Accessors instead of widget flag macros in Katze
This commit is contained in:
parent
cd855b7cde
commit
fa66334289
3 changed files with 17 additions and 4 deletions
|
@ -28,6 +28,12 @@
|
|||
#if !GTK_CHECK_VERSION (2, 18, 0)
|
||||
#define gtk_widget_set_window(wdgt, wndw) wdgt->window = wndw
|
||||
#define gtk_widget_get_allocation (wdgt, alloc) *alloc = wdgt->allocation
|
||||
#define gtk_widget_is_drawable GTK_WIDGET_DRAWABLE
|
||||
#endif
|
||||
#if !GTK_CHECK_VERSION (2, 20, 0)
|
||||
#define gtk_widget_set_realized(wdgt, real) \
|
||||
if (real) GTK_WIDGET_SET_FLAGS (wdgt, GTK_REALIZED); \
|
||||
else GTK_WIDGET_UNSET_FLAGS (wdgt, GTK_REALIZED)
|
||||
#endif
|
||||
|
||||
#define DEFAULT_INTERVAL 50
|
||||
|
@ -277,7 +283,7 @@ on_expose_event (GtkWidget* widget,
|
|||
KatzeScrolledPrivate* priv = scrolled->priv;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
if (GTK_WIDGET_DRAWABLE (widget))
|
||||
if (gtk_widget_is_drawable (widget))
|
||||
{
|
||||
if (event->window == priv->horizontal_scrollbar_window)
|
||||
{
|
||||
|
@ -904,7 +910,7 @@ katze_scrolled_realize (GtkWidget* widget)
|
|||
color.red = color.green = color.blue = 0x6666;
|
||||
gdk_gc_set_rgb_fg_color (priv->shadow_gc, &color);
|
||||
|
||||
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
|
||||
#if !GTK_CHECK_VERSION (2, 18, 0)
|
||||
#define gtk_widget_get_allocation (wdgt, alloc) *alloc = wdgt->allocation
|
||||
#define gtk_widget_set_has_window(wdgt, wnd) \
|
||||
if (wnd) GTK_WIDGET_UNSET_FLAGS (wdgt, GTK_NO_WINDOW); \
|
||||
else GTK_WIDGET_SET_FLAGS (wdgt, GTK_NO_WINDOW)
|
||||
#endif
|
||||
|
||||
struct _KatzeThrobber
|
||||
|
@ -202,7 +205,7 @@ katze_throbber_class_init (KatzeThrobberClass* class)
|
|||
static void
|
||||
katze_throbber_init (KatzeThrobber *throbber)
|
||||
{
|
||||
GTK_WIDGET_SET_FLAGS (throbber, GTK_NO_WINDOW);
|
||||
gtk_widget_set_has_window (GTK_WIDGET (throbber), FALSE);
|
||||
|
||||
throbber->timer_id = -1;
|
||||
}
|
||||
|
|
|
@ -29,6 +29,10 @@
|
|||
#include <hildon/hildon.h>
|
||||
#endif
|
||||
|
||||
#if !GTK_CHECK_VERSION (2, 18, 0)
|
||||
#define gtk_widget_get_has_window(wdgt) !GTK_WIDGET_NO_WINDOW (wdgt)
|
||||
#endif
|
||||
|
||||
static void
|
||||
proxy_toggle_button_toggled_cb (GtkToggleButton* button,
|
||||
GObject* object)
|
||||
|
@ -923,7 +927,7 @@ katze_widget_popup_position_menu (GtkMenu* menu,
|
|||
gint widget_height;
|
||||
|
||||
/* Retrieve size and position of both widget and menu */
|
||||
if (GTK_WIDGET_NO_WINDOW (widget))
|
||||
if (!gtk_widget_get_has_window (widget))
|
||||
{
|
||||
gdk_window_get_position (widget->window, &wx, &wy);
|
||||
wx += widget->allocation.x;
|
||||
|
|
Loading…
Reference in a new issue