Documentation fixed for bug #351657.
[platform/core/uifw/at-spi2-atk.git] / cspi / spi-private.h
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2002 Ximian, Inc.
6  *           2002 Sun Microsystems Inc.
7  *           
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24
25 #ifndef _SPI_PRIVATE_H_
26 #define _SPI_PRIVATE_H_
27
28 /* Private internal implementation details of at-spi. */
29
30 #include <libspi/Accessibility.h>
31 #include <cspi/spi.h>
32 #include "cspi/cspi-lowlevel.h"
33 #include "cspi/spi-listener.h"
34
35 struct _Accessible {
36         CORBA_Object objref;
37         /* And some other bits */
38         guint        on_loan : 1;
39         guint        ref_count : 30;
40 };
41
42 struct _AccessibleStateSet {
43         guint   ref_count;
44         GArray *states;
45 };
46
47 #define SPI_INTERNAL_EVENT_MAGIC 0xc3
48 /* 
49  * For internal use by CSPI implementation only
50  */
51 typedef struct {
52   AccessibleEvent event;
53   guint           id;
54   guchar          magic;
55   guchar          type;
56   guint16         ref_count;
57   void           *data; 
58 } InternalEvent;
59
60 struct _SPIException {
61   SPIExceptionType type;
62   CORBA_Object source;
63   CORBA_Environment *ev;
64   SPIExceptionCode code;
65   char * desc;
66 };
67
68 #define CSPI_OBJREF(a) (((Accessible *)(a))->objref)
69
70 CORBA_Environment     *cspi_ev                (void);
71 CORBA_Environment     *cspi_peek_ev           (void);
72 SPIBoolean             cspi_exception         (void);
73 Accessibility_Registry cspi_registry          (void);
74 Accessible            *cspi_object_add        (CORBA_Object corba_object);
75 void                   cspi_object_ref        (Accessible  *accessible);
76 void                   cspi_object_unref      (Accessible  *accessible);
77 Accessible            *cspi_object_borrow     (CORBA_Object corba_object);
78 Accessible            *cspi_object_take       (CORBA_Object corba_object);
79 void                   cspi_object_return     (Accessible  *accessible);
80 SPIBoolean             cspi_accessible_is_a   (Accessible  *accessible,
81                                                const char  *interface_name);
82 AccessibleRole         cspi_role_from_spi_role (Accessibility_Role role);
83 void                   cspi_streams_close_all (void);
84 gboolean               cspi_exception_throw (CORBA_Environment *ev, char *desc_prefix);
85
86 AccessibleAttributeSet 
87                      *_cspi_attribute_set_from_sequence (const Accessibility_AttributeSet *seq);
88 #define cspi_return_if_fail(val)                \
89         if (!(val))                             \
90                 return
91 #define cspi_return_val_if_fail(val, ret)       \
92         if (!(val))                             \
93                 return (ret)
94
95 #define cspi_return_if_ev(err)                  \
96         if (!cspi_check_ev (err))               \
97                 return;
98 #define cspi_return_val_if_ev(err, ret) \
99         if (!cspi_check_ev (err))               \
100                 return (ret);
101
102 #endif /* _SPI_PRIVATE_H_ */