1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* 3 * Copyright (C) 2004-2020 Shaun McCance <shaunm@gnome.org> 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation; either version 2 of the 8 * License, or (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 GNU 13 * General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public 16 * License along with this program; if not, see <http://www.gnu.org/licenses/>. 17 * 18 * Author: Shaun McCance <shaunm@gnome.org> 19 */ 20 21 #ifndef __YELP_SETTINGS_H__ 22 #define __YELP_SETTINGS_H__ 23 24 #include <glib-object.h> 25 26 G_BEGIN_DECLS 27 28 #define YELP_TYPE_SETTINGS (yelp_settings_get_type ()) 29 #define YELP_SETTINGS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), YELP_TYPE_SETTINGS, YelpSettings)) 30 #define YELP_SETTINGS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), YELP_TYPE_SETTINGS, YelpSettingsClass)) 31 #define YELP_IS_SETTINGS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), YELP_TYPE_SETTINGS)) 32 #define YELP_IS_SETTINGS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), YELP_TYPE_SETTINGS)) 33 #define YELP_SETTINGS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), YELP_TYPE_SETTINGS, YelpSettingsClass)) 34 35 typedef struct _YelpSettings YelpSettings; 36 typedef struct _YelpSettingsClass YelpSettingsClass; 37 typedef struct _YelpSettingsPrivate YelpSettingsPrivate; 38 39 struct _YelpSettings { 40 GObject parent; 41 YelpSettingsPrivate *priv; 42 }; 43 44 struct _YelpSettingsClass { 45 GObjectClass parent_class; 46 }; 47 48 typedef enum { 49 YELP_SETTINGS_COLOR_BASE, 50 YELP_SETTINGS_COLOR_TEXT, 51 YELP_SETTINGS_COLOR_TEXT_LIGHT, 52 YELP_SETTINGS_COLOR_LINK, 53 YELP_SETTINGS_COLOR_LINK_VISITED, 54 YELP_SETTINGS_COLOR_GRAY_BASE, 55 YELP_SETTINGS_COLOR_DARK_BASE, 56 YELP_SETTINGS_COLOR_GRAY_BORDER, 57 YELP_SETTINGS_COLOR_BLUE_BASE, 58 YELP_SETTINGS_COLOR_BLUE_BORDER, 59 YELP_SETTINGS_COLOR_RED_BASE, 60 YELP_SETTINGS_COLOR_RED_BORDER, 61 YELP_SETTINGS_COLOR_YELLOW_BASE, 62 YELP_SETTINGS_COLOR_YELLOW_BORDER, 63 YELP_SETTINGS_NUM_COLORS 64 } YelpSettingsColor; 65 66 typedef enum { 67 YELP_SETTINGS_FONT_VARIABLE, 68 YELP_SETTINGS_FONT_FIXED, 69 YELP_SETTINGS_NUM_FONTS 70 } YelpSettingsFont; 71 72 typedef enum { 73 YELP_SETTINGS_ICON_BUG, 74 YELP_SETTINGS_ICON_IMPORTANT, 75 YELP_SETTINGS_ICON_NOTE, 76 YELP_SETTINGS_ICON_TIP, 77 YELP_SETTINGS_ICON_WARNING, 78 YELP_SETTINGS_NUM_ICONS 79 } YelpSettingsIcon; 80 81 GType yelp_settings_get_type (void); 82 YelpSettings * yelp_settings_get_default (void); 83 84 gchar * yelp_settings_get_color (YelpSettings *settings, 85 YelpSettingsColor color); 86 gchar ** yelp_settings_get_colors (YelpSettings *settings); 87 void yelp_settings_set_colors (YelpSettings *settings, 88 YelpSettingsColor first_color, 89 ...); 90 const gchar* yelp_settings_get_color_param (YelpSettingsColor color); 91 92 93 gchar * yelp_settings_get_font (YelpSettings *settings, 94 YelpSettingsFont font); 95 gchar * yelp_settings_get_font_family (YelpSettings *settings, 96 YelpSettingsFont font); 97 gint yelp_settings_get_font_size (YelpSettings *settings, 98 YelpSettingsFont font); 99 void yelp_settings_set_fonts (YelpSettings *settings, 100 YelpSettingsFont first_font, 101 ...); 102 gint yelp_settings_get_font_adjustment (YelpSettings *settings); 103 void yelp_settings_set_font_adjustment (YelpSettings *settings, 104 gint adjustment); 105 106 gint yelp_settings_get_icon_size (YelpSettings *settings); 107 void yelp_settings_set_icon_size (YelpSettings *settings, 108 gint size); 109 gchar * yelp_settings_get_icon (YelpSettings *settings, 110 YelpSettingsIcon icon); 111 void yelp_settings_set_icons (YelpSettings *settings, 112 YelpSettingsIcon first_icon, 113 ...); 114 const gchar * yelp_settings_get_icon_param (YelpSettingsIcon icon); 115 116 gchar ** yelp_settings_get_all_params (YelpSettings *settings, 117 gint extra, 118 gint *end); 119 120 gboolean yelp_settings_get_show_text_cursor (YelpSettings *settings); 121 void yelp_settings_set_show_text_cursor (YelpSettings *settings, 122 gboolean show); 123 124 gboolean yelp_settings_get_editor_mode (YelpSettings *settings); 125 void yelp_settings_set_editor_mode (YelpSettings *settings, 126 gboolean editor_mode); 127 128 gint yelp_settings_cmp_icons (const gchar *icon1, 129 const gchar *icon2); 130 131 G_END_DECLS 132 133 #endif /* __YELP_SETTINGS_H__ */ 134