2006-12-03 Dimitris Glezos <dimitris@glezos.com>
[dia.git] / lib / propinternals.h
blob59bc40687b8d95275bd55c68f9d7080db47f6991
1 /* Dia -- a diagram creation/manipulation program
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 * propinternals.h: prototypes for routines which might be of use to other
10 * sections of the property support code (but whose use by external code is
11 * strongly discouraged !)
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 #ifndef PROPINTERNALS_H
28 #define PROPINTERNALS_H
30 #include <glib.h>
32 #include <gtk/gtk.h>
33 #include "properties.h" /* **after** gtk.h, please */
35 /* returns TRUE if two property descriptors describe properties
36 which can be merged. */
37 gboolean propdescs_can_be_merged(const PropDescription *p1,
38 const PropDescription *p2);
40 void prophandler_connect(const Property *prop, GtkObject *object,
41 const gchar *signal);
43 /* returns FALSE if error is set cause of meesed up format */
44 gboolean prop_list_load(GPtrArray *props, DataNode data, GError **err);
45 void prop_list_save(GPtrArray *props, DataNode data);
47 #define struct_member(sp, off, tp) (*(tp *)(((char *)sp) + off))
49 Property *find_prop_by_name(const GPtrArray *props, const gchar *name);
50 Property *find_prop_by_name_and_type(const GPtrArray *props, const gchar *name,
51 PropertyType type);
53 /* ************************ */
54 /* Property dialog methods */
56 /* Add a widget without a title. This will restart a new title+widget table
57 afterwards. */
58 void prop_dialog_add_raw(PropDialog *dialog, GtkWidget *widget);
59 void prop_dialog_add_raw_with_flags(PropDialog *dialog, GtkWidget *widget,
60 gboolean expand, gboolean fill);
61 /* Register a new container widget (which won't be automatically added) */
62 void prop_dialog_container_push(PropDialog *dialog, GtkWidget *container);
63 /* De-register the last container of the stack. */
64 GtkWidget *prop_dialog_container_pop(PropDialog *dialog);
65 void prop_dialog_add_property(PropDialog *dialog, Property *prop);
67 PropDialog *prop_dialog_new(DiaObject *obj, gboolean is_default);
68 PropDialog *prop_dialog_from_widget(GtkWidget *dialog_widget);
69 void prop_dialog_destroy(PropDialog *dialog);
70 void prop_get_data_from_widgets(PropDialog *dialog);
71 WIDGET *prop_dialog_get_widget(const PropDialog *dialog);
73 void prophandler_connect(const Property *prop, GtkObject *object,
74 const gchar *signal);
76 /* Stuff in propoffsets.c: */
77 void prop_offset_list_calculate_quarks(PropOffset *offsets);
78 void do_set_props_from_offsets(void *base, GPtrArray *props,
79 const PropOffset *offsets);
80 void do_get_props_from_offsets(void *base, GPtrArray *props,
81 const PropOffset *offsets);
84 #include "prop_basic.h"
85 #include "prop_inttypes.h"
86 #include "prop_geomtypes.h"
87 #include "prop_attr.h"
88 #include "prop_text.h"
89 #include "prop_widgets.h"
90 #include "prop_sdarray.h"
92 #endif /* PROPINTERNALS_H */