[gtk-mac-integration] Remove deprecations for Gtk-mac-integration release 1.0.0



commit 2c99958942bf531f9bfecfb6365470f1e46929da
Author: John Ralls <jralls ceridwen us>
Date:   Tue Sep 20 09:01:56 2011 -0700

    Remove deprecations for Gtk-mac-integration release 1.0.0

 src/gtkosxapplication.h        |   26 ++--------
 src/gtkosxapplication_quartz.c |   99 ----------------------------------------
 2 files changed, 5 insertions(+), 120 deletions(-)
---
diff --git a/src/gtkosxapplication.h b/src/gtkosxapplication.h
index 346d8b8..9ef16b0 100644
--- a/src/gtkosxapplication.h
+++ b/src/gtkosxapplication.h
@@ -77,12 +77,6 @@ void gtk_osxapplication_set_menu_bar (GtkOSXApplication *self,
 				      GtkMenuShell *menu_shell);
 void gtk_osxapplication_sync_menubar (GtkOSXApplication *self);
 
-#ifndef GTK_DISABLE_DEPRECATED
-GtkOSXApplicationMenuGroup *gtk_osxapplication_add_app_menu_group (GtkOSXApplication* self);
-void gtk_osxapplication_add_app_menu_item (GtkOSXApplication *self,
-					   GtkOSXApplicationMenuGroup *group,
-					   GtkMenuItem *menu_item);
-#endif
 void gtk_osxapplication_insert_app_menu_item (GtkOSXApplication *self,
 					      GtkWidget *menu_item,
 					      gint index);
