MildenhallInfoRoller

MildenhallInfoRoller — It is a combination of drawer and either a fixed roller or a variable roller.

Functions

Properties

gboolean fix-roller Read / Write
gboolean header-left-icon Read / Write
GObject * header-model Read / Write
gboolean header-right-icon Read / Write
gfloat height Read
GType * item-type Read / Write
gboolean list-roller Read / Write
GObject * model Read / Write
gboolean show Read / Write
gfloat width Read

Signals

void info-roller-animated No Recursion
void info-roller-down-animation-started No Recursion
void info-roller-item-selected No Recursion
void info-roller-up-animation-started No Recursion

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── MildenhallInfoRoller

Implemented Interfaces

MildenhallInfoRoller implements ClutterContainer, ClutterScriptable, ClutterAnimatable and AtkImplementorIface.

Description

MildenhallInfoRoller widget is a kind of a drawer which contains elements arranged in inside a roller. The roller can be of variable/fixed. It supports model using which the applications can fill the data to the model.

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
{
  COLUMN_LEFT_ICON_TEXT,
  COLUMN_MID_TEXT,
  COLUMN_RIGHT_ICON_TEXT,
  COLUMN_LAST
};

How to create MildenhallInfoRoller

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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
g_autofree gchar *image = NULL;
g_autofree gchar *overlay_img_file = NULL;
GObject *object = NULL;
ClutterActor *roller_actor = NULL;
ThornburyModel *header_model = NULL;
ThornburyModel *model = NULL;
g_autofree gchar *launcher_video_file = NULL;
g_autofree gchar *content_video_file = NULL;

launcher_video_file = g_build_filename ("/usr/share/mildenhall",
                                       "mildenhallroller",
                                       "01_appl_launcher_2009.03.09.avi",
                                       NULL);
content_video_file = g_build_filename ("/usr/share/mildenhall",
                                      "mildenhallroller",
                                      "03_content_roll_2009.03.09.avi",
                                      NULL);
Thornburyitem_factory *item_factory = thornbury_item_factory_generate_widget_with_props (
                  MILDENHALL_TYPE_INFO_ROLLER,
                  "/usr/share/mildenhall/mildenhall_info_roller_prop.json");

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

g_signal_connect (G_OBJECT (roller_actor), "info-roller-item-selected",
		    G_CALLBACK (item_selected_cb), NULL);
g_signal_connect (G_OBJECT (roller_actor), "info-roller-animated",
		    G_CALLBACK (animated_cb), NULL);
g_signal_connect (G_OBJECT (roller_actor), "info-roller-up-animation-started",
		    G_CALLBACK (up_animation_started_cb), NULL);
g_signal_connect (G_OBJECT (roller_actor), "info-roller-down-animation-started",
		    G_CALLBACK (down_animation_started_cb), NULL);

header_model = (ThornburyModel*) thornbury_list_model_new (COLUMN_LAST,
                                                          G_TYPE_POINTER, NULL,
                                                          G_TYPE_STRING, NULL,
                                                          G_TYPE_STRING, NULL, -1);
thornbury_model_append (header_model,
                       COLUMN_LEFT_ICON_TEXT, "/usr/share/mildenhall/test-drawer-base/icon_music_AC.png",
                       COLUMN_MID_TEXT, "ALBUMS", COLUMN_RIGHT_ICON_TEXT,
                       NULL, -1);
g_object_set (roller_actor, "header-model", header_model, NULL);

model = (ThornburyModel *)thornbury_list_model_new (COLUMN_LAST,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_BOOLEAN, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_FLOAT, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   -1);
for (i = 0; i < num_of_items; i++)
{
 g_autofree gchar *column_name = g_strdup_printf ("item number %i", i);
 g_autofree gchar *column_text = g_strdup_printf ("text for item %i", i);
 thornbury_model_append (model,
                        COLUMN_NAME, column_name,
                        COLUMN_ICON, i % 2 == 0 ? icon1 : icon2,
                        COLUMN_LABEL, column_name,
                        COLUMN_TOGGLE, i % 2,
                        COLUMN_VIDEO, i % 2 == 0 ? launcher_video_file : content_video_file,
                        COLUMN_EXTRA_HEIGHT, (i % 100.0),
                        COLUMN_COVER, covers[i % 3],
                        COLUMN_THUMB,NULL,
                        COLUMN_LONG_TEXT, column_text,
                        -1);
}
mildenhall_info_roller_add_attribute (MILDENHALL_INFO_ROLLER (roller_actor),
                                     "name", 0);
mildenhall_info_roller_add_attribute (MILDENHALL_INFO_ROLLER (roller_actor),
                                     "label", 2);
g_object_set (roller_actor,
             "item-type", TYPE_SAMPLE_VARIABLE_ITEM,
             "model", model,
             NULL);
 clutter_actor_add_child (stage, roller_actor);

