~ubuntu-branches/debian/experimental/xfce4-panel/experimental

« back to all changes in this revision

Viewing changes to plugins/launcher/launcher.h

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez, Lionel Le Folgoc, Yves-Alexis Perez
  • Date: 2011-02-06 18:10:07 UTC
  • mfrom: (1.3.13 upstream) (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110206181007-vpw5z3xnm3hdvybx
Tags: 4.8.1-1
[ Lionel Le Folgoc ]
* New upstream bugfix release.
* debian/control:
  - refreshed (b-)deps for this new major release
  - add myself to Uploaders
  - bump Standards-Version to 3.9.1.
* debian/NEWS: dropped, unneeded.
* debian/xfce4-panel.shlibs: refreshed, bump to (>= 4.7.2).
* debian/xfce4-panel.lintian-overrides: refreshed, new lib name.
* debian/xfce4-panel.preinst: added, handles removal of old conffiles.
* debian/xfce4-panel.postinst: explicitly set -e.
* debian/*.install: refreshed.
* debian/rules:
  - call dpkg-buildflags
  - dropped rc files mangling as they don't exist anymore
  - updated removal of *.{l,}a files.
  - drop overrides for dh_auto_{configure,clean}, obsolete.
* debian/xfce4-panel.{preinst,postinst,prerm}: use dpkg-maintscript-helper
  to remove pre-xfconf config files.
* Bugs fixed by 4.7.x/4.8.x series:
  - rgba support                                                  lp: #586012
  - disappearing menus                                             lp: #53897
  - xrandr support                               lp: #176174, Closes: #432914
  - Fails to reap children, creating zombies                      lp: #420187
  - DND of desktop-files on the panel to create new launchers Closes: #480380
* Bumped shlibs to >= 4.7.7, abi break for external plugins.

[ Yves-Alexis Perez ]
* New upstream development release
* debian/xfce4-panel.install:
  - install wrapper and migrate tools in xfce4-panel package
  - update plugins paths
* debian/rules:
  - update path when removing .a/.la files for plugins.
  - add hardening flags to {C,LD}FLAGS
* debian/control:
  - add build-dep on hardening-includes
  - update build-dep on garcon to 0.1.4.
* debian/copyright updated for new release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  $Id: launcher.h 29082 2009-01-02 16:25:45Z nick $
2
 
 *
3
 
 *  Copyright (c) 2005-2007 Jasper Huijsmans <jasper@xfce.org>
4
 
 *  Copyright (c) 2006-2007 Nick Schermer <nick@xfce.org>
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 Library 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
1
/*
 
2
 * Copyright (C) 2008-2010 Nick Schermer <nick@xfce.org>
 
3
 *
 
4
 * This library 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)
 
7
 * any later version.
 
8
 *
 
9
 * This library 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
 
12
 * more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Library General Public License
 
15
 * along with this library; if not, write to the Free Software Foundation,
 
16
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19
17
 */
20
18
 
21
 
#ifndef __XFCE_PANEL_LAUNCHER_H__
22
 
#define __XFCE_PANEL_LAUNCHER_H__
 
19
#ifndef __LAUNCHER_H__
 
20
#define __LAUNCHER_H__
23
21
 
24
22
#include <gtk/gtk.h>
25
 
#include <exo/exo.h>
26
 
#include <libxfce4panel/xfce-panel-plugin.h>
27
 
 
28
 
#define BORDER                     (6)
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)
37
 
 
38
 
 
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); \
43
 
    }G_STMT_END
44
 
 
45
 
 
46
 
typedef struct _LauncherEntry  LauncherEntry;
47
 
typedef struct _LauncherPlugin LauncherPlugin;
48
 
 
49
 
struct _LauncherEntry
50
 
{
51
 
    gchar    *name;
52
 
    gchar    *comment;
53
 
    gchar    *exec;
54
 
    gchar    *path;
55
 
    gchar    *icon;
56
 
 
57
 
    guint     terminal : 1;
58
 
#ifdef HAVE_LIBSTARTUP_NOTIFICATION
59
 
    guint     startup : 1;
60
 
#endif
61
 
 
62
 
#if LAUNCHER_NEW_TOOLTIP_API
63
 
    GdkPixbuf *tooltip_cache;
64
 
#endif
65
 
};
66
 
 
67
 
struct _LauncherPlugin
68
 
