]> Dogcows Code - chaz/tint2/blob - src/launcher/launcher.h
launcher_apps_dir-v2.patch
[chaz/tint2] / src / launcher / launcher.h
1 /**************************************************************************
2 * Copyright (C) 2010 (mrovi@interfete-web-club.com)
3 *
4 *
5 **************************************************************************/
6
7 #ifndef LAUNCHER_H
8 #define LAUNCHER_H
9
10 #include "common.h"
11 #include "area.h"
12 #include "xsettings-client.h"
13
14 typedef struct Launcher {
15 // always start with area
16 Area area;
17 GSList *list_apps; // List of char*, each is a path to a app.desktop file
18 GSList *list_icons; // List of LauncherIcon*
19 GSList *list_themes; // List of IconTheme*
20 } Launcher;
21
22 typedef struct LauncherIcon {
23 // always start with area
24 Area area;
25 Imlib_Image icon_scaled;
26 Imlib_Image icon_original;
27 char *cmd;
28 char *icon_name;
29 char *icon_path;
30 char *icon_tooltip;
31 int icon_size;
32 int is_app_desktop;
33 int x, y;
34 } LauncherIcon;
35
36 typedef struct DesktopEntry {
37 char *name;
38 char *exec;
39 char *icon;
40 } DesktopEntry;
41
42 #define ICON_DIR_TYPE_SCALABLE 0
43 #define ICON_DIR_TYPE_FIXED 1
44 #define ICON_DIR_TYPE_THRESHOLD 2
45 typedef struct IconThemeDir {
46 char *name;
47 int size;
48 int type;
49 int max_size;
50 int min_size;
51 int threshold;
52 char *context;
53 } IconThemeDir;
54
55 typedef struct IconTheme {
56 char *name;
57 GSList *list_inherits; // each item is a char* (theme name)
58 GSList *list_directories; // each item is an IconThemeDir*
59 } IconTheme;
60
61 extern int launcher_enabled;
62 extern int launcher_max_icon_size;
63 extern int launcher_tooltip_enabled;
64 extern int launcher_alpha;
65 extern int launcher_saturation;
66 extern int launcher_brightness;
67 extern char *icon_theme_name; // theme name
68 extern XSettingsClient *xsettings_client;
69
70 // default global data
71 void default_launcher();
72
73 // initialize launcher : y position, precision, ...
74 void init_launcher();
75 void init_launcher_panel(void *panel);
76 void cleanup_launcher();
77 void cleanup_launcher_theme(Launcher *launcher);
78
79 int resize_launcher(void *obj);
80 void draw_launcher (void *obj, cairo_t *c);
81
82 // Populates the list_themes list
83 void launcher_load_themes(Launcher *launcher);
84 // Populates the list_icons list
85 void launcher_load_icons(Launcher *launcher);
86 void launcher_action(LauncherIcon *icon, XEvent* e);
87
88 void test_launcher_read_desktop_file();
89 void test_launcher_read_theme_file();
90
91 #endif
This page took 0.03969 seconds and 4 git commands to generate.