![]() |
![]() |
![]() |
Libfm Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Signals |
struct FmDirTreeModel; struct FmDirTreeModelClass; enum FmDirTreeModelCol; void fm_dir_tree_model_add_root (FmDirTreeModel *model
,FmFileInfo *root
,GtkTreeIter *iter
); guint fm_dir_tree_model_get_icon_size (FmDirTreeModel *model
); void fm_dir_tree_model_load_row (FmDirTreeModel *model
,GtkTreeIter *it
,GtkTreePath *tp
); FmDirTreeModel * fm_dir_tree_model_new (void
); void fm_dir_tree_model_set_icon_size (FmDirTreeModel *model
,guint icon_size
); void fm_dir_tree_model_unload_row (FmDirTreeModel *model
,GtkTreeIter *it
,GtkTreePath *tp
); const char * fm_dir_tree_row_get_disp_name (FmDirTreeModel *model
,GtkTreeIter *iter
); FmFileInfo * fm_dir_tree_row_get_file_info (FmDirTreeModel *model
,GtkTreeIter *iter
); FmPath * fm_dir_tree_row_get_file_path (FmDirTreeModel *model
,GtkTreeIter *iter
); GdkPixbuf * fm_dir_tree_row_get_icon (FmDirTreeModel *model
,GtkTreeIter *iter
); gboolean fm_dir_tree_row_is_loaded (FmDirTreeModel *model
,GtkTreeIter *iter
);
include
: libfm/fm-dir-tree-model.h
The FmDirTreeModel represents tree of folders which can be used by FmDirTreeView to create tree-like expandable list of directories.
struct FmDirTreeModelClass { GObjectClass parent_class; void (*row_loaded)(FmDirTreeModel* model, GtkTreePath* row); };
the parent class | |
the class closure for the "row-loaded" signal |
typedef enum { FM_DIR_TREE_MODEL_COL_ICON, FM_DIR_TREE_MODEL_COL_DISP_NAME, FM_DIR_TREE_MODEL_COL_INFO, FM_DIR_TREE_MODEL_COL_PATH, FM_DIR_TREE_MODEL_COL_FOLDER, } FmDirTreeModelCol;
Columns of dir tree model
(GdkPixbuf *) icon | |
(char *) displayed name | |
(FmFileInfo *) file info | |
(FmPath *) file path | |
(FmFolder *) folder object |
void fm_dir_tree_model_add_root (FmDirTreeModel *model
,FmFileInfo *root
,GtkTreeIter *iter
);
Adds a root node for file root
into model
. If iter
is not NULL
then on return it will be set to new row data.
|
the model instance |
|
a root path to add |
|
pointer to iterator to set. [allow-none] |
Since 0.1.16
guint fm_dir_tree_model_get_icon_size (FmDirTreeModel *model
);
Retrieves size of icons which are associated with rows.
Before 1.0.0 this API had name fm_dir_tree_get_icon_size.
|
the model instance |
Returns : |
preferrable icom size for the model . |
Since 0.1.16
void fm_dir_tree_model_load_row (FmDirTreeModel *model
,GtkTreeIter *it
,GtkTreePath *tp
);
If row with iterator it
has its children already retrieved then
does nothing. Else starts retrieving of list of children for row
with iterator it
and path tp
. When children are loaded then a
"row-loaded" signal will be emitted. The folder
associated with the row will be monitored for changes in children
after that.
This API is used when the row is expanded in the view.
Before 1.0.0 this API had name fm_dir_tree_model_expand_row.
See also: fm_dir_tree_row_is_loaded()
, fm_dir_tree_model_unload_row()
.
|
the model instance |
|
iterator of row to load |
|
path of row to load |
Since 0.1.16
FmDirTreeModel * fm_dir_tree_model_new (void
);
Creates new FmDirTreeModel instance.
Returns : |
a new FmDirTreeModel object. |
Since 0.1.16
void fm_dir_tree_model_set_icon_size (FmDirTreeModel *model
,guint icon_size
);
Sets size of icons which are associated with rows.
|
the model instance |
|
new preferrable icon size |
Since 0.1.16
void fm_dir_tree_model_unload_row (FmDirTreeModel *model
,GtkTreeIter *it
,GtkTreePath *tp
);
If children of row with iterator it
are retrieved or monitored
then stops monitoring the folder and forgets children of the row.
This API is used when the row is collapsed in the view.
Before 1.0.0 this API had name fm_dir_tree_model_collapse_row.
|
the model instance |
|
iterator of row to unload |
|
path of row to unload |
Since 0.1.16
const char * fm_dir_tree_row_get_disp_name (FmDirTreeModel *model
,GtkTreeIter *iter
);
Retrieves display name of file associated with row of iter
in model
.
Returned data are owned by model
and should be not freed by caller.
|
the model instance |
|
the iterator of row to retrieve data |
Returns : |
the file display name for the row. [transfer none] |
Since 1.0.0
FmFileInfo * fm_dir_tree_row_get_file_info (FmDirTreeModel *model
,GtkTreeIter *iter
);
Retrieves info for file associated with row of iter
in model
.
Returned data are owned by model
and should be not freed by caller.
|
the model instance |
|
the iterator of row to retrieve data |
Returns : |
the file info for the row. [transfer none] |
Since 1.0.0
FmPath * fm_dir_tree_row_get_file_path (FmDirTreeModel *model
,GtkTreeIter *iter
);
Retrieves FmPath for file associated with row of iter
in model
.
Returned data are owned by model
and should be not freed by caller.
|
the model instance |
|
the iterator of row to retrieve data |
Returns : |
the file path for the row. [transfer none] |
Since 1.0.0
GdkPixbuf * fm_dir_tree_row_get_icon (FmDirTreeModel *model
,GtkTreeIter *iter
);
Retrieves an icon associated with row of iter
in model
. Returned
data are owned by model
and should be not freed by caller.
|
the model instance |
|
the iterator of row to retrieve data |
Returns : |
the icon for the row. [transfer none] |
Since 1.0.0
gboolean fm_dir_tree_row_is_loaded (FmDirTreeModel *model
,GtkTreeIter *iter
);
Checks if the row has its children already retrieved. This check may
need be done since any duplicate calls to fm_dir_tree_model_load_row()
will not emit any duplicate "row-loaded" signal.
|
the model instance |
|
the iterator of row to inspect |
Returns : |
TRUE if the row has children already loaded. |
Since 1.0.0
"row-loaded"
signalvoid user_function (FmDirTreeModel *model,
GtkTreePath *row,
gpointer user_data) : Run First
The "row-loaded" signal is emitted when content of
folder row
is completely retrieved. It may happen either
after call to fm_dir_tree_model_load_row()
or in time of that call (in case if the folder was already cached in
memory).
See also: fm_dir_tree_model_unload_row()
.
|
dir tree model instance that received the signal |
|
path to folder row that is ready |
|
user data set when the signal handler was connected. |
Since 1.0.0