Second click on weather plugin icon should hide conditions dialog if it's shown.
[lxde/lxpanel.git] / src / misc.h
1 /**
2 * Copyright (c) 2006 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 MISC_H
20 #define MISC_H
21
22 #include <X11/Xatom.h>
23 #include <gtk/gtk.h>
24 #include <gdk/gdk.h>
25 #include <gdk/gdkx.h>
26 #include <stdio.h>
27 #include <libfm/fm.h>
28
29 #include "panel.h"
30
31 /* Decoded value of WM_STATE property. */
32 typedef struct {
33 unsigned int modal : 1;
34 unsigned int sticky : 1;
35 unsigned int maximized_vert : 1;
36 unsigned int maximized_horz : 1;
37 unsigned int shaded : 1;
38 unsigned int skip_taskbar : 1;
39 unsigned int skip_pager : 1;
40 unsigned int hidden : 1;
41 unsigned int fullscreen : 1;
42 unsigned int above : 1;
43 unsigned int below : 1;
44 } NetWMState;
45
46 /* Decoded value of _NET_WM_WINDOW_TYPE property. */
47 typedef struct {
48 unsigned int desktop : 1;
49 unsigned int dock : 1;
50 unsigned int toolbar : 1;
51 unsigned int menu : 1;
52 unsigned int utility : 1;
53 unsigned int splash : 1;
54 unsigned int dialog : 1;
55 unsigned int normal : 1;
56 } NetWMWindowType;
57
58 void Xclimsg(Window win, Atom type, long l0, long l1, long l2, long l3, long l4);
59 void Xclimsgwm(Window win, Atom type, Atom arg);
60 void *get_xaproperty (Window win, Atom prop, Atom type, int *nitems);
61 char *get_textproperty(Window win, Atom prop);
62 void *get_utf8_property(Window win, Atom atom);
63 char **get_utf8_property_list(Window win, Atom atom, int *count);
64
65 void resolve_atoms();
66 //Window Select_Window(Display *dpy);
67 int get_net_number_of_desktops();
68 int get_net_current_desktop ();
69 int get_net_wm_desktop(Window win);
70 int get_wm_state (Window win);
71 void get_net_wm_state(Window win, NetWMState *nws);
72 void get_net_wm_window_type(Window win, NetWMWindowType *nwwt);
73 GPid get_net_wm_pid(Window win);
74
75 gchar *expand_tilda(const gchar *file);
76
77 void get_button_spacing(GtkRequisition *req, GtkContainer *parent, gchar *name);
78 guint32 gcolor2rgb24(GdkColor *color);
79 GtkWidget *lxpanel_button_new_for_icon(LXPanel *panel, const gchar *name, GdkColor *color, const gchar *label);
80 GtkWidget *lxpanel_button_new_for_fm_icon(LXPanel *panel, FmIcon *icon, GdkColor *color, const gchar *label);
81 void lxpanel_button_set_icon(GtkWidget* btn, const gchar *name, gint size);
82 void lxpanel_button_update_icon(GtkWidget* btn, FmIcon *icon, gint size);
83
84 typedef enum {
85 CONF_TYPE_STR,
86 CONF_TYPE_INT,
87 CONF_TYPE_BOOL,
88 CONF_TYPE_FILE,
89 CONF_TYPE_FILE_ENTRY,
90 CONF_TYPE_DIRECTORY_ENTRY,
91 CONF_TYPE_TRIM
92 } PluginConfType;
93
94 /* Parameters: const char* name, gpointer ret_value, PluginConfType type, ....NULL */
95 extern GtkWidget *lxpanel_generic_config_dlg(const char *title, LXPanel *panel,
96 GSourceFunc apply_func,
97 GtkWidget *plugin,
98 const char *name, ...);
99
100 #endif