1 /* 2 * Copyright © 2009-2018 Siyan Panayotov <contact@siyanpanayotov.com> 3 * 4 * This file is part of Viewnior. 5 * 6 * Viewnior is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * Viewnior is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with Viewnior. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef __VNR_PREFS_H__ 21 #define __VNR_PREFS_H__ 22 23 #include "config.h" 24 25 #include <glib.h> 26 #include <gtk/gtk.h> 27 #include <gio/gio.h> 28 #include <gdk/gdkkeysyms.h> 29 30 G_BEGIN_DECLS 31 32 typedef struct _VnrPrefs VnrPrefs; 33 typedef struct _VnrPrefsClass VnrPrefsClass; 34 35 #define VNR_TYPE_PREFS (vnr_prefs_get_type ()) 36 #define VNR_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VNR_TYPE_PREFS, VnrPrefs)) 37 #define VNR_PREFS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VNR_TYPE_PREFS, VnrPrefsClass)) 38 #define VNR_IS_PREFS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VNR_TYPE_PREFS)) 39 #define VNR_IS_PREFS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VNR_TYPE_PREFS)) 40 #define VNR_PREFS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VNR_TYPE_PREFS, VnrPrefsClass)) 41 42 typedef enum{ 43 VNR_PREFS_ZOOM_SMART, 44 VNR_PREFS_ZOOM_NORMAL, 45 VNR_PREFS_ZOOM_FIT, 46 VNR_PREFS_ZOOM_LAST_USED, 47 } VnrPrefsZoom; 48 49 50 typedef enum{ 51 VNR_PREFS_DESKTOP_GNOME2, 52 VNR_PREFS_DESKTOP_GNOME3, 53 VNR_PREFS_DESKTOP_XFCE, 54 VNR_PREFS_DESKTOP_LXDE, 55 VNR_PREFS_DESKTOP_PUPPY, 56 VNR_PREFS_DESKTOP_FLUXBOX, 57 VNR_PREFS_DESKTOP_NITROGEN, 58 VNR_PREFS_DESKTOP_MATE, 59 VNR_PREFS_DESKTOP_CINNAMON, 60 VNR_PREFS_DESKTOP_AUTO, 61 } VnrPrefsDesktop; 62 63 typedef enum{ 64 VNR_PREFS_WHEEL_NAVIGATE , 65 VNR_PREFS_WHEEL_ZOOM , 66 VNR_PREFS_WHEEL_SCROLL, 67 } VnrPrefsWheel ; 68 69 typedef enum{ 70 VNR_PREFS_CLICK_ZOOM , 71 VNR_PREFS_CLICK_FULLSCREEN , 72 VNR_PREFS_CLICK_NEXT , 73 } VnrPrefsClick ; 74 75 typedef enum{ 76 VNR_PREFS_MODIFY_ASK , 77 VNR_PREFS_MODIFY_SAVE , 78 VNR_PREFS_MODIFY_IGNORE , 79 } VnrPrefsModify ; 80 81 struct _VnrPrefs { 82 GObject parent; 83 84 VnrPrefsZoom zoom; 85 86 VnrPrefsDesktop desktop; 87 88 VnrPrefsWheel behavior_wheel; 89 VnrPrefsClick behavior_click; 90 VnrPrefsModify behavior_modify; 91 gboolean fit_on_fullscreen; 92 gboolean show_hidden; 93 gboolean smooth_images; 94 gboolean confirm_delete; 95 gboolean reload_on_save; 96 gboolean show_menu_bar; 97 gboolean show_toolbar; 98 gboolean show_scrollbar; 99 gboolean start_maximized; 100 gboolean start_slideshow; 101 gboolean start_fullscreen; 102 gboolean auto_resize; 103 int slideshow_timeout; 104 int jpeg_quality; 105 int png_compression; 106 107 GtkWidget *dialog; 108 GtkWidget *vnr_win; 109 110 GtkSpinButton *slideshow_timeout_widget; 111 }; 112 113 struct _VnrPrefsClass { 114 GObjectClass parent_class; 115 }; 116 117 GType vnr_prefs_get_type (void) G_GNUC_CONST; 118 119 GObject* vnr_prefs_new (GtkWidget *window); 120 void vnr_prefs_show_dialog (VnrPrefs *prefs); 121 void vnr_prefs_set_slideshow_timeout (VnrPrefs *prefs, int value); 122 void vnr_prefs_set_show_menu_bar (VnrPrefs *prefs, gboolean show_menu_bar); 123 void vnr_prefs_set_show_toolbar (VnrPrefs *prefs, gboolean show_toolbar); 124 void vnr_prefs_set_show_scrollbar (VnrPrefs *prefs, gboolean show_scollbar); 125 gboolean vnr_prefs_save (VnrPrefs *prefs); 126 127 G_END_DECLS 128 #endif /* __VNR_PREFS_H__ */ 129