Example for “info-roller-item-selected”, “info-roller-animated”, “info-roller-up-animation-started”, “info-roller-down-animation-started” callback implementations.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
static void item_selected_cb (MildenhallInfoRoller *roller, guint row, gpointer data)
{
  g_debug ("selected row = %d", row);
}

static void down_animation_started_cb (MildenhallInfoRoller *roller, gpointer data)
{
  g_debug ("%s", __FUNCTION__);
}

static void up_animation_started_cb (MildenhallInfoRoller *roller, gpointer data)
{
  g_debug ("%s", __FUNCTION__);
}

static void animated_cb (MildenhallInfoRoller *roller, gpointer data)
{
  g_debug ("%s", __FUNCTION__);
}

Functions

mildenhall_info_roller_new ()

MildenhallInfoRoller *
mildenhall_info_roller_new (void);

Creates a info roller object

Returns

info roller object.

[transfer full]


mildenhall_info_roller_get_header_icon_right ()

gboolean
mildenhall_info_roller_get_header_icon_right
                               (MildenhallInfoRoller *pInfoRoller);

whether header right side has an icon or a text.

Parameters

pInfoRoller

info roller object reference

 

Returns

TRUE if header right side has an icon, FALSE if text


mildenhall_info_roller_get_header_icon_left ()

gboolean
mildenhall_info_roller_get_header_icon_left
                               (MildenhallInfoRoller *pInfoRoller);

whether header left side has an icon or a text.

Parameters

pInfoRoller

info roller object reference

 

Returns

TRUE if header left side has an icon, FALSE if text


mildenhall_info_roller_get_header_model ()

ThornburyModel *
mildenhall_info_roller_get_header_model
                               (MildenhallInfoRoller *pInfoRoller);

gets the header model containing info roller header data

Parameters

pInfoRoller

Object reference

 

Returns

header model pointer


mildenhall_info_roller_get_model ()

ThornburyModel *
mildenhall_info_roller_get_model (MildenhallInfoRoller *pInfoRoller);

gets the roller model containing info roller item data

Parameters

pInfoRoller

Object reference

 

Returns

model pointer


mildenhall_info_roller_get_item_type ()

GType
mildenhall_info_roller_get_item_type (MildenhallInfoRoller *pInfoRoller);

gets the GType of roller item.

Parameters

pInfoRoller

Object reference

 

Returns

item type


mildenhall_info_roller_get_fix_roller ()

gboolean
mildenhall_info_roller_get_fix_roller (MildenhallInfoRoller *pInfoRoller);

TRUE for FIXED_ROLLER, FLASE if roller is a variable roller

Parameters

pInfoRoller

Object reference

 

Returns

TRUE/FALSE whether roller is of fix/variable type


mildenhall_info_roller_get_width ()

gfloat
mildenhall_info_roller_get_width (MildenhallInfoRoller *pInfoRoller);

gets the width of info roller.

Parameters

pInfoRoller

Object reference

 

Returns

width of the info roller


mildenhall_info_roller_get_height ()

gfloat
mildenhall_info_roller_get_height (MildenhallInfoRoller *pInfoRoller);

gets the height of info roller.

Parameters

pInfoRoller

Object reference

 

Returns

height of the info roller


mildenhall_info_roller_get_show ()

gboolean
mildenhall_info_roller_get_show (MildenhallInfoRoller *pInfoRoller);

whether info roller is shown.

Parameters

pInfoRoller

info roller object reference

 

Returns

TRUE if info roller is shown


mildenhall_info_roller_get_list_roller ()

gboolean
mildenhall_info_roller_get_list_roller
                               (MildenhallInfoRoller *pInfoRoller);

TRUE for list roller, FLASE if roller has roll-over

Parameters

pInfoRoller

Object reference

 

Returns

TRUE/FALSE whether roller is of list/roll-over


mildenhall_info_roller_set_header_model ()

void
mildenhall_info_roller_set_header_model
                               (MildenhallInfoRoller *infoRoller,
                                ThornburyModel *pModel);

Set the model used by the meta info header

Parameters

pInfoRoller

Object reference

 

pModel

Value which need to be set for header model

 

mildenhall_info_roller_set_header_icon_right ()

void
mildenhall_info_roller_set_header_icon_right
                               (MildenhallInfoRoller *pInfoRoller,
                                gboolean bIconRight);

whether header right end has an icon or a text.

Parameters

pInfoRoller

info roller object reference

 

bIconRight

TRUE if icon else FALSE(in case of text)

 

mildenhall_info_roller_set_header_icon_left ()

void
mildenhall_info_roller_set_header_icon_left
                               (MildenhallInfoRoller *pInfoRoller,
                                gboolean bIconLeft);

whether header left side has an icon or a text. MetaInfoHeader can have more than one icon on left side which will toggle the icons on click of the left icon and signal will get emitted.

Parameters

pInfoRoller

info roller object reference

 

bIconLeft

TRUE if icon else FALSE(in case of text)

 

mildenhall_info_roller_set_fix_roller ()

