MildenhallPullupRoller

MildenhallPullupRoller — A widget that mixes a drawer, a MetaInfoFooter from Mildenhall and either a FixedRoller or a VariableRoller from Lightwood.

Functions

Properties

gboolean fix-roller Read / Write
gboolean footer-left-icon Read / Write
GObject * footer-model Read / Write
gboolean footer-ratings Read / Write
gfloat height Read
GType * item-type Read / Write
GObject * model Read / Write
gboolean show Read / Write
gfloat width Read

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── MildenhallPullupRoller

Implemented Interfaces

MildenhallPullupRoller implements ClutterContainer, ClutterScriptable, ClutterAnimatable and AtkImplementorIface.

Description

MildenhallPullupRoller can be opened to show the roller. It differs from InfoRoller, In that it uses a MetaInfoFooter to provide the base of the drawer.

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_NONE
};

A private enum to set model columns

1
2
3
4
5
6
7
8
enum
{
  COLUMN_NAME1,
  COLUMN_ICON1,
  COLUMN_TOOLTIP_TEXT,
  COLUMN_REACTIVE,
  COLUMN_LAST1
};

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
80
ThornburyItemFactory *item_factory1;
ThornburyItemFactory *item_factory;
GObject *object = NULL;
ClutterActor *pullup_roller = NULL;
ThornburyModel *footer_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);
item_factory = thornbury_item_factory_generate_widget_with_props (
		MILDENHALL_TYPE_PULLUP_ROLLER,
		"/usr/share/mildenhall/mildenhall_pullup_roller_prop.json");

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

g_signal_connect (pullup_roller, "pullup-roller-item-selected",
                 G_CALLBACK (pullup_item_selected_cb), pullup_roller);
g_signal_connect (pullup_roller, "pullup-roller-animated",
                 G_CALLBACK (pullup_animated_cb), pullup_roller);
g_signal_connect (pullup_roller, "pullup-roller-up-animation-started",
                 G_CALLBACK (pullup_up_animation_started_cb), pullup_roller);
g_signal_connect (pullup_roller, "pullup-roller-down-animation-started",
                 G_CALLBACK (pullup_down_animation_started_cb), pullup_roller);

footer_model = (ThornburyModel*) thornbury_list_model_new (COLUMN_NONE,
                                                          G_TYPE_STRING, NULL,
                                                          G_TYPE_STRING, NULL,
                                                          G_TYPE_POINTER, NULL, -1);
thornbury_model_append (footer_model,
                       COLUMN_LEFT_ICON_TEXT, "/usr/share/mildenhall/test-drawer-base/icon_music_AC.png",
                       COLUMN_MID_TEXT, "A L B U M S",
                       COLUMN_RIGHT_ICON_TEXT, NULL,
                       -1);
g_object_set (pullup_roller, "footer-model", footer_model, NULL);

ThornburyModel *model2 = (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 < 20; i++)
{
  g_autfree gchar *number = g_strdup_printf ("item number %i", i);
  g_autfree gchar *text = g_strdup_printf ("text for item %i", i);
  thornbury_model_append (model2,
                         COLUMN_NAME, number,
                         COLUMN_ICON, i % 2 == 0 ? icon1 : icon2,
                         COLUMN_LABEL, number,
                         COLUMN_TOGGLE, i % 2,
                         COLUMN_VIDEO, i % 2 == 0 ? launcher_video_file : content_video_file,
                         COLUMN_EXTRA_HEIGHT, (float) (i % 100),
                         COLUMN_COVER, covers[i % 3],
                         COLUMN_THUMB,NULL,
                         COLUMN_LONG_TEXT, text,
                         -1);
}

mildenhall_pullup_roller_add_attribute (
    	MILDENHALL_PULLUP_ROLLER (pullup_roller), "name", 0);
mildenhall_pullup_roller_add_attribute (
    	MILDENHALL_PULLUP_ROLLER (pullup_roller), "label", 2);
mildenhall_pullup_roller_add_attribute (
    	MILDENHALL_PULLUP_ROLLER (pullup_roller), "extra-height", 5);
g_object_set (pullup_roller, "item-type", TYPE_SAMPLE_VARIABLE_ITEM, "model",
             model2, NULL);
clutter_actor_add_child (stage, pullup_roller);

Example for “pullup-roller-item-selected”, “pullup-roller-animated”, “pullup-roller-up-animation-started”, “pullup-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
20
21
22
23
24
25
26
27
28
29
30
31
32
static void
pullup_item_selected_cb (MildenhallPullupRoller *roller, guint row,
                        gpointer data)
{
  g_debug ("row = %d", row);

}

