Commit 45debfb0 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

gtk/gtkmenushell.c gtk/gtktable.c gtk/gtktext.c gtk/gtktipsquery.c

2008-02-27  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenushell.c
	* gtk/gtktable.c
	* gtk/gtktext.c
	* gtk/gtktipsquery.c
	* gtk/gtktoolbar.c
	* gtk/gtktreeitem.c
	* gtk/gtktreeview.c
	* gtk/gtkviewport.c
	* gtk/gtkwin32embedwidget.c: remove g_return_if_fail() from
	private functions and virtual function implementations.


svn path=/trunk/; revision=19668
parent f14bf846
2008-02-27 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenushell.c
* gtk/gtktable.c
* gtk/gtktext.c
* gtk/gtktipsquery.c
* gtk/gtktoolbar.c
* gtk/gtktreeitem.c
* gtk/gtktreeview.c
* gtk/gtkviewport.c
* gtk/gtkwin32embedwidget.c: remove g_return_if_fail() from
private functions and virtual function implementations.
2008-02-27 Richard Hult <richard@imendio.com>
* gdk/quartz/GdkQuartzView.c:
......
......@@ -506,8 +506,6 @@ gtk_menu_shell_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
g_return_if_fail (GTK_IS_MENU_SHELL (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
attributes.x = widget->allocation.x;
......@@ -773,14 +771,9 @@ static gint
gtk_menu_shell_key_press (GtkWidget *widget,
GdkEventKey *event)
{
GtkMenuShell *menu_shell;
GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget);
gboolean enable_mnemonics;
g_return_val_if_fail (GTK_IS_MENU_SHELL (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
menu_shell = GTK_MENU_SHELL (widget);
if (!menu_shell->active_menu_item && menu_shell->parent_menu_shell)
return gtk_widget_event (menu_shell->parent_menu_shell, (GdkEvent *)event);
......@@ -801,12 +794,7 @@ static gint
gtk_menu_shell_enter_notify (GtkWidget *widget,
GdkEventCrossing *event)
{
GtkMenuShell *menu_shell;
g_return_val_if_fail (GTK_IS_MENU_SHELL (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
menu_shell = GTK_MENU_SHELL (widget);
GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget);
if (menu_shell->active)
{
......@@ -873,17 +861,11 @@ static gint
gtk_menu_shell_leave_notify (GtkWidget *widget,
GdkEventCrossing *event)
{
GtkMenuShell *menu_shell;
GtkMenuItem *menu_item;
GtkWidget *event_widget;
g_return_val_if_fail (GTK_IS_MENU_SHELL (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_VISIBLE (widget))
{
menu_shell = GTK_MENU_SHELL (widget);
event_widget = gtk_get_event_widget ((GdkEvent*) event);
GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget);
GtkWidget *event_widget = gtk_get_event_widget ((GdkEvent*) event);
GtkMenuItem *menu_item;
if (!event_widget || !GTK_IS_MENU_ITEM (event_widget))
return TRUE;
......@@ -929,14 +911,10 @@ static void
gtk_menu_shell_remove (GtkContainer *container,
GtkWidget *widget)
{
GtkMenuShell *menu_shell;
GtkMenuShell *menu_shell = GTK_MENU_SHELL (container);
gint was_visible;
g_return_if_fail (GTK_IS_MENU_SHELL (container));
g_return_if_fail (GTK_IS_MENU_ITEM (widget));
was_visible = GTK_WIDGET_VISIBLE (widget);
menu_shell = GTK_MENU_SHELL (container);
menu_shell->children = g_list_remove (menu_shell->children, widget);
if (widget == menu_shell->active_menu_item)
......@@ -960,15 +938,10 @@ gtk_menu_shell_forall (GtkContainer *container,
GtkCallback callback,
gpointer callback_data)
{
GtkMenuShell *menu_shell;
GtkMenuShell *menu_shell = GTK_MENU_SHELL (container);
GtkWidget *child;
GList *children;
g_return_if_fail (GTK_IS_MENU_SHELL (container));
g_return_if_fail (callback != NULL);
menu_shell = GTK_MENU_SHELL (container);
children = menu_shell->children;
while (children)
{
......
......@@ -798,11 +798,7 @@ gtk_table_get_homogeneous (GtkTable *table)
static void
gtk_table_finalize (GObject *object)
{
GtkTable *table;
g_return_if_fail (GTK_IS_TABLE (object));
table = GTK_TABLE (object);
GtkTable *table = GTK_TABLE (object);
g_free (table->rows);
g_free (table->cols);
......@@ -814,14 +810,9 @@ static void
gtk_table_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkTable *table;
GtkTable *table = GTK_TABLE (widget);
gint row, col;
g_return_if_fail (GTK_IS_TABLE (widget));
g_return_if_fail (requisition != NULL);
table = GTK_TABLE (widget);
requisition->width = 0;
requisition->height = 0;
......@@ -849,13 +840,9 @@ static void
gtk_table_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkTable *table;
g_return_if_fail (GTK_IS_TABLE (widget));
g_return_if_fail (allocation != NULL);
GtkTable *table = GTK_TABLE (widget);
widget->allocation = *allocation;
table = GTK_TABLE (widget);
gtk_table_size_allocate_init (table);
gtk_table_size_allocate_pass1 (table);
......@@ -866,9 +853,6 @@ static void
gtk_table_add (GtkContainer *container,
GtkWidget *widget)
{
g_return_if_fail (GTK_IS_TABLE (container));
g_return_if_fail (widget != NULL);
gtk_table_attach_defaults (GTK_TABLE (container), widget, 0, 1, 0, 1);
}
......@@ -876,14 +860,10 @@ static void
gtk_table_remove (GtkContainer *container,
GtkWidget *widget)
{
GtkTable *table;
GtkTable *table = GTK_TABLE (container);
GtkTableChild *child;
GList *children;
g_return_if_fail (GTK_IS_TABLE (container));
g_return_if_fail (widget != NULL);
table = GTK_TABLE (container);
children = table->children;
while (children)
......@@ -913,14 +893,10 @@ gtk_table_forall (GtkContainer *container,
GtkCallback callback,
gpointer callback_data)
{
GtkTable *table;
GtkTable *table = GTK_TABLE (container);
GtkTableChild *child;
GList *children;
g_return_if_fail (GTK_IS_TABLE (container));
g_return_if_fail (callback != NULL);
table = GTK_TABLE (container);
children = table->children;
while (children)
......
......@@ -1165,11 +1165,7 @@ gtk_text_get_chars (GtkOldEditable *old_editable,
static void
gtk_text_destroy (GtkObject *object)
{
GtkText *text;
g_return_if_fail (GTK_IS_TEXT (object));
text = GTK_TEXT (object);
GtkText *text = GTK_TEXT (object);
if (text->hadj)
{
......@@ -1196,13 +1192,9 @@ gtk_text_destroy (GtkObject *object)
static void
gtk_text_finalize (GObject *object)
{
GtkText *text;
GtkText *text = GTK_TEXT (object);
GList *tmp_list;
g_return_if_fail (GTK_IS_TEXT (object));
text = GTK_TEXT (object);
/* Clean up the internal structures */
if (text->use_wchar)
g_free (text->text.wc);
......@@ -1238,15 +1230,11 @@ gtk_text_finalize (GObject *object)
static void
gtk_text_realize (GtkWidget *widget)
{
GtkText *text;
GtkOldEditable *old_editable;
GtkText *text = GTK_TEXT (widget);
GtkOldEditable *old_editable = GTK_OLD_EDITABLE (widget);
GdkWindowAttr attributes;
gint attributes_mask;
g_return_if_fail (GTK_IS_TEXT (widget));
text = GTK_TEXT (widget);
old_editable = GTK_OLD_EDITABLE (widget);
GTK_WIDGET_SET_FLAGS (text, GTK_REALIZED);
attributes.window_type = GDK_WINDOW_CHILD;
......@@ -1360,11 +1348,7 @@ gtk_text_state_changed (GtkWidget *widget,
static void
gtk_text_unrealize (GtkWidget *widget)
{
GtkText *text;
g_return_if_fail (GTK_IS_TEXT (widget));
text = GTK_TEXT (widget);
GtkText *text = GTK_TEXT (widget);
gdk_window_set_user_data (text->text_area, NULL);
gdk_window_destroy (text->text_area);
......@@ -1499,9 +1483,6 @@ gtk_text_size_request (GtkWidget *widget,
gint char_height;
gint char_width;
g_return_if_fail (GTK_IS_TEXT (widget));
g_return_if_fail (requisition != NULL);
xthickness = widget->style->xthickness + TEXT_BORDER_ROOM;
ythickness = widget->style->ythickness + TEXT_BORDER_ROOM;
......@@ -1523,12 +1504,7 @@ static void
gtk_text_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkText *text;
g_return_if_fail (GTK_IS_TEXT (widget));
g_return_if_fail (allocation != NULL);
text = GTK_TEXT (widget);
GtkText *text = GTK_TEXT (widget);
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
......@@ -1553,9 +1529,6 @@ static gint
gtk_text_expose (GtkWidget *widget,
GdkEventExpose *event)
{
g_return_val_if_fail (GTK_IS_TEXT (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (event->window == GTK_TEXT (widget)->text_area)
{
TDEBUG (("in gtk_text_expose (expose)\n"));
......@@ -1603,14 +1576,8 @@ static gint
gtk_text_button_press (GtkWidget *widget,
GdkEventButton *event)
{
GtkText *text;
GtkOldEditable *old_editable;
g_return_val_if_fail (GTK_IS_TEXT (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
text = GTK_TEXT (widget);
old_editable = GTK_OLD_EDITABLE (widget);
GtkText *text = GTK_TEXT (widget);
GtkOldEditable *old_editable = GTK_OLD_EDITABLE (widget);
if (text->button && (event->button != text->button))
return FALSE;
......@@ -1700,15 +1667,10 @@ static gint
gtk_text_button_release (GtkWidget *widget,
GdkEventButton *event)
{
GtkText *text;
GtkText *text = GTK_TEXT (widget);
GtkOldEditable *old_editable;
GdkDisplay *display;
g_return_val_if_fail (GTK_IS_TEXT (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
text = GTK_TEXT (widget);
gtk_grab_remove (widget);
if (text->button != event->button)
......@@ -1768,16 +1730,11 @@ static gint
gtk_text_motion_notify (GtkWidget *widget,
GdkEventMotion *event)
{
GtkText *text;
GtkText *text = GTK_TEXT (widget);
gint x, y;
gint height;
GdkModifierType mask;
g_return_val_if_fail (GTK_IS_TEXT (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
text = GTK_TEXT (widget);
x = event->x;
y = event->y;
mask = event->state;
......@@ -1849,12 +1806,10 @@ gtk_text_delete_text (GtkEditable *editable,
gint start_pos,
gint end_pos)
{
GtkText *text;
GtkText *text = GTK_TEXT (editable);
g_return_if_fail (start_pos >= 0);
text = GTK_TEXT (editable);
gtk_text_set_point (text, start_pos);
if (end_pos < 0)
end_pos = TEXT_LENGTH (text);
......@@ -1867,18 +1822,12 @@ static gint
gtk_text_key_press (GtkWidget *widget,
GdkEventKey *event)
{
GtkText *text;
GtkOldEditable *old_editable;
GtkText *text = GTK_TEXT (widget);
GtkOldEditable *old_editable = GTK_OLD_EDITABLE (widget);
gchar key;
gint return_val;
gint position;
g_return_val_if_fail (GTK_IS_TEXT (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
text = GTK_TEXT (widget);
old_editable = GTK_OLD_EDITABLE (widget);
key = event->keyval;
return_val = TRUE;
......
......@@ -252,11 +252,7 @@ gtk_tips_query_get_arg (GtkObject *object,
static void
gtk_tips_query_destroy (GtkObject *object)
{
GtkTipsQuery *tips_query;
g_return_if_fail (GTK_IS_TIPS_QUERY (object));
tips_query = GTK_TIPS_QUERY (object);
GtkTipsQuery *tips_query = GTK_TIPS_QUERY (object);
if (tips_query->in_query)
gtk_tips_query_stop_query (tips_query);
......
......@@ -2475,12 +2475,7 @@ static void
gtk_toolbar_add (GtkContainer *container,
GtkWidget *widget)
{
GtkToolbar *toolbar;
g_return_if_fail (GTK_IS_TOOLBAR (container));
g_return_if_fail (widget != NULL);
toolbar = GTK_TOOLBAR (container);
GtkToolbar *toolbar = GTK_TOOLBAR (container);
if (GTK_IS_TOOL_ITEM (widget))
gtk_toolbar_insert (toolbar, GTK_TOOL_ITEM (widget), -1);
......@@ -2492,17 +2487,11 @@ static void
gtk_toolbar_remove (GtkContainer *container,
GtkWidget *widget)
{
GtkToolbar *toolbar;
GtkToolbarPrivate *priv;
GtkToolbar *toolbar = GTK_TOOLBAR (container);
GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
ToolbarContent *content_to_remove;
GList *list;
g_return_if_fail (GTK_IS_TOOLBAR (container));
g_return_if_fail (GTK_IS_WIDGET (widget));
toolbar = GTK_TOOLBAR (container);
priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
content_to_remove = NULL;
for (list = priv->content; list != NULL; list = list->next)
{
......
......@@ -221,8 +221,6 @@ gtk_tree_item_init (GtkTreeItem *tree_item)
{
GtkWidget *eventbox, *pixmapwid;
g_return_if_fail (GTK_IS_TREE_ITEM (tree_item));
tree_item->expanded = FALSE;
tree_item->subtree = NULL;
GTK_WIDGET_SET_FLAGS (tree_item, GTK_CAN_FOCUS);
......@@ -442,8 +440,6 @@ gtk_tree_item_remove_pixmaps (GtkTreeItem *tree_item)
static void
gtk_tree_item_realize (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
if (GTK_WIDGET_CLASS (parent_class)->realize)
(* GTK_WIDGET_CLASS (parent_class)->realize) (widget);
......@@ -457,16 +453,10 @@ static void
gtk_tree_item_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkBin *bin;
GtkTreeItem* item;
GtkBin *bin = GTK_BIN (widget);
GtkTreeItem *item = GTK_TREE_ITEM (widget);
GtkRequisition child_requisition;
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
g_return_if_fail (requisition != NULL);
bin = GTK_BIN (widget);
item = GTK_TREE_ITEM(widget);
requisition->width = (GTK_CONTAINER (widget)->border_width +
widget->style->xthickness) * 2;
requisition->height = GTK_CONTAINER (widget)->border_width * 2;
......@@ -493,24 +483,18 @@ static void
gtk_tree_item_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkBin *bin;
GtkTreeItem* item;
GtkBin *bin = GTK_BIN (widget);
GtkTreeItem *item = GTK_TREE_ITEM (widget);
GtkAllocation child_allocation;
gint border_width;
int temp;
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
g_return_if_fail (allocation != NULL);
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
allocation->width, allocation->height);
bin = GTK_BIN (widget);
item = GTK_TREE_ITEM(widget);
if (bin->child)
{
border_width = (GTK_CONTAINER (widget)->border_width +
......@@ -612,9 +596,6 @@ gtk_tree_item_paint (GtkWidget *widget,
GdkRectangle child_area, item_area;
GtkTreeItem* tree_item;
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
g_return_if_fail (area != NULL);
/* FIXME: We should honor tree->view_mode, here - I think
* the desired effect is that when the mode is VIEW_ITEM,
* only the subitem is drawn as selected, not the entire
......@@ -677,10 +658,6 @@ static gint
gtk_tree_item_button_press (GtkWidget *widget,
GdkEventButton *event)
{
g_return_val_if_fail (GTK_IS_TREE_ITEM (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (event->type == GDK_BUTTON_PRESS
&& GTK_WIDGET_IS_SENSITIVE(widget)
&& !GTK_WIDGET_HAS_FOCUS (widget))
......@@ -726,9 +703,6 @@ gtk_tree_item_expose (GtkWidget *widget,
GdkEventExpose *event;
} data;
g_return_val_if_fail (GTK_IS_TREE_ITEM (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
{
gtk_tree_item_paint (widget, &event->area);
......@@ -860,17 +834,13 @@ gtk_real_tree_item_collapse (GtkTreeItem *tree_item)
static void
gtk_tree_item_destroy (GtkObject *object)
{
GtkTreeItem* item;
GtkTreeItem* item = GTK_TREE_ITEM(object);
GtkWidget* child;
g_return_if_fail (GTK_IS_TREE_ITEM (object));
#ifdef TREE_DEBUG
g_message("+ gtk_tree_item_destroy [object %#x]\n", (int)object);
#endif /* TREE_DEBUG */
item = GTK_TREE_ITEM(object);
/* free sub tree if it exist */
child = item->subtree;
if (child)
......@@ -964,13 +934,8 @@ gtk_tree_item_remove_subtree (GtkTreeItem* item)
static void
gtk_tree_item_map (GtkWidget *widget)
{
GtkBin *bin;
GtkTreeItem* item;
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
bin = GTK_BIN (widget);
item = GTK_TREE_ITEM(widget);
GtkBin *bin = GTK_BIN (widget);
GtkTreeItem* item = GTK_TREE_ITEM(widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
......@@ -990,14 +955,10 @@ gtk_tree_item_map (GtkWidget *widget)
static void
gtk_tree_item_unmap (GtkWidget *widget)
{
GtkBin *bin;
GtkTreeItem* item;
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
GtkBin *bin = GTK_BIN (widget);
GtkTreeItem* item = GTK_TREE_ITEM(widget);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
bin = GTK_BIN (widget);
item = GTK_TREE_ITEM(widget);
gdk_window_hide (widget->window);
......@@ -1018,14 +979,8 @@ gtk_tree_item_forall (GtkContainer *container,
GtkCallback callback,
gpointer callback_data)
{
GtkBin *bin;
GtkTreeItem *tree_item;
g_return_if_fail (GTK_IS_TREE_ITEM (container));
g_return_if_fail (callback != NULL);
bin = GTK_BIN (container);
tree_item = GTK_TREE_ITEM (container);
GtkBin *bin = GTK_BIN (container);
GtkTreeItem *tree_item = GTK_TREE_ITEM (container);
if (bin->child)
(* callback) (bin->child, callback_data);
......
......@@ -1732,12 +1732,8 @@ gtk_tree_view_map_buttons (GtkTreeView *tree_view)
static void
gtk_tree_view_map (GtkWidget *widget)
{
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
GList *tmp_list;
GtkTreeView *tree_view;
g_return_if_fail (GTK_IS_TREE_VIEW (widget));
tree_view = GTK_TREE_VIEW (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
......@@ -1763,15 +1759,11 @@ gtk_tree_view_map (GtkWidget *widget)
static void
gtk_tree_view_realize (GtkWidget *widget)
{
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
GList *tmp_list;
GtkTreeView *tree_view;
GdkWindowAttr attributes;
gint attributes_mask;
g_return_if_fail (GTK_IS_TREE_VIEW (widget));
tree_view = GTK_TREE_VIEW (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
/* Make the main, clipping window */
......@@ -1854,15 +1846,10 @@ gtk_tree_view_realize (GtkWidget *widget)
static void
gtk_tree_view_unrealize (GtkWidget *widget)
{
GtkTreeView *tree_view;
GtkTreeViewPrivate *priv;
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
GtkTreeViewPrivate *priv = tree_view->priv;
GList *list;
g_return_if_fail (GTK_IS_TREE_VIEW (widget));
tree_view = GTK_TREE_VIEW (widget);
priv = tree_view->priv;
if (priv->scroll_timeout != 0)
{
g_source_remove (priv->scroll_timeout);
......@@ -2042,13 +2029,9 @@ static void
gtk_tree_view_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkTreeView *tree_view;
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
GList *tmp_list;
g_return_if_fail (GTK_IS_TREE_VIEW (widget));
tree_view = GTK_TREE_VIEW (widget);
/* we validate GTK_TREE_VIEW_NUM_ROWS_PER_IDLE rows initially just to make
* sure we have some size. In practice, with a lot of static lists, this
* should get a good width.
......@@ -2298,20 +2281,16 @@ static void
gtk_tree_view_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
GList *tmp_list;
GtkTreeView *tree_view;
gboolean width_changed = FALSE;
gint old_width = widget->allocation.width;
g_return_if_fail (GTK_IS_TREE_VIEW (widget));
if (allocation->width != widget->allocation.width)
width_changed = TRUE;
widget->allocation = *allocation;
tree_view = GTK_TREE_VIEW (widget);
tmp_list = tree_view->priv->children;
while (tmp_list)
......@@ -2464,7 +2443,7 @@ static gboolean
gtk_tree_view_button_press (GtkWidget *widget,
GdkEventButton *event)
{
GtkTreeView *tree_view;
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
GList *list;
GtkTreeViewColumn *column = NULL;
gint i;
......@@ -2475,10 +2454,6 @@ gtk_tree_view_button_press (GtkWidget *widget,
gboolean path_is_selectable;
gboolean rtl;
g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
tree_view = GTK_TREE_VIEW (widget);
rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
gtk_tree_view_stop_editing (tree_view, FALSE);
gtk_widget_style_get (widget,
......@@ -2959,12 +2934,7 @@ static gboolean
gtk_tree_view_button_release (GtkWidget *widget,
GdkEventButton *event)
{
GtkTreeView *tree_view;
g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
tree_view = GTK_TREE_VIEW (widget);
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_DRAG))
return gtk_tree_view_button_release_drag_column (widget, event);
......@@ -3016,12 +2986,7 @@ static gboolean
gtk_tree_view_grab_broken (GtkWidget *widget,
GdkEventGrabBroken *event)
{
GtkTreeView *tree_view;
g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
tree_view = GTK_TREE_VIEW (widget);
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_DRAG))
gtk_tree_view_button_release_drag_column (widget, (GdkEventButton *)event);
......@@ -4174,7 +4139,7 @@ static gboolean
gtk_tree_view_bin_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkTreeView *tree_view;
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
GtkTreePath *path;
GtkRBTree *tree;
GList *list;
......@@ -4211,12 +4176,8 @@ gtk_tree_view_bin_expose (GtkWidget *widget,
gboolean row_ending_details;
gboolean draw_vgrid_lines, draw_hgrid_lines;
g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE);
rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
tree_view = GTK_TREE_VIEW (widget);
gtk_widget_style_get (widget,
"horizontal-separator", &horizontal_separator,
"vertical-separator", &vertical_separator,
......@@ -4919,11 +4880,7 @@ static gboolean
gtk_tree_view_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkTreeView *tree_view;
g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE);
tree_view = GTK_TREE_VIEW (widget);
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
if (event->window == tree_view->priv->bin_window)
{
......@@ -5434,15 +5391,11 @@ static gboolean
gtk_tree_view_enter_notify (GtkWidget *widget,
GdkEventCrossing *event)
{
GtkTreeView *tree_view;
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
GtkRBTree *tree;
GtkRBNode *node;
gint new_y;
g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE);
tree_view = GTK_TREE_VIEW (widget);
/* Sanity check it */
if (event->window != tree_view->priv->bin_window)
return FALSE;
......@@ -7465,14 +7418,10 @@ static void