void
mildenhall_info_roller_set_fix_roller (MildenhallInfoRoller *pInfoRoller,
                                       gboolean bFixedRoller);

Function to set the type of roller.

Parameters

pInfoRoller

Object reference

 

bFixedRoller

TRUE for Fixed Roller/ FALSE for Variable roller

 

mildenhall_info_roller_set_model ()

void
mildenhall_info_roller_set_model (MildenhallInfoRoller *pInfoRoller,
                                  ThornburyModel *model);

Set the model used by the roller

Parameters

pInfoRoller

Object reference

 

pModel

Value which need to be set for roller model

 

mildenhall_info_roller_set_item_type ()

void
mildenhall_info_roller_set_item_type (MildenhallInfoRoller *pInfoRoller,
                                      GType gType);

Function which the sets the item type

Parameters

pInfoRoller

info roller object reference

 

gType

GType for item type

 

mildenhall_info_roller_set_show ()

void
mildenhall_info_roller_set_show (MildenhallInfoRoller *pInfoRoller,
                                 gboolean bShow);

info roller is shown with animation if set as TRUE.

Parameters

pInfoRoller

info roller object reference

 

bShow

TRUE if roller needs to be shown

 

mildenhall_info_roller_set_list_roller ()

void
mildenhall_info_roller_set_list_roller
                               (MildenhallInfoRoller *pInfoRoller,
                                gboolean bListRoller);

info roller roll-over feature will be disabled if list roller is set as true

Parameters

pInfoRoller

info roller object reference

 

bListRoller

TRUE if roller needs to be a list

 

mildenhall_info_roller_add_attribute ()

void
mildenhall_info_roller_add_attribute (MildenhallInfoRoller *pInfoRoller,
                                      const gchar *pProperty,
                                      gint inColumn);

Maps a property of the item actors to a column of the current ThornburyModel.

Parameters

pInfoRoller

object reference

 

property

Name of the attribute

 

column

Column number

 

Types and Values

struct MildenhallInfoRoller

struct MildenhallInfoRoller;

The MildenhallInfoRoller struct contains only private data.


struct MildenhallInfoRollerClass

struct MildenhallInfoRollerClass {
	ClutterActorClass parent_class;
	
	void (* info_roller_animated) (MildenhallInfoRoller *pInfoRoller);
        void (* info_roller_up_animation_started) (MildenhallInfoRoller *pInfoRoller);
        void (* info_roller_down_animation_started) (MildenhallInfoRoller *pInfoRoller);
        void (* info_roller_item_selected) (MildenhallInfoRoller *pInfoRoller, guint uinRow);
};

The MildenhallInfoRollerClass struct contains only private data.

Members

info_roller_animated ()

class handler for the “info_roller_animated” signal

 

info_roller_up_animation_started ()

class handler for the “info_roller_up_animation_started” signal

 

info_roller_down_animation_started ()

class handler for the “info_roller_down_animation_started” signal

 

info_roller_item_selected ()

class handler for the “info_roller_item_selected” signal

 

Property Details

The “fix-roller” property

  “fix-roller”               gboolean

Roller Type to create the roller.

Flags: Read / Write

Default value: TRUE


The “header-left-icon” property

  “header-left-icon”         gboolean

Whether the icon or text on left side of header.

Flags: Read / Write

Default value: TRUE


The “header-model” property

  “header-model”             GObject *

header model having info roller header data.

Flags: Read / Write


The “header-right-icon” property

  “header-right-icon”        gboolean

Whether the icon or text on right side of header.

Flags: Read / Write

Default value: TRUE


The “height” property

  “height”                   gfloat

Height of the info roller.

Flags: Read

Allowed values: >= 0

Default value: 0


The “item-type” property

  “item-type”                GType *

Item Type for the roller item factory.

Flags: Read / Write

Allowed values: ClutterActor


The “list-roller” property

  “list-roller”              gboolean

List roller roll over disabled.

Flags: Read / Write

Default value: TRUE


The “model” property

  “model”                    GObject *

Model to use to construct the items.

Flags: Read / Write


The “show” property

  “show”                     gboolean

To show the info roller.

Flags: Read / Write

Default value: TRUE


The “width” property

  “width”                    gfloat

Width of theinfo roller .

Flags: Read

Allowed values: >= 0

Default value: 0

Signal Details

The “info-roller-animated” signal

void
user_function (MildenhallInfoRoller *mildenhallinforoller,
               gpointer              user_data)

Flags: No Recursion


The “info-roller-down-animation-started” signal

void
user_function (MildenhallInfoRoller *mildenhallinforoller,
               gpointer              user_data)

Flags: No Recursion


The “info-roller-item-selected” signal

void
user_function (MildenhallInfoRoller *mildenhallinforoller,
               guint                 arg1,
               gpointer              user_data)

Flags: No Recursion


The “info-roller-up-animation-started” signal

void
user_function (MildenhallInfoRoller *mildenhallinforoller,
               gpointer              user_data)

Flags: No Recursion

See Also

ClutterActor, ThornburyItemFactory