[anjuta] Use accessor functions instead direct access.
- From: Johannes Schmid <jhs src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [anjuta] Use accessor functions instead direct access.
- Date: Mon, 23 Nov 2009 16:49:29 +0000 (UTC)
commit 7640b178262642c5e5af0dfc1f75db9501d3db17
Author: Javier Jardón <javierjc1982 gmail com>
Date: Mon Oct 5 02:04:39 2009 +0200
Use accessor functions instead direct access.
GTK+ 2.17.10 is now the required version
I've used all the GTK+ 2.17.11 api available, still missing:
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
GTK_WIDGET_REALIZED (widget)
GTK_WIDGET_MAPPED (widget)
https://bugzilla.gnome.org/show_bug.cgi?id=597365
configure.in | 2 +-
libanjuta/anjuta-launcher.c | 2 +-
libanjuta/anjuta-message-area.c | 19 ++--
libanjuta/anjuta-plugin-manager.c | 12 +-
libanjuta/anjuta-preferences-dialog.c | 2 +-
libanjuta/anjuta-save-prompt.c | 16 ++--
libanjuta/anjuta-status.c | 71 +++++++-----
libanjuta/anjuta-utils.c | 11 +-
libanjuta/e-splash.c | 12 +-
libanjuta/resources.c | 2 +-
plugins/class-gen/cell-renderer-flags.c | 15 ++-
plugins/class-gen/combo-flags.c | 45 +++++---
plugins/debug-manager/breakpoints.c | 4 +-
plugins/debug-manager/chunk_view.c | 52 +++++----
plugins/debug-manager/data_view.c | 128 +++++++++++++---------
plugins/debug-manager/info.c | 8 +-
plugins/debug-manager/sharedlib.c | 13 ++-
plugins/debug-manager/signals.c | 13 ++-
plugins/debug-manager/sparse_view.c | 85 ++++++++------
plugins/document-manager/action-callbacks.c | 4 +-
plugins/document-manager/anjuta-docman.c | 7 +-
plugins/document-manager/plugin.c | 7 +-
plugins/file-loader/anjuta-recent-chooser-menu.c | 2 +-
plugins/file-loader/plugin.c | 4 +-
plugins/file-wizard/file.c | 6 +-
plugins/gbf-am/gbf-am-properties.c | 9 +-
plugins/gbf-mkfile/gbf-mkfile-properties.c | 5 +-
plugins/git/giggle-graph-renderer.c | 4 +-
plugins/git/git-create-branch-dialog.c | 2 +-
plugins/git/git-log-dialog.c | 4 +-
plugins/gtodo/add_edit_item.c | 2 +-
plugins/gtodo/egg-datetime.c | 19 ++--
plugins/gtodo/list_tooltip.c | 19 ++-
plugins/gtodo/mcategory.c | 2 +-
plugins/gtodo/notification.c | 6 +-
plugins/gtodo/preferences.c | 2 +-
plugins/macro/macro-dialog.c | 3 +-
plugins/macro/macro-edit.c | 19 +--
plugins/message-view/anjuta-msgman.c | 2 +-
plugins/message-view/message-view.c | 7 +-
plugins/patch/patch-plugin.c | 2 +-
plugins/project-manager/gbf-project-view.c | 4 +-
plugins/project-manager/plugin.c | 4 +-
plugins/project-wizard/property.c | 8 +-
plugins/run-program/parameters.c | 17 ++-
plugins/search/search-replace.c | 10 +-
plugins/sourceview/anjuta-view.c | 4 +-
plugins/sourceview/assist-tip.c | 12 +-
plugins/sourceview/assist-window.c | 20 ++--
plugins/starter/starter.c | 13 ++-
plugins/symbol-db/symbol-db-search-command.c | 4 +-
plugins/terminal/terminal.c | 4 +-
src/action-callbacks.c | 2 +-
src/anjuta-app.c | 4 +-
src/shell.c | 2 +-
55 files changed, 433 insertions(+), 324 deletions(-)
---
diff --git a/configure.in b/configure.in
index 620ed0b..30280a4 100644
--- a/configure.in
+++ b/configure.in
@@ -25,7 +25,7 @@ AC_SUBST(ANJUTA_VERSION)
GLIB_REQUIRED=2.18.0
GDK_PIXBUF_REQUIRED=2.0.0
-GTK_REQUIRED=2.14.0
+GTK_REQUIRED=2.17.10
ORBIT_REQUIRED=2.6.0
GCONF_REQUIRED=2.12.0
VTE_REQUIRED=0.9.0
diff --git a/libanjuta/anjuta-launcher.c b/libanjuta/anjuta-launcher.c
index 3f4caab..79a85c4 100644
--- a/libanjuta/anjuta-launcher.c
+++ b/libanjuta/anjuta-launcher.c
@@ -561,7 +561,7 @@ create_password_dialog (const gchar* prompt)
"anjuta");
hbox = gtk_hbox_new (FALSE, 10);
gtk_widget_show (hbox);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG(dialog))), hbox);
icon = anjuta_res_get_image (ANJUTA_PIXMAP_PASSWORD);
gtk_widget_show (icon);
diff --git a/libanjuta/anjuta-message-area.c b/libanjuta/anjuta-message-area.c
index d7f4a4a..f95e79a 100644
--- a/libanjuta/anjuta-message-area.c
+++ b/libanjuta/anjuta-message-area.c
@@ -101,17 +101,20 @@ get_response_data (GtkWidget *widget, gboolean create)
static gboolean
paint_message_area (GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
{
- gtk_paint_flat_box (widget->style,
- widget->window,
+ GtkAllocation allocation;
+
+ gtk_widget_get_allocation (widget, &allocation);
+ gtk_paint_flat_box (gtk_widget_get_style (widget),
+ gtk_widget_get_window (widget),
GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
NULL,
widget,
"tooltip",
- widget->allocation.x + 1,
- widget->allocation.y + 1,
- widget->allocation.width - 2,
- widget->allocation.height - 2);
+ allocation.x + 1,
+ allocation.y + 1,
+ allocation.width - 2,
+ allocation.height - 2);
return FALSE;
}
@@ -199,7 +202,7 @@ anjuta_message_area_init (AnjutaMessageArea *message_area)
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- GTK_WIDGET_SET_FLAGS (label, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (label, TRUE);
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
message_area->priv->label = label;
@@ -393,7 +396,7 @@ anjuta_message_area_add_button (AnjutaMessageArea *message_area,
button = gtk_button_new_from_stock (button_text);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_show (button);
diff --git a/libanjuta/anjuta-plugin-manager.c b/libanjuta/anjuta-plugin-manager.c
index 8dfcd83..32977da 100644
--- a/libanjuta/anjuta-plugin-manager.c
+++ b/libanjuta/anjuta-plugin-manager.c
@@ -1885,6 +1885,7 @@ anjuta_plugin_manager_select (AnjutaPluginManager *plugin_manager,
GtkCellRenderer *renderer;
GList *node;
GtkWidget *label;
+ GtkWidget *content_area;
GtkWidget *sc;
GtkWidget *remember_checkbox;
gint response;
@@ -1915,8 +1916,9 @@ anjuta_plugin_manager_select (AnjutaPluginManager *plugin_manager,
label = gtk_label_new (description);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), label,
- FALSE, FALSE, 5);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dlg));
+ gtk_box_pack_start (GTK_BOX (content_area), label,
+ FALSE, FALSE, 5);
sc = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (sc);
@@ -1926,8 +1928,8 @@ anjuta_plugin_manager_select (AnjutaPluginManager *plugin_manager,
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dlg)->vbox), sc,
- TRUE, TRUE, 5);
+ gtk_box_pack_start (GTK_BOX (content_area), sc,
+ TRUE, TRUE, 5);
model = GTK_TREE_MODEL (gtk_list_store_new (N_COLUMNS, GDK_TYPE_PIXBUF,
G_TYPE_STRING, G_TYPE_POINTER));
@@ -1960,7 +1962,7 @@ anjuta_plugin_manager_select (AnjutaPluginManager *plugin_manager,
gtk_check_button_new_with_label (_("Remember this selection"));
gtk_container_set_border_width (GTK_CONTAINER (remember_checkbox), 10);
gtk_widget_show (remember_checkbox);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dlg)->vbox), remember_checkbox,
+ gtk_box_pack_start (GTK_BOX (content_area), remember_checkbox,
FALSE, FALSE, 0);
node = plugin_descriptions;
diff --git a/libanjuta/anjuta-preferences-dialog.c b/libanjuta/anjuta-preferences-dialog.c
index ddde9c1..7307322 100644
--- a/libanjuta/anjuta-preferences-dialog.c
+++ b/libanjuta/anjuta-preferences-dialog.c
@@ -214,7 +214,7 @@ anjuta_preferences_dialog_init (AnjutaPreferencesDialog *dlg)
g_signal_connect (selection, "changed",
G_CALLBACK (selection_changed_cb), dlg);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), hbox,
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), hbox,
TRUE, TRUE, 0);
gtk_dialog_add_button (GTK_DIALOG (dlg), GTK_STOCK_CLOSE, -7);
diff --git a/libanjuta/anjuta-save-prompt.c b/libanjuta/anjuta-save-prompt.c
index 3bc2c49..9b6874f 100644
--- a/libanjuta/anjuta-save-prompt.c
+++ b/libanjuta/anjuta-save-prompt.c
@@ -145,14 +145,13 @@ anjuta_save_prompt_init(AnjutaSavePrompt *obj)
obj->priv = g_new0(AnjutaSavePromptPrivate, 1);
- gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_MESSAGE_DIALOG (obj)->label),
- "Uninitialized");
+ gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (obj), "Uninitialized");
gtk_window_set_resizable (GTK_WINDOW (obj), TRUE);
gtk_window_set_default_size (GTK_WINDOW (obj), 400, 300);
vbox = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (obj)->vbox),
- vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (obj))),
+ vbox, TRUE, TRUE, 0);
gtk_widget_show (vbox);
label = gtk_label_new (_("Select the items to save:"));
@@ -266,6 +265,7 @@ anjuta_save_prompt_add_item (AnjutaSavePrompt *save_prompt,
GtkTreeModel *model;
GtkTreeIter iter;
gchar *label;
+ const gchar *markup;
gint items_count;
g_return_if_fail (ANJUTA_IS_SAVE_PROMPT (save_prompt));
@@ -303,8 +303,8 @@ anjuta_save_prompt_add_item (AnjutaSavePrompt *save_prompt,
label = g_strdup_printf("<b>%s</b>",
_("There is an item with unsaved changes. Save changes before closing?"));
}
-
- gtk_label_set_markup (GTK_LABEL (GTK_MESSAGE_DIALOG (save_prompt)->label),
- label);
- g_free (label);
+
+ markup = label;
+ gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (save_prompt), markup);
+ g_free (label);
}
diff --git a/libanjuta/anjuta-status.c b/libanjuta/anjuta-status.c
index 5bd4f43..751d556 100644
--- a/libanjuta/anjuta-status.c
+++ b/libanjuta/anjuta-status.c
@@ -272,8 +272,11 @@ anjuta_status_clear_stack (AnjutaStatus *status)
static void
foreach_widget_set_cursor (gpointer widget, gpointer value, gpointer cursor)
{
- if (GTK_WIDGET (widget)->window)
- gdk_window_set_cursor (GTK_WIDGET (widget)->window, (GdkCursor*)cursor);
+ GdkWindow *window;
+
+ window = gtk_widget_get_window (widget);
+ if (window)
+ gdk_window_set_cursor (window, (GdkCursor*)cursor);
}
void
@@ -281,6 +284,7 @@ anjuta_status_busy_push (AnjutaStatus *status)
{
GtkWidget *top;
GdkCursor *cursor;
+ GdkWindow *window;
g_return_if_fail (ANJUTA_IS_STATUS (status));
@@ -292,8 +296,9 @@ anjuta_status_busy_push (AnjutaStatus *status)
if (status->priv->busy_count > 1)
return;
cursor = gdk_cursor_new (GDK_WATCH);
- if (GTK_WIDGET (top)->window)
- gdk_window_set_cursor (GTK_WIDGET (top)->window, cursor);
+ window = gtk_widget_get_window (top);
+ if (window)
+ gdk_window_set_cursor (window, cursor);
if (status->priv->widgets)
g_hash_table_foreach (status->priv->widgets,
foreach_widget_set_cursor, cursor);
@@ -306,6 +311,7 @@ void
anjuta_status_busy_pop (AnjutaStatus *status)
{
GtkWidget *top;
+ GdkWindow *window;
g_return_if_fail (ANJUTA_IS_STATUS (status));
@@ -318,8 +324,9 @@ anjuta_status_busy_pop (AnjutaStatus *status)
return;
status->priv->busy_count = 0;
- if (GTK_WIDGET (top)->window)
- gdk_window_set_cursor (GTK_WIDGET (top)->window, NULL);
+ gtk_widget_get_window (top);
+ if (window)
+ gdk_window_set_cursor (window, NULL);
if (status->priv->widgets)
g_hash_table_foreach (status->priv->widgets,
foreach_widget_set_cursor, NULL);
@@ -457,16 +464,17 @@ anjuta_status_progress_add_ticks (AnjutaStatus *status, gint ticks)
{
if (status->priv->progress_bar && status->priv->status_bar)
{
+ GdkWindow *progressbar_window, *statusbar_window;
+
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (status->priv->progress_bar),
percentage);
gtk_widget_queue_draw (GTK_WIDGET (status->priv->status_bar));
gtk_widget_queue_draw (GTK_WIDGET (status->priv->progress_bar));
- if (GTK_WIDGET(status->priv->progress_bar)->window != NULL &&
- GDK_IS_WINDOW(GTK_WIDGET(status->priv->progress_bar)->window))
- gdk_window_process_updates (GTK_WIDGET(status->priv->progress_bar)->window, TRUE);
- if (GTK_WIDGET(status->priv->status_bar)->window != NULL &&
- GDK_IS_WINDOW(GTK_WIDGET(status->priv->status_bar)->window))
- gdk_window_process_updates (GTK_WIDGET(status->priv->status_bar)->window, TRUE);
+ progressbar_window = gtk_widget_get_window (GTK_WIDGET(status->priv->progress_bar));
+ if (progressbar_window != NULL)
+ gdk_window_process_updates (progressbar_window, TRUE);
+ if (statusbar_window != NULL)
+ gdk_window_process_updates (statusbar_window, TRUE);
}
}
}
@@ -476,6 +484,7 @@ anjuta_status_progress_pulse (AnjutaStatus *status, const gchar *text)
{
GtkProgressBar *progressbar;
GtkWidget *statusbar;
+ GdkWindow *progressbar_window, *statusbar_window;
progressbar = GTK_PROGRESS_BAR (status->priv->progress_bar);
statusbar = status->priv->status_bar;
@@ -487,12 +496,12 @@ anjuta_status_progress_pulse (AnjutaStatus *status, const gchar *text)
gtk_widget_queue_draw (GTK_WIDGET (statusbar));
gtk_widget_queue_draw (GTK_WIDGET (progressbar));
- if (GTK_WIDGET(progressbar)->window != NULL &&
- GDK_IS_WINDOW(GTK_WIDGET(progressbar)->window))
- gdk_window_process_updates (GTK_WIDGET(progressbar)->window, TRUE);
- if (GTK_WIDGET(statusbar)->window != NULL &&
- GDK_IS_WINDOW(GTK_WIDGET(statusbar)->window))
- gdk_window_process_updates (GTK_WIDGET(statusbar)->window, TRUE);
+ progressbar_window = gtk_widget_get_window (GTK_WIDGET (progressbar));
+ if (progressbar_window != NULL)
+ gdk_window_process_updates (progressbar_window, TRUE);
+ statusbar_window = gtk_widget_get_window (GTK_WIDGET (statusbar));
+ if (statusbar_window != NULL)
+ gdk_window_process_updates (statusbar_window, TRUE);
}
void
@@ -515,6 +524,7 @@ anjuta_status_progress_tick (AnjutaStatus *status,
{
GtkProgressBar *progressbar;
GtkWidget *statusbar;
+ GdkWindow *progressbar_window, *statusbar_window;
if (text)
anjuta_status_set (status, "%s", text);
@@ -524,12 +534,12 @@ anjuta_status_progress_tick (AnjutaStatus *status,
statusbar = status->priv->status_bar;
gtk_widget_queue_draw (GTK_WIDGET (statusbar));
gtk_widget_queue_draw (GTK_WIDGET (progressbar));
- if (GTK_WIDGET(progressbar)->window != NULL &&
- GDK_IS_WINDOW(GTK_WIDGET(progressbar)->window))
- gdk_window_process_updates (GTK_WIDGET(progressbar)->window, TRUE);
- if (GTK_WIDGET(statusbar)->window != NULL &&
- GDK_IS_WINDOW(GTK_WIDGET(statusbar)->window))
- gdk_window_process_updates (GTK_WIDGET(statusbar)->window, TRUE);
+ progressbar_window = gtk_widget_get_window (GTK_WIDGET (progressbar));
+ if (progressbar_window != NULL)
+ gdk_window_process_updates (progressbar_window, TRUE);
+ statusbar_window = gtk_widget_get_window (GTK_WIDGET (statusbar));
+ if (statusbar_window != NULL)
+ gdk_window_process_updates (statusbar_window, TRUE);
}
if (status->priv->current_ticks >= status->priv->total_ticks)
anjuta_status_progress_reset (status);
@@ -540,6 +550,7 @@ anjuta_status_progress_increment_ticks (AnjutaStatus *status, gint ticks,
const gchar *text)
{
gfloat percentage;
+ GdkWindow *progressbar_window, *statusbar_window;
g_return_if_fail (ANJUTA_IS_STATUS (status));
g_return_if_fail (status->priv->total_ticks != 0);
@@ -558,12 +569,12 @@ anjuta_status_progress_increment_ticks (AnjutaStatus *status, gint ticks,
statusbar = status->priv->status_bar;
gtk_widget_queue_draw (GTK_WIDGET (statusbar));
gtk_widget_queue_draw (GTK_WIDGET (progressbar));
- if (GTK_WIDGET(progressbar)->window != NULL &&
- GDK_IS_WINDOW(GTK_WIDGET(progressbar)->window))
- gdk_window_process_updates (GTK_WIDGET(progressbar)->window, TRUE);
- if (GTK_WIDGET(statusbar)->window != NULL &&
- GDK_IS_WINDOW(GTK_WIDGET(statusbar)->window))
- gdk_window_process_updates (GTK_WIDGET(statusbar)->window, TRUE);
+ progressbar_window = gtk_widget_get_window (GTK_WIDGET(progressbar));
+ if (progressbar_window != NULL)
+ gdk_window_process_updates (progressbar_window, TRUE);
+ statusbar_window = gtk_widget_get_window (GTK_WIDGET(statusbar));
+ if (statusbar_window != NULL)
+ gdk_window_process_updates (statusbar_window, TRUE);
if (status->priv->current_ticks >= status->priv->total_ticks)
anjuta_status_progress_reset (status);
diff --git a/libanjuta/anjuta-utils.c b/libanjuta/anjuta-utils.c
index c42323f..44e958a 100644
--- a/libanjuta/anjuta-utils.c
+++ b/libanjuta/anjuta-utils.c
@@ -175,6 +175,7 @@ anjuta_util_button_new_with_stock_image (const gchar* text,
const gchar* stock_id)
{
GtkWidget *button;
+ GtkWidget *child;
GtkStockItem item;
GtkWidget *label;
GtkWidget *image;
@@ -183,9 +184,9 @@ anjuta_util_button_new_with_stock_image (const gchar* text,
button = gtk_button_new ();
- if (GTK_BIN (button)->child)
- gtk_container_remove (GTK_CONTAINER (button),
- GTK_BIN (button)->child);
+ child = gtk_bin_get_child (GTK_BIN (button));
+ if (child)
+ gtk_container_remove (GTK_CONTAINER (button), child);
if (gtk_stock_lookup (stock_id, &item))
{
@@ -232,7 +233,7 @@ anjuta_util_dialog_add_button (GtkDialog *dialog, const gchar* text,
button = anjuta_util_button_new_with_stock_image (text, stock_id);
g_return_val_if_fail (button != NULL, NULL);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_show (button);
@@ -435,7 +436,7 @@ anjuta_util_dialog_input (GtkWindow *parent, const gchar *prompt,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
- dialog_vbox = GTK_DIALOG (dialog)->vbox;
+ dialog_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_window_set_default_size (GTK_WINDOW (dialog), 400, -1);
gtk_widget_show (dialog_vbox);
diff --git a/libanjuta/e-splash.c b/libanjuta/e-splash.c
index 99f54b3..42a80ff 100644
--- a/libanjuta/e-splash.c
+++ b/libanjuta/e-splash.c
@@ -117,13 +117,15 @@ on_expose_event_cb (GtkWidget *widget, GdkEventExpose *event,
ESplash *splash)
{
ESplashPrivate *priv;
+ GdkWindow *window;
cairo_t *cr;
gint inc_width;
priv = splash->priv;
+ window = gtk_widget_get_window (widget);
/* draw the background pixbuf */
- cr = gdk_cairo_create (widget->window);
+ cr = gdk_cairo_create (window);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
gdk_cairo_set_source_pixbuf (cr, priv->splash_image_pixbuf, 0, 0);
@@ -132,7 +134,7 @@ on_expose_event_cb (GtkWidget *widget, GdkEventExpose *event,
/* draw the plugin icon */
if (priv->icon_pixbuf)
{
- cr = gdk_cairo_create (widget->window);
+ cr = gdk_cairo_create (window);
gdk_cairo_set_source_pixbuf (cr, priv->icon_pixbuf, ICON_X, ICON_Y);
cairo_paint (cr);
@@ -150,7 +152,7 @@ on_expose_event_cb (GtkWidget *widget, GdkEventExpose *event,
pango_layout_set_markup (layout, priv->title, -1);
pango_layout_get_size (layout, NULL, &layout_height);
- cr = gdk_cairo_create (widget->window);
+ cr = gdk_cairo_create (window);
cairo_move_to (cr, ICON_X + ICON_SIZE + 10,
ICON_Y + ICON_SIZE - PROGRESS_SIZE - PANGO_PIXELS (layout_height));
@@ -163,14 +165,14 @@ on_expose_event_cb (GtkWidget *widget, GdkEventExpose *event,
inc_width = gdk_pixbuf_get_width (priv->splash_image_pixbuf);
inc_width -= (ICON_X + ICON_SIZE + 20);
- cr = gdk_cairo_create (widget->window);
+ cr = gdk_cairo_create (window);
cairo_set_source_rgb (cr, 0.0, 0.0, 1.0);
cairo_rectangle (cr, ICON_X + ICON_SIZE + 10, ICON_Y + ICON_SIZE,
inc_width, PROGRESS_SIZE);
cairo_fill (cr);
- cr = gdk_cairo_create (widget->window);
+ cr = gdk_cairo_create (window);
cairo_rectangle (cr, ICON_X + ICON_SIZE + 10, ICON_Y + ICON_SIZE,
(priv->progress_percentage * inc_width), PROGRESS_SIZE);
diff --git a/libanjuta/resources.c b/libanjuta/resources.c
index 45a6800..97d50c1 100644
--- a/libanjuta/resources.c
+++ b/libanjuta/resources.c
@@ -51,7 +51,7 @@ anjuta_res_lookup_widget (GtkWidget * widget, const gchar * widget_name)
gtk_menu_get_attach_widget (GTK_MENU
(widget));
else
- parent = widget->parent;
+ parent = gtk_widget_get_parent (widget);
if (parent == NULL)
break;
widget = parent;
diff --git a/plugins/class-gen/cell-renderer-flags.c b/plugins/class-gen/cell-renderer-flags.c
index 1aff981..67a9c21 100644
--- a/plugins/class-gen/cell-renderer-flags.c
+++ b/plugins/class-gen/cell-renderer-flags.c
@@ -333,6 +333,8 @@ cg_cell_renderer_flags_start_editing (GtkCellRenderer *cell,
CgCellRendererFlags *cell_flags;
CgCellRendererFlagsPrivate *priv;
GtkCellRendererText *cell_text;
+ gboolean editable;
+ gchar *text;
const gchar *prev;
const gchar *pos;
@@ -344,7 +346,13 @@ cg_cell_renderer_flags_start_editing (GtkCellRenderer *cell,
priv = CG_CELL_RENDERER_FLAGS_PRIVATE (cell_flags);
cell_text = GTK_CELL_RENDERER_TEXT (cell);
- if (cell_text->editable == FALSE) return NULL;
+
+ g_object_get (cell_text,
+ "editable", &editable,
+ "text", &text,
+ NULL);
+
+ if (editable == FALSE) return NULL;
if (priv->model == NULL || priv->text_column < 0 || priv->abbr_column < 0)
return NULL;
@@ -376,8 +384,8 @@ cg_cell_renderer_flags_start_editing (GtkCellRenderer *cell,
priv->edit_status = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free, NULL);
- pos = cell_text->text;
- prev = cell_text->text;
+ pos = text;
+ prev = text;
while (prev != NULL && *prev != '\0')
{
@@ -389,6 +397,7 @@ cg_cell_renderer_flags_start_editing (GtkCellRenderer *cell,
if(*pos != '\0') ++ pos;
prev = pos;
}
+ g_free (text);
g_object_set_data_full (G_OBJECT (combo), CG_CELL_RENDERER_FLAGS_PATH,
g_strdup (path), g_free);
diff --git a/plugins/class-gen/combo-flags.c b/plugins/class-gen/combo-flags.c
index f1cb8c7..2c4f80b 100644
--- a/plugins/class-gen/combo-flags.c
+++ b/plugins/class-gen/combo-flags.c
@@ -370,32 +370,36 @@ cg_combo_flags_get_position (CgComboFlags *combo,
gint *height)
{
CgComboFlagsPrivate *priv;
+ GtkAllocation allocation;
+ GtkRequisition popup_req;
+ GdkWindow *window;
GdkScreen *screen;
- gint monitor_num;
GdkRectangle monitor;
- GtkRequisition popup_req;
+ gint monitor_num;
priv = CG_COMBO_FLAGS_PRIVATE (combo);
g_assert (priv->window != NULL);
- gdk_window_get_origin (GTK_WIDGET (combo)->window, x, y);
+ window = gtk_widget_get_window (GTK_WIDGET (combo));
+ gdk_window_get_origin (window, x, y);
- if (GTK_WIDGET_NO_WINDOW (GTK_WIDGET (combo)))
+ gtk_widget_get_allocation (GTK_WIDGET (combo), &allocation);
+
+ if (!gtk_widget_get_has_window (GTK_WIDGET (combo)))
{
- *x += GTK_WIDGET (combo)->allocation.x;
- *y += GTK_WIDGET (combo)->allocation.y;
+ *x += allocation.x;
+ *y += allocation.y;
}
gtk_widget_size_request (priv->window, &popup_req);
- *width = GTK_WIDGET (combo)->allocation.width;
+ *width = allocation.width;
if (popup_req.width > *width) *width = popup_req.width;
*height = popup_req.height;
screen = gtk_widget_get_screen (GTK_WIDGET(combo));
- monitor_num =
- gdk_screen_get_monitor_at_window (screen, GTK_WIDGET (combo)->window);
+ monitor_num = gdk_screen_get_monitor_at_window (screen, window);
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
@@ -408,26 +412,26 @@ cg_combo_flags_get_position (CgComboFlags *combo,
*x = monitor.x + monitor.width - *width;
}
- if (*y + GTK_WIDGET (combo)->allocation.height + *height <=
+ if (*y + allocation.height + *height <=
monitor.y + monitor.height)
{
- *y += GTK_WIDGET (combo)->allocation.height;
+ *y += allocation.height;
}
else if (*y - *height >= monitor.y)
{
*y -= *height;
}
else if (monitor.y + monitor.height -
- (*y + GTK_WIDGET (combo)->allocation.height) > *y - monitor.y)
+ (*y + allocation.height) > *y - monitor.y)
{
- *y += GTK_WIDGET (combo)->allocation.height;
+ *y += allocation.height;
*height = monitor.y + monitor.height - *y;
}
- else
- {
+ else
+ {
*height = *y - monitor.y;
*y = monitor.y;
- }
+ }
}
static gboolean
@@ -712,6 +716,7 @@ cg_combo_flags_popup_idle (gpointer data)
GtkTreeSelection* selection;
GtkWidget *toplevel;
GtkWidget *scrolled;
+ GdkWindow *window;
gint height, width, x, y;
combo = CG_COMBO_FLAGS (data);
@@ -787,17 +792,19 @@ cg_combo_flags_popup_idle (gpointer data)
gtk_widget_show (priv->window);
gtk_widget_grab_focus (priv->window);
- if (!GTK_WIDGET_HAS_FOCUS (priv->treeview))
+ if (!gtk_widget_has_focus (priv->treeview))
gtk_widget_grab_focus (priv->treeview);
- gdk_pointer_grab (priv->window->window, TRUE,
+ window = gtk_widget_get_window (priv->window);
+
+ gdk_pointer_grab (window, TRUE,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK,
NULL, NULL, GDK_CURRENT_TIME);
gtk_grab_add (priv->window);
- gdk_keyboard_grab (priv->window->window, TRUE, GDK_CURRENT_TIME);
+ gdk_keyboard_grab (window, TRUE, GDK_CURRENT_TIME);
return FALSE;
}
diff --git a/plugins/debug-manager/breakpoints.c b/plugins/debug-manager/breakpoints.c
index 8c3d296..8b4aa44 100644
--- a/plugins/debug-manager/breakpoints.c
+++ b/plugins/debug-manager/breakpoints.c
@@ -1512,7 +1512,7 @@ breakpoints_dbase_edit_breakpoint (BreakpointsDBase *bd, BreakpointItem *bi)
location = g_strdup_printf ("*%lx", bi->bp.address);
}
- if (GTK_WIDGET_VISIBLE(location_entry))
+ if (gtk_widget_get_visible (location_entry))
{
gtk_entry_set_text (GTK_ENTRY (location_entry), location == NULL ? "" : location);
}
@@ -1539,7 +1539,7 @@ breakpoints_dbase_edit_breakpoint (BreakpointsDBase *bd, BreakpointItem *bi)
while (isspace(*condition)) condition++;
if (*condition == '\0') condition = NULL;
- if (GTK_WIDGET_VISIBLE(location_entry))
+ if (gtk_widget_get_visible (location_entry))
{
new_location = gtk_entry_get_text (GTK_ENTRY (location_entry));
while (isspace(*new_location)) new_location++;
diff --git a/plugins/debug-manager/chunk_view.c b/plugins/debug-manager/chunk_view.c
index a57b599..8591a5f 100644
--- a/plugins/debug-manager/chunk_view.c
+++ b/plugins/debug-manager/chunk_view.c
@@ -47,13 +47,19 @@ static GtkWidgetClass *parent_class = NULL;
static void
set_adjustment_clamped (GtkAdjustment *adj, gdouble value)
{
- if (value < adj->lower)
+ gdouble lower, upper, page_size;
+
+ lower = gtk_adjustment_get_lower (adj);
+ upper = gtk_adjustment_get_upper (adj);
+ page_size = gtk_adjustment_get_page_size (adj);
+
+ if (value < lower)
{
- value = adj->lower;
+ value = lower;
}
- if (value > (adj->upper - adj->page_size))
+ if (value > (upper - page_size))
{
- value = adj->upper - adj->page_size;
+ value = upper - page_size;
}
gtk_adjustment_set_value (adj, value);
}
@@ -68,50 +74,52 @@ dma_chunk_view_move_cursor (GtkTextView *text_view,
gboolean extend_selection)
{
DmaChunkView *view = DMA_CHUNK_VIEW (text_view);
- gdouble value = view->vadjustment->value;
GtkTextMark *mark;
GtkTextBuffer *buffer;
GtkTextIter cur;
gint line;
+ gdouble value, step_increment;
switch (step)
- {
- case GTK_MOVEMENT_LOGICAL_POSITIONS:
- case GTK_MOVEMENT_VISUAL_POSITIONS:
+ {
+ case GTK_MOVEMENT_LOGICAL_POSITIONS:
+ case GTK_MOVEMENT_VISUAL_POSITIONS:
case GTK_MOVEMENT_WORDS:
- case GTK_MOVEMENT_DISPLAY_LINE_ENDS:
- case GTK_MOVEMENT_HORIZONTAL_PAGES:
+ case GTK_MOVEMENT_DISPLAY_LINE_ENDS:
+ case GTK_MOVEMENT_HORIZONTAL_PAGES:
break;
- case GTK_MOVEMENT_DISPLAY_LINES:
- case GTK_MOVEMENT_PARAGRAPHS:
- case GTK_MOVEMENT_PARAGRAPH_ENDS:
+ case GTK_MOVEMENT_DISPLAY_LINES:
+ case GTK_MOVEMENT_PARAGRAPHS:
+ case GTK_MOVEMENT_PARAGRAPH_ENDS:
buffer = gtk_text_view_get_buffer (text_view);
- mark = gtk_text_buffer_get_insert (buffer);
- gtk_text_buffer_get_iter_at_mark (buffer, &cur, mark);
- line = gtk_text_iter_get_line (&cur);
+ mark = gtk_text_buffer_get_insert (buffer);
+ gtk_text_buffer_get_iter_at_mark (buffer, &cur, mark);
+ line = gtk_text_iter_get_line (&cur);
+ step_increment = gtk_adjustment_get_step_increment (view->vadjustment);
if ((count < 0) && (line == 0))
{
- value += count * view->vadjustment->step_increment;
+ value += count * step_increment;
set_adjustment_clamped (view->vadjustment, value);
return;
}
else if ((count > 0) && (line == gtk_text_buffer_get_line_count(buffer) - 1))
{
- value += count * view->vadjustment->step_increment;
+ value += count * step_increment;
set_adjustment_clamped (view->vadjustment, value);
return;
}
break;
case GTK_MOVEMENT_PAGES:
- value += count * view->vadjustment->page_increment;
+ value += count * gtk_adjustment_get_page_increment (view->vadjustment);
set_adjustment_clamped (view->vadjustment, value);
return;
case GTK_MOVEMENT_BUFFER_ENDS:
- set_adjustment_clamped (view->vadjustment, count < 0 ? view->vadjustment->lower : view->vadjustment->upper);
+ set_adjustment_clamped (view->vadjustment,
+ count < 0 ? gtk_adjustment_get_lower (view->vadjustment) : gtk_adjustment_get_upper (view->vadjustment));
return;
- default:
- break;
+ default:
+ break;
}
GTK_TEXT_VIEW_CLASS (parent_class)->move_cursor (text_view,
diff --git a/plugins/debug-manager/data_view.c b/plugins/debug-manager/data_view.c
index f0f96a3..49494a8 100644
--- a/plugins/debug-manager/data_view.c
+++ b/plugins/debug-manager/data_view.c
@@ -24,7 +24,9 @@
#include "anjuta-marshal.h"
+#if !GTK_CHECK_VERSION (2,16,0)
#include "sexy-icon-entry.h"
+#endif
#include <glib/gi18n.h>
@@ -177,7 +179,7 @@ dma_data_view_goto_position_func (DmaDataView *view)
{
gint x, y;
gint win_x, win_y;
- GdkWindow *window = GTK_WIDGET (view)->window;
+ GdkWindow *window = gtk_widget_get_window (GTK_WIDGET (view));
GdkScreen *screen = gdk_drawable_get_screen (window);
gint monitor_num;
GdkRectangle monitor;
@@ -209,7 +211,7 @@ send_focus_change (GtkWidget *widget,
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
fevent->focus_change.type = GDK_FOCUS_CHANGE;
- fevent->focus_change.window = g_object_ref (widget->window);
+ fevent->focus_change.window = g_object_ref (gtk_widget_get_window (widget));
fevent->focus_change.in = in;
gtk_widget_event (widget, fevent);
@@ -222,31 +224,35 @@ send_focus_change (GtkWidget *widget,
static void
dma_data_view_goto_activate (GtkWidget *menu_item,
- DmaDataView *view)
+ DmaDataView *view)
{
GtkWidget *toplevel;
GtkWidget *frame;
GtkWidget *vbox;
+ GtkWindowGroup *toplevel_group;
+ GtkWindowGroup *goto_window_group;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (view));
+ toplevel_group = gtk_window_get_group (GTK_WINDOW (toplevel));
+ goto_window_group = gtk_window_get_group (GTK_WINDOW (view->goto_window));
if (view->goto_window != NULL)
{
- if (GTK_WINDOW (toplevel)->group)
- gtk_window_group_add_window (GTK_WINDOW (toplevel)->group,
- GTK_WINDOW (view->goto_window));
- else if (GTK_WINDOW (view->goto_window)->group)
- gtk_window_group_remove_window (GTK_WINDOW (view->goto_window)->group,
- GTK_WINDOW (view->goto_window));
+ if (toplevel_group)
+ gtk_window_group_add_window (toplevel_group,
+ GTK_WINDOW (view->goto_window));
+ else if (goto_window_group)
+ gtk_window_group_remove_window (goto_window_group,
+ GTK_WINDOW (view->goto_window));
}
else
{
view->goto_window = gtk_window_new (GTK_WINDOW_POPUP);
- if (GTK_WINDOW (toplevel)->group)
- gtk_window_group_add_window (GTK_WINDOW (toplevel)->group,
- GTK_WINDOW (view->goto_window));
+ if (toplevel_group)
+ gtk_window_group_add_window (toplevel_group,
+ GTK_WINDOW (view->goto_window));
gtk_window_set_modal (GTK_WINDOW (view->goto_window), TRUE);
g_signal_connect (view->goto_window, "delete_event",
@@ -337,8 +343,8 @@ dma_data_view_data_size_request (DmaDataView *view,
context = gtk_widget_get_pango_context (view->data);
metrics = pango_context_get_metrics (context,
- view->data->style->font_desc,
- pango_context_get_language (context));
+ gtk_widget_get_style (view->data)->font_desc,
+ pango_context_get_language (context));
requisition->height = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) +
pango_font_metrics_get_descent (metrics));
@@ -355,8 +361,8 @@ dma_data_view_ascii_size_request (DmaDataView *view,
context = gtk_widget_get_pango_context (view->ascii);
metrics = pango_context_get_metrics (context,
- view->ascii->style->font_desc,
- pango_context_get_language (context));
+ gtk_widget_get_style (view->ascii)->font_desc,
+ pango_context_get_language (context));
requisition->height = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) +
pango_font_metrics_get_descent (metrics));
@@ -369,7 +375,10 @@ static void
dma_data_view_value_changed (GtkAdjustment *adj,
DmaDataView *view)
{
- view->start = ((gulong)adj->value) - (((gulong)adj->value) % view->bytes_by_line);
+ gboolean value;
+
+ value = gtk_adjustment_get_value (adj);
+ view->start = ((gulong) value) - (((gulong) value) % view->bytes_by_line);
dma_data_view_refresh (view);
}
@@ -399,6 +408,7 @@ dma_data_view_size_request (GtkWidget *widget,
{
DmaDataView *view = DMA_DATA_VIEW (widget);
GtkRequisition child_requisition;
+ GtkStyle *style;
gtk_widget_size_request (view->range, requisition);
@@ -418,8 +428,9 @@ dma_data_view_size_request (GtkWidget *widget,
if (view->shadow_type != GTK_SHADOW_NONE)
{
- requisition->width += 2 * widget->style->xthickness;
- requisition->height += 2 * widget->style->ythickness;
+ style = gtk_widget_get_style (widget);
+ requisition->width += 2 * style->xthickness;
+ requisition->height += 2 * style->ythickness;
}
requisition->width += SCROLLBAR_SPACING;
}
@@ -429,6 +440,7 @@ dma_data_view_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
DmaDataView *view = DMA_DATA_VIEW (widget);
+ GtkStyle *style;
GtkAllocation child_allocation;
GtkRequisition range_requisition;
GtkRequisition address_requisition;
@@ -438,17 +450,20 @@ dma_data_view_size_allocate (GtkWidget *widget,
gint height;
gint bytes_by_line;
gint step;
+ guint border_width;
gboolean need_fill = FALSE;
gtk_widget_get_child_requisition (view->range, &range_requisition);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (view));
+ style = gtk_widget_get_style (widget);
dma_data_view_address_size_request (view, &address_requisition);
dma_data_view_data_size_request (view, &data_requisition);
dma_data_view_ascii_size_request (view, &ascii_requisition);
/* Compute number of byte per line */
width = allocation->width
- - 2 * GTK_CONTAINER (view)->border_width
- - (view->shadow_type == GTK_SHADOW_NONE ? 0 : 2 * widget->style->xthickness)
+ - 2 * border_width
+ - (view->shadow_type == GTK_SHADOW_NONE ? 0 : 2 * style->xthickness)
- ADDRESS_BORDER
- ASCII_BORDER
- SCROLLBAR_SPACING
@@ -471,35 +486,37 @@ dma_data_view_size_allocate (GtkWidget *widget,
/* Compute number of line by page */
height = allocation->height
- - 2 * GTK_CONTAINER (view)->border_width
- - (view->shadow_type == GTK_SHADOW_NONE ? 0 : 2 * widget->style->ythickness);
+ - 2 * border_width
+ - (view->shadow_type == GTK_SHADOW_NONE ? 0 : 2 * style->ythickness);
if (view->line_by_page != (height / address_requisition.height))
{
need_fill = TRUE;
view->line_by_page = (height / address_requisition.height);
}
-
- child_allocation.y = allocation->y + GTK_CONTAINER (view)->border_width;
- child_allocation.height = MAX (1, (gint) allocation->height - (gint) GTK_CONTAINER (view)->border_width * 2);
+
+ child_allocation.y = allocation->y + border_width;
+ child_allocation.height = MAX (1, (gint) allocation->height - (gint) border_width * 2);
/* Scroll bar */
- child_allocation.x = allocation->x + allocation->width - GTK_CONTAINER (view)->border_width - range_requisition.width;
+ child_allocation.x = allocation->x + allocation->width - border_width - range_requisition.width;
child_allocation.width = range_requisition.width;
gtk_widget_size_allocate (view->range, &child_allocation);
- child_allocation.x = allocation->x + GTK_CONTAINER (view)->border_width;
+ child_allocation.x = allocation->x + border_width;
/* Frame */
if (view->shadow_type != GTK_SHADOW_NONE)
{
- view->frame.x = allocation->x + GTK_CONTAINER (view)->border_width;
- view->frame.y = allocation->y + GTK_CONTAINER (view)->border_width;
- view->frame.width = allocation->width - range_requisition.width - SCROLLBAR_SPACING - 2 * (GTK_CONTAINER (view)->border_width);
- view->frame.height = allocation->height - 2 * (GTK_CONTAINER (view)->border_width);
- child_allocation.x += widget->style->xthickness;
- child_allocation.y += widget->style->ythickness;
- child_allocation.height -= 2 * widget->style->ythickness;
+ GtkStyle *style = gtk_widget_get_style (widget);
+
+ view->frame.x = allocation->x + border_width;
+ view->frame.y = allocation->y + border_width;
+ view->frame.width = allocation->width - range_requisition.width - SCROLLBAR_SPACING - 2 * border_width;
+ view->frame.height = allocation->height - 2 * border_width;
+ child_allocation.x += style->xthickness;
+ child_allocation.y += style->ythickness;
+ child_allocation.height -= 2 * style->ythickness;
}
/* Address */
@@ -524,13 +541,19 @@ dma_data_view_size_allocate (GtkWidget *widget,
if (need_fill)
{
- view->buffer_range->step_increment = view->bytes_by_line;
- view->buffer_range->page_increment = view->bytes_by_line * (view->line_by_page - 1);
- view->buffer_range->page_size = (gulong)(view->buffer_range->upper) % (view->bytes_by_line) + view->buffer_range->page_increment;
+ gdouble page_increment, page_size, upper;
- if (view->start + view->buffer_range->page_size > view->buffer_range->upper)
+ page_increment = view->bytes_by_line * (view->line_by_page - 1);
+ upper = gtk_adjustment_get_upper (view->buffer_range);
+ page_size = (gulong) upper % view->bytes_by_line + page_increment;
+
+ gtk_adjustment_set_step_increment (view->buffer_range, view->bytes_by_line);
+ gtk_adjustment_set_page_increment (view->buffer_range, page_increment);
+ gtk_adjustment_set_page_size (view->buffer_range, page_size);
+
+ if (view->start + page_size > upper)
{
- view->start = view->buffer_range->upper - view->buffer_range->page_size + view->bytes_by_line - 1;
+ view->start = upper - page_size + view->bytes_by_line - 1;
view->start -= view->start % view->bytes_by_line;
}
dma_data_view_refresh (view);
@@ -545,14 +568,15 @@ dma_data_view_paint (GtkWidget *widget,
DmaDataView *view = DMA_DATA_VIEW (widget);
if (view->shadow_type != GTK_SHADOW_NONE)
- {
- gtk_paint_shadow (widget->style, widget->window,
- GTK_STATE_NORMAL, view->shadow_type,
- area, widget, "dma_data_view",
- view->frame.x,
- view->frame.y,
- view->frame.width,
- view->frame.height);
+ {
+ gtk_paint_shadow (gtk_widget_get_style (widget),
+ gtk_widget_get_window (widget),
+ GTK_STATE_NORMAL, view->shadow_type,
+ area, widget, "dma_data_view",
+ view->frame.x,
+ view->frame.y,
+ view->frame.width,
+ view->frame.height);
}
}
@@ -560,7 +584,7 @@ static gint
dma_data_view_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- if (GTK_WIDGET_DRAWABLE (widget))
+ if (gtk_widget_is_drawable (widget))
{
dma_data_view_paint (widget, &event->area);
@@ -578,9 +602,9 @@ dma_data_view_create_widget (DmaDataView *view)
PangoFontDescription *font_desc;
wid = GTK_WIDGET (view);
-
- GTK_WIDGET_SET_FLAGS (wid, GTK_NO_WINDOW);
- GTK_WIDGET_SET_FLAGS (wid, GTK_CAN_FOCUS);
+
+ gtk_widget_set_has_window (wid, FALSE);
+ gtk_widget_set_can_focus (wid, TRUE);
gtk_widget_set_redraw_on_allocate (wid, FALSE);
view->char_by_byte = 2;
diff --git a/plugins/debug-manager/info.c b/plugins/debug-manager/info.c
index 7f17c5b..0e55f14 100644
--- a/plugins/debug-manager/info.c
+++ b/plugins/debug-manager/info.c
@@ -62,8 +62,8 @@ create_dialog_with_textview (GtkWindow *parent, gint width, gint height)
G_CALLBACK (gtk_widget_destroy), NULL);
scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
- scrolledwindow);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
+ scrolledwindow);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
@@ -111,8 +111,8 @@ create_dialog_with_treeview (GtkWindow *parent, gint width, gint height)
G_CALLBACK (gtk_widget_destroy), NULL);
scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
- scrolledwindow);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
+ scrolledwindow);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
diff --git a/plugins/debug-manager/sharedlib.c b/plugins/debug-manager/sharedlib.c
index 418cbd2..1b82d0e 100644
--- a/plugins/debug-manager/sharedlib.c
+++ b/plugins/debug-manager/sharedlib.c
@@ -283,7 +283,7 @@ sharedlibs_show (Sharedlibs* sl)
{
if(sl->is_showing)
{
- gdk_window_raise(sl->widgets.window->window);
+ gdk_window_raise(gtk_widget_get_window (sl->widgets.window));
}
else
{
@@ -304,13 +304,16 @@ sharedlibs_show (Sharedlibs* sl)
void
sharedlibs_hide (Sharedlibs* sl)
{
+ GdkWindow *window;
+
if(sl)
{
if(sl->is_showing == FALSE) return;
- gdk_window_get_root_origin(sl->widgets.window->window,
- &sl->win_pos_x, &sl->win_pos_y);
- gdk_drawable_get_size(sl ->widgets.window->window, &sl->win_width,
- &sl->win_height);
+ window = gtk_widget_get_window (sl->widgets.window);
+ gdk_window_get_root_origin (window,
+ &sl->win_pos_x, &sl->win_pos_y);
+ gdk_drawable_get_size (window,
+ &sl->win_width, &sl->win_height);
gtk_widget_hide(sl->widgets.window);
sl->is_showing = FALSE;
}
diff --git a/plugins/debug-manager/signals.c b/plugins/debug-manager/signals.c
index c006f3e..7e15099 100644
--- a/plugins/debug-manager/signals.c
+++ b/plugins/debug-manager/signals.c
@@ -419,7 +419,7 @@ signals_show (Signals * sg)
{
if (sg->is_showing)
{
- gdk_window_raise (sg->widgets.window->window);
+ gdk_window_raise (gtk_widget_get_window (sg->widgets.window));
}
else
{
@@ -440,14 +440,17 @@ signals_show (Signals * sg)
void
signals_hide (Signals * sg)
{
+ GdkWindow *window;
+
if (sg)
{
if (sg->is_showing == FALSE)
return;
- gdk_window_get_root_origin (sg->widgets.window->window, &sg->win_pos_x,
- &sg->win_pos_y);
- gdk_drawable_get_size (sg->widgets.window->window, &sg->win_width,
- &sg->win_height);
+ window = gtk_widget_get_window (sg->widgets.window);
+ gdk_window_get_root_origin (window, &sg->win_pos_x,
+ &sg->win_pos_y);
+ gdk_drawable_get_size (window, &sg->win_width,
+ &sg->win_height);
gtk_widget_hide (sg->widgets.window);
sg->is_showing = FALSE;
}
diff --git a/plugins/debug-manager/sparse_view.c b/plugins/debug-manager/sparse_view.c
index babbec5..f1af3e1 100644
--- a/plugins/debug-manager/sparse_view.c
+++ b/plugins/debug-manager/sparse_view.c
@@ -30,7 +30,9 @@
#include <libanjuta/anjuta-debug.h>
#include <libanjuta/interfaces/ianjuta-markable.h>
+#if !GTK_CHECK_VERSION (2,16,0)
#include "sexy-icon-entry.h"
+#endif
#include <glib/gi18n.h>
@@ -114,7 +116,7 @@ send_focus_change (GtkWidget *widget,
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
fevent->focus_change.type = GDK_FOCUS_CHANGE;
- fevent->focus_change.window = g_object_ref (widget->window);
+ fevent->focus_change.window = g_object_ref (gtk_widget_get_window (widget));
fevent->focus_change.in = in;
gtk_widget_event (widget, fevent);
@@ -194,7 +196,7 @@ dma_sparse_view_goto_position_func (DmaSparseView *view)
{
gint x, y;
gint win_x, win_y;
- GdkWindow *window = GTK_WIDGET (view)->window;
+ GdkWindow *window = gtk_widget_get_window (GTK_WIDGET (view));
GdkScreen *screen = gdk_drawable_get_screen (window);
gint monitor_num;
GdkRectangle monitor;
@@ -218,34 +220,38 @@ dma_sparse_view_goto_activate (GtkWidget *menu_item,
GtkWidget *toplevel;
GtkWidget *frame;
GtkWidget *vbox;
+ GtkWindowGroup *toplevel_group, *goto_window_group;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (view));
+ toplevel_group = gtk_window_get_group (GTK_WINDOW (toplevel));
if (view->priv->goto_window != NULL)
{
- if (GTK_WINDOW (toplevel)->group)
- gtk_window_group_add_window (GTK_WINDOW (toplevel)->group,
- GTK_WINDOW (view->priv->goto_window));
- else if (GTK_WINDOW (view->priv->goto_window)->group)
- gtk_window_group_remove_window (GTK_WINDOW (view->priv->goto_window)->group,
- GTK_WINDOW (view->priv->goto_window));
+ goto_window_group = gtk_window_get_group (GTK_WINDOW (view->priv->goto_window));
+
+ if (toplevel_group)
+ gtk_window_group_add_window (toplevel_group,
+ GTK_WINDOW (view->priv->goto_window));
+ else if (goto_window_group)
+ gtk_window_group_remove_window (goto_window_group,
+ GTK_WINDOW (view->priv->goto_window));
}
else
{
view->priv->goto_window = gtk_window_new (GTK_WINDOW_POPUP);
- if (GTK_WINDOW (toplevel)->group)
- gtk_window_group_add_window (GTK_WINDOW (toplevel)->group,
- GTK_WINDOW (view->priv->goto_window));
+ if (toplevel_group)
+ gtk_window_group_add_window (toplevel_group,
+ GTK_WINDOW (view->priv->goto_window));
gtk_window_set_modal (GTK_WINDOW (view->priv->goto_window), TRUE);
g_signal_connect (view->priv->goto_window, "delete_event",
- G_CALLBACK (dma_sparse_view_goto_delete_event),
- view);
+ G_CALLBACK (dma_sparse_view_goto_delete_event),
+ view);
g_signal_connect (view->priv->goto_window, "key_press_event",
- G_CALLBACK (dma_sparse_view_goto_key_press_event),
- view);
+ G_CALLBACK (dma_sparse_view_goto_key_press_event),
+ view);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
@@ -272,7 +278,7 @@ dma_sparse_view_goto_activate (GtkWidget *menu_item,
#endif
gtk_widget_show (view->priv->goto_entry);
gtk_container_add (GTK_CONTAINER (vbox),
- view->priv->goto_entry);
+ view->priv->goto_entry);
gtk_widget_realize (view->priv->goto_entry);
}
@@ -282,8 +288,8 @@ dma_sparse_view_goto_activate (GtkWidget *menu_item,
gtk_widget_show (view->priv->goto_window);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
- gtk_widget_grab_focus (view->priv->goto_entry);
- send_focus_change (view->priv->goto_entry, TRUE);
+ gtk_widget_grab_focus (view->priv->goto_entry);
+ send_focus_change (view->priv->goto_entry, TRUE);
gtk_editable_set_position (GTK_EDITABLE (view->priv->goto_entry), -1);
}
@@ -552,18 +558,19 @@ dma_sparse_view_synchronize_iter (DmaSparseView *view, DmaSparseIter *iter)
if (dist != 0)
{
- if ((dist < 4.0 * (view->priv->vadjustment->page_size))
- && (dist > -4.0 * (view->priv->vadjustment->page_size)))
- {
- gint count = (gint)(dist / view->priv->vadjustment->step_increment);
-
- dma_sparse_iter_forward_lines (iter, count);
- }
- else
+ gdouble page_size = gtk_adjustment_get_page_size (view->priv->vadjustment);
+
+ if ((dist < 4.0 * page_size) && (dist > -4.0 * page_size))
{
- dma_sparse_iter_move_at (iter, pos);
- dma_sparse_iter_round (iter, FALSE);
- }
+ gint count = (gint) (dist / gtk_adjustment_get_step_increment (view->priv->vadjustment));
+
+ dma_sparse_iter_forward_lines (iter, count);
+ }
+ else
+ {
+ dma_sparse_iter_move_at (iter, pos);
+ dma_sparse_iter_round (iter, FALSE);
+ }
gtk_adjustment_set_value (view->priv->vadjustment, (gdouble)dma_sparse_iter_get_address (iter));
}
}
@@ -754,9 +761,9 @@ dma_sparse_view_paint_margin (DmaSparseView *view,
g_snprintf (str, sizeof (str),"0x%0*lX", margin_length, (long unsigned int)address);
pango_layout_set_markup (layout, str, -1);
- gtk_paint_layout (GTK_WIDGET (view)->style,
+ gtk_paint_layout (gtk_widget_get_style (GTK_WIDGET (view)),
win,
- GTK_WIDGET_STATE (view),
+ gtk_widget_get_state (GTK_WIDGET (view)),
FALSE,
NULL,
GTK_WIDGET (view),
@@ -812,10 +819,14 @@ dma_sparse_view_update_adjustement (DmaSparseView *view)
if (view->priv->vadjustment != NULL)
{
GtkAdjustment *vadj = view->priv->vadjustment;
+ gdouble step_increment, page_size;
+
+ step_increment = view->priv->char_by_line;
+ page_size = (view->priv->line_by_page - 1) * step_increment;
- vadj->step_increment = view->priv->char_by_line;
- vadj->page_size = (view->priv->line_by_page - 1) * vadj->step_increment;
- vadj->page_increment = vadj->page_size * 0.9;
+ gtk_adjustment_set_step_increment (vadj, step_increment);
+ gtk_adjustment_set_page_size (vadj, page_size);
+ gtk_adjustment_set_page_increment (vadj, page_size * 0.9);
gtk_adjustment_changed (vadj);
}
}
@@ -859,9 +870,9 @@ dma_sparse_view_set_scroll_adjustments (GtkTextView *text_view,
G_CALLBACK (dma_sparse_view_value_changed),
view);
- vadj->upper = dma_sparse_buffer_get_upper (view->priv->buffer);
- vadj->lower = dma_sparse_buffer_get_lower (view->priv->buffer);
- vadj->value = 0;
+ gtk_adjustment_set_upper (vadj, dma_sparse_buffer_get_upper (view->priv->buffer));
+ gtk_adjustment_set_lower (vadj, dma_sparse_buffer_get_lower (view->priv->buffer));
+ gtk_adjustment_set_value (vadj, 0);
}
view->priv->vadjustment = vadj;
dma_sparse_view_update_adjustement (view);
diff --git a/plugins/document-manager/action-callbacks.c b/plugins/document-manager/action-callbacks.c
index 62878c2..88ca7ca 100644
--- a/plugins/document-manager/action-callbacks.c
+++ b/plugins/document-manager/action-callbacks.c
@@ -81,7 +81,7 @@ get_current_popup_active (gpointer user_data)
if (widget)
{
widget = gtk_widget_get_toplevel (widget);
- if (GTK_WIDGET_TOPLEVEL (widget))
+ if (gtk_widget_is_toplevel (widget))
return gtk_window_has_toplevel_focus (GTK_WINDOW (widget));
}
return FALSE;
@@ -844,7 +844,7 @@ on_repeat_quicksearch (GtkAction *action, gpointer user_data)
if (!gtk_widget_get_parent (search_box))
gtk_box_pack_end (GTK_BOX (plugin->vbox), search_box, FALSE, FALSE, 0);
- if (!GTK_WIDGET_VISIBLE (search_box))
+ if (!gtk_widget_get_visible (search_box))
gtk_widget_show (search_box);
on_search_activated (NULL, SEARCH_BOX (search_box));
}
diff --git a/plugins/document-manager/anjuta-docman.c b/plugins/document-manager/anjuta-docman.c
index 7cd1b08..97a7f2a 100644
--- a/plugins/document-manager/anjuta-docman.c
+++ b/plugins/document-manager/anjuta-docman.c
@@ -601,7 +601,7 @@ anjuta_docman_open_file (AnjutaDocman *docman)
docman->priv->fileselection =
create_file_open_dialog_gui(GTK_WINDOW (parent), docman);
}
- if (GTK_WIDGET_VISIBLE (docman->priv->fileselection))
+ if (gtk_widget_get_visible (docman->priv->fileselection))
gtk_window_present (GTK_WINDOW (docman->priv->fileselection));
else
gtk_widget_show (docman->priv->fileselection);
@@ -938,13 +938,12 @@ on_document_destroy (IAnjutaDocument *doc, AnjutaDocman *docman)
if (!docman->priv->shutingdown)
{
- if (GTK_NOTEBOOK (docman)->children == NULL)
+ if ((page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (docman))) == -1)
anjuta_docman_set_current_document (docman, NULL);
else
{
AnjutaDocmanPage *next_page;
/* set a replacement active document */
- page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (docman));
next_page = anjuta_docman_get_nth_page (docman, page_num);
anjuta_docman_set_current_document (docman, next_page->doc);
}
@@ -1052,7 +1051,7 @@ anjuta_docman_get_current_focus_widget (AnjutaDocman *docman)
{
GtkWidget *widget;
widget = gtk_widget_get_toplevel (GTK_WIDGET (docman));
- if (GTK_WIDGET_TOPLEVEL (widget) &&
+ if (gtk_widget_is_toplevel (widget) &&
gtk_window_has_toplevel_focus (GTK_WINDOW (widget)))
{
return gtk_window_get_focus (GTK_WINDOW (widget));
diff --git a/plugins/document-manager/plugin.c b/plugins/document-manager/plugin.c
index 800ab81..b7a313e 100644
--- a/plugins/document-manager/plugin.c
+++ b/plugins/document-manager/plugin.c
@@ -1262,7 +1262,7 @@ on_window_key_press_event (AnjutaShell *shell,
gint pages_nb;
gint cur_page;
- if (!notebook->children)
+ if ((cur_page = gtk_notebook_get_current_page (notebook)) == -1);
return FALSE;
if (!plugin->g_tabbing)
@@ -1270,8 +1270,7 @@ on_window_key_press_event (AnjutaShell *shell,
plugin->g_tabbing = TRUE;
}
- pages_nb = g_list_length (notebook->children);
- cur_page = gtk_notebook_get_current_page (notebook);
+ pages_nb = gtk_notebook_get_n_pages (notebook);
if (global_keymap[i].id == ID_NEXTBUFFER)
cur_page = (cur_page < pages_nb - 1) ? cur_page + 1 : 0;
@@ -1289,7 +1288,7 @@ on_window_key_press_event (AnjutaShell *shell,
GtkNotebook *notebook = GTK_NOTEBOOK (plugin->docman);
gint page_req = global_keymap[i].id - ID_FIRSTBUFFER;
- if (!notebook->children)
+ if (gtk_notebook_get_n_pages (notebook) == 0);
return FALSE;
gtk_notebook_set_current_page(notebook, page_req);
}
diff --git a/plugins/file-loader/anjuta-recent-chooser-menu.c b/plugins/file-loader/anjuta-recent-chooser-menu.c
index 66f4ab4..ab61fc3 100644
--- a/plugins/file-loader/anjuta-recent-chooser-menu.c
+++ b/plugins/file-loader/anjuta-recent-chooser-menu.c
@@ -998,7 +998,7 @@ anjuta_recent_chooser_menu_create_item (AnjutaRecentChooserMenu *menu,
/* ellipsize the menu item label, in case the recent document
* display name is huge.
*/
- label = GTK_BIN (item)->child;
+ label = gtk_bin_get_child (GTK_BIN (item));
if (GTK_IS_LABEL (label))
{
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
diff --git a/plugins/file-loader/plugin.c b/plugins/file-loader/plugin.c
index 51fd83e..2cfc5ab 100644
--- a/plugins/file-loader/plugin.c
+++ b/plugins/file-loader/plugin.c
@@ -275,8 +275,8 @@ open_with_dialog (AnjutaFileLoaderPlugin *plugin, const gchar *uri,
g_free (message);
hbox = gtk_hbox_new (FALSE, 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->vbox), hbox,
- FALSE, FALSE, 5);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
+ hbox, FALSE, FALSE, 5);
label = gtk_label_new (_("Open with:"));
options = gtk_combo_box_new_text ();
gtk_box_pack_end (GTK_BOX(hbox), options, FALSE, FALSE, 10);
diff --git a/plugins/file-wizard/file.c b/plugins/file-wizard/file.c
index bc4b5d3..9349652 100644
--- a/plugins/file-wizard/file.c
+++ b/plugins/file-wizard/file.c
@@ -272,7 +272,7 @@ on_new_file_okbutton_clicked(GtkWidget *window, GdkEvent *event,
source_type = gtk_combo_box_get_active(GTK_COMBO_BOX(optionmenu));
checkbutton = GTK_WIDGET (gtk_builder_get_object (nfg->bxml, NEW_FILE_HEADER));
- if (GTK_WIDGET_SENSITIVE(checkbutton) &&
+ if (gtk_widget_get_sensitive (checkbutton) &&
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton)))
{
if (name && strlen (name) > 0)
@@ -299,7 +299,7 @@ on_new_file_okbutton_clicked(GtkWidget *window, GdkEvent *event,
}
checkbutton = GTK_WIDGET (gtk_builder_get_object (nfg->bxml, NEW_FILE_TEMPLATE));
- if (GTK_WIDGET_SENSITIVE(checkbutton) &&
+ if (gtk_widget_get_sensitive (checkbutton) &&
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton)))
{
insert_header(macro, source_type);
@@ -312,7 +312,7 @@ on_new_file_okbutton_clicked(GtkWidget *window, GdkEvent *event,
}
checkbutton = GTK_WIDGET (gtk_builder_get_object (nfg->bxml, NEW_FILE_LICENSE));
- if (GTK_WIDGET_SENSITIVE(checkbutton) &&
+ if (gtk_widget_get_sensitive (checkbutton) &&
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbutton)))
{
optionmenu = GTK_WIDGET (gtk_builder_get_object (nfg->bxml, NEW_FILE_MENU_LICENSE));
diff --git a/plugins/gbf-am/gbf-am-properties.c b/plugins/gbf-am/gbf-am-properties.c
index 669ba8a..df7d87b 100644
--- a/plugins/gbf-am/gbf-am-properties.c
+++ b/plugins/gbf-am/gbf-am-properties.c
@@ -141,10 +141,13 @@ recursive_config_foreach_cb (const gchar *key, GbfAmConfigValue *value,
GtkWidget *table;
GtkWidget *label;
GtkWidget *widget;
+ GList *children;
gint position;
table = GTK_WIDGET (user_data);
- position = g_list_length (GTK_TABLE (table)->children);
+ children = gtk_container_get_children (GTK_CONTAINER (table));
+ position = g_list_length (children);
+ g_list_free (children);
label = gtk_label_new (key);
gtk_misc_set_alignment (GTK_MISC (label), 0, -1);
@@ -837,7 +840,7 @@ gbf_am_properties_get_widget (GbfAmProject *project, GError **error)
table = GTK_WIDGET (gtk_builder_get_object (bxml, "general_properties_table"));
g_object_ref (top_level);
- gtk_container_remove (GTK_CONTAINER(top_level->parent), top_level);
+ gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (top_level)), top_level);
g_signal_connect (add_module_button, "clicked",
G_CALLBACK (add_package_module_clicked_cb),
@@ -1449,7 +1452,7 @@ on_advanced_clicked (GtkButton* button,
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE,
NULL);
- gtk_container_add (GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table_cflags);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG(dialog))), table_cflags);
gtk_widget_show_all (dialog);
gtk_dialog_run (GTK_DIALOG (dialog));
diff --git a/plugins/gbf-mkfile/gbf-mkfile-properties.c b/plugins/gbf-mkfile/gbf-mkfile-properties.c
index b5c6078..0fb3534 100644
--- a/plugins/gbf-mkfile/gbf-mkfile-properties.c
+++ b/plugins/gbf-mkfile/gbf-mkfile-properties.c
@@ -116,10 +116,13 @@ recursive_config_foreach_cb (const gchar *key, GbfMkfileConfigValue *value,
GtkWidget *table;
GtkWidget *label;
GtkWidget *widget;
+ GList *children;
gint position;
table = GTK_WIDGET (user_data);
- position = g_list_length (GTK_TABLE (table)->children);
+ children = gtk_container_get_children (GTK_CONTAINER (table));
+ position = g_list_length (children);
+ g_list_free (children);
label = gtk_label_new (key);
gtk_misc_set_alignment (GTK_MISC (label), 0, -1);
diff --git a/plugins/git/giggle-graph-renderer.c b/plugins/git/giggle-graph-renderer.c
index 6997df7..407df61 100644
--- a/plugins/git/giggle-graph-renderer.c
+++ b/plugins/git/giggle-graph-renderer.c
@@ -222,7 +222,7 @@ giggle_graph_renderer_get_size (GtkCellRenderer *cell,
gint size;
priv = GIGGLE_GRAPH_RENDERER (cell)->_priv;
- size = PANGO_PIXELS (pango_font_description_get_size (widget->style->font_desc));
+ size = PANGO_PIXELS (pango_font_description_get_size (gtk_widget_get_style (widget)->font_desc));
if (height) {
*height = PATH_SPACE (size);
@@ -273,7 +273,7 @@ giggle_graph_renderer_render (GtkCellRenderer *cell,
y = background_area->y;
h = background_area->height;
revision = priv->revision;
- size = PANGO_PIXELS (pango_font_description_get_size (widget->style->font_desc));
+ size = PANGO_PIXELS (pango_font_description_get_size (gtk_widget_get_style (widget)->font_desc));
table = g_hash_table_new (g_direct_hash, g_direct_equal);
paths_state = g_object_get_qdata (G_OBJECT (revision), revision_paths_state_quark);
diff --git a/plugins/git/git-create-branch-dialog.c b/plugins/git/git-create-branch-dialog.c
index f01cbf8..90a06b0 100644
--- a/plugins/git/git-create-branch-dialog.c
+++ b/plugins/git/git-create-branch-dialog.c
@@ -161,7 +161,7 @@ on_branch_revision_radio_toggled (GtkToggleButton *toggle_button,
active = gtk_toggle_button_get_active (toggle_button);
gtk_widget_set_sensitive (widget, active);
- if (active && GTK_WIDGET_CAN_FOCUS (widget))
+ if (active && gtk_widget_get_can_focus (widget))
{
gtk_window_set_focus (GTK_WINDOW (create_branch_dialog),
widget);
diff --git a/plugins/git/git-log-dialog.c b/plugins/git/git-log-dialog.c
index 1ea3edf..8b9f2b9 100644
--- a/plugins/git/git-log-dialog.c
+++ b/plugins/git/git-log-dialog.c
@@ -127,8 +127,8 @@ create_columns (LogData *data)
GtkCellRenderer *renderer;
log_changes_view = GTK_WIDGET (gtk_builder_get_object (data->bxml, "log_changes_view"));
- font_size = PANGO_PIXELS (pango_font_description_get_size (GTK_WIDGET (log_changes_view)->style->font_desc));
-
+ font_size = PANGO_PIXELS (pango_font_description_get_size (gtk_widget_get_style (GTK_WIDGET (log_changes_view))->font_desc));
+
/* Ref info */
column = gtk_tree_view_column_new ();
gtk_tree_view_append_column (GTK_TREE_VIEW (log_changes_view), column);
diff --git a/plugins/gtodo/add_edit_item.c b/plugins/gtodo/add_edit_item.c
index fa6fb65..43ce1ed 100644
--- a/plugins/gtodo/add_edit_item.c
+++ b/plugins/gtodo/add_edit_item.c
@@ -143,7 +143,7 @@ void gui_add_todo_item(GtkWidget *useless, gpointer data, guint32 openid){
/* the vbox for the selectors, buttons */
vbox = gtk_vbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 9);
/* summary label */
diff --git a/plugins/gtodo/egg-datetime.c b/plugins/gtodo/egg-datetime.c
index 1c72611..63b1635 100644
--- a/plugins/gtodo/egg-datetime.c
+++ b/plugins/gtodo/egg-datetime.c
@@ -824,15 +824,17 @@ get_time_string (guint8 hour, guint8 minute, guint8 second)
popup_position (GtkWidget *widget, GtkWindow *popup)
{
GtkRequisition requisition;
+ GtkAllocation allocation;
gint x, y, width, height;
gtk_widget_size_request (GTK_WIDGET (popup), &requisition);
- gdk_window_get_origin (widget->window, &x, &y);
+ gdk_window_get_origin (gtk_widget_get_window (widget), &x, &y);
- x += widget->allocation.x;
- y += widget->allocation.y;
- width = widget->allocation.width;
- height = widget->allocation.height;
+ gtk_widget_get_allocation (widget, &allocation);
+ x += allocation.x;
+ y += allocation.y;
+ width = allocation.width;
+ height = allocation.height;
x += width - requisition.width;
y += height;
@@ -1029,7 +1031,7 @@ cal_popup_button_pressed (EggDateTime *edt, GdkEventButton *event, GtkWidget *wi
while (child) {
if (child == widget)
return FALSE;
- child = child->parent;
+ child = gtk_widget_get_parent (child);
}
}
@@ -1103,7 +1105,8 @@ time_popup_changed (EggDateTime *edt, Timelist *timelist)
normalize_time (edt);
- if(GTK_WIDGET_VISIBLE(timelist))update_time_label (edt);
+ if (gtk_widget_get_visible (timelist))
+ update_time_label (edt);
g_signal_emit (G_OBJECT (edt), egg_datetime_signals[SIGNAL_TIME_CHANGED], 0);
}
@@ -1139,7 +1142,7 @@ time_popup_button_pressed (EggDateTime *edt, GdkEventButton *event, GtkWidget *w
while (child) {
if (child == widget)
return FALSE;
- child = child->parent;
+ child = gtk_widget_get_parent (child);
}
}
diff --git a/plugins/gtodo/list_tooltip.c b/plugins/gtodo/list_tooltip.c
index 770038e..95dd144 100644
--- a/plugins/gtodo/list_tooltip.c
+++ b/plugins/gtodo/list_tooltip.c
@@ -103,18 +103,21 @@ static
void mw_paint_tip(GtkWidget *widget, GdkEventExpose *event)
{
GtkStyle *style;
+ GdkWindow *window;
char *tooltiptext = get_tooltip_text();
+
if(tooltiptext == NULL) tooltiptext = g_strdup("oeps");
pango_layout_set_markup(layout, tooltiptext, strlen(tooltiptext));
pango_layout_set_wrap(layout, PANGO_WRAP_WORD);
pango_layout_set_width(layout, 300000);
- style = tipwindow->style;
+ style = gtk_widget_get_style (tipwindow);
+ window = gtk_widget_get_window (tipwindow);
- gtk_paint_flat_box (style, tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+ gtk_paint_flat_box (style, window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
NULL, tipwindow, "tooltip", 0, 0, -1, -1);
- gtk_paint_layout (style, tipwindow->window, GTK_STATE_NORMAL, TRUE,
+ gtk_paint_layout (style, window, GTK_STATE_NORMAL, TRUE,
NULL, tipwindow, "tooltip", 4, 4, layout);
/*
g_object_unref(layout);
@@ -125,13 +128,14 @@ void mw_paint_tip(GtkWidget *widget, GdkEventExpose *event)
gboolean mw_tooltip_timeout(GtkWidget *tv)
{
+ GtkAllocation allocation;
int scr_w,scr_h, w, h, x, y;
char *tooltiptext = NULL;
tooltiptext = get_tooltip_text();
tipwindow = gtk_window_new(GTK_WINDOW_POPUP);
- tipwindow->parent = tv;
+ gtk_widget_set_parent(tipwindow, tv);
gtk_widget_set_app_paintable(tipwindow, TRUE);
gtk_window_set_resizable(GTK_WINDOW(tipwindow), FALSE);
gtk_widget_set_name(tipwindow, "gtk-tooltips");
@@ -150,8 +154,11 @@ gboolean mw_tooltip_timeout(GtkWidget *tv)
h = PANGO_PIXELS(h) + 8;
gdk_window_get_pointer(NULL, &x, &y, NULL);
- if (GTK_WIDGET_NO_WINDOW(mw.vbox))
- y += mw.vbox->allocation.y;
+ if (!gtk_widget_get_has_window (mw.vbox))
+ {
+ gtk_widget_get_allocation (mw.vbox, &allocation);
+ y += allocation.y;
+ }
x -= ((w >> 1) + 4);
diff --git a/plugins/gtodo/mcategory.c b/plugins/gtodo/mcategory.c
index e08fc8d..8b27729 100644
--- a/plugins/gtodo/mcategory.c
+++ b/plugins/gtodo/mcategory.c
@@ -23,7 +23,7 @@ void category_manager(void)
NULL);
hbox = gtk_hbox_new(FALSE,12);
- gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox);
+ gtk_container_add(GTK_CONTAINER(gtk_container_get_content_area(GTK_DIALOG(dialog))), hbox);
gtk_container_set_border_width(GTK_CONTAINER(hbox), 6);
/* the list */
diff --git a/plugins/gtodo/notification.c b/plugins/gtodo/notification.c
index 91a19f2..46e28a6 100644
--- a/plugins/gtodo/notification.c
+++ b/plugins/gtodo/notification.c
@@ -43,6 +43,7 @@ void create_notification_window(GTodoItem *item)
{
GtkWidget *dialog, *but_cancel, *image, *ck_but;
GtkWidget *hbox, *label, *vbox;
+ GtkWidget *content_area;
gchar *buffer, *tempstr;
if(table == NULL) table = g_array_new(TRUE, TRUE, sizeof(GtkWidget *));
else{
@@ -78,8 +79,9 @@ void create_notification_window(GTodoItem *item)
}
/* create image and more stuff in dialog */
dialog = gtk_dialog_new();
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG(dialog));
gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)), 6);
- gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), 12);
+ gtk_container_set_border_width(GTK_CONTAINER(content_area), 12);
/* hig stuff */
gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(mw.window));
@@ -94,7 +96,7 @@ void create_notification_window(GTodoItem *item)
gtk_container_set_border_width(GTK_CONTAINER(hbox), 12);
vbox= gtk_vbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, TRUE, TRUE,0);
+ gtk_box_pack_start(GTK_BOX(content_area), hbox, TRUE, TRUE,0);
/* Add the image */
image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG);
label = gtk_alignment_new(0.5, 0,0,0);
diff --git a/plugins/gtodo/preferences.c b/plugins/gtodo/preferences.c
index 34b4136..24d71e6 100644
--- a/plugins/gtodo/preferences.c
+++ b/plugins/gtodo/preferences.c
@@ -23,7 +23,7 @@ void gui_preferences(void)
GTK_STOCK_CLOSE,
GTK_RESPONSE_CANCEL,
NULL);
- gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), notebook);
+ gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), notebook);
gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
gtk_widget_show_all(dialog);
diff --git a/plugins/macro/macro-dialog.c b/plugins/macro/macro-dialog.c
index 63ffee8..18a79c6 100644
--- a/plugins/macro/macro-dialog.c
+++ b/plugins/macro/macro-dialog.c
@@ -272,7 +272,8 @@ macro_dialog_init (MacroDialog * dialog)
table = GTK_WIDGET (gtk_builder_get_object (dialog->bxml, "macro_dialog_table"));
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
+ table);
gtk_dialog_add_buttons (GTK_DIALOG (dialog), _("Insert"), OK,
GTK_STOCK_CANCEL, CANCEL, NULL);
gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 300);
diff --git a/plugins/macro/macro-edit.c b/plugins/macro/macro-edit.c
index c4146c9..8452359 100644
--- a/plugins/macro/macro-edit.c
+++ b/plugins/macro/macro-edit.c
@@ -85,9 +85,7 @@ on_add_ok_clicked (MacroEdit * edit)
macro_db_add (edit->macro_db,
gtk_entry_get_text (GTK_ENTRY (edit->name_entry)),
- gtk_entry_get_text (GTK_ENTRY
- (GTK_BIN (edit->category_entry)->
- child)),
+ gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (edit->category_entry)))),
gtk_entry_get_text (GTK_ENTRY (edit->shortcut_entry)),
text);
gtk_widget_destroy (GTK_WIDGET (edit));
@@ -118,11 +116,8 @@ on_edit_ok_clicked (MacroEdit * edit)
macro_db_change (edit->macro_db, &iter,
gtk_entry_get_text (GTK_ENTRY (edit->name_entry)),
- gtk_entry_get_text (GTK_ENTRY
- (GTK_BIN (edit->category_entry)->
- child)),
- gtk_entry_get_text (GTK_ENTRY
- (edit->shortcut_entry)), text);
+ gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (edit->category_entry)))),
+ gtk_entry_get_text (GTK_ENTRY (edit->shortcut_entry)), text);
gtk_widget_destroy (GTK_WIDGET (edit));
}
@@ -203,7 +198,8 @@ macro_edit_init (MacroEdit * edit)
}
table = GTK_WIDGET (gtk_builder_get_object (edit->bxml, "macro_edit_table"));
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (edit)->vbox), table);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (edit))),
+ table);
gtk_dialog_add_buttons (GTK_DIALOG (edit), GTK_STOCK_OK, OK,
GTK_STOCK_CANCEL, CANCEL, NULL);
g_signal_connect (G_OBJECT (edit), "response",
@@ -291,9 +287,8 @@ macro_edit_fill (MacroEdit * edit, GtkTreeSelection * select)
g_strdup_printf ("%c", shortcut);
gtk_entry_set_text (GTK_ENTRY (edit->name_entry),
name);
- gtk_entry_set_text (GTK_ENTRY
- (GTK_BIN (edit->category_entry)->
- child), category);
+ gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (edit->category_entry))),
+ category);
gtk_entry_set_text (GTK_ENTRY (edit->shortcut_entry),
shortcut_string);
g_free (shortcut_string);
diff --git a/plugins/message-view/anjuta-msgman.c b/plugins/message-view/anjuta-msgman.c
index dd1bcbc..8b47769 100644
--- a/plugins/message-view/anjuta-msgman.c
+++ b/plugins/message-view/anjuta-msgman.c
@@ -388,7 +388,7 @@ on_message_view_destroy (MessageView *view, AnjutaMsgman *msgman)
// gtk_notebook_remove_page (GTK_NOTEBOOK (msgman), page_num);
/* This is called to set the next active document */
- if (GTK_NOTEBOOK (msgman)->children == NULL)
+ if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (msgman)) == 0)
anjuta_msgman_set_current_view (msgman, NULL);
g_signal_handlers_unblock_by_func (GTK_OBJECT (msgman),
diff --git a/plugins/message-view/message-view.c b/plugins/message-view/message-view.c
index 186bf42..7a1ba70 100644
--- a/plugins/message-view/message-view.c
+++ b/plugins/message-view/message-view.c
@@ -308,7 +308,7 @@ on_message_event (GObject* object, GdkEvent* event, gpointer data)
message);
return TRUE;
}
- }
+ }
return FALSE;
}
else if (event->type == GDK_BUTTON_PRESS)
@@ -335,14 +335,15 @@ on_filter_buttons_toggled (GtkToggleButton *toggle, gpointer user_data)
static void
on_adjustment_changed (GtkAdjustment* adj, gpointer data)
{
- gtk_adjustment_set_value (adj, adj->upper - adj->page_size);
+ gtk_adjustment_set_value (adj,
+ gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj));
}
static void
on_adjustment_value_changed (GtkAdjustment* adj, gpointer data)
{
MessageView *self = MESSAGE_VIEW (data);
- if (adj->value > (adj->upper - adj->page_size) - 0.1)
+ if (gtk_adjustment_get_value (adj) > (gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj)) - 0.1)
{
if (!self->privat->adj_chgd_hdlr)
{
diff --git a/plugins/patch/patch-plugin.c b/plugins/patch/patch-plugin.c
index 80eda29..51201d5 100644
--- a/plugins/patch/patch-plugin.c
+++ b/plugins/patch/patch-plugin.c
@@ -47,7 +47,7 @@ static gint patch_level = 0;
static void
patch_level_changed (GtkAdjustment *adj)
{
- patch_level = (gint) adj->value;
+ patch_level = (gint) gtk_adjustment_get_value (adj);
}
static gchar* get_project_uri(PatchPlugin *plugin)
diff --git a/plugins/project-manager/gbf-project-view.c b/plugins/project-manager/gbf-project-view.c
index 2db6a70..f932a0c 100644
--- a/plugins/project-manager/gbf-project-view.c
+++ b/plugins/project-manager/gbf-project-view.c
@@ -260,9 +260,9 @@ expose_event (GtkWidget *widget, GdkEventExpose *ev)
if (root) {
gtk_tree_view_get_background_area (
tree_view, root, gtk_tree_view_get_column (tree_view, 0), &rect);
- gtk_paint_hline (widget->style,
+ gtk_paint_hline (gtk_widget_get_style (widget),
ev->window,
- GTK_WIDGET_STATE (widget),
+ gtk_widget_get_state (widget),
&ev->area,
widget,
"",
diff --git a/plugins/project-manager/plugin.c b/plugins/project-manager/plugin.c
index 48492d2..bf6ef23 100644
--- a/plugins/project-manager/plugin.c
+++ b/plugins/project-manager/plugin.c
@@ -448,8 +448,8 @@ project_manager_show_properties_dialog (ProjectManagerPlugin *plugin,
G_CALLBACK (on_properties_dialog_response),
plugin);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG(win)->vbox),
- properties);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG(win))),
+ properties);
gtk_window_set_default_size (GTK_WINDOW (win), 450, -1);
gtk_widget_show (win);
}
diff --git a/plugins/project-wizard/property.c b/plugins/project-wizard/property.c
index 5a1c41e..9d391e8 100644
--- a/plugins/project-wizard/property.c
+++ b/plugins/project-wizard/property.c
@@ -479,6 +479,7 @@ npw_property_create_widget (NPWProperty* prop)
break;
case NPW_LIST_PROPERTY:
{
+ GtkWidget *child;
GSList* node;
gboolean get_value = FALSE;
@@ -492,11 +493,12 @@ npw_property_create_widget (NPWProperty* prop)
get_value = TRUE;
}
}
+ child = gtk_bin_get_child (GTK_BIN (entry));
if (!(prop->options & NPW_EDITABLE_OPTION))
{
- gtk_editable_set_editable (GTK_EDITABLE (GTK_BIN (entry)->child), FALSE);
+ gtk_editable_set_editable (child, FALSE);
}
- if (value) gtk_entry_set_text (GTK_ENTRY (GTK_BIN (entry)->child), value);
+ if (value) gtk_entry_set_text (child, value);
break;
}
default:
@@ -600,7 +602,7 @@ npw_property_set_value_from_widget (NPWProperty* prop, NPWValueTag tag)
{
GSList* node;
- value = gtk_entry_get_text (GTK_ENTRY (GTK_BIN (prop->widget)->child));
+ value = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (prop->widget))));
for (node = prop->items; node != NULL; node = node->next)
{
if (strcmp (value, _(((NPWItem *)node->data)->label)) == 0)
diff --git a/plugins/run-program/parameters.c b/plugins/run-program/parameters.c
index 2f7c6d9..062e763 100644
--- a/plugins/run-program/parameters.c
+++ b/plugins/run-program/parameters.c
@@ -237,7 +237,7 @@ save_dialog_data (RunDialog* dlg)
RunProgramPlugin *plugin = dlg->plugin;
/* Save arguments */
- arg = gtk_entry_get_text (GTK_ENTRY (GTK_BIN (dlg->args)->child));
+ arg = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (dlg->args))));
if (arg != NULL)
{
find = g_list_find_custom(plugin->recent_args, arg, (GCompareFunc)strcmp);
@@ -250,7 +250,7 @@ save_dialog_data (RunDialog* dlg)
}
/* Save target */
- filename = gtk_entry_get_text (GTK_ENTRY (GTK_BIN (dlg->target)->child));
+ filename = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (dlg->target))));
if ((filename != NULL) && (*filename != '\0'))
{
GFile *file;
@@ -313,7 +313,7 @@ on_select_target (RunDialog* dlg)
{
gchar* filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (sel_dlg));
- gtk_entry_set_text (GTK_ENTRY (GTK_BIN (dlg->target)->child), filename);
+ gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (dlg->target))), filename);
g_free (filename);
}
gtk_widget_destroy (GTK_WIDGET (sel_dlg));
@@ -598,6 +598,7 @@ run_dialog_init (RunDialog *dlg, RunProgramPlugin *plugin)
{
GtkBuilder *bxml;
GtkWindow *parent;
+ GtkWidget *child;
GtkCellRenderer *renderer;
GtkTreeModel* model;
GtkTreeViewColumn *column;
@@ -650,7 +651,7 @@ run_dialog_init (RunDialog *dlg, RunProgramPlugin *plugin)
g_list_foreach (plugin->recent_args, on_add_string_in_model, model);
if (plugin->recent_args != NULL)
{
- gtk_entry_set_text (GTK_ENTRY (GTK_BIN (dlg->args)->child), (const char *)plugin->recent_args->data);
+ gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (dlg->args))), (const char *)plugin->recent_args->data);
}
g_object_unref (model);
@@ -704,13 +705,15 @@ run_dialog_init (RunDialog *dlg, RunProgramPlugin *plugin)
* new project created by the wizard without any change */
if (plugin->recent_dirs == NULL) gtk_file_chooser_set_uri (dlg->dirs, project_root_uri);
}
+
+ child = gtk_bin_get_child (GTK_BIN (dlg->target));
if (plugin->recent_target != NULL)
{
gchar *local;
local = anjuta_util_get_local_path_from_uri ((const char *)plugin->recent_target->data);
- gtk_entry_set_text (GTK_ENTRY (GTK_BIN (dlg->target)->child), local);
+ gtk_entry_set_text (GTK_ENTRY (child), local);
g_free (local);
}
else
@@ -726,7 +729,7 @@ run_dialog_init (RunDialog *dlg, RunProgramPlugin *plugin)
gtk_tree_model_get (model, &iter,
0, &default_target,
-1);
- gtk_entry_set_text (GTK_ENTRY (GTK_BIN (dlg->target)->child), default_target);
+ gtk_entry_set_text (GTK_ENTRY (child), default_target);
g_free (default_target);
}
}
@@ -777,7 +780,7 @@ run_parameters_dialog_or_try_execute (RunProgramPlugin *plugin, gboolean try_run
gint response;
run_dialog_init (&dlg, plugin);
- const char *target = gtk_entry_get_text (GTK_ENTRY (GTK_BIN (dlg.target)->child));
+ const char *target = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (dlg.target))));
if (try_run && target && *target)
{
save_dialog_data (&dlg);
diff --git a/plugins/search/search-replace.c b/plugins/search/search-replace.c
index aec503b..91fa836 100644
--- a/plugins/search/search-replace.c
+++ b/plugins/search/search-replace.c
@@ -1321,7 +1321,7 @@ create_dialog(void)
if (GE_COMBO_ENTRY == w->type)
{
/* Get child of GtkComboBoxEntry */
- w->widget = GTK_BIN(w->widget)->child;
+ w->widget = gtk_bin_get_child (GTK_BIN (w->widget));
}
g_object_ref(w->widget);
if (GE_COMBO == w->type && NULL != w->extra)
@@ -1333,7 +1333,7 @@ create_dialog(void)
widget = sr_get_gladewidget(SEARCH_STRING_COMBO)->widget;
g_signal_connect (widget, "changed", G_CALLBACK (on_search_expression_changed), NULL);
/* Entry in the GtkComboBoxEntry */
- widget = GTK_BIN (widget)->child;
+ widget = gtk_bin_get_child (GTK_BIN (widget));
gtk_entry_set_activates_default (GTK_ENTRY(widget), TRUE);
g_signal_connect (widget, "changed", G_CALLBACK (on_search_expression_entry_changed), NULL);
widget = sr_get_gladewidget(SEARCH_STRING)->widget;
@@ -1929,7 +1929,7 @@ on_search_expression_activate (GtkEditable *edit, gpointer user_data)
search_replace_populate();
search_and_replace();
- combo = GTK_WIDGET(edit)->parent;
+ combo = gtk_widget_get_parent (GTK_WIDGET(edit));
reset_flags_and_search_button();
}
@@ -2085,8 +2085,8 @@ anjuta_search_replace_activate (gboolean replace, gboolean project)
/* Set default button */
if (search_button)
{
- GTK_WIDGET_SET_FLAGS (search_button, GTK_CAN_DEFAULT);
- gtk_widget_grab_default(search_button);
+ gtk_widget_set_can_default (search_button, TRUE);
+ gtk_widget_grab_default (search_button);
}
show_dialog();
}
diff --git a/plugins/sourceview/anjuta-view.c b/plugins/sourceview/anjuta-view.c
index df19893..c938daf 100644
--- a/plugins/sourceview/anjuta-view.c
+++ b/plugins/sourceview/anjuta-view.c
@@ -285,7 +285,7 @@ move_cursor (GtkTextView *text_view,
const GtkTextIter *new_location,
gboolean extend_selection)
{
- GtkTextBuffer *buffer = text_view->buffer;
+ GtkTextBuffer *buffer = gtk_text_view_get_buffer (text_view);
if (extend_selection)
gtk_text_buffer_move_mark_by_name (buffer,
@@ -308,7 +308,7 @@ anjuta_view_move_cursor (GtkTextView *text_view,
gint count,
gboolean extend_selection)
{
- GtkTextBuffer *buffer = text_view->buffer;
+ GtkTextBuffer *buffer = gtk_text_view_get_buffer (text_view);
GtkTextMark *mark;
GtkTextIter cur, iter;
diff --git a/plugins/sourceview/assist-tip.c b/plugins/sourceview/assist-tip.c
index 903989e..ad27c72 100644
--- a/plugins/sourceview/assist-tip.c
+++ b/plugins/sourceview/assist-tip.c
@@ -42,15 +42,17 @@ assist_tip_init (AssistTip *object)
{
GtkWidget* alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
GtkWidget* window = GTK_WIDGET(object);
+ GtkStyle* style;
gtk_widget_set_name (GTK_WIDGET(object), "gtk-tooltip");
gtk_widget_set_app_paintable (GTK_WIDGET(object), TRUE);
-
+
+ style = gtk_widget_get_style (window);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment),
- window->style->ythickness,
- window->style->ythickness,
- window->style->xthickness,
- window->style->xthickness);
+ style->ythickness,
+ style->ythickness,
+ style->xthickness,
+ style->xthickness);
object->label = gtk_label_new ("");
gtk_widget_show (object->label);
diff --git a/plugins/sourceview/assist-window.c b/plugins/sourceview/assist-window.c
index 38b7248..70a7605 100644
--- a/plugins/sourceview/assist-window.c
+++ b/plugins/sourceview/assist-window.c
@@ -89,7 +89,7 @@ assist_window_expose(GtkWidget* widget, GdkEventExpose* event)
NULL, NULL, NULL, &height);
screen = gtk_widget_get_screen (text_view);
- monitor_num = gdk_screen_get_monitor_at_window (screen, text_view->window);
+ monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (text_view));
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
gtk_widget_style_get (GTK_WIDGET (assistwin->priv->view),
@@ -103,10 +103,10 @@ assist_window_expose(GtkWidget* widget, GdkEventExpose* event)
{
int scrollbar_spacing;
GtkRequisition scrollbar_req;
- gtk_widget_size_request (GTK_SCROLLED_WINDOW(assistwin->priv->scrolled_window)->vscrollbar,
- &scrollbar_req);
+ gtk_widget_size_request (gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (assistwin->priv->scrolled_window)),
+ &scrollbar_req);
gtk_widget_style_get (GTK_WIDGET (assistwin->priv->scrolled_window),
- "scrollbar-spacing", &scrollbar_spacing, NULL);
+ "scrollbar-spacing", &scrollbar_spacing, NULL);
width += scrollbar_req.width + scrollbar_spacing;
}
@@ -269,7 +269,7 @@ static gboolean assist_window_select(AssistWindow* assistwin)
GtkTreeModel* model;
GtkTreeSelection* selection;
- if (!GTK_WIDGET_VISIBLE(GTK_WIDGET(assistwin)))
+ if (!gtk_widget_get_visible(GTK_WIDGET(assistwin)))
return FALSE;
selection = gtk_tree_view_get_selection(assistwin->priv->view);
@@ -293,7 +293,7 @@ static gboolean assist_window_first(AssistWindow* assistwin)
GtkTreeModel* model;
GtkTreeSelection* selection;
- if (!GTK_WIDGET_VISIBLE(GTK_WIDGET(assistwin)))
+ if (!gtk_widget_get_visible(GTK_WIDGET(assistwin)))
return FALSE;
selection = gtk_tree_view_get_selection(assistwin->priv->view);
@@ -319,7 +319,7 @@ static gboolean assist_window_last(AssistWindow* assistwin)
GtkTreePath* path;
gint children;
- if (!GTK_WIDGET_VISIBLE(GTK_WIDGET(assistwin)))
+ if (!gtk_widget_get_visible(GTK_WIDGET(assistwin)))
return FALSE;
selection = gtk_tree_view_get_selection(assistwin->priv->view);
@@ -349,7 +349,7 @@ static gboolean assist_window_up(AssistWindow* assistwin, gint rows)
GtkTreeModel* model;
GtkTreeSelection* selection;
- if (!GTK_WIDGET_VISIBLE(GTK_WIDGET(assistwin)))
+ if (!gtk_widget_get_visible(GTK_WIDGET(assistwin)))
return FALSE;
selection = gtk_tree_view_get_selection(assistwin->priv->view);
@@ -381,7 +381,7 @@ static gboolean assist_window_down(AssistWindow* assistwin, gint rows)
GtkTreeModel* model;
GtkTreeSelection* selection;
- if (!GTK_WIDGET_VISIBLE(GTK_WIDGET(assistwin)))
+ if (!gtk_widget_get_visible(GTK_WIDGET(assistwin)))
return FALSE;
selection = gtk_tree_view_get_selection(assistwin->priv->view);
@@ -527,7 +527,7 @@ assist_window_filter_keypress(AssistWindow* assist_window, guint keyval)
gboolean assist_window_is_active(AssistWindow* assistwin)
{
- return GTK_WIDGET_VISIBLE(GTK_WIDGET(assistwin));
+ return gtk_widget_get_visible(GTK_WIDGET(assistwin));
}
AssistWindow*
diff --git a/plugins/starter/starter.c b/plugins/starter/starter.c
index 6612203..722a25a 100644
--- a/plugins/starter/starter.c
+++ b/plugins/starter/starter.c
@@ -246,12 +246,17 @@ static gboolean
on_expose_event_cb (GtkWidget *widget, GdkEventExpose *event,
Starter *wcm)
{
+ GtkAllocation allocation;
+ GdkWindow *window;
cairo_t *cr;
cairo_pattern_t *pattern;
+
+ window = gtk_widget_get_window (widget);
- cr = gdk_cairo_create (widget->window);
-
- pattern = cairo_pattern_create_linear (0, 0, 0, widget->allocation.height);
+ cr = gdk_cairo_create (window);
+
+ gtk_widget_get_allocation (widget, &allocation);
+ pattern = cairo_pattern_create_linear (0, 0, 0, allocation.height);
if (gdk_screen_get_rgba_colormap (gtk_widget_get_screen (widget)) &&
gtk_widget_is_composited (widget))
@@ -276,7 +281,7 @@ on_expose_event_cb (GtkWidget *widget, GdkEventExpose *event,
cairo_destroy (cr);
- cr = gdk_cairo_create (widget->window);
+ cr = gdk_cairo_create (window);
gdk_cairo_set_source_pixbuf (cr, wcm->priv->logo, 20, 20);
diff --git a/plugins/symbol-db/symbol-db-search-command.c b/plugins/symbol-db/symbol-db-search-command.c
index 72ecc72..ff7950a 100644
--- a/plugins/symbol-db/symbol-db-search-command.c
+++ b/plugins/symbol-db/symbol-db-search-command.c
@@ -35,7 +35,7 @@ struct _SymbolDBSearchCommandPriv {
IAnjutaSymbolType match_types;
gboolean include_types;
IAnjutaSymbolField info_fields;
- const gchar *pattern;
+ gchar *pattern;
IAnjutaSymbolManagerSearchFileScope filescope_search;
gint results_limit;
gint results_offset;
@@ -179,7 +179,7 @@ sdb_search_command_run (AnjutaCommand *command)
static void
sdb_search_command_cancel(AnjutaCommand* command)
{
- command->priv->cancelled = TRUE;
+
}
static void
diff --git a/plugins/terminal/terminal.c b/plugins/terminal/terminal.c
index a831ca3..13050f0 100644
--- a/plugins/terminal/terminal.c
+++ b/plugins/terminal/terminal.c
@@ -661,8 +661,8 @@ create_box (GtkWidget *term)
GtkWidget *sb, *hbox;
sb = gtk_vscrollbar_new (GTK_ADJUSTMENT (VTE_TERMINAL (term)->adjustment));
- GTK_WIDGET_UNSET_FLAGS (sb, GTK_CAN_FOCUS);
-
+ gtk_widget_set_can_focus (sb, FALSE);
+
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), term, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), sb, FALSE, TRUE, 0);
diff --git a/src/action-callbacks.c b/src/action-callbacks.c
index a7e0834..a052011 100644
--- a/src/action-callbacks.c
+++ b/src/action-callbacks.c
@@ -43,7 +43,7 @@ on_exit1_activate (GtkAction * action, AnjutaApp *app)
{
GdkEvent *event = gdk_event_new (GDK_DELETE);
- event->any.window = g_object_ref (GTK_WIDGET(app)->window);
+ event->any.window = g_object_ref (gtk_widget_get_window (GTK_WIDGET(app)));
event->any.send_event = TRUE;
gtk_main_do_event (event);
diff --git a/src/anjuta-app.c b/src/anjuta-app.c
index 883d63e..2b073fb 100644
--- a/src/anjuta-app.c
+++ b/src/anjuta-app.c
@@ -252,7 +252,7 @@ on_session_save (AnjutaShell *shell, AnjutaSessionPhase phase,
return;
/* Save geometry */
- state = gdk_window_get_state (GTK_WIDGET (app)->window);
+ state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (app)));
if (state & GDK_WINDOW_STATE_MAXIMIZED) {
anjuta_session_set_int (session, "Anjuta", "Maximized", 1);
}
@@ -603,7 +603,7 @@ anjuta_app_get_geometry (AnjutaApp *app)
geometry = NULL;
width = height = posx = posy = 0;
- if (GTK_WIDGET(app)->window)
+ if (gtk_widget_get_window (GTK_WIDGET (app)))
{
gtk_window_get_size (GTK_WINDOW (app), &width, &height);
gtk_window_get_position (GTK_WINDOW(app), &posx, &posy);
diff --git a/src/shell.c b/src/shell.c
index 3a1fc75..89cb644 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -75,7 +75,7 @@ on_shortcuts_activate (GtkAction *action, AnjutaTestShell *shell)
win = gtk_dialog_new_with_buttons (_("Anjuta Plugins"), GTK_WINDOW (shell),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE, GTK_STOCK_CANCEL, NULL);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG(win)->vbox), accel_editor, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG(win))), accel_editor, TRUE, TRUE, 0);
gtk_window_set_default_size (GTK_WINDOW (win), 500, 400);
gtk_dialog_run (GTK_DIALOG (win));
gtk_widget_destroy (win);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]