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 #ifndef __CAIRO_DOCK_GUI_SWITCH__ 21 #define __CAIRO_DOCK_GUI_SWITCH__ 22 23 #include <gtk/gtk.h> 24 G_BEGIN_DECLS 25 26 // Definition of the main GUI interface. 27 struct _CairoDockMainGuiBackend { 28 // Show the main config panel, build it if necessary. 29 GtkWidget * (*show_main_gui) (void); 30 // Show the config panel of a given module (internal or external), reload it if it was already opened. 31 GtkWidget * (*show_module_gui) (const gchar *cModuleName); 32 // close the config panels. 33 void (*close_gui) (void); 34 // update the GUI to mark a module as '(in)active'. 35 void (*update_module_state) (const gchar *cModuleName, gboolean bActive); 36 void (*update_module_instance_container) (GldiModuleInstance *pInstance, gboolean bDetached); 37 void (*update_desklet_params) (CairoDesklet *pDesklet); 38 void (*update_desklet_visibility_params) (CairoDesklet *pDesklet); 39 void (*update_modules_list) (void); 40 void (*update_shortkeys) (void); 41 // Show the config panel on a given icon/container, build or reload it if necessary. 42 GtkWidget * (*show_gui) (Icon *pIcon, GldiContainer *pContainer, GldiModuleInstance *pModuleInstance, int iShowPage); 43 // reload the gui and its content, for the case a launcher has changed (image, order, new container, etc). 44 void (*reload_items) (void); 45 // reload everything, in case the current theme has changed 46 void (*reload) (void); 47 // show the themes, in case it should be presented in the menu. 48 GtkWidget * (*show_themes) (void); 49 // show the applets. 50 GtkWidget * (*show_addons) (void); 51 const gchar *cDisplayedName; 52 const gchar *cTooltip; 53 } ; 54 typedef struct _CairoDockMainGuiBackend CairoDockMainGuiBackend; 55 56 57 void cairo_dock_load_user_gui_backend (int iMode); 58 59 int cairo_dock_gui_backend_get_mode (); 60 61 GtkWidget *cairo_dock_make_switch_gui_button (void); 62 63 gboolean cairo_dock_theme_manager_is_integrated (void); 64 65 66 67 void cairo_dock_gui_update_desklet_params (CairoDesklet *pDesklet); 68 69 void cairo_dock_gui_update_desklet_visibility (CairoDesklet *pDesklet); 70 71 void cairo_dock_gui_trigger_reload_items (void); 72 73 void cairo_dock_gui_trigger_update_module_state (const gchar *cModuleName); 74 75 void cairo_dock_gui_trigger_update_modules_list (void); 76 77 void cairo_dock_gui_trigger_update_module_container (GldiModuleInstance *pInstance, gboolean bIsDetached); 78 79 void cairo_dock_gui_trigger_reload_shortkeys (void); 80 81 82 void cairo_dock_register_config_gui_backend (CairoDockMainGuiBackend *pBackend); 83 84 85 GtkWidget * cairo_dock_show_main_gui (void); 86 87 void cairo_dock_show_module_gui (const gchar *cModuleName); 88 89 void cairo_dock_close_gui (void); 90 91 void cairo_dock_show_items_gui (Icon *pIcon, GldiContainer *pContainer, GldiModuleInstance *pModuleInstance, int iShowPage); 92 93 void cairo_dock_reload_gui (void); 94 95 void cairo_dock_show_themes (void); 96 97 void cairo_dock_show_addons (void); 98 99 gboolean cairo_dock_can_manage_themes (void); 100 101 G_END_DECLS 102 #endif 103