aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2011-06-01 15:24:28 -0400
committerMichael Terry <mike@mterry.name>2011-06-01 15:24:28 -0400
commit5ddcf6b51cdcb8d793748ff4a812f843a0d4f6e7 (patch)
tree67cdd3557d77ae36dbc61ed05cd6c136bf4f2fe8 /src
parent3e67ec3d19dd4e31ec68b1b9c33f4b330c7672a3 (diff)
downloadayatana-ido-5ddcf6b51cdcb8d793748ff4a812f843a0d4f6e7.tar.gz
ayatana-ido-5ddcf6b51cdcb8d793748ff4a812f843a0d4f6e7.tar.bz2
ayatana-ido-5ddcf6b51cdcb8d793748ff4a812f843a0d4f6e7.zip
allow building either gtk2 or gtk3 versions; some deprecation cleanups
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am20
-rw-r--r--src/idomessagedialog.c8
-rw-r--r--src/idoscalemenuitem.c7
3 files changed, 21 insertions, 14 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 1485019..5ac5a01 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,11 @@
+if USE_GTK3
+VER=3
+lib_LTLIBRARIES = libido3-0.1.la
+else
+VER=
+lib_LTLIBRARIES = libido-0.1.la
+endif
+
ido_built_public_sources = \
idotypebuiltins.h
@@ -40,16 +48,13 @@ INCLUDES = \
-DLIBDIR=\"$(libdir)"\" \
-DG_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
- -DGDK_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED
+ -DGDK_DISABLE_DEPRECATED
AM_CPPFLAGS = \
$(GCC_FLAGS) \
$(GTK_CFLAGS) \
$(MAINTAINER_CFLAGS)
-lib_LTLIBRARIES = libido-0.1.la
-
libido_0_1_la_SOURCES = \
idotypebuiltins.c \
idocalendarmenuitem.c \
@@ -58,8 +63,9 @@ libido_0_1_la_SOURCES = \
idorange.c \
idoscalemenuitem.c \
idotimeline.c
+libido3_0_1_la_SOURCES = $(libido_0_1_la_SOURCES)
-libidoincludedir=$(includedir)/libido-0.1/libido
+libidoincludedir=$(includedir)/libido$(VER)-0.1/libido
libidoinclude_HEADERS = \
idocalendarmenuitem.h \
@@ -72,8 +78,8 @@ libidoinclude_HEADERS = \
libido_0_1_la_LIBADD = $(GTK_LIBS)
libido_0_1_la_LDFLAGS = $(GTK_LT_LDFLAGS)
-
-idoheadersdir = $(includedir)/ido-0.1/ido
+libido3_0_1_la_LIBADD = $(libido_0_1_la_LIBADD)
+libido3_0_1_la_LDFLAGS = $(libido_0_1_la_LDFLAGS)
DISTCLEANFILES = \
stamp-idotypebuiltins.h \
diff --git a/src/idomessagedialog.c b/src/idomessagedialog.c
index c5acb03..1e72701 100644
--- a/src/idomessagedialog.c
+++ b/src/idomessagedialog.c
@@ -284,11 +284,13 @@ ido_message_dialog_new (GtkWindow *parent,
NULL);
dialog = GTK_DIALOG (widget);
+#if ! GTK_CHECK_VERSION(3, 0, 0)
if (flags & GTK_DIALOG_NO_SEPARATOR)
{
g_warning ("The GTK_DIALOG_NO_SEPARATOR flag cannot be used for IdoMessageDialog");
flags &= ~GTK_DIALOG_NO_SEPARATOR;
}
+#endif
if (message_format)
{
@@ -296,8 +298,7 @@ ido_message_dialog_new (GtkWindow *parent,
msg = g_strdup_vprintf (message_format, args);
va_end (args);
- gtk_label_set_text (GTK_LABEL (GTK_MESSAGE_DIALOG (widget)->label),
- msg);
+ g_object_set (G_OBJECT (widget), "text", msg, NULL);
g_free (msg);
}
@@ -397,7 +398,8 @@ ido_message_dialog_get_label (IdoMessageDialog *dialog, gboolean primary)
label = GTK_LABEL (vlist->data);
- if (strcmp ((primary ? text : secondary_text), label->label) == 0)
+ if (strcmp ((primary ? text : secondary_text),
+ gtk_label_get_label (label)) == 0)
{
return GTK_WIDGET (label);
}
diff --git a/src/idoscalemenuitem.c b/src/idoscalemenuitem.c
index 5d522ca..6b1189b 100644
--- a/src/idoscalemenuitem.c
+++ b/src/idoscalemenuitem.c
@@ -185,8 +185,8 @@ ido_scale_menu_item_size_allocate (GtkWidget *widget,
priv->right_padding = primary_padding;
}
- priv->child_allocation.x = GTK_CONTAINER (widget)->border_width + widget->style->xthickness;
- priv->child_allocation.y = GTK_CONTAINER (widget)->border_width + widget->style->ythickness;
+ priv->child_allocation.x = gtk_container_get_border_width (GTK_CONTAINER (widget)) + gtk_widget_get_style (widget)->xthickness;
+ priv->child_allocation.y = gtk_container_get_border_width (GTK_CONTAINER (widget)) + gtk_widget_get_style (widget)->ythickness;
priv->child_allocation.x += horizontal_padding;
priv->child_allocation.x += priv->toggle_size;
@@ -261,7 +261,6 @@ static void
ido_scale_menu_item_class_init (IdoScaleMenuItemClass *item_class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (item_class);
- GtkWidgetClass *object_class = GTK_OBJECT_CLASS (item_class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (item_class);
widget_class->button_press_event = ido_scale_menu_item_button_press_event;
@@ -325,7 +324,7 @@ ido_scale_menu_item_class_init (IdoScaleMenuItemClass *item_class)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- g_type_class_add_private (object_class, sizeof (IdoScaleMenuItemPrivate));
+ g_type_class_add_private (item_class, sizeof (IdoScaleMenuItemPrivate));
}
static void