MxWidget

MxWidget — Base class for stylable actors

Synopsis

                    MxWidget;
void                mx_widget_get_available_area        (MxWidget *widget,
                                                         const ClutterActorBox *allocation,
                                                         ClutterActorBox *area);
void                mx_widget_set_style_pseudo_class    (MxWidget *actor,
                                                         const gchar *pseudo_class);
const gchar *       mx_widget_get_style_pseudo_class    (MxWidget *actor);
void                mx_widget_set_style_class_name      (MxWidget *actor,
                                                         const gchar *style_class);
const gchar *       mx_widget_get_style_class_name      (MxWidget *actor);
void                mx_widget_set_has_tooltip           (MxWidget *widget,
                                                         gboolean has_tooltip);
gboolean            mx_widget_get_has_tooltip           (MxWidget *widget);
void                mx_widget_set_tooltip_text          (MxWidget *widget,
                                                         const gchar *text);
const gchar*        mx_widget_get_tooltip_text          (MxWidget *widget);
void                mx_widget_show_tooltip              (MxWidget *widget);
void                mx_widget_hide_tooltip              (MxWidget *widget);
void                mx_widget_ensure_style              (MxWidget *widget);
ClutterActor *      mx_widget_get_background_image      (MxWidget *actor);
ClutterActor *      mx_widget_get_border_image          (MxWidget *actor);
void                mx_widget_get_padding               (MxWidget *widget,
                                                         MxPadding *padding);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----MxWidget
                     +----MxBin
                     +----MxBoxLayout
                     +----MxComboBox
                     +----MxEntry
                     +----MxGrid
                     +----MxIcon
                     +----MxLabel
                     +----MxNotebook
                     +----MxFloatingWidget
                     +----MxProgressBar
                     +----MxTable
                     +----MxToggle

Implemented Interfaces

MxWidget implements ClutterScriptable and MxStylable.

Properties

  "has-tooltip"              gboolean              : Read / Write
  "tooltip-text"             gchar*                : Read / Write

Description

MxWidget is a simple abstract class on top of ClutterActor. It provides basic themeing properties.

Actors in the Mx library should subclass MxWidget if they plan to obey to a certain MxStyle.

Details

MxWidget

typedef struct _MxWidget MxWidget;

Base class for stylable actors. The contents of the MxWidget structure are private and should only be accessed through the public API.


mx_widget_get_available_area ()

void                mx_widget_get_available_area        (MxWidget *widget,
                                                         const ClutterActorBox *allocation,
                                                         ClutterActorBox *area);

widget :

allocation :

area :


mx_widget_set_style_pseudo_class ()

void                mx_widget_set_style_pseudo_class    (MxWidget *actor,
                                                         const gchar *pseudo_class);

Set the style pseudo class

actor :

a MxWidget

pseudo_class :

a new pseudo class string

mx_widget_get_style_pseudo_class ()

const gchar *       mx_widget_get_style_pseudo_class    (MxWidget *actor);

Get the current style pseudo class

actor :

a MxWidget

Returns :

the pseudo class string. The string is owned by the MxWidget and should not be modified or freed.

mx_widget_set_style_class_name ()

void                mx_widget_set_style_class_name      (MxWidget *actor,
                                                         const gchar *style_class);

Set the style class name

actor :

a MxWidget

style_class :

a new style class string

mx_widget_get_style_class_name ()

const gchar *       mx_widget_get_style_class_name      (MxWidget *actor);

Get the current style class name

actor :

a MxWidget

Returns :

the class name string. The string is owned by the MxWidget and should not be modified or freed.

mx_widget_set_has_tooltip ()

void                mx_widget_set_has_tooltip           (MxWidget *widget,
                                                         gboolean has_tooltip);

Enables tooltip support on the MxWidget.

Note that setting has-tooltip to TRUE will cause the widget to be set reactive. If you no longer need tooltip support and do not need the widget to be reactive, you need to set ClutterActor::reactive to FALSE.

widget :

A MxWidget

has_tooltip :

TRUE if the widget should display a tooltip

mx_widget_get_has_tooltip ()

gboolean            mx_widget_get_has_tooltip           (MxWidget *widget);

Returns the current value of the has-tooltip property. See mx_tooltip_set_has_tooltip() for more information.

widget :

A MxWidget

Returns :

current value of has-tooltip on widget

mx_widget_set_tooltip_text ()

void                mx_widget_set_tooltip_text          (MxWidget *widget,
                                                         const gchar *text);

Set the tooltip text of the widget. This will set MxWidget::has-tooltip to TRUE. A value of NULL will unset the tooltip and set has-tooltip to FALSE.

widget :

A MxWidget

text :

text to set as the tooltip

mx_widget_get_tooltip_text ()

const gchar*        mx_widget_get_tooltip_text          (MxWidget *widget);

Get the current tooltip string

widget :

A MxWidget

Returns :

The current tooltip string, owned by the MxWidget

mx_widget_show_tooltip ()

void                mx_widget_show_tooltip              (MxWidget *widget);

Show the tooltip for widget

widget :

A MxWidget

mx_widget_hide_tooltip ()

void                mx_widget_hide_tooltip              (MxWidget *widget);

Hide the tooltip for widget

widget :

A MxWidget

mx_widget_ensure_style ()

void                mx_widget_ensure_style              (MxWidget *widget);

Ensures that widget has read its style information.

widget :

A MxWidget

mx_widget_get_background_image ()

ClutterActor *      mx_widget_get_background_image      (MxWidget *actor);

Get the texture used as the background image. This is set using the "background-image" CSS property. This function should normally only be used by subclasses.

actor :

A MxWidget

Returns :

a ClutterActor

mx_widget_get_border_image ()

ClutterActor *      mx_widget_get_border_image          (MxWidget *actor);

Get the texture used as the border image. This is set using the "border-image" CSS property. This function should normally only be used by subclasses.

actor :

A MxWidget

Returns :

ClutterActor

mx_widget_get_padding ()

void                mx_widget_get_padding               (MxWidget *widget,
                                                         MxPadding *padding);

Gets the padding of the widget, set using the "padding" CSS property. This function should normally only be used by subclasses.

widget :

A MxWidget

padding :

A pointer to an MxPadding to fill

Property Details

The "has-tooltip" property

  "has-tooltip"              gboolean              : Read / Write

Determines whether the widget has a tooltip. If set to TRUE, causes the widget to monitor enter and leave events (i.e. sets the widget reactive).

Default value: FALSE


The "tooltip-text" property

  "tooltip-text"             gchar*                : Read / Write

text displayed on the tooltip

Default value: ""