MildenhallSpeller

MildenhallSpeller — It is a widget which allows a user to enter the different set of characters.

Functions

Properties

gint cursor-entry Read / Write
MildenhallSpellerEntryType entry Read / Write
gboolean hidden Read / Write
gboolean history-support Read / Write
gchar * layout Read / Write
gchar * layout-state Read / Write
GObject * model Read / Write
gboolean shown Read / Write
guint speller-state Read
gboolean text-selection Read / Write
gfloat y-offset Read / Write

Signals

void entry-status No Recursion
void go-pressed No Recursion
void key-pad-pressed No Recursion
void speller-hidden No Recursion
void speller-shown No Recursion

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── MildenhallSpeller

Implemented Interfaces

MildenhallSpeller implements ClutterContainer, ClutterScriptable, ClutterAnimatable and AtkImplementorIface.

Includes

#include <include/mildenhall_roller_container.h>

Description

A virtual keyboard. It works by using its own text entry widgets rather than by sending key events immediately to the application. There are signals to be notified when the user has pressed a key and when text is committed. It provides 'history-support' using which the speller can show auto complete text when the user has entered any of the characters. The signal "key-pad-pressed" shall be emitted to the applications whenever the user has pressed any of the characters from the Keypad. The Speller provided by Mildenhall supports several types of entries where text can be typed. The entry type can be specified as a property of the Speller object.

Freeing the widget

Call g_object_unref() to free the widget.

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
46
47
48
49
50
51
52
53
ThornburyItemFactory *item_factory = NULL;
ThornburyModel *speller_model = NULL;
GObject *object = NULL;
MildenhallSpeller *self = NULL;
ClutterActor *actor = NULL;
GVariantBuilder *row_values = NULL, *row_values1 = NULL;
GVariant *p = NULL, *q = NULL;

item_factory = thornbury_item_factory_generate_widget_with_props (
            MILDENHALL_TYPE_SPELLER,
            "/usr/share/mildenhall/mildenhall_speller_prop.json");
g_object_get (item_factory, "object", &object, NULL);
self = MILDENHALL_SPELLER (object);
actor = CLUTTER_ACTOR (self);
clutter_actor_add_child (stage, actor);

speller_model = thornbury_list_model_new (COLUMN_LAST, G_TYPE_BOOLEAN,
                                         0, G_TYPE_FLOAT, 0,
                                         G_TYPE_STRING, NULL,
                                         G_TYPE_POINTER, NULL,
                                         G_TYPE_BOOLEAN, 0,
                                         G_TYPE_FLOAT, 0,
                                         G_TYPE_STRING, NULL,
                                         G_TYPE_POINTER, NULL,
                                         G_TYPE_STRING, NULL,
                                         G_TYPE_STRING, NULL, -1);

row_values = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
g_variant_builder_add (row_values, "{ss}", "SEARCH", "SEARCH");
g_variant_builder_add (row_values, "{ss}", "URL", "URL");

row_values1 = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
g_variant_builder_add (row_values1, "{ss}", "album",
			   "/test-drawer-base/icon_music_artists_AC.png");
g_variant_builder_add (row_values1, "{ss}", "artist",
			   "/test-drawer-base/icon_internet_AC.png");

p = g_variant_builder_end (row_values);
q = g_variant_builder_end (row_values1);

//append model info for default entry
thornbury_model_append (speller_model, COLUMN_LEFT_IS_TEXT, TRUE,
                       COLUMN_LEFT_WIDTH, 158.0, COLUMN_LEFT_ID,
                       "BUTTON1", COLUMN_LEFT_INFO, (gpointer) p,
                       COLUMN_RIGHT_IS_TEXT, FALSE, COLUMN_RIGHT_WIDTH, 58.0,
                       COLUMN_RIGHT_ID, "BUTTON2",
                       COLUMN_RIGHT_INFO, (gpointer) q,
                       COLUMN_TEXT_BOX_DEFAULT_TEXT, "", COLUMN_ENTRY_ID,
                       "entry", -1);

g_object_set (actor, "model", speller_model, NULL);
g_variant_unref (row_values);
g_variant_unref (row_values1);

Functions

MILDENHALL_SPELLER_PRINT()

