commit ab749ab4307882a41386ab870269b39a58f8a668 Author: phantomjinx <p.g.richard...@phantomjinx.co.uk> Date: Sun Aug 29 21:07:25 2010 +0100
Allow backward compatibility to gtk 2.18 * gtk_widget_get_realized() only available from gtk 2.20. Since Mandriva 2010 includes 2.18, not unreasonable that this version should still be supported. * configure.in Make the -DGSEAL_ENABLE flag conditional on a gsealed_gdk since use of GTK_WIDGET_REALIZED is not an option with gsealed. * Add pp version checks in code to allow for older gtk versions configure.in | 9 ++++----- plugins/cover_display/display_coverart.c | 4 ++++ plugins/details_editor/details.c | 4 ++++ plugins/photo_editor/display_photo.c | 11 +++++++++-- src/anjuta-app.c | 8 ++++++++ 5 files changed, 29 insertions(+), 7 deletions(-) --- diff --git a/configure.in b/configure.in index b2e2571..55ed179 100644 --- a/configure.in +++ b/configure.in @@ -87,16 +87,15 @@ PKG_CHECK_MODULES(GSEALED_GDK, gdk-2.0 >= 2.21.0, have_gsealed_gdk=yes, have_gse AM_CONDITIONAL(HAVE_GSEALED_GDK, test "x$have_gsealed_gdk" = "xyes") if test "x$have_gsealed_gdk" = "xyes"; then AC_DEFINE(HAVE_GSEALED_GDK, 1, [Define if GDK has GSEAL]) + dnl Preparing for GTK3 transition + GTK_CLEANLINESS_FLAGS="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES" + GTK_CLEANLINESS_FLAGS="$GTK_CLEANLINESS_FLAGS -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" + GTK_CLEANLINESS_FLAGS="$GTK_CLEANLINESS_FLAGS -DGSEAL_ENABLE" fi dnl Force C99 mode (no implicit int declarations) CFLAGS="$CFLAGS -std=gnu99 -Werror-implicit-function-declaration" -dnl Preparing for GTK3 transition -GTK_CLEANLINESS_FLAGS="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES" -GTK_CLEANLINESS_FLAGS="$GTK_CLEANLINESS_FLAGS -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" -GTK_CLEANLINESS_FLAGS="$GTK_CLEANLINESS_FLAGS -DGSEAL_ENABLE" - CFLAGS="$CFLAGS $GTK_CFLAGS $GLIB_CFLAGS $GMODULE_CFLAGS $GTHREAD_CFLAGS $LIBGLADE_CFLAGS $LIBGPOD_CFLAGS $LIBANJUTA_CFLAGS $LIBGDL_CFLAGS $GTK_CLEANLINESS_FLAGS" LIBS="$LIBS $GTK_LIBS $GLIB_LIBS $GMODULE_LIBS $GTHREAD_LIBS $LIBGLADE_LIBS $LIBGPOD_LIBS $LIBANJUTA_LIBS $LIBGDL_LIBS" diff --git a/plugins/cover_display/display_coverart.c b/plugins/cover_display/display_coverart.c index 6d0bbab..60dfd40 100644 --- a/plugins/cover_display/display_coverart.c +++ b/plugins/cover_display/display_coverart.c @@ -284,7 +284,11 @@ static void set_display_window_dimensions() { * */ void coverart_block_change(gboolean val) { +#if GTK_CHECK_VERSION(2,20,0) if (gtk_widget_get_realized(GTK_WIDGET(gtkpod_app))) { +#else + if GTK_WIDGET_REALIZED(gtkpod_app) { +#endif if (val) { GdkCursor *cursor = gdk_cursor_new(GDK_WATCH); gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(gtkpod_app)), cursor); diff --git a/plugins/details_editor/details.c b/plugins/details_editor/details.c index 2a08cf3..b022ccb 100644 --- a/plugins/details_editor/details.c +++ b/plugins/details_editor/details.c @@ -1533,7 +1533,11 @@ void details_edit(GList *selected_tracks) { if (!details_view || !details_view->window) { create_details_editor_view(); } +#if GTK_CHECK_VERSION(2,20,0) else if (! gtk_widget_get_realized(details_view->window)) { +#else + else if (! GTK_WIDGET_REALIZED(details_view->window)) { +#endif gtkpod_display_widget(details_view->window); } details_set_tracks(selected_tracks); diff --git a/plugins/photo_editor/display_photo.c b/plugins/photo_editor/display_photo.c index 951f889..7ad75e6 100644 --- a/plugins/photo_editor/display_photo.c +++ b/plugins/photo_editor/display_photo.c @@ -297,9 +297,12 @@ static void gphoto_create_albumview() { /* create tree view */ photo_editor->album_view = GTK_TREE_VIEW (gtk_tree_view_new ()); +#if GTK_CHECK_VERSION(2,20,0) if (!gtk_widget_get_realized(GTK_WIDGET(photo_editor->album_view))) +#else + if (!GTK_WIDGET_REALIZED(GTK_WIDGET(photo_editor->album_view))) +#endif gtk_widget_set_events(GTK_WIDGET(photo_editor->album_view), GDK_KEY_PRESS_MASK); - renderer = gtk_cell_renderer_text_new(); gtk_tree_view_insert_column_with_attributes(photo_editor->album_view, -1, _("Photo Albums"), renderer, "text", COL_ALBUM_NAME, NULL); @@ -357,7 +360,11 @@ static void gphoto_create_thumbnailview() { if (photo_editor->thumbnail_view == NULL) photo_editor->thumbnail_view = GTK_ICON_VIEW (gtk_icon_view_new ()); - if (!gtk_widget_get_realized(GTK_WIDGET (photo_editor->thumbnail_view))) +#if GTK_CHECK_VERSION(2,20,0) + if (!gtk_widget_get_realized(GTK_WIDGET(photo_editor->thumbnail_view))) +#else + if (!GTK_WIDGET_REALIZED(GTK_WIDGET(photo_editor->thumbnail_view))) +#endif gtk_widget_set_events(GTK_WIDGET(photo_editor->thumbnail_view), GDK_KEY_PRESS_MASK); gtk_container_add(GTK_CONTAINER (photo_editor->photo_thumb_window), GTK_WIDGET(photo_editor->thumbnail_view)); diff --git a/src/anjuta-app.c b/src/anjuta-app.c index 71e862d..d04d3b5 100644 --- a/src/anjuta-app.c +++ b/src/anjuta-app.c @@ -566,7 +566,11 @@ void anjuta_app_set_geometry(AnjutaApp *app, const gchar *geometry) { DEBUG_PRINT ("Setting geometry: %s", geometry); if (sscanf(geometry, "%dx%d+%d+%d", &width, &height, &posx, &posy) == 4) { +#if GTK_CHECK_VERSION(2,20,0) if (gtk_widget_get_realized (GTK_WIDGET (app))) { +#else + if (GTK_WIDGET_REALIZED (app)) { +#endif gtk_window_resize(GTK_WINDOW (app), width, height); } else { @@ -586,7 +590,11 @@ void anjuta_app_set_geometry(AnjutaApp *app, const gchar *geometry) { height = gdk_screen_height() - 25; width = (width < 790) ? width : 790; height = (height < 575) ? width : 575; +#if GTK_CHECK_VERSION(2,20,0) if (gtk_widget_get_realized (GTK_WIDGET (app)) == FALSE) { +#else + if (GTK_WIDGET_REALIZED (GTK_WIDGET (app)) == FALSE) { +#endif gtk_window_set_default_size(GTK_WINDOW (app), width, height); gtk_window_move(GTK_WINDOW (app), posx, posy); } ------------------------------------------------------------------------------ Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d _______________________________________________ gtkpod-cvs2 mailing list gtkpod-cvs2@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2