static void
pullup_up_animation_started_cb (MildenhallPullupRoller *roller, gpointer data)
{
  g_object_set (MILDENHALL_INFO_ROLLER(data), "show", FALSE, NULL);
}

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

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

static void
info_pullup_item_selected_cb (MildenhallInfoRoller *roller, guint row,
                             gpointer data)
{
  g_debug ("row = %d", row);
}

Functions

mildenhall_pullup_roller_new ()

MildenhallPullupRoller *
mildenhall_pullup_roller_new (void);

Creates a pullup roller object

Returns

returns a newly created MildenhallPullupRoller.

[transfer full]


mildenhall_pullup_roller_get_footer_ratings ()

gboolean
mildenhall_pullup_roller_get_footer_ratings
                               (MildenhallPullupRoller *pPullupRoller);

whether footer right side has an ratings.

Parameters

pPullupRoller

pullup roller object reference

 

Returns

TRUE if footer right side has ratings star, FALSE otherwise


mildenhall_pullup_roller_get_footer_icon_left ()

gboolean
mildenhall_pullup_roller_get_footer_icon_left
                               (MildenhallPullupRoller *pPullupRoller);

whether footer left side has an icon or a text.

Parameters

pPullupRoller

pullup roller object reference

 

Returns

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


mildenhall_pullup_roller_get_footer_model ()

ThornburyModel *
mildenhall_pullup_roller_get_footer_model
                               (MildenhallPullupRoller *pPullupRoller);

gets the footer model containing pullup roller footer data

Parameters

pPullupRoller

Object reference

 

Returns

model of type ThornburyModel


mildenhall_pullup_roller_get_model ()

ThornburyModel *
mildenhall_pullup_roller_get_model (MildenhallPullupRoller *pPullupRoller);

gets the roller model containing pullup roller item data

Parameters

pPullupRoller

Object reference

 

Returns

model of type ThornburyModel


mildenhall_pullup_roller_get_item_type ()

GType
mildenhall_pullup_roller_get_item_type
                               (MildenhallPullupRoller *pPullupRoller);

gets the GType of roller item.

Parameters

pPullupRoller

Object reference

 

Returns

item type of GType


mildenhall_pullup_roller_get_fix_roller ()

gboolean
mildenhall_pullup_roller_get_fix_roller
                               (MildenhallPullupRoller *pPullupRoller);

TRUE for FIXED_ROLLER, FLASE if roller is a variable roller

Parameters

pPullupRoller

Object reference

 

Returns

TRUE/FALSE whether roller is of fix/variable type


mildenhall_pullup_roller_get_width ()

gfloat
mildenhall_pullup_roller_get_width (MildenhallPullupRoller *pPullupRoller);

gets the width of pullup roller.

Parameters

pPullupRoller

Object reference

 

Returns

width of the roller in float value


mildenhall_pullup_roller_get_height ()

gfloat
mildenhall_pullup_roller_get_height (MildenhallPullupRoller *pPullupRoller);

gets the height of pullup roller.

Parameters

pPullupRoller

Object reference

 

Returns

height of the roller in float value


mildenhall_pullup_roller_get_show ()

gboolean
mildenhall_pullup_roller_get_show (MildenhallPullupRoller *pPullupRoller);

whether pullup roller is shown.

Parameters

pPullupRoller

pullup roller object reference

 

Returns

TRUE if pullup roller is shown


mildenhall_pullup_roller_set_footer_model ()

void
mildenhall_pullup_roller_set_footer_model
                               (MildenhallPullupRoller *pullupRoller,
                                ThornburyModel *pModel);

Set the model used by the meta info footer

Parameters

pPullupRoller

Object reference

 

pModel

Value which need to be set for footer model

 

mildenhall_pullup_roller_set_footer_ratings ()

void
mildenhall_pullup_roller_set_footer_ratings
                               (MildenhallPullupRoller *pPullupRoller,
                                gboolean bIconRight);

whether footer right end has raings stars.

Parameters

pPullupRoller

pullup roller object reference

 

bRatings

TRUE if icon else FALSE(in case of text)

 

mildenhall_pullup_roller_set_footer_icon_left ()

void
mildenhall_pullup_roller_set_footer_icon_left
                               (MildenhallPullupRoller *pPullupRoller,
                                gboolean bIconLeft);

