summaryrefslogtreecommitdiff
path: root/clutter/clutter/cally/cally-actor.h
blob: c6c9937edb6a051764d76b52d169d88a06f394bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* CALLY - The Clutter Accessibility Implementation Library
 *
 * Copyright (C) 2008 Igalia, S.L.
 *
 * Author: Alejandro PiƱeiro Iglesias <apinheiro@igalia.com>
 *
 * Some parts are based on GailWidget from GAIL
 * GAIL - The GNOME Accessibility Implementation Library
 * Copyright 2001, 2002, 2003 Sun Microsystems Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that 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 along with this library. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __CALLY_ACTOR_H__
#define __CALLY_ACTOR_H__

#if !defined(__CALLY_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <cally/cally.h> can be included directly."
#endif

#include <atk/atk.h>
#include <clutter/clutter.h>

G_BEGIN_DECLS

#define CALLY_TYPE_ACTOR            (cally_actor_get_type ())
#define CALLY_ACTOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALLY_TYPE_ACTOR, CallyActor))
#define CALLY_ACTOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), CALLY_TYPE_ACTOR, CallyActorClass))
#define CALLY_IS_ACTOR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALLY_TYPE_ACTOR))
#define CALLY_IS_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALLY_TYPE_ACTOR))
#define CALLY_ACTOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), CALLY_TYPE_ACTOR, CallyActorClass))

typedef struct _CallyActor           CallyActor;
typedef struct _CallyActorClass      CallyActorClass;
typedef struct _CallyActorPrivate    CallyActorPrivate;

/**
 * CallyActionFunc:
 * @cally_actor: a #CallyActor
 *
 * Action function, to be used on #AtkAction implementations as a individual
 * action
 */
typedef void (* CallyActionFunc) (CallyActor *cally_actor);

/**
 * CallyActionCallback:
 * @cally_actor: a #CallyActor
 * @user_data: user data passed to the function
 *
 * Action function, to be used on #AtkAction implementations as
 * an individual action.
 * 
 * Unlike #CallyActionFunc, this function uses the @user_data 
 * argument passed to [method@Actor.add_action_full].
 */
typedef void (* CallyActionCallback) (CallyActor *cally_actor,
                                      gpointer    user_data);

struct _CallyActor
{
  /*< private >*/
  AtkGObjectAccessible parent;

  CallyActorPrivate *priv;
};

/**
 * CallyActorClass:
 * @notify_clutter: Signal handler for notify signal on Clutter actor
 * @add_actor: Signal handler for actor-added signal on
 *   ClutterContainer interface
 * @remove_actor: Signal handler for actor-added signal on
 *   ClutterContainer interface
 *
 * The <structname>CallyActorClass</structname> structure contains
 * only private data
 */
struct _CallyActorClass
{
  /*< private >*/
  AtkGObjectAccessibleClass parent_class;

  /*< public >*/
  void     (*notify_clutter) (GObject    *object,
                              GParamSpec *pspec);

  gint     (*add_actor)      (ClutterActor *container,
                              ClutterActor *actor,
                              gpointer      data);

  gint     (*remove_actor)   (ClutterActor *container,
                              ClutterActor *actor,
                              gpointer      data);

  /*< private >*/
  /* padding for future expansion */
  gpointer _padding_dummy[32];
};

CLUTTER_EXPORT
GType      cally_actor_get_type              (void) G_GNUC_CONST;

CLUTTER_EXPORT
AtkObject* cally_actor_new                   (ClutterActor        *actor);

CLUTTER_EXPORT
guint      cally_actor_add_action            (CallyActor          *cally_actor,
                                              const gchar         *action_name,
                                              const gchar         *action_description,
                                              const gchar         *action_keybinding,
                                              CallyActionFunc      action_func);
CLUTTER_EXPORT
guint      cally_actor_add_action_full       (CallyActor          *cally_actor,
                                              const gchar         *action_name,
                                              const gchar         *action_description,
                                              const gchar         *action_keybinding,
                                              CallyActionCallback  callback,
                                              gpointer             user_data,
                                              GDestroyNotify       notify);

CLUTTER_EXPORT
gboolean   cally_actor_remove_action         (CallyActor          *cally_actor,
                                              gint                 action_id);

CLUTTER_EXPORT
gboolean   cally_actor_remove_action_by_name (CallyActor          *cally_actor,
                                              const gchar         *action_name);

G_END_DECLS

#endif /* __CALLY_ACTOR_H__ */