Remove compatibility checks with GTK 2.x
authorPhilip Chimento <philip.chimento@gmail.com>
Sat, 15 Sep 2012 19:51:33 +0000 (21:51 +0200)
committerPhilip Chimento <philip.chimento@gmail.com>
Sat, 15 Sep 2012 21:30:28 +0000 (23:30 +0200)
GTK 2.x won't be supported anymore on this branch.

libchimara/chimara-glk.c
libchimara/chimara-if.c
libchimara/fileref.c
libchimara/input.c
libchimara/pager.c

index bb2758a68c9a32f3d5c52947da9240ccfa5a5f03..8fd1a1e81b752a430537961253813191dd685ba4 100644 (file)
 #define CHIMARA_GLK_MIN_WIDTH 0
 #define CHIMARA_GLK_MIN_HEIGHT 0
 
-/* Substitute functions for compiling on iLiad */
-
-#if !GTK_CHECK_VERSION(2, 18, 0)
-#define gtk_widget_get_allocation(w, a) \
-       G_STMT_START { \
-               (a)->x = (w)->allocation.x; \
-               (a)->y = (w)->allocation.y; \
-               (a)->width = (w)->allocation.width; \
-               (a)->height = (w)->allocation.height; \
-       } G_STMT_END
-#define gtk_widget_set_allocation(w, a) \
-       G_STMT_START { (w)->allocation = *(a); } G_STMT_END
-#define gtk_widget_set_has_window(w, f) \
-       G_STMT_START { \
-               if(f) \
-                       GTK_WIDGET_UNSET_FLAGS((w), GTK_NO_WINDOW); \
-               else \
-                       GTK_WIDGET_SET_FLAGS((w), GTK_NO_WINDOW); \
-       } G_STMT_END
-#endif /* GTK 2.18 */
-
 /**
  * SECTION:chimara-glk
  * @short_description: Widget which executes a Glk program
@@ -767,18 +746,6 @@ chimara_glk_iliad_screen_update(ChimaraGlk *self, gboolean typing)
        /* Default signal handler */
 }
 
-/* COMPAT: G_PARAM_STATIC_STRINGS only appeared in GTK 2.13.0 */
-#ifndef G_PARAM_STATIC_STRINGS
-
-/* COMPAT: G_PARAM_STATIC_NAME and friends only appeared in GTK 2.8 */
-#if GTK_CHECK_VERSION(2,8,0)
-#define G_PARAM_STATIC_STRINGS (G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)
-#else
-#define G_PARAM_STATIC_STRINGS (0)
-#endif
-
-#endif
-
 static void
 chimara_glk_class_init(ChimaraGlkClass *klass)
 {
index 95f8b93dca03082d9fe9fd69d4dca18a4da6f279..64c32e30211b8dd1ba0ce7dee6dfec7bd9ae0d5c 100644 (file)
@@ -286,18 +286,6 @@ chimara_if_command(ChimaraIF *self, gchar *input, gchar *response)
        /* Default signal handler */
 }
 
-/* COMPAT: G_PARAM_STATIC_STRINGS only appeared in GTK 2.13.0 */
-#ifndef G_PARAM_STATIC_STRINGS
-
-/* COMPAT: G_PARAM_STATIC_NAME and friends only appeared in GTK 2.8 */
-#if GTK_CHECK_VERSION(2,8,0)
-#define G_PARAM_STATIC_STRINGS (G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)
-#else
-#define G_PARAM_STATIC_STRINGS (0)
-#endif
-
-#endif
-
 static void
 chimara_if_class_init(ChimaraIFClass *klass)
 {
index d4f2043dc454fc322c627844d22f168060b47e61..5838996ba840bad83952d612e88fba5cd00a3a59 100644 (file)
@@ -246,11 +246,7 @@ glk_fileref_create_by_prompt(glui32 usage, glui32 fmode, glui32 rock)
                                GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
                                NULL);
                        gtk_file_chooser_set_action(GTK_FILE_CHOOSER(chooser), GTK_FILE_CHOOSER_ACTION_SAVE);
-
-                       /* COMPAT: */
-#if GTK_CHECK_VERSION(2,8,0)
                        gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(chooser), TRUE);
-#endif
                        break;
                case filemode_ReadWrite:
                case filemode_WriteAppend:
index 3a4babf2dedf24e5f63f1e7254bb3bf5b57a9c3b..fd5aef4e5189836034199637e2e4c16951956e04 100644 (file)
@@ -143,10 +143,7 @@ text_grid_request_line_event_common(winid_t win, glui32 maxlen, gboolean insert,
        gtk_entry_set_has_frame(GTK_ENTRY(win->input_entry), FALSE);
        GtkBorder border = { 0, 0, 0, 0 };
 
-       /* COMPAT: */
-#if GTK_CHECK_VERSION(2,10,0)
        gtk_entry_set_inner_border(GTK_ENTRY(win->input_entry), &border);
-#endif
     gtk_entry_set_max_length(GTK_ENTRY(win->input_entry), win->input_length);
     gtk_entry_set_width_chars(GTK_ENTRY(win->input_entry), win->input_length);
 
index c04553fe135bdea0af9b16610968ec81b1d69498..efb941b46f39bb945e82292539e89c5371d09f02 100644 (file)
@@ -157,13 +157,7 @@ pager_after_size_allocate(GtkTextView *textview, GdkRectangle *allocation, winid
        if(!win->currently_paging) {
                if(scroll_distance > view_height) {
                        start_paging(win);
-                       /* Seriously... */
-                       /* COMPAT: */
-#if GTK_CHECK_VERSION(2,14,0)
                        gdk_window_invalidate_rect(gtk_widget_get_window(win->widget), NULL, TRUE);
-#else
-                       gdk_window_invalidate_rect(win->widget->window, NULL, TRUE);
-#endif
                }
        }
 }