whether footer 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

pPullupRoller

pullup roller object reference

 

bIconLeft

TRUE if icon else FALSE(in case of text)

 

mildenhall_pullup_roller_set_fix_roller ()

void
mildenhall_pullup_roller_set_fix_roller
                               (MildenhallPullupRoller *pPullupRoller,
                                gboolean bFixedRoller);

roller type as enum : FIXED_ROLLER / VARIABLE_ROLLER

Parameters

pPullupRoller

Object reference

 

bFixedRoller

set to TRUE for fixed roller else FALSE

 

mildenhall_pullup_roller_set_model ()

void
mildenhall_pullup_roller_set_model (MildenhallPullupRoller *pPullupRoller,
                                    ThornburyModel *model);

Set the model used by the roller

Parameters

pPullupRoller

Object reference

 

pModel

Value which need to be set for roller model

 

mildenhall_pullup_roller_set_item_type ()

void
mildenhall_pullup_roller_set_item_type
                               (MildenhallPullupRoller *pPullupRoller,
                                GType gType);

item type as GType for roller tiem

Parameters

pPullupRoller

pullup roller object reference

 

gType

GType for item type

 

mildenhall_pullup_roller_set_show ()

void
mildenhall_pullup_roller_set_show (MildenhallPullupRoller *pPullupRoller,
                                   gboolean bShow);

pullup roller is shown with animation if set as TRUE.

Parameters

pPullupRoller

pullup roller object reference

 

bShow

TRUE if roller needs to be shown

 

mildenhall_pullup_roller_add_attribute ()

void
mildenhall_pullup_roller_add_attribute
                               (MildenhallPullupRoller *pPullupRoller,
                                const gchar *pProperty,
                                gint inColumn);

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

Parameters

pPullupRoller

object reference

 

pProperty

Name of the attribute

 

inColumn

Column number

 

Types and Values

struct MildenhallPullupRoller

struct MildenhallPullupRoller;

The MildenhallPullupRoller struct contains only private data.


struct MildenhallPullupRollerClass

struct MildenhallPullupRollerClass {
	ClutterActorClass parent_class;
	
	void (* pullup_roller_animated) (MildenhallPullupRoller *pPullupRoller);
        void (* pullup_roller_up_animation_started) (MildenhallPullupRoller *pPullupRoller);
        void (* pullup_roller_down_animation_started) (MildenhallPullupRoller *pPullupRoller);
        void (* pullup_roller_item_selected) (MildenhallPullupRoller *pPullupRoller, guint uinRow);
};

The MildenhallPullupRollerClass struct contains only private data.

Members

pullup_roller_animated ()

class handler for the “pullup_roller_animated” signal

 

pullup_roller_up_animation_started ()

class handler for the “pullup_roller_up_animation_started” signal

 

pullup_roller_down_animation_started ()

class handler for the “pullup_roller_down_animation_started” signal

 

pullup_roller_item_selected ()

class handler for the “pullup_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 “footer-left-icon” property

  “footer-left-icon”         gboolean

Whether the icon or text on left side of footer.

Flags: Read / Write

Default value: TRUE


The “footer-model” property

  “footer-model”             GObject *

footer model having pullup roller footer data.

Flags: Read / Write


The “footer-ratings” property

  “footer-ratings”           gboolean

Whether the footer right side ratings star required.

Flags: Read / Write

Default value: FALSE


The “height” property

  “height”                   gfloat

Height of the pullup 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 “model” property

  “model”                    GObject *

Model to use to construct the items.

Flags: Read / Write


The “show” property

  “show”                     gboolean

To show the pullup roller.

Flags: Read / Write

Default value: TRUE


The “width” property

  “width”                    gfloat

Width of thepullup roller .

Flags: Read

Allowed values: >= 0

Default value: 0

Signal Details

The “pullup-roller-animated” signal

void
user_function (MildenhallPullupRoller *mildenhallpulluproller,
               gpointer                user_data)

Flags: No Recursion


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

void
user_function (MildenhallPullupRoller *mildenhallpulluproller,
               gpointer                user_data)

Flags: No Recursion


The “pullup-roller-item-selected” signal

void
user_function (MildenhallPullupRoller *mildenhallpulluproller,
               guint                   arg1,
               gpointer                user_data)

Flags: No Recursion


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

void
user_function (MildenhallPullupRoller *mildenhallpulluproller,
               gpointer                user_data)

Flags: No Recursion

See Also

ClutterActor, ThornburyItemFactory