1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2009-2010 Vic Lee
4  * Copyright (C) 2017-2021 Antenore Gatta, Giovanni Panozzo
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA  02110-1301, USA.
20  *
21  *  In addition, as a special exception, the copyright holders give
22  *  permission to link the code of portions of this program with the
23  *  OpenSSL library under certain conditions as described in each
24  *  individual source file, and distribute linked combinations
25  *  including the two.
26  *  You must obey the GNU General Public License in all respects
27  *  for all of the code used other than OpenSSL. *  If you modify
28  *  file(s) with this exception, you may extend this exception to your
29  *  version of the file(s), but you are not obligated to do so. *  If you
30  *  do not wish to do so, delete this exception statement from your
31  *  version. *  If you delete this exception statement from all source
32  *  files in the program, then also delete it here.
33  *
34  */
35 
36 #pragma once
37 
38 G_BEGIN_DECLS
39 
40 #define REMMINA_TYPE_APPLET_MENU_ITEM            (remmina_applet_menu_item_get_type())
41 #define REMMINA_APPLET_MENU_ITEM(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), REMMINA_TYPE_APPLET_MENU_ITEM, RemminaAppletMenuItem))
42 #define REMMINA_APPLET_MENU_ITEM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), REMMINA_TYPE_APPLET_MENU_ITEM, RemminaAppletMenuItemClass))
43 #define REMMINA_IS_APPLET_MENU_ITEM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), REMMINA_TYPE_APPLET_MENU_ITEM))
44 #define REMMINA_IS_APPLET_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), REMMINA_TYPE_APPLET_MENU_ITEM))
45 #define REMMINA_APPLET_MENU_ITEM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), REMMINA_TYPE_APPLET_MENU_ITEM, RemminaAppletMenuItemClass))
46 
47 typedef enum {
48 	REMMINA_APPLET_MENU_ITEM_FILE, REMMINA_APPLET_MENU_ITEM_NEW, REMMINA_APPLET_MENU_ITEM_DISCOVERED
49 } RemminaAppletMenuItemType;
50 
51 typedef struct _RemminaAppletMenuItem {
52 	GtkImageMenuItem		image_menu_item;
53 
54 	RemminaAppletMenuItemType	item_type;
55 	gchar *				filename;
56 	gchar *				name;
57 	gchar *				group;
58 	gchar *				protocol;
59 	gchar *				server;
60 	gboolean			ssh_tunnel_enabled;
61 } RemminaAppletMenuItem;
62 
63 typedef struct _RemminaAppletMenuItemClass {
64 	GtkImageMenuItemClass parent_class;
65 } RemminaAppletMenuItemClass;
66 
67 GType remmina_applet_menu_item_get_type(void)
68 G_GNUC_CONST;
69 
70 GtkWidget *remmina_applet_menu_item_new(RemminaAppletMenuItemType item_type, ...);
71 gint remmina_applet_menu_item_compare(gconstpointer a, gconstpointer b, gpointer user_data);
72 
73 G_END_DECLS
74