@@ -138,26 +132,16 @@ void gtk_osxapplication_cancel_attention_request(GtkOSXApplication *self, gint i
  * CFBundleIdentifier key (So if you need to detect being in a bundle,
  * make sure that your bundle has that key!) 
 
- * Richard Proctor pointed out that these functions don't really need to be class functions: the self parameter isn't used, and making them "free" functions will often save one from having to call g_object_new(GTK_TYPE_OSX_APPLICATION) just to get it. For backwards compatibility, there's a define for the old version, but it will go away in 1.0, so clean up your code now.
-*/
+ * Richard Proctor pointed out that these functions don't really need
+ * to be class functions: the self parameter isn't used, and making
+ * them "free" functions will often save one from having to call
+ * g_object_new(GTK_TYPE_OSX_APPLICATION) just to get it. */
+
 gchar *quartz_application_get_bundle_path(void);
 gchar *quartz_application_get_resource_path(void);
 gchar *quartz_application_get_executable_path(void);
 gchar *quartz_application_get_bundle_id(void);
 gchar *quartz_application_get_bundle_info(const gchar *key);
 
-#ifndef GTK_DISABLE_DEPRECATED
-#define gtk_osxapplication_get_bundle_path(x) \
-    quartz_application_get_bundle_path()
-#define gtk_osxapplication_get_resource_path(x) \
-    quartz_application_get_resource_path()
-#define gtk_osxapplication_get_executable_path(x) \
-    quartz_application_get_executable_path()
-#define gtk_osxapplication_get_bundle_id(x) \
-    quartz_application_get_bundle_id()
-#define gtk_osxapplication_get_bundle_info(x, y) \
-    quartz_application_get_bundle_info(y)
-#endif
-G_END_DECLS
 
 #endif /* __GTK_OSX_APPLICATION_H__ */
diff --git a/src/gtkosxapplication_quartz.c b/src/gtkosxapplication_quartz.c
index a25f089..6c44b62 100644
--- a/src/gtkosxapplication_quartz.c
+++ b/src/gtkosxapplication_quartz.c
@@ -706,105 +706,6 @@ gtk_osxapplication_sync_menubar (GtkOSXApplication *self)
 
 
 /**
- * gtk_osxapplication_add_app_menu_group:
- * @self: The GtkOSXApplication object
- *
- * GtkOSXApplicationMenuGroups are used to insert separators in the
- * App menu and to ensure that they are displayed only if not the
- * first item in the menu. Groups are added sequentially; there is no
- * provision for inserting them at a particular position.
- *
- * Returns: A new GtkOSXApplicationMenuGroup
- *
- * Deperecated: 0.9.5: Use gtk_osxapplication_insert_menu_item and
- * pass in a GtkSeparator at the index you want one.
- */
-GtkOSXApplicationMenuGroup *
-gtk_osxapplication_add_app_menu_group (GtkOSXApplication* self )
-{
-  GNSMenuBar *menubar = (GNSMenuBar*)[NSApp mainMenu];
-  GtkOSXApplicationMenuGroup *group = [menubar addGroup];
-    return group;
-}
-
-/**
- * gtk_osxapplication_add_app_menu_item:
- * @self: The GtkOSXApplication object
- * @group: The GtkOSXApplicationMenuGroup to which the menu item should be 
- * added.
- * @menu_item: The GtkMenuItem to add to the group.
- *
- * Certain menu items (About, Check for updates, and Preferences in
- * particular) are normally found in the so-called Application menu
- * (the first one on the menubar, named after the application) in OSX
- * applications. This function will create a menu entry for such a
- * menu item, removing it from its original menu in the Gtk
- * application.
- *
- * Use this after calling gtk_osxapplication_set_menu_bar(), first
- * creating a GtkOSXApplicationMenuGroup to hold it with
- * gtk_osxapplication_add_menu_group().
- *
- * Don't use it for Quit! A Quit menu item is created automatically
- * along with the Application menu. Just hide your Gtk Quit menu item.
- *
- * Deprecated: 0.9.5: Use gtk_osxapplication_insert_menu_item instead.
- */
-void
-gtk_osxapplication_add_app_menu_item (GtkOSXApplication *self,
-				   GtkOSXApplicationMenuGroup *group,
-				   GtkMenuItem *menu_item)
-{
-  // we know that the application menu is always the submenu of the first item in the main menu
-  GNSMenuBar *menubar = (GNSMenuBar*)[NSApp mainMenu];
-  GList   *list = NULL, *menu_groups = [menubar app_menu_groups];
-  gint     index = 0;
-  NSMenu *app_menu = [[menubar itemAtIndex: 0] submenu];
-  GtkWidget *parent = gtk_widget_get_toplevel (GTK_WIDGET (menu_item));
-
-  g_return_if_fail (group != NULL);
-  g_return_if_fail (GTK_IS_MENU_ITEM (menu_item));
-  g_return_if_fail(parent != NULL);
-
-  for (list = menu_groups; list; list = g_list_next (list))
-    {
-      GtkOSXApplicationMenuGroup *list_group = (GtkOSXApplicationMenuGroup*) list->data;
-
-      index += g_list_length (list_group->items);
-
-      /*  adjust index for the separator between groups, but not
-       *  before the first group
-       */
-      if (list_group->items && list->prev)
-	index++;
-
-      if (group == list_group)
-	{
-	  /*  add a separator before adding the first item, but not
-	   *  for the first group
-	   */
-		
-	  if (!group->items && list->prev)
-	    {
-	      [app_menu insertItem:[NSMenuItem separatorItem] 
-	       atIndex:index+1];
-	      index++;
-	    }
-	  DEBUG ("Add to APP menu bar %s\n", get_menu_label_text (GTK_WIDGET(menu_item), NULL));
-	  cocoa_menu_item_add_item ([[[NSApp mainMenu] itemAtIndex: 0] submenu],
-				    GTK_WIDGET(menu_item), index + 1);
-
-	  group->items = g_list_append (group->items, menu_item);
-	  return;
-	}
-    }
-
-  if (!list)
-    g_warning ("%s: app menu group %p does not exist",
-	       G_STRFUNC, group);
-}
-
-/**
  * gtk_osxapplication_insert_app_menu_item:
  * @self: The GtkOSXApplication object
  * @menu_item: The GtkMenuItem to add to the group.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]