From: joncruz Date: Sat, 21 Mar 2009 18:20:28 +0000 (+0000) Subject: Cleaning up interface. Moved internals out of .h file. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6f55ec7628f3d5379c1394f83bb7f2edff3a08e2;p=inkscape.git Cleaning up interface. Moved internals out of .h file. --- diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index 1bc3e6882..4e15d26ac 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -49,6 +49,64 @@ namespace UI { namespace Dialogs { +void _loadPaletteFile( gchar const *filename ); + +/** + * The color swatch you see on screen as a clickable box. + */ +class ColorItem : public Inkscape::UI::Previewable +{ + friend void _loadPaletteFile( gchar const *filename ); +public: + ColorItem( ege::PaintDef::ColorType type ); + ColorItem( unsigned int r, unsigned int g, unsigned int b, + Glib::ustring& name ); + virtual ~ColorItem(); + ColorItem(ColorItem const &other); + virtual ColorItem &operator=(ColorItem const &other); + virtual Gtk::Widget* getPreview(PreviewStyle style, + ViewType view, + ::PreviewSize size, + guint ratio); + void buttonClicked(bool secondary = false); + ege::PaintDef def; + void* ptr; + +private: + static void _dropDataIn( GtkWidget *widget, + GdkDragContext *drag_context, + gint x, gint y, + GtkSelectionData *data, + guint info, + guint event_time, + gpointer user_data); + + static void _dragGetColorData( GtkWidget *widget, + GdkDragContext *drag_context, + GtkSelectionData *data, + guint info, + guint time, + gpointer user_data); + + static void _wireMagicColors( void* p ); + static void _colorDefChanged(void* data); + + void _linkTint( ColorItem& other, int percent ); + void _linkTone( ColorItem& other, int percent, int grayLevel ); + + Gtk::Tooltips tips; + std::vector _previews; + + bool _isLive; + bool _linkIsTone; + int _linkPercent; + int _linkGray; + ColorItem* _linkSrc; + std::vector _listeners; +}; + + + ColorItem::ColorItem(ege::PaintDef::ColorType type) : def(type), ptr(0), diff --git a/src/ui/dialog/swatches.h b/src/ui/dialog/swatches.h index c498f7ffd..13029840a 100644 --- a/src/ui/dialog/swatches.h +++ b/src/ui/dialog/swatches.h @@ -21,64 +21,7 @@ namespace Inkscape { namespace UI { namespace Dialogs { - -void _loadPaletteFile( gchar const *filename ); - -/** - * The color swatch you see on screen as a clickable box. - */ -class ColorItem : public Inkscape::UI::Previewable -{ - friend void _loadPaletteFile( gchar const *filename ); -public: - ColorItem( ege::PaintDef::ColorType type ); - ColorItem( unsigned int r, unsigned int g, unsigned int b, - Glib::ustring& name ); - virtual ~ColorItem(); - ColorItem(ColorItem const &other); - virtual ColorItem &operator=(ColorItem const &other); - virtual Gtk::Widget* getPreview(PreviewStyle style, - ViewType view, - ::PreviewSize size, - guint ratio); - void buttonClicked(bool secondary = false); - ege::PaintDef def; - void* ptr; - -private: - static void _dropDataIn( GtkWidget *widget, - GdkDragContext *drag_context, - gint x, gint y, - GtkSelectionData *data, - guint info, - guint event_time, - gpointer user_data); - - static void _dragGetColorData( GtkWidget *widget, - GdkDragContext *drag_context, - GtkSelectionData *data, - guint info, - guint time, - gpointer user_data); - - static void _wireMagicColors( void* p ); - static void _colorDefChanged(void* data); - - void _linkTint( ColorItem& other, int percent ); - void _linkTone( ColorItem& other, int percent, int grayLevel ); - - Gtk::Tooltips tips; - std::vector _previews; - - bool _isLive; - bool _linkIsTone; - int _linkPercent; - int _linkGray; - ColorItem* _linkSrc; - std::vector _listeners; -}; - -class RemoveColorItem; +class ColorItem; /** * A panel that displays color swatches. @@ -90,6 +33,7 @@ public: virtual ~SwatchesPanel(); static SwatchesPanel& getInstance(); + virtual void setOrientation( Gtk::AnchorType how ); virtual void setDesktop( SPDesktop* desktop ); @@ -107,8 +51,6 @@ private: SwatchesPanel(SwatchesPanel const &); // no copy SwatchesPanel &operator=(SwatchesPanel const &); // no assign - static SwatchesPanel* instance; - PreviewHolder* _holder; ColorItem* _clear; ColorItem* _remove;