summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2012-11-11 14:17:53 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2012-11-11 14:17:53 +0000
commitf2907ae896ed8688e800519310b61754550f27f6 (patch)
tree937b9390112d97163c1d0fb73fad7ce3cb6707f1 /src
parentReplace remaining C-style pointer casts for src/widgets (diff)
downloadinkscape-f2907ae896ed8688e800519310b61754550f27f6.tar.gz
inkscape-f2907ae896ed8688e800519310b61754550f27f6.zip
SPObject: drop sp_object_ prefix on class members
(bzr r11869)
Diffstat (limited to 'src')
-rw-r--r--src/marker.cpp4
-rw-r--r--src/sp-object.cpp71
-rw-r--r--src/sp-object.h42
-rw-r--r--src/sp-shape.cpp4
-rw-r--r--src/xml/repr-css.cpp2
5 files changed, 60 insertions, 63 deletions
diff --git a/src/marker.cpp b/src/marker.cpp
index 45582caa4..8acac805b 100644
--- a/src/marker.cpp
+++ b/src/marker.cpp
@@ -119,7 +119,7 @@ sp_marker_init (SPMarker *marker)
* parent class' build routine to attach the object to its document and
* repr. The result will be creation of the whole document tree.
*
- * \see sp_object_build()
+ * \see SPObject::build()
*/
static void sp_marker_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
@@ -147,7 +147,7 @@ static void sp_marker_build(SPObject *object, SPDocument *document, Inkscape::XM
* and release its SPRepr bindings. The result will be the destruction
* of the entire document tree.
*
- * \see sp_object_release()
+ * \see SPObject::release()
*/
static void sp_marker_release(SPObject *object)
{
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 3e18c0835..2cf28137a 100644
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -64,11 +64,11 @@ using std::strstr;
guint update_in_progress = 0; // guard against update-during-update
Inkscape::XML::NodeEventVector object_event_vector = {
- SPObject::sp_object_repr_child_added,
- SPObject::sp_object_repr_child_removed,
- SPObject::sp_object_repr_attr_changed,
- SPObject::sp_object_repr_content_changed,
- SPObject::sp_object_repr_order_changed
+ SPObject::repr_child_added,
+ SPObject::repr_child_removed,
+ SPObject::repr_attr_changed,
+ SPObject::repr_content_changed,
+ SPObject::repr_order_changed
};
// A friend class used to set internal members on SPObject so as to not expose settors in SPObject's public API
@@ -104,18 +104,18 @@ public:
GObjectClass * SPObjectClass::static_parent_class = 0;
-GType SPObject::sp_object_get_type()
+GType SPObject::get_type()
{
static GType type = 0;
if (!type) {
GTypeInfo info = {
sizeof(SPObjectClass),
NULL, NULL,
- (GClassInitFunc) SPObjectClass::sp_object_class_init,
+ (GClassInitFunc) SPObjectClass::init,
NULL, NULL,
sizeof(SPObject),
16,
- (GInstanceInitFunc) sp_object_init,
+ (GInstanceInitFunc)init,
NULL
};
type = g_type_register_static(G_TYPE_OBJECT, "SPObject", &info, (GTypeFlags)0);
@@ -123,7 +123,7 @@ GType SPObject::sp_object_get_type()
return type;
}
-void SPObjectClass::sp_object_class_init(SPObjectClass *klass)
+void SPObjectClass::init(SPObjectClass *klass)
{
GObjectClass *object_class;
@@ -131,21 +131,18 @@ void SPObjectClass::sp_object_class_init(SPObjectClass *klass)
static_parent_class = (GObjectClass *) g_type_class_ref(G_TYPE_OBJECT);
- object_class->finalize = SPObject::sp_object_finalize;
+ object_class->finalize = SPObject::finalize;
- klass->child_added = SPObject::sp_object_child_added;
- klass->remove_child = SPObject::sp_object_remove_child;
- klass->order_changed = SPObject::sp_object_order_changed;
-
- klass->release = SPObject::sp_object_release;
-
- klass->build = SPObject::sp_object_build;
-
- klass->set = SPObject::sp_object_private_set;
- klass->write = SPObject::sp_object_private_write;
+ klass->child_added = SPObject::child_added;
+ klass->remove_child = SPObject::remove_child;
+ klass->order_changed = SPObject::order_changed;
+ klass->release = SPObject::release;
+ klass->build = SPObject::build;
+ klass->set = SPObject::private_set;
+ klass->write = SPObject::private_write;
}
-void SPObject::sp_object_init(SPObject *object)
+void SPObject::init(SPObject *object)
{
debug("id=%x, typename=%s",object, g_type_name_from_instance((GTypeInstance*)object));
@@ -178,7 +175,7 @@ void SPObject::sp_object_init(SPObject *object)
object->_default_label = NULL;
}
-void SPObject::sp_object_finalize(GObject *object)
+void SPObject::finalize(GObject *object)
{
SPObject *spobject = (SPObject *)object;
@@ -616,7 +613,7 @@ SPObject *SPObject::get_child_by_repr(Inkscape::XML::Node *repr)
return result;
}
-void SPObject::sp_object_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref)
+void SPObject::child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref)
{
GType type = sp_repr_type_lookup(child);
if (!type) {
@@ -630,7 +627,7 @@ void SPObject::sp_object_child_added(SPObject *object, Inkscape::XML::Node *chil
ochild->invoke_build(object->document, child, object->cloned);
}
-void SPObject::sp_object_release(SPObject *object)
+void SPObject::release(SPObject *object)
{
debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
while (object->children) {
@@ -638,7 +635,7 @@ void SPObject::sp_object_release(SPObject *object)
}
}
-void SPObject::sp_object_remove_child(SPObject *object, Inkscape::XML::Node *child)
+void SPObject::remove_child(SPObject *object, Inkscape::XML::Node *child)
{
debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
SPObject *ochild = object->get_child_by_repr(child);
@@ -648,7 +645,7 @@ void SPObject::sp_object_remove_child(SPObject *object, Inkscape::XML::Node *chi
}
}
-void SPObject::sp_object_order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node */*old_ref*/,
+void SPObject::order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node * /*old_ref*/,
Inkscape::XML::Node *new_ref)
{
SPObject *ochild = object->get_child_by_repr(child);
@@ -658,7 +655,7 @@ void SPObject::sp_object_order_changed(SPObject *object, Inkscape::XML::Node *ch
ochild->_position_changed_signal.emit(ochild);
}
-void SPObject::sp_object_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
+void SPObject::build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
/* Nothing specific here */
debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
@@ -709,7 +706,7 @@ void SPObject::invoke_build(SPDocument *document, Inkscape::XML::Node *repr, uns
gchar const *id = this->repr->attribute("id");
if (!document->isSeeking()) {
{
- gchar *realid = sp_object_get_unique_id(this, id);
+ gchar *realid = get_unique_id(this, id);
g_assert(realid != NULL);
this->document->bindObjectToId(realid, this);
@@ -820,7 +817,7 @@ SPObject *SPObject::getPrev()
return prev;
}
-void SPObject::sp_object_repr_child_added(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, gpointer data)
+void SPObject::repr_child_added(Inkscape::XML::Node * /*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, gpointer data)
{
SPObject *object = SP_OBJECT(data);
@@ -829,7 +826,7 @@ void SPObject::sp_object_repr_child_added(Inkscape::XML::Node */*repr*/, Inkscap
}
}
-void SPObject::sp_object_repr_child_removed(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node */*ref*/, gpointer data)
+void SPObject::repr_child_removed(Inkscape::XML::Node * /*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node * /*ref*/, gpointer data)
{
SPObject *object = SP_OBJECT(data);
@@ -838,7 +835,7 @@ void SPObject::sp_object_repr_child_removed(Inkscape::XML::Node */*repr*/, Inksc
}
}
-void SPObject::sp_object_repr_order_changed(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node *old, Inkscape::XML::Node *newer, gpointer data)
+void SPObject::repr_order_changed(Inkscape::XML::Node * /*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node *old, Inkscape::XML::Node *newer, gpointer data)
{
SPObject *object = SP_OBJECT(data);
@@ -847,7 +844,7 @@ void SPObject::sp_object_repr_order_changed(Inkscape::XML::Node */*repr*/, Inksc
}
}
-void SPObject::sp_object_private_set(SPObject *object, unsigned int key, gchar const *value)
+void SPObject::private_set(SPObject *object, unsigned int key, gchar const *value)
{
g_assert(key != SP_ATTR_INVALID);
@@ -869,7 +866,7 @@ void SPObject::sp_object_private_set(SPObject *object, unsigned int key, gchar c
if (!document->isSeeking()) {
sp_object_ref(conflict, NULL);
// give the conflicting object a new ID
- gchar *new_conflict_id = sp_object_get_unique_id(conflict, NULL);
+ gchar *new_conflict_id = get_unique_id(conflict, NULL);
conflict->getRepr()->setAttribute("id", new_conflict_id);
g_free(new_conflict_id);
sp_object_unref(conflict, NULL);
@@ -960,7 +957,7 @@ void SPObject::readAttr(gchar const *key)
}
}
-void SPObject::sp_object_repr_attr_changed(Inkscape::XML::Node */*repr*/, gchar const *key, gchar const */*oldval*/, gchar const */*newval*/, bool is_interactive, gpointer data)
+void SPObject::repr_attr_changed(Inkscape::XML::Node * /*repr*/, gchar const *key, gchar const * /*oldval*/, gchar const * /*newval*/, bool is_interactive, gpointer data)
{
SPObject *object = SP_OBJECT(data);
@@ -973,7 +970,7 @@ void SPObject::sp_object_repr_attr_changed(Inkscape::XML::Node */*repr*/, gchar
}
}
-void SPObject::sp_object_repr_content_changed(Inkscape::XML::Node */*repr*/, gchar const */*oldcontent*/, gchar const */*newcontent*/, gpointer data)
+void SPObject::repr_content_changed(Inkscape::XML::Node * /*repr*/, gchar const * /*oldcontent*/, gchar const * /*newcontent*/, gpointer data)
{
SPObject *object = SP_OBJECT(data);
@@ -997,7 +994,7 @@ static gchar const *sp_xml_get_space_string(unsigned int space)
}
}
-Inkscape::XML::Node * SPObject::sp_object_private_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
+Inkscape::XML::Node * SPObject::private_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
if (!repr && (flags & SP_OBJECT_WRITE_BUILD)) {
repr = object->getRepr()->duplicate(doc);
@@ -1302,7 +1299,7 @@ bool SPObject::storeAsDouble( gchar const *key, double *val ) const
/* Helper */
-gchar * SPObject::sp_object_get_unique_id(SPObject *object, gchar const *id)
+gchar * SPObject::get_unique_id(SPObject *object, gchar const *id)
{
static unsigned long count = 0;
diff --git a/src/sp-object.h b/src/sp-object.h
index b08706b0b..d9ddb17bb 100644
--- a/src/sp-object.h
+++ b/src/sp-object.h
@@ -18,7 +18,7 @@
class SPObject;
class SPObjectClass;
-#define SP_TYPE_OBJECT (SPObject::sp_object_get_type ())
+#define SP_TYPE_OBJECT (SPObject::get_type ())
#define SP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_OBJECT, SPObject))
#define SP_OBJECT_CLASS(clazz) (G_TYPE_CHECK_CLASS_CAST((clazz), SP_TYPE_OBJECT, SPObjectClass))
#define SP_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_OBJECT))
@@ -260,7 +260,7 @@ public:
* Represents the style properties, whether from presentation attributes, the <tt>style</tt>
* attribute, or inherited.
*
- * sp_object_private_set doesn't handle SP_ATTR_STYLE or any presentation attributes at the
+ * private_set() doesn't handle SP_ATTR_STYLE or any presentation attributes at the
* time of writing, so this is probably NULL for all SPObject's that aren't an SPItem.
*
* However, this gives rise to the bugs mentioned in sp_object_get_style_property.
@@ -801,18 +801,18 @@ private:
/**
* Callback to initialize the SPObject object.
*/
- static void sp_object_init(SPObject *object);
+ static void init(SPObject *object);
/**
* Callback to destroy all members and connections of object and itself.
*/
- static void sp_object_finalize(GObject *object);
+ static void finalize(GObject *object);
/**
* Callback for child_added event.
* Invoked whenever the given mutation event happens in the XML tree.
*/
- static void sp_object_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
+ static void child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
/**
* Remove object's child whose node equals repr, release and
@@ -822,7 +822,7 @@ private:
* tree, BEFORE removal from the XML tree happens, so grouping
* objects can safely release the child data.
*/
- static void sp_object_remove_child(SPObject *object, Inkscape::XML::Node *child);
+ static void remove_child(SPObject *object, Inkscape::XML::Node *child);
/**
* Move object corresponding to child after sibling object corresponding
@@ -830,7 +830,7 @@ private:
* Invoked whenever the given mutation event happens in the XML tree.
* @param old_ref Ignored
*/
- static void sp_object_order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref);
+ static void order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref);
/**
* Removes, releases and unrefs all children of object.
@@ -841,9 +841,9 @@ private:
* document and releases the SPRepr bindings; implementations should free
* state data and release all child objects. Invoking release on
* SPRoot destroys the whole document tree.
- * @see sp_object_build()
+ * @see build()
*/
- static void sp_object_release(SPObject *object);
+ static void release(SPObject *object);
/**
* Virtual build callback.
@@ -854,21 +854,21 @@ private:
* generate the children objects and so on. Invoking build on the SPRoot
* object results in creation of the whole document tree (this is, what
* SPDocument does after the creation of the XML tree).
- * @see sp_object_release()
+ * @see release()
*/
- static void sp_object_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
+ static void build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
/**
* Callback for set event.
*/
- static void sp_object_private_set(SPObject *object, unsigned int key, gchar const *value);
+ static void private_set(SPObject *object, unsigned int key, gchar const *value);
/**
* Callback for write event.
*/
- static Inkscape::XML::Node *sp_object_private_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
+ static Inkscape::XML::Node *private_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
- static gchar *sp_object_get_unique_id(SPObject *object, gchar const *defid);
+ static gchar *get_unique_id(SPObject *object, gchar const *defid);
/* Real handlers of repr signals */
@@ -877,34 +877,34 @@ public:
/**
* Registers the SPObject class with Gdk and returns its type number.
*/
- static GType sp_object_get_type();
+ static GType get_type();
/**
* Callback for attr_changed node event.
*/
- static void sp_object_repr_attr_changed(Inkscape::XML::Node *repr, gchar const *key, gchar const *oldval, gchar const *newval, bool is_interactive, gpointer data);
+ static void repr_attr_changed(Inkscape::XML::Node *repr, gchar const *key, gchar const *oldval, gchar const *newval, bool is_interactive, gpointer data);
/**
* Callback for content_changed node event.
*/
- static void sp_object_repr_content_changed(Inkscape::XML::Node *repr, gchar const *oldcontent, gchar const *newcontent, gpointer data);
+ static void repr_content_changed(Inkscape::XML::Node *repr, gchar const *oldcontent, gchar const *newcontent, gpointer data);
/**
* Callback for child_added node event.
*/
- static void sp_object_repr_child_added(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, gpointer data);
+ static void repr_child_added(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, gpointer data);
/**
* Callback for remove_child node event.
*/
- static void sp_object_repr_child_removed(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, void *data);
+ static void repr_child_removed(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, void *data);
/**
* Callback for order_changed node event.
*
* \todo fixme:
*/
- static void sp_object_repr_order_changed(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *old, Inkscape::XML::Node *newer, gpointer data);
+ static void repr_order_changed(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *old, Inkscape::XML::Node *newer, gpointer data);
friend class SPObjectClass;
@@ -942,7 +942,7 @@ private:
/**
* Initializes the SPObject vtable.
*/
- static void sp_object_class_init(SPObjectClass *klass);
+ static void init(SPObjectClass *klass);
friend class SPObject;
};
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index a9a9c7781..ad73f226c 100644
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
@@ -146,7 +146,7 @@ void SPShape::sp_shape_finalize(GObject *object)
*
* This is to be invoked immediately after creation of an SPShape.
*
- * \see sp_object_build()
+ * \see SPObject::build()
*/
void SPShape::sp_shape_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
@@ -167,7 +167,7 @@ void SPShape::sp_shape_build(SPObject *object, SPDocument *document, Inkscape::X
* by other objects. This routine also disconnects/unrefs markers and
* curves attached to it.
*
- * \see sp_object_release()
+ * \see SPObject::release()
*/
void SPShape::sp_shape_release(SPObject *object)
{
diff --git a/src/xml/repr-css.cpp b/src/xml/repr-css.cpp
index f554d314d..4c339ad5a 100644
--- a/src/xml/repr-css.cpp
+++ b/src/xml/repr-css.cpp
@@ -312,7 +312,7 @@ void sp_repr_css_set(Node *repr, SPCSSAttr *css, gchar const *attr)
/*
* If the new value is different from the old value, this will sometimes send a signal via
* CompositeNodeObserver::notiftyAttributeChanged() which results in calling
- * SPObject::sp_object_repr_attr_changed and thus updates the object's SPStyle. This update
+ * SPObject::repr_attr_changed and thus updates the object's SPStyle. This update
* results in another call to repr->setAttribute().
*/
repr->setAttribute(attr, value.c_str());