Add support for monitors "All" to span panel over all monitors.
[lxde/lxpanel.git] / src / panel.h.in
1 /**
2 * Copyright (c) 2006-2014 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__ 1
21
22 #include <X11/Xlib.h>
23 #include <gtk/gtk.h>
24
25 G_BEGIN_DECLS
26
27 #define LXPANEL_CHECK_VERSION(_a,_b,_c) \
28 (@VERSION_MAJOR@ > _a || \
29 (@VERSION_MAJOR@ == _a && @VERSION_MINOR@ > _b) || \
30 (@VERSION_MAJOR@ == _a && @VERSION_MINOR@ == _b && @VERSION_MICRO@ >= _c))
31
32
33 #define LX_TYPE_PANEL (lxpanel_get_type())
34 #define LXPANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
35 LX_TYPE_PANEL, LXPanel))
36 #define LXPANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
37 LX_TYPE_PANEL, LXPanelClass))
38 #define LX_IS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
39 LX_TYPE_PANEL))
40
41 extern GType lxpanel_get_type (void) G_GNUC_CONST;
42
43 /* A little trick to be compatible with some themes which rely on the
44 PanelToplevel class, so we use LXPanel as alias for PanelToplevel */
45 typedef struct _LXPanel LXPanel;
46 typedef struct _LXPanel PanelToplevel;
47 typedef struct _LXPanelClass PanelToplevelClass;
48
49 typedef struct _Panel Panel;
50
51 struct _LXPanel
52 {
53 GtkWindow window;
54 Panel *priv;
55 };
56
57 struct _LXPanelClass
58 {
59 GtkWindowClass parent_class;
60 };
61
62 /**
63 * panel_apply_icon
64 * @w: a window to apply
65 *
66 * Sets appropriate icon as the window icon for @w.
67 */
68 extern void panel_apply_icon(GtkWindow *w);
69
70 /**
71 * lxpanel_draw_label_text
72 * @p: a panel instance
73 * @label: a label widget
74 * @text: (allow-none): text for the label
75 * @bold: %TRUE if text should be bold
76 * @custom_size_factor: scale factor for font size
77 * @custom_color: %TRUE to use font color from panel settings
78 *
79 * Changes @label to contain @text with appropriate attributes using the
80 * panel @p settings.
81 */
82 extern void lxpanel_draw_label_text(LXPanel * p, GtkWidget * label, const char * text,
83 gboolean bold, float custom_size_factor,
84 gboolean custom_color);
85
86 /**
87 * lxpanel_image_set_from_file
88 * @p: a panel instance
89 * @image: a #GtkImage widget
90 * @file: image file path
91 *
92 * Applies icon from @file to @image in accordance with icon size setting
93 * on panel @p.
94 */
95 extern void lxpanel_image_set_from_file(LXPanel * p, GtkWidget * image, const char * file);
96
97 /**
98 * lxpanel_image_set_icon_theme
99 * @p: a panel instance
100 * @image: a #GtkImage widget
101 * @icon: icon name
102 *
103 * Applies icon size and theme from settings of @p to @image using @icon
104 * name to select icon.
105 */
106 extern gboolean lxpanel_image_set_icon_theme(LXPanel * p, GtkWidget * image, const gchar * icon);
107
108 /**
109 * lxpanel_config_save
110 * @p: a panel instance
111 *
112 * Immediately saves current configuration for panel @p.
113 */
114 void lxpanel_config_save(LXPanel *p); /* defined in configurator.c */
115
116 /* Accessors APIs for Panel* */
117 extern GtkOrientation panel_get_orientation(LXPanel *panel);
118 extern gint panel_get_icon_size(LXPanel *panel);
119 extern gint panel_get_height(LXPanel *panel);
120 extern Window panel_get_xwindow(LXPanel *panel);
121 extern gint panel_get_monitor(LXPanel *panel);
122 extern GtkStyle *panel_get_defstyle(LXPanel *panel);
123 extern GtkIconTheme *panel_get_icon_theme(LXPanel *panel);
124 extern gboolean panel_is_at_bottom(LXPanel *panel);
125 extern gboolean panel_is_dynamic(LXPanel *panel);
126 extern GtkWidget *panel_box_new(LXPanel *panel, gboolean homogeneous, gint spacing);
127 extern GtkWidget *panel_separator_new(LXPanel *panel);
128
129 G_END_DECLS
130
131 #endif