FmSidePane

FmSidePane — A widget for side pane displaying

Synopsis

struct              FmSidePane;
struct              FmSidePaneClass;
enum                FmSidePaneMode;
void                (*FmSidePaneUpdatePopup)            (FmSidePane *sp,
                                                         GtkUIManager *ui,
                                                         GtkActionGroup *act_grp,
                                                         FmFileInfo *file,
                                                         gpointer user_data);
void                fm_side_pane_chdir                  (FmSidePane *sp,
                                                         FmPath *path);
FmPath *            fm_side_pane_get_cwd                (FmSidePane *sp);
FmSidePaneMode      fm_side_pane_get_mode               (FmSidePane *sp);
FmSidePaneMode      fm_side_pane_get_mode_by_name       (const char *str);
const char *        fm_side_pane_get_mode_label         (FmSidePaneMode mode);
const char *        fm_side_pane_get_mode_name          (FmSidePaneMode mode);
const char *        fm_side_pane_get_mode_tooltip       (FmSidePaneMode mode);
gint                fm_side_pane_get_n_modes            (void);
GtkWidget *         fm_side_pane_get_title_bar          (FmSidePane *sp);
FmSidePane *        fm_side_pane_new                    (void);
gboolean            fm_side_pane_set_home_dir           (FmSidePane *sp,
                                                         const char *home_dir);
void                fm_side_pane_set_mode               (FmSidePane *sp,
                                                         FmSidePaneMode mode);
void                fm_side_pane_set_popup_updater      (FmSidePane *sp,
                                                         FmSidePaneUpdatePopup update_popup,
                                                         gpointer user_data);
gboolean            fm_side_pane_set_show_hidden        (FmSidePane *sp,
                                                         gboolean show_hidden);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBox
                                 +----GtkVBox
                                       +----FmSidePane

Implemented Interfaces

FmSidePane implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Signals

  "chdir"                                          : Run Last
  "mode-changed"                                   : Run Last

Description

include: libfm/fm-gtk.h

The FmSidePane widget displays side pane for fast navigation across places.

Details

struct FmSidePane

struct FmSidePane;

struct FmSidePaneClass

struct FmSidePaneClass {
    GtkVBoxClass parent_class;
    void (*chdir)(FmSidePane* sp, guint button, FmPath* path);
    void (*mode_changed)(FmSidePane* sp);
};

GtkVBoxClass parent_class;

the parent class

chdir ()

the class closure for the "chdir" signal

mode_changed ()

the class closure for the "mode-changed" signal

enum FmSidePaneMode

typedef enum {
    FM_SP_NONE,
    FM_SP_PLACES,
    FM_SP_DIR_TREE,
    FM_SP_REMOTE
} FmSidePaneMode;

Mode of side pane view.

FM_SP_NONE

invalid mode

FM_SP_PLACES

FmPlacesView mode

FM_SP_DIR_TREE

FmDirTreeView mode

FM_SP_REMOTE

reserved mode

FmSidePaneUpdatePopup ()

void                (*FmSidePaneUpdatePopup)            (FmSidePane *sp,
                                                         GtkUIManager *ui,
                                                         GtkActionGroup *act_grp,
                                                         FmFileInfo *file,
                                                         gpointer user_data);

The callback to update popup menu. It can disable items of menu, add some new, replace actions, etc. depending of the window and files. In some cases file may be incomplete so callback should check that.

sp :

the side pane widget

ui :

the object to add interface

act_grp :

group of actions to add action

file :

the file the popup menu was created for

user_data :

pointer passed to fm_side_pane_set_popup_updater()

fm_side_pane_chdir ()

void                fm_side_pane_chdir                  (FmSidePane *sp,
                                                         FmPath *path);

Changes active path in the side pane.

sp :

a widget to apply

path :

new path

Since 0.1.12


fm_side_pane_get_cwd ()

FmPath *            fm_side_pane_get_cwd                (FmSidePane *sp);

Retrieves current active path in the side pane. Returned data are owned by side pane and should not be freed by caller.

sp :

a widget to inspect

Returns :

active file path.

Since 0.1.12


fm_side_pane_get_mode ()

FmSidePaneMode      fm_side_pane_get_mode               (FmSidePane *sp);

Retrieves side pane view mode.

sp :

a widget to inspect

Returns :

current view mode.

Since 0.1.12


fm_side_pane_get_mode_by_name ()

FmSidePaneMode      fm_side_pane_get_mode_by_name       (const char *str);

Finds mode which have an associated name equal to str.

str :

the name of mode

Returns :

mode or FM_SP_NONE if str specifies invalid mode.

Since 1.2.0


fm_side_pane_get_mode_label ()

const char *        fm_side_pane_get_mode_label         (FmSidePaneMode mode);

Retrieves label for mode which can be used in menus. Returned data should not be freed by caller.

mode :

the view mode

Returns :

desription or NULL if mode is invalid.

Since 1.2.0


fm_side_pane_get_mode_name ()

const char *        fm_side_pane_get_mode_name          (FmSidePaneMode mode);

Retrieves the name of the specified side pane mode, or NULL if mode is invalid. The name of mode may be used for config save or another similar purpose. Returned data are owned by implementation and should be not freed by caller.

mode :

mode to convert

Returns :

the name associated with mode.

Since 1.2.0


fm_side_pane_get_mode_tooltip ()

const char *        fm_side_pane_get_mode_tooltip       (FmSidePaneMode mode);

Retrieves tooltip for mode which can be used in menus. Returned data should not be freed by caller.

mode :

the view mode

Returns :

desription or NULL if mode is invalid.

Since 1.2.0


fm_side_pane_get_n_modes ()

gint                fm_side_pane_get_n_modes            (void);

Tests how many view modes are known to create FmSidePane widget. The returned value is the highest FmSidePaneMode that can be used due to historical reasons since FmSidePaneMode equal to 0 is invalid.

Returns :

number of known modes for side pane.

Since 1.2.0


fm_side_pane_get_title_bar ()

GtkWidget *         fm_side_pane_get_title_bar          (FmSidePane *sp);

Retrieves side pane title bar widget.

sp :

a widget to inspect

Returns :

pointer to title bar of side pane. [transfer none]

Since 0.1.14


fm_side_pane_new ()

FmSidePane *        fm_side_pane_new                    (void);

Creates new side pane.

Returns :

a new FmSidePane widget. [transfer full]

Since 0.1.12


fm_side_pane_set_home_dir ()

gboolean            fm_side_pane_set_home_dir           (FmSidePane *sp,
                                                         const char *home_dir);

Changes path used by side pane view for "Home" items if view mode has any such items.

sp :

a widget to apply

home_dir :

a new path to set

Returns :

TRUE if current side pane mode accepts this change.

Since 1.2.0


fm_side_pane_set_mode ()

void                fm_side_pane_set_mode               (FmSidePane *sp,
                                                         FmSidePaneMode mode);

Changes side pane view mode.

sp :

a widget to apply

mode :

new mode for the side pane

Since 0.1.12


fm_side_pane_set_popup_updater ()

void                fm_side_pane_set_popup_updater      (FmSidePane *sp,
                                                         FmSidePaneUpdatePopup update_popup,
                                                         gpointer user_data);

Sets up the callback to update context menu on any item in the sidebar widget.

sp :

a widget to set

update_popup :

a callback to update popup. [allow-none]

user_data :

user data supplied for callback

Since 1.2.0


fm_side_pane_set_show_hidden ()

gboolean            fm_side_pane_set_show_hidden        (FmSidePane *sp,
                                                         gboolean show_hidden);

Changes visibility of hidden files in side pane sp.

sp :

a widget to apply

show_hidden :

TRUE to show hidden files in side pane

Returns :

TRUE if current side pane mode accepts this change.

Since 1.2.0

Signal Details

The "chdir" signal

void                user_function                      (FmSidePane *pane,
                                                        guint       button,
                                                        gpointer    path,
                                                        gpointer    user_data)      : Run Last

The "chdir" signal is emitted when current selected directory in the pane is changed.

pane :

the widget which emitted the signal

button :

the button path was activated with

path :

(FmPath *) new directory path

user_data :

user data set when the signal handler was connected.

Since 0.1.12


The "mode-changed" signal

void                user_function                      (FmSidePane *pane,
                                                        gpointer    user_data)      : Run Last

The "mode-changed" signal is emitted when view mode in the pane is changed.

pane :

the widget which emitted the signal

user_data :

user data set when the signal handler was connected.

Since 0.1.12