2009-02-27 Alberto Garcia <agarcia@igalia.com>
[hildon] / src / hildon-color-button.c
index 2164294..3fa180d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
  *
- * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+ * Contact: Rodrigo Novo <rodrigo.novo@nokia.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
  * 
  */
 
+#undef                                          HILDON_DISABLE_DEPRECATED
+
 #ifdef                                          HAVE_CONFIG_H
 #include                                        <config.h>
 #endif
 
-#include                                        "hildon-color-button.h"
-#include                                        <gtk/gtkbutton.h>
-#include                                        <gtk/gtkalignment.h>
-#include                                        <gtk/gtkdrawingarea.h>
-#include                                        <gtk/gtksignal.h>
 #include                                        <gdk/gdkkeysyms.h>
+
+#include                                        "hildon-color-button.h"
 #include                                        "hildon-defines.h"
 #include                                        "hildon-color-chooser-dialog.h"
 #include                                        "hildon-color-button-private.h"
 
 #define                                         INNER_BORDER_THICKNESS 2
 
-enum 
+enum
+{
+    SETUP_DIALOG,
+    LAST_SIGNAL
+};
+
+enum
 {
     PROP_0,
     PROP_COLOR,
@@ -143,13 +148,14 @@ draw_grid                                       (GdkDrawable *drawable,
                                                  gint h);
 
 static gpointer                                 parent_class = NULL;
+static guint                                    signals [LAST_SIGNAL] = { 0, };
 
 /**
  * hildon_color_button_get_type:
  *
  * Initializes and returns the type of a hildon color button.
  *
- * @Returns: GType of #HildonColorButton.
+ * Returns: GType of #HildonColorButton.
  */
 GType G_GNUC_CONST
 hildon_color_button_get_type                    (void)
@@ -199,6 +205,16 @@ hildon_color_button_class_init                  (HildonColorButtonClass *klass)
     button_class->clicked           = hildon_color_button_clicked;
     widget_class->mnemonic_activate = hildon_color_button_mnemonic_activate;
 
+   signals[SETUP_DIALOG] =
+       g_signal_new ("setup-dialog",
+                     G_TYPE_FROM_CLASS (klass),
+                     G_SIGNAL_RUN_LAST,
+                     0,
+                     NULL, NULL,
+                     g_cclosure_marshal_VOID__OBJECT,
+                     G_TYPE_NONE, 1,
+                     HILDON_TYPE_COLOR_CHOOSER_DIALOG);
+
     /**
      * HildonColorButton:color:
      *
@@ -427,6 +443,8 @@ hildon_color_button_clicked                     (GtkButton *button)
         cs_dialog = HILDON_COLOR_CHOOSER_DIALOG (priv->dialog);
         if (parent)
             gtk_window_set_transient_for (GTK_WINDOW (cs_dialog), GTK_WINDOW (parent));
+
+        g_signal_emit (button, signals[SETUP_DIALOG], 0, priv->dialog);
     }
 
     /* Set the initial color for the color selector dialog */