X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdialogs%2Fswatches.h;h=b6f28f18201be089257b122264f72d92ee867d3a;hb=1b3997fca33846b920f132a00549600159e9492d;hp=ca17cd066cd2ad90e4034f55734fc6fd98bc3ba5;hpb=6b15695578f07a3f72c4c9475c1a261a3021472a;p=inkscape.git diff --git a/src/dialogs/swatches.h b/src/dialogs/swatches.h index ca17cd066..b6f28f182 100644 --- a/src/dialogs/swatches.h +++ b/src/dialogs/swatches.h @@ -17,18 +17,24 @@ #include "ui/widget/panel.h" #include "ui/previewholder.h" +#include "dialogs/eek-color-def.h" + +using eek::ColorDef; 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( unsigned int r, unsigned int g, unsigned int b, Glib::ustring& name ); @@ -39,13 +45,32 @@ public: ViewType view, Gtk::BuiltinIconSize size); void buttonClicked(bool secondary = false); - unsigned int _r; - unsigned int _g; - unsigned int _b; - Glib::ustring _name; - + + ColorDef def; + 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 _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 _linkIsTone; + int _linkPercent; + int _linkGray; + ColorItem* _linkSrc; + std::vector _listeners; }; @@ -60,6 +85,7 @@ public: virtual ~SwatchesPanel(); static SwatchesPanel& getInstance(); + virtual void setOrientation( Gtk::AnchorType how ); protected: virtual void _handleAction( int setId, int itemId );