{
69
 
    /* panel plugin */
70
 
    XfcePanelPlugin *panel_plugin;
71
 
 
72
 
    /* whether saving is allowed */
73
 
    guint            plugin_can_save : 1;
74
 
    gint             image_size;
75
 
 
76
 
    /* list of launcher entries */
77
 
    GList           *entries;
78
 
 
79
 
    /* panel widgets */
80
 
    GtkWidget       *box;
81
 
    GtkWidget       *icon_button;
82
 
    GtkWidget       *arrow_button;
83
 
    GtkWidget       *image;
84
 
    GtkWidget       *menu;
85
 
#if !LAUNCHER_NEW_TOOLTIP_API
86
 
    GtkTooltips     *tips;
87
 
#endif
88
 
 
89
 
    /* event source ids */
90
 
    guint            popup_timeout_id;
91
 
 
92
 
    /* settings */
93
 
    guint            move_first : 1;
94
 
    guint            arrow_position;
95
 
};
96
 
 
97
 
enum
98
 
{
99
 
    LAUNCHER_ARROW_DEFAULT = 0,
100
 
    LAUNCHER_ARROW_LEFT,
101
 
    LAUNCHER_ARROW_RIGHT,
102
 
    LAUNCHER_ARROW_TOP,
103
 
    LAUNCHER_ARROW_BOTTOM,
104
 
    LAUNCHER_ARROW_INSIDE_BUTTON
105
 
};
106
 
 
107
 
/* target types for dropping in the launcher plugin */
108
 
static const GtkTargetEntry drop_targets[] =
109
 
{
110
 
    { (gchar *) "text/uri-list", 0, 0, },
111
 
    { (gchar *) "STRING",              0, 0 },
112
 
    { (gchar *) "UTF8_STRING",   0, 0 },
113
 
    { (gchar *) "text/plain",    0, 0 },
114
 
};
115
 
 
116
 
 
117
 
 
118
 
GSList        *launcher_utility_filenames_from_selection_data (GtkSelectionData *selection_data) G_GNUC_MALLOC G_GNUC_INTERNAL;
119
 
GdkPixbuf     *launcher_utility_load_pixbuf                   (GdkScreen        *screen,
120
 
                                                               const gchar      *name,
121
 
                                                               guint             size) G_GNUC_MALLOC G_GNUC_INTERNAL;
122
 
LauncherEntry *launcher_entry_new                             (void) G_GNUC_MALLOC G_GNUC_INTERNAL;
123
 
void           launcher_entry_free                            (LauncherEntry    *entry,
124
 
                                                               LauncherPlugin   *launcher) G_GNUC_INTERNAL;
125
 
void           launcher_plugin_rebuild                        (LauncherPlugin   *launcher,
126
 
                                                               gboolean          update_icon) G_GNUC_INTERNAL;
127
 
void           launcher_plugin_read                           (LauncherPlugin   *launcher) G_GNUC_INTERNAL;
128
 
void           launcher_plugin_save                           (LauncherPlugin   *launcher) G_GNUC_INTERNAL;
129
 
 
130
 
#endif /* !__XFCE_PANEL_LAUNCHER_H__ */
 
23
#include <libxfce4panel/libxfce4panel.h>
 
24
 
 
25
G_BEGIN_DECLS
 
26
 
 
27
typedef struct _LauncherPluginClass LauncherPluginClass;
 
28
typedef struct _LauncherPlugin      LauncherPlugin;
 
29
typedef enum   _LauncherArrowType   LauncherArrowType;
 
30
 
 
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))
 
37
 
 
38
enum _LauncherArrowType
 
39
{
 
40
  LAUNCHER_ARROW_DEFAULT = 0,
 
41
  LAUNCHER_ARROW_NORTH,
 
42
  LAUNCHER_ARROW_WEST,
 
43
  LAUNCHER_ARROW_EAST,
 
44
  LAUNCHER_ARROW_SOUTH,
 
45
  LAUNCHER_ARROW_INTERNAL
 
46
};
 
47
 
 
48
GType       launcher_plugin_get_type         (void) G_GNUC_CONST;
 
49
 
 
50
void        launcher_plugin_register_type    (XfcePanelTypeModule *type_module);
 
51
 
 
52
GSList     *launcher_plugin_get_items        (LauncherPlugin      *plugin);
 
53
 
 
54
gchar      *launcher_plugin_unique_filename  (LauncherPlugin      *plugin);
 
55
 
 
56
GHashTable *launcher_plugin_garcon_menu_pool (void);
 
57
 
 
58
gboolean    launcher_plugin_item_is_editable (LauncherPlugin      *plugin,
 
59
                                              GarconMenuItem      *item,
 
60
                                              gboolean            *can_delete);
 
61
 
 
62
G_END_DECLS
 
63
 
 
64
#endif /* !__LAUNCHER_H__ */