Update copyrights everywhere.
[lxde/lxpanel.git] / src / misc.h
CommitLineData
5d344669 1/**
b840f7cc 2 * Copyright (c) 2006-2014 LxDE Developers, see the file AUTHORS for details.
5d344669
AL
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
a52c2257
HJYP
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>
911d5489 27#include <libfm/fm.h>
a52c2257
HJYP
28
29#include "panel.h"
a52c2257 30
b31cb1d2 31/* Decoded value of WM_STATE property. */
a52c2257 32typedef struct {
b31cb1d2
AG
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. */
a52c2257 47typedef struct {
b31cb1d2
AG
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;
a52c2257 57
2918994e 58void Xclimsg(Window win, Atom type, long l0, long l1, long l2, long l3, long l4);
a52c2257
HJYP
59void Xclimsgwm(Window win, Atom type, Atom arg);
60void *get_xaproperty (Window win, Atom prop, Atom type, int *nitems);
61char *get_textproperty(Window win, Atom prop);
62void *get_utf8_property(Window win, Atom atom);
63char **get_utf8_property_list(Window win, Atom atom, int *count);
64
65void resolve_atoms();
66//Window Select_Window(Display *dpy);
67int get_net_number_of_desktops();
68int get_net_current_desktop ();
69int get_net_wm_desktop(Window win);
70int get_wm_state (Window win);
22242ed4
HJYP
71void get_net_wm_state(Window win, NetWMState *nws);
72void get_net_wm_window_type(Window win, NetWMWindowType *nwwt);
73GPid get_net_wm_pid(Window win);
a52c2257 74
b8c2e0be 75gchar *expand_tilda(const gchar *file);
2918994e 76
a52c2257
HJYP
77void get_button_spacing(GtkRequisition *req, GtkContainer *parent, gchar *name);
78guint32 gcolor2rgb24(GdkColor *color);
a7bd16a4
AG
79GtkWidget *lxpanel_button_new_for_icon(LXPanel *panel, const gchar *name, GdkColor *color, const gchar *label);
80GtkWidget *lxpanel_button_new_for_fm_icon(LXPanel *panel, FmIcon *icon, GdkColor *color, const gchar *label);
c8e5ebb2 81void lxpanel_button_set_icon(GtkWidget* btn, const gchar *name, gint size);
7969be34 82void lxpanel_button_update_icon(GtkWidget* btn, FmIcon *icon, gint size);
08ea5341 83
d79161b7
AG
84typedef 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 */
a7bd16a4 95extern GtkWidget *lxpanel_generic_config_dlg(const char *title, LXPanel *panel,
4ab8027b
AG
96 GSourceFunc apply_func,
97 GtkWidget *plugin,
98 const char *name, ...);
5a343ad5 99
a52c2257 100#endif