[gdl] Remove gdl-tools.h with deprecated libgnome macros and use glib macros instead
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdl] Remove gdl-tools.h with deprecated libgnome macros and use glib macros instead
- Date: Sat, 26 Jun 2010 21:44:16 +0000 (UTC)
commit 7399ad1ae0e48f6118559a99e77eff4b276d610f
Author: Johannes Schmid <jhs gnome org>
Date: Sat Jun 26 23:43:45 2010 +0200
Remove gdl-tools.h with deprecated libgnome macros and use glib macros instead
gdl/Makefile.am | 1 -
gdl/gdl-dock-bar.c | 8 +-
gdl/gdl-dock-item-button-image.c | 11 +--
gdl/gdl-dock-item-grip.c | 21 ++---
gdl/gdl-dock-item.c | 31 +++----
gdl/gdl-dock-layout.c | 7 +-
gdl/gdl-dock-master.c | 8 +-
gdl/gdl-dock-notebook.c | 19 ++---
gdl/gdl-dock-object.c | 48 +++++-----
gdl/gdl-dock-paned.c | 30 +++----
gdl/gdl-dock-placeholder.c | 9 +--
gdl/gdl-dock-tablabel.c | 17 ++--
gdl/gdl-dock.c | 47 +++++------
gdl/gdl-switcher.c | 32 +++----
gdl/gdl-tools.h | 184 --------------------------------------
gdl/gdl.h | 1 -
gdl/test-dock.c | 2 -
17 files changed, 121 insertions(+), 355 deletions(-)
---
diff --git a/gdl/Makefile.am b/gdl/Makefile.am
index 1d30490..b0ed68b 100644
--- a/gdl/Makefile.am
+++ b/gdl/Makefile.am
@@ -22,7 +22,6 @@ CLEANFILES = \
libgdl_headers = \
gdl.h \
- gdl-tools.h \
gdl-dock.h \
gdl-dock-object.h \
gdl-dock-master.h \
diff --git a/gdl/gdl-dock-bar.c b/gdl/gdl-dock-bar.c
index 97a60c6..d7acd47 100644
--- a/gdl/gdl-dock-bar.c
+++ b/gdl/gdl-dock-bar.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include <string.h>
-#include "gdl-tools.h"
#include "gdl-dock.h"
#include "gdl-dock-master.h"
#include "gdl-dock-bar.h"
@@ -42,7 +41,6 @@ enum {
/* ----- Private prototypes ----- */
static void gdl_dock_bar_class_init (GdlDockBarClass *klass);
-static void gdl_dock_bar_instance_init (GdlDockBar *dockbar);
static void gdl_dock_bar_get_property (GObject *object,
guint prop_id,
@@ -71,7 +69,7 @@ struct _GdlDockBarPrivate {
/* ----- Private functions ----- */
-GDL_CLASS_BOILERPLATE (GdlDockBar, gdl_dock_bar, GtkBox, GTK_TYPE_BOX)
+G_DEFINE_TYPE (GdlDockBar, gdl_dock_bar, GTK_TYPE_BOX)
static void gdl_dock_bar_size_request (GtkWidget *widget,
GtkRequisition *requisition );
@@ -124,7 +122,7 @@ gdl_dock_bar_class_init (GdlDockBarClass *klass)
}
static void
-gdl_dock_bar_instance_init (GdlDockBar *dockbar)
+gdl_dock_bar_init (GdlDockBar *dockbar)
{
dockbar->_priv = g_new0 (GdlDockBarPrivate, 1);
dockbar->_priv->master = NULL;
@@ -209,7 +207,7 @@ gdl_dock_bar_destroy (GtkObject *object)
g_free (priv);
}
- GDL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+ GTK_OBJECT_CLASS (gdl_dock_bar_parent_class)->destroy (object);
}
static void
diff --git a/gdl/gdl-dock-item-button-image.c b/gdl/gdl-dock-item-button-image.c
index fbf78a9..da0cba2 100644
--- a/gdl/gdl-dock-item-button-image.c
+++ b/gdl/gdl-dock-item-button-image.c
@@ -23,13 +23,12 @@
#include "gdl-dock-item-button-image.h"
#include <math.h>
-#include "gdl-tools.h"
#define ICON_SIZE 12
-GDL_CLASS_BOILERPLATE (GdlDockItemButtonImage,
- gdl_dock_item_button_image,
- GtkWidget, GTK_TYPE_WIDGET);
+G_DEFINE_TYPE (GdlDockItemButtonImage,
+ gdl_dock_item_button_image,
+ GTK_TYPE_WIDGET);
static gint
gdl_dock_item_button_image_expose (GtkWidget *widget,
@@ -115,7 +114,7 @@ gdl_dock_item_button_image_expose (GtkWidget *widget,
}
static void
-gdl_dock_item_button_image_instance_init (
+gdl_dock_item_button_image_init (
GdlDockItemButtonImage *button_image)
{
gtk_widget_set_has_window (GTK_WIDGET (button_image), FALSE);
@@ -140,8 +139,6 @@ gdl_dock_item_button_image_class_init (
GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
widget_class->expose_event =
gdl_dock_item_button_image_expose;
widget_class->size_request =
diff --git a/gdl/gdl-dock-item-grip.c b/gdl/gdl-dock-item-grip.c
index 8bb8465..02c2471 100644
--- a/gdl/gdl-dock-item-grip.c
+++ b/gdl/gdl-dock-item-grip.c
@@ -39,7 +39,6 @@
#include "gdl-dock-item-grip.h"
#include "gdl-dock-item-button-image.h"
#include "gdl-switcher.h"
-#include "gdl-tools.h"
#define ALIGN_BORDER 5
#define DRAG_HANDLE_SIZE 10
@@ -58,8 +57,7 @@ struct _GdlDockItemGripPrivate {
gboolean handle_shown;
};
-GDL_CLASS_BOILERPLATE (GdlDockItemGrip, gdl_dock_item_grip,
- GtkContainer, GTK_TYPE_CONTAINER);
+G_DEFINE_TYPE (GdlDockItemGrip, gdl_dock_item_grip, GTK_TYPE_CONTAINER);
GtkWidget*
gdl_dock_item_create_label_widget(GdlDockItemGrip *grip)
@@ -143,7 +141,7 @@ gdl_dock_item_grip_expose (GtkWidget *widget,
}
- return GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
+ return GTK_WIDGET_CLASS (gdl_dock_item_grip_parent_class)->expose_event (widget, event);
}
static void
@@ -209,7 +207,7 @@ gdl_dock_item_grip_destroy (GtkObject *object)
g_free (priv);
}
- GDL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+ GTK_OBJECT_CLASS (gdl_dock_item_grip_parent_class)->destroy (object);
}
static void
@@ -334,7 +332,7 @@ gdl_dock_item_grip_iconify_clicked (GtkWidget *widget,
}
static void
-gdl_dock_item_grip_instance_init (GdlDockItemGrip *grip)
+gdl_dock_item_grip_init (GdlDockItemGrip *grip)
{
GtkWidget *image;
@@ -390,7 +388,7 @@ gdl_dock_item_grip_realize (GtkWidget *widget)
{
GdlDockItemGrip *grip = GDL_DOCK_ITEM_GRIP (widget);
- GTK_WIDGET_CLASS (parent_class)->realize (widget);
+ GTK_WIDGET_CLASS (gdl_dock_item_grip_parent_class)->realize (widget);
g_return_if_fail (grip->_priv != NULL);
@@ -450,7 +448,7 @@ gdl_dock_item_grip_unrealize (GtkWidget *widget)
grip->title_window = NULL;
}
- GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
+ GTK_WIDGET_CLASS (gdl_dock_item_grip_parent_class)->unrealize (widget);
}
static void
@@ -458,7 +456,7 @@ gdl_dock_item_grip_map (GtkWidget *widget)
{
GdlDockItemGrip *grip = GDL_DOCK_ITEM_GRIP (widget);
- GTK_WIDGET_CLASS (parent_class)->map (widget);
+ GTK_WIDGET_CLASS (gdl_dock_item_grip_parent_class)->map (widget);
if (grip->title_window)
gdk_window_show (grip->title_window);
@@ -472,7 +470,7 @@ gdl_dock_item_grip_unmap (GtkWidget *widget)
if (grip->title_window)
gdk_window_hide (grip->title_window);
- GTK_WIDGET_CLASS (parent_class)->unmap (widget);
+ GTK_WIDGET_CLASS (gdl_dock_item_grip_parent_class)->unmap (widget);
}
static void
@@ -532,7 +530,7 @@ gdl_dock_item_grip_size_allocate (GtkWidget *widget,
grip = GDL_DOCK_ITEM_GRIP (widget);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
+ GTK_WIDGET_CLASS (gdl_dock_item_grip_parent_class)->size_allocate (widget, allocation);
gtk_widget_size_request (grip->_priv->close_button,
&close_requisition);
@@ -678,7 +676,6 @@ gdl_dock_item_grip_class_init (GdlDockItemGripClass *klass)
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
- parent_class = g_type_class_peek_parent (klass);
gobject_class = G_OBJECT_CLASS (klass);
gtk_object_class = GTK_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
diff --git a/gdl/gdl-dock-item.c b/gdl/gdl-dock-item.c
index a7d9461..4d4bd04 100644
--- a/gdl/gdl-dock-item.c
+++ b/gdl/gdl-dock-item.c
@@ -37,7 +37,6 @@
#include <string.h>
#include <gdk/gdkkeysyms.h>
-#include "gdl-tools.h"
#include "gdl-dock.h"
#include "gdl-dock-item.h"
#include "gdl-dock-item-grip.h"
@@ -54,7 +53,6 @@
/* ----- Private prototypes ----- */
static void gdl_dock_item_class_init (GdlDockItemClass *class);
-static void gdl_dock_item_instance_init (GdlDockItem *item);
static GObject *gdl_dock_item_constructor (GType type,
guint n_construct_properties,
@@ -193,7 +191,7 @@ struct _GdlDockItemPrivate {
/* ----- Private functions ----- */
-GDL_CLASS_BOILERPLATE (GdlDockItem, gdl_dock_item, GdlDockObject, GDL_TYPE_DOCK_OBJECT);
+G_DEFINE_TYPE (GdlDockItem, gdl_dock_item, GDL_TYPE_DOCK_OBJECT);
static void
gdl_dock_item_class_init (GdlDockItemClass *klass)
@@ -404,7 +402,7 @@ gdl_dock_item_class_init (GdlDockItemClass *klass)
}
static void
-gdl_dock_item_instance_init (GdlDockItem *item)
+gdl_dock_item_init (GdlDockItem *item)
{
gtk_widget_set_has_window (GTK_WIDGET (item), TRUE);
@@ -456,12 +454,9 @@ gdl_dock_item_constructor (GType type,
{
GObject *g_object;
- g_object = GDL_CALL_PARENT_WITH_DEFAULT (G_OBJECT_CLASS,
- constructor,
- (type,
- n_construct_properties,
- construct_param),
- NULL);
+ g_object = G_OBJECT_CLASS (gdl_dock_item_parent_class)-> constructor (type,
+ n_construct_properties,
+ construct_param);
if (g_object) {
GdlDockItem *item = GDL_DOCK_ITEM (g_object);
GtkWidget *hbox;
@@ -633,7 +628,7 @@ gdl_dock_item_destroy (GtkObject *object)
g_free (priv);
}
- GDL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+ GTK_OBJECT_CLASS (gdl_dock_item_parent_class)->destroy (object);
}
static void
@@ -994,9 +989,10 @@ gdl_dock_item_expose (GtkWidget *widget,
g_return_val_if_fail (event != NULL, FALSE);
if (gtk_widget_is_drawable (widget) &&
- event->window == gtk_widget_get_window (widget)) {
+ event->window == gtk_widget_get_window (widget))
+ {
gdl_dock_item_paint (widget, event);
- GDL_CALL_PARENT_GBOOLEAN(GTK_WIDGET_CLASS, expose_event, (widget,event));
+ GTK_WIDGET_CLASS (gdl_dock_item_parent_class)->expose_event (widget,event);
}
return FALSE;
@@ -1152,10 +1148,7 @@ gdl_dock_item_key_press (GtkWidget *widget,
if (event_handled)
return TRUE;
else
- return GDL_CALL_PARENT_WITH_DEFAULT (GTK_WIDGET_CLASS,
- key_press_event,
- (widget, event),
- FALSE);
+ return GTK_WIDGET_CLASS (gdl_dock_item_parent_class)->key_press_event (widget, event);
}
static gboolean
@@ -1820,8 +1813,8 @@ gdl_dock_item_set_orientation (GdlDockItem *item,
"orientation", orientation,
NULL);
};
-
- GDL_CALL_VIRTUAL (item, GDL_DOCK_ITEM_GET_CLASS, set_orientation, (item, orientation));
+ if (GDL_DOCK_ITEM_GET_CLASS (item)->set_orientation)
+ GDL_DOCK_ITEM_GET_CLASS (item)->set_orientation (item, orientation);
g_object_notify (G_OBJECT (item), "orientation");
}
}
diff --git a/gdl/gdl-dock-layout.c b/gdl/gdl-dock-layout.c
index 04a0fe0..ff2a27a 100644
--- a/gdl/gdl-dock-layout.c
+++ b/gdl/gdl-dock-layout.c
@@ -30,7 +30,6 @@
#include <gtk/gtk.h>
#include "gdl-dock-layout.h"
-#include "gdl-tools.h"
#include "gdl-dock-placeholder.h"
@@ -82,8 +81,6 @@ struct _GdlDockLayoutUIData {
static void gdl_dock_layout_class_init (GdlDockLayoutClass *klass);
-static void gdl_dock_layout_instance_init (GdlDockLayout *layout);
-
static void gdl_dock_layout_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -106,7 +103,7 @@ static void gdl_dock_layout_build_models (GdlDockLayout *layout);
/* ----- Private implementation ----- */
-GDL_CLASS_BOILERPLATE (GdlDockLayout, gdl_dock_layout, GObject, G_TYPE_OBJECT);
+G_DEFINE_TYPE (GdlDockLayout, gdl_dock_layout, G_TYPE_OBJECT);
static void
gdl_dock_layout_class_init (GdlDockLayoutClass *klass)
@@ -135,7 +132,7 @@ gdl_dock_layout_class_init (GdlDockLayoutClass *klass)
}
static void
-gdl_dock_layout_instance_init (GdlDockLayout *layout)
+gdl_dock_layout_init (GdlDockLayout *layout)
{
layout->master = NULL;
layout->dirty = FALSE;
diff --git a/gdl/gdl-dock-master.c b/gdl/gdl-dock-master.c
index 31dc7a8..d2a3cbd 100644
--- a/gdl/gdl-dock-master.c
+++ b/gdl/gdl-dock-master.c
@@ -27,7 +27,6 @@
#include "gdl-i18n.h"
-#include "gdl-tools.h"
#include "gdl-dock-master.h"
#include "gdl-dock.h"
#include "gdl-dock-item.h"
@@ -39,7 +38,6 @@
/* ----- Private prototypes ----- */
static void gdl_dock_master_class_init (GdlDockMasterClass *klass);
-static void gdl_dock_master_instance_init (GdlDockMaster *master);
static void gdl_dock_master_dispose (GObject *g_object);
static void gdl_dock_master_set_property (GObject *object,
@@ -122,7 +120,7 @@ static guint master_signals [LAST_SIGNAL] = { 0 };
/* ----- Private interface ----- */
-GDL_CLASS_BOILERPLATE (GdlDockMaster, gdl_dock_master, GObject, G_TYPE_OBJECT);
+G_DEFINE_TYPE (GdlDockMaster, gdl_dock_master, G_TYPE_OBJECT);
static void
gdl_dock_master_class_init (GdlDockMasterClass *klass)
@@ -174,7 +172,7 @@ gdl_dock_master_class_init (GdlDockMasterClass *klass)
}
static void
-gdl_dock_master_instance_init (GdlDockMaster *master)
+gdl_dock_master_init (GdlDockMaster *master)
{
master->dock_objects = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
@@ -306,7 +304,7 @@ gdl_dock_master_dispose (GObject *g_object)
master->_priv = NULL;
}
- GDL_CALL_PARENT (G_OBJECT_CLASS, dispose, (g_object));
+ G_OBJECT_CLASS (gdl_dock_master_parent_class)->dispose (g_object);
}
static void
diff --git a/gdl/gdl-dock-notebook.c b/gdl/gdl-dock-notebook.c
index 4c3741e..54749f2 100644
--- a/gdl/gdl-dock-notebook.c
+++ b/gdl/gdl-dock-notebook.c
@@ -26,7 +26,6 @@
#include "gdl-i18n.h"
#include "gdl-switcher.h"
-#include "gdl-tools.h"
#include "gdl-dock-notebook.h"
#include "gdl-dock-tablabel.h"
@@ -34,7 +33,6 @@
/* Private prototypes */
static void gdl_dock_notebook_class_init (GdlDockNotebookClass *klass);
-static void gdl_dock_notebook_instance_init (GdlDockNotebook *notebook);
static void gdl_dock_notebook_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -90,7 +88,7 @@ enum {
/* ----- Private functions ----- */
-GDL_CLASS_BOILERPLATE (GdlDockNotebook, gdl_dock_notebook, GdlDockItem, GDL_TYPE_DOCK_ITEM) ;
+G_DEFINE_TYPE (GdlDockNotebook, gdl_dock_notebook, GDL_TYPE_DOCK_ITEM);
static void
gdl_dock_notebook_class_init (GdlDockNotebookClass *klass)
@@ -176,7 +174,7 @@ gdl_dock_notebook_button_cb (GtkWidget *widget,
}
static void
-gdl_dock_notebook_instance_init (GdlDockNotebook *notebook)
+gdl_dock_notebook_init (GdlDockNotebook *notebook)
{
GdlDockItem *item;
@@ -250,7 +248,7 @@ gdl_dock_notebook_destroy (GtkObject *object)
/* we need to call the virtual first, since in GdlDockDestroy our
children dock objects are detached */
- GDL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+ GTK_OBJECT_CLASS (gdl_dock_notebook_parent_class)->destroy (object);
/* after that we can remove the GtkNotebook */
if (item->child) {
@@ -324,8 +322,8 @@ gdl_dock_notebook_forall (GtkContainer *container,
if (include_internals) {
/* use GdlDockItem's forall */
- GDL_CALL_PARENT (GTK_CONTAINER_CLASS, forall,
- (container, include_internals, callback, callback_data));
+ GTK_CONTAINER_CLASS (gdl_dock_notebook_parent_class)->forall
+ (container, include_internals, callback, callback_data);
}
else {
item = GDL_DOCK_ITEM (container);
@@ -427,8 +425,7 @@ gdl_dock_notebook_dock (GdlDockObject *object,
}
}
else
- GDL_CALL_PARENT (GDL_DOCK_OBJECT_CLASS, dock,
- (object, requestor, position, other_data));
+ GDL_DOCK_OBJECT_CLASS (gdl_dock_notebook_parent_class)->dock (object, requestor, position, other_data);
}
static void
@@ -442,7 +439,7 @@ gdl_dock_notebook_set_orientation (GdlDockItem *item,
gtk_notebook_set_tab_pos (GTK_NOTEBOOK (item->child), GTK_POS_LEFT);
}
- GDL_CALL_PARENT (GDL_DOCK_ITEM_CLASS, set_orientation, (item, orientation));
+ GDL_DOCK_ITEM_CLASS (gdl_dock_notebook_parent_class)->set_orientation (item, orientation);
}
static gboolean
@@ -487,7 +484,7 @@ gdl_dock_notebook_present (GdlDockObject *object,
if (i >= 0)
gtk_notebook_set_current_page (GTK_NOTEBOOK (item->child), i);
- GDL_CALL_PARENT (GDL_DOCK_OBJECT_CLASS, present, (object, child));
+ GDL_DOCK_OBJECT_CLASS (gdl_dock_notebook_parent_class)->present (object, child);
}
static gboolean
diff --git a/gdl/gdl-dock-object.c b/gdl/gdl-dock-object.c
index d03d8fe..3d125e4 100644
--- a/gdl/gdl-dock-object.c
+++ b/gdl/gdl-dock-object.c
@@ -29,7 +29,6 @@
#include <stdlib.h>
#include <string.h>
-#include "gdl-tools.h"
#include "gdl-dock-object.h"
#include "gdl-dock-master.h"
#include "libgdltypebuiltins.h"
@@ -46,7 +45,6 @@
/* ----- Private prototypes ----- */
static void gdl_dock_object_class_init (GdlDockObjectClass *klass);
-static void gdl_dock_object_instance_init (GdlDockObject *object);
static void gdl_dock_object_set_property (GObject *g_object,
guint prop_id,
@@ -95,7 +93,7 @@ static guint gdl_dock_object_signals [LAST_SIGNAL] = { 0 };
/* ----- Private interface ----- */
-GDL_CLASS_BOILERPLATE (GdlDockObject, gdl_dock_object, GtkContainer, GTK_TYPE_CONTAINER);
+G_DEFINE_TYPE (GdlDockObject, gdl_dock_object, GTK_TYPE_CONTAINER);
static void
gdl_dock_object_class_init (GdlDockObjectClass *klass)
@@ -186,7 +184,7 @@ gdl_dock_object_class_init (GdlDockObjectClass *klass)
}
static void
-gdl_dock_object_instance_init (GdlDockObject *object)
+gdl_dock_object_init (GdlDockObject *object)
{
object->flags = GDL_DOCK_AUTOMATIC;
object->freeze_count = 0;
@@ -268,7 +266,7 @@ gdl_dock_object_finalize (GObject *g_object)
g_free (object->stock_id);
object->stock_id = NULL;
- GDL_CALL_PARENT (G_OBJECT_CLASS, finalize, (g_object));
+ G_OBJECT_CLASS (gdl_dock_object_parent_class)->finalize (g_object);
}
static void
@@ -305,7 +303,7 @@ gdl_dock_object_destroy (GtkObject *gtk_object)
if (object->master)
gdl_dock_object_unbind (object);
- GDL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (gtk_object));
+ GTK_OBJECT_CLASS(gdl_dock_object_parent_class)->destroy (gtk_object);
}
static void
@@ -326,7 +324,7 @@ gdl_dock_object_show (GtkWidget *widget)
(GtkCallback) gdl_dock_object_foreach_automatic,
gtk_widget_show);
}
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, show, (widget));
+ GTK_WIDGET_CLASS (gdl_dock_object_parent_class)->show (widget);
}
static void
@@ -337,7 +335,7 @@ gdl_dock_object_hide (GtkWidget *widget)
(GtkCallback) gdl_dock_object_foreach_automatic,
gtk_widget_hide);
}
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, hide, (widget));
+ GTK_WIDGET_CLASS (gdl_dock_object_parent_class)->hide (widget);
}
static void
@@ -541,7 +539,8 @@ gdl_dock_object_reduce (GdlDockObject *object)
return;
}
- GDL_CALL_VIRTUAL (object, GDL_DOCK_OBJECT_GET_CLASS, reduce, (object));
+ if (GDL_DOCK_OBJECT_GET_CLASS (object)->reduce)
+ GDL_DOCK_OBJECT_GET_CLASS (object)->reduce (object);
}
gboolean
@@ -551,12 +550,11 @@ gdl_dock_object_dock_request (GdlDockObject *object,
GdlDockRequest *request)
{
g_return_val_if_fail (object != NULL && request != NULL, FALSE);
-
- return GDL_CALL_VIRTUAL_WITH_DEFAULT (object,
- GDL_DOCK_OBJECT_GET_CLASS,
- dock_request,
- (object, x, y, request),
- FALSE);
+
+ if (GDL_DOCK_OBJECT_GET_CLASS (object)->dock_request)
+ return GDL_DOCK_OBJECT_GET_CLASS (object)->dock_request (object, x, y, request);
+ else
+ return FALSE;
}
/**
@@ -677,11 +675,10 @@ gdl_dock_object_reorder (GdlDockObject *object,
{
g_return_val_if_fail (object != NULL && child != NULL, FALSE);
- return GDL_CALL_VIRTUAL_WITH_DEFAULT (object,
- GDL_DOCK_OBJECT_GET_CLASS,
- reorder,
- (object, child, new_position, other_data),
- FALSE);
+ if (GDL_DOCK_OBJECT_GET_CLASS (object)->reorder)
+ GDL_DOCK_OBJECT_GET_CLASS (object)->reorder (object, child, new_position, other_data);
+ else
+ return FALSE;
}
void
@@ -697,7 +694,8 @@ gdl_dock_object_present (GdlDockObject *object,
/* chain the call to our parent */
gdl_dock_object_present (parent, object);
- GDL_CALL_VIRTUAL (object, GDL_DOCK_OBJECT_GET_CLASS, present, (object, child));
+ if (GDL_DOCK_OBJECT_GET_CLASS (object)->present)
+ GDL_DOCK_OBJECT_GET_CLASS (object)->present (object, child);
}
/**
@@ -730,10 +728,10 @@ gdl_dock_object_child_placement (GdlDockObject *object,
if (!gdl_dock_object_is_compound (object))
return FALSE;
- return GDL_CALL_VIRTUAL_WITH_DEFAULT (object, GDL_DOCK_OBJECT_GET_CLASS,
- child_placement,
- (object, child, placement),
- FALSE);
+ if (GDL_DOCK_OBJECT_GET_CLASS (object)->child_placement)
+ GDL_DOCK_OBJECT_GET_CLASS (object)->child_placement (object, child, placement);
+ else
+ return FALSE;
}
diff --git a/gdl/gdl-dock-paned.c b/gdl/gdl-dock-paned.c
index 2b6bd1b..42212d4 100644
--- a/gdl/gdl-dock-paned.c
+++ b/gdl/gdl-dock-paned.c
@@ -29,14 +29,13 @@
#include <string.h>
#include <gtk/gtk.h>
-#include "gdl-tools.h"
#include "gdl-dock-paned.h"
/* Private prototypes */
static void gdl_dock_paned_class_init (GdlDockPanedClass *klass);
-static void gdl_dock_paned_instance_init (GdlDockPaned *paned);
+static void gdl_dock_paned_init (GdlDockPaned *paned);
static GObject *gdl_dock_paned_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_param);
@@ -88,7 +87,7 @@ enum {
/* ----- Private functions ----- */
-GDL_CLASS_BOILERPLATE (GdlDockPaned, gdl_dock_paned, GdlDockItem, GDL_TYPE_DOCK_ITEM);
+G_DEFINE_TYPE (GdlDockPaned, gdl_dock_paned, GDL_TYPE_DOCK_ITEM);
static void
gdl_dock_paned_class_init (GdlDockPanedClass *klass)
@@ -136,7 +135,7 @@ gdl_dock_paned_class_init (GdlDockPanedClass *klass)
}
static void
-gdl_dock_paned_instance_init (GdlDockPaned *paned)
+gdl_dock_paned_init (GdlDockPaned *paned)
{
paned->position_changed = FALSE;
}
@@ -221,13 +220,10 @@ gdl_dock_paned_constructor (GType type,
GObjectConstructParam *construct_param)
{
GObject *g_object;
-
- g_object = GDL_CALL_PARENT_WITH_DEFAULT (G_OBJECT_CLASS,
- constructor,
- (type,
- n_construct_properties,
- construct_param),
- NULL);
+
+ g_object = G_OBJECT_CLASS (gdl_dock_paned_parent_class)-> constructor (type,
+ n_construct_properties,
+ construct_param);
if (g_object) {
GdlDockItem *item = GDL_DOCK_ITEM (g_object);
@@ -290,7 +286,7 @@ gdl_dock_paned_destroy (GtkObject *object)
/* we need to call the virtual first, since in GdlDockDestroy our
children dock objects are detached */
- GDL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+ GTK_OBJECT_CLASS (gdl_dock_paned_parent_class)->destroy (object);
/* after that we can remove the GtkNotebook */
if (item->child) {
@@ -347,8 +343,8 @@ gdl_dock_paned_forall (GtkContainer *container,
if (include_internals) {
/* use GdlDockItem's forall */
- GDL_CALL_PARENT (GTK_CONTAINER_CLASS, forall,
- (container, include_internals, callback, callback_data));
+ GTK_CONTAINER_CLASS (gdl_dock_paned_parent_class)->forall
+ (container, include_internals, callback, callback_data);
}
else {
item = GDL_DOCK_ITEM (container);
@@ -587,8 +583,8 @@ gdl_dock_paned_dock (GdlDockObject *object,
if (!done) {
/* this will create another paned and reparent us there */
- GDL_CALL_PARENT (GDL_DOCK_OBJECT_CLASS, dock, (object, requestor, position,
- other_data));
+ GDL_DOCK_OBJECT_CLASS (gdl_dock_paned_parent_class)->dock (object, requestor, position,
+ other_data);
}
else {
gdl_dock_item_show_grip (GDL_DOCK_ITEM (requestor));
@@ -634,7 +630,7 @@ gdl_dock_paned_set_orientation (GdlDockItem *item,
}
}
- GDL_CALL_PARENT (GDL_DOCK_ITEM_CLASS, set_orientation, (item, orientation));
+ GDL_DOCK_ITEM_CLASS (gdl_dock_paned_parent_class)->set_orientation (item, orientation);
}
static gboolean
diff --git a/gdl/gdl-dock-placeholder.c b/gdl/gdl-dock-placeholder.c
index 4d6202e..8cde7a5 100644
--- a/gdl/gdl-dock-placeholder.c
+++ b/gdl/gdl-dock-placeholder.c
@@ -27,7 +27,6 @@
#include "gdl-i18n.h"
-#include "gdl-tools.h"
#include "gdl-dock-placeholder.h"
#include "gdl-dock-item.h"
#include "gdl-dock-paned.h"
@@ -40,7 +39,6 @@
/* ----- Private prototypes ----- */
static void gdl_dock_placeholder_class_init (GdlDockPlaceholderClass *klass);
-static void gdl_dock_placeholder_instance_init (GdlDockPlaceholder *ph);
static void gdl_dock_placeholder_set_property (GObject *g_object,
guint prop_id,
@@ -120,8 +118,7 @@ struct _GdlDockPlaceholderPrivate {
/* ----- Private interface ----- */
-GDL_CLASS_BOILERPLATE (GdlDockPlaceholder, gdl_dock_placeholder,
- GdlDockObject, GDL_TYPE_DOCK_OBJECT);
+G_DEFINE_TYPE (GdlDockPlaceholder, gdl_dock_placeholder, GDL_TYPE_DOCK_OBJECT);
static void
gdl_dock_placeholder_class_init (GdlDockPlaceholderClass *klass)
@@ -214,7 +211,7 @@ gdl_dock_placeholder_class_init (GdlDockPlaceholderClass *klass)
}
static void
-gdl_dock_placeholder_instance_init (GdlDockPlaceholder *ph)
+gdl_dock_placeholder_init (GdlDockPlaceholder *ph)
{
gtk_widget_set_has_window (GTK_WIDGET (ph), FALSE);
gtk_widget_set_can_focus (GTK_WIDGET (ph), FALSE);
@@ -326,7 +323,7 @@ gdl_dock_placeholder_destroy (GtkObject *object)
ph->_priv = NULL;
}
- GDL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+ GTK_OBJECT_CLASS (gdl_dock_placeholder_parent_class)->destroy (object);
}
static void
diff --git a/gdl/gdl-dock-tablabel.c b/gdl/gdl-dock-tablabel.c
index 6a2db70..441db34 100644
--- a/gdl/gdl-dock-tablabel.c
+++ b/gdl/gdl-dock-tablabel.c
@@ -29,7 +29,6 @@
#include <gtk/gtk.h>
#include "gdl-dock-tablabel.h"
-#include "gdl-tools.h"
#include "gdl-dock-item.h"
#include "libgdlmarshal.h"
@@ -37,7 +36,6 @@
/* ----- Private prototypes ----- */
static void gdl_dock_tablabel_class_init (GdlDockTablabelClass *klass);
-static void gdl_dock_tablabel_instance_init (GdlDockTablabel *tablabel);
static void gdl_dock_tablabel_set_property (GObject *object,
guint prop_id,
@@ -93,8 +91,7 @@ static guint dock_tablabel_signals [LAST_SIGNAL] = { 0 };
/* ----- Private interface ----- */
-GDL_CLASS_BOILERPLATE (GdlDockTablabel, gdl_dock_tablabel,
- GtkBin, GTK_TYPE_BIN);
+G_DEFINE_TYPE (GdlDockTablabel, gdl_dock_tablabel, GTK_TYPE_BIN);
static void
gdl_dock_tablabel_class_init (GdlDockTablabelClass *klass)
@@ -146,7 +143,7 @@ gdl_dock_tablabel_class_init (GdlDockTablabelClass *klass)
}
static void
-gdl_dock_tablabel_instance_init (GdlDockTablabel *tablabel)
+gdl_dock_tablabel_init (GdlDockTablabel *tablabel)
{
GtkWidget *widget;
GtkWidget *label_widget;
@@ -394,7 +391,7 @@ gdl_dock_tablabel_expose (GtkWidget *widget,
g_return_val_if_fail (event != NULL, FALSE);
if (gtk_widget_get_visible (widget) && gtk_widget_get_mapped (widget)) {
- GDL_CALL_PARENT_GBOOLEAN(GTK_WIDGET_CLASS, expose_event, (widget,event));
+ GTK_WIDGET_CLASS (gdl_dock_tablabel_parent_class)->expose_event (widget,event);
gdl_dock_tablabel_paint (widget, event);
};
@@ -578,15 +575,15 @@ gdl_dock_tablabel_unrealize (GtkWidget *widget)
tablabel->event_window = NULL;
}
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, unrealize, (widget));
+ GTK_WIDGET_CLASS (gdl_dock_tablabel_parent_class)->unrealize (widget);
}
static void
gdl_dock_tablabel_map (GtkWidget *widget)
{
GdlDockTablabel *tablabel = GDL_DOCK_TABLABEL (widget);
-
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, map, (widget));
+
+ GTK_WIDGET_CLASS (gdl_dock_tablabel_parent_class)->map (widget);
gdk_window_show (tablabel->event_window);
}
@@ -598,7 +595,7 @@ gdl_dock_tablabel_unmap (GtkWidget *widget)
gdk_window_hide (tablabel->event_window);
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, unmap, (widget));
+ GTK_WIDGET_CLASS (gdl_dock_tablabel_parent_class)->unmap (widget);
}
/* ----- Public interface ----- */
diff --git a/gdl/gdl-dock.c b/gdl/gdl-dock.c
index 27d5fe1..7d836b7 100644
--- a/gdl/gdl-dock.c
+++ b/gdl/gdl-dock.c
@@ -28,7 +28,6 @@
#include <stdlib.h>
#include <string.h>
-#include "gdl-tools.h"
#include "gdl-dock.h"
#include "gdl-dock-master.h"
#include "gdl-dock-paned.h"
@@ -44,7 +43,6 @@
/* ----- Private prototypes ----- */
static void gdl_dock_class_init (GdlDockClass *class);
-static void gdl_dock_instance_init (GdlDock *dock);
static GObject *gdl_dock_constructor (GType type,
guint n_construct_properties,
@@ -150,7 +148,7 @@ static guint dock_signals [LAST_SIGNAL] = { 0 };
/* ----- Private functions ----- */
-GDL_CLASS_BOILERPLATE (GdlDock, gdl_dock, GdlDockObject, GDL_TYPE_DOCK_OBJECT);
+G_DEFINE_TYPE (GdlDock, gdl_dock, GDL_TYPE_DOCK_OBJECT);
static void
gdl_dock_class_init (GdlDockClass *klass)
@@ -261,7 +259,7 @@ gdl_dock_class_init (GdlDockClass *klass)
}
static void
-gdl_dock_instance_init (GdlDock *dock)
+gdl_dock_init (GdlDock *dock)
{
gtk_widget_set_has_window (GTK_WIDGET (dock), FALSE);
@@ -295,17 +293,14 @@ gdl_dock_constructor (GType type,
GObjectConstructParam *construct_param)
{
GObject *g_object;
-
- g_object = GDL_CALL_PARENT_WITH_DEFAULT (G_OBJECT_CLASS,
- constructor,
- (type,
- n_construct_properties,
- construct_param),
- NULL);
+
+ g_object = G_OBJECT_CLASS (gdl_dock_parent_class)-> constructor (type,
+ n_construct_properties,
+ construct_param);
if (g_object) {
GdlDock *dock = GDL_DOCK (g_object);
GdlDockMaster *master;
-
+
/* create a master for the dock if none was provided in the construction */
master = GDL_DOCK_OBJECT_GET_MASTER (GDL_DOCK_OBJECT (dock));
if (!master) {
@@ -317,11 +312,11 @@ gdl_dock_constructor (GType type,
if (dock->_priv->floating) {
GdlDockObject *controller;
-
+
/* create floating window for this dock */
dock->_priv->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_object_set_data (G_OBJECT (dock->_priv->window), "dock", dock);
-
+
/* set position and default size */
gtk_window_set_position (GTK_WINDOW (dock->_priv->window),
GTK_WIN_POS_MOUSE);
@@ -330,32 +325,32 @@ gdl_dock_constructor (GType type,
dock->_priv->height);
gtk_window_set_type_hint (GTK_WINDOW (dock->_priv->window),
GDK_WINDOW_TYPE_HINT_NORMAL);
-
+
/* metacity ignores this */
gtk_window_move (GTK_WINDOW (dock->_priv->window),
dock->_priv->float_x,
dock->_priv->float_y);
-
+
/* connect to the configure event so we can track down window geometry */
g_signal_connect (dock->_priv->window, "configure_event",
(GCallback) gdl_dock_floating_configure_event_cb,
dock);
-
+
/* set the title and connect to the long_name notify queue
- so we can reset the title when this prop changes */
+ so we can reset the title when this prop changes */
gdl_dock_set_title (dock);
g_signal_connect (dock, "notify::long-name",
(GCallback) gdl_dock_notify_cb, NULL);
-
+
gtk_container_add (GTK_CONTAINER (dock->_priv->window), GTK_WIDGET (dock));
-
+
g_signal_connect (dock->_priv->window, "delete_event",
G_CALLBACK (gdl_dock_floating_window_delete_event_cb),
NULL);
}
GDL_DOCK_OBJECT_SET_FLAGS (dock, GDL_DOCK_ATTACHED);
}
-
+
return g_object;
}
@@ -530,7 +525,7 @@ gdl_dock_destroy (GtkObject *object)
g_free (priv);
}
- GDL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+ GTK_OBJECT_CLASS (gdl_dock_parent_class)->destroy (object);
}
static void
@@ -600,7 +595,7 @@ gdl_dock_map (GtkWidget *widget)
dock = GDL_DOCK (widget);
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, map, (widget));
+ GTK_WIDGET_CLASS (gdl_dock_parent_class)->map (widget);
if (dock->root) {
child = GTK_WIDGET (dock->root);
@@ -620,7 +615,7 @@ gdl_dock_unmap (GtkWidget *widget)
dock = GDL_DOCK (widget);
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, unmap, (widget));
+ GTK_WIDGET_CLASS (gdl_dock_parent_class)->unmap (widget);
if (dock->root) {
child = GTK_WIDGET (dock->root);
@@ -650,7 +645,7 @@ gdl_dock_show (GtkWidget *widget)
g_return_if_fail (widget != NULL);
g_return_if_fail (GDL_IS_DOCK (widget));
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, show, (widget));
+ GTK_WIDGET_CLASS (gdl_dock_parent_class)->show (widget);
dock = GDL_DOCK (widget);
if (dock->_priv->floating && dock->_priv->window)
@@ -671,7 +666,7 @@ gdl_dock_hide (GtkWidget *widget)
g_return_if_fail (widget != NULL);
g_return_if_fail (GDL_IS_DOCK (widget));
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, hide, (widget));
+ GTK_WIDGET_CLASS (gdl_dock_parent_class)->hide (widget);
dock = GDL_DOCK (widget);
if (dock->_priv->floating && dock->_priv->window)
diff --git a/gdl/gdl-switcher.c b/gdl/gdl-switcher.c
index dc55273..213e927 100644
--- a/gdl/gdl-switcher.c
+++ b/gdl/gdl-switcher.c
@@ -32,7 +32,6 @@
#include "gdl-i18n.h"
#include "gdl-switcher.h"
-#include "gdl-tools.h"
#include "libgdlmarshal.h"
#include "libgdltypebuiltins.h"
@@ -88,7 +87,7 @@ struct _GdlSwitcherPrivate {
gboolean in_toggle;
};
-GDL_CLASS_BOILERPLATE (GdlSwitcher, gdl_switcher, GtkNotebook, GTK_TYPE_NOTEBOOK)
+G_DEFINE_TYPE (GdlSwitcher, gdl_switcher, GTK_TYPE_NOTEBOOK)
#define INTERNAL_MODE(switcher) (switcher->priv->switcher_style == \
GDL_SWITCHER_STYLE_TOOLBAR ? switcher->priv->toolbar_style : \
@@ -276,8 +275,7 @@ layout_buttons (GdlSwitcher *switcher)
last_buttons_height = switcher->priv->buttons_height_request;
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, size_request,
- (GTK_WIDGET (switcher), &client_requisition));
+ GTK_WIDGET_CLASS (gdl_switcher_parent_class)->size_request (GTK_WIDGET (switcher), &client_requisition);
y = allocation.y + allocation.height - V_PADDING - 1;
@@ -453,8 +451,7 @@ do_layout (GdlSwitcher *switcher)
child_allocation.width = allocation.width;
child_allocation.height = y - allocation.y;
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, size_allocate,
- (GTK_WIDGET (switcher), &child_allocation));
+ GTK_WIDGET_CLASS (gdl_switcher_parent_class)->size_allocate (GTK_WIDGET (switcher), &child_allocation);
}
/* GtkContainer methods. */
@@ -467,9 +464,9 @@ gdl_switcher_forall (GtkContainer *container, gboolean include_internals,
GDL_SWITCHER (container);
GSList *p;
- GDL_CALL_PARENT (GTK_CONTAINER_CLASS, forall,
- (GTK_CONTAINER (switcher), include_internals,
- callback, callback_data));
+ GTK_CONTAINER_CLASS (gdl_switcher_parent_class)->forall (GTK_CONTAINER (switcher),
+ include_internals,
+ callback, callback_data);
if (include_internals) {
for (p = switcher->priv->buttons; p != NULL; p = p->next) {
GtkWidget *widget = ((Button *) p->data)->button_widget;
@@ -499,8 +496,7 @@ gdl_switcher_remove (GtkContainer *container, GtkWidget *widget)
break;
}
}
- GDL_CALL_PARENT (GTK_CONTAINER_CLASS, remove,
- (GTK_CONTAINER (switcher), widget));
+ GTK_CONTAINER_CLASS (gdl_switcher_parent_class)->remove (GTK_CONTAINER (switcher), widget);
}
/* GtkWidget methods. */
@@ -512,8 +508,7 @@ gdl_switcher_size_request (GtkWidget *widget, GtkRequisition *requisition)
GSList *p;
gint button_height = 0;
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, size_request,
- (GTK_WIDGET (switcher), requisition));
+ GTK_WIDGET_CLASS (gdl_switcher_parent_class)->size_request (GTK_WIDGET (switcher), requisition);
if (!switcher->priv->show)
return;
@@ -556,8 +551,7 @@ gdl_switcher_expose (GtkWidget *widget, GdkEventExpose *event)
button, event);
}
}
- return GDL_CALL_PARENT_WITH_DEFAULT (GTK_WIDGET_CLASS, expose_event,
- (widget, event), FALSE);
+ return GTK_WIDGET_CLASS (gdl_switcher_parent_class)->expose_event (widget, event);
}
static void
@@ -572,7 +566,7 @@ gdl_switcher_map (GtkWidget *widget)
gtk_widget_map (button);
}
}
- GDL_CALL_PARENT (GTK_WIDGET_CLASS, map, (widget));
+ GTK_WIDGET_CLASS (gdl_switcher_parent_class)->map (widget);
}
/* GObject methods. */
@@ -632,7 +626,7 @@ gdl_switcher_dispose (GObject *object)
g_slist_free (priv->buttons);
priv->buttons = NULL;
- GDL_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
+ G_OBJECT_CLASS (gdl_switcher_parent_class)->dispose (object);
}
static void
@@ -642,7 +636,7 @@ gdl_switcher_finalize (GObject *object)
g_free (priv);
- GDL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
+ G_OBJECT_CLASS (gdl_switcher_parent_class)->finalize (object);
}
/* Signal handlers */
@@ -749,7 +743,7 @@ gdl_switcher_class_init (GdlSwitcherClass *klass)
}
static void
-gdl_switcher_instance_init (GdlSwitcher *switcher)
+gdl_switcher_init (GdlSwitcher *switcher)
{
GdlSwitcherPrivate *priv;
diff --git a/gdl/gdl.h b/gdl/gdl.h
index b288969..9ba6459 100644
--- a/gdl/gdl.h
+++ b/gdl/gdl.h
@@ -22,7 +22,6 @@
#ifndef __GDL_H__
#define __GDL_H__
-#include <gdl/gdl-tools.h>
#include <gdl/gdl-dock-object.h>
#include <gdl/gdl-dock-master.h>
#include <gdl/gdl-dock.h>
diff --git a/gdl/test-dock.c b/gdl/test-dock.c
index c891116..caf5b91 100644
--- a/gdl/test-dock.c
+++ b/gdl/test-dock.c
@@ -7,8 +7,6 @@
#include <string.h>
#include <gtk/gtk.h>
-#include "gdl-tools.h"
-
#include "gdl-dock.h"
#include "gdl-dock-item.h"
#include "gdl-dock-notebook.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]