1 /*
2  *  xfdesktop - xfce4's desktop manager
3  *
4  *  Copyright (c) 2004 Brian Tarricone, <bjt23@cornell.edu>
5  *  Copyright (c) 2010 Jannis Pohlmann, <jannis@xfce.org>
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU Library General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software Foundation,
19  *  Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
20  *
21  *  Random portions taken from or inspired by the original xfdesktop for xfce4:
22  *     Copyright (C) 2002-2003 Jasper Huijsmans (huysmans@users.sourceforge.net)
23  *     Copyright (C) 2003 Benedikt Meurer <benedikt.meurer@unix-ag.uni-siegen.de>
24  */
25 
26 #ifndef _XFDESKTOP_COMMON_H_
27 #define _XFDESKTOP_COMMON_H_
28 
29 #include <glib.h>
30 #include <gdk/gdk.h>
31 #include <gtk/gtk.h>
32 
33 #include <X11/Xlib.h>
34 
35 #include <stdarg.h>
36 
37 #define XFDESKTOP_CHANNEL        "xfce4-desktop"
38 #define DEFAULT_BACKDROP         DATADIR "/backgrounds/xfce/xfce-verticals.png"
39 #define DEFAULT_ICON_FONT_SIZE   12
40 #define DEFAULT_ICON_SIZE        48
41 #define ITHEME_FLAGS             (GTK_ICON_LOOKUP_USE_BUILTIN)
42 
43 #define LIST_TEXT                "# xfce backdrop list"
44 #define XFDESKTOP_SELECTION_FMT  "XFDESKTOP_SELECTION_%d"
45 #define XFDESKTOP_IMAGE_FILE_FMT "XFDESKTOP_IMAGE_FILE_%d"
46 #define XFDESKTOP_RC_VERSION_STAMP "xfdesktop-version-4.10.3+-rcfile_format"
47 
48 #define RELOAD_MESSAGE     "reload"
49 #define MENU_MESSAGE       "menu"
50 #define WINDOWLIST_MESSAGE "windowlist"
51 #define ARRANGE_MESSAGE    "arrange"
52 #define QUIT_MESSAGE       "quit"
53 
54 #define SINGLE_WORKSPACE_MODE     "/backdrop/single-workspace-mode"
55 #define SINGLE_WORKSPACE_NUMBER   "/backdrop/single-workspace-number"
56 
57 #define DESKTOP_ICONS_SHOW_THUMBNAILS        "/desktop-icons/show-thumbnails"
58 #define DESKTOP_ICONS_SHOW_HIDDEN_FILES      "/desktop-icons/show-hidden-files"
59 #define DESKTOP_ICONS_SHOW_NETWORK_REMOVABLE "/desktop-icons/file-icons/show-network-removable"
60 #define DESKTOP_ICONS_SHOW_DEVICE_REMOVABLE  "/desktop-icons/file-icons/show-device-removable"
61 #define DESKTOP_ICONS_SHOW_UNKNWON_REMOVABLE "/desktop-icons/file-icons/show-unknown-removable"
62 #define DESKTOP_ICONS_SHOW_HOME              "/desktop-icons/file-icons/show-home"
63 #define DESKTOP_ICONS_SHOW_TRASH             "/desktop-icons/file-icons/show-trash"
64 #define DESKTOP_ICONS_SHOW_FILESYSTEM        "/desktop-icons/file-icons/show-filesystem"
65 #define DESKTOP_ICONS_SHOW_REMOVABLE         "/desktop-icons/file-icons/show-removable"
66 
67 #define DESKTOP_MENU_MAX_TEMPLATE_FILES     "/desktop-menu/max-template-files"
68 
69 /**
70  * File information namespaces queried for #GFileInfo objects.
71  */
72 #define XFDESKTOP_FILE_INFO_NAMESPACE \
73   "access::*," \
74   "id::*," \
75   "mountable::*," \
76   "preview::*," \
77   "standard::*," \
78   "time::*," \
79   "thumbnail::*," \
80   "trash::*," \
81   "unix::*," \
82   "metadata::*"
83 
84 /**
85  * Filesystem information namespaces queried for #GFileInfo * objects.
86  */
87 #define XFDESKTOP_FILESYSTEM_INFO_NAMESPACE \
88   "filesystem::*"
89 
90 G_BEGIN_DECLS
91 
92 gchar* xfdesktop_get_monitor_name_from_gtk_widget(GtkWidget *widget,
93                                                   gint monitor_num);
94 
95 gint xfdesktop_compare_paths(GFile *a, GFile *b);
96 
97 gboolean xfdesktop_image_file_is_valid(const gchar *filename);
98 
99 gchar *xfdesktop_get_file_mimetype(const gchar *file);
100 
101 gint xfce_translate_image_styles(gint input);
102 
103 gchar* xfdesktop_remove_whitspaces(gchar* str);
104 
105 GtkWidget* xfdesktop_menu_create_menu_item_with_markup(const gchar *name,
106                                                        GtkWidget   *image);
107 
108 GtkWidget* xfdesktop_menu_create_menu_item_with_mnemonic(const gchar *name,
109                                                          GtkWidget   *image);
110 
111 void xfdesktop_get_screen_dimensions(GdkScreen *gcreen,
112                                      gint      *width,
113                                      gint      *height);
114 
115 #if defined(G_HAVE_ISO_VARARGS)
116 
117 #define XF_DEBUG(...) xfdesktop_debug (__func__, __FILE__, __LINE__, __VA_ARGS__)
118 
119 void xfdesktop_debug(const char *func, const char *file, int line, const char *format, ...) __attribute__((format (printf,4,5)));
120 
121 #else /* defined(G_HAVE_ISO_VARARGS) */
122 
123 #define XF_DEBUG(...)
124 
125 #endif /* defined(G_HAVE_ISO_VARARGS) */
126 
127 void xfdesktop_debug_set(gboolean debug);
128 
129 G_END_DECLS
130 
131 #endif
132