File: preferences.h

package info (click to toggle)
file-browser-applet 0.6.6-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 428 kB
  • ctags: 281
  • sloc: ansic: 2,740; makefile: 6
file content (126 lines) | stat: -rw-r--r-- 4,904 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
 * File:                preferences.h
 * Created:             April 2006
 * Created by:          Axel von Bertoldi
 * Last Modified:       November 2009
 * Last Modified by:    Axel von Bertoldi
 * (C) 2005-2009        Axel von Bertoldi
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to:
 * The Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor
 * Boston, MA 02110-1301, USA.
 */

#ifndef __PREFERENCES_H__
#define __PREFERENCES_H__

#include <glib-object.h>
#include <panel-applet-gconf.h>

G_BEGIN_DECLS

/******************************************************************************/
#define TYPE_APPLET_PREFERENCES (applet_preferences_get_type ())
#define APPLET_PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APPLET_PREFERENCES, AppletPreferences))
#define APPLET_PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APPLET_PREFERENCES, AppletPreferencesClass))
#define IS_APPLET_PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APPLET_PREFERENCES))
#define IS_APPLET_PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APPLET_PREFERENCES))
#define APPLET_PREFERENCES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APPLET_PREFERENCES, AppletPreferencesClass))
/******************************************************************************/
#define KEY_DIR             "dirs"
#define KEY_LABELS          "labels"
#define KEY_ICON_NAME       "icon"
#define KEY_ICON_SHOW       "show_icon"
#define KEY_HIDDEN_SHOW     "show_hidden"
#define KEY_HIDE_FILES      "hide_files"
#define KEY_TERMINAL        "terminal"
#define KEY_EDITOR          "editor"
#define KEY_HORIZONTAL_TEXT "horizontal_text"
#define KEY_SHOW_THUMBNAILS "show_thumbnail"

/* default options */
#define DEFAULT_ICON            "user-home"
#define DEFAULT_SHOW_ICON       TRUE
#define DEFAULT_LABEL           "Home"
#define DEFAULT_PATH            g_get_home_dir ()
#define DEFAULT_TERMINAL        "gnome-terminal"
#define DEFAULT_EDITOR          "gedit"
#define DEFAULT_SHOW_HIDDEN     FALSE
#define DEFAULT_HIDE_FILES      FALSE
#define DEFAULT_HORIZONTAL_TEXT TRUE
#define DEFAULT_SHOW_THUMBNAILS TRUE
/******************************************************************************/
typedef struct _BrowserPrefs BrowserPrefs;
typedef struct _MenuBarPrefs MenuBarPrefs;
typedef struct _AppletPreferences AppletPreferences;
typedef struct _AppletPreferencesClass AppletPreferencesClass;
typedef struct _AppletPreferencesPrivate AppletPreferencesPrivate;
typedef struct _PrefsChangedSignalData PrefsChangedSignalData;
/******************************************************************************/
struct _BrowserPrefs {
    gchar       *terminal;
    gchar       *editor;
    gboolean    show_hidden;
    gboolean    hide_files;
    gboolean    show_thumbnail;
};
struct _MenuBarPrefs {
    GSList          *dirs;
    GSList          *labels;
    gboolean        show_icon;
    gboolean        horizontal_text;
    gchar           *icon;
    BrowserPrefs    *browser_prefs;
};
struct _AppletPreferences {
    GObject                     parent;
    MenuBarPrefs                *menu_bar_prefs;
    AppletPreferencesPrivate    *priv;
};
struct _AppletPreferencesClass {
    GObjectClass parent;
    void (*prefs_changed)(AppletPreferences *a_prefs,
                          PrefsChangedSignalData *signal_data,
                          gpointer user_data);
};
struct _PrefsChangedSignalData {
    gint    signal_id;
    gint    instance;
    gchar   *label;
    gchar   *path;
};
/******************************************************************************/
enum {
    PREFS_SIGNAL_TERMINAL,
    PREFS_SIGNAL_SHOW_HIDDEN,
    PREFS_SIGNAL_SHOW_ICON,
    PREFS_SIGNAL_ICON_CHANGED,
    PREFS_SIGNAL_DIR_CHANGED,
    PREFS_SIGNAL_DIR_MOVE_UP,
    PREFS_SIGNAL_DIR_MOVE_DOWN,
    PREFS_SIGNAL_DIR_ADD,
    PREFS_SIGNAL_DIR_DEL,
    PREFS_SIGNAL_HORIZONTAL_TEXT,
    PREFS_SIGNAL_SHOW_THUMBNAIL
};
/******************************************************************************/
AppletPreferences*  applet_preferences_new (PanelApplet *applet);
void                applet_preferences_make_dialog (AppletPreferences *preferences);
GType               applet_preferences_get_type (void);
/******************************************************************************/

G_END_DECLS

#endif