From 84a63033c820bf890e0bcecd2f07cc325c44e9e9 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 7 May 2012 17:18:10 -0700 Subject: require gtk3 --- Makefile.am | 4 ---- configure.ac | 15 +-------------- example/Makefile.am | 4 ---- example/menus.c | 4 ---- example/messagedialog.c | 4 ---- src/Makefile.am | 5 ----- src/idocalendarmenuitem.c | 4 ---- src/idoentrymenuitem.c | 4 ---- src/idomessagedialog.c | 16 ---------------- src/idorange.c | 10 ---------- src/idoscalemenuitem.c | 32 -------------------------------- tests/Makefile.am | 5 ----- 12 files changed, 1 insertion(+), 106 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6cad78b..4b2a6d3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,6 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -if USE_GTK3 VER=3 -else -VER= -endif V = @ Q = $(V:1=) diff --git a/configure.ac b/configure.ac index 6e350b9..8b69cca 100644 --- a/configure.ac +++ b/configure.ac @@ -78,19 +78,7 @@ AC_FUNC_MALLOC AC_FUNC_MMAP AC_CHECK_FUNCS([memset munmap strcasecmp strdup]) -AC_ARG_WITH([gtk], - [AS_HELP_STRING([--with-gtk], - [Which version of gtk to use @<:@default=3@:>@])], - [], - [with_gtk=3]) -AM_CONDITIONAL(USE_GTK3, [test "x$with_gtk" = x3]) - -if test "x$with_gtk" = "x2"; then - PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.19.7) -else - PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0.0) - AC_DEFINE_UNQUOTED(USE_GTK3, , [Use GTK3]) -fi +PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0.0) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) @@ -157,7 +145,6 @@ echo " ido $VERSION" echo " ===============================" echo "" echo " Prefix : ${prefix}" -echo " GTK : ${with_gtk}" echo " gcov : ${use_gcov}" echo "" echo " Documentation: ${enable_gtk_doc}" diff --git a/example/Makefile.am b/example/Makefile.am index b986b9b..a578404 100644 --- a/example/Makefile.am +++ b/example/Makefile.am @@ -1,8 +1,4 @@ -if USE_GTK3 VER=3 -else -VER= -endif noinst_PROGRAMS = \ messagedialog \ diff --git a/example/menus.c b/example/menus.c index b563eaf..207c0e4 100644 --- a/example/menus.c +++ b/example/menus.c @@ -38,11 +38,7 @@ main (int argc, char *argv[]) g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL); -#ifdef USE_GTK3 vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); -#else - vbox = gtk_vbox_new (FALSE, 0); -#endif gtk_container_add (GTK_CONTAINER (window), vbox); diff --git a/example/messagedialog.c b/example/messagedialog.c index 4ba866b..d9cfc21 100644 --- a/example/messagedialog.c +++ b/example/messagedialog.c @@ -41,11 +41,7 @@ main (int argc, char *argv[]) gtk_window_set_title (GTK_WINDOW (window), "Message Dialogs"); g_signal_connect (window, "destroy", gtk_main_quit, NULL); -#ifdef USE_GTK3 vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); -#else - vbox = gtk_vbox_new (FALSE, 0); -#endif gtk_container_add (GTK_CONTAINER (window), vbox); diff --git a/src/Makefile.am b/src/Makefile.am index b849bf5..4e9b77f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,10 +1,5 @@ -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 diff --git a/src/idocalendarmenuitem.c b/src/idocalendarmenuitem.c index da7c436..f5bd60f 100644 --- a/src/idocalendarmenuitem.c +++ b/src/idocalendarmenuitem.c @@ -132,11 +132,7 @@ ido_calendar_menu_item_init (IdoCalendarMenuItem *item) G_CALLBACK (calendar_move_focus_cb), item); -#ifdef USE_GTK3 priv->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); -#else - priv->box = gtk_hbox_new (FALSE, 0); -#endif gtk_box_pack_start (GTK_BOX (priv->box), priv->calendar, FALSE, FALSE, 0); diff --git a/src/idoentrymenuitem.c b/src/idoentrymenuitem.c index 088c559..17e8314 100644 --- a/src/idoentrymenuitem.c +++ b/src/idoentrymenuitem.c @@ -119,11 +119,7 @@ ido_entry_menu_item_init (IdoEntryMenuItem *item) G_CALLBACK (entry_move_focus_cb), item); -#ifdef USE_GTK3 priv->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); -#else - priv->box = gtk_hbox_new (FALSE, 0); -#endif gtk_box_pack_start (GTK_BOX (priv->box), priv->entry, FALSE, FALSE, 0); diff --git a/src/idomessagedialog.c b/src/idomessagedialog.c index d4a3e2f..d3f73aa 100644 --- a/src/idomessagedialog.c +++ b/src/idomessagedialog.c @@ -167,22 +167,14 @@ ido_message_dialog_focus_in_event (GtkWidget *widget, IdoTimeline *timeline; IdoMessageDialogMorphContext *context; -#ifdef USE_GTK3 gtk_widget_get_preferred_size (GTK_WIDGET (dialog), NULL, &start); -#else - gtk_widget_get_requisition (GTK_WIDGET (dialog), &start); -#endif priv->expanded = TRUE; gtk_widget_show (priv->action_area); gtk_widget_show (priv->secondary_label); -#ifdef USE_GTK3 gtk_widget_get_preferred_size (GTK_WIDGET (dialog), NULL, &end); -#else - gtk_widget_get_requisition (GTK_WIDGET (dialog), &end); -#endif gtk_widget_hide (priv->action_area); gtk_widget_hide (priv->secondary_label); @@ -379,11 +371,7 @@ ido_message_dialog_get_label (IdoMessageDialog *dialog, gboolean primary) for (list = children; list != NULL; list = list->next) { -#ifdef USE_GTK3 if (G_TYPE_FROM_INSTANCE (list->data) == GTK_TYPE_BOX && gtk_orientable_get_orientation (list->data) == GTK_ORIENTATION_HORIZONTAL) -#else - if (G_TYPE_FROM_INSTANCE (list->data) == GTK_TYPE_HBOX) -#endif { GList *hchildren; GList *hlist; @@ -393,11 +381,7 @@ ido_message_dialog_get_label (IdoMessageDialog *dialog, gboolean primary) for (hlist = hchildren; hlist != NULL; hlist = hlist->next) { -#ifdef USE_GTK3 if (G_TYPE_FROM_INSTANCE (hlist->data) == GTK_TYPE_BOX && gtk_orientable_get_orientation (hlist->data) == GTK_ORIENTATION_VERTICAL) -#else - if (G_TYPE_FROM_INSTANCE (hlist->data) == GTK_TYPE_VBOX) -#endif { GList *vlist; GtkWidget *vbox = GTK_WIDGET (hlist->data); diff --git a/src/idorange.c b/src/idorange.c index b9c9cab..4f165bb 100644 --- a/src/idorange.c +++ b/src/idorange.c @@ -153,16 +153,6 @@ ido_range_constructed (GObject *object) "knob-width", &width, "knob-height", &height, NULL); - -#ifndef USE_GTK3 - g_snprintf (buf, sizeof (buf), - "style \"ido-range\" {\n" - " GtkRange::slider-width = %d\n" - " GtkScale::slider-length = %d\n" - "} widget \"*.idorange-%p\" style \"ido-range\"\n", - width, height, range); - gtk_rc_parse_string (buf); -#endif } gtk_range_set_slider_size_fixed (GTK_RANGE (range), TRUE); diff --git a/src/idoscalemenuitem.c b/src/idoscalemenuitem.c index 4b60b8b..b3c80f6 100644 --- a/src/idoscalemenuitem.c +++ b/src/idoscalemenuitem.c @@ -144,27 +144,15 @@ ido_scale_menu_item_size_allocate (GtkWidget *widget, switch (priv->style) { case IDO_SCALE_MENU_ITEM_STYLE_IMAGE: -#ifdef USE_GTK3 gtk_widget_get_preferred_size (priv->primary_image, &primary_req, NULL); gtk_widget_get_preferred_size (priv->secondary_image, &secondary_req, NULL); -#else - gtk_widget_get_child_requisition (priv->primary_image, &primary_req); - gtk_widget_get_child_requisition (priv->secondary_image, &secondary_req); -#endif - primary_padding = gtk_widget_get_visible (priv->primary_image) ? primary_req.width : 0; secondary_padding = gtk_widget_get_visible (priv->secondary_image) ? secondary_req.width : 0; break; case IDO_SCALE_MENU_ITEM_STYLE_LABEL: -#ifdef USE_GTK3 gtk_widget_get_preferred_size (priv->primary_label, &primary_req, NULL); gtk_widget_get_preferred_size (priv->secondary_label, &secondary_req, NULL); -#else - gtk_widget_get_child_requisition (priv->primary_label, &primary_req); - gtk_widget_get_child_requisition (priv->secondary_label, &secondary_req); -#endif - primary_padding = gtk_widget_get_visible (priv->primary_label) ? primary_req.width : 0; secondary_padding = gtk_widget_get_visible (priv->secondary_label) ? secondary_req.width : 0; break; @@ -256,11 +244,7 @@ ido_scale_menu_item_constructed (GObject *object) G_CALLBACK (on_scale_button_press_or_release_event), NULL); -#ifdef USE_GTK3 hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); -#else - hbox = gtk_hbox_new (FALSE, 0); -#endif priv->primary_image = gtk_image_new (); g_signal_connect (priv->primary_image, "notify", @@ -505,10 +489,6 @@ ido_scale_menu_item_button_press_event (GtkWidget *menuitem, IdoScaleMenuItemPrivate *priv = GET_PRIVATE (menuitem); gdouble x; -#ifndef USE_GTK3 - GtkWidget *scale = priv->scale; -#endif - // can we block emissions of "grab-notify" on parent?? translate_event_coordinates (menuitem, event->x, &x); @@ -517,28 +497,16 @@ ido_scale_menu_item_button_press_event (GtkWidget *menuitem, translate_event_coordinates (menuitem, event->x_root, &x); event->x_root = x; -#ifndef USE_GTK3 - ubuntu_gtk_widget_set_has_grab (scale, TRUE); -#endif - gtk_widget_event (priv->scale, ((GdkEvent *)(void*)(event))); -#ifndef USE_GTK3 - ubuntu_gtk_widget_set_has_grab (scale, FALSE); -#endif - if (!priv->grabbed) { priv->grabbed = TRUE; g_signal_emit (menuitem, signals[SLIDER_GRABBED], 0); } -#ifdef USE_GTK3 return FALSE; -#else - return TRUE; -#endif } static gboolean diff --git a/tests/Makefile.am b/tests/Makefile.am index 04e6cde..89b9b5b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,10 +1,5 @@ -if USE_GTK3 VER=3 IDOLIB = $(top_builddir)/src/libido3-0.1.la -else -VER= -IDOLIB = $(top_builddir)/src/libido-0.1.la -endif check_LIBRARIES = libgtest.a check_PROGRAMS = -- cgit v1.2.3