![]() |
![]() |
![]() |
nbtk Reference Manual | |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
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);
GObject +----ClutterChildMeta +----NbtkWidgetChild +----NbtkTableChild
GObject +----GInitiallyUnowned +----ClutterActor +----NbtkWidget +----NbtkBin +----NbtkEntry +----NbtkGrid +----NbtkLabel +----NbtkTable +----NbtkTooltip
"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
"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
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.
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.
void nbtk_widget_set_style_pseudo_class (NbtkWidget *actor, const gchar *pseudo_class);
Set the style pseudo class
|
a NbtkWidget |
|
a new pseudo class string |
const gchar * nbtk_widget_get_style_pseudo_class (NbtkWidget *actor);
Get the current style pseudo class
|
a NbtkWidget |
Returns : |
the pseudo class string. The string is owned by the NbtkWidget and should not be modified or freed. |
void nbtk_widget_set_style_class_name (NbtkWidget *actor, const gchar *style_class);
Set the style class name
|
a NbtkWidget |
|
a new style class string |
const gchar * nbtk_widget_get_style_class_name (NbtkWidget *actor);
Get the current style class name
|
a NbtkWidget |
Returns : |
the class name string. The string is owned by the NbtkWidget and should not be modified or freed. |
guint nbtk_widget_get_dnd_threshold (NbtkWidget *actor);
Retrieves the drag and drop threshold.
|
a NbtkWidget |
Returns : |
the current threshold. |
void nbtk_widget_set_dnd_threshold (NbtkWidget *actor, guint threshold);
Sets the drag and drop threshold.
|
a NbtkWidget |
|
the threshold. |
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.
|
a NbtkWidget |
|
a ClutterActor |
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.
|
a NbtkWidget |
|
a ClutterActor |
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.
|
A NbtkWidget |
Returns : |
a ClutterActor |
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.
|
A NbtkWidget |
Returns : |
ClutterActor |
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.
|
A NbtkWidget |
|
A pointer to an NbtkPadding to fill |
"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.
"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
"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
"pseudo-class"
property"pseudo-class" gchar* : Read / Write
The pseudo-class of the actor. Typical values include "hover", "active", "focus".
Default value: ""
"stylable"
property"stylable" gboolean : Read / Write
Enable or disable styling of the widget
Default value: TRUE
"style-class"
property"style-class" gchar* : Read / Write
The style-class of the actor for use in styling.
Default value: ""
"tooltip-text"
property"tooltip-text" gchar* : Read / Write
text displayed on the tooltip
Default value: ""
"dnd-begin"
signalvoid 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.
|
the ClutterActor that received the signal |
|
ClutterActor that is being dragged. |
|
ClutterActor representing the actor being dragged. |
|
x coordinate of the event |
|
y coordinate of the event |
|
user data set when the signal handler was connected. |
"dnd-dropped"
signalvoid 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.
|
ClutterActor that received the signal |
|
ClutterActor that is being dragged. |
|
ClutterActor representing the actor being dragged. |
|
x coordinate of the event |
|
y coordinate of the event |
|
user data set when the signal handler was connected. |
"dnd-end"
signalvoid 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.
|
ClutterActor that received the signal |
|
ClutterActor that is being dragged. |
|
ClutterActor representing the actor being dragged. |
|
x coordinate of the event |
|
y coordinate of the event |
|
user data set when the signal handler was connected. |
"dnd-enter"
signalvoid 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.
|
ClutterActor that received the signal |
|
ClutterActor that is being dragged. |
|
ClutterActor representing the actor being dragged. |
|
x coordinate of the event |
|
y coordinate of the event |
|
user data set when the signal handler was connected. |
"dnd-leave"
signalvoid 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.
|
ClutterActor that received the signal |
|
ClutterActor that is being dragged. |
|
ClutterActor representing the actor being dragged. |
|
x coordinate of the event |
|
y coordinate of the event |
|
user data set when the signal handler was connected. |
"dnd-motion"
signalvoid 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.
|
ClutterActor that received the signal |
|
ClutterActor that is being dragged. |
|
ClutterActor representing the actor being dragged. |
|
x coordinate of the event |
|
y coordinate of the event |
|
user data set when the signal handler was connected. |
"style-changed"
signalvoid 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
|
the actor that received the signal |
|
user data set when the signal handler was connected. |