~ubuntu-branches/ubuntu/lucid/libfm/lucid

« back to all changes in this revision

Viewing changes to .pc/02-detailled-view.patch/src/gtk/fm-folder-view.h

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-04-25 18:35:59 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100425183559-8gprnl67nm1b3h03
Tags: 0.1.10-0ubuntu1
* New upstream release (LP: #566241)
 - Fix crash when running as root. (LP: #561903)
 - Fix crash when editing bookmarks.
* debian/patches/02-detailled-view.patch: Workaround behavior change of
  gtktreeview to make click on detailled view work again. LP: #520118

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *      folder-view.h
 
3
 *
 
4
 *      Copyright 2009 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
 
 
23
#ifndef __FOLDER_VIEW_H__
 
24
#define __FOLDER_VIEW_H__
 
25
 
 
26
#include <gtk/gtk.h>
 
27
#include "fm-file-info.h"
 
28
#include "fm-path.h"
 
29
#include "fm-dnd-src.h"
 
30
#include "fm-dnd-dest.h"
 
31
#include "fm-folder.h"
 
32
 
 
33
G_BEGIN_DECLS
 
34
 
 
35
#define FM_FOLDER_VIEW_TYPE                             (fm_folder_view_get_type())
 
36
#define FM_FOLDER_VIEW(obj)                             (G_TYPE_CHECK_INSTANCE_CAST((obj),\
 
37
                        FM_FOLDER_VIEW_TYPE, FmFolderView))
 
38
#define FM_FOLDER_VIEW_CLASS(klass)             (G_TYPE_CHECK_CLASS_CAST((klass),\
 
39
                        FM_FOLDER_VIEW_TYPE, FmFolderViewClass))
 
40
#define IS_FM_FOLDER_VIEW(obj)                  (G_TYPE_CHECK_INSTANCE_TYPE((obj),\
 
41
                        FM_FOLDER_VIEW_TYPE))
 
42
#define IS_FM_FOLDER_VIEW_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),\
 
43
                        FM_FOLDER_VIEW_TYPE))
 
44
 
 
45
typedef enum _FmFolderViewMode FmFolderViewMode;
 
46
enum _FmFolderViewMode
 
47
{
 
48
        FM_FV_ICON_VIEW,
 
49
        FM_FV_COMPACT_VIEW,
 
50
    FM_FV_THUMBNAIL_VIEW,
 
51
        FM_FV_LIST_VIEW
 
52
};
 
53
 
 
54
typedef enum _FmFolderViewClickType FmFolderViewClickType;
 
55
enum _FmFolderViewClickType
 
56
{
 
57
        FM_FV_CLICK_NONE,
 
58
        FM_FV_ACTIVATED, /* this can be triggered by both
 
59
                                                left single or double click depending on
 
60
                                                whether single-click activation is used or not. */
 
61
        FM_FV_MIDDLE_CLICK,
 
62
        FM_FV_CONTEXT_MENU
 
63
};
 
64
 
 
65
typedef struct _FmFolderView                    FmFolderView;
 
66
typedef struct _FmFolderViewClass               FmFolderViewClass;
 
67
 
 
68
struct _FmFolderView
 
69
{
 
70
        GtkScrolledWindow parent;
 
71
 
 
72
        FmFolderViewMode mode;
 
73
        GtkSelectionMode sel_mode;
 
74
        GtkSortType sort_type;
 
75
        int sort_by;
 
76
 
 
77
        gboolean show_hidden;
 
78
 
 
79
        GtkWidget* view;
 
80
    FmFolder* folder;
 
81
        GtkTreeModel* model;
 
82
    GtkCellRenderer* renderer_pixbuf;
 
83
    guint icon_size_changed_handler;
 
84
 
 
85
        FmPath* cwd;
 
86
        FmDndSrc* dnd_src; /* dnd source manager */
 
87
        FmDndDest* dnd_dest; /* dnd dest manager */
 
88
};
 
89
 
 
90
struct _FmFolderViewClass
 
91
{
 
92
        GtkScrolledWindowClass parent_class;
 
93
        void (*chdir)(FmFolderView* fv, FmPath* dir_path);
 
94
        void (*loaded)(FmFolderView* fv, FmPath* dir_path);
 
95
        void (*status)(FmFolderView* fv, const char* msg);
 
96
        void (*clicked)(FmFolderView* fv, FmFolderViewClickType type, FmFileInfo* file);
 
97
    void (*sel_changed)(FmFolderView* fv, FmFileInfoList* sels);
 
98
    void (*sort_changed)(FmFolderView* fv);
 
99
};
 
100
 
 
101
GType           fm_folder_view_get_type         (void);
 
102
GtkWidget*      fm_folder_view_new                      (FmFolderViewMode mode);
 
103
 
 
104
void fm_folder_view_set_mode(FmFolderView* fv, FmFolderViewMode mode);
 
105
FmFolderViewMode fm_folder_view_get_mode(FmFolderView* fv);
 
106
 
 
107
void fm_folder_view_set_selection_mode(FmFolderView* fv, GtkSelectionMode mode);
 
108
GtkSelectionMode fm_folder_view_get_selection_mode(FmFolderView* fv);
 
109
 
 
110
void fm_folder_view_sort(FmFolderView* fv, GtkSortType type, int by);
 
111
GtkSortType fm_folder_view_get_sort_type(FmFolderView* fv);
 
112
int fm_folder_view_get_sort_by(FmFolderView* fv);
 
113
 
 
114
void fm_folder_view_set_show_hidden(FmFolderView* fv, gboolean show);
 
115
gboolean fm_folder_view_get_show_hidden(FmFolderView* fv);
 
116
 
 
117
gboolean fm_folder_view_chdir(FmFolderView* fv, FmPath* path);
 
118
gboolean fm_folder_view_chdir_by_name(FmFolderView* fv, const char* path_str);
 
119
FmPath* fm_folder_view_get_cwd(FmFolderView* fv);
 
120
FmFileInfo* fm_folder_view_get_cwd_info(FmFolderView* fv);
 
121
 
 
122
FmFileInfoList* fm_folder_view_get_selected_files(FmFolderView* fv);
 
123
FmPathList* fm_folder_view_get_selected_file_paths(FmFolderView* fv);
 
124
 
 
125
void fm_folder_view_select_all(FmFolderView* fv);
 
126
void fm_folder_view_select_invert(FmFolderView* fv);
 
127
void fm_folder_view_select_file_path(FmFolderView* fv, FmPath* path);
 
128
void fm_folder_view_select_file_paths(FmFolderView* fv, FmPathList* paths);
 
129
 
 
130
/* select files by custom func, not yet implemented */
 
131
void fm_folder_view_custom_select(FmFolderView* fv, GFunc filter, gpointer user_data);
 
132
 
 
133
 
 
134
G_END_DECLS
 
135
 
 
136
#endif /* __FOLDER_VIEW_H__ */