1 /* -*- Mode: C; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 3 -*- */
2 
3 /*
4  * GImageView
5  * Copyright (C) 2001 Takuro Ashie
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (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  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  *
21  * $Id: gimv_prefs_win.h,v 1.2 2003/06/13 09:43:33 makeinu Exp $
22  */
23 
24 #ifndef __PREFS_WIN_H__
25 #define __PREFS_WIN_H__
26 
27 #include "gimageview.h"
28 
29 typedef enum
30 {
31    GIMV_PREFS_WIN_ACTION_OK,
32    GIMV_PREFS_WIN_ACTION_APPLY,
33    GIMV_PREFS_WIN_ACTION_CANCEL
34    /* GIMV_PREFS_WIN_ACTION_SET_DEFAULT, */
35 } GimvPrefsWinAction;
36 
37 /* FIXME */
38 typedef GtkWidget *(*GimvPrefsWinCreatePageFn)  (void);
39 /* return true if want to stop applying */
40 typedef gboolean   (*GimvPrefsWinApplyFn)       (GimvPrefsWinAction action);
41 
42 typedef struct GimvPrefsWinPage_Tag {
43    const gchar * const     path;
44    gint                    priority_hint;
45    const gchar * const     icon;
46    const gchar * const     icon_open;
47 
48    GimvPrefsWinCreatePageFn create_page_fn;
49    GimvPrefsWinApplyFn      apply_fn;
50 
51 } GimvPrefsWinPage;
52 
53 GtkWidget *gimv_prefs_win_open           (const gchar *path,
54                                           GtkWindow *parent);
55 void       gimv_prefs_win_open_idle      (const gchar *path,
56                                           GtkWindow *window);
57 void       gimv_prefs_win_set_page       (const gchar *path);
58 gboolean   gimv_prefs_win_is_opened      (void);
59 GtkWidget *gimv_prefs_win_get            (void);
60 gboolean   gimv_prefs_win_add_page_entry (GimvPrefsWinPage *page);
61 
62 
63 #if 0
64 
65 typedef struct PrefsWin_Tag      PrefsWin;
66 typedef struct PrefsWinClass_Tag PrefsWinClass;
67 
68 typedef enum {
69    PrefsWinModeNotebook,
70    PrefsWinModeTree,
71    PrefsWinModeStackButtons,
72 } PrefsWinMode;
73 
74 struct PrefsWin_Tag
75 {
76    GtkDialog parent;
77 
78    GtkWidget *nav_tree;
79    GtkWieget *notebook;
80 };
81 
82 struct PrefsWinClass_Tag
83 {
84    GtkDialogClass parent_class;
85 
86    void (*ok)     (PrefsWin *window);
87    void (*apply)  (PrefsWin *window);
88    void (*cancel) (PrefsWin *window);
89 };
90 
91 
92 void       prefs_win_new                (PrefsWinMode       mode);
93 void       prefs_win_new_new_with_pages (PrefsWinMode       mode,
94                                          PrefsWinPageEntry *page[],
95                                          gint               n_pages);
96 void       prefs_win_show_modal         (PrefsWin          *window);
97 void       prefs_win_create_pages       (PrefsWin          *widnow,
98                                          PrefsWinPageEntry *page[],
99                                          gint               n_pages);
100 GtkWidget *prefs_win_append_page        (PrefsWin          *window,
101                                          PrefsWinPageEntry *page);
102 void       prefs_win_remove_page        (const gchar *path);
103 
104 #endif
105 
106 #endif /* __PREFS_WIN_H__ */
107