Second click on weather plugin icon should hide conditions dialog if it's shown.
[lxde/lxpanel.git] / src / panel.h
1 /**
2 * Copyright (c) 2006 LxDE Developers, see the file AUTHORS for details.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19 #ifndef PANEL_H
20 #define PANEL_H
21
22 #include <X11/Xlib.h>
23 #include <gtk/gtk.h>
24
25 extern gchar *cprofile;
26
27 extern Atom a_UTF8_STRING;
28 extern Atom a_XROOTPMAP_ID;
29
30 extern Atom a_WM_STATE;
31 extern Atom a_WM_CLASS;
32 extern Atom a_WM_DELETE_WINDOW;
33 extern Atom a_WM_PROTOCOLS;
34 extern Atom a_NET_WORKAREA;
35 extern Atom a_NET_CLIENT_LIST;
36 extern Atom a_NET_CLIENT_LIST_STACKING;
37 extern Atom a_NET_NUMBER_OF_DESKTOPS;
38 extern Atom a_NET_CURRENT_DESKTOP;
39 extern Atom a_NET_DESKTOP_VIEWPORT;
40 extern Atom a_NET_DESKTOP_NAMES;
41 extern Atom a_NET_ACTIVE_WINDOW;
42 extern Atom a_NET_CLOSE_WINDOW;
43 extern Atom a_NET_SHOWING_DESKTOP;
44 extern Atom a_NET_SUPPORTED;
45 extern Atom a_NET_WM_STATE;
46 extern Atom a_NET_WM_STATE_SKIP_TASKBAR;
47 extern Atom a_NET_WM_STATE_SKIP_PAGER;
48 extern Atom a_NET_WM_STATE_STICKY;
49 extern Atom a_NET_WM_STATE_HIDDEN;
50 extern Atom a_NET_WM_STATE_SHADED;
51
52 #define a_NET_WM_STATE_REMOVE 0 /* remove/unset property */
53 #define a_NET_WM_STATE_ADD 1 /* add/set property */
54 #define a_NET_WM_STATE_TOGGLE 2 /* toggle property */
55
56 extern Atom a_NET_WM_WINDOW_TYPE;
57 extern Atom a_NET_WM_WINDOW_TYPE_DESKTOP;
58 extern Atom a_NET_WM_WINDOW_TYPE_DOCK;
59 extern Atom a_NET_WM_WINDOW_TYPE_TOOLBAR;
60 extern Atom a_NET_WM_WINDOW_TYPE_MENU;
61 extern Atom a_NET_WM_WINDOW_TYPE_UTILITY;
62 extern Atom a_NET_WM_WINDOW_TYPE_SPLASH;
63 extern Atom a_NET_WM_WINDOW_TYPE_DIALOG;
64 extern Atom a_NET_WM_WINDOW_TYPE_NORMAL;
65
66 extern Atom a_NET_WM_DESKTOP;
67 extern Atom a_NET_WM_NAME;
68 extern Atom a_NET_WM_VISIBLE_NAME;
69 extern Atom a_NET_WM_STRUT;
70 extern Atom a_NET_WM_STRUT_PARTIAL;
71 extern Atom a_NET_WM_ICON;
72 extern Atom a_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR;
73
74 extern Atom a_NET_SYSTEM_TRAY_OPCODE;
75 extern Atom a_NET_SYSTEM_TRAY_MESSAGE_DATA;
76 extern Atom a_NET_SYSTEM_TRAY_ORIENTATION;
77 extern Atom a_MANAGER;
78
79 extern Atom a_LXPANEL_CMD; /* for private client message */
80
81 #define LX_TYPE_PANEL (lxpanel_get_type())
82 #define LXPANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
83 LX_TYPE_PANEL, LXPanel))
84 #define LXPANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
85 LX_TYPE_PANEL, LXPanelClass))
86 #define LX_IS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
87 LX_TYPE_PANEL))
88
89 extern GType lxpanel_get_type (void) G_GNUC_CONST;
90
91 /* A little trick to be compatible with some themes which rely on the
92 PanelToplevel class, so we use LXPanel as alias for PanelToplevel */
93 typedef struct _LXPanel LXPanel;
94 typedef struct _LXPanel PanelToplevel;
95 typedef struct _LXPanelClass PanelToplevelClass;
96
97 typedef struct _Panel Panel;
98
99 struct _LXPanel
100 {
101 GtkWindow window;
102 Panel *priv;
103 };
104
105 struct _LXPanelClass
106 {
107 GtkWindowClass parent_class;
108 };
109
110 extern void panel_apply_icon(GtkWindow *w);
111 extern void lxpanel_draw_label_text(LXPanel * p, GtkWidget * label, const char * text,
112 gboolean bold, float custom_size_factor,
113 gboolean custom_color);
114 extern void lxpanel_image_set_from_file(LXPanel * p, GtkWidget * image, const char * file);
115 extern gboolean lxpanel_image_set_icon_theme(LXPanel * p, GtkWidget * image, const gchar * icon);
116
117 extern int panel_handle_x_error(Display * d, XErrorEvent * ev);
118 extern int panel_handle_x_error_swallow_BadWindow_BadDrawable(Display * d, XErrorEvent * ev);
119
120 void lxpanel_config_save(LXPanel *p); /* defined in configurator.c */
121
122 /* Accessors APIs for Panel* */
123 extern GtkOrientation panel_get_orientation(LXPanel *panel);
124 extern gint panel_get_icon_size(LXPanel *panel);
125 extern gint panel_get_height(LXPanel *panel);
126 extern Window panel_get_xwindow(LXPanel *panel);
127 extern gint panel_get_monitor(LXPanel *panel);
128 extern GtkStyle *panel_get_defstyle(LXPanel *panel);
129 extern GtkIconTheme *panel_get_icon_theme(LXPanel *panel);
130 extern gboolean panel_is_at_bottom(LXPanel *panel);
131 extern gboolean panel_is_dynamic(LXPanel *panel);
132 extern GtkWidget *panel_box_new(LXPanel *panel, gboolean homogeneous, gint spacing);
133 extern GtkWidget *panel_separator_new(LXPanel *panel);
134
135 #endif