| 1 |
/** |
| 2 |
* This file is a part of the Cairo-Dock project |
| 3 |
* |
| 4 |
* Copyright : (C) see the 'copyright' file. |
| 5 |
* E-mail : see the 'copyright' file. |
| 6 |
* |
| 7 |
* This program is free software; you can redistribute it and/or |
| 8 |
* modify it under the terms of the GNU General Public License |
| 9 |
* as published by the Free Software Foundation; either version 3 |
| 10 |
* of the License, or (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 General Public License for more details. |
| 16 |
* You should have received a copy of the GNU General Public License |
| 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
*/ |
| 19 |
|
| 20 |
#include "stdlib.h" |
| 21 |
|
| 22 |
#include "cairo-dock-gio-vfs.h" |
| 23 |
|
| 24 |
#include "applet-thunar-vfs.h" |
| 25 |
#include "applet-utils.h" |
| 26 |
#include "applet-init.h" |
| 27 |
|
| 28 |
|
| 29 |
CD_APPLET_DEFINE_BEGIN ("xfce integration", |
| 30 |
1, 6, 2, |
| 31 |
CAIRO_DOCK_CATEGORY_APPLET_SYSTEM, |
| 32 |
"This applet provides functions for a better integration into a XFCE environnement.\n" |
| 33 |
"It is auto-activated, so you don't need to activate it.", |
| 34 |
"Tofe (Christophe Chapuis") |
| 35 |
if (g_iDesktopEnv == CAIRO_DOCK_XFCE) |
| 36 |
{ |
| 37 |
CairoDockDesktopEnvBackend *pVFSBackend = NULL; |
| 38 |
if (cairo_dock_gio_vfs_init ()) |
| 39 |
{ |
| 40 |
pVFSBackend = g_new0 (CairoDockDesktopEnvBackend, 1); |
| 41 |
|
| 42 |
cairo_dock_gio_vfs_fill_backend(pVFSBackend); |
| 43 |
} |
| 44 |
#ifdef HAVE_THUNAR |
| 45 |
else if (init_vfs_backend ()) |
| 46 |
{ |
| 47 |
pVFSBackend = g_new0 (CairoDockDesktopEnvBackend, 1); |
| 48 |
pVFSBackend->get_file_info = vfs_backend_get_file_info; |
| 49 |
pVFSBackend->get_file_properties = vfs_backend_get_file_properties; |
| 50 |
pVFSBackend->list_directory = vfs_backend_list_directory; |
| 51 |
pVFSBackend->launch_uri = vfs_backend_launch_uri; |
| 52 |
pVFSBackend->is_mounted = vfs_backend_is_mounted; |
| 53 |
pVFSBackend->mount = vfs_backend_mount; |
| 54 |
pVFSBackend->unmount = vfs_backend_unmount; |
| 55 |
pVFSBackend->add_monitor = vfs_backend_add_monitor; |
| 56 |
pVFSBackend->remove_monitor = vfs_backend_remove_monitor; |
| 57 |
pVFSBackend->delete_file = vfs_backend_delete_file; |
| 58 |
pVFSBackend->rename = vfs_backend_rename_file; |
| 59 |
pVFSBackend->move = vfs_backend_move_file; |
| 60 |
pVFSBackend->get_trash_path = vfs_backend_get_trash_path; |
| 61 |
pVFSBackend->get_desktop_path = vfs_backend_get_desktop_path; |
| 62 |
} |
| 63 |
#endif |
| 64 |
if(pVFSBackend != NULL) |
| 65 |
{ |
| 66 |
pVFSBackend->logout = env_backend_logout; |
| 67 |
pVFSBackend->shutdown = env_backend_shutdown; |
| 68 |
pVFSBackend->reboot = env_backend_shutdown; |
| 69 |
pVFSBackend->lock_screen = env_backend_lock_screen; |
| 70 |
pVFSBackend->setup_time = env_backend_setup_time; |
| 71 |
pVFSBackend->show_system_monitor = env_backend_show_system_monitor; |
| 72 |
cairo_dock_fm_register_vfs_backend (pVFSBackend); |
| 73 |
} |
| 74 |
} |
| 75 |
else |
| 76 |
return FALSE; |
| 77 |
CD_APPLET_SET_CONTAINER_TYPE (CAIRO_DOCK_MODULE_IS_PLUGIN); |
| 78 |
CD_APPLET_DEFINE_END |