1 /*
2  *      fm-path-bar.h
3  *
4  *      Copyright 2011 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
5  *
6  *      This program 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 2 of the License, or
9  *      (at your option) any later version.
10  *
11  *      This program 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 this program; if not, write to the Free Software
18  *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  *      MA 02110-1301, USA.
20  */
21 
22 #ifndef __FM_PATH_BAR_H__
23 #define __FM_PATH_BAR_H__
24 
25 #include <gtk/gtk.h>
26 #include "fm-path.h"
27 
28 #include "fm-seal.h"
29 
30 G_BEGIN_DECLS
31 
32 
33 #define FM_TYPE_PATH_BAR                (fm_path_bar_get_type())
34 #define FM_PATH_BAR(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj),\
35             FM_TYPE_PATH_BAR, FmPathBar))
36 #define FM_PATH_BAR_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST((klass),\
37             FM_TYPE_PATH_BAR, FmPathBarClass))
38 #define FM_IS_PATH_BAR(obj)            (G_TYPE_CHECK_INSTANCE_TYPE((obj),\
39             FM_TYPE_PATH_BAR))
40 #define FM_IS_PATH_BAR_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE((klass),\
41             FM_TYPE_PATH_BAR))
42 #define FM_PATH_BAR_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj),\
43             FM_TYPE_PATH_BAR, FmPathBarClass))
44 
45 typedef struct _FmPathBar            FmPathBar;
46 typedef struct _FmPathBarClass        FmPathBarClass;
47 
48 struct _FmPathBar
49 {
50     /*< private >*/
51     GtkHBox parent;
52     GtkWidget* FM_SEAL(viewport); /* viewport to make hbox scrollable */
53     GtkWidget* FM_SEAL(btn_box); /* hbox containing path element buttons */
54 
55     GtkWidget* FM_SEAL(left_scroll);    /* left scroll button */
56     GtkWidget* FM_SEAL(right_scroll);   /* right scroll button */
57     FmPath* FM_SEAL(cur_path);   /* currently active path */
58     FmPath* FM_SEAL(full_path);  /* full path shown in the bar */
59     gpointer _reserved1;
60     gpointer _reserved2;
61 };
62 
63 /**
64  * FmPathBarClass:
65  * @parent_class: the parent class
66  * @chdir: the class closure for the #FmPathBar::chdir signal
67  */
68 struct _FmPathBarClass
69 {
70     GtkHBoxClass parent_class;
71     void (*chdir)(FmPathBar* bar, FmPath* path);
72     /*< private >*/
73     gpointer _reserved1;
74 };
75 
76 
77 GType        fm_path_bar_get_type        (void);
78 FmPathBar*    fm_path_bar_new            (void);
79 
80 FmPath* fm_path_bar_get_path(FmPathBar* bar);
81 void fm_path_bar_set_path(FmPathBar* bar, FmPath* path);
82 
83 G_END_DECLS
84 
85 #endif /* __FM_PATH_BAR_H__ */
86