genfio: Splitting gen_template in 2 parts
[fio.git] / gcompat.c
index f691ec11de89b4e42b11cbbd8220fc9cbea3bca8..5944df0ddc2fb7a86ee2f54d5779844bdd1a1bcf 100644 (file)
--- a/gcompat.c
+++ b/gcompat.c
@@ -33,3 +33,27 @@ gchar *gtk_combo_box_text_get_active_text(GtkComboBoxText *combo_box)
 }
 
 #endif
+
+#if GTK_MAJOR_VERSION < 3
+
+guint gtk_widget_get_allocated_width(GtkWidget *w)
+{
+       return w->allocation.width;
+}
+
+guint gtk_widget_get_allocated_height(GtkWidget *w)
+{
+       return w->allocation.height;
+}
+
+#endif
+
+#if GTK_MAJOR_VERSION <= 2 && GTK_MINOR_VERSION < 18
+void gtk_widget_set_can_focus(GtkWidget *widget, gboolean can_focus)
+{
+       if (can_focus)
+               GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS);
+       else
+               GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_FOCUS);
+}
+#endif