2006-12-03 Dimitris Glezos <dimitris@glezos.com>
[dia.git] / lib / prop_basic.h
blobb1ac544dfa2ef300b24135eeed2320002778b61f
1 /* Dia -- a diagram creation/manipulation program -*- c -*-
2 * Copyright (C) 1998 Alexander Larsson
4 * Property system for dia objects/shapes.
5 * Copyright (C) 2000 James Henstridge
6 * Copyright (C) 2001 Cyrille Chepelov
7 * Major restructuration done in August 2001 by C. Chepelov
9 * Basic Property types definition.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 #ifndef PROP_BASIC_H
27 #define PROP_BASIC_H
29 #include "properties.h"
30 #include "dia_xml.h"
32 void initialize_property(Property *prop, const PropDescription *pdesc,
33 PropDescToPropPredicate reason);
34 void copy_init_property(Property *dest, const Property *src);
36 typedef struct {
37 Property common;
38 } NoopProperty;
40 NoopProperty *noopprop_new(const PropDescription *pdesc,
41 PropDescToPropPredicate reason);
42 void noopprop_free(NoopProperty *prop);
43 NoopProperty *noopprop_copy(NoopProperty *src);
44 WIDGET *noopprop_get_widget(NoopProperty *prop, PropDialog *dialog);
45 void noopprop_reset_widget(NoopProperty *prop, WIDGET *widget);
46 void noopprop_set_from_widget(NoopProperty *prop, WIDGET *widget);
47 void noopprop_load(NoopProperty *prop, AttributeNode attr, DataNode data);
48 void noopprop_save(NoopProperty *prop, AttributeNode attr);
49 gboolean noopprop_can_merge(const PropDescription *pd1,
50 const PropDescription *pd2);
51 gboolean noopprop_cannot_merge(const PropDescription *pd1,
52 const PropDescription *pd2);
53 void noopprop_get_from_offset(const NoopProperty *prop,
54 void *base, guint offset, guint offset2);
55 void noopprop_set_from_offset(NoopProperty *prop,
56 void *base, guint offset, guint offset2);
58 typedef struct {
59 Property common;
60 } InvalidProperty;
62 InvalidProperty *invalidprop_new(const PropDescription *pdesc,
63 PropDescToPropPredicate reason);
64 void invalidprop_free(InvalidProperty *prop);
65 InvalidProperty *invalidprop_copy(InvalidProperty *src);
66 WIDGET *invalidprop_get_widget(InvalidProperty *prop, PropDialog *dialog);
67 void invalidprop_reset_widget(InvalidProperty *prop, WIDGET *widget);
68 void invalidprop_set_from_widget(InvalidProperty *prop, WIDGET *widget);
69 void invalidprop_load(InvalidProperty *prop, AttributeNode attr,
70 DataNode data);
71 void invalidprop_save(InvalidProperty *prop, AttributeNode attr);
72 gboolean invalidprop_can_merge(const PropDescription *pd1,
73 const PropDescription *pd2);
74 void invalidprop_get_from_offset(const InvalidProperty *prop,
75 void *base, guint offset, guint offset2);
76 void invalidprop_set_from_offset(InvalidProperty *prop,
77 void *base, guint offset, guint offset2);
78 typedef struct {
79 Property common;
80 } UnimplementedProperty;
82 UnimplementedProperty *unimplementedprop_new(const PropDescription *pdesc,
83 PropDescToPropPredicate reason);
84 void unimplementedprop_free(UnimplementedProperty *prop);
85 UnimplementedProperty *unimplementedprop_copy(UnimplementedProperty *src);
86 WIDGET *unimplementedprop_get_widget(UnimplementedProperty *prop,
87 PropDialog *dialog);
88 void unimplementedprop_reset_widget(UnimplementedProperty *prop,
89 WIDGET *widget);
90 void unimplementedprop_set_from_widget(UnimplementedProperty *prop,
91 WIDGET *widget);
92 void unimplementedprop_load(UnimplementedProperty *prop,
93 AttributeNode attr, DataNode data);
94 void unimplementedprop_save(UnimplementedProperty *prop, AttributeNode attr);
95 gboolean unimplementedprop_can_merge(const PropDescription *pd1,
96 const PropDescription *pd2);
97 void unimplementedprop_get_from_offset(const UnimplementedProperty *prop,
98 void *base,
99 guint offset, guint offset2);
101 void unimplementedprop_set_from_offset(UnimplementedProperty *prop,
102 void *base,
103 guint offset, guint offset2);
104 void prop_basic_register(void);
106 #endif