[dia] More explicit include of properties.h
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] More explicit include of properties.h
- Date: Sun, 24 Oct 2010 15:10:49 +0000 (UTC)
commit 7b29488ff1361588e746be468f627efb41e033a7
Author: Hans Breuer <hans breuer org>
Date: Sun Oct 24 12:41:28 2010 +0200
More explicit include of properties.h
Everything in objects/ depends on std-props, but not everything
in plug-ins/ . Remove inclsuion of properties.h in text.h (needed
by every renderer) and add #include "properties.h" where it is
really needed.
Sligthly related change of Property::self to Property::self_event_data.
app/create_object.c | 1 +
app/diagram_tree_view.c | 1 +
app/sheets.c | 1 +
lib/dialib.c | 1 +
lib/element.c | 1 +
lib/object.h | 9 +++++++++
lib/propdialogs.c | 9 ++++-----
lib/properties.h | 12 +-----------
lib/text.h | 2 +-
objects/Database/reference.c | 1 +
objects/Database/table_dialog.c | 1 +
objects/Misc/tree.c | 1 +
objects/UML/transition.c | 1 +
objects/UML/uml.c | 1 +
objects/custom/shape_info.h | 1 +
objects/custom_lines/line_info.h | 1 +
objects/network/bus.c | 1 +
objects/network/wanlink.c | 1 +
tests/test-objects.c | 1 +
19 files changed, 30 insertions(+), 17 deletions(-)
---
diff --git a/app/create_object.c b/app/create_object.c
index 9bcf2b8..986da5c 100644
--- a/app/create_object.c
+++ b/app/create_object.c
@@ -29,6 +29,7 @@
#include "parent.h"
#include "message.h"
#include "object.h"
+#include "intl.h"
static void create_object_button_press(CreateObjectTool *tool, GdkEventButton *event,
DDisplay *ddisp);
diff --git a/app/diagram_tree_view.c b/app/diagram_tree_view.c
index 34fdcfc..a297160 100644
--- a/app/diagram_tree_view.c
+++ b/app/diagram_tree_view.c
@@ -38,6 +38,7 @@
#include "properties-dialog.h" /* object_list_properties_show */
#include "dia-props.h" /* diagram_properties_show */
#include "persistence.h"
+#include "intl.h"
typedef struct _DiagramTreeView DiagramTreeView;
struct _DiagramTreeView {
diff --git a/app/sheets.c b/app/sheets.c
index e108b94..3f96a49 100644
--- a/app/sheets.c
+++ b/app/sheets.c
@@ -38,6 +38,7 @@
#include "interface.h"
#include "sheets.h"
#include "sheets_dialog.h"
+#include "intl.h"
#include "gtkhwrapbox.h"
GtkWidget *sheets_dialog = NULL;
diff --git a/lib/dialib.c b/lib/dialib.c
index e3ad385..22a0734 100644
--- a/lib/dialib.c
+++ b/lib/dialib.c
@@ -33,6 +33,7 @@
#include "color.h"
#include "object.h"
#include "dia_dirs.h"
+#include "properties.h" /* stdprops_init() */
static void
stderr_message_internal(const char *title, enum ShowAgainStyle showAgain,
diff --git a/lib/element.c b/lib/element.c
index 942f691..bf408f6 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -31,6 +31,7 @@
#include "element.h"
#include "message.h"
+#include "properties.h"
#ifdef G_OS_WIN32
/* defined in header */
diff --git a/lib/object.h b/lib/object.h
index fcbd0e9..0031cd5 100644
--- a/lib/object.h
+++ b/lib/object.h
@@ -571,6 +571,15 @@ gchar *dia_object_get_meta (DiaObject *obj, const gchar *key);
int dia_object_get_num_connections (DiaObject *obj);
+/* standard way to load/save properties of an object */
+void object_load_props(DiaObject *obj, ObjectNode obj_node);
+void object_save_props(DiaObject *obj, ObjectNode obj_node);
+
+/* standard way to copy the properties of an object into another (of the
+ same type) */
+void object_copy_props(DiaObject *dest, const DiaObject *src,
+ gboolean is_default);
+
G_END_DECLS
#endif /* OBJECT_H */
diff --git a/lib/propdialogs.c b/lib/propdialogs.c
index 9215af3..7deaf81 100644
--- a/lib/propdialogs.c
+++ b/lib/propdialogs.c
@@ -221,7 +221,7 @@ prophandler_connect(const Property *prop,
g_signal_connect (G_OBJECT (object),
signal,
G_CALLBACK (property_signal_handler),
- (gpointer)(&prop->self));
+ (gpointer)(&prop->self_event_data));
}
void
@@ -231,16 +231,15 @@ prop_dialog_add_property(PropDialog *dialog, Property *prop)
PropWidgetAssoc pwa;
GtkWidget *label;
- prop->self.dialog = dialog;
- prop->self.self = prop;
- prop->self.my_index = dialog->prop_widgets->len;
+ prop->self_event_data.dialog = dialog;
+ prop->self_event_data.self = prop;
if (prop->ops->get_widget)
widget = prop->ops->get_widget(prop,dialog);
if (!widget)
return; /* either property has no widget or it's a container */
- prop->self.widget = widget;
+ prop->self_event_data.widget = widget;
if (prop->ops->reset_widget) prop->ops->reset_widget(prop,widget);
prop->experience |= PXP_NOTSET;
diff --git a/lib/properties.h b/lib/properties.h
index 4d8d97a..f5b3fab 100644
--- a/lib/properties.h
+++ b/lib/properties.h
@@ -75,7 +75,6 @@ struct _PropDialog { /* This is to be treated as opaque ! */
struct _PropEventData {
PropDialog *dialog;
- guint my_index; /* in dialog->propwidgets */
WIDGET *widget;
Property *self;
};
@@ -285,7 +284,7 @@ struct _Property {
GQuark name_quark;
GQuark type_quark;
const PropDescription *descr;
- PropEventData self;
+ PropEventData self_event_data;
PropEventHandler event_handler;
PropDescToPropPredicate reason; /* why has this property been created from
the pdesc ? */
@@ -439,15 +438,6 @@ Property *object_prop_by_name_type(DiaObject *obj, const char *name, const char
/* Set the pixbuf property if there is one */
ObjectChange *dia_object_set_pixbuf (DiaObject *object, GdkPixbuf *pixbuf);
-/* standard way to load/save properties of an object */
-void object_load_props(DiaObject *obj, ObjectNode obj_node);
-void object_save_props(DiaObject *obj, ObjectNode obj_node);
-
-/* standard way to copy the properties of an object into another (of the
- same type) */
-void object_copy_props(DiaObject *dest, const DiaObject *src,
- gboolean is_default);
-
/* ************************************************************* */
void stdprops_init(void);
diff --git a/lib/text.h b/lib/text.h
index 6bc2ec8..6927857 100644
--- a/lib/text.h
+++ b/lib/text.h
@@ -28,7 +28,7 @@ typedef enum {
#include "diatypes.h"
#include "textattr.h"
#include "focus.h"
-#include "properties.h"
+#include "dia_xml.h" /* for AttributeNode */
struct _Text {
/* don't change these values directly, use the text_set* functions */
diff --git a/objects/Database/reference.c b/objects/Database/reference.c
index 493f738..891a6e2 100644
--- a/objects/Database/reference.c
+++ b/objects/Database/reference.c
@@ -28,6 +28,7 @@
#include "database.h"
#include "arrows.h"
#include "attributes.h"
+#include "properties.h"
#include "diarenderer.h"
#include "pixmaps/reference.xpm"
diff --git a/objects/Database/table_dialog.c b/objects/Database/table_dialog.c
index 784ce38..2c3418b 100644
--- a/objects/Database/table_dialog.c
+++ b/objects/Database/table_dialog.c
@@ -35,6 +35,7 @@
#include <gtk/gtk.h>
#include <string.h>
#include "database.h"
+#include "intl.h"
struct _TablePropDialog {
GtkWidget * dialog;
diff --git a/objects/Misc/tree.c b/objects/Misc/tree.c
index bed65b0..9b413ab 100644
--- a/objects/Misc/tree.c
+++ b/objects/Misc/tree.c
@@ -29,6 +29,7 @@
#include "connectionpoint.h"
#include "diarenderer.h"
#include "attributes.h"
+#include "properties.h"
#include "diamenu.h"
#include "pixmaps/tree.xpm"
diff --git a/objects/UML/transition.c b/objects/UML/transition.c
index 5f64867..245d012 100644
--- a/objects/UML/transition.c
+++ b/objects/UML/transition.c
@@ -27,6 +27,7 @@
#include "orth_conn.h"
#include "diarenderer.h"
#include "attributes.h"
+#include "properties.h"
#include "pixmaps/transition.xpm"
diff --git a/objects/UML/uml.c b/objects/UML/uml.c
index 10c8cd6..ccf98ac 100644
--- a/objects/UML/uml.c
+++ b/objects/UML/uml.c
@@ -28,6 +28,7 @@
#include "object.h"
#include "uml.h"
#include "plug-ins.h"
+#include "properties.h"
extern DiaObjectType umlclass_type;
extern DiaObjectType umlclass_template_type;
diff --git a/objects/custom/shape_info.h b/objects/custom/shape_info.h
index 963c7f1..7971792 100644
--- a/objects/custom/shape_info.h
+++ b/objects/custom/shape_info.h
@@ -30,6 +30,7 @@
#include "dia_xml.h"
#include "object.h"
#include "text.h"
+#include "properties.h"
#include "intl.h"
#include "dia_svg.h"
diff --git a/objects/custom_lines/line_info.h b/objects/custom_lines/line_info.h
index c1781e0..48c0b2d 100644
--- a/objects/custom_lines/line_info.h
+++ b/objects/custom_lines/line_info.h
@@ -30,6 +30,7 @@
#include "dia_xml.h"
#include "object.h"
#include "text.h"
+#include "properties.h"
#include "intl.h"
#include "dia_svg.h"
diff --git a/objects/network/bus.c b/objects/network/bus.c
index 39a773e..4a522a6 100644
--- a/objects/network/bus.c
+++ b/objects/network/bus.c
@@ -30,6 +30,7 @@
#include "diarenderer.h"
#include "attributes.h"
#include "diamenu.h"
+#include "properties.h"
#include "pixmaps/bus.xpm"
diff --git a/objects/network/wanlink.c b/objects/network/wanlink.c
index 53fc5c5..3b4acf9 100644
--- a/objects/network/wanlink.c
+++ b/objects/network/wanlink.c
@@ -29,6 +29,7 @@
#include "connection.h"
#include "diarenderer.h"
#include "attributes.h"
+#include "properties.h"
#include "network.h"
#ifndef M_PI_2
diff --git a/tests/test-objects.c b/tests/test-objects.c
index 66f7c7d..61822ad 100644
--- a/tests/test-objects.c
+++ b/tests/test-objects.c
@@ -36,6 +36,7 @@
#include "plug-ins.h"
#include "dialib.h"
#include "create.h"
+#include "properties.h"
/* allows to select specific objects for testing */
static gchar *_type_name = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]