desktop-widget.cpp revision 5c5c56db03b12d3639ba5bf4148bed717d745621
/** \file
* Desktop widget implementation
*/
/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* MenTaLguY <mental@rydia.net>
* bulia byak <buliabyak@users.sf.net>
* Ralf Stephan <ralf@ark.in-berlin.de>
* John Bintz <jcoswell@coswellproductions.org>
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
* Jon A. Cruz <jon@joncruz.org>
* Abhishek Sharma
*
* Copyright (C) 2007 Johan Engelen
* Copyright (C) 2006 John Bintz
* Copyright (C) 2004 MenTaLguY
* Copyright (C) 1999-2002 Lauris Kaplinski
* Copyright (C) 2000-2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "ui/dialog/dialog-manager.h"
#include "box3d-context.h"
#include "cms-system.h"
#include "conn-avoid-ref.h"
#include "desktop.h"
#include "desktop-events.h"
#include "desktop-handles.h"
#include "desktop-widget.h"
#include "display/sp-canvas.h"
#include "display/canvas-arena.h"
#include "document.h"
#include "ege-color-prof-tracker.h"
#include "ege-select-one-action.h"
#include "file.h"
#include "helper/unit-tracker.h"
#include "inkscape-private.h"
#include "interface.h"
#include "macros.h"
#include "preferences.h"
#include "sp-image.h"
#include "sp-item.h"
#include "sp-namedview.h"
#include "ui/dialog/swatches.h"
#include "ui/icon-names.h"
#include "ui/widget/layer-selector.h"
#include "ui/widget/selected-style.h"
#include "ui/uxmanager.h"
#include "util/ege-appear-time-tracker.h"
#include "sp-root.h"
// We're in the "widgets" directory, so no need to explicitly prefix these:
#include "button.h"
#include "ruler.h"
#include "spinbutton-events.h"
#include "spw-utilities.h"
#include "toolbox.h"
#include "widget-sizes.h"
#include "verbs.h"
#include "round.h"
#endif
using Inkscape::UnitTracker;
using ege::AppearTimeTracker;
#ifdef WITH_INKBOARD
#endif
enum {
};
//---------------------------------------------------------------------
/* SPDesktopWidget */
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
class CMSPrefWatcher {
public:
CMSPrefWatcher() :
_dpw(*this),
_spw(*this),
{
}
virtual ~CMSPrefWatcher() {}
//virtual void notify(PrefValue &);
}
}
private:
public:
_pw._refreshAll();
}
private:
};
public:
_pw._refreshAll();
}
private:
};
void _refreshAll();
void _setCmsSensitive(bool value);
friend class DisplayProfileWatcher;
friend class SoftproofWatcher;
};
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void CMSPrefWatcher::hook(EgeColorProfTracker * /*tracker*/, gint screen, gint monitor, CMSPrefWatcher * /*watcher*/)
{
unsigned char* buf = 0;
}
#else
void CMSPrefWatcher::hook(EgeColorProfTracker * /*tracker*/, gint /*screen*/, gint /*monitor*/, CMSPrefWatcher * /*watcher*/)
{
}
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/// @todo Use conditional compilation in saner places. The whole PrefWatcher
/// object is unnecessary if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) is not defined.
void CMSPrefWatcher::_refreshAll()
{
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
for ( std::list<SPDesktopWidget*>::iterator it = _widget_list.begin(); it != _widget_list.end(); ++it ) {
(*it)->requestCanvasUpdate();
}
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
}
{
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
for ( std::list<SPDesktopWidget*>::iterator it = _widget_list.begin(); it != _widget_list.end(); ++it ) {
}
}
#else
(void) enabled;
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
}
void
{
// make sure the important messages are displayed immediately!
}
}
{
gint x,y;
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
}
static GTimer *overallTimer = 0;
/**
* Registers SPDesktopWidget class and returns its type number.
*/
{
if (!type) {
sizeof(SPDesktopWidgetClass),
0, // base_init
0, // base_finalize
0, // class_finalize
0, // class_data
sizeof(SPDesktopWidget),
0, // n_preallocs
0 // value_table
};
type = g_type_register_static(SP_TYPE_VIEW_WIDGET, "SPDesktopWidget", &info, static_cast<GTypeFlags>(0));
// Begin a timer to watch for the first desktop to appear on-screen
overallTimer = g_timer_new();
}
return type;
}
/**
* SPDesktopWidget vtable initialization
*/
static void
{
}
/**
* Callback for SPDesktopWidget object initialization.
*/
{
/* Main table */
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
//gtk_widget_set_usize (dtw->statusbar, -1, BOTTOM_BAR_HEIGHT);
{
}
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
/* Horizontal ruler */
eventbox = gtk_event_box_new ();
gtk_widget_set_tooltip_text (dtw->hruler_box, gettext(sp_unit_get_plural (&sp_unit_get_by_id(SP_UNIT_PT))));
gtk_table_attach (GTK_TABLE (canvas_tbl), eventbox, 1, 2, 0, 1, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL),
g_signal_connect (G_OBJECT (eventbox), "button_release_event", G_CALLBACK (sp_dt_hruler_event), dtw);
g_signal_connect (G_OBJECT (eventbox), "motion_notify_event", G_CALLBACK (sp_dt_hruler_event), dtw);
/* Vertical ruler */
eventbox = gtk_event_box_new ();
gtk_widget_set_tooltip_text (dtw->vruler_box, gettext(sp_unit_get_plural (&sp_unit_get_by_id(SP_UNIT_PT))));
gtk_table_attach (GTK_TABLE (canvas_tbl), eventbox, 0, 1, 1, 2, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0,
g_signal_connect (G_OBJECT (eventbox), "button_release_event", G_CALLBACK (sp_dt_vruler_event), dtw);
g_signal_connect (G_OBJECT (eventbox), "motion_notify_event", G_CALLBACK (sp_dt_vruler_event), dtw);
/* Horizontal scrollbar */
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
gtk_table_attach (GTK_TABLE (canvas_tbl), dtw->hscrollbar, 1, 2, 2, 3, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_SHRINK), 0, 0);
/* Vertical scrollbar and the sticky zoom button */
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
NULL,
INKSCAPE_ICON("zoom-original"),
_("Zoom drawing if window size changes"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dtw->sticky_zoom), prefs->getBool("/options/stickyzoom/value"));
g_signal_connect (G_OBJECT (dtw->sticky_zoom), "toggled", G_CALLBACK (sp_dtw_sticky_zoom_toggled), dtw);
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
gtk_table_attach (GTK_TABLE (canvas_tbl), dtw->vscrollbar_box, 2, 3, 0, 2, (GtkAttachOptions)(GTK_SHRINK), (GtkAttachOptions)(GTK_FILL), 0, 0);
if ( verb ) {
}
}
NULL,
INKSCAPE_ICON("color-management"),
tip );
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
{
if ( enabled ) {
if ( active ) {
}
}
}
g_signal_connect_after( G_OBJECT(dtw->cms_adjust), "clicked", G_CALLBACK(cms_adjust_toggled), dtw );
#else
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
gtk_table_attach( GTK_TABLE(canvas_tbl), dtw->cms_adjust, 2, 3, 2, 3, (GtkAttachOptions)(GTK_SHRINK), (GtkAttachOptions)(GTK_SHRINK), 0, 0);
{
if (!watcher) {
watcher = new CMSPrefWatcher();
}
}
/* Canvas */
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
#if GTK_CHECK_VERSION(3,0,0)
&white);
#else
#endif
// TODO: Extension event stuff has been removed from public API in GTK+ 3
// Need to check that this hasn't broken anything
#if !GTK_CHECK_VERSION(3,0,0)
gtk_widget_set_extension_events(GTK_WIDGET (dtw->canvas) , GDK_EXTENSION_EVENTS_ALL); //set extension events for tablets, unless disabled in preferences
#endif
gtk_table_attach (GTK_TABLE (canvas_tbl), GTK_WIDGET(dtw->canvas), 1, 2, 1, 2, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), 0, 0);
/* Dock */
bool create_dock =
if (create_dock) {
/* Prevent the paned from catching F6 and F8 by unsetting the default callbacks */
}
gtk_table_attach (GTK_TABLE (tbl), GTK_WIDGET (paned->gobj()), 1, 2, 1, 2, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
} else {
gtk_table_attach (GTK_TABLE (tbl), GTK_WIDGET (canvas_tbl), 1, 2, 1, 2, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
}
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
// connect scrollbar signals
g_signal_connect (G_OBJECT (dtw->hadj), "value-changed", G_CALLBACK (sp_desktop_widget_adjustment_value_changed), dtw);
g_signal_connect (G_OBJECT (dtw->vadj), "value-changed", G_CALLBACK (sp_desktop_widget_adjustment_value_changed), dtw);
// zoom status spinbutton
dtw->zoom_status = gtk_spin_button_new_with_range (log(SP_DESKTOP_ZOOM_MIN)/log(2), log(SP_DESKTOP_ZOOM_MAX)/log(2), 0.1);
g_signal_connect (G_OBJECT (dtw->zoom_status), "focus-in-event", G_CALLBACK (spinbutton_focus_in), dtw->zoom_status);
g_signal_connect (G_OBJECT (dtw->zoom_status), "key-press-event", G_CALLBACK (spinbutton_keypress), dtw->zoom_status);
dtw->zoom_update = g_signal_connect (G_OBJECT (dtw->zoom_status), "value_changed", G_CALLBACK (sp_dtw_zoom_value_changed), dtw);
dtw->zoom_update = g_signal_connect (G_OBJECT (dtw->zoom_status), "populate_popup", G_CALLBACK (sp_dtw_zoom_populate_popup), dtw);
// cursor coordinates
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
eventbox = gtk_event_box_new ();
gtk_table_attach(GTK_TABLE(dtw->coord_status), dtw->coord_status_x, 2,3, 0,1, GTK_FILL, GTK_FILL, 0, 0);
gtk_table_attach(GTK_TABLE(dtw->coord_status), dtw->coord_status_y, 2,3, 1,2, GTK_FILL, GTK_FILL, 0, 0);
gtk_table_attach(GTK_TABLE(dtw->coord_status), gtk_label_new(_("Z:")), 3,4, 0,2, GTK_FILL, GTK_FILL, 0, 0);
gtk_table_attach(GTK_TABLE(dtw->coord_status), dtw->zoom_status, 4,5, 0,2, GTK_FILL, GTK_FILL, 0, 0);
// FIXME: need to unreference on container destruction to avoid leak
//dtw->layer_selector->set_size_request(-1, SP_ICON_SIZE_BUTTON);
gtk_box_pack_start(GTK_BOX(dtw->statusbar), GTK_WIDGET(dtw->layer_selector->gobj()), FALSE, FALSE, 1);
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
if ( fromDisplay ) {
bool enabled = false;
}
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
g_signal_connect( G_OBJECT(dtw->_tracker), "changed", G_CALLBACK(sp_dtw_color_profile_event), dtw );
// display the initial welcome message in the statusbar
gtk_label_set_markup (GTK_LABEL (dtw->select_status), _("<b>Welcome to Inkscape!</b> Use shape or freehand tools to create objects; use selector (arrow) to move or transform them."));
// space label 2 pixels from left edge
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
// If this is the first desktop created, report the time it takes to show up
if ( overallTimer ) {
// Time tracker takes ownership of the timer.
AppearTimeTracker *tracker = new AppearTimeTracker(overallTimer, GTK_WIDGET(dtw), "first SPDesktopWidget");
tracker->setAutodelete(true);
} else {
}
overallTimer = 0;
}
}
/**
* Called before SPDesktopWidget destruction.
*/
{
if ( watcher ) {
}
g_signal_handlers_disconnect_by_func(G_OBJECT (dtw->zoom_status), (gpointer) G_CALLBACK(sp_dtw_zoom_input), dtw);
g_signal_handlers_disconnect_by_func(G_OBJECT (dtw->zoom_status), (gpointer) G_CALLBACK(sp_dtw_zoom_output), dtw);
g_signal_handlers_disconnect_matched (G_OBJECT (dtw->zoom_status), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, dtw->zoom_status);
g_signal_handlers_disconnect_by_func (G_OBJECT (dtw->zoom_status), (gpointer) G_CALLBACK (sp_dtw_zoom_value_changed), dtw);
g_signal_handlers_disconnect_by_func (G_OBJECT (dtw->zoom_status), (gpointer) G_CALLBACK (sp_dtw_zoom_populate_popup), dtw);
g_signal_handlers_disconnect_by_func (G_OBJECT (dtw->canvas), (gpointer) G_CALLBACK (sp_desktop_widget_event), dtw);
}
}
}
/**
* Set the title in the desktop-window (if desktop has an own window).
*
* The title has form file name: desktop number - Inkscape.
* The desktop number is only shown if it's 2 or higher,
*/
void
{
if (window) {
if (doc->isModifiedSinceSave()) {
modifiedname = "*";
}
}
g_string_printf (name, _("%s%s: %d (outline%s) - Inkscape"), modifiedname, fname, this->desktop->number, colormodenamecomma);
g_string_printf (name, _("%s%s: %d (no filters%s) - Inkscape"), modifiedname, fname, this->desktop->number, colormodenamecomma);
} else {
g_string_printf (name, _("%s%s: %d %s- Inkscape"), modifiedname, fname, this->desktop->number, colormodename);
}
} else {
g_string_printf (name, _("%s%s (no filters%s) - Inkscape"), modifiedname, fname, colormodenamecomma);
} else {
}
}
}
}
{
return dock;
}
/**
* Callback to allocate space for desktop widget.
*/
static void
{
if ((allocation->x == widg_allocation.x) &&
(allocation->y == widg_allocation.y) &&
return;
}
if (gtk_widget_get_realized (widget)) {
}
/* Find new visible area */
/* Calculate adjusted zoom */
}
// TODO - Should call show_dialogs() from sp_namedview_window_from_document only.
// But delaying the call to here solves dock sizing issues on OS X, (see #171579)
} else {
}
// this->size_allocate (widget, allocation);
}
}
/**
* Callback to realize desktop widget.
*/
static void
{
dtw->updateNamedview();
}
/* This is just to provide access to common functionality from sp_desktop_widget_realize() above
as well as from SPDesktop::change_document() */
void SPDesktopWidget::updateNamedview()
{
// Listen on namedview modification
// originally (prior to the sigc++ conversion) the signal was simply
// connected twice rather than disconnecting the first connection
modified_connection = desktop->namedview->connectModified(sigc::mem_fun(*this, &SPDesktopWidget::namedviewModified));
}
/**
* Callback to handle desktop widget event.
*/
static gint
{
// defocus any spinbuttons
}
} else {
}
}
} else {
// The keypress events need to be passed to desktop handler explicitly,
// because otherwise the event contexts only receive keypresses when the mouse cursor
// is over the canvas. This redirection is only done for keypresses and only if there's no
// current item on the canvas, because item events and all mouse events are caught
// and passed on by the canvas acetate (I think). --bb
}
}
return FALSE;
}
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
{
// Handle profile changes
bool enabled = false;
}
#else
{
}
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
{
if (down) {
dtw->setMessage (Inkscape::NORMAL_MESSAGE, _("Color-managed display is <b>enabled</b> in this window"));
} else {
dtw->setMessage (Inkscape::NORMAL_MESSAGE, _("Color-managed display is <b>disabled</b> in this window"));
}
}
}
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
{
if ( verb ) {
if ( act ) {
}
}
}
void
{
/* update active desktop indicator */
}
void
{
/* update inactive desktop indicator */
}
/**
* Shuts down the desktop object for the view being closed. It checks
* to see if the document has been edited, and if so prompts the user
* to save, discard, or cancel. Returns TRUE if the shutdown operation
* is cancelled or if the save is cancelled or fails, FALSE otherwise.
*/
bool
{
if (doc->isModifiedSinceSave()) {
/** \todo
* FIXME !!! obviously this will have problems if the document
* name contains markup characters
*/
_("<span weight=\"bold\" size=\"larger\">Save changes to document \"%s\" before closing?</span>\n\n"
"If you close without saving, your changes will be discarded."),
// fix for bug lp:168809
switch (response) {
case GTK_RESPONSE_YES:
{
} else { // save dialog cancelled or save failed
return TRUE;
}
break;
}
case GTK_RESPONSE_NO:
break;
default: // cancel pressed, or dialog was closed
return TRUE;
break;
}
}
/* Code to check data loss */
bool allow_data_loss = FALSE;
/** \todo
* FIXME !!! obviously this will have problems if the document
* name contains markup characters
*/
_("<span weight=\"bold\" size=\"larger\">The file \"%s\" was saved with a format that may cause data loss!</span>\n\n"
"Do you want to save this file as Inkscape SVG?"),
// fix for bug lp:168809
switch (response) {
case GTK_RESPONSE_YES:
{
} else { // save dialog cancelled or save failed
return TRUE;
}
break;
}
case GTK_RESPONSE_NO:
break;
default: // cancel pressed, or dialog was closed
return TRUE;
break;
}
}
}
/* Save window geometry to prefs for use as a default.
* Use depends on setting of "options.savewindowgeometry".
* But we save the info here regardless of the setting.
*/
{
gint w, h, x, y;
desktop->getWindowGeometry(x, y, w, h);
// Don't save geom for maximized windows. It
// just tells you the current maximized size, which is not
// as useful as whatever value it had previously.
}
}
return FALSE;
}
/**
* \pre this->desktop->main != 0
*/
void
}
void
while (gtk_events_pending())
}
void
{
if (_interaction_disabled_counter == 0) {
}
}
void
{
if (_interaction_disabled_counter == 0) {
}
}
void
{
}
void
{
if (zoom_status)
}
void
{
(void)vis; // TODO figure out why it is here but not used.
if (window)
{
window->get_position (x, y);
}
}
void
{
if (window)
{
}
}
void
{
if (window)
{
window->set_default_size (w, h);
}
}
/**
* \note transientizing does not work on windows; when you minimize a document
* and then open it back, only its transient emerges and you cannot access
* the document window. The document window must be restored by rightclicking
* the taskbar button and pressing "Restore"
*/
void
{
if (window)
{
gtk_window_set_transient_for (GTK_WINDOW(p), w);
/*
* This enables "aggressive" transientization,
* i.e. dialogs always emerging on top when you switch documents. Note
* however that this breaks "click to raise" policy of a window
* manager because the switched-to document will be raised at once
* (so that its transients also could raise)
*/
if (transient_policy == 2)
// without this, a transient window not always emerges on top
gtk_window_present (w);
}
}
void
{
if (w)
gtk_window_present (w);
}
{
bool result = false;
if (window)
{
gtk_window_set_title( GTK_WINDOW(dialog), _("Note:")); // probably want to take this as a parameter.
}
return result;
}
bool
{
if (w)
{
w,
"%s", text);
if (response == GTK_RESPONSE_YES)
return true;
}
return false;
}
void
{
if (GTK_IS_WINDOW(topw)) {
} else {
}
}
}
void
{
if (GTK_IS_WINDOW(topw)) {
} else {
// Save geometry to prefs before maximizing so that
// something useful is stored there, because GTK doesn't maintain
// a separate non-maximized size.
{
gint w, h, x, y;
dtw->getWindowGeometry(x, y, w, h);
}
}
}
}
void
{
#ifdef HAVE_GTK_WINDOW_FULLSCREEN
if (GTK_IS_WINDOW(topw)) {
// widget layout is triggered by the resulting window_state_event
} else {
// Save geometry to prefs before maximizing so that
// something useful is stored there, because GTK doesn't maintain
// a separate non-maximized size.
{
gint w, h, x, y;
dtw->getWindowGeometry(x, y, w, h);
}
// widget layout is triggered by the resulting window_state_event
}
}
#endif /* HAVE_GTK_WINDOW_FULLSCREEN */
}
/**
* Hide whatever the user does not want to see in the window
*/
void SPDesktopWidget::layoutWidgets()
{
SPDesktopWidget *dtw = this;
pref_root = "/focus/";
pref_root = "/fullscreen/";
} else {
pref_root = "/window/";
}
} else {
}
} else {
}
} else {
}
} else {
// we cannot just show_all because that will show all tools' panels;
// this is a function from toolbox.cpp that shows only the current tool's panel
}
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
}
void
{
{
}
}
void
{
GtkAdjustment *a = NULL;
if (GTK_IS_SPIN_BUTTON(hb))
else if (GTK_IS_RANGE(hb))
}
if (a)
else
}
void
{
if (hb) {
}
}
bool
{
bool isActive = false;
if ( !thing ) {
//g_message( "Unable to locate item for {%s}", id );
} else if ( GTK_IS_TOGGLE_BUTTON(thing) ) {
isActive = gtk_toggle_button_get_active( b ) != 0;
} else if ( GTK_IS_TOGGLE_ACTION(thing) ) {
} else {
//g_message( "Item for {%s} is of an unsupported type", id );
}
return isActive;
}
{
// Note - later on these won't be individual member variables.
if (id == "ToolToolbar") {
} else if (id == "AuxToolbar") {
} else if (id == "CommandsToolbar") {
} else if (id == "SnapToolbar") {
}
if (toolbox) {
switch(pos) {
case GTK_POS_TOP:
case GTK_POS_BOTTOM:
}
break;
case GTK_POS_LEFT:
case GTK_POS_RIGHT:
if (pos == GTK_POS_LEFT) {
}
}
break;
}
}
}
{
return SP_VIEW_WIDGET(dtw);
}
{
// Add the shape geometry to libavoid for autorouting connectors.
// This needs desktop set for its spacing preferences.
/* Once desktop is set, we can update rulers */
/* Listen on namedview modification */
dtw->modified_connection = namedview->connectModified(sigc::mem_fun(*dtw, &SPDesktopWidget::namedviewModified));
dtw->layoutWidgets();
return dtw;
}
void
{
}
void
{
}
void
{
/* The viewbox (in integers) must exactly match the size of SPCanvasbuf's pixel buffer.
* This is important because the former is being used for drawing the ruler, whereas
* the latter is used for drawing e.g. the grids and guides. Only when the viewbox
* coincides with the pixel buffer, everything will line up nicely.
*/
}
void
{
/* The viewbox (in integers) must exactly match the size of SPCanvasbuf's pixel buffer.
* This is important because the former is being used for drawing the ruler, whereas
* the latter is used for drawing e.g. the grids and guides. Only when the viewbox
* coincides with the pixel buffer, everything will line up nicely.
*/
}
{
if (flags & SP_OBJECT_MODIFIED_FLAG) {
/* This loops through all the grandchildren of aux toolbox,
* and for each that it finds, it performs an sp_search_by_data_recursive(),
* looking for widgets that hold some "tracker" data (this is used by
* all toolboxes to refer to the unit selector). The default document units
* is then selected within these unit selectors.
*
* Of course it would be nice to be able to refer to the toolbox and the
* unit selector directly by name, but I don't yet see a way to do that.
*
* This should solve: https://bugs.launchpad.net/inkscape/+bug/362995
*/
if (GTK_IS_CONTAINER(aux_toolbox)) {
if (GTK_IS_CONTAINER(i->data)) {
continue;
if (t == NULL) // didn't find any tracker data
continue;
continue;
} // grandchildren
} // if child is a container
} // children
} // if aux_toolbox is a container
}
}
static void
{
return;
/* update perspective lines if we are in the 3D box tool (so that infinite ones are shown correctly) */
}
/* we make the desktop window with focus active, signal is connected in interface.c */
{
}
}
return false;
}
static gdouble
{
}
static gdouble
{
}
static gint
{
if (sp_dtw_zoom_value_to_display (new_scrolled) == new_typed) { // the new value is set by scrolling
*new_val = new_scrolled;
} else { // the new value is typed in
}
return TRUE;
}
static bool
{
gchar b[64];
if (val < 10) {
} else {
}
return TRUE;
}
static void
{
}
static void
{
}
}
static void
{
}
static void
{
}
static void
{
}
static void
{
}
static void
{
}
static void
{
}
static void
{
}
static void
{
}
void
{
g_signal_handlers_block_by_func (G_OBJECT (dtw->zoom_status), (gpointer)G_CALLBACK (sp_dtw_zoom_value_changed), dtw);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (dtw->zoom_status), log(dtw->desktop->current_zoom()) / log(2));
if (window)
g_signal_handlers_unblock_by_func (G_OBJECT (dtw->zoom_status), (gpointer)G_CALLBACK (sp_dtw_zoom_value_changed), dtw);
}
void
{
prefs->setBool(dtw->desktop->is_fullscreen() ? "/fullscreen/rulers/state" : "/window/rulers/state", false);
} else {
prefs->setBool(dtw->desktop->is_fullscreen() ? "/fullscreen/rulers/state" : "/window/rulers/state", true);
}
}
void
{
prefs->setBool(dtw->desktop->is_fullscreen() ? "/fullscreen/scrollbars/state" : "/window/scrollbars/state", false);
} else {
prefs->setBool(dtw->desktop->is_fullscreen() ? "/fullscreen/scrollbars/state" : "/window/scrollbars/state", true);
}
}
{
}
{
} else {
}
}
}
/* Unused
void
sp_spw_toggle_menubar (SPDesktopWidget *dtw, bool is_fullscreen)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
if (gtk_widget_get_visible (dtw->menubar)) {
gtk_widget_hide (dtw->menubar);
} else {
gtk_widget_show_all (dtw->menubar);
}
}
*/
static void
{
if ((l != gtk_adjustment_get_lower(adj)) ||
(u != gtk_adjustment_get_upper(adj)) ||
}
}
void
{
if (!dtw) return;
/* The desktop region we always show unconditionally */
} else {
}
/* Canvas region we always show unconditionally */
Geom::Rect carea( Geom::Point(deskarea->min()[Geom::X] * scale - 64, deskarea->max()[Geom::Y] * -scale - 64),
/* Viewbox is always included into scrollable region */
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :