[gdl] Deprecate GdlDockTablabel



commit eafa2ecb40f31de0e9e190ba9585f035ae1473ca
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Sun May 27 19:47:18 2012 +0200

    Deprecate GdlDockTablabel

 docs/reference/gdl-docs.sgml             |    3 +++
 gdl/Makefile.am                          |    4 ++--
 gdl/{ => deprecated}/gdl-dock-tablabel.c |   11 +++++++++++
 gdl/{ => deprecated}/gdl-dock-tablabel.h |   10 +++++++++-
 gdl/gdl-dock-item.c                      |   17 -----------------
 gdl/gdl-dock-notebook.c                  |   23 -----------------------
 6 files changed, 25 insertions(+), 43 deletions(-)
---
diff --git a/docs/reference/gdl-docs.sgml b/docs/reference/gdl-docs.sgml
index 6a3f8d4..e5dae20 100644
--- a/docs/reference/gdl-docs.sgml
+++ b/docs/reference/gdl-docs.sgml
@@ -35,6 +35,9 @@
       <xi:include href="xml/gdl-dock-placeholder.xml" />
       <xi:include href="xml/gdl-preview-window.xml" />
       <xi:include href="xml/gdl-switcher.xml" />
+    </chapter>
+    <chapter id="deprecated">
+      <title>Deprecated Classes</title>
       <xi:include href="xml/gdl-dock-tablabel.xml" />
     </chapter>
   </part>
diff --git a/gdl/Makefile.am b/gdl/Makefile.am
index ff7c218..1e5bd43 100644
--- a/gdl/Makefile.am
+++ b/gdl/Makefile.am
@@ -48,8 +48,8 @@ libgdl_3_la_SOURCES = \
 	gdl-dock-notebook.c \
 	gdl-dock-paned.c \
 	gdl-dock-paned.h \
-	gdl-dock-tablabel.c \
-	gdl-dock-tablabel.h \
+	deprecated/gdl-dock-tablabel.c \
+	deprecated/gdl-dock-tablabel.h \
 	gdl-dock-layout.c \
 	gdl-dock-placeholder.c \
 	gdl-dock-bar.c \
diff --git a/gdl/gdl-dock-tablabel.c b/gdl/deprecated/gdl-dock-tablabel.c
similarity index 99%
rename from gdl/gdl-dock-tablabel.c
rename to gdl/deprecated/gdl-dock-tablabel.c
index b6fd0f9..cb1474e 100644
--- a/gdl/gdl-dock-tablabel.c
+++ b/gdl/deprecated/gdl-dock-tablabel.c
@@ -25,6 +25,9 @@
 #include <config.h>
 #endif
 
+#ifndef GDL_DISABLE_DEPRECATED
+#define GDL_DISABLE_DEPRECATION_WARNINGS
+
 #include "gdl-i18n.h"
 #include <gtk/gtk.h>
 
@@ -648,6 +651,8 @@ gdl_dock_tablabel_unmap (GtkWidget *widget)
  * Creates a new GDL tab label widget.
  *
  * Returns: a new #GdlDockTablabel.
+ *
+ * Deprecated: 3.6: Use a #GtkLabel instead
  */
 GtkWidget *
 gdl_dock_tablabel_new (GdlDockItem *item)
@@ -666,6 +671,8 @@ gdl_dock_tablabel_new (GdlDockItem *item)
  * @tablabel:  A #GdlDockTablabel widget
  *
  * Set the widget in "activated" state.
+ *
+ * Deprecated: 3.6:
  */
 void
 gdl_dock_tablabel_activate (GdlDockTablabel *tablabel)
@@ -681,6 +688,8 @@ gdl_dock_tablabel_activate (GdlDockTablabel *tablabel)
  * @tablabel:  A #GdlDockTablabel widget
  *
  * Set the widget in "deactivated" state.
+ *
+ * Deprecated: 3.6:
  */
 void
 gdl_dock_tablabel_deactivate (GdlDockTablabel *tablabel)
@@ -691,3 +700,5 @@ gdl_dock_tablabel_deactivate (GdlDockTablabel *tablabel)
     /* yeah, i know it contradictive */
     gtk_widget_set_state (GTK_WIDGET (tablabel), GTK_STATE_ACTIVE);
 }
+
+#endif
diff --git a/gdl/gdl-dock-tablabel.h b/gdl/deprecated/gdl-dock-tablabel.h
similarity index 94%
rename from gdl/gdl-dock-tablabel.h
rename to gdl/deprecated/gdl-dock-tablabel.h
index ce0e7df..3e3b4e9 100644
--- a/gdl/gdl-dock-tablabel.h
+++ b/gdl/deprecated/gdl-dock-tablabel.h
@@ -30,6 +30,8 @@
 
 G_BEGIN_DECLS
 
+#ifndef GDL_DISABLE_DEPRECATED
+
 /* standard macros */
 #define GDL_TYPE_DOCK_TABLABEL            (gdl_dock_tablabel_get_type ())
 #define GDL_DOCK_TABLABEL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDL_TYPE_DOCK_TABLABEL, GdlDockTablabel))
@@ -62,13 +64,19 @@ struct _GdlDockTablabelClass {
 };
 
 /* public interface */
- 
+
 GtkWidget     *gdl_dock_tablabel_new           (GdlDockItem *item);
+#ifdef GDL_DISABLE_DEPRECATION_WARNINGS
 GType          gdl_dock_tablabel_get_type      (void);
+#else
+GType          gdl_dock_tablabel_get_type      (void) G_GNUC_DEPRECATED;
+#endif
 
 void           gdl_dock_tablabel_activate      (GdlDockTablabel *tablabel);
 void           gdl_dock_tablabel_deactivate    (GdlDockTablabel *tablabel);
 
+#endif
+
 G_END_DECLS
 
 #endif
diff --git a/gdl/gdl-dock-item.c b/gdl/gdl-dock-item.c
index 2ce5384..3d7f54e 100644
--- a/gdl/gdl-dock-item.c
+++ b/gdl/gdl-dock-item.c
@@ -42,7 +42,6 @@
 #include "gdl-dock-item-grip.h"
 #include "gdl-dock-notebook.h"
 #include "gdl-dock-paned.h"
-#include "gdl-dock-tablabel.h"
 #include "gdl-dock-placeholder.h"
 #include "gdl-dock-master.h"
 #include "libgdltypebuiltins.h"
@@ -1130,9 +1129,6 @@ gdl_dock_item_move_focus_child (GdlDockItem      *item,
 #define EVENT_IN_GRIP_EVENT_WINDOW(ev,gr) \
     ((gr) != NULL && (ev)->window == GDL_DOCK_ITEM_GRIP (gr)->title_window)
 
-#define EVENT_IN_TABLABEL_EVENT_WINDOW(ev,tl) \
-    ((tl) != NULL && (ev)->window == GDL_DOCK_TABLABEL (tl)->event_window)
-
 static gint
 gdl_dock_item_button_changed (GtkWidget      *widget,
                               GdkEventButton *event)
@@ -2039,13 +2035,6 @@ gdl_dock_item_set_tablabel (GdlDockItem *item,
 
     if (item->priv->tab_label) {
         /* disconnect and unref the previous tablabel */
-        if (GDL_IS_DOCK_TABLABEL (item->priv->tab_label)) {
-            g_signal_handlers_disconnect_matched (item->priv->tab_label,
-                                                  G_SIGNAL_MATCH_DATA,
-                                                  0, 0, NULL,
-                                                  NULL, item);
-            g_object_set (item->priv->tab_label, "item", NULL, NULL);
-        }
         g_object_unref (item->priv->tab_label);
         item->priv->tab_label = NULL;
     }
@@ -2053,12 +2042,6 @@ gdl_dock_item_set_tablabel (GdlDockItem *item,
     if (tablabel) {
         g_object_ref_sink (G_OBJECT (tablabel));
         item->priv->tab_label = tablabel;
-        if (GDL_IS_DOCK_TABLABEL (tablabel)) {
-            g_object_set (tablabel, "item", item, NULL);
-            /* connect to tablabel signal */
-            g_signal_connect (tablabel, "button_pressed_handle",
-                              G_CALLBACK (gdl_dock_item_tab_button), item);
-        }
     }
 }
 
diff --git a/gdl/gdl-dock-notebook.c b/gdl/gdl-dock-notebook.c
index f1d576a..fe39ce2 100644
--- a/gdl/gdl-dock-notebook.c
+++ b/gdl/gdl-dock-notebook.c
@@ -27,7 +27,6 @@
 #include "gdl-switcher.h"
 
 #include "gdl-dock-notebook.h"
-#include "gdl-dock-tablabel.h"
 
 /**
  * SECTION:gdl-dock-notebook
@@ -284,21 +283,6 @@ gdl_dock_notebook_switch_page_cb (GtkNotebook     *nb,
     notebook = GDL_DOCK_NOTEBOOK (data);
     current_page = gtk_notebook_get_current_page (nb);
 
-    /* deactivate old tablabel */
-    if (current_page) {
-        tablabel = gtk_notebook_get_tab_label (
-            nb, gtk_notebook_get_nth_page (
-                nb, current_page));
-        if (tablabel && GDL_IS_DOCK_TABLABEL (tablabel))
-            gdl_dock_tablabel_deactivate (GDL_DOCK_TABLABEL (tablabel));
-    };
-
-    /* activate new label */
-    tablabel = gtk_notebook_get_tab_label (
-        nb, page);
-    if (tablabel && GDL_IS_DOCK_TABLABEL (tablabel))
-        gdl_dock_tablabel_activate (GDL_DOCK_TABLABEL (tablabel));
-
     if (GDL_DOCK_ITEM_USER_ACTION (notebook) &&
         GDL_DOCK_OBJECT (notebook)->master)
         g_signal_emit_by_name (GDL_DOCK_OBJECT (notebook)->master,
@@ -417,13 +401,6 @@ gdl_dock_notebook_dock (GdlDockObject    *object,
                 label = gtk_label_new (long_name);
                 gdl_dock_item_set_tablabel (requestor_item, label);
             }
-#if 0
-            if (GDL_IS_DOCK_TABLABEL (label)) {
-                gdl_dock_tablabel_deactivate (GDL_DOCK_TABLABEL (label));
-                /* hide the item grip, as we will use the tablabel's */
-                gdl_dock_item_hide_grip (requestor_item);
-            }
-#endif
 
             if (other_data && G_VALUE_HOLDS (other_data, G_TYPE_INT))
                 position = g_value_get_int (other_data);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]