~mterry/ubuntu/natty/gnome-shell/wip

« back to all changes in this revision

Viewing changes to src/st/st-widget.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-10-12 22:44:00 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091012224400-k91p42yvou07i525
Tags: 2.28.0-0ubuntu1
* New upstream version
* debian/control:
  - updated build requirement
* debian/patches/80_git_change_fix_alt_tab_ressource_usage.patch:
  - git change to fix ressources not being freed on alt-tab

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 
2
/*
 
3
 * st-widget.h: Base class for St actors
 
4
 *
 
5
 * Copyright 2007 OpenedHand
 
6
 * Copyright 2008, 2009 Intel Corporation.
 
7
 *
 
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.
 
11
 *
 
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
 
15
 * more details.
 
16
 *
 
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.
 
21
 *
 
22
 */
 
23
 
 
24
#if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION)
 
25
#error "Only <st/st.h> can be included directly.h"
 
26
#endif
 
27
 
 
28
#ifndef __ST_WIDGET_H__
 
29
#define __ST_WIDGET_H__
 
30
 
 
31
#include <clutter/clutter.h>
 
32
#include <st/st-types.h>
 
33
#include <st/st-theme.h>
 
34
#include <st/st-theme-node.h>
 
35
 
 
36
G_BEGIN_DECLS
 
37
 
 
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))
 
44
 
 
45
typedef struct _StWidget               StWidget;
 
46
typedef struct _StWidgetPrivate        StWidgetPrivate;
 
47
typedef struct _StWidgetClass          StWidgetClass;
 
48
 
 
49
/**
 
50
 * StWidget:
 
51
 *
 
52
 * Base class for stylable actors. The contents of the #StWidget
 
53
 * structure are private and should only be accessed through the
 
54
 * public API.
 
55
 */
 
56
struct _StWidget
 
57
{
 
58
  /*< private >*/
 
59
  ClutterActor parent_instance;
 
60
 
 
61
  StWidgetPrivate *priv;
 
62
};
 
63
 
 
64
/**
 
65
 * StWidgetClass:
 
66
 *
 
67
 * Base class for stylable actors.
 
68
 */
 
69
struct _StWidgetClass
 
70
{
 
71
  /*< private >*/
 
72
  ClutterActorClass parent_class;
 
73
 
 
74
  /* vfuncs */
 
75
  void (* draw_background) (StWidget *self);
 
76
  void (* style_changed)   (StWidget *self);
 
77
};
 
78
 
 
79
GType st_widget_get_type (void) G_GNUC_CONST;
 
80
 
 
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,
 
88
                                                        const gchar *style);
 
89
G_CONST_RETURN gchar *st_widget_get_style              (StWidget    *actor);
 
90
void                  st_widget_set_theme              (StWidget    *actor,
 
91
                                                        StTheme     *theme);
 
92
StTheme *             st_widget_get_theme              (StWidget    *actor);
 
93
 
 
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,
 
98
                                         const gchar *text);
 
99
const gchar* st_widget_get_tooltip_text (StWidget    *widget);
 
100
 
 
101
void st_widget_show_tooltip (StWidget *widget);
 
102
void st_widget_hide_tooltip (StWidget *widget);
 
103
 
 
104
void st_widget_ensure_style (StWidget *widget);
 
105
 
 
106
 
 
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);
 
110
 
 
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);
 
114
 
 
115
G_END_DECLS
 
116
 
 
117
#endif /* __ST_WIDGET_H__ */