MildenhallCabinetRoller

MildenhallCabinetRoller — A widget that allows navigation of hierarchical content, such as folders.

Functions

Properties

ClutterActor * active-roller Read
GObject * create-roller Write
GObject * set-roller Write
gboolean show-prev-roller Write
gboolean show-root-roller Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── MildenhallCabinetRoller

Description

MildenhallCabinetRoller shows up to two Rollers side by side. Selecting an item will show the contents of that item on the right-side roller. It is more frequently be used in Launcher applications where the list of application icons shall be shown based on the categories user has selected.

Freeing the widget

Call g_object_unref() to free the widget.

Sample C Code

A private enum to set column of ThornburyModel

1
2
3
4
5
6
7
enum
{
  ROLLER_OVERLAY,
  ROLLER_ICON, ROLLER_TEXT,
  ROLLER_TYPE,
  ROLLER_COLUMN_LAST
};

How to create MildenhallCabinetRoller

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
ThornburyItemFactory *item_factory = thornbury_item_factory_generate_widget_with_props (
    	MILDENHALL_TYPE_CABINET_ROLLER,
    	"/usr/share/mildenhall/mildenhall_cabinet_roller_prop.json");
GObject *object = NULL;
ClutterActor *actor = NULL;
ThornburyModel *model = NULL;

g_object_get (item_factory, "object", &object, NULL);
actor = CLUTTER_ACTOR (object);

model = (ThornburyModel*) thornbury_list_model_new (ROLLER_COLUMN_LAST,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_INT, NULL,
                                                   -1);
thornbury_model_append (model, ROLLER_OVERLAY,
                       MILDENHALL_CABINET_PICTURE_OVERLAY_PATH,
                       ROLLER_ICON, NULL, ROLLER_TEXT,
                       "unknownhfjhfhfhfghfg", ROLLER_TYPE,
                       MILDENHALL_CABINET_FOLDER_TYPE, -1);
thornbury_model_append (model, ROLLER_OVERLAY,
                       MILDENHALL_CABINET_PICTURE_OVERLAY_PATH,
                       ROLLER_ICON, NULL, ROLLER_TEXT,
                       "whgfhfghhhhhhhhhhhhhhhhh", ROLLER_TYPE,
			    MILDENHALL_CABINET_FILE_TYPE, -1);
thornbury_model_append (model, ROLLER_OVERLAY,
                       MILDENHALL_CABINET_PICTURE_OVERLAY_PATH,
                       ROLLER_ICON, NULL, ROLLER_TEXT,
                       "irghfggggggggggg", ROLLER_TYPE,
                       MILDENHALL_CABINET_FOLDER_TYPE, -1);
thornbury_model_append (model, ROLLER_OVERLAY,
                       MILDENHALL_CABINET_PICTURE_OVERLAY_PATH,
                       ROLLER_ICON, NULL, ROLLER_TEXT,
                       "iajhjhofghgjhjufjklawjdioqwjknwejkfijgnfj", ROLLER_TYPE,
                       MILDENHALL_CABINET_FOLDER_TYPE, -1);
thornbury_model_append (model, ROLLER_OVERLAY,
                       MILDENHALL_CABINET_PICTURE_OVERLAY_PATH,
                       ROLLER_ICON, NULL, ROLLER_TEXT,
                       "iajhjhilhjkjhlgijfbnfklbjfilbnjlgfijkvjbhfkbnfgblfkgjbjgfkn",
                       ROLLER_TYPE, MILDENHALL_CABINET_FOLDER_TYPE, -1);

g_object_set (G_OBJECT (object), "create-roller", model, NULL);

g_signal_connect (G_OBJECT (actor), "cabinet-prev-item-activated",
                 G_CALLBACK (roller_prev_item_activated_cb), NULL);
g_signal_connect (G_OBJECT (actor), "cabinet-active-item-activated",
                 G_CALLBACK (roller_active_item_activated_cb), NULL);
clutter_actor_add_child (stage, actor);

Example Callback functions for signals “cabinet-prev-item-activated” and “cabinet-active-item-activated”

1
2
3
4
5
6
7
8
9
10
11
12
13
static void
roller_prev_item_activated_cb (MildenhallCabinetRoller *roller, guint row,
                              ThornburyModel *model, gpointer data)
{
  g_debug ("roller_prev_item_activated_cb: %d", row)
}

static void
roller_active_item_activated_cb (MildenhallCabinetRoller *roller, guint row,
                                ThornburyModel *model, gpointer data)
{
  g_debug ("roller_active_item_activated_cb: %d", row)
}

Functions

mildenhall_cabinet_roller_new ()

MildenhallCabinetRoller *
mildenhall_cabinet_roller_new (void);

Creates a new cabinet roller object

Returns

a newly created MildenhallCabinetRoller.

[transfer full]

Types and Values

MILDENHALL_CABINET_PICTURE_OVERLAY_PATH

#define MILDENHALL_CABINET_PICTURE_OVERLAY_PATH        "0"

MILDENHALL_CABINET_BOOKMARK_OVERLAY_PATH

#define MILDENHALL_CABINET_BOOKMARK_OVERLAY_PATH       "1"

MILDENHALL_CABINET_FOLDER_OVERLAY_PATH

#define MILDENHALL_CABINET_FOLDER_OVERLAY_PATH         "2"

MILDENHALL_CABINET_MUSIC_OVERLAY_PATH

#define MILDENHALL_CABINET_MUSIC_OVERLAY_PATH          "3"

MILDENHALL_CABINET_VIDEO_OVERLAY_PATH

#define MILDENHALL_CABINET_VIDEO_OVERLAY_PATH          "4"

MILDENHALL_CABINET_DOC_OVERLAY_PATH

#define MILDENHALL_CABINET_DOC_OVERLAY_PATH            "5"

MILDENHALL_CABINET_DELICOUS_OVERLAY_PATH

#define MILDENHALL_CABINET_DELICOUS_OVERLAY_PATH       "6"

Property Details

The “active-roller” property

  “active-roller”            ClutterActor *

returns the active roller object

Flags: Read


The “create-roller” property

  “create-roller”            GObject *

Model to use to construct the items

Flags: Write


The “set-roller” property

  “set-roller”               GObject *

Model to use to construct the items

Flags: Write


The “show-prev-roller” property

  “show-prev-roller”         gboolean

If TRUE, will show the prev roller directly, FALSE otherwise

Flags: Write

Default value: FALSE


The “show-root-roller” property

  “show-root-roller”         gboolean

show root roller directly

Flags: Write

Default value: FALSE

Signal Details

The “cabinet-active-item-activated” signal

void
user_function (MildenhallCabinetRoller *mildenhallcabinetroller,
               guint                    arg1,
               GObject                 *arg2,
               gpointer                 user_data)

Emitted when an item gets activated, only if the item doesn't block the release event.

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “cabinet-locking-finished” signal

void
user_function (MildenhallCabinetRoller *mildenhallcabinetroller,
               gpointer                 user_data)

Emitted when the locking animation finishes

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “cabinet-prev-item-activated” signal

void
user_function (MildenhallCabinetRoller *mildenhallcabinetroller,
               guint                    arg1,
               GObject                 *arg2,
               gpointer                 user_data)

Emitted when an item gets activated, only if the item doesn't block the release event.

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “cabinet-same-prev-item-activated” signal

void
user_function (MildenhallCabinetRoller *mildenhallcabinetroller,
               guint                    arg1,
               GObject                 *arg2,
               gpointer                 user_data)

Flags: Run Last


The “cabinet-wipe-completed” signal

void
user_function (MildenhallCabinetRoller *mildenhallcabinetroller,
               guint                    arg1,
               GObject                 *arg2,
               gpointer                 user_data)

Emitted when an item gets activated, only if the item doesn't block the release event.

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “cabinet-wipe-started” signal

void
user_function (MildenhallCabinetRoller *mildenhallcabinetroller,
               guint                    arg1,
               GObject                 *arg2,
               gpointer                 user_data)

Emitted when an item gets activated, only if the item doesn't block the release event.

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

See Also

ClutterActor, ThornburyItemFactory