Move few declarations from C files into private.h file.
[lxde/lxpanel.git] / src / panel.h
CommitLineData
239cb032 1/**
b840f7cc 2 * Copyright (c) 2006-2014 LxDE Developers, see the file AUTHORS for details.
a99ee9e1
JH
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
de7ff173
AG
19#ifndef __PANEL_H__
20#define __PANEL_H__ 1
a52c2257 21
a52c2257
HJYP
22#include <X11/Xlib.h>
23#include <gtk/gtk.h>
a52c2257 24
de7ff173
AG
25G_BEGIN_DECLS
26
a52c2257
HJYP
27extern gchar *cprofile;
28
29extern Atom a_UTF8_STRING;
30extern Atom a_XROOTPMAP_ID;
31
32extern Atom a_WM_STATE;
33extern Atom a_WM_CLASS;
34extern Atom a_WM_DELETE_WINDOW;
35extern Atom a_WM_PROTOCOLS;
36extern Atom a_NET_WORKAREA;
37extern Atom a_NET_CLIENT_LIST;
38extern Atom a_NET_CLIENT_LIST_STACKING;
39extern Atom a_NET_NUMBER_OF_DESKTOPS;
40extern Atom a_NET_CURRENT_DESKTOP;
c0aed50f 41extern Atom a_NET_DESKTOP_VIEWPORT;
a52c2257
HJYP
42extern Atom a_NET_DESKTOP_NAMES;
43extern Atom a_NET_ACTIVE_WINDOW;
44extern Atom a_NET_CLOSE_WINDOW;
53b37ef2 45extern Atom a_NET_SHOWING_DESKTOP;
a52c2257
HJYP
46extern Atom a_NET_SUPPORTED;
47extern Atom a_NET_WM_STATE;
48extern Atom a_NET_WM_STATE_SKIP_TASKBAR;
49extern Atom a_NET_WM_STATE_SKIP_PAGER;
50extern Atom a_NET_WM_STATE_STICKY;
51extern Atom a_NET_WM_STATE_HIDDEN;
52extern Atom a_NET_WM_STATE_SHADED;
53
54#define a_NET_WM_STATE_REMOVE 0 /* remove/unset property */
55#define a_NET_WM_STATE_ADD 1 /* add/set property */
56#define a_NET_WM_STATE_TOGGLE 2 /* toggle property */
57
58extern Atom a_NET_WM_WINDOW_TYPE;
59extern Atom a_NET_WM_WINDOW_TYPE_DESKTOP;
60extern Atom a_NET_WM_WINDOW_TYPE_DOCK;
61extern Atom a_NET_WM_WINDOW_TYPE_TOOLBAR;
62extern Atom a_NET_WM_WINDOW_TYPE_MENU;
63extern Atom a_NET_WM_WINDOW_TYPE_UTILITY;
64extern Atom a_NET_WM_WINDOW_TYPE_SPLASH;
65extern Atom a_NET_WM_WINDOW_TYPE_DIALOG;
66extern Atom a_NET_WM_WINDOW_TYPE_NORMAL;
bee4c26e 67
a52c2257
HJYP
68extern Atom a_NET_WM_DESKTOP;
69extern Atom a_NET_WM_NAME;
70extern Atom a_NET_WM_VISIBLE_NAME;
71extern Atom a_NET_WM_STRUT;
72extern Atom a_NET_WM_STRUT_PARTIAL;
73extern Atom a_NET_WM_ICON;
74extern Atom a_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR;
75
2918994e 76extern Atom a_NET_SYSTEM_TRAY_OPCODE;
964b8b7e 77extern Atom a_NET_SYSTEM_TRAY_MESSAGE_DATA;
2918994e 78extern Atom a_NET_SYSTEM_TRAY_ORIENTATION;
79extern Atom a_MANAGER;
80
77886b88 81extern Atom a_LXPANEL_CMD; /* for private client message */
a52c2257 82
a7bd16a4
AG
83#define LX_TYPE_PANEL (lxpanel_get_type())
84#define LXPANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
85 LX_TYPE_PANEL, LXPanel))
86#define LXPANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
87 LX_TYPE_PANEL, LXPanelClass))
88#define LX_IS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
89 LX_TYPE_PANEL))
90
91extern GType lxpanel_get_type (void) G_GNUC_CONST;
92
93/* A little trick to be compatible with some themes which rely on the
94 PanelToplevel class, so we use LXPanel as alias for PanelToplevel */
95typedef struct _LXPanel LXPanel;
96typedef struct _LXPanel PanelToplevel;
97typedef struct _LXPanelClass PanelToplevelClass;
98
b31cb1d2 99typedef struct _Panel Panel;
a52c2257 100
a7bd16a4
AG
101struct _LXPanel
102{
103 GtkWindow window;
104 Panel *priv;
105};
106
107struct _LXPanelClass
108{
109 GtkWindowClass parent_class;
110};
111
2918994e 112extern void panel_apply_icon(GtkWindow *w);
a7bd16a4
AG
113extern void lxpanel_draw_label_text(LXPanel * p, GtkWidget * label, const char * text,
114 gboolean bold, float custom_size_factor,
115 gboolean custom_color);
116extern void lxpanel_image_set_from_file(LXPanel * p, GtkWidget * image, const char * file);
117extern gboolean lxpanel_image_set_icon_theme(LXPanel * p, GtkWidget * image, const gchar * icon);
2918994e 118
119extern int panel_handle_x_error(Display * d, XErrorEvent * ev);
120extern int panel_handle_x_error_swallow_BadWindow_BadDrawable(Display * d, XErrorEvent * ev);
bee4c26e 121
a7bd16a4 122void lxpanel_config_save(LXPanel *p); /* defined in configurator.c */
5d2de79a 123
b31cb1d2 124/* Accessors APIs for Panel* */
a7bd16a4
AG
125extern GtkOrientation panel_get_orientation(LXPanel *panel);
126extern gint panel_get_icon_size(LXPanel *panel);
127extern gint panel_get_height(LXPanel *panel);
128extern Window panel_get_xwindow(LXPanel *panel);
129extern gint panel_get_monitor(LXPanel *panel);
130extern GtkStyle *panel_get_defstyle(LXPanel *panel);
131extern GtkIconTheme *panel_get_icon_theme(LXPanel *panel);
132extern gboolean panel_is_at_bottom(LXPanel *panel);
072944bf 133extern gboolean panel_is_dynamic(LXPanel *panel);
a7bd16a4
AG
134extern GtkWidget *panel_box_new(LXPanel *panel, gboolean homogeneous, gint spacing);
135extern GtkWidget *panel_separator_new(LXPanel *panel);
b31cb1d2 136
de7ff173
AG
137G_END_DECLS
138
a52c2257 139#endif