Add .PHONY for phony target in src/Makefile
[lxde/lxpanel.git] / src / panel.h.in
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
04544a53
AG
27/**
28 * LXPANEL_CHECK_VERSION
29 *
30 * A simple macro for plugins to check features.
31 *
32 * Since: 0.8.0
33 */
98c7671a
AG
34#define LXPANEL_CHECK_VERSION(_a,_b,_c) \
35 (@VERSION_MAJOR@ > _a || \
36 (@VERSION_MAJOR@ == _a && @VERSION_MINOR@ > _b) || \
37 (@VERSION_MAJOR@ == _a && @VERSION_MINOR@ == _b && @VERSION_MICRO@ >= _c))
38
39
a7bd16a4
AG
40#define LX_TYPE_PANEL (lxpanel_get_type())
41#define LXPANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
42 LX_TYPE_PANEL, LXPanel))
43#define LXPANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
44 LX_TYPE_PANEL, LXPanelClass))
45#define LX_IS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
46 LX_TYPE_PANEL))
47
48extern GType lxpanel_get_type (void) G_GNUC_CONST;
49
50/* A little trick to be compatible with some themes which rely on the
51 PanelToplevel class, so we use LXPanel as alias for PanelToplevel */
52typedef struct _LXPanel LXPanel;
53typedef struct _LXPanel PanelToplevel;
54typedef struct _LXPanelClass PanelToplevelClass;
55
b31cb1d2 56typedef struct _Panel Panel;
a52c2257 57
a7bd16a4
AG
58struct _LXPanel
59{
60 GtkWindow window;
61 Panel *priv;
62};
63
edd6656c
AG
64/**
65 * LXPanelClass:
66 * @parent_class: The parent class.
67 * @icon_size_changed: callback for "icon-size-changed" signal, emitted when
68 * icons size for panel is changed in the configuration dialog.
69 * @panel_font_changed: callback for "panel-font-changed" signal, emitted when
70 * custom font enabled, disabled or its metrics or color changed
71 * in the panel configuration dialog.
72 */
a7bd16a4
AG
73struct _LXPanelClass
74{
75 GtkWindowClass parent_class;
bf7645fc 76 void (*icon_size_changed)(LXPanel *panel);
176125ed 77 void (*panel_font_changed)(LXPanel *panel);
a7bd16a4
AG
78};
79
ef274a49
AG
80/**
81 * panel_apply_icon
82 * @w: a window to apply
83 *
84 * Sets appropriate icon as the window icon for @w.
85 */
2918994e 86extern void panel_apply_icon(GtkWindow *w);
ef274a49
AG
87
88/**
89 * lxpanel_draw_label_text
90 * @p: a panel instance
91 * @label: a label widget
92 * @text: (allow-none): text for the label
93 * @bold: %TRUE if text should be bold
94 * @custom_size_factor: scale factor for font size
95 * @custom_color: %TRUE to use font color from panel settings
96 *
97 * Changes @label to contain @text with appropriate attributes using the
98 * panel @p settings.
99 */
a7bd16a4
AG
100extern void lxpanel_draw_label_text(LXPanel * p, GtkWidget * label, const char * text,
101 gboolean bold, float custom_size_factor,
102 gboolean custom_color);
ef274a49
AG
103
104/**
ef274a49
AG
105 * lxpanel_config_save
106 * @p: a panel instance
107 *
108 * Immediately saves current configuration for panel @p.
109 */
a7bd16a4 110void lxpanel_config_save(LXPanel *p); /* defined in configurator.c */
5d2de79a 111
b31cb1d2 112/* Accessors APIs for Panel* */
a7bd16a4
AG
113extern GtkOrientation panel_get_orientation(LXPanel *panel);
114extern gint panel_get_icon_size(LXPanel *panel);
115extern gint panel_get_height(LXPanel *panel);
116extern Window panel_get_xwindow(LXPanel *panel);
117extern gint panel_get_monitor(LXPanel *panel);
118extern GtkStyle *panel_get_defstyle(LXPanel *panel);
119extern GtkIconTheme *panel_get_icon_theme(LXPanel *panel);
120extern gboolean panel_is_at_bottom(LXPanel *panel);
072944bf 121extern gboolean panel_is_dynamic(LXPanel *panel);
a7bd16a4
AG
122extern GtkWidget *panel_box_new(LXPanel *panel, gboolean homogeneous, gint spacing);
123extern GtkWidget *panel_separator_new(LXPanel *panel);
b31cb1d2 124
de7ff173
AG
125G_END_DECLS
126
a52c2257 127#endif