Automatic translation update from Pootle
[lxde/lxpanel.git] / src / panel.h.in
CommitLineData
7d17da4d
AG
1/*
2 * Copyright (C) 2006-2010 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
3 * 2006-2008 Jim Huang <jserv.tw@gmail.com>
4 * 2008 Fred Chien <fred@lxde.org>
5 * 2009-2010 Marty Jack <martyj19@comcast.net>
6 * 2010 Lajos Kamocsay <lajos@panka.com>
7 * 2012 Piotr Sipika <Piotr.Sipika@gmail.com>
8 * 2012 Michael Rawson <michaelrawson76@gmail.com>
9 * 2013 Henry Gebhardt <hsggebhardt@gmail.com>
10 * 2013 Rouslan <rouslan-k@users.sourceforge.net>
11 * 2014 Andriy Grytsenko <andrej@rep.kiev.ua>
97f3cbb4 12 * 2018 Mamoru TASAKA <mtasaka@fedoraproject.org>
a99ee9e1
JH
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software Foundation,
26 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 */
28
de7ff173
AG
29#ifndef __PANEL_H__
30#define __PANEL_H__ 1
a52c2257 31
a52c2257
HJYP
32#include <X11/Xlib.h>
33#include <gtk/gtk.h>
a52c2257 34
de7ff173
AG
35G_BEGIN_DECLS
36
04544a53
AG
37/**
38 * LXPANEL_CHECK_VERSION
39 *
40 * A simple macro for plugins to check features.
41 *
42 * Since: 0.8.0
43 */
98c7671a
AG
44#define LXPANEL_CHECK_VERSION(_a,_b,_c) \
45 (@VERSION_MAJOR@ > _a || \
46 (@VERSION_MAJOR@ == _a && @VERSION_MINOR@ > _b) || \
47 (@VERSION_MAJOR@ == _a && @VERSION_MINOR@ == _b && @VERSION_MICRO@ >= _c))
48
49
a7bd16a4
AG
50#define LX_TYPE_PANEL (lxpanel_get_type())
51#define LXPANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
52 LX_TYPE_PANEL, LXPanel))
53#define LXPANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
54 LX_TYPE_PANEL, LXPanelClass))
55#define LX_IS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
56 LX_TYPE_PANEL))
57
58extern GType lxpanel_get_type (void) G_GNUC_CONST;
59
60/* A little trick to be compatible with some themes which rely on the
61 PanelToplevel class, so we use LXPanel as alias for PanelToplevel */
62typedef struct _LXPanel LXPanel;
63typedef struct _LXPanel PanelToplevel;
64typedef struct _LXPanelClass PanelToplevelClass;
65
b31cb1d2 66typedef struct _Panel Panel;
a52c2257 67
a7bd16a4
AG
68struct _LXPanel
69{
70 GtkWindow window;
71 Panel *priv;
72};
73
edd6656c
AG
74/**
75 * LXPanelClass:
76 * @parent_class: The parent class.
77 * @icon_size_changed: callback for "icon-size-changed" signal, emitted when
78 * icons size for panel is changed in the configuration dialog.
79 * @panel_font_changed: callback for "panel-font-changed" signal, emitted when
80 * custom font enabled, disabled or its metrics or color changed
81 * in the panel configuration dialog.
82 */
a7bd16a4
AG
83struct _LXPanelClass
84{
85 GtkWindowClass parent_class;
bf7645fc 86 void (*icon_size_changed)(LXPanel *panel);
176125ed 87 void (*panel_font_changed)(LXPanel *panel);
a7bd16a4
AG
88};
89
ef274a49
AG
90/**
91 * panel_apply_icon
92 * @w: a window to apply
93 *
94 * Sets appropriate icon as the window icon for @w.
95 */
2918994e 96extern void panel_apply_icon(GtkWindow *w);
ef274a49
AG
97
98/**
99 * lxpanel_draw_label_text
100 * @p: a panel instance
101 * @label: a label widget
102 * @text: (allow-none): text for the label
103 * @bold: %TRUE if text should be bold
104 * @custom_size_factor: scale factor for font size
105 * @custom_color: %TRUE to use font color from panel settings
106 *
107 * Changes @label to contain @text with appropriate attributes using the
108 * panel @p settings.
109 */
a7bd16a4
AG
110extern void lxpanel_draw_label_text(LXPanel * p, GtkWidget * label, const char * text,
111 gboolean bold, float custom_size_factor,
112 gboolean custom_color);
ef274a49
AG
113
114/**
590d3173
F
115 * lxpanel_draw_label_text_with_color
116 * @p: a panel instance
117 * @label: a label widget
118 * @text: (allow-none): text for the label
119 * @bold: %TRUE if text should be bold
120 * @custom_size_factor: scale factor for font size
121 * @color: GdkColor for drawing text
122 *
123 * Changes @label to contain @text with appropriate attributes using the
124 * panel @p settings.
125 */
126extern void lxpanel_draw_label_text_with_color(LXPanel * p, GtkWidget * label, const char * text,
127 gboolean bold, float custom_size_factor,
128 GdkColor *color);
129
130/**
ef274a49
AG
131 * lxpanel_config_save
132 * @p: a panel instance
133 *
134 * Immediately saves current configuration for panel @p.
135 */
a7bd16a4 136void lxpanel_config_save(LXPanel *p); /* defined in configurator.c */
5d2de79a 137
b31cb1d2 138/* Accessors APIs for Panel* */
a7bd16a4
AG
139extern GtkOrientation panel_get_orientation(LXPanel *panel);
140extern gint panel_get_icon_size(LXPanel *panel);
141extern gint panel_get_height(LXPanel *panel);
142extern Window panel_get_xwindow(LXPanel *panel);
143extern gint panel_get_monitor(LXPanel *panel);
144extern GtkStyle *panel_get_defstyle(LXPanel *panel);
145extern GtkIconTheme *panel_get_icon_theme(LXPanel *panel);
146extern gboolean panel_is_at_bottom(LXPanel *panel);
072944bf 147extern gboolean panel_is_dynamic(LXPanel *panel);
a7bd16a4
AG
148extern GtkWidget *panel_box_new(LXPanel *panel, gboolean homogeneous, gint spacing);
149extern GtkWidget *panel_separator_new(LXPanel *panel);
b31cb1d2 150
de7ff173
AG
151G_END_DECLS
152
a52c2257 153#endif