Update uses of deprecated GTK+ macros and API

This commit is contained in:
Christian Dywan 2010-04-02 18:54:29 +02:00
parent 12b4859dc7
commit f2f0f16dd2
4 changed files with 12 additions and 5 deletions

View file

@ -5658,7 +5658,7 @@ midori_browser_size_allocate_cb (MidoriBrowser* browser,
{ {
GtkWidget* widget = GTK_WIDGET (browser); GtkWidget* widget = GTK_WIDGET (browser);
if (GTK_WIDGET_REALIZED (widget) && !browser->alloc_timeout) if (gtk_widget_get_realized (widget) && !browser->alloc_timeout)
{ {
gpointer last_page; gpointer last_page;
@ -6681,7 +6681,8 @@ midori_browser_toolbar_item_button_press_event_cb (GtkWidget* toolitem,
if (event->button == 2) if (event->button == 2)
{ {
GtkWidget* parent = gtk_widget_get_parent (toolitem); GtkWidget* parent = gtk_widget_get_parent (toolitem);
GtkAction* action = gtk_widget_get_action (parent); GtkAction* action = gtk_activatable_get_related_action (
GTK_ACTIVATABLE (parent));
return midori_browser_menu_middle_click_on_navigation_action (browser, action); return midori_browser_menu_middle_click_on_navigation_action (browser, action);
} }

View file

@ -2340,7 +2340,7 @@ midori_view_populate_popup (MidoriView* view,
menuitem = sokoke_action_create_popup_menu_item ( menuitem = sokoke_action_create_popup_menu_item (
gtk_action_group_get_action (actions, "Encoding")); gtk_action_group_get_action (actions, "Encoding"));
gtk_menu_shell_append (menu_shell, menuitem); gtk_menu_shell_append (menu_shell, menuitem);
if (GTK_WIDGET_IS_SENSITIVE (menuitem)) if (gtk_widget_get_sensitive (menuitem))
{ {
GtkWidget* sub_menu; GtkWidget* sub_menu;
static const GtkActionEntry encodings[] = { static const GtkActionEntry encodings[] = {

View file

@ -859,7 +859,8 @@ sokoke_get_desktop (void)
GdkDisplay* display = gdk_display_get_default (); GdkDisplay* display = gdk_display_get_default ();
Display* xdisplay = GDK_DISPLAY_XDISPLAY (display); Display* xdisplay = GDK_DISPLAY_XDISPLAY (display);
Window root_window = RootWindow (xdisplay, 0); Window root_window = RootWindow (xdisplay, 0);
Atom save_mode_atom = gdk_x11_get_xatom_by_name ("_DT_SAVE_MODE"); Atom save_mode_atom = gdk_x11_get_xatom_by_name_for_display (
display, "_DT_SAVE_MODE");
Atom actual_type; Atom actual_type;
int actual_format; int actual_format;
unsigned long n_items, bytes; unsigned long n_items, bytes;
@ -1016,7 +1017,7 @@ sokoke_entry_set_default_text (GtkEntry* entry,
PANGO_STYLE_ITALIC); PANGO_STYLE_ITALIC);
gtk_entry_set_text (entry, default_text); gtk_entry_set_text (entry, default_text);
} }
else if (!GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (entry))) else if (!gtk_widget_has_focus (GTK_WIDGET (entry)))
{ {
gint has_default = GPOINTER_TO_INT ( gint has_default = GPOINTER_TO_INT (
g_object_get_data (G_OBJECT (entry), "sokoke_has_default")); g_object_get_data (G_OBJECT (entry), "sokoke_has_default"));

View file

@ -39,6 +39,11 @@
#define gtk_widget_is_toplevel(widget) GTK_WIDGET_TOPLEVEL (widget) #define gtk_widget_is_toplevel(widget) GTK_WIDGET_TOPLEVEL (widget)
#define gtk_widget_has_focus(widget) GTK_WIDGET_HAS_FOCUS (widget) #define gtk_widget_has_focus(widget) GTK_WIDGET_HAS_FOCUS (widget)
#define gtk_widget_get_visible(widget) GTK_WIDGET_VISIBLE (widget) #define gtk_widget_get_visible(widget) GTK_WIDGET_VISIBLE (widget)
#define gtk_widget_get_sensitive(widget) GTK_WIDGET_IS_SENSITIVE (widget)
#endif
#if !GTK_CHECK_VERSION (2, 20, 0)
#define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED (widget)
#endif #endif
#if !GTK_CHECK_VERSION(2, 12, 0) #if !GTK_CHECK_VERSION(2, 12, 0)