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