1 | #ifndef PANEL_UTIL_H |
---|
2 | #define PANEL_UTIL_H |
---|
3 | |
---|
4 | #include <gnome.h> |
---|
5 | |
---|
6 | BEGIN_GNOME_DECLS |
---|
7 | |
---|
8 | typedef void (*UpdateFunction) (gpointer); |
---|
9 | |
---|
10 | gboolean string_is_in_list (const GSList *list, |
---|
11 | const char *text); |
---|
12 | |
---|
13 | /* return TRUE if string is NULL or the first character is '\0' */ |
---|
14 | gboolean string_empty (const char *string); |
---|
15 | #define sure_string(s) ((s)!=NULL?(s):"") |
---|
16 | |
---|
17 | GtkWidget * create_text_entry (GtkWidget *table, |
---|
18 | const char *history_id, |
---|
19 | int row, |
---|
20 | const char *label, |
---|
21 | const char *text, |
---|
22 | UpdateFunction func, |
---|
23 | gpointer data); |
---|
24 | GtkWidget * create_icon_entry (GtkWidget *table, |
---|
25 | const char *history_id, |
---|
26 | int cols, |
---|
27 | int cole, |
---|
28 | const char *label, |
---|
29 | const char *subdir, |
---|
30 | const char *text, |
---|
31 | UpdateFunction func, |
---|
32 | gpointer data); |
---|
33 | |
---|
34 | void panel_show_help (const char *path); |
---|
35 | |
---|
36 | GList * my_g_list_swap_next (GList *list, |
---|
37 | GList *dl); |
---|
38 | GList * my_g_list_swap_prev (GList *list, |
---|
39 | GList *dl); |
---|
40 | /*maybe this should be a glib function? |
---|
41 | it resorts a single item in the list*/ |
---|
42 | GList * my_g_list_resort_item (GList *list, |
---|
43 | gpointer data, |
---|
44 | GCompareFunc func); |
---|
45 | |
---|
46 | void set_frame_colors (PanelWidget *panel, |
---|
47 | GtkWidget *frame, |
---|
48 | GtkWidget *but1, |
---|
49 | GtkWidget *but2, |
---|
50 | GtkWidget *but3, |
---|
51 | GtkWidget *but4); |
---|
52 | |
---|
53 | /* recursively remove directory, if just_clean is true, then |
---|
54 | the directory itself is also removed, otherwise just it's |
---|
55 | contents, it does not give any error output and will fail |
---|
56 | silently, but it will remove as much as possible */ |
---|
57 | void remove_directory (const char *dirname, |
---|
58 | gboolean just_clean); |
---|
59 | |
---|
60 | /* like strtok, but unescapes string as well and escaped separators |
---|
61 | don't count. if empty is true, don't skip empty parts */ |
---|
62 | char * strtok_with_escape (char *string, |
---|
63 | const char *seps, |
---|
64 | gboolean empty); |
---|
65 | /* return a newly allocated string that escapes / and 'special' */ |
---|
66 | char * escape_string (const char *string, |
---|
67 | const char *special); |
---|
68 | |
---|
69 | gboolean convert_string_to_keysym_state (const char *string, |
---|
70 | guint *keysym, |
---|
71 | guint *state); |
---|
72 | char * convert_keysym_state_to_string (guint keysym, |
---|
73 | guint state); |
---|
74 | |
---|
75 | void panel_set_dialog_layer (GtkWidget *dialog); |
---|
76 | void panel_reset_dialog_layers (void); |
---|
77 | GtkWidget * panel_error_dialog (const char *format, ...) G_GNUC_PRINTF (1, 2); |
---|
78 | |
---|
79 | gboolean is_ext (const char *file, |
---|
80 | const char *ext); |
---|
81 | int strcasecmp_no_locale (const char *s1, |
---|
82 | const char *s2); |
---|
83 | |
---|
84 | /* stolen from gnome-libs head as they are faster and don't use "stat" */ |
---|
85 | gboolean panel_file_exists (const char *filename); |
---|
86 | char * panel_is_program_in_path (const char *program); |
---|
87 | |
---|
88 | int find_applet (GtkWidget *widget); |
---|
89 | |
---|
90 | int get_requisition_width (GtkWidget *widget); |
---|
91 | int get_requisition_height (GtkWidget *widget); |
---|
92 | |
---|
93 | char * panel_gnome_kde_help_path (const char *docpath); |
---|
94 | |
---|
95 | gboolean panel_is_url (const char *url); |
---|
96 | |
---|
97 | END_GNOME_DECLS |
---|
98 | |
---|
99 | #endif /* PANEL_UTIL_H */ |
---|