aabb3ab46a37f69b867cfe44a3aacb0ee4c6547e
[cl-launcher] / src / cl-utils.h
1 /*
2  *  Camera Launcher for Maemo.
3  *  Copyright (C) 2009 Roman Moravcik
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20 #ifndef CL_UTILS_H
21 #define CL_UTILS_H
22
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30
31 #include <glib.h>
32 #include <glib/gi18n-lib.h>
33
34 #include <gtk/gtk.h>
35 #include <hildon/hildon.h>
36
37 #define GCONF_CL_LAUNCHER "/apps/maemo/cl-launcher"
38 #define CL_LAUNCHER_DESKTOP_DATADIR "/usr/share/applications/cl-launcher"
39
40 typedef enum {
41         CL_LAUNCHER_ACTION_DO_NOTHING = 0,
42         CL_LAUNCHER_ACTION_RUN_PREFERED_APPLICATION,
43         CL_LAUNCHER_ACTION_SHOW_SELECTOR_POPUP
44 } CLLauncherAction;
45
46 enum {
47         SELECTOR_COLUMN_ICON = 0,
48         SELECTOR_COLUMN_NAME,
49         SELECTOR_COLUMN_OSSO_SERVICE,
50         SELECTOR_COLUMN_EXEC,
51         NUM_COLS
52 };
53
54 typedef struct {
55         gchar *icon;
56         gchar *name;
57         gchar *osso_service;
58         gchar *exec;
59 } DesktopFileInfo;
60
61 gboolean get_application_list (GtkListStore *list);
62
63 DesktopFileInfo *get_desktop_file_info (const gchar *desktop_file);
64
65 #endif /* CL_UTILS_H */