annotate Plugins/Visualization/paranormal/pn/pnobject.h @ 1717:837983bac90f trunk

[svn] Fixed a lot of warnings that only showed up on *BSD.
author js
date Sat, 16 Sep 2006 16:26:54 -0700
parents 0c5fdcf3f947
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1507
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
1 /* Paranormal - A highly customizable audio visualization library
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
2 * Copyright (C) 2001 Jamie Gennis <jgennis@mindspring.com>
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
3 *
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
4 * This library is free software; you can redistribute it and/or
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
5 * modify it under the terms of the GNU Library General Public
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
6 * License as published by the Free Software Foundation; either
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
7 * version 2 of the License, or (at your option) any later version.
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
8 *
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
9 * This library is distributed in the hope that it will be useful,
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
12 * Library General Public License for more details.
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
13 *
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
14 * You should have received a copy of the GNU Library General Public
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
15 * License along with this library; if not, write to the Free
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
17 */
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
18
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
19 #ifndef __PN_OBJECT_H__
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
20 #define __PN_OBJECT_H__
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
21
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
22 #include <config.h>
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
23
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
24 #include <glib.h>
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
25 #include <glib-object.h>
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
26
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
27 G_BEGIN_DECLS
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
28
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
29 #define PN_TYPE_OBJECT (pn_object_get_type ())
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
30 #define PN_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PN_TYPE_OBJECT, PnObject))
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
31 #define PN_OBJECT_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), PN_TYPE_OBJECT, PnObjectClass))
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
32 #define PN_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PN_TYPE_OBJECT))
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
33 #define PN_IS_OBJECT_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), PN_TYPE_OBJECT))
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
34 #define PN_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PN_TYPE_OBJECT, PnObjectClass))
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
35 #define PN_OBJECT_CLASS_TYPE(class) (G_TYPE_FROM_CLASS (class))
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
36 #define PN_OBJECT_CLASS_NAME(class) (g_type_name (PN_OBJECT_CLASS_TYPE (class)))
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
37
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
38 #define PN_OBJECT_TYPE(obj) (G_TYPE_FROM_INSTANCE (obj))
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
39 #define PN_OBJECT_TYPE_NAME(obj) (g_type_name (PN_OBJECT_TYPE (obj)))
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
40
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
41 typedef enum
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
42 {
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
43 PN_DESTROYED = 1 << 0,
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
44 PN_FLOATING = 1 << 1,
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
45 PN_RESERVED_1 = 1 << 2,
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
46 PN_RESERVED_2 = 1 << 3
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
47 } PnObjectFlags;
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
48
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
49 #define PN_OBJECT_FLAGS(obj) (PN_OBJECT (obj)->flags)
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
50 #define PN_OBJECT_DESTROYED(obj) ((PN_OBJECT_FLAGS (obj) & PN_DESTROYED) != 0)
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
51 #define PN_OBJECT_FLOATING(obj) ((PN_OBJECT_FLAGS (obj) & PN_FLOATING) != 0)
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
52 #define PN_OBJECT_CONNECTED(obj) ((PN_OBJECT_FLAGS (obj) & PN_CONNECTED) != 0)
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
53
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
54 #define PN_OBJECT_SET_FLAGS(obj,flag) G_STMT_START{ (PN_OBJECT_FLAGS (obj) |= (flag)); }G_STMT_END
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
55 #define PN_OBJECT_UNSET_FLAGS(obj,flag) G_STMT_START{ (PN_OBJECT_FLAGS (obj) &= ~(flag)); }G_STMT_END
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
56
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
57 typedef struct _PnObject PnObject;
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
58 typedef struct _PnObjectClass PnObjectClass;
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
59
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
60 struct _PnObject
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
61 {
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
62 GObject parent;
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
63
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
64 /* Only the first four bits are used, so derived classes can use this
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
65 * for their own flags
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
66 */
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
67 guint32 flags;
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
68 };
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
69
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
70 struct _PnObjectClass
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
71 {
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
72 GObjectClass parent_class;
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
73
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
74 /* if a class overrides this then it MUST call its superclass'
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
75 * implimentation
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
76 */
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
77 void (*destroy) (PnObject *object);
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
78 };
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
79
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
80 /* Creators */
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
81 GType pn_object_get_type (void);
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
82
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
83 /* Referencing */
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
84 PnObject* pn_object_ref (PnObject *object);
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
85 void pn_object_unref (PnObject *object);
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
86 void pn_object_sink (PnObject *object);
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
87
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
88 /* Destruction */
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
89 void pn_object_destroy (PnObject *object);
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
90
0c5fdcf3f947 [svn] - incomplete stuff
nenolod
parents:
diff changeset
91 #endif /* __PN_OBJECT_H__ */