Update copyrights everywhere.
[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
a52c2257
HJYP
19#ifndef PANEL_H
20#define PANEL_H
21
a52c2257
HJYP
22#include <X11/Xlib.h>
23#include <gtk/gtk.h>
a52c2257
HJYP
24
25extern gchar *cprofile;
26
27extern Atom a_UTF8_STRING;
28extern Atom a_XROOTPMAP_ID;
29
30extern Atom a_WM_STATE;
31extern Atom a_WM_CLASS;
32extern Atom a_WM_DELETE_WINDOW;
33extern Atom a_WM_PROTOCOLS;
34extern Atom a_NET_WORKAREA;
35extern Atom a_NET_CLIENT_LIST;
36extern Atom a_NET_CLIENT_LIST_STACKING;
37extern Atom a_NET_NUMBER_OF_DESKTOPS;
38extern Atom a_NET_CURRENT_DESKTOP;
c0aed50f 39extern Atom a_NET_DESKTOP_VIEWPORT;
a52c2257
HJYP
40extern Atom a_NET_DESKTOP_NAMES;
41extern Atom a_NET_ACTIVE_WINDOW;
42extern Atom a_NET_CLOSE_WINDOW;
53b37ef2 43extern Atom a_NET_SHOWING_DESKTOP;
a52c2257
HJYP
44extern Atom a_NET_SUPPORTED;
45extern Atom a_NET_WM_STATE;
46extern Atom a_NET_WM_STATE_SKIP_TASKBAR;
47extern Atom a_NET_WM_STATE_SKIP_PAGER;
48extern Atom a_NET_WM_STATE_STICKY;
49extern Atom a_NET_WM_STATE_HIDDEN;
50extern 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
56extern Atom a_NET_WM_WINDOW_TYPE;
57extern Atom a_NET_WM_WINDOW_TYPE_DESKTOP;
58extern Atom a_NET_WM_WINDOW_TYPE_DOCK;
59extern Atom a_NET_WM_WINDOW_TYPE_TOOLBAR;
60extern Atom a_NET_WM_WINDOW_TYPE_MENU;
61extern Atom a_NET_WM_WINDOW_TYPE_UTILITY;
62extern Atom a_NET_WM_WINDOW_TYPE_SPLASH;
63extern Atom a_NET_WM_WINDOW_TYPE_DIALOG;
64extern Atom a_NET_WM_WINDOW_TYPE_NORMAL;
bee4c26e 65
a52c2257
HJYP
66extern Atom a_NET_WM_DESKTOP;
67extern Atom a_NET_WM_NAME;
68extern Atom a_NET_WM_VISIBLE_NAME;
69extern Atom a_NET_WM_STRUT;
70extern Atom a_NET_WM_STRUT_PARTIAL;
71extern Atom a_NET_WM_ICON;
72extern Atom a_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR;
73
2918994e 74extern Atom a_NET_SYSTEM_TRAY_OPCODE;
964b8b7e 75extern Atom a_NET_SYSTEM_TRAY_MESSAGE_DATA;
2918994e 76extern Atom a_NET_SYSTEM_TRAY_ORIENTATION;
77extern Atom a_MANAGER;
78
77886b88 79extern Atom a_LXPANEL_CMD; /* for private client message */
a52c2257 80
a7bd16a4
AG
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
89extern 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 */
93typedef struct _LXPanel LXPanel;
94typedef struct _LXPanel PanelToplevel;
95typedef struct _LXPanelClass PanelToplevelClass;
96
b31cb1d2 97typedef struct _Panel Panel;
a52c2257 98
a7bd16a4
AG
99struct _LXPanel
100{
101 GtkWindow window;
102 Panel *priv;
103};
104
105struct _LXPanelClass
106{
107 GtkWindowClass parent_class;
108};
109
2918994e 110extern void panel_apply_icon(GtkWindow *w);
a7bd16a4
AG
111extern void lxpanel_draw_label_text(LXPanel * p, GtkWidget * label, const char * text,
112 gboolean bold, float custom_size_factor,
113 gboolean custom_color);
114extern void lxpanel_image_set_from_file(LXPanel * p, GtkWidget * image, const char * file);
115extern gboolean lxpanel_image_set_icon_theme(LXPanel * p, GtkWidget * image, const gchar * icon);
2918994e 116
117extern int panel_handle_x_error(Display * d, XErrorEvent * ev);
118extern int panel_handle_x_error_swallow_BadWindow_BadDrawable(Display * d, XErrorEvent * ev);
bee4c26e 119
a7bd16a4 120void lxpanel_config_save(LXPanel *p); /* defined in configurator.c */
5d2de79a 121
b31cb1d2 122/* Accessors APIs for Panel* */
a7bd16a4
AG
123extern GtkOrientation panel_get_orientation(LXPanel *panel);
124extern gint panel_get_icon_size(LXPanel *panel);
125extern gint panel_get_height(LXPanel *panel);
126extern Window panel_get_xwindow(LXPanel *panel);
127extern gint panel_get_monitor(LXPanel *panel);
128extern GtkStyle *panel_get_defstyle(LXPanel *panel);
129extern GtkIconTheme *panel_get_icon_theme(LXPanel *panel);
130extern gboolean panel_is_at_bottom(LXPanel *panel);
072944bf 131extern gboolean panel_is_dynamic(LXPanel *panel);
a7bd16a4
AG
132extern GtkWidget *panel_box_new(LXPanel *panel, gboolean homogeneous, gint spacing);
133extern GtkWidget *panel_separator_new(LXPanel *panel);
b31cb1d2 134
a52c2257 135#endif