X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdialogs%2Fswatches.h;h=02861781f8e2746aecca0e8f9698713fdc534109;hb=724821145d62dee9f97465c706952582da6e432d;hp=1fba23ebaa8556a1b9441bcf4717889e93ae0688;hpb=f42da2a813083a17eb54d776692970b61ff934f6;p=inkscape.git diff --git a/src/dialogs/swatches.h b/src/dialogs/swatches.h index 1fba23eba..02861781f 100644 --- a/src/dialogs/swatches.h +++ b/src/dialogs/swatches.h @@ -26,12 +26,15 @@ 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 ); @@ -40,12 +43,42 @@ public: virtual ColorItem &operator=(ColorItem const &other); virtual Gtk::Widget* getPreview(PreviewStyle style, ViewType view, - Gtk::BuiltinIconSize size); + Inkscape::IconSize size); void buttonClicked(bool secondary = false); 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 _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; }; @@ -56,7 +89,7 @@ private: class SwatchesPanel : public Inkscape::UI::Widget::Panel { public: - SwatchesPanel(); + SwatchesPanel(gchar const* prefsPath = "dialogs.swatches"); virtual ~SwatchesPanel(); static SwatchesPanel& getInstance();