NbtkWidget

NbtkWidget — Base class for stylable actors

Synopsis

                    NbtkWidgetChild;
                    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);
guint               nbtk_widget_get_dnd_threshold       (NbtkWidget *actor);
void                nbtk_widget_set_dnd_threshold       (NbtkWidget *actor,
                                                         guint threshold);
void                nbtk_widget_setup_child_dnd         (NbtkWidget *actor,
                                                         ClutterActor *child);
void                nbtk_widget_undo_child_dnd          (NbtkWidget *actor,
                                                         ClutterActor *child);
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);

Object Hierarchy

  GObject
   +----ClutterChildMeta
         +----NbtkWidgetChild
               +----NbtkTableChild
  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----NbtkWidget
                     +----NbtkBin
                     +----NbtkEntry
                     +----NbtkGrid
                     +----NbtkLabel
                     +----NbtkTable
                     +----NbtkTooltip

Implemented Interfaces

NbtkWidget implements NbtkStylable and ClutterScriptable.

Properties

  "dnd-icon"                 ClutterActor*         : Read / Write
  "dnd-threshold"            guint                 : Read / Write
  "has-tooltip"              gboolean              : Read / Write
  "pseudo-class"             gchar*                : Read / Write
  "stylable"                 gboolean              : Read / Write
  "style-class"              gchar*                : Read / Write
  "tooltip-text"             gchar*                : Read / Write

Signals

  "dnd-begin"                                      : Run First
  "dnd-dropped"                                    : Run First
  "dnd-end"                                        : Run First
  "dnd-enter"                                      : Run First
  "dnd-leave"                                      : Run First
  "dnd-motion"                                     : Run First
  "style-changed"                                  : Run Last

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

NbtkWidgetChild

typedef struct _NbtkWidgetChild NbtkWidgetChild;


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_get_dnd_threshold ()

guint               nbtk_widget_get_dnd_threshold       (NbtkWidget *actor);

Retrieves the drag and drop threshold.

actor :

a NbtkWidget

Returns :

the current threshold.

nbtk_widget_set_dnd_threshold ()

void                nbtk_widget_set_dnd_threshold       (NbtkWidget *actor,
                                                         guint threshold);

Sets the drag and drop threshold.

actor :

a NbtkWidget

threshold :

the threshold.

nbtk_widget_setup_child_dnd ()

void                nbtk_widget_setup_child_dnd         (NbtkWidget *actor,
                                                         ClutterActor *child);

Sets up child for drag and drop; this function is intended for use by NbtkWidget subclasses that wish to support DND.

actor :

a NbtkWidget

child :

a ClutterActor

nbtk_widget_undo_child_dnd ()

void                nbtk_widget_undo_child_dnd          (NbtkWidget *actor,
                                                         ClutterActor *child);

Removes the DND machinery from the child; this function is intended for use by NbtkWidget subclasses that wish to support DND.

actor :

a NbtkWidget

child :

a ClutterActor

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

Property Details

The "dnd-icon" property

  "dnd-icon"                 ClutterActor*         : Read / Write

An ClutterActor icon to use during drag and drop. When this property is not set, a clone of the dragged item is used.


The "dnd-threshold" property

  "dnd-threshold"            guint                 : Read / Write

The threshold which needs to be exceeded before motion is treated as drag. Value of 0 indicates that drag and drop is disabled.

Default value: 0


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: ""

Signal Details

The "dnd-begin" signal

void                user_function                      (NbtkWidget   *actor,
                                                        ClutterActor *dragged,
                                                        ClutterActor *icon,
                                                        gint          x,
                                                        gint          y,
                                                        gpointer      user_data)      : Run First

The ::dnd-begin signal will be emitted each time a child of the container enters into drag and drop state. When the drag and drop state ends, the ::dnd-end signal is issued.

actor :

the ClutterActor that received the signal

dragged :

ClutterActor that is being dragged.

icon :

ClutterActor representing the actor being dragged.

x :

x coordinate of the event

y :

y coordinate of the event

user_data :

user data set when the signal handler was connected.

The "dnd-dropped" signal

void                user_function                      (NbtkWidget   *actor,
                                                        ClutterActor *dragged,
                                                        ClutterActor *icon,
                                                        gint          x,
                                                        gint          y,
                                                        gpointer      user_data)      : Run First

The ::dnd-drop signal will be emitted before the ::dnd-end signal if the drag resulted in a successful drop.

actor :

ClutterActor that received the signal

dragged :

ClutterActor that is being dragged.

icon :

ClutterActor representing the actor being dragged.

x :

x coordinate of the event

y :

y coordinate of the event

user_data :

user data set when the signal handler was connected.

The "dnd-end" signal

void                user_function                      (NbtkWidget   *actor,
                                                        ClutterActor *dragged,
                                                        ClutterActor *icon,
                                                        gint          x,
                                                        gint          y,
                                                        gpointer      user_data)      : Run First

The ::dnd-end signal will be emitted each time a child of the container exists a drag and drop state. If the signal is issued due to successful drop, the ::dnd-drop signal will be issued before the ::dnd-end signal.

actor :

ClutterActor that received the signal

dragged :

ClutterActor that is being dragged.

icon :

ClutterActor representing the actor being dragged.

x :

x coordinate of the event

y :

y coordinate of the event

user_data :

user data set when the signal handler was connected.

The "dnd-enter" signal

void                user_function                      (NbtkWidget   *actor,
                                                        ClutterActor *dragged,
                                                        ClutterActor *icon,
                                                        gint          x,
                                                        gint          y,
                                                        gpointer      user_data)      : Run First

The ::dnd-enter signal will be emitted each time the dragged child enters the bounding box of a dnd-enabled NbtkWidget.

actor :

ClutterActor that received the signal

dragged :

ClutterActor that is being dragged.

icon :

ClutterActor representing the actor being dragged.

x :

x coordinate of the event

y :

y coordinate of the event

user_data :

user data set when the signal handler was connected.

The "dnd-leave" signal

void                user_function                      (NbtkWidget   *actor,
                                                        ClutterActor *dragged,
                                                        ClutterActor *icon,
                                                        gint          x,
                                                        gint          y,
                                                        gpointer      user_data)      : Run First

The ::dnd-leave signal will be emitted each time a dragged child of the container leaves the bounding box of a dnd-enabled NbtkWidget.

actor :

ClutterActor that received the signal

dragged :

ClutterActor that is being dragged.

icon :

ClutterActor representing the actor being dragged.

x :

x coordinate of the event

y :

y coordinate of the event

user_data :

user data set when the signal handler was connected.

The "dnd-motion" signal

void                user_function                      (NbtkWidget   *actor,
                                                        ClutterActor *dragged,
                                                        ClutterActor *icon,
                                                        gint          x,
                                                        gint          y,
                                                        gpointer      user_data)      : Run First

The ::dnd-motion signal will be emitted each time a child of the container changes is position due to dragging.

actor :

ClutterActor that received the signal

dragged :

ClutterActor that is being dragged.

icon :

ClutterActor representing the actor being dragged.

x :

x coordinate of the event

y :

y coordinate of the event

user_data :

user data set when the signal handler was connected.

The "style-changed" signal

void                user_function                      (NbtkWidget *actor,
                                                        gpointer    user_data)      : Run Last

The ::style-changed signal will be emitted each time the style for the object changes. This includes when any of the properties linked to the style change, including pseudo-class and style-class

actor :

the actor that received the signal

user_data :

user data set when the signal handler was connected.