X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkuimanager.c;h=75189aac3ecc695ec664994f695a554f1f5c795c;hb=32825a66ac8e65bf98cafed26a339fa1f31eddd4;hp=1e644d29ef2bfd20e545aa5e84464dbbe05a7960;hpb=739ab8548d1d59a9b10fa6ec6a077ddf0ea8c206;p=~andy%2Fgtk diff --git a/gtk/gtkuimanager.c b/gtk/gtkuimanager.c index 1e644d29e..75189aac3 100644 --- a/gtk/gtkuimanager.c +++ b/gtk/gtkuimanager.c @@ -14,9 +14,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with the Gnome Library; see the file COPYING.LIB. If not, - * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ /* @@ -47,6 +45,11 @@ #include "gtkwindow.h" #include "gtkprivate.h" +#undef GDK_DEPRECATED +#undef GDK_DEPRECATED_FOR +#define GDK_DEPRECATED +#define GDK_DEPRECATED_FOR(f) + #include "gtkuimanager.h" #include "deprecated/gtktearoffmenuitem.h" @@ -125,7 +128,7 @@ * * * A UI definition - * + * * * @@ -150,7 +153,7 @@ * * * - * + * ]]> * * * The constructed widget hierarchy is very similar to the element tree @@ -711,7 +714,6 @@ gtk_ui_manager_buildable_add_child (GtkBuildable *buildable, pos = g_list_length (manager->private_data->action_groups); - g_object_ref (child); gtk_ui_manager_insert_action_group (manager, GTK_ACTION_GROUP (child), pos); @@ -966,6 +968,10 @@ cb_proxy_post_activate (GtkActionGroup *group, * with @manager. Actions in earlier groups hide actions with the same * name in later groups. * + * If @pos is larger than the number of action groups in @manager, or + * negative, @action_group will be inserted at the end of the internal + * list. + * * Since: 2.4 **/ void @@ -1389,17 +1395,16 @@ static gboolean free_node (GNode *node) { Node *info = NODE_INFO (node); - + g_list_free_full (info->uifiles, node_ui_reference_free); + info->uifiles = NULL; - if (info->action) - g_object_unref (info->action); - if (info->proxy) - g_object_unref (info->proxy); - if (info->extra) - g_object_unref (info->extra); - g_free (info->name); + g_clear_object (&info->action); + g_clear_object (&info->proxy); + g_clear_object (&info->extra); + g_clear_pointer (&info->name, g_free); g_slice_free (Node, info); + node->data = NULL; return FALSE; } @@ -2410,50 +2415,6 @@ find_toolbar_position (GNode *node, return TRUE; } -/** - * _gtk_menu_is_empty: - * @menu: (allow-none): a #GtkMenu or %NULL - * - * Determines whether @menu is empty. A menu is considered empty if it - * the only visible children are tearoff menu items or "filler" menu - * items which were inserted to mark the menu as empty. - * - * This function is used by #GtkAction. - * - * Return value: whether @menu is empty. - **/ -gboolean -_gtk_menu_is_empty (GtkWidget *menu) -{ - GList *children, *cur; - gboolean result = TRUE; - - g_return_val_if_fail (menu == NULL || GTK_IS_MENU (menu), TRUE); - - if (!menu) - return FALSE; - - children = gtk_container_get_children (GTK_CONTAINER (menu)); - - cur = children; - while (cur) - { - if (gtk_widget_get_visible (cur->data)) - { - if (!GTK_IS_TEAROFF_MENU_ITEM (cur->data) && - !g_object_get_data (cur->data, "gtk-empty-menu-item")) - { - result = FALSE; - break; - } - } - cur = cur->next; - } - g_list_free (children); - - return result; -} - enum { SEPARATOR_MODE_SMART, SEPARATOR_MODE_VISIBLE,