PopupInfo

PopupInfo — Its an implementation for LightwoodPopupBase.

Functions

void popup_info_show ()
void popup_info_hide ()

Properties

GObject * model Read / Write
BarkwayPopupType popupinfo-type Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── LightwoodPopupBase
                ╰── PopupInfo

Includes

#include <include/mildenhall_roller_container.h>

Description

PopupInfo shall be able to show text followed by 3 buttons (which shall be used to show text/interactive buttons to show in a popup). It supports model, using wich the applications can fill the following data required for the popup. 1. MSGSTYLE - Text-Active/Text-Passive 2. MSGTEXT - Text Messgae in String 3. IMAGEICON - AppIcon/MessageIcon 4. BUTTONTEXT - Text for the button1 5. BUTTONNUM - Button number out of three buttons 6. IMAGEPATH - Image path for the Icon 7. TIMER - Timeout value to be set for the popup

Freeing the widget

Call g_object_unref() to free the widget.

Sample C Code

How to create PopupInfo

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
ThornburyItemFactory *item_factory = NULL;
gdouble timeout;
ThornburyModel *model = NULL;
GObject *object = NULL;
PopupInfo *actor = NULL;

model = (ThornburyModel*) thornbury_list_model_new (COLUMN_LAST,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_STRING, NULL,
                                                   G_TYPE_INT, NULL, -1);

 item_factory = thornbury_item_factory_generate_widget_with_props (
            POPUP_TYPE_INFO,
            "/usr/share/mildenhall/mildenhall_popup_prop.json");

 g_object_get (item_factory, "object", &object, NULL);
 actor = POPUP_INFO (object);
 g_signal_connect (actor, "popup-shown", (GCallback) shown_cb, NULL);
 g_signal_connect (actor, "popup-hidden", (GCallback) hidden_cb, NULL);
 g_signal_connect (actor, "popup-action", (GCallback) action_cb, NULL);

 thornbury_model_append (model,
                        MSGSTYLE, "Text-Active",
                        MSGTEXT, "RATE THE APP",
                        IMAGEICON, "AppIcon",
                        BUTTONTEXT, "R A T E",
                        BUTTONNUM, "BUTTON1",
                        IMAGEPATH, "/var/lib/MILDENHALL_extensions/themes/blau/icon_request_inactive.png",
                        TIMER, 10, -1);

 thornbury_model_append (model, BUTTONTEXT, "N O",
                        BUTTONNUM, "BUTTON2",
                        IMAGEICON, "MsgIcon", IMAGEPATH,
                        "/var/lib/MILDENHALL_extensions/themes/blau/icon_request_inactive.png",
                        -1);

 thornbury_model_append (model, BUTTONTEXT, "T H I R D", -1);
 g_object_set (actor, "model", model, NULL);
 clutter_actor_add_child (stage, CLUTTER_ACTOR (actor));
 popup_info_show (actor);

Example for “popup-shown”, “popup-hidden” and “popup-action” callback implementations.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
gboolean shown_cb (PopupInfo *actor, gpointer data)
{
  return FALSE;
}

gboolean hidden_cb (PopupInfo *actor, gpointer data)
{
  return FALSE;
}

gboolean action_cb (PopupInfo *actor, gchar *button,
                   gpointer value, gpointer data)
{
  return FALSE;
}

Functions

popup_info_show ()

void
popup_info_show (gpointer data);

Function which shows the popup

Parameters

data

gpointer data which is holding objects reference.

 

popup_info_hide ()

void
popup_info_hide (gpointer data);

Function which hides the popup

Parameters

data

gpointer data which is holding objects reference.

 

Types and Values

MMD_POPUP_BUTTON_TXT_CORRECTION_FACTOR

#define MMD_POPUP_BUTTON_TXT_CORRECTION_FACTOR      8

POPUP_PATH

#define POPUP_PATH                  PKGTHEMEDIR "/"

MMD_REQUEST_ICON

#define MMD_REQUEST_ICON            POPUP_PATH "icon_request_inactive.png"

MMD_APP_ICON

#define MMD_APP_ICON                MMD_REQUEST_ICON

MMD_INFO_ICON

#define MMD_INFO_ICON               POPUP_PATH "icon_request_info.png"

MMD_ERROR_ICON

#define MMD_ERROR_ICON              POPUP_PATH "icon_request_error.png"

MMD_POPUP_BUTTON1_TEXT_X

#define MMD_POPUP_BUTTON1_TEXT_X    161

MMD_POPUP_BUTTON1_TEXT_Y

#define MMD_POPUP_BUTTON1_TEXT_Y    152

MMD_POPUP_BUTTON2_TEXT_X

#define MMD_POPUP_BUTTON2_TEXT_X    486

MMD_POPUP_BUTTON2_TEXT_Y

#define MMD_POPUP_BUTTON2_TEXT_Y    152

MMD_SINGLE_BUTTON_WIDTH

#define MMD_SINGLE_BUTTON_WIDTH     648

MAX_NUM_POPUP_BUTTON

#define MAX_NUM_POPUP_BUTTON        2

MMD_POPUP_SHOWTIME

#define MMD_POPUP_SHOWTIME          750

MMD_POPUP_SHOW_X

#define MMD_POPUP_SHOW_X            79

MMD_POPUP_SHOW_Y

#define MMD_POPUP_SHOW_Y            286

MMD_POPUP_HIDE_X

#define MMD_POPUP_HIDE_X            79

MMD_POPUP_HIDE_Y

#define MMD_POPUP_HIDE_Y            458

MMD_POPUP_TEXT_LETTER_NUM

#define MMD_POPUP_TEXT_LETTER_NUM   44

MMD_POPUP_MAX_TEXT_LEN

#define MMD_POPUP_MAX_TEXT_LEN      88

MMD_POPUP_TXT_LINE_MID_X

#define MMD_POPUP_TXT_LINE_MID_X    324

MMD_POPUP_TXT_LINE1_MID_Y

#define MMD_POPUP_TXT_LINE1_MID_Y   50

MMD_POPUP_TXT_LINE2_MID_Y

#define MMD_POPUP_TXT_LINE2_MID_Y   86

MMD_POPUP_TXT_LINE_MID_Y

#define MMD_POPUP_TXT_LINE_MID_Y    68

Property Details

The “model” property

  “model”                    GObject *

model data for popup widget

Flags: Read / Write


The “popupinfo-type” property

  “popupinfo-type”           BarkwayPopupType

popup info type of popup widget DEFAULT:BARKWAY_POPUP_TYPE_ENUM_INFO_OR_ERROR

Flags: Read / Write

Default value: INFO_OR_ERROR

See Also

ClutterActor, ThornburyItemFactory, LightwoodPopupBase