Permalink
Browse files

Merge pull request #250 from Teslos/master

Changes IoState_registerProtoWithFunc_ to IoState_registerProtoWithId_
  • Loading branch information...
stevedekorte committed Sep 11, 2013
2 parents 238ed2f + 74a461a commit e36e74c91713258a4819ceb957b74562fec38e7e
@@ -8,10 +8,10 @@ Cairo is a 2D graphics library. http://cairographics.org/
#include "IoNumber.h"
#include <cairo-svg.h>
-
+static const char *protoId = "Cairo";
static IoTag *IoCairo_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("Cairo");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoCairo_rawClone);
return tag;
@@ -22,7 +22,7 @@ IoCairo *IoCairo_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairo_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairo_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -45,7 +45,7 @@ IoCairoContext *IoCairoContext_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoContext_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoContext_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -212,7 +212,8 @@ IoCairoContext *IoCairoContext_rawClone(IoCairoContext *proto)
IoCairoContext *IoCairoContext_newWithSurface_(void *state, IoCairoImageSurface *surface)
{
- IoCairoContext *self = IOCLONE(IoState_protoWithInitId_(state, protoId));
+ //IoCairoContext *self = IOCLONE(IoState_protoWithInitId_(state, protoId));
+ IoCairoContext *self = IOCLONE(IoState_protoWithId_(state, protoId));
cairo_t *rawContext = cairo_create(IoCairoSurface_rawSurface(surface));
checkStatus_(state, 0, cairo_status(rawContext));
IoObject_setDataPointer_(self, rawContext);
@@ -25,7 +25,7 @@ IoCairoExtents *IoCairoExtents_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(IoCairoExtentsData)));
- IoState_registerProtoWithFunc_(state, self, IoCairoExtents_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -49,7 +49,8 @@ IoCairoExtents *IoCairoExtents_rawClone(IoCairoExtents *proto)
IoCairoExtents *IoCairoExtents_newSet(void *state, double x1, double y1, double x2, double y2)
{
- IoCairoExtents *self = IOCLONE(IoState_protoWithInitId_(state, protoId));
+ //IoCairoExtents *self = IOCLONE(IoState_protoWithInitId_(state, protoId));
+ IoCairoExtents *self = IOCLONE(IoState_protoWithId_(state, protoId));
DATA(self)->x1 = x1;
DATA(self)->y1 = y1;
DATA(self)->x2 = x2;
@@ -25,7 +25,7 @@ IoCairoFontExtents *IoCairoFontExtents_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(cairo_font_extents_t)));
- IoState_registerProtoWithFunc_(state, self, IoCairoFontExtents_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -50,7 +50,8 @@ IoCairoFontExtents *IoCairoFontExtents_rawClone(IoCairoFontExtents *proto)
IoCairoFontExtents *IoCairoFontExtents_newWithRawFontExtents(void *state, cairo_font_extents_t *extents)
{
- IoCairoFontExtents *self = IOCLONE(IoState_protoWithInitId_(state, protoId));
+ //IoCairoFontExtents *self = IOCLONE(IoState_protoWithInitId_(state, protoId));
+ IoCairoFontExtents *self = IOCLONE(IoState_protoWithId_(state, protoId));
memcpy(EXTENTS(self), extents, sizeof(cairo_font_extents_t));
return self;
}
@@ -32,7 +32,7 @@ IoCairoFontFace *IoCairoFontFace_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoFontFace_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoFontFace_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
return self;
}
@@ -47,7 +47,8 @@ IoCairoFontFace *IoCairoFontFace_rawClone(IoCairoFontFace *proto)
IoCairoFontFace *IoCairoFontFace_newWithRawFontFace_(void *state, cairo_font_face_t *face)
{
- IoCairoFontFace *self = IOCLONE(IoState_protoWithInitId_(state, protoId));
+ //IoCairoFontFace *self = IOCLONE(IoState_protoWithInitId_(state, protoId));
+ IoCairoFontFace *self = IOCLONE(IoState_protoWithId_(state, protoId));
IoObject_setDataPointer_(self, face);
return self;
}
@@ -36,7 +36,7 @@ IoCairoFontOptions *IoCairoFontOptions_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoFontOptions_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoFontOptions_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -25,7 +25,7 @@ IoCairoGlyph *IoCairoGlyph_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(cairo_glyph_t)));
- IoState_registerProtoWithFunc_(state, self, IoCairoGlyph_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -54,7 +54,8 @@ IoCairoGlyph *IoCairoGlyph_rawClone(IoCairoGlyph *proto)
IoCairoGlyph *IoCairoGlyph_newWithRawGlyph_(void *state, cairo_glyph_t *glyph)
{
- IoCairoGlyph *self = IOCLONE(IoState_protoWithInitId_(state, protoId));
+ //IoCairoGlyph *self = IOCLONE(IoState_protoWithInitId_(state, protoId));
+ IoCairoGlyph *self = IOCLONE(IoState_protoWithId_(state, protoId));
memcpy(GLYPH(self), glyph, sizeof(cairo_glyph_t));
return self;
}
@@ -9,10 +9,11 @@
#include "IoNumber.h"
#include "tools.h"
+static const char *protoId = "Gradient";
static IoTag *IoCairoGradient_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("Gradient");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoCairoGradient_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoCairoPattern_free);
@@ -24,7 +25,7 @@ IoCairoGradient *IoCairoGradient_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoGradient_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoGradient_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoCairoGradient_addMethods(self);
@@ -14,10 +14,11 @@
static const cairo_user_data_key_t dataKey;
+static const char *protoId = "CairoImageSurface";
static IoTag *IoCairoImageSurface_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("CairoImageSurface");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoCairoImageSurface_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoCairoSurface_free);
@@ -29,7 +30,7 @@ IoCairoImageSurface *IoCairoImageSurface_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoImageSurface_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoImageSurface_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoCairoSurface_addMethods(self);
{
@@ -9,10 +9,11 @@
#include "IoCairoPattern_inline.h"
#include "tools.h"
+static const char *protoId = "LinearGradient";
static IoTag *IoCairoLinearGradient_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("LinearGradient");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoCairoLinearGradient_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoCairoPattern_free);
@@ -24,7 +25,7 @@ IoCairoLinearGradient *IoCairoLinearGradient_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoLinearGradient_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoLinearGradient_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoCairoGradient_addMethods(self);
{
@@ -36,7 +36,7 @@ IoCairoMatrix *IoCairoMatrix_proto(void *state)
IoObject_setDataPointer_(self, malloc(sizeof(cairo_matrix_t)));
cairo_matrix_init_identity(MATRIX(self));
- IoState_registerProtoWithFunc_(state, self, IoCairoMatrix_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -36,7 +36,7 @@ IoCairoPath *IoCairoPath_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoPath_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoPath_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -67,7 +67,8 @@ IoCairoPath *IoCairoPath_newWithRawPath_(void *state, cairo_path_t *path)
checkStatus_(state, 0, path->status);
- self = IOCLONE(IoState_protoWithInitId_(state, protoId));
+ //self = IOCLONE(IoState_protoWithInitId_(state, protoId));
+ self = IOCLONE(IoState_protoWithId_(state, protoId));
IoObject_setDataPointer_(self, calloc(1, sizeof(IoCairoPathData)));
DATA(self)->path = path;
DATA(self)->refCount = 1;
@@ -31,7 +31,7 @@ IoCairoPathElement *IoCairoPathElement_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoPathElement_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoPathElement_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -31,7 +31,7 @@ IoCairoPattern *IoCairoPattern_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoPattern_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoPattern_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoCairoPattern_addMethods(self);
return self;
@@ -8,7 +8,7 @@
#include "IoCairoPattern.h"
#include "IoCairoPattern_inline.h"
#include "tools.h"
-
+static const char *protoId = "RadialGradient";
static IoTag *IoCairoRadialGradient_newTag(void *state)
{
@@ -24,7 +24,7 @@ IoCairoRadialGradient *IoCairoRadialGradient_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoRadialGradient_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoRadialGradient_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoCairoGradient_addMethods(self);
{
@@ -25,7 +25,7 @@ IoCairoRectangle *IoCairoRectangle_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(cairo_rectangle_t)));
- IoState_registerProtoWithFunc_(state, self, IoCairoRectangle_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -42,7 +42,7 @@ IoCairoScaledFont *IoCairoScaledFont_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoScaledFont_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoScaledFont_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -8,10 +8,11 @@
#include "IoCairoPattern_inline.h"
#include "tools.h"
+static const char *protoId = "SolidPattern";
static IoTag *IoCairoSolidPattern_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("SolidPattern");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoCairoSolidPattern_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoCairoPattern_free);
@@ -23,7 +24,7 @@ IoCairoSolidPattern *IoCairoSolidPattern_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoSolidPattern_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoSolidPattern_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoCairoPattern_addMethods(self);
{
@@ -29,7 +29,7 @@ IoCairoSurface *IoCairoSurface_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoSurface_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoSurface_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoCairoSurface_addMethods(self);
@@ -9,10 +9,11 @@
#include "IoNumber.h"
#include "tools.h"
+static const char *protoId = "SurfacePattern";
static IoTag *IoCairoSurfacePattern_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("SurfacePattern");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoCairoSurfacePattern_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoCairoPattern_free);
@@ -24,7 +25,7 @@ IoCairoSurfacePattern *IoCairoSurfacePattern_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoSurfacePattern_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoSurfacePattern_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoCairoPattern_addMethods(self);
{
@@ -25,7 +25,7 @@ IoCairoTextExtents *IoCairoTextExtents_proto(void *state)
IoObject_setDataPointer_(self, calloc(1, sizeof(cairo_text_extents_t)));
- IoState_registerProtoWithFunc_(state, self, IoCairoTextExtents_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
{
IoMethodTable methodTable[] = {
@@ -9,10 +9,11 @@
#include "IoCairoSurface_inline.h"
#include <cairo-pdf.h>
+static const char *protoId = "CairoPDFSurface";
static IoTag *IoCairoPDFSurface_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("CairoPDFSurface");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoCairoPDFSurface_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoCairoSurface_free);
@@ -24,7 +25,7 @@ IoCairoPDFSurface *IoCairoPDFSurface_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoPDFSurface_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoPDFSurface_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoCairoSurface_addMethods(self);
{
@@ -9,10 +9,11 @@
#include "IoCairoSurface_inline.h"
#include <cairo-ps.h>
+static const char *protoId = "CairoPSSurface";
static IoTag *IoCairoPSSurface_newTag(void *state)
{
- IoTag *tag = IoTag_newWithName_("CairoPSSurface");
+ IoTag *tag = IoTag_newWithName_(protoId);
IoTag_state_(tag, state);
IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoCairoPSSurface_rawClone);
IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoCairoSurface_free);
@@ -24,7 +25,7 @@ IoCairoPSSurface *IoCairoPSSurface_proto(void *state)
IoObject *self = IoObject_new(state);
IoObject_tag_(self, IoCairoPSSurface_newTag(state));
- IoState_registerProtoWithFunc_(state, self, IoCairoPSSurface_proto);
+ IoState_registerProtoWithId_(state, self, protoId);
IoCairoSurface_addMethods(self);
{
Oops, something went wrong.

0 comments on commit e36e74c

Please sign in to comment.