1 /* csm-util.h
2  * Copyright (C) 2008 Lucas Rocha.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser 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
16  * Foundation, Inc., 51 Franklin Street - Suite 500, Boston, MA
17  * 02110-1335, USA.
18  */
19 
20 #ifndef __CSM_UTIL_H__
21 #define __CSM_UTIL_H__
22 
23 #include <glib.h>
24 #include <gtk/gtk.h>
25 
26 G_BEGIN_DECLS
27 
28 #define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
29 
30 char *      csm_util_find_desktop_file_for_app_name (const char *app_name,
31                                                      gboolean    look_in_saved_session,
32                                                      gboolean    autostart_first);
33 
34 gchar      *csm_util_get_empty_tmp_session_dir      (void);
35 
36 const char *csm_util_get_saved_session_dir          (void);
37 
38 gchar**     csm_util_get_app_dirs                   (void);
39 
40 gchar**     csm_util_get_autostart_dirs             (void);
41 void        csm_util_set_autostart_dirs             (char **dirs);
42 
43 gchar **    csm_util_get_desktop_dirs               (gboolean include_saved_session,
44                                                      gboolean autostart_first);
45 
46 const char *csm_util_get_current_desktop            (void);
47 
48 gboolean    csm_util_text_is_blank                  (const char *str);
49 
50 void        csm_util_init_error                     (gboolean    fatal,
51                                                      const char *format, ...);
52 
53 char *      csm_util_generate_startup_id            (void);
54 
55 gboolean    csm_util_export_activation_environment  (GError     **error);
56 
57 gboolean    csm_util_export_user_environment        (GError     **error);
58 
59 void        csm_util_setenv                         (const char *variable,
60                                                      const char *value);
61 
62 GtkIconSize csm_util_get_computer_fail_icon_size    (void);
63 
64 G_END_DECLS
65 
66 #endif /* __CSM_UTIL_H__ */
67