mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
gtk/gtkcontainer.c gtk/gtkexpander.c gtk/gtkframe.c gtk/gtklabel.c
2008-02-06 Michael Natterer <mitch@imendio.com> * gtk/gtkcontainer.c * gtk/gtkexpander.c * gtk/gtkframe.c * gtk/gtklabel.c * gtk/gtkmain.c * gtk/gtkmenu.c * gtk/gtkmenuitem.c * gtk/gtkmenushell.c * gtk/gtknotebook.c * gtk/gtkseparatortoolitem.c * gtk/gtksocket.c * gtk/gtktextlayout.c * gtk/gtktoggletoolbutton.c * gtk/gtktoolbutton.c * gtk/gtktoolitem.c * gtk/gtktree.c * gtk/gtktreeitem.c: replace "foo && GTK_IS_FOO (foo)" by simply "GTK_IS_FOO (foo)". svn path=/trunk/; revision=19481
This commit is contained in:
parent
0f1958e355
commit
e7355f82c2
21
ChangeLog
21
ChangeLog
@ -1,3 +1,24 @@
|
||||
2008-02-06 Michael Natterer <mitch@imendio.com>
|
||||
|
||||
* gtk/gtkcontainer.c
|
||||
* gtk/gtkexpander.c
|
||||
* gtk/gtkframe.c
|
||||
* gtk/gtklabel.c
|
||||
* gtk/gtkmain.c
|
||||
* gtk/gtkmenu.c
|
||||
* gtk/gtkmenuitem.c
|
||||
* gtk/gtkmenushell.c
|
||||
* gtk/gtknotebook.c
|
||||
* gtk/gtkseparatortoolitem.c
|
||||
* gtk/gtksocket.c
|
||||
* gtk/gtktextlayout.c
|
||||
* gtk/gtktoggletoolbutton.c
|
||||
* gtk/gtktoolbutton.c
|
||||
* gtk/gtktoolitem.c
|
||||
* gtk/gtktree.c
|
||||
* gtk/gtktreeitem.c: replace "foo && GTK_IS_FOO (foo)" by simply
|
||||
"GTK_IS_FOO (foo)".
|
||||
|
||||
2008-02-05 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkprintsettings.c (gtk_print_settings_get_page_ranges):
|
||||
|
@ -1867,8 +1867,8 @@ old_focus_coords (GtkContainer *container,
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (container);
|
||||
GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
|
||||
|
||||
if (toplevel && GTK_IS_WINDOW (toplevel) && GTK_WINDOW (toplevel)->focus_widget)
|
||||
|
||||
if (GTK_IS_WINDOW (toplevel) && GTK_WINDOW (toplevel)->focus_widget)
|
||||
{
|
||||
GtkWidget *old_focus = GTK_WINDOW (toplevel)->focus_widget;
|
||||
|
||||
|
@ -1552,7 +1552,7 @@ gtk_expander_get_label (GtkExpander *expander)
|
||||
|
||||
priv = expander->priv;
|
||||
|
||||
if (priv->label_widget && GTK_IS_LABEL (priv->label_widget))
|
||||
if (GTK_IS_LABEL (priv->label_widget))
|
||||
return gtk_label_get_text (GTK_LABEL (priv->label_widget));
|
||||
else
|
||||
return NULL;
|
||||
@ -1584,7 +1584,7 @@ gtk_expander_set_use_underline (GtkExpander *expander,
|
||||
{
|
||||
priv->use_underline = use_underline;
|
||||
|
||||
if (priv->label_widget && GTK_IS_LABEL (priv->label_widget))
|
||||
if (GTK_IS_LABEL (priv->label_widget))
|
||||
gtk_label_set_use_underline (GTK_LABEL (priv->label_widget), use_underline);
|
||||
|
||||
g_object_notify (G_OBJECT (expander), "use-underline");
|
||||
@ -1638,7 +1638,7 @@ gtk_expander_set_use_markup (GtkExpander *expander,
|
||||
{
|
||||
priv->use_markup = use_markup;
|
||||
|
||||
if (priv->label_widget && GTK_IS_LABEL (priv->label_widget))
|
||||
if (GTK_IS_LABEL (priv->label_widget))
|
||||
gtk_label_set_use_markup (GTK_LABEL (priv->label_widget), use_markup);
|
||||
|
||||
g_object_notify (G_OBJECT (expander), "use-markup");
|
||||
|
@ -349,7 +349,7 @@ gtk_frame_get_label (GtkFrame *frame)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_FRAME (frame), NULL);
|
||||
|
||||
if (frame->label_widget && GTK_IS_LABEL (frame->label_widget))
|
||||
if (GTK_IS_LABEL (frame->label_widget))
|
||||
return gtk_label_get_text (GTK_LABEL (frame->label_widget));
|
||||
else
|
||||
return NULL;
|
||||
|
@ -882,15 +882,15 @@ gtk_label_mnemonic_activate (GtkWidget *widget,
|
||||
*/
|
||||
parent = widget->parent;
|
||||
|
||||
if (parent && GTK_IS_NOTEBOOK (parent))
|
||||
if (GTK_IS_NOTEBOOK (parent))
|
||||
return FALSE;
|
||||
|
||||
while (parent)
|
||||
{
|
||||
if (GTK_WIDGET_CAN_FOCUS (parent) ||
|
||||
(!group_cycling && GTK_WIDGET_GET_CLASS (parent)->activate_signal) ||
|
||||
(parent->parent && GTK_IS_NOTEBOOK (parent->parent)) ||
|
||||
(GTK_IS_MENU_ITEM (parent)))
|
||||
GTK_IS_NOTEBOOK (parent->parent) ||
|
||||
GTK_IS_MENU_ITEM (parent))
|
||||
return gtk_widget_mnemonic_activate (parent, group_cycling);
|
||||
parent = parent->parent;
|
||||
}
|
||||
@ -949,7 +949,7 @@ gtk_label_setup_mnemonic (GtkLabel *label,
|
||||
mnemonic_menu = menu_shell;
|
||||
}
|
||||
|
||||
if (!(menu_shell && GTK_IS_MENU (menu_shell)))
|
||||
if (!GTK_IS_MENU (menu_shell))
|
||||
{
|
||||
gtk_window_add_mnemonic (GTK_WINDOW (toplevel),
|
||||
label->mnemonic_keyval,
|
||||
|
@ -1636,7 +1636,7 @@ gtk_main_get_window_group (GtkWidget *widget)
|
||||
if (widget)
|
||||
toplevel = gtk_widget_get_toplevel (widget);
|
||||
|
||||
if (toplevel && GTK_IS_WINDOW (toplevel))
|
||||
if (GTK_IS_WINDOW (toplevel))
|
||||
return gtk_window_get_group (GTK_WINDOW (toplevel));
|
||||
else
|
||||
return gtk_window_get_group (NULL);
|
||||
@ -2293,7 +2293,7 @@ gtk_propagate_event (GtkWidget *widget,
|
||||
GtkWidget *window;
|
||||
|
||||
window = gtk_widget_get_toplevel (widget);
|
||||
if (window && GTK_IS_WINDOW (window))
|
||||
if (GTK_IS_WINDOW (window))
|
||||
{
|
||||
/* If there is a grab within the window, give the grab widget
|
||||
* a first crack at the key event
|
||||
@ -2304,7 +2304,7 @@ gtk_propagate_event (GtkWidget *widget,
|
||||
if (!handled_event)
|
||||
{
|
||||
window = gtk_widget_get_toplevel (widget);
|
||||
if (window && GTK_IS_WINDOW (window))
|
||||
if (GTK_IS_WINDOW (window))
|
||||
{
|
||||
if (GTK_WIDGET_IS_SENSITIVE (window))
|
||||
gtk_widget_event (window, event);
|
||||
|
@ -1393,7 +1393,7 @@ gtk_menu_popup (GtkMenu *menu,
|
||||
}
|
||||
|
||||
/* Set transient for to get the right window group and parent relationship */
|
||||
if (parent_toplevel && GTK_IS_WINDOW (parent_toplevel))
|
||||
if (GTK_IS_WINDOW (parent_toplevel))
|
||||
gtk_window_set_transient_for (GTK_WINDOW (menu->toplevel),
|
||||
GTK_WINDOW (parent_toplevel));
|
||||
|
||||
|
@ -1618,7 +1618,7 @@ gtk_menu_item_set_accel_path (GtkMenuItem *menu_item,
|
||||
gtk_widget_set_accel_path (widget, NULL, NULL);
|
||||
|
||||
/* install accelerators associated with new path */
|
||||
if (widget->parent && GTK_IS_MENU (widget->parent))
|
||||
if (GTK_IS_MENU (widget->parent))
|
||||
{
|
||||
GtkMenu *menu = GTK_MENU (widget->parent);
|
||||
|
||||
|
@ -1016,7 +1016,7 @@ gtk_menu_shell_is_item (GtkMenuShell *menu_shell,
|
||||
g_return_val_if_fail (child != NULL, FALSE);
|
||||
|
||||
parent = child->parent;
|
||||
while (parent && GTK_IS_MENU_SHELL (parent))
|
||||
while (GTK_IS_MENU_SHELL (parent))
|
||||
{
|
||||
if (parent == (GtkWidget*) menu_shell)
|
||||
return TRUE;
|
||||
|
@ -3655,7 +3655,7 @@ gtk_notebook_get_child_property (GtkContainer *container,
|
||||
case CHILD_PROP_TAB_LABEL:
|
||||
label = gtk_notebook_get_tab_label (notebook, child);
|
||||
|
||||
if (label && GTK_IS_LABEL (label))
|
||||
if (GTK_IS_LABEL (label))
|
||||
g_value_set_string (value, GTK_LABEL (label)->label);
|
||||
else
|
||||
g_value_set_string (value, NULL);
|
||||
@ -3663,7 +3663,7 @@ gtk_notebook_get_child_property (GtkContainer *container,
|
||||
case CHILD_PROP_MENU_LABEL:
|
||||
label = gtk_notebook_get_menu_label (notebook, child);
|
||||
|
||||
if (label && GTK_IS_LABEL (label))
|
||||
if (GTK_IS_LABEL (label))
|
||||
g_value_set_string (value, GTK_LABEL (label)->label);
|
||||
else
|
||||
g_value_set_string (value, NULL);
|
||||
@ -4427,9 +4427,9 @@ gtk_notebook_update_labels (GtkNotebook *notebook)
|
||||
}
|
||||
if (notebook->menu && page->default_menu)
|
||||
{
|
||||
if (page->tab_label && GTK_IS_LABEL (page->tab_label))
|
||||
if (GTK_IS_LABEL (page->tab_label))
|
||||
gtk_label_set_text (GTK_LABEL (page->menu_label),
|
||||
GTK_LABEL (page->tab_label)->label);
|
||||
GTK_LABEL (page->tab_label)->label);
|
||||
else
|
||||
gtk_label_set_text (GTK_LABEL (page->menu_label), string);
|
||||
}
|
||||
@ -5929,7 +5929,7 @@ gtk_notebook_menu_item_create (GtkNotebook *notebook,
|
||||
page = list->data;
|
||||
if (page->default_menu)
|
||||
{
|
||||
if (page->tab_label && GTK_IS_LABEL (page->tab_label))
|
||||
if (GTK_IS_LABEL (page->tab_label))
|
||||
page->menu_label = gtk_label_new (GTK_LABEL (page->tab_label)->label);
|
||||
else
|
||||
page->menu_label = gtk_label_new ("");
|
||||
@ -6981,7 +6981,7 @@ gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
|
||||
|
||||
tab_label = gtk_notebook_get_tab_label (notebook, child);
|
||||
|
||||
if (tab_label && GTK_IS_LABEL (tab_label))
|
||||
if (GTK_IS_LABEL (tab_label))
|
||||
return gtk_label_get_text (GTK_LABEL (tab_label));
|
||||
else
|
||||
return NULL;
|
||||
@ -7116,7 +7116,7 @@ gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
|
||||
|
||||
menu_label = gtk_notebook_get_menu_label (notebook, child);
|
||||
|
||||
if (menu_label && GTK_IS_LABEL (menu_label))
|
||||
if (GTK_IS_LABEL (menu_label))
|
||||
return gtk_label_get_text (GTK_LABEL (menu_label));
|
||||
else
|
||||
return NULL;
|
||||
|
@ -205,7 +205,7 @@ gtk_separator_tool_item_expose (GtkWidget *widget,
|
||||
|
||||
if (priv->draw)
|
||||
{
|
||||
if (widget->parent && GTK_IS_TOOLBAR (widget->parent))
|
||||
if (GTK_IS_TOOLBAR (widget->parent))
|
||||
toolbar = GTK_TOOLBAR (widget->parent);
|
||||
|
||||
_gtk_toolbar_paint_space_line (widget, toolbar,
|
||||
|
@ -360,7 +360,7 @@ _gtk_socket_end_embedding (GtkSocket *socket)
|
||||
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (socket));
|
||||
gint i;
|
||||
|
||||
if (toplevel && GTK_IS_WINDOW (toplevel))
|
||||
if (GTK_IS_WINDOW (toplevel))
|
||||
_gtk_socket_windowing_end_embedding_toplevel (socket);
|
||||
|
||||
g_object_unref (socket->plug_window);
|
||||
@ -890,7 +890,7 @@ _gtk_socket_add_window (GtkSocket *socket,
|
||||
/* Add a pointer to the socket on our toplevel window */
|
||||
|
||||
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (socket));
|
||||
if (toplevel && GTK_IS_WINDOW (toplevel))
|
||||
if (GTK_IS_WINDOW (toplevel))
|
||||
gtk_window_add_embedded_xid (GTK_WINDOW (toplevel), xid);
|
||||
|
||||
_gtk_socket_windowing_embed_notify (socket);
|
||||
|
@ -1821,7 +1821,7 @@ allocate_child_widgets (GtkTextLayout *text_layout,
|
||||
/* shaped_object is NULL for child anchors with no
|
||||
* widgets stored at them
|
||||
*/
|
||||
if (shaped_object && GTK_IS_WIDGET (shaped_object))
|
||||
if (GTK_IS_WIDGET (shaped_object))
|
||||
{
|
||||
PangoRectangle extents;
|
||||
|
||||
|
@ -193,7 +193,7 @@ gtk_toggle_tool_button_create_menu_proxy (GtkToolItem *item)
|
||||
const gchar *label_text = gtk_tool_button_get_label (tool_button);
|
||||
const gchar *stock_id = gtk_tool_button_get_stock_id (tool_button);
|
||||
|
||||
if (label_widget && GTK_IS_LABEL (label_widget))
|
||||
if (GTK_IS_LABEL (label_widget))
|
||||
{
|
||||
label = gtk_label_get_label (GTK_LABEL (label_widget));
|
||||
use_mnemonic = gtk_label_get_use_underline (GTK_LABEL (label_widget));
|
||||
|
@ -614,7 +614,7 @@ gtk_tool_button_create_menu_proxy (GtkToolItem *item)
|
||||
gboolean use_mnemonic = TRUE;
|
||||
const char *label;
|
||||
|
||||
if (button->priv->label_widget && GTK_IS_LABEL (button->priv->label_widget))
|
||||
if (GTK_IS_LABEL (button->priv->label_widget))
|
||||
{
|
||||
label = gtk_label_get_label (GTK_LABEL (button->priv->label_widget));
|
||||
use_mnemonic = gtk_label_get_use_underline (GTK_LABEL (button->priv->label_widget));
|
||||
@ -638,7 +638,7 @@ gtk_tool_button_create_menu_proxy (GtkToolItem *item)
|
||||
else
|
||||
menu_item = gtk_image_menu_item_new_with_label (label);
|
||||
|
||||
if (button->priv->icon_widget && GTK_IS_IMAGE (button->priv->icon_widget))
|
||||
if (GTK_IS_IMAGE (button->priv->icon_widget))
|
||||
{
|
||||
menu_image = clone_image_menu_size (GTK_IMAGE (button->priv->icon_widget),
|
||||
gtk_widget_get_settings (GTK_WIDGET (button)));
|
||||
|
@ -1119,8 +1119,8 @@ gtk_tool_item_rebuild_menu (GtkToolItem *tool_item)
|
||||
g_return_if_fail (GTK_IS_TOOL_ITEM (tool_item));
|
||||
|
||||
widget = GTK_WIDGET (tool_item);
|
||||
|
||||
if (widget->parent && GTK_IS_TOOL_SHELL (widget->parent))
|
||||
|
||||
if (GTK_IS_TOOL_SHELL (widget->parent))
|
||||
gtk_tool_shell_rebuild_menu (GTK_TOOL_SHELL (widget->parent));
|
||||
}
|
||||
|
||||
|
@ -473,7 +473,7 @@ gtk_tree_parent_set (GtkWidget *widget,
|
||||
GtkWidget *child;
|
||||
GList *children;
|
||||
|
||||
if (widget->parent && GTK_IS_TREE (widget->parent))
|
||||
if (GTK_IS_TREE (widget->parent))
|
||||
{
|
||||
gtk_tree_unselect_all (tree);
|
||||
|
||||
@ -638,7 +638,7 @@ gtk_tree_remove_items (GtkTree *tree,
|
||||
else
|
||||
{
|
||||
GtkWidget *tmp = GTK_WIDGET (tree);
|
||||
while (tmp->parent && GTK_IS_TREE (tmp->parent))
|
||||
while (GTK_IS_TREE (tmp->parent))
|
||||
tmp = tmp->parent;
|
||||
|
||||
root_tree = GTK_TREE (tmp);
|
||||
|
@ -784,7 +784,7 @@ gtk_real_tree_item_toggle (GtkItem *item)
|
||||
if(!GTK_WIDGET_IS_SENSITIVE(item))
|
||||
return;
|
||||
|
||||
if (GTK_WIDGET (item)->parent && GTK_IS_TREE (GTK_WIDGET (item)->parent))
|
||||
if (GTK_IS_TREE (GTK_WIDGET (item)->parent))
|
||||
gtk_tree_select_child (GTK_TREE (GTK_WIDGET (item)->parent),
|
||||
GTK_WIDGET (item));
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user