#define MILDENHALL_SPELLER_PRINT(...) //g_print(__VA_ARGS__)

mildenhall_speller_new ()

MildenhallSpeller *
mildenhall_speller_new (void);

Creates a speller object

Returns

a new MildenhallSpeller.

[transfer full]


mildenhall_speller_show ()

void
mildenhall_speller_show (ClutterActor *speller,
                         gboolean animate);

api to show the speller


mildenhall_speller_hide ()

void
mildenhall_speller_hide (ClutterActor *speller,
                         gboolean animate);

api to hide the speller

Types and Values

struct MildenhallSpeller

struct MildenhallSpeller;

The MildenhallSpeller struct contains only private data.


struct MildenhallSpellerClass

struct MildenhallSpellerClass {
  ClutterActorClass parent_class;

  void (*shown)                         (MildenhallSpeller *self);
  void (*hidden)                        (MildenhallSpeller *self);
  void (*go_pressed)                    (MildenhallSpeller *self,
                                         const GVariant *variant);
  void (*key_pad_pressed)               (MildenhallSpeller *self,
                                         guint keypad,
                                         const gchar *keyname);
  void (*entry_status)                  (MildenhallSpeller *self,
                                         const gchar *button_name,
                                         const gchar *button_id);
};

Property Details

The “cursor-entry” property

  “cursor-entry”             gint

this to set focus entry

Flags: Read / Write

Allowed values: [0,40]

Default value: 0


The “entry” property

  “entry”                    MildenhallSpellerEntryType

set entry type according to requriment

Flags: Read / Write

Default value: DEFAULT_ENTRY


The “hidden” property

  “hidden”                   gboolean

set hidden to TRUE/FALSE

Flags: Read / Write

Default value: TRUE


The “history-support” property

  “history-support”          gboolean

set history-support to TRUE/FALSE

Flags: Read / Write

Default value: FALSE


The “layout” property

  “layout”                   gchar *

set layout

Flags: Read / Write

Default value: NULL


The “layout-state” property

  “layout-state”             gchar *

set layout-state

Flags: Read / Write

Default value: NULL


The “model” property

  “model”                    GObject *

Sets data to the speller.To give the data to speller refer MildenhallSpellerModelColumns.

Flags: Read / Write


The “shown” property

  “shown”                    gboolean

set shown to TRUE/FALSE

Flags: Read / Write

Default value: FALSE


The “speller-state” property

  “speller-state”            guint

set speller-state to LOWER/UPPER/SYMBOL

Flags: Read

Allowed values: <= 3

Default value: 3


The “text-selection” property

  “text-selection”           gboolean

set TRUE to select the text

Flags: Read / Write

Default value: FALSE


The “y-offset” property

  “y-offset”                 gfloat

set y-offset to 0 for default

Flags: Read / Write

Allowed values: >= 0

Default value: 0

Signal Details

The “entry-status” signal

void
user_function (MildenhallSpeller *self,
               gchar             *button_name,
               gchar             *button_id,
               gpointer           user_data)

Signal emitted entry is pressed

Parameters

self

a MildenhallSpeller reference

 

button_name

the name of button

 

button_id

the id of button

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion


The “go-pressed” signal

void
user_function (MildenhallSpeller *self,
               GVariant          *arg1,
               gpointer           user_data)

Signal emitted when go button is pressed

Parameters

self

a MildenhallSpeller

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion


The “key-pad-pressed” signal

void
user_function (MildenhallSpeller *self,
               guint              keypad,
               gchar             *keyname,
               gpointer           user_data)

Signal emitted when key-pad is pressed

Parameters

self

a MildenhallSpeller

 

keypad

pressed keypad

 

keyname

pressed keypad name

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion


The “speller-hidden” signal

void
user_function (MildenhallSpeller *self,
               gpointer           user_data)

Signal emitted speller is hidden

Parameters

self

a MildenhallSpeller

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion


The “speller-shown” signal

void
user_function (MildenhallSpeller *self,
               gpointer           user_data)

Signal emitted speller is shown

Parameters

self

a MildenhallSpeller

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion

See Also

ClutterActor, ThornburyItemFactory, ThornburyModel