Code

Objects will now change when their linked colors change.
[inkscape.git] / src / dialogs / swatches.h
index 1fba23ebaa8556a1b9441bcf4717889e93ae0688..b6f28f18201be089257b122264f72d92ee867d3a 100644 (file)
@@ -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 );
@@ -44,8 +47,30 @@ public:
     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 _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<Gtk::Widget*> _previews;
+
+    bool _linkIsTone;
+    int _linkPercent;
+    int _linkGray;
+    ColorItem* _linkSrc;
+    std::vector<ColorItem*> _listeners;
 };