comparison Plugins/Visualization/paranormal/pn/pnuserobject.h @ 1507:0c5fdcf3f947 trunk

[svn] - incomplete stuff
author nenolod
date Sun, 06 Aug 2006 01:53:29 -0700
parents
children
comparison
equal deleted inserted replaced
1506:2a8e193c07a6 1507:0c5fdcf3f947
1 /* Paranormal - A highly customizable audio visualization library
2 * Copyright (C) 2001 Jamie Gennis <jgennis@mindspring.com>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19 #ifndef __PN_USER_OBJECT_H__
20 #define __PN_USER_OBJECT_H__
21
22 #include "pnobject.h"
23 #include "pnxml.h"
24
25
26 G_BEGIN_DECLS
27
28
29 #define PN_TYPE_USER_OBJECT (pn_user_object_get_type ())
30 #define PN_USER_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PN_TYPE_USER_OBJECT, PnUserObject))
31 #define PN_USER_OBJECT_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), PN_TYPE_USER_OBJECT, PnUserObjectClass))
32 #define PN_IS_USER_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PN_TYPE_USER_OBJECT))
33 #define PN_IS_USER_OBJECT_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), PN_TYPE_USER_OBJECT))
34 #define PN_USER_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PN_TYPE_USER_OBJECT, PnUserObjectClass))
35 #define PN_USER_OBJECT_CLASS_TYPE(class) (G_TYPE_FROM_CLASS (class))
36 #define PN_USER_OBJECT_CLASS_NAME(class) (g_type_name (PN_USER_OBJECT_CLASS_TYPE (class)))
37
38 #define PN_USER_OBJECT_TYPE(obj) (G_TYPE_FROM_INSTANCE (obj))
39 #define PN_USER_OBJECT_TYPE_NAME(obj) (g_type_name (PN_USER_OBJECT_TYPE (obj)))
40
41 #define PN_USER_OBJECT_NAME(obj) (PN_USER_OBJECT (obj)->name)
42 #define PN_USER_OBJECT_DESC(obj) (PN_USER_OBJECT (obj)->desc)
43 #define PN_USER_OBJECT_OWNER(obj) (PN_USER_OBJECT (obj)->owner)
44
45 typedef struct _PnUserObject PnUserObject;
46 typedef struct _PnUserObjectClass PnUserObjectClass;
47
48 struct _PnUserObject
49 {
50 PnObject parent;
51
52 gchar *name;
53 gchar *desc;
54 PnUserObject *owner;
55 };
56
57 struct _PnUserObjectClass
58 {
59 PnObjectClass parent_class;
60
61 void (* save_thyself) (PnUserObject *user_object,
62 xmlNodePtr node);
63 void (* load_thyself) (PnUserObject *user_object,
64 xmlNodePtr node);
65 };
66
67 GType pn_user_object_get_type (void);
68 #define pn_user_object_destroy(object) pn_object_destroy (PN_OBJECT (object))
69
70 /* Accessors */
71 void pn_user_object_set_name (PnUserObject *user_object,
72 const gchar *name);
73 gchar *pn_user_object_get_name (PnUserObject *user_object);
74 void pn_user_object_set_description (PnUserObject *user_object,
75 const gchar *desc);
76 gchar *pn_user_object_get_description (PnUserObject *user_object);
77 void pn_user_object_set_owner (PnUserObject *user_object,
78 PnUserObject *owner);
79 PnUserObject *pn_user_object_get_owner (PnUserObject *user_object);
80
81 /* Actions */
82 void pn_user_object_save_thyself (PnUserObject *user_object,
83 xmlNodePtr node);
84 void pn_user_object_load_thyself (PnUserObject *user_object,
85 xmlNodePtr node);
86
87
88
89
90
91 #endif /* __PN_USER_OBJECT_H__ */