NbtkWidget

NbtkWidget — Base class for stylable actors

Synopsis

                    NbtkWidget;
void                nbtk_widget_set_style_pseudo_class  (NbtkWidget *actor,
                                                         const gchar *pseudo_class);
const gchar *       nbtk_widget_get_style_pseudo_class  (NbtkWidget *actor);
void                nbtk_widget_set_style_class_name    (NbtkWidget *actor,
                                                         const gchar *style_class);
const gchar *       nbtk_widget_get_style_class_name    (NbtkWidget *actor);
void                nbtk_widget_set_has_tooltip         (NbtkWidget *widget,
                                                         gboolean has_tooltip);
gboolean            nbtk_widget_get_has_tooltip         (NbtkWidget *widget);
void                nbtk_widget_set_tooltip_text        (NbtkWidget *widget,
                                                         const gchar *text);
const gchar*        nbtk_widget_get_tooltip_text        (NbtkWidget *widget);
void                nbtk_widget_show_tooltip            (NbtkWidget *widget);
void                nbtk_widget_hide_tooltip            (NbtkWidget *widget);
void                nbtk_widget_ensure_style            (NbtkWidget *widget);
ClutterActor *      nbtk_widget_get_background_image    (NbtkWidget *actor);
ClutterActor *      nbtk_widget_get_border_image        (NbtkWidget *actor);
void                nbtk_widget_get_padding             (NbtkWidget *widget,
                                                         NbtkPadding *padding);
void                nbtk_widget_draw_background         (NbtkWidget *widget);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----NbtkWidget
                     +----NbtkBin
                     +----NbtkBoxLayout
                     +----NbtkComboBox
                     +----NbtkEntry
                     +----NbtkGrid
                     +----NbtkIcon
                     +----NbtkLabel
                     +----NbtkPopup
                     +----NbtkProgressBar
                     +----NbtkTable
                     +----NbtkTooltip

Implemented Interfaces

NbtkWidget implements ClutterScriptable, ClutterAnimatable, AtkImplementorIface and NbtkStylable.

Properties

  "has-tooltip"              gboolean              : Read / Write
  "pseudo-class"             gchar*                : Read / Write
  "stylable"                 gboolean              : Read / Write
  "style-class"              gchar*                : Read / Write
  "tooltip-text"             gchar*                : Read / Write

Description

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

Actors in the Nbtk library should subclass NbtkWidget if they plan to obey to a certain NbtkStyle.

Details

NbtkWidget

typedef struct _NbtkWidget NbtkWidget;

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


nbtk_widget_set_style_pseudo_class ()

void                nbtk_widget_set_style_pseudo_class  (NbtkWidget *actor,
                                                         const gchar *pseudo_class);

Set the style pseudo class

actor :

a NbtkWidget

pseudo_class :

a new pseudo class string

nbtk_widget_get_style_pseudo_class ()

const gchar *       nbtk_widget_get_style_pseudo_class  (NbtkWidget *actor);

Get the current style pseudo class

actor :

a NbtkWidget

Returns :

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

nbtk_widget_set_style_class_name ()

void                nbtk_widget_set_style_class_name    (NbtkWidget *actor,
                                                         const gchar *style_class);

Set the style class name

actor :

a NbtkWidget

style_class :

a new style class string

nbtk_widget_get_style_class_name ()

const gchar *       nbtk_widget_get_style_class_name    (NbtkWidget *actor);

Get the current style class name

actor :

a NbtkWidget

Returns :

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

nbtk_widget_set_has_tooltip ()

void                nbtk_widget_set_has_tooltip         (NbtkWidget *widget,
                                                         gboolean has_tooltip);

Enables tooltip support on the NbtkWidget.

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 NbtkWidget

has_tooltip :

TRUE if the widget should display a tooltip

nbtk_widget_get_has_tooltip ()

gboolean            nbtk_widget_get_has_tooltip         (NbtkWidget *widget);

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

widget :

A NbtkWidget

Returns :

current value of has-tooltip on widget

nbtk_widget_set_tooltip_text ()

void                nbtk_widget_set_tooltip_text        (NbtkWidget *widget,
                                                         const gchar *text);

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

widget :

A NbtkWidget

text :

text to set as the tooltip

nbtk_widget_get_tooltip_text ()

const gchar*        nbtk_widget_get_tooltip_text        (NbtkWidget *widget);

Get the current tooltip string

widget :

A NbtkWidget

Returns :

The current tooltip string, owned by the NbtkWidget

nbtk_widget_show_tooltip ()

void                nbtk_widget_show_tooltip            (NbtkWidget *widget);

Show the tooltip for widget

widget :

A NbtkWidget

nbtk_widget_hide_tooltip ()

void                nbtk_widget_hide_tooltip            (NbtkWidget *widget);

Hide the tooltip for widget

widget :

A NbtkWidget

nbtk_widget_ensure_style ()

void                nbtk_widget_ensure_style            (NbtkWidget *widget);

Ensures that widget has read its style information.

widget :

A NbtkWidget

nbtk_widget_get_background_image ()

ClutterActor *      nbtk_widget_get_background_image    (NbtkWidget *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 NbtkWidget

Returns :

a ClutterActor

nbtk_widget_get_border_image ()

ClutterActor *      nbtk_widget_get_border_image        (NbtkWidget *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 NbtkWidget

Returns :

ClutterActor

nbtk_widget_get_padding ()

void                nbtk_widget_get_padding             (NbtkWidget *widget,
                                                         NbtkPadding *padding);

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

widget :

A NbtkWidget

padding :

A pointer to an NbtkPadding to fill

nbtk_widget_draw_background ()

void                nbtk_widget_draw_background         (NbtkWidget *widget);

Invokes NbtkWidget::draw_background() using the default background image and/or color from the widget style

This function should be used by subclasses of NbtkWidget that override the paint() virtual function and cannot chain up

widget :

a NbtkWidget

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 "pseudo-class" property

  "pseudo-class"             gchar*                : Read / Write

The pseudo-class of the actor. Typical values include "hover", "active", "focus".

Default value: ""


The "stylable" property

  "stylable"                 gboolean              : Read / Write

Enable or disable styling of the widget

Default value: TRUE


The "style-class" property

  "style-class"              gchar*                : Read / Write

The style-class of the actor for use in styling.

Default value: ""


The "tooltip-text" property

  "tooltip-text"             gchar*                : Read / Write

text displayed on the tooltip

Default value: ""