2
* Copyright 2013 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3, as published
6
* by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License along
14
* with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Lars Uebernickel <lars.uebernickel@canonical.com>
21
#include <gtk/ubuntu-private.h>
23
#include "idousermenuitem.h"
25
#define IDO_TYPE_MENU_ITEM_FACTORY (ido_menu_item_factory_get_type ())
26
#define IDO_MENU_ITEM_FACTORY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), IDO_TYPE_MENU_ITEM_FACTORY, IdoMenuItemFactory))
27
#define IDO_IS_MENU_ITEM_FACTORY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), IDO_TYPE_MENU_ITEM_FACTORY))
29
typedef GObject IdoMenuItemFactory;
30
typedef GObjectClass IdoMenuItemFactoryClass;
32
GType ido_menu_item_factory_get_type (void);
33
static void ido_menu_item_factory_interface_init (UbuntuMenuItemFactoryInterface *iface);
35
G_DEFINE_TYPE_WITH_CODE (IdoMenuItemFactory, ido_menu_item_factory, G_TYPE_OBJECT,
36
G_IMPLEMENT_INTERFACE (UBUNTU_TYPE_MENU_ITEM_FACTORY, ido_menu_item_factory_interface_init)
37
g_io_extension_point_implement (UBUNTU_MENU_ITEM_FACTORY_EXTENSION_POINT_NAME,
38
g_define_type_id, "ido", 0);)
41
ido_menu_item_factory_create_menu_item (UbuntuMenuItemFactory *factory,
44
GActionGroup *actions)
46
GtkMenuItem *item = NULL;
48
if (g_str_equal (type, "indicator.user-menu-item"))
49
item = ido_user_menu_item_new_from_model (menuitem, actions);
55
ido_menu_item_factory_class_init (IdoMenuItemFactoryClass *class)
60
ido_menu_item_factory_interface_init (UbuntuMenuItemFactoryInterface *iface)
62
iface->create_menu_item = ido_menu_item_factory_create_menu_item;
66
ido_menu_item_factory_init (IdoMenuItemFactory *factory)