1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
3
* st-widget.h: Base class for St actors
5
* Copyright 2007 OpenedHand
6
* Copyright 2008, 2009 Intel Corporation.
8
* This program is free software; you can redistribute it and/or modify it
9
* under the terms and conditions of the GNU Lesser General Public License,
10
* version 2.1, as published by the Free Software Foundation.
12
* This program is distributed in the hope it will be useful, but WITHOUT ANY
13
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
17
* You should have received a copy of the GNU Lesser General Public License
18
* along with this program; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
20
* Boston, MA 02111-1307, USA.
24
#if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION)
25
#error "Only <st/st.h> can be included directly.h"
28
#ifndef __ST_WIDGET_H__
29
#define __ST_WIDGET_H__
31
#include <clutter/clutter.h>
32
#include <st/st-types.h>
33
#include <st/st-theme.h>
34
#include <st/st-theme-node.h>
38
#define ST_TYPE_WIDGET (st_widget_get_type ())
39
#define ST_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_WIDGET, StWidget))
40
#define ST_IS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_WIDGET))
41
#define ST_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_WIDGET, StWidgetClass))
42
#define ST_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_WIDGET))
43
#define ST_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_WIDGET, StWidgetClass))
45
typedef struct _StWidget StWidget;
46
typedef struct _StWidgetPrivate StWidgetPrivate;
47
typedef struct _StWidgetClass StWidgetClass;
52
* Base class for stylable actors. The contents of the #StWidget
53
* structure are private and should only be accessed through the
59
ClutterActor parent_instance;
61
StWidgetPrivate *priv;
67
* Base class for stylable actors.
72
ClutterActorClass parent_class;
75
void (* draw_background) (StWidget *self);
76
void (* style_changed) (StWidget *self);
79
GType st_widget_get_type (void) G_GNUC_CONST;
81
void st_widget_set_style_pseudo_class (StWidget *actor,
82
const gchar *pseudo_class);
83
G_CONST_RETURN gchar *st_widget_get_style_pseudo_class (StWidget *actor);
84
void st_widget_set_style_class_name (StWidget *actor,
85
const gchar *style_class);
86
G_CONST_RETURN gchar *st_widget_get_style_class_name (StWidget *actor);
87
void st_widget_set_style (StWidget *actor,
89
G_CONST_RETURN gchar *st_widget_get_style (StWidget *actor);
90
void st_widget_set_theme (StWidget *actor,
92
StTheme * st_widget_get_theme (StWidget *actor);
94
void st_widget_set_has_tooltip (StWidget *widget,
95
gboolean has_tooltip);
96
gboolean st_widget_get_has_tooltip (StWidget *widget);
97
void st_widget_set_tooltip_text (StWidget *widget,
99
const gchar* st_widget_get_tooltip_text (StWidget *widget);
101
void st_widget_show_tooltip (StWidget *widget);
102
void st_widget_hide_tooltip (StWidget *widget);
104
void st_widget_ensure_style (StWidget *widget);
107
/* Only to be used by sub-classes of StWidget */
108
void st_widget_style_changed (StWidget *widget);
109
StThemeNode *st_widget_get_theme_node (StWidget *widget);
111
ClutterActor *st_widget_get_background_image (StWidget *actor);
112
ClutterActor *st_widget_get_border_image (StWidget *actor);
113
void st_widget_draw_background (StWidget *widget);
117
#endif /* __ST_WIDGET_H__ */