3
* Copyright (c) 2005-2007 Jasper Huijsmans <jasper@xfce.org>
4
* Copyright (c) 2006-2007 Nick Schermer <nick@xfce.org>
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.
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 Library General Public License for more details.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2
* Copyright (C) 2008-2009 Nick Schermer <nick@xfce.org>
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the Free
6
* Software Foundation; either version 2 of the License, or (at your option)
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14
* You should have received a copy of the GNU General Public License along with
15
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16
* Place, Suite 330, Boston, MA 02111-1307 USA
21
#ifndef __XFCE_PANEL_LAUNCHER_H__
22
#define __XFCE_PANEL_LAUNCHER_H__
19
#ifndef __LAUNCHER_H__
20
#define __LAUNCHER_H__
24
22
#include <gtk/gtk.h>
26
#include <libxfce4panel/xfce-panel-plugin.h>
29
#define LAUNCHER_NEW_TOOLTIP_API (GTK_CHECK_VERSION (2,11,6))
30
#define LAUNCHER_ARROW_SIZE (16)
31
#define LAUNCHER_POPUP_DELAY (225)
32
#define LAUNCHER_TOOLTIP_SIZE (32)
33
#define LAUNCHER_MENU_SIZE (24)
34
#define LAUNCHER_STARTUP_TIMEOUT (30 * 1000)
35
#define LAUNCHER_TREE_ICON_SIZE (24)
36
#define LAUNCHER_CHOOSER_ICON_SIZE (48)
39
/* frequently used code */
40
#define launcher_free_filenames(list) G_STMT_START{ \
41
g_slist_foreach (list, (GFunc) g_free, NULL); \
42
g_slist_free (list); \
46
typedef struct _LauncherEntry LauncherEntry;
47
typedef struct _LauncherPlugin LauncherPlugin;
58
#ifdef HAVE_LIBSTARTUP_NOTIFICATION
62
#if LAUNCHER_NEW_TOOLTIP_API
63
GdkPixbuf *tooltip_cache;
67
struct _LauncherPlugin
70
XfcePanelPlugin *panel_plugin;
72
/* whether saving is allowed */
73
guint plugin_can_save : 1;
76
/* list of launcher entries */
81
GtkWidget *icon_button;
82
GtkWidget *arrow_button;
85
#if !LAUNCHER_NEW_TOOLTIP_API
89
/* event source ids */
90
guint popup_timeout_id;
96
/* icon theme changed handler */
97
gulong icon_theme_change_handler;
102
LAUNCHER_ARROW_DEFAULT = 0,
104
LAUNCHER_ARROW_RIGHT,
106
LAUNCHER_ARROW_BOTTOM,
107
LAUNCHER_ARROW_INSIDE_BUTTON
110
/* target types for dropping in the launcher plugin */
111
static const GtkTargetEntry drop_targets[] =
113
{ (gchar *) "text/uri-list", 0, 0, },
114
{ (gchar *) "STRING", 0, 0 },
115
{ (gchar *) "UTF8_STRING", 0, 0 },
116
{ (gchar *) "text/plain", 0, 0 },
121
GSList *launcher_utility_filenames_from_selection_data (GtkSelectionData *selection_data) G_GNUC_MALLOC G_GNUC_INTERNAL;
122
GdkPixbuf *launcher_utility_load_pixbuf (GdkScreen *screen,
124
guint size) G_GNUC_MALLOC G_GNUC_INTERNAL;
125
LauncherEntry *launcher_entry_new (void) G_GNUC_MALLOC G_GNUC_INTERNAL;
126
void launcher_entry_free (LauncherEntry *entry,
127
LauncherPlugin *launcher) G_GNUC_INTERNAL;
128
void launcher_plugin_rebuild (LauncherPlugin *launcher,
129
gboolean update_icon) G_GNUC_INTERNAL;
130
void launcher_plugin_read (LauncherPlugin *launcher) G_GNUC_INTERNAL;
131
void launcher_plugin_save (LauncherPlugin *launcher) G_GNUC_INTERNAL;
133
#endif /* !__XFCE_PANEL_LAUNCHER_H__ */
23
#include <libxfce4panel/libxfce4panel.h>
27
typedef struct _LauncherPluginClass LauncherPluginClass;
28
typedef struct _LauncherPlugin LauncherPlugin;
29
typedef enum _LauncherArrowType LauncherArrowType;
31
#define XFCE_TYPE_LAUNCHER_PLUGIN (launcher_plugin_get_type ())
32
#define XFCE_LAUNCHER_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_LAUNCHER_PLUGIN, LauncherPlugin))
33
#define XFCE_LAUNCHER_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_LAUNCHER_PLUGIN, LauncherPluginClass))
34
#define XFCE_IS_LAUNCHER_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_LAUNCHER_PLUGIN))
35
#define XFCE_IS_LAUNCHER_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_LAUNCHER_PLUGIN))
36
#define XFCE_LAUNCHER_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_LAUNCHER_PLUGIN, LauncherPluginClass))
38
enum _LauncherArrowType
40
LAUNCHER_ARROW_DEFAULT = 0,
45
LAUNCHER_ARROW_INTERNAL
48
GType launcher_plugin_get_type (void) G_GNUC_CONST;
50
void launcher_plugin_register_type (XfcePanelTypeModule *type_module);
52
GSList *launcher_plugin_get_items (LauncherPlugin *plugin);
54
gchar *launcher_plugin_unique_filename (LauncherPlugin *plugin);
56
GHashTable *launcher_plugin_garcon_menu_pool (void);
58
gboolean launcher_plugin_item_is_editable (LauncherPlugin *plugin,
60
gboolean *can_delete);
64
#endif /* !__LAUNCHER_H__ */