mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
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
This commit is contained in:
parent
f14bf84699
commit
45debfb0ef
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
||||
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,13 +771,8 @@ 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,12 +798,8 @@ 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,14 +840,10 @@ 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);
|
||||
gtk_table_size_allocate_pass2 (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,12 +1192,8 @@ 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)
|
||||
@ -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);
|
||||
@ -1498,10 +1482,7 @@ gtk_text_size_request (GtkWidget *widget,
|
||||
gint ythickness;
|
||||
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,13 +1504,8 @@ 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,13 +2475,8 @@ 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);
|
||||
else
|
||||
@ -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)
|
||||
{
|
||||
|
@ -220,8 +220,6 @@ static void
|
||||
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;
|
||||
@ -441,9 +439,7 @@ 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))
|
||||
@ -725,9 +702,6 @@ gtk_tree_item_expose (GtkWidget *widget,
|
||||
GtkWidget *container;
|
||||
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))
|
||||
{
|
||||
@ -746,7 +720,7 @@ gtk_tree_item_expose (GtkWidget *widget,
|
||||
|
||||
static void
|
||||
gtk_real_tree_item_select (GtkItem *item)
|
||||
{
|
||||
{
|
||||
GtkWidget *widget;
|
||||
|
||||
g_return_if_fail (GTK_IS_TREE_ITEM (item));
|
||||
@ -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,19 +2281,15 @@ 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));
|
||||
gint old_width = widget->allocation.width;
|
||||
|
||||
if (allocation->width != widget->allocation.width)
|
||||
width_changed = TRUE;
|
||||
|
||||
widget->allocation = *allocation;
|
||||
|
||||
tree_view = GTK_TREE_VIEW (widget);
|
||||
widget->allocation = *allocation;
|
||||
|
||||
tmp_list = tree_view->priv->children;
|
||||
|
||||
@ -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
|
||||
gtk_tree_view_remove (GtkContainer *container,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkTreeView *tree_view;
|
||||
GtkTreeView *tree_view = GTK_TREE_VIEW (container);
|
||||
GtkTreeViewChild *child = NULL;
|
||||
GList *tmp_list;
|
||||
|
||||
g_return_if_fail (GTK_IS_TREE_VIEW (container));
|
||||
|
||||
tree_view = GTK_TREE_VIEW (container);
|
||||
|
||||
tmp_list = tree_view->priv->children;
|
||||
while (tmp_list)
|
||||
{
|
||||
@ -7511,16 +7460,11 @@ gtk_tree_view_forall (GtkContainer *container,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
GtkTreeView *tree_view;
|
||||
GtkTreeView *tree_view = GTK_TREE_VIEW (container);
|
||||
GtkTreeViewChild *child = NULL;
|
||||
GtkTreeViewColumn *column;
|
||||
GList *tmp_list;
|
||||
|
||||
g_return_if_fail (GTK_IS_TREE_VIEW (container));
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
tree_view = GTK_TREE_VIEW (container);
|
||||
|
||||
tmp_list = tree_view->priv->children;
|
||||
while (tmp_list)
|
||||
{
|
||||
@ -7846,15 +7790,9 @@ static gint
|
||||
gtk_tree_view_focus (GtkWidget *widget,
|
||||
GtkDirectionType direction)
|
||||
{
|
||||
GtkTreeView *tree_view;
|
||||
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
|
||||
GtkContainer *container = GTK_CONTAINER (widget);
|
||||
GtkWidget *focus_child;
|
||||
GtkContainer *container;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE);
|
||||
g_return_val_if_fail (GTK_WIDGET_VISIBLE (widget), FALSE);
|
||||
|
||||
container = GTK_CONTAINER (widget);
|
||||
tree_view = GTK_TREE_VIEW (widget);
|
||||
|
||||
if (!GTK_WIDGET_IS_SENSITIVE (container))
|
||||
return FALSE;
|
||||
@ -7915,14 +7853,10 @@ static void
|
||||
gtk_tree_view_style_set (GtkWidget *widget,
|
||||
GtkStyle *previous_style)
|
||||
{
|
||||
GtkTreeView *tree_view;
|
||||
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
|
||||
GList *list;
|
||||
GtkTreeViewColumn *column;
|
||||
|
||||
g_return_if_fail (GTK_IS_TREE_VIEW (widget));
|
||||
|
||||
tree_view = GTK_TREE_VIEW (widget);
|
||||
|
||||
if (GTK_WIDGET_REALIZED (widget))
|
||||
{
|
||||
gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
|
||||
|
@ -645,14 +645,9 @@ static void
|
||||
gtk_viewport_paint (GtkWidget *widget,
|
||||
GdkRectangle *area)
|
||||
{
|
||||
GtkViewport *viewport;
|
||||
|
||||
g_return_if_fail (GTK_IS_VIEWPORT (widget));
|
||||
g_return_if_fail (area != NULL);
|
||||
|
||||
if (GTK_WIDGET_DRAWABLE (widget))
|
||||
{
|
||||
viewport = GTK_VIEWPORT (widget);
|
||||
GtkViewport *viewport = GTK_VIEWPORT (widget);
|
||||
|
||||
gtk_paint_shadow (widget->style, widget->window,
|
||||
GTK_STATE_NORMAL, viewport->shadow_type,
|
||||
@ -691,11 +686,8 @@ static void
|
||||
gtk_viewport_add (GtkContainer *container,
|
||||
GtkWidget *child)
|
||||
{
|
||||
GtkBin *bin;
|
||||
GtkBin *bin = GTK_BIN (container);
|
||||
|
||||
g_return_if_fail (GTK_IS_WIDGET (child));
|
||||
|
||||
bin = GTK_BIN (container);
|
||||
g_return_if_fail (bin->child == NULL);
|
||||
|
||||
gtk_widget_set_parent_window (child, GTK_VIEWPORT (bin)->bin_window);
|
||||
@ -707,11 +699,9 @@ static void
|
||||
gtk_viewport_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
GtkBin *bin;
|
||||
GtkBin *bin = GTK_BIN (widget);
|
||||
GtkRequisition child_requisition;
|
||||
|
||||
bin = GTK_BIN (widget);
|
||||
|
||||
requisition->width = GTK_CONTAINER (widget)->border_width;
|
||||
|
||||
requisition->height = GTK_CONTAINER (widget)->border_width;
|
||||
@ -796,14 +786,8 @@ static void
|
||||
gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment,
|
||||
gpointer data)
|
||||
{
|
||||
GtkViewport *viewport;
|
||||
GtkBin *bin;
|
||||
|
||||
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
||||
g_return_if_fail (GTK_IS_VIEWPORT (data));
|
||||
|
||||
viewport = GTK_VIEWPORT (data);
|
||||
bin = GTK_BIN (data);
|
||||
GtkViewport *viewport = GTK_VIEWPORT (data);
|
||||
GtkBin *bin = GTK_BIN (data);
|
||||
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child) &&
|
||||
GTK_WIDGET_REALIZED (viewport))
|
||||
@ -829,13 +813,11 @@ static void
|
||||
gtk_viewport_style_set (GtkWidget *widget,
|
||||
GtkStyle *previous_style)
|
||||
{
|
||||
GtkViewport *viewport;
|
||||
|
||||
if (GTK_WIDGET_REALIZED (widget) &&
|
||||
!GTK_WIDGET_NO_WINDOW (widget))
|
||||
{
|
||||
viewport = GTK_VIEWPORT (widget);
|
||||
|
||||
GtkViewport *viewport = GTK_VIEWPORT (widget);
|
||||
|
||||
gtk_style_set_background (widget->style, viewport->bin_window, GTK_STATE_NORMAL);
|
||||
gtk_style_set_background (widget->style, widget->window, widget->state);
|
||||
}
|
||||
|
@ -128,11 +128,7 @@ _gtk_win32_embed_widget_dialog_procedure (GtkWin32EmbedWidget *embed_widget,
|
||||
static void
|
||||
gtk_win32_embed_widget_unrealize (GtkWidget *widget)
|
||||
{
|
||||
GtkWin32EmbedWidget *embed_widget;
|
||||
|
||||
g_return_if_fail (GTK_IS_WIN32_EMBED_WIDGET (widget));
|
||||
|
||||
embed_widget = GTK_WIN32_EMBED_WIDGET (widget);
|
||||
GtkWin32EmbedWidget *embed_widget = GTK_WIN32_EMBED_WIDGET (widget);
|
||||
|
||||
embed_widget->old_window_procedure = NULL;
|
||||
|
||||
@ -176,17 +172,12 @@ gtk_win32_embed_widget_window_process (HWND hwnd, UINT msg, WPARAM wparam, LPARA
|
||||
static void
|
||||
gtk_win32_embed_widget_realize (GtkWidget *widget)
|
||||
{
|
||||
GtkWindow *window;
|
||||
GtkWin32EmbedWidget *embed_widget;
|
||||
GtkWindow *window = GTK_WINDOW (widget);
|
||||
GtkWin32EmbedWidget *embed_widget = GTK_WIN32_EMBED_WIDGET (widget);
|
||||
GdkWindowAttr attributes;
|
||||
gint attributes_mask;
|
||||
LONG_PTR styles;
|
||||
|
||||
g_return_if_fail (GTK_IS_WIN32_EMBED_WIDGET (widget));
|
||||
|
||||
window = GTK_WINDOW (widget);
|
||||
embed_widget = GTK_WIN32_EMBED_WIDGET (widget);
|
||||
|
||||
/* ensure widget tree is properly size allocated */
|
||||
if (widget->allocation.x == -1 &&
|
||||
widget->allocation.y == -1 &&
|
||||
|
Loading…
Reference in New Issue
Block a user