Audacious $Id:Doxyfile42802007-03-2104:39:00Znenolod$
gtk-compat.h
Go to the documentation of this file.
00001 /* Compatibility macros to make supporting multiple GTK versions easier.
00002  * Public domain. */
00003 
00004 #ifndef AUD_GTK_COMPAT_H
00005 #define AUD_GTK_COMPAT_H
00006 
00007 #include <string.h>
00008 
00009 #if defined GDK_KEY_Tab && ! defined GDK_Tab
00010 #include <gdk/gdkkeysyms-compat.h>
00011 #endif
00012 
00013 #if ! GTK_CHECK_VERSION (2, 14, 0)
00014 #define gtk_adjustment_get_page_size(a) ((a)->page_size)
00015 #define gtk_adjustment_get_upper(a) ((a)->upper)
00016 #define gtk_dialog_get_action_area(d) ((d)->action_area)
00017 #define gtk_dialog_get_content_area(d) ((d)->vbox)
00018 #define gtk_selection_data_get_data(s) ((s)->data)
00019 #define gtk_selection_data_get_length(s) ((s)->length)
00020 #define gtk_widget_get_window(w) ((w)->window)
00021 #endif
00022 
00023 #if ! GTK_CHECK_VERSION (2, 18, 0)
00024 
00025 static inline void gtk_widget_set_can_default (GtkWidget * w, gboolean b)
00026 {
00027     if (b)
00028         GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
00029     else
00030         GTK_WIDGET_UNSET_FLAGS (w, GTK_CAN_DEFAULT);
00031 }
00032 
00033 static inline void gtk_widget_set_can_focus (GtkWidget * w, gboolean b)
00034 {
00035     if (b)
00036         GTK_WIDGET_SET_FLAGS (w, GTK_CAN_FOCUS);
00037     else
00038         GTK_WIDGET_UNSET_FLAGS (w, GTK_CAN_FOCUS);
00039 }
00040 
00041 #define gtk_widget_get_allocation(w, a) memcpy ((a), & (w)->allocation, sizeof (GtkAllocation))
00042 #define gtk_widget_get_sensitive GTK_WIDGET_SENSITIVE
00043 #define gtk_widget_get_visible GTK_WIDGET_VISIBLE
00044 #define gtk_widget_is_toplevel GTK_WIDGET_TOPLEVEL
00045 #endif
00046 
00047 #if ! GTK_CHECK_VERSION (2, 20, 0)
00048 #define gtk_widget_is_drawable GTK_WIDGET_DRAWABLE
00049 #endif
00050 
00051 #if ! GTK_CHECK_VERSION (3, 0, 0)
00052 
00053 static inline void gdk_window_get_geometry_compat (GdkWindow * win, gint * x,
00054  gint * y, gint * w, gint * h)
00055 {
00056     gdk_window_get_geometry (win, x, y, w, h, NULL);
00057 }
00058 
00059 #define GtkComboBoxText GtkComboBox
00060 #define gdk_window_get_geometry gdk_window_get_geometry_compat
00061 #define gtk_combo_box_text_new gtk_combo_box_new_text
00062 #define gtk_combo_box_text_new_with_entry gtk_combo_box_entry_new_text
00063 #define gtk_combo_box_text_append_text gtk_combo_box_append_text
00064 #endif
00065 
00066 #if GTK_CHECK_VERSION (3, 0, 0)
00067 #define gtk_range_set_update_policy(...)
00068 #endif
00069 
00070 #endif /* AUD_GTK_COMPAT_H */