Initial import.
[lxde/lxpanel.git] / src / misc.h
1 #ifndef MISC_H
2 #define MISC_H
3
4 #include <X11/Xatom.h>
5 #include <gtk/gtk.h>
6 #include <gdk/gdk.h>
7 #include <gdk/gdkx.h>
8 #include <stdio.h>
9
10 #include "panel.h"
11
12 enum { LINE_NONE, LINE_BLOCK_START, LINE_BLOCK_END, LINE_VAR };
13
14 typedef struct {
15 int num, len, type;
16 gchar str[256];
17 gchar *t[3];
18 } line;
19
20
21 typedef struct {
22 int num;
23 gchar *str;
24 } pair;
25
26 extern pair allign_pair[];
27 extern pair edge_pair[];
28 extern pair width_pair[];
29 extern pair height_pair[];
30 extern pair bool_pair[];
31 extern pair pos_pair[];
32
33 int str2num(pair *p, gchar *str, int defval);
34 gchar *num2str(pair *p, int num, gchar *defval);
35 extern int get_line(FILE *fp, line *s);
36 int get_line_as_is(FILE *fp, line *s);
37
38 void Xclimsg(Window win, long type, long l0, long l1, long l2, long l3, long l4);
39 void Xclimsgwm(Window win, Atom type, Atom arg);
40 void *get_xaproperty (Window win, Atom prop, Atom type, int *nitems);
41 char *get_textproperty(Window win, Atom prop);
42 void *get_utf8_property(Window win, Atom atom);
43 char **get_utf8_property_list(Window win, Atom atom, int *count);
44
45 void resolve_atoms();
46 //Window Select_Window(Display *dpy);
47 int get_net_number_of_desktops();
48 int get_net_current_desktop ();
49 int get_net_wm_desktop(Window win);
50 int get_wm_state (Window win);
51 void get_net_wm_state(Window win, net_wm_state *nws);
52 void get_net_wm_window_type(Window win, net_wm_window_type *nwwt);
53
54 void calculate_position(panel *np);
55 gchar *expand_tilda(gchar *file);
56 GdkPixbuf *gdk_pixbuf_scale_ratio(GdkPixbuf *p, int width, int height, GdkInterpType itype,
57 gboolean keep_ratio);
58 GtkWidget *gtk_image_new_from_file_scaled(const gchar *file, gint width, gint height,
59 gboolean keep_ratio);
60 void get_button_spacing(GtkRequisition *req, GtkContainer *parent, gchar *name);
61 guint32 gcolor2rgb24(GdkColor *color);
62 GtkWidget *fb_button_new_from_file(gchar *fname, int width, int height, gulong hicolor,
63 gboolean keep_ratio);
64 GtkWidget *fb_button_new_from_file_with_label(gchar *fname, int width, int height,
65 gulong hicolor, gboolean keep_ratio, gchar *label);
66 #endif