2009-09-29 19:08:01 +00:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
2009-09-08 19:47:30 +00:00
|
|
|
/*
|
|
|
|
* st-widget.h: Base class for St actors
|
|
|
|
*
|
|
|
|
* Copyright 2007 OpenedHand
|
|
|
|
* Copyright 2008, 2009 Intel Corporation.
|
2010-11-10 22:00:45 +00:00
|
|
|
* Copyright 2009, 2010 Red Hat, Inc.
|
|
|
|
* Copyright 2009 Abderrahim Kitouni
|
|
|
|
* Copyright 2010 Florian Müllner
|
2009-09-08 19:47:30 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU Lesser General Public License,
|
|
|
|
* version 2.1, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT ANY
|
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
2010-11-10 22:00:45 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2009-09-08 19:47:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION)
|
|
|
|
#error "Only <st/st.h> can be included directly.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __ST_WIDGET_H__
|
|
|
|
#define __ST_WIDGET_H__
|
|
|
|
|
|
|
|
#include <clutter/clutter.h>
|
|
|
|
#include <st/st-types.h>
|
2009-09-20 01:10:15 +00:00
|
|
|
#include <st/st-theme.h>
|
|
|
|
#include <st/st-theme-node.h>
|
2009-09-08 19:47:30 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define ST_TYPE_WIDGET (st_widget_get_type ())
|
|
|
|
#define ST_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_WIDGET, StWidget))
|
|
|
|
#define ST_IS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_WIDGET))
|
|
|
|
#define ST_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_WIDGET, StWidgetClass))
|
|
|
|
#define ST_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_WIDGET))
|
|
|
|
#define ST_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_WIDGET, StWidgetClass))
|
|
|
|
|
|
|
|
typedef struct _StWidget StWidget;
|
|
|
|
typedef struct _StWidgetPrivate StWidgetPrivate;
|
|
|
|
typedef struct _StWidgetClass StWidgetClass;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* StWidget:
|
|
|
|
*
|
|
|
|
* Base class for stylable actors. The contents of the #StWidget
|
|
|
|
* structure are private and should only be accessed through the
|
|
|
|
* public API.
|
|
|
|
*/
|
|
|
|
struct _StWidget
|
|
|
|
{
|
|
|
|
/*< private >*/
|
|
|
|
ClutterActor parent_instance;
|
|
|
|
|
|
|
|
StWidgetPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* StWidgetClass:
|
|
|
|
*
|
|
|
|
* Base class for stylable actors.
|
|
|
|
*/
|
|
|
|
struct _StWidgetClass
|
|
|
|
{
|
|
|
|
/*< private >*/
|
|
|
|
ClutterActorClass parent_class;
|
|
|
|
|
2011-01-26 19:45:38 +00:00
|
|
|
/* signals */
|
|
|
|
void (* style_changed) (StWidget *self);
|
|
|
|
void (* popup_menu) (StWidget *self);
|
2011-01-04 12:14:15 +00:00
|
|
|
|
2011-01-26 19:45:38 +00:00
|
|
|
/* vfuncs */
|
2012-03-10 01:30:20 +00:00
|
|
|
|
|
|
|
/**
|
2012-04-06 14:34:52 +00:00
|
|
|
* StWidgetClass::navigate_focus:
|
2012-03-10 01:30:20 +00:00
|
|
|
* @self: the "top level" container
|
|
|
|
* @from: (allow-none): the actor that the focus is coming from
|
|
|
|
* @direction: the direction focus is moving in
|
|
|
|
*/
|
2011-01-26 19:45:38 +00:00
|
|
|
gboolean (* navigate_focus) (StWidget *self,
|
|
|
|
ClutterActor *from,
|
|
|
|
GtkDirectionType direction);
|
|
|
|
GType (* get_accessible_type) (void);
|
2012-02-14 00:55:30 +00:00
|
|
|
|
|
|
|
GList * (* get_focus_chain) (StWidget *widget);
|
2009-09-08 19:47:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GType st_widget_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2010-03-19 15:45:57 +00:00
|
|
|
void st_widget_set_style_pseudo_class (StWidget *actor,
|
2010-03-19 15:37:04 +00:00
|
|
|
const gchar *pseudo_class_list);
|
|
|
|
void st_widget_add_style_pseudo_class (StWidget *actor,
|
|
|
|
const gchar *pseudo_class);
|
|
|
|
void st_widget_remove_style_pseudo_class (StWidget *actor,
|
2010-03-19 15:45:57 +00:00
|
|
|
const gchar *pseudo_class);
|
2011-03-13 13:29:13 +00:00
|
|
|
const gchar * st_widget_get_style_pseudo_class (StWidget *actor);
|
2010-03-19 15:37:04 +00:00
|
|
|
gboolean st_widget_has_style_pseudo_class (StWidget *actor,
|
|
|
|
const gchar *pseudo_class);
|
|
|
|
|
2010-03-19 15:45:57 +00:00
|
|
|
void st_widget_set_style_class_name (StWidget *actor,
|
2010-03-19 15:37:04 +00:00
|
|
|
const gchar *style_class_list);
|
|
|
|
void st_widget_add_style_class_name (StWidget *actor,
|
|
|
|
const gchar *style_class);
|
|
|
|
void st_widget_remove_style_class_name (StWidget *actor,
|
2010-03-19 15:45:57 +00:00
|
|
|
const gchar *style_class);
|
2011-03-13 13:29:13 +00:00
|
|
|
const gchar * st_widget_get_style_class_name (StWidget *actor);
|
2010-03-19 15:37:04 +00:00
|
|
|
gboolean st_widget_has_style_class_name (StWidget *actor,
|
|
|
|
const gchar *style_class);
|
|
|
|
|
2010-03-19 15:45:57 +00:00
|
|
|
void st_widget_set_style (StWidget *actor,
|
|
|
|
const gchar *style);
|
2011-03-13 13:29:13 +00:00
|
|
|
const gchar * st_widget_get_style (StWidget *actor);
|
2010-03-19 15:45:57 +00:00
|
|
|
void st_widget_set_theme (StWidget *actor,
|
|
|
|
StTheme *theme);
|
|
|
|
StTheme * st_widget_get_theme (StWidget *actor);
|
|
|
|
|
2010-03-19 17:47:34 +00:00
|
|
|
void st_widget_set_track_hover (StWidget *widget,
|
|
|
|
gboolean track_hover);
|
|
|
|
gboolean st_widget_get_track_hover (StWidget *widget);
|
|
|
|
void st_widget_set_hover (StWidget *widget,
|
|
|
|
gboolean hover);
|
|
|
|
void st_widget_sync_hover (StWidget *widget);
|
|
|
|
gboolean st_widget_get_hover (StWidget *widget);
|
2013-05-07 06:28:13 +00:00
|
|
|
void st_widget_popup_menu (StWidget *self);
|
2010-03-19 17:47:34 +00:00
|
|
|
|
2010-03-19 15:45:57 +00:00
|
|
|
void st_widget_ensure_style (StWidget *widget);
|
|
|
|
|
2010-06-15 16:11:39 +00:00
|
|
|
void st_widget_set_can_focus (StWidget *widget,
|
|
|
|
gboolean can_focus);
|
|
|
|
gboolean st_widget_get_can_focus (StWidget *widget);
|
|
|
|
gboolean st_widget_navigate_focus (StWidget *widget,
|
|
|
|
ClutterActor *from,
|
|
|
|
GtkDirectionType direction,
|
|
|
|
gboolean wrap_around);
|
|
|
|
|
2011-03-08 18:33:41 +00:00
|
|
|
ClutterActor * st_widget_get_label_actor (StWidget *widget);
|
|
|
|
void st_widget_set_label_actor (StWidget *widget,
|
|
|
|
ClutterActor *label);
|
|
|
|
|
2009-09-08 19:47:30 +00:00
|
|
|
/* Only to be used by sub-classes of StWidget */
|
2010-03-19 15:45:57 +00:00
|
|
|
void st_widget_style_changed (StWidget *widget);
|
|
|
|
StThemeNode * st_widget_get_theme_node (StWidget *widget);
|
2010-11-02 20:09:49 +00:00
|
|
|
StThemeNode * st_widget_peek_theme_node (StWidget *widget);
|
2009-09-20 01:10:15 +00:00
|
|
|
|
2012-02-14 00:55:30 +00:00
|
|
|
GList * st_widget_get_focus_chain (StWidget *widget);
|
2012-02-13 21:41:29 +00:00
|
|
|
void st_widget_paint_background (StWidget *widget);
|
2012-02-14 00:55:30 +00:00
|
|
|
|
2010-06-20 02:16:06 +00:00
|
|
|
/* debug methods */
|
|
|
|
char *st_describe_actor (ClutterActor *actor);
|
|
|
|
void st_set_slow_down_factor (gfloat factor);
|
|
|
|
gfloat st_get_slow_down_factor (void);
|
2009-09-08 19:47:30 +00:00
|
|
|
|
2012-02-27 16:23:42 +00:00
|
|
|
/* accessibility methods */
|
2012-03-09 23:16:56 +00:00
|
|
|
void st_widget_set_accessible_role (StWidget *widget,
|
|
|
|
AtkRole role);
|
|
|
|
AtkRole st_widget_get_accessible_role (StWidget *widget);
|
|
|
|
void st_widget_add_accessible_state (StWidget *widget,
|
|
|
|
AtkStateType state);
|
|
|
|
void st_widget_remove_accessible_state (StWidget *widget,
|
|
|
|
AtkStateType state);
|
2012-03-15 18:32:21 +00:00
|
|
|
void st_widget_set_accessible_name (StWidget *widget,
|
|
|
|
const gchar *name);
|
|
|
|
const gchar * st_widget_get_accessible_name (StWidget *widget);
|
2012-02-27 16:23:42 +00:00
|
|
|
|
2013-06-14 21:53:59 +00:00
|
|
|
/* utility methods */
|
|
|
|
void st_get_align_factors (StAlign x_align,
|
|
|
|
StAlign y_align,
|
|
|
|
gdouble *x_align_out,
|
|
|
|
gdouble *y_align_out);
|
|
|
|
|
2009-09-08 19:47:30 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __ST_WIDGET_H__ */
|