MildenhallDrawerBase

MildenhallDrawerBase — provides a swipe-based side panel to provide a central location for navigation.

Functions

ClutterActor * mildenhall_drawer_base_new ()

Properties

gboolean close Read / Write
gfloat height Read
gchar * language Read / Write
GObject * model Read / Write
gfloat tooltip-width Read
enMildenhallDrawerType type Read / Write
gfloat width Read

Signals

void drawer-button-released No Recursion
void drawer-close No Recursion
void drawer-open No Recursion
void drawer-tooltip-hidden No Recursion
void drawer-tooltip-shown No Recursion

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── MildenhallDrawerBase
                ├── MildenhallContextDrawer
                ├── MildenhallNaviDrawer
                ╰── MildenhallViewsDrawer

Implemented Interfaces

MildenhallDrawerBase implements ClutterContainer, ClutterScriptable, ClutterAnimatable and AtkImplementorIface.

Description

MildenhallDrawerBase widget can be positioned at any of the four edges of the content item. The drawer is then opened by "dragging" it from edges of the window. In general, it can be used as views drawer/menu's drawer. Both views drawer and menu's drawer extends MildenhallDrawerBase but only differs in the way it is positioned in the stage. (views drawer is positioned at the top most right side whereas menu's drawer is positoned at right most center). In addition, It is also possible for the application to show the tool-tip by providing the tooltip-text through ThronburyModel

Freeing the widget

Call g_object_unref() to free the widget.

How to create MildenhallDrawerBase

Sample C Code

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
ClutterActor *drawer = NULL;
ThornburyModel *model = NULL;

drawer = mildenhall_drawer_base_new ();
model = (ThornburyModel*) thornbury_list_model_new (COLUMN_LAST,
						      G_TYPE_STRING, NULL,
						      G_TYPE_STRING, NULL,
						      G_TYPE_STRING, NULL,
						      G_TYPE_BOOLEAN, NULL, -1);

thornbury_model_append (model,
                       COLUMN_NAME, "MUSIC",
                       COLUMN_ICON, "/var/lib/MILDENHALL_extensions/themes/test-drawer-base/icon_music_AC.png",
                       COLUMN_TOOLTIP_TEXT, "MUSIC",
                       COLUMN_REACTIVE, TRUE, -1);
thornbury_model_append (model,
                       COLUMN_NAME, "ARTISTS",
                       COLUMN_ICON, "/var/lib/MILDENHALL_extensions/themes/test-drawer-base/icon_music_artists_AC.png",
                       COLUMN_TOOLTIP_TEXT, "ARTIST",
                       COLUMN_REACTIVE, TRUE, -1);
thornbury_model_append (model,
                       COLUMN_NAME, "INTERNET",
                       COLUMN_ICON, "/var/lib/MILDENHALL_extensions/themes/test-drawer-base/icon_internet_AC.png",
                       COLUMN_TOOLTIP_TEXT, "INTERNET",
                       COLUMN_REACTIVE, TRUE, -1);
thornbury_model_append (model,
                       COLUMN_NAME, "ALBUMS",
                       COLUMN_ICON, "/var/lib/MILDENHALL_extensions/themes/test-drawer-base/icon_music_AC.png",
                       COLUMN_TOOLTIP_TEXT, "ALBUMS",
                       COLUMN_REACTIVE, TRUE, -1);

g_object_set (drawer, "model", model, NULL);

g_signal_connect (drawer, "drawer-open", G_CALLBACK (drawer_opened),
                 NULL);
g_signal_connect (drawer, "drawer-close", G_CALLBACK (drawer_closed),
                 NULL);
g_signal_connect (drawer, "drawer-button-released",
                 G_CALLBACK (drawer_button_released), NULL);
g_signal_connect (drawer, "drawer-tooltip-hidden",
                 G_CALLBACK (tooltip_hidden), NULL);
g_signal_connect (drawer, "drawer-tooltip-shown",
                 G_CALLBACK (tooltip_shown), NULL);

clutter_actor_add_child (stage, drawer);

Example of “drawer-open”, “drawer-close”, “drawer-button-released”, “drawer-tooltip-hidden”, “drawer-tooltip-shown” callback implementations.

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
static void drawer_opened (GObject *actor, gpointer user_data)
{
  g_debug ("DRAWER_WIDGET: %s", __FUNCTION__);
}

static void drawer_closed (GObject *actor, gpointer user_data)
{
  g_debug ("DRAWER_WIDGET: %s\n", __FUNCTION__);
}

static void tooltip_hidden (GObject *actor, gpointer user_data)
{
  g_debug ("DRAWER_WIDGET: %s\n", __FUNCTION__);
}

static void tooltip_shown (GObject *actor, gpointer user_data)
{
  g_debug ("DRAWER_WIDGET: %s\n", __FUNCTION__);
}

static void drawer_button_released (GObject *actor, gchar *name, gpointer user_data)
{
  g_debug ("DRAWER_WIDGET: %s\n", __FUNCTION__);
  g_debug ("DRAWER_WIDGET: button released = %s\n", name);
}

Functions

mildenhall_drawer_base_new ()

ClutterActor *
mildenhall_drawer_base_new (void);

Creates a drawer base object

Returns

Mildenhall Drawer base object.

[transfer full]

Types and Values

struct MildenhallDrawerBase

struct MildenhallDrawerBase;

The MildenhallDrawerBase struct contains only private data.


struct MildenhallDrawerBaseClass

struct MildenhallDrawerBaseClass {
	ClutterActorClass parent_class;
	void (*drawer_open)    ( GObject *pDrawer);
	void (*drawer_close)   ( GObject *pDrawer);
	void (*drawer_tooltip_shown)  ( GObject *pDrawer);
	void (*drawer_tooltip_hidden) ( GObject *pDrawer);
	void (*drawer_button_released) ( GObject *pDrawer, gchar* pButtonName);
};

The MildenhallDrawerBaseClass struct contains only private data.

Members

drawer_open ()

class handler for the “drawer_open” signal

 

drawer_close ()

class handler for the “drawer_close” signal

 

drawer_tooltip_shown ()

class handler for the “drawer_tooltip_shown” signal

 

drawer_tooltip_hidden ()

class handler for the “drawer_tooltip_hidden” signal

 

drawer_button_released ()

class handler for the “drawer_button_released” signal

 

MildenhallDrawerBasePrivate

typedef struct _MildenhallDrawerBasePrivate MildenhallDrawerBasePrivate;

Property Details

The “close” property

  “close”                    gboolean

To set the drawer close state as TRUE/FLASE Default: TRUE

Flags: Read / Write

Default value: TRUE


The “height” property

  “height”                   gfloat

Height of the drawer

Flags: Read

Allowed values: >= 0

Default value: 0


The “language” property

  “language”                 gchar *

sets language for all drawer buttons

Flags: Read / Write

Default value: "en_US"


The “model” property

  “model”                    GObject *

Model contains the data for the drawer buttons.

Drawer model each row contains: 1. button ID (name) 2. icon image path 3. tooltip text 4. reactive

If button has multi state, there should be more than one row with same button ID.For creating model please refer MildenhallDrawerBaseModelColumns

Default: NULL

Flags: Read / Write


The “tooltip-width” property

  “tooltip-width”            gfloat

Width of the tooltip box.

Flags: Read

Allowed values: >= 1

Default value: 100


The “type” property

  “type”                     enMildenhallDrawerType

Based on Drawer Type, position, background, tooltip-width will differ.

Flags: Read / Write

Default value: MILDENHALL_CONTEXT_DRAWER


The “width” property

  “width”                    gfloat

Width of the drawer

Flags: Read

Allowed values: >= 0

Default value: 0

Signal Details

The “drawer-button-released” signal

void
user_function (MildenhallDrawerBase *mildenhallDrawer,
               gchar                *buttonIndex,
               gpointer              user_data)

::drawer-button-released is emitted when drawer button is released

Parameters

mildenhallDrawer

The object which received the signal

 

buttonIndex

pressed button index

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion


The “drawer-close” signal

void
user_function (MildenhallDrawerBase *mildenhallDrawerBase,
               gpointer              user_data)

::drawer-close is emitted when drawer is closed

Parameters

mildenhallDrawerBase

The object which received the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion


The “drawer-open” signal

void
user_function (MildenhallDrawerBase *mildenhallDrawerBase,
               gpointer              user_data)

::drawer-open is emitted when drawer is opened

Parameters

mildenhallDrawerBase

The object which received the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion


The “drawer-tooltip-hidden” signal

void
user_function (MildenhallDrawerBase *mildenhallDrawerBase,
               gpointer              user_data)

::drawer-tooltip-hidden is emitted when drawer tooltip is hidden

Parameters

mildenhallDrawerBase

The object which received the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion


The “drawer-tooltip-shown” signal

void
user_function (MildenhallDrawerBase *mildenhallDrawerBase,
               gpointer              user_data)

::drawer-tooltip-shown is emitted when drawer tooltip is shown

Parameters

mildenhallDrawerBase

The object which received the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion

See Also

ClutterActor, ThornburyItemFactory, MildenhallViewsDrawer, MildenhallNaviDrawer