From: joncruz Date: Mon, 26 Nov 2007 20:54:55 +0000 (+0000) Subject: Menu item to toggle CMS adjustment on and off X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=adf2a834bc87a6a22f3a99e8efb42a54dbfbb788;p=inkscape.git Menu item to toggle CMS adjustment on and off --- diff --git a/src/desktop.cpp b/src/desktop.cpp index f12d0ffd7..7cc77cbab 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -387,7 +387,7 @@ void SPDesktop::displayModeToggle() { if (displayMode == RENDERMODE_OUTLINE) setDisplayModeNormal(); - else + else setDisplayModeOutline(); } @@ -409,7 +409,7 @@ SPObject *SPDesktop::currentLayer() const /** * Sets the current layer of the desktop. - * + * * Make \a object the top layer. */ void SPDesktop::setCurrentLayer(SPObject *object) { @@ -1109,7 +1109,7 @@ SPDesktop::onWindowStateEvent (GdkEventWindowState* event) if (changed & (GDK_WINDOW_STATE_FULLSCREEN|GDK_WINDOW_STATE_MAXIMIZED)) { layoutWidget(); } - + return false; } @@ -1182,6 +1182,11 @@ void SPDesktop::clearWaitingCursor() sp_event_context_update_cursor(sp_desktop_event_context(this)); } +void SPDesktop::toggleColorProfAdjust() +{ + _widget->toggleColorProfAdjust(); +} + void SPDesktop::toggleGrids() { if (namedview->grids) { @@ -1491,7 +1496,7 @@ _namedview_modified (SPObject *obj, guint flags, SPDesktop *desktop) ((CtrlRect *) desktop->page)->setShadow(0, 0x00000000); } } - + /* Show/hide page shadow */ if (nv->showpageshadow && nv->pageshadow) { ((CtrlRect *) desktop->page_border)->setShadow(nv->pageshadow, nv->bordercolor); @@ -1528,7 +1533,7 @@ _update_snap_distances (SPDesktop *desktop) *nv.gridtoleranceunit, px)); } - + nv.snap_manager.guide.setDistance(sp_convert_distance_full(nv.guidetolerance, *nv.guidetoleranceunit, px)); diff --git a/src/desktop.h b/src/desktop.h index fa8b4f84e..4c9d1ece8 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -1,5 +1,5 @@ -#ifndef __SP_DESKTOP_H__ -#define __SP_DESKTOP_H__ +#ifndef SEEN_SP_DESKTOP_H +#define SEEN_SP_DESKTOP_H /** \file * SPDesktop: an editable view. @@ -59,16 +59,16 @@ typedef int sp_verb_t; -namespace Inkscape { +namespace Inkscape { class Application; class MessageContext; - class Selection; + class Selection; class ObjectHierarchy; class LayerManager; class EventLog; - namespace UI { - namespace Dialog { - class DialogManager; + namespace UI { + namespace Dialog { + class DialogManager; } } namespace Whiteboard { @@ -115,13 +115,13 @@ struct SPDesktop : public Inkscape::UI::View::View /// \todo fixme: This has to be implemented in different way */ guint guides_active : 1; - // storage for selected dragger used by GrDrag as it's + // storage for selected dragger used by GrDrag as it's // created and deleted by tools SPItem *gr_item; guint gr_point_type; guint gr_point_i; - bool gr_fill_or_stroke; - + bool gr_fill_or_stroke; + Inkscape::ObjectHierarchy *_layer_hierarchy; gchar * _reconstruction_old_layer_id; @@ -134,45 +134,45 @@ struct SPDesktop : public Inkscape::UI::View::View { return _document_replaced_signal.connect (slot); } - - sigc::connection connectEventContextChanged (const sigc::slot & slot) + + sigc::connection connectEventContextChanged (const sigc::slot & slot) { return _event_context_changed_signal.connect (slot); } - sigc::connection connectSetStyle (const sigc::slot & slot) + sigc::connection connectSetStyle (const sigc::slot & slot) { - return _set_style_signal.connect (slot); + return _set_style_signal.connect (slot); } - sigc::connection connectQueryStyle (const sigc::slot & slot) + sigc::connection connectQueryStyle (const sigc::slot & slot) { - return _query_style_signal.connect (slot); + return _query_style_signal.connect (slot); } // subselection is some sort of selection which is specific to the tool, such as a handle in gradient tool, or a text selection sigc::connection connectToolSubselectionChanged(const sigc::slot & slot) { - return _tool_subselection_changed.connect(slot); + return _tool_subselection_changed.connect(slot); } - void emitToolSubselectionChanged(gpointer data); + void emitToolSubselectionChanged(gpointer data); sigc::connection connectCurrentLayerChanged(const sigc::slot & slot) { - return _layer_changed_signal.connect(slot); + return _layer_changed_signal.connect(slot); } - - // Whiteboard changes + + // Whiteboard changes #ifdef WITH_INKBOARD - Inkscape::Whiteboard::SessionManager* whiteboard_session_manager() { - return _whiteboard_session_manager; - } + Inkscape::Whiteboard::SessionManager* whiteboard_session_manager() { + return _whiteboard_session_manager; + } - Inkscape::Whiteboard::SessionManager* _whiteboard_session_manager; + Inkscape::Whiteboard::SessionManager* _whiteboard_session_manager; #endif - + SPDesktop(); void init (SPNamedView* nv, SPCanvas* canvas); virtual ~SPDesktop(); void destroy(); Inkscape::MessageContext *guidesMessageContext() const { - return _guides_message_context; + return _guides_message_context; } void setDisplayModeNormal(); @@ -191,7 +191,7 @@ struct SPDesktop : public Inkscape::UI::View::View bool isLayer(SPObject *object) const; bool isWithinViewport(SPItem *item) const; bool itemIsHidden(SPItem const *item) const; - + void activate_guides (bool activate); void change_document (SPDocument *document); @@ -253,13 +253,15 @@ struct SPDesktop : public Inkscape::UI::View::View bool isToolboxButtonActive (gchar const *id); void updateNow(); void updateCanvasNow(); - + void enableInteraction(); void disableInteraction(); void setWaitingCursor(); void clearWaitingCursor(); - + + void toggleColorProfAdjust(); + void toggleGrids(); bool gridsEnabled() { return grids_visible; } void showGrids(bool show, bool dirty_document = true); @@ -331,7 +333,7 @@ private: static void _onSelectionModified (Inkscape::Selection *selection, guint flags, SPDesktop *dt); }; -#endif +#endif // SEEN_SP_DESKTOP_H /* Local Variables: diff --git a/src/helper/window.cpp b/src/helper/window.cpp index 6f898ee3e..b814424e5 100644 --- a/src/helper/window.cpp +++ b/src/helper/window.cpp @@ -41,14 +41,14 @@ Inkscape::UI::window_new (const gchar *title, unsigned int resizeable) window->set_title (title); window->set_resizable (resizeable); window->signal_key_press_event().connect(sigc::ptr_fun(&on_window_key_press)); - + return window; } static gboolean -sp_window_key_press (GtkWidget *widget, GdkEventKey *event) +sp_window_key_press(GtkWidget */*widget*/, GdkEventKey *event) { - return on_window_key_press(event); + return on_window_key_press(event); } GtkWidget * diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h index 1b7939194..7bff62c29 100644 --- a/src/menus-skeleton.h +++ b/src/menus-skeleton.h @@ -118,6 +118,7 @@ static char const menus_skeleton[] = " \n" " \n" " \n" +" \n" " \n" " \n" " \n" diff --git a/src/ui/view/edit-widget-interface.h b/src/ui/view/edit-widget-interface.h index c8219b7b2..f148bb715 100644 --- a/src/ui/view/edit-widget-interface.h +++ b/src/ui/view/edit-widget-interface.h @@ -4,7 +4,7 @@ * Abstract base class for all EditWidget implementations. * * Authors: - * Ralf Stephan + * Ralf Stephan * John Bintz * * Copyright (C) 2006 John Bintz @@ -33,107 +33,110 @@ struct EditWidgetInterface /// Returns pointer to window UI object as void* virtual Gtk::Window *getWindow() = 0; - + /// Set the widget's title virtual void setTitle (gchar const*) = 0; - + /// Show all parts of widget the user wants to see. virtual void layout() = 0; - + /// Present widget to user virtual void present() = 0; - + /// Returns geometry of widget virtual void getGeometry (gint &x, gint &y, gint &w, gint &h) = 0; - + /// Change the widget's size virtual void setSize (gint w, gint h) = 0; - + /// Move widget to specified position virtual void setPosition (NR::Point p) = 0; - + /// Transientize widget virtual void setTransient (void*, int) = 0; - + /// Return mouse position in widget virtual NR::Point getPointer() = 0; - + /// Make widget iconified virtual void setIconified() = 0; - + /// Make widget maximized on screen virtual void setMaximized() = 0; - + /// Make widget fill screen and show it if possible. virtual void setFullscreen() = 0; - + /// 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. virtual bool shutdown() = 0; - + /// Destroy and delete widget. virtual void destroy() = 0; - - + + /// Queue a redraw request with the canvas virtual void requestCanvasUpdate() = 0; - + /// Force a redraw of the canvas virtual void requestCanvasUpdateAndWait() = 0; - + /// Enable interaction on this desktop virtual void enableInteraction() = 0; - + /// Disable interaction on this desktop virtual void disableInteraction() = 0; - + /// Update the "active desktop" indicator virtual void activateDesktop() = 0; - + /// Update the "inactive desktop" indicator virtual void deactivateDesktop() = 0; - + /// Set rulers to position virtual void viewSetPosition (NR::Point p) = 0; - + /// Update rulers from current values virtual void updateRulers() = 0; - + /// Update scrollbars from current values virtual void updateScrollbars (double scale) = 0; - + /// Toggle rulers on/off and set preference value accordingly virtual void toggleRulers() = 0; - + /// Toggle scrollbars on/off and set preference value accordingly virtual void toggleScrollbars() = 0; - + + /// Toggle CMS on/off and set preference value accordingly + virtual void toggleColorProfAdjust() = 0; + /// Temporarily block signals and update zoom display virtual void updateZoom() = 0; - + /// The zoom display will get the keyboard focus. virtual void letZoomGrabFocus() = 0; - + /// In auxiliary toolbox, set focus to widget having specific id virtual void setToolboxFocusTo (const gchar *) = 0; - + /// In auxiliary toolbox, set value of adjustment with specific id virtual void setToolboxAdjustmentValue (const gchar *, double) = 0; /// In auxiliary toolbox, select one of the "select one" options (usually radio toggles) virtual void setToolboxSelectOneValue (const gchar *, gint) = 0; - + /// In auxiliary toolbox, return true if specific togglebutton is active virtual bool isToolboxButtonActive (gchar const*) = 0; - + /// Set the coordinate display virtual void setCoordinateStatus (NR::Point p) = 0; - + /// Message widget will get no content virtual void setMessage (Inkscape::MessageType type, gchar const* msg) = 0; - + /// Open yes/no dialog with warning text and confirmation question. virtual bool warnDialog (gchar*) = 0; diff --git a/src/ui/view/edit-widget.cpp b/src/ui/view/edit-widget.cpp index f99658f97..7bf4fc752 100644 --- a/src/ui/view/edit-widget.cpp +++ b/src/ui/view/edit-widget.cpp @@ -1465,6 +1465,11 @@ EditWidget::toggleScrollbars() } } +void EditWidget::toggleColorProfAdjust() +{ + // TODO implement +} + void EditWidget::updateZoom() { diff --git a/src/ui/view/edit-widget.h b/src/ui/view/edit-widget.h index 4341f667c..e665b2fae 100644 --- a/src/ui/view/edit-widget.h +++ b/src/ui/view/edit-widget.h @@ -43,7 +43,7 @@ namespace Inkscape { namespace UI { namespace View { -class EditWidget : public Gtk::Window, +class EditWidget : public Gtk::Window, public EditWidgetInterface { public: EditWidget (SPDocument*); @@ -86,13 +86,13 @@ public: void onDialogTrace(); void onDialogXmlEditor(); - // Whiteboard (Inkboard) + // Whiteboard (Inkboard) #ifdef WITH_INKBOARD - void onDialogWhiteboardConnect(); - void onDialogWhiteboardShareWithUser(); - void onDialogWhiteboardShareWithChat(); - void onDialogOpenSessionFile(); - void onDumpXMLTracker(); + void onDialogWhiteboardConnect(); + void onDialogWhiteboardShareWithUser(); + void onDialogWhiteboardShareWithChat(); + void onDialogOpenSessionFile(); + void onDumpXMLTracker(); #endif void onUriChanged(); @@ -123,6 +123,7 @@ public: virtual void updateScrollbars (double scale); virtual void toggleRulers(); virtual void toggleScrollbars(); + virtual void toggleColorProfAdjust(); virtual void updateZoom(); virtual void letZoomGrabFocus(); virtual void setToolboxFocusTo (const gchar *); @@ -139,7 +140,7 @@ protected: void _namedview_modified(SPObject *namedview, guint); Gtk::Tooltips _tooltips; - + // Child widgets: Gtk::Table _main_window_table; Gtk::VBox _toolbars_vbox; @@ -168,7 +169,7 @@ protected: Gtk::Table _coord_status; Gtk::Label _coord_status_x, _coord_status_y; Gtk::Label _select_status; - + SPDesktop* _desktop; SPNamedView* _namedview; double _dt2r; diff --git a/src/verbs.cpp b/src/verbs.cpp index a1947fb97..ea4ffd71b 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1630,6 +1630,9 @@ ZoomVerb::perform(SPAction *action, void *data, void */*pdata*/) case SP_VERB_VIEW_MODE_TOGGLE: dt->displayModeToggle(); break; + case SP_VERB_VIEW_CMS_TOGGLE: + dt->toggleColorProfAdjust(); + break; case SP_VERB_VIEW_ICON_PREVIEW: inkscape_dialogs_unhide(); dt->_dlg_mgr->showDialog("IconPreviewPanel"); @@ -2458,6 +2461,9 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_VIEW_MODE_TOGGLE, "ViewModeToggle", N_("_Toggle"), N_("Toggle between normal and outline display modes"), NULL), + new ZoomVerb(SP_VERB_VIEW_CMS_TOGGLE, "ViewCmsToggle", N_("Display Adjustment"), + N_("Toggle CMS display adjustment on and off"), "swatches"), + new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview..."), N_("Open a window to preview objects at different icon resolutions"), "view_icon_preview"), new ZoomVerb(SP_VERB_ZOOM_PAGE, "ZoomPage", N_("_Page"), diff --git a/src/verbs.h b/src/verbs.h index b9c05dbc7..be9405f9b 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -193,6 +193,7 @@ enum { SP_VERB_VIEW_MODE_NORMAL, SP_VERB_VIEW_MODE_OUTLINE, SP_VERB_VIEW_MODE_TOGGLE, + SP_VERB_VIEW_CMS_TOGGLE, SP_VERB_VIEW_ICON_PREVIEW, SP_VERB_ZOOM_PAGE, SP_VERB_ZOOM_PAGE_WIDTH, diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 580274dc4..b0bd3a260 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -1556,6 +1556,18 @@ sp_desktop_widget_toggle_scrollbars (SPDesktopWidget *dtw) } } +void sp_desktop_widget_toggle_color_prof_adj( SPDesktopWidget *dtw ) +{ + + if ( GTK_WIDGET_SENSITIVE( dtw->cms_adjust ) ) { + if ( SP_BUTTON_IS_DOWN(dtw->cms_adjust) ) { + sp_button_toggle_set_down( SP_BUTTON(dtw->cms_adjust), FALSE ); + } else { + sp_button_toggle_set_down( SP_BUTTON(dtw->cms_adjust), TRUE ); + } + } +} + /* Unused void sp_spw_toggle_menubar (SPDesktopWidget *dtw, bool is_fullscreen) diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index a0b97f9d8..8f38277ab 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -48,6 +48,7 @@ void sp_desktop_widget_update_rulers (SPDesktopWidget *dtw); void sp_desktop_widget_toggle_rulers (SPDesktopWidget *dtw); void sp_desktop_widget_toggle_scrollbars (SPDesktopWidget *dtw); void sp_desktop_widget_update_scrollbars (SPDesktopWidget *dtw, double scale); +void sp_desktop_widget_toggle_color_prof_adj( SPDesktopWidget *dtw ); void sp_dtw_desktop_activate (SPDesktopWidget *dtw); void sp_dtw_desktop_deactivate (SPDesktopWidget *dtw); @@ -173,6 +174,8 @@ struct SPDesktopWidget { { sp_desktop_widget_toggle_rulers (_dtw); } virtual void toggleScrollbars() { sp_desktop_widget_toggle_scrollbars (_dtw); } + virtual void toggleColorProfAdjust() + { sp_desktop_widget_toggle_color_prof_adj(_dtw); } virtual void updateZoom() { sp_desktop_widget_update_zoom (_dtw); } virtual void letZoomGrabFocus()