static int
get_toolbar_position (EggEditableToolbar *etoolbar, GtkWidget *toolbar)
{
- return get_dock_position (etoolbar, toolbar->parent);
+ return get_dock_position (etoolbar, gtk_widget_get_parent (toolbar));
}
static int
EggEditableToolbar *etoolbar)
{
int pos, toolbar_pos;
+ GtkWidget *parent;
widget = gtk_widget_get_ancestor (widget, GTK_TYPE_TOOL_ITEM);
g_return_if_fail (widget != NULL);
g_return_if_fail (EGG_IS_EDITABLE_TOOLBAR (etoolbar));
- pos = gtk_toolbar_get_item_index (GTK_TOOLBAR (widget->parent),
+ parent = gtk_widget_get_parent (widget);
+ pos = gtk_toolbar_get_item_index (GTK_TOOLBAR (parent),
GTK_TOOL_ITEM (widget));
- toolbar_pos = get_toolbar_position (etoolbar, widget->parent);
+ toolbar_pos = get_toolbar_position (etoolbar, parent);
egg_toolbars_model_remove_item (etoolbar->priv->model,
toolbar_pos, pos);
EggToolbarsModel *model;
const char *name;
char *data;
+ GdkAtom target;
g_return_if_fail (EGG_IS_EDITABLE_TOOLBAR (etoolbar));
model = egg_editable_toolbar_get_model (etoolbar);
g_return_if_fail (name != NULL);
}
- data = egg_toolbars_model_get_data (model, selection_data->target, name);
+ target = gtk_selection_data_get_target (selection_data);
+ data = egg_toolbars_model_get_data (model, target, name);
if (data != NULL)
{
- gtk_selection_data_set (selection_data, selection_data->target, 8, (unsigned char *)data, strlen (data));
+ gtk_selection_data_set (selection_data, target, 8, (unsigned char *)data, strlen (data));
g_free (data);
}
}
EggEditableToolbar *etoolbar)
{
GtkWidget *toolitem = gtk_widget_get_ancestor (egg_editable_toolbar_get_selected (etoolbar), GTK_TYPE_TOOL_ITEM);
+ GtkWidget *parent = gtk_widget_get_parent (toolitem);
int pos, toolbar_pos;
- toolbar_pos = get_toolbar_position (etoolbar, toolitem->parent);
- pos = gtk_toolbar_get_item_index (GTK_TOOLBAR (toolitem->parent),
+ toolbar_pos = get_toolbar_position (etoolbar, parent);
+ pos = gtk_toolbar_get_item_index (GTK_TOOLBAR (parent),
GTK_TOOL_ITEM (toolitem));
egg_toolbars_model_remove_item (etoolbar->priv->model,
{
EggEditableToolbarPrivate *priv = etoolbar->priv;
GtkWidget *widget = GTK_WIDGET (item);
+ GdkWindow *window = gtk_widget_get_window (widget);
- if (widget->window != NULL)
+ if (window != NULL)
{
if (priv->edit_mode > 0)
{
cursor = gdk_cursor_new_for_display (gdk_screen_get_display (screen),
GDK_HAND2);
- gdk_window_set_cursor (widget->window, cursor);
+ gdk_window_set_cursor (window, cursor);
gdk_cursor_unref (cursor);
gtk_drag_source_set (widget, GDK_BUTTON1_MASK, dest_drag_types,
}
else
{
- gdk_window_set_cursor (GTK_WIDGET(item)->window, NULL);
+ gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET(item)), NULL);
}
}
}
* actually add a new item to the toolbar.
*/
- GdkAtom type = selection_data->type;
- const char *data = (char *)selection_data->data;
+ GdkAtom type = gtk_selection_data_get_data_type (selection_data);
+ const char *data = (char *)gtk_selection_data_get_data (selection_data);
int ipos = -1;
char *name = NULL;
gboolean used = FALSE;
/* Find out where the drop is occuring, and the name of what is being dropped. */
- if (selection_data->length >= 0)
+ if (gtk_selection_data_get_length (selection_data) >= 0)
{
ipos = gtk_toolbar_get_drop_index (toolbar, x, y);
name = egg_toolbars_model_get_name (etoolbar->priv->model, type, data, FALSE);
etoolbar->priv->dnd_toolitem = NULL;
/* If we don't have a name to use yet, try to create one. */
- if (name == NULL && selection_data->length >= 0)
+ if (name == NULL && gtk_selection_data_get_length (selection_data) >= 0)
{
name = egg_toolbars_model_get_name (etoolbar->priv->model, type, data, TRUE);
}
priv->visibility_id = gtk_ui_manager_new_merge_id (priv->manager);
#if GTK_CHECK_VERSION(2,20,0)
- showing = gtk_widget_get_visible (etoolbar);
+ showing = gtk_widget_get_visible (GTK_WIDGET (etoolbar));
#else
showing = GTK_WIDGET_VISIBLE (etoolbar);
#endif
toolbar = etoolbar->priv->fixed_toolbar;
dock = get_dock_nth (etoolbar, 0);
- if (dock && toolbar->parent != NULL)
+ if (dock && gtk_widget_get_parent (toolbar) != NULL)
{
gtk_container_remove (GTK_CONTAINER (dock), toolbar);
}
toolbar = etoolbar->priv->fixed_toolbar;
dock = get_dock_nth (etoolbar, 0);
- if (dock && toolbar && toolbar->parent == NULL)
+ if (dock && toolbar && gtk_widget_get_parent (toolbar) == NULL)
{
gtk_box_pack_end (GTK_BOX (dock), toolbar, FALSE, TRUE, 0);
target = g_object_get_data (G_OBJECT (widget), "egg-item-name");
g_return_if_fail (target != NULL);
- gtk_selection_data_set (selection_data, selection_data->target, 8,
+ gtk_selection_data_set (selection_data,
+ gtk_selection_data_get_target (selection_data), 8,
(const guchar *) target, strlen (target));
}
cursor = gdk_cursor_new_for_display (gdk_screen_get_display (screen),
GDK_HAND2);
- gdk_window_set_cursor (widget->window, cursor);
+ gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
gdk_cursor_unref (cursor);
}
g_ptr_array_free (items, TRUE);
/* Delete old table. */
- viewport = GTK_BIN (editor->priv->scrolled_window)->child;
+ viewport = gtk_bin_get_child (GTK_BIN (editor->priv->scrolled_window));
if (viewport)
{
gtk_container_remove (GTK_CONTAINER (viewport),
- GTK_BIN (viewport)->child);
+ gtk_bin_get_child (GTK_BIN (viewport)));
}
/* Add table to window. */