From 064e6b53faec08a67075dd0f97303f5365d4e79b Mon Sep 17 00:00:00 2001 From: scuri Date: Mon, 25 Apr 2011 18:26:50 +0000 Subject: *** empty log message *** --- html/en/func/coordinates.html | 5 +++++ include/cd_private.h | 6 +++--- src/cairo/cdcairodbuf.c | 3 +-- src/cairo/cdcairoemf.c | 3 +-- src/cairo/cdcairoimg.c | 3 +-- src/cairo/cdcairoirgb.c | 3 +-- src/cairo/cdcaironative_gdk.c | 3 +-- src/cairo/cdcaironative_win32.c | 3 +-- src/cairo/cdcaironative_x11.c | 3 +-- src/cairo/cdcairopdf.c | 3 +-- src/cairo/cdcairoplus.c | 2 +- src/cairo/cdcairoprn_unix.c | 3 +-- src/cairo/cdcairoprn_win32.c | 3 +-- src/cairo/cdcairops.c | 3 +-- src/cairo/cdcairosvg.c | 3 +-- src/cd.c | 10 +++++----- src/drv/cdcgm.c | 1 - src/drv/cddebug.c | 1 - src/drv/cddgn.c | 1 - src/drv/cddxf.c | 1 - src/drv/cdgl.c | 1 - src/drv/cdirgb.c | 2 -- src/drv/cdmf.c | 1 - src/drv/cdpdf.c | 1 - src/drv/cdpicture.c | 1 - src/drv/cdps.c | 1 - src/gdiplus/cdwclpp.cpp | 3 +-- src/gdiplus/cdwdbufp.cpp | 3 +-- src/gdiplus/cdwemfp.cpp | 3 +-- src/gdiplus/cdwgdiplus.c | 2 +- src/gdiplus/cdwimgp.cpp | 3 +-- src/gdiplus/cdwnativep.cpp | 3 +-- src/gdiplus/cdwprnp.cpp | 3 +-- src/gdk/cdgdkclp.c | 1 - src/gdk/cdgdkdbuf.c | 1 - src/gdk/cdgdkimg.c | 1 - src/gdk/cdgdknative.c | 1 - src/lua5/cdvoid5.c | 1 - src/svg/cdsvg.c | 1 - src/win32/cdwclp.c | 1 - src/win32/cdwdbuf.c | 1 - src/win32/cdwemf.c | 1 - src/win32/cdwimg.c | 1 - src/win32/cdwnative.c | 1 - src/win32/cdwprn.c | 1 - src/win32/cdwwmf.c | 3 +-- src/x11/cdxclp.c | 1 - src/x11/cdxdbuf.c | 1 - src/x11/cdximg.c | 1 - src/x11/cdxnative.c | 1 - src/xrender/cdxrender.c | 12 ++++++------ src/xrender/cdxrplus.c | 2 +- 52 files changed, 41 insertions(+), 82 deletions(-) diff --git a/html/en/func/coordinates.html b/html/en/func/coordinates.html index 1f09f4b..ce4ff9a 100644 --- a/html/en/func/coordinates.html +++ b/html/en/func/coordinates.html @@ -119,6 +119,11 @@ and ScrollArea.

and Origin functions. And those are affected if a transformation is set, just like other regular primitives.

+

The transformation matrix and world coordinates perform similar + functions. World coordinates were developed before the transformation matrix + support. The transformation matrix operates at a lower level than world + coordinates, and, as such, might be faster, but might behave differently on + different platforms. World coordinates behave consistently across platforms.

double* cdCanvasGetTransform(cdCanvas* canvas); [in C]
diff --git a/include/cd_private.h b/include/cd_private.h
index 672d23c..92d378b 100644
--- a/include/cd_private.h
+++ b/include/cd_private.h
@@ -68,8 +68,7 @@ struct _cdImage
 struct _cdContext
 {
   unsigned long caps;  /* canvas capabilities, combination of CD_CAP_*  */
-  int plus; /* indicates if the context is a context plus */
-  int type; /* context type WINDOW, DEVICE, IMAGE or FILE */
+  int type; /* context type WINDOW, DEVICE, IMAGE or FILE, combined with PLUS */
 
   /* can NOT be NULL */
   void  (*cxCreateCanvas)(cdCanvas* canvas, void *data);
@@ -264,7 +263,8 @@ void wdSetDefaults(cdCanvas* canvas);
 void cdInitContextPlusList(cdContext* ctx_list[]);
 cdContext* cdGetContextPlus(int ctx);
 enum{CD_CTXPLUS_NATIVEWINDOW, CD_CTXPLUS_IMAGE, CD_CTXPLUS_DBUFFER, CD_CTXPLUS_PRINTER, CD_CTXPLUS_EMF, CD_CTXPLUS_CLIPBOARD}; 
-#define NUM_CONTEXTPLUS 6
+#define CD_CTXPLUS_COUNT 6
+#define CD_CTX_PLUS 0xFF00  /* to combine with context type */
 
 /*************/
 /* utilities */
diff --git a/src/cairo/cdcairodbuf.c b/src/cairo/cdcairodbuf.c
index 845a24b..0322191 100644
--- a/src/cairo/cdcairodbuf.c
+++ b/src/cairo/cdcairodbuf.c
@@ -137,8 +137,7 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdDBufferContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE ),
-  1,
-  CD_CTX_IMAGE,
+  CD_CTX_IMAGE|CD_CTX_PLUS,
   cdcreatecanvas,  
   cdinittable,
   NULL,             
diff --git a/src/cairo/cdcairoemf.c b/src/cairo/cdcairoemf.c
index f83ae11..f2b31b6 100644
--- a/src/cairo/cdcairoemf.c
+++ b/src/cairo/cdcairoemf.c
@@ -108,8 +108,7 @@ static cdContext cdEMFCairoContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_GETIMAGERGB |
                  CD_CAP_WRITEMODE | CD_CAP_PALETTE | CD_CAP_IMAGESRV),
-  1,
-  CD_CTX_FILE,
+  CD_CTX_FILE|CD_CTX_PLUS,
   cdcreatecanvas,
   cdinittable,
   NULL,
diff --git a/src/cairo/cdcairoimg.c b/src/cairo/cdcairoimg.c
index 3786de1..77bbda8 100644
--- a/src/cairo/cdcairoimg.c
+++ b/src/cairo/cdcairoimg.c
@@ -38,8 +38,7 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdImageContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE ),
-  1,
-  CD_CTX_IMAGE,
+  CD_CTX_IMAGE|CD_CTX_PLUS,
   cdcreatecanvas,
   cdinittable,
   NULL,
diff --git a/src/cairo/cdcairoirgb.c b/src/cairo/cdcairoirgb.c
index 21ff6c5..e5f2c2a 100644
--- a/src/cairo/cdcairoirgb.c
+++ b/src/cairo/cdcairoirgb.c
@@ -146,8 +146,7 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdCairoImageRGBContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE),
-  0,  /* not a plus driver */
-  CD_CTX_IMAGE,
+  CD_CTX_IMAGE,  /* not a plus driver */
   cdcreatecanvas,  
   cdinittable,
   NULL,                 
diff --git a/src/cairo/cdcaironative_gdk.c b/src/cairo/cdcaironative_gdk.c
index 1e177a4..e2e0bd1 100644
--- a/src/cairo/cdcaironative_gdk.c
+++ b/src/cairo/cdcaironative_gdk.c
@@ -95,8 +95,7 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdNativeWindowContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE),
-  1,
-  CD_CTX_WINDOW,
+  CD_CTX_WINDOW|CD_CTX_PLUS,
   cdcreatecanvas,
   cdinittable,
   NULL,
diff --git a/src/cairo/cdcaironative_win32.c b/src/cairo/cdcaironative_win32.c
index 3cc1972..9c097f9 100644
--- a/src/cairo/cdcaironative_win32.c
+++ b/src/cairo/cdcaironative_win32.c
@@ -144,8 +144,7 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdNativeWindowContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE),
-  1,
-  CD_CTX_WINDOW,
+  CD_CTX_WINDOW|CD_CTX_PLUS,
   cdcreatecanvas,
   cdinittable,
   NULL,
diff --git a/src/cairo/cdcaironative_x11.c b/src/cairo/cdcaironative_x11.c
index ae08420..c177e82 100644
--- a/src/cairo/cdcaironative_x11.c
+++ b/src/cairo/cdcaironative_x11.c
@@ -84,8 +84,7 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdNativeWindowContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE ),
-  1,
-  CD_CTX_WINDOW,
+  CD_CTX_WINDOW|CD_CTX_PLUS,
   cdcreatecanvas,
   cdinittable,
   NULL,
diff --git a/src/cairo/cdcairopdf.c b/src/cairo/cdcairopdf.c
index 980da72..5a8c210 100644
--- a/src/cairo/cdcairopdf.c
+++ b/src/cairo/cdcairopdf.c
@@ -109,8 +109,7 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdCairoPDFContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE),
-  0,  /* not a plus driver */
-  CD_CTX_FILE,
+  CD_CTX_FILE,  /* not a plus driver */
   cdcreatecanvas,  
   cdinittable,
   NULL,                 
diff --git a/src/cairo/cdcairoplus.c b/src/cairo/cdcairoplus.c
index d37efa7..9da8b33 100644
--- a/src/cairo/cdcairoplus.c
+++ b/src/cairo/cdcairoplus.c
@@ -13,7 +13,7 @@
 
 void cdInitContextPlus(void)
 {
-  cdContext* ctx_list[NUM_CONTEXTPLUS];
+  cdContext* ctx_list[CD_CTXPLUS_COUNT];
   memset(ctx_list, 0, sizeof(ctx_list));
 
   ctx_list[CD_CTXPLUS_NATIVEWINDOW] = cdContextCairoNativeWindow();
diff --git a/src/cairo/cdcairoprn_unix.c b/src/cairo/cdcairoprn_unix.c
index 0c4544c..ddde827 100644
--- a/src/cairo/cdcairoprn_unix.c
+++ b/src/cairo/cdcairoprn_unix.c
@@ -194,8 +194,7 @@ static cdContext cdPrinterCairoContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_GETIMAGERGB |
                  CD_CAP_WRITEMODE | CD_CAP_PALETTE | CD_CAP_IMAGESRV),
-  1,
-  CD_CTX_DEVICE,
+  CD_CTX_DEVICE|CD_CTX_PLUS,
   cdcreatecanvas,
   cdinittable,
   NULL,
diff --git a/src/cairo/cdcairoprn_win32.c b/src/cairo/cdcairoprn_win32.c
index a5fadbd..003a8ac 100644
--- a/src/cairo/cdcairoprn_win32.c
+++ b/src/cairo/cdcairoprn_win32.c
@@ -181,8 +181,7 @@ static cdContext cdPrinterCairoContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_GETIMAGERGB |
                  CD_CAP_WRITEMODE | CD_CAP_PALETTE | CD_CAP_IMAGESRV),
-  1,
-  CD_CTX_DEVICE,
+  CD_CTX_DEVICE|CD_CTX_PLUS,
   cdcreatecanvas,
   cdinittable,
   NULL,
diff --git a/src/cairo/cdcairops.c b/src/cairo/cdcairops.c
index 8880255..0905716 100644
--- a/src/cairo/cdcairops.c
+++ b/src/cairo/cdcairops.c
@@ -158,8 +158,7 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdCairoPSContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE),
-  0,  /* not a plus driver */
-  CD_CTX_FILE,
+  CD_CTX_FILE,  /* not a plus driver */
   cdcreatecanvas,  
   cdinittable,
   NULL,                 
diff --git a/src/cairo/cdcairosvg.c b/src/cairo/cdcairosvg.c
index 116d39d..c147a3e 100644
--- a/src/cairo/cdcairosvg.c
+++ b/src/cairo/cdcairosvg.c
@@ -70,8 +70,7 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdCairoSVGContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE),
-  0,  /* not a plus driver */
-  CD_CTX_FILE,
+  CD_CTX_FILE,  /* not a plus driver */
   cdcreatecanvas,  
   cdinittable,
   NULL,                 
diff --git a/src/cd.c b/src/cd.c
index 50e1134..f833037 100644
--- a/src/cd.c
+++ b/src/cd.c
@@ -268,14 +268,14 @@ int cdContextIsPlus(cdContext *context)
 {
   if (!context)
     return CD_ERROR;
-  return context->plus;
+  return context->type&CD_CTX_PLUS? 1: 0;
 }
 
 int cdContextType(cdContext *context)
 {
   if (!context)
     return CD_ERROR;
-  return context->type;
+  return context->type&0x00FF;
 }
 
 int cdCanvasSimulate(cdCanvas* canvas, int mode)
@@ -752,7 +752,7 @@ void cdfCanvasPixel2MM(cdCanvas* canvas, double dx, double dy, double *mm_dx, do
 /***** Context Plus Functions ********/
 
 static int use_context_plus = 0;
-static cdContext* context_plus[NUM_CONTEXTPLUS] = {NULL, NULL, NULL, NULL, NULL, NULL};
+static cdContext* context_plus[CD_CTXPLUS_COUNT] = {NULL, NULL, NULL, NULL, NULL, NULL};
 
 int cdUseContextPlus(int use)
 {
@@ -768,14 +768,14 @@ int cdUseContextPlus(int use)
 void cdInitContextPlusList(cdContext* ctx_list[])
 {
   int ctx;
-  for (ctx = 0; ctx < NUM_CONTEXTPLUS; ctx++)
+  for (ctx = 0; ctx < CD_CTXPLUS_COUNT; ctx++)
     if (ctx_list[ctx] != NULL)
       context_plus[ctx] = ctx_list[ctx];
 }
 
 cdContext* cdGetContextPlus(int ctx)
 {
-  if (ctx < 0 || ctx >= NUM_CONTEXTPLUS)
+  if (ctx < 0 || ctx >= CD_CTXPLUS_COUNT)
     return NULL;
 
   return context_plus[ctx];
diff --git a/src/drv/cdcgm.c b/src/drv/cdcgm.c
index 17a1239..471a174 100644
--- a/src/drv/cdcgm.c
+++ b/src/drv/cdcgm.c
@@ -1135,7 +1135,6 @@ static cdContext cdCGMContext =
                  CD_CAP_FONTDIM | CD_CAP_TEXTSIZE | 
                  CD_CAP_IMAGERGBA | CD_CAP_GETIMAGERGB | 
                  CD_CAP_TEXTORIENTATION | CD_CAP_PATH | CD_CAP_BEZIER),
-  0,
   CD_CTX_FILE,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/drv/cddebug.c b/src/drv/cddebug.c
index 3550fc6..796947e 100644
--- a/src/drv/cddebug.c
+++ b/src/drv/cddebug.c
@@ -820,7 +820,6 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdDebugContext =
 {
   CD_CAP_ALL,
-  0,
   CD_CTX_FILE,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/drv/cddgn.c b/src/drv/cddgn.c
index 505526a..af818c9 100644
--- a/src/drv/cddgn.c
+++ b/src/drv/cddgn.c
@@ -1687,7 +1687,6 @@ static cdContext cdDGNContext =
                  CD_CAP_HATCH | CD_CAP_STIPPLE | CD_CAP_PATTERN | 
                  CD_CAP_IMAGERGBA | CD_CAP_GETIMAGERGB | 
                  CD_CAP_FPRIMTIVES  | CD_CAP_TEXTORIENTATION),
-  0,
   CD_CTX_FILE,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/drv/cddxf.c b/src/drv/cddxf.c
index bdb77a4..2518a36 100644
--- a/src/drv/cddxf.c
+++ b/src/drv/cddxf.c
@@ -1363,7 +1363,6 @@ static cdContext cdDXFContext =
                  CD_CAP_BACKGROUND | CD_CAP_BACKOPACITY | CD_CAP_WRITEMODE |
                  CD_CAP_HATCH | CD_CAP_STIPPLE | CD_CAP_PATTERN |
                  CD_CAP_IMAGERGBA | CD_CAP_GETIMAGERGB),
-  0,
   CD_CTX_FILE,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/drv/cdgl.c b/src/drv/cdgl.c
index 120e4bc..7fe7ba2 100644
--- a/src/drv/cdgl.c
+++ b/src/drv/cdgl.c
@@ -1547,7 +1547,6 @@ static cdContext cdGLContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_PALETTE | CD_CAP_LINEJOIN | CD_CAP_LINECAP |
                  CD_CAP_REGION | CD_CAP_STIPPLE | CD_CAP_PATTERN),
-  0,
   CD_CTX_WINDOW,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/drv/cdirgb.c b/src/drv/cdirgb.c
index 5b72dc6..90c8335 100644
--- a/src/drv/cdirgb.c
+++ b/src/drv/cdirgb.c
@@ -1878,7 +1878,6 @@ static cdContext cdImageRGBContext =
   CD_CAP_ALL & ~(CD_CAP_FLUSH | CD_CAP_PLAY | 
                  CD_CAP_LINECAP | CD_CAP_LINEJOIN | 
                  CD_CAP_PALETTE ),
-  0,
   CD_CTX_IMAGE,
   cdcreatecanvas,
   cdinittable,
@@ -1975,7 +1974,6 @@ static cdContext cdDBufferRGBContext =
   CD_CAP_ALL & ~(CD_CAP_PLAY |  
                  CD_CAP_LINECAP | CD_CAP_LINEJOIN | 
                  CD_CAP_PALETTE ),
-  0,
   CD_CTX_IMAGE,
   cdcreatecanvasDB,  
   cdinittableDB,
diff --git a/src/drv/cdmf.c b/src/drv/cdmf.c
index ecbdf8c..f309a82 100644
--- a/src/drv/cdmf.c
+++ b/src/drv/cdmf.c
@@ -1262,7 +1262,6 @@ static cdContext cdMetafileContext =
 {
   CD_CAP_ALL & ~(CD_CAP_GETIMAGERGB | CD_CAP_IMAGESRV | 
                  CD_CAP_REGION | CD_CAP_FONTDIM | CD_CAP_TEXTSIZE),
-  0,
   CD_CTX_FILE,
   cdcreatecanvasMF,
   cdinittableMF,
diff --git a/src/drv/cdpdf.c b/src/drv/cdpdf.c
index f7f3b36..4e4898b 100644
--- a/src/drv/cdpdf.c
+++ b/src/drv/cdpdf.c
@@ -1733,7 +1733,6 @@ static cdContext cdPDFContext =
   CD_CAP_ALL & ~(CD_CAP_CLEAR | CD_CAP_PLAY | CD_CAP_PALETTE | 
                  CD_CAP_REGION | CD_CAP_IMAGESRV | CD_CAP_TEXTSIZE | 
                  CD_CAP_WRITEMODE | CD_CAP_GETIMAGERGB),
-  0,
   CD_CTX_FILE,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/drv/cdpicture.c b/src/drv/cdpicture.c
index 85bb84a..9844763 100644
--- a/src/drv/cdpicture.c
+++ b/src/drv/cdpicture.c
@@ -1396,7 +1396,6 @@ static cdContext cdPictureContext =
 {
   CD_CAP_ALL & ~(CD_CAP_GETIMAGERGB | CD_CAP_IMAGESRV | 
                  CD_CAP_REGION | CD_CAP_FONTDIM | CD_CAP_TEXTSIZE),
-  0,
   CD_CTX_DEVICE,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/drv/cdps.c b/src/drv/cdps.c
index abd7359..88e7360 100644
--- a/src/drv/cdps.c
+++ b/src/drv/cdps.c
@@ -2127,7 +2127,6 @@ static cdContext cdPSContext =
                  CD_CAP_BACKGROUND | CD_CAP_BACKOPACITY | CD_CAP_WRITEMODE | 
                  CD_CAP_FONTDIM | CD_CAP_TEXTSIZE | 
                  CD_CAP_IMAGERGBA | CD_CAP_GETIMAGERGB),
-  0,
   CD_CTX_FILE,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/gdiplus/cdwclpp.cpp b/src/gdiplus/cdwclpp.cpp
index 9fa2c4c..666f8b1 100644
--- a/src/gdiplus/cdwclpp.cpp
+++ b/src/gdiplus/cdwclpp.cpp
@@ -188,8 +188,7 @@ static cdContext cdClipboardContext =
 {
   CD_CAP_ALL & ~(CD_CAP_CLEAR | CD_CAP_FLUSH | CD_CAP_YAXIS | CD_CAP_PLAY |
                  CD_CAP_IMAGERGBA | CD_CAP_GETIMAGERGB | CD_CAP_IMAGESRV ),
-  1,
-  CD_CTX_DEVICE,
+  CD_CTX_DEVICE|CD_CTX_PLUS,
   cdcreatecanvas,  
   cdinittable,
   NULL,          
diff --git a/src/gdiplus/cdwdbufp.cpp b/src/gdiplus/cdwdbufp.cpp
index df81265..cfa0319 100644
--- a/src/gdiplus/cdwdbufp.cpp
+++ b/src/gdiplus/cdwdbufp.cpp
@@ -148,8 +148,7 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdDBufferContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS ),
-  1,
-  CD_CTX_IMAGE,
+  CD_CTX_IMAGE|CD_CTX_PLUS,
   cdcreatecanvas,  
   cdinittable,
   NULL,             
diff --git a/src/gdiplus/cdwemfp.cpp b/src/gdiplus/cdwemfp.cpp
index b19f4cb..9bf9ec0 100644
--- a/src/gdiplus/cdwemfp.cpp
+++ b/src/gdiplus/cdwemfp.cpp
@@ -87,8 +87,7 @@ static cdContext cdEMFContext =
 {
   CD_CAP_ALL & ~(CD_CAP_CLEAR | CD_CAP_PLAY | CD_CAP_FLUSH | CD_CAP_YAXIS | 
                  CD_CAP_GETIMAGERGB | CD_CAP_IMAGESRV),
-  1,
-  CD_CTX_FILE,
+  CD_CTX_FILE|CD_CTX_PLUS,
   cdcreatecanvas,  
   cdinittable,
   NULL,          
diff --git a/src/gdiplus/cdwgdiplus.c b/src/gdiplus/cdwgdiplus.c
index 4997d3c..8a45239 100644
--- a/src/gdiplus/cdwgdiplus.c
+++ b/src/gdiplus/cdwgdiplus.c
@@ -25,7 +25,7 @@ void cdInitGdiPlus(void)
 
 void cdInitContextPlus(void)
 {
-  cdContext* ctx_list[NUM_CONTEXTPLUS];
+  cdContext* ctx_list[CD_CTXPLUS_COUNT];
   memset(ctx_list, 0, sizeof(ctx_list));
 
   ctx_list[CD_CTXPLUS_NATIVEWINDOW] = cdContextNativeWindowPlus();
diff --git a/src/gdiplus/cdwimgp.cpp b/src/gdiplus/cdwimgp.cpp
index 9b45edb..f04f91c 100644
--- a/src/gdiplus/cdwimgp.cpp
+++ b/src/gdiplus/cdwimgp.cpp
@@ -49,8 +49,7 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdImageContext =
 {
   CD_CAP_ALL & ~(CD_CAP_FLUSH | CD_CAP_PLAY | CD_CAP_YAXIS ),
-  1,
-  CD_CTX_IMAGE,
+  CD_CTX_IMAGE|CD_CTX_PLUS,
   cdcreatecanvas,  
   cdinittable,
   NULL,             
diff --git a/src/gdiplus/cdwnativep.cpp b/src/gdiplus/cdwnativep.cpp
index 4fdc19a..47979a0 100644
--- a/src/gdiplus/cdwnativep.cpp
+++ b/src/gdiplus/cdwnativep.cpp
@@ -122,8 +122,7 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdNativeContext =
 {
   CD_CAP_ALL & ~(CD_CAP_FLUSH | CD_CAP_PLAY | CD_CAP_YAXIS ),
-  1,
-  CD_CTX_WINDOW,
+  CD_CTX_WINDOW|CD_CTX_PLUS,
   cdcreatecanvas,
   cdinittable,
   NULL,              
diff --git a/src/gdiplus/cdwprnp.cpp b/src/gdiplus/cdwprnp.cpp
index df62ca5..4d32249 100644
--- a/src/gdiplus/cdwprnp.cpp
+++ b/src/gdiplus/cdwprnp.cpp
@@ -141,8 +141,7 @@ static cdContext cdPrinterContext =
 {
   CD_CAP_ALL & ~(CD_CAP_CLEAR | CD_CAP_PLAY | CD_CAP_YAXIS | 
                  CD_CAP_GETIMAGERGB | CD_CAP_IMAGESRV),
-  1,
-  CD_CTX_DEVICE,
+  CD_CTX_DEVICE|CD_CTX_PLUS,
   cdcreatecanvas,  
   cdinittable,
   NULL,                 
diff --git a/src/gdk/cdgdkclp.c b/src/gdk/cdgdkclp.c
index e861b5e..50a6a22 100644
--- a/src/gdk/cdgdkclp.c
+++ b/src/gdk/cdgdkclp.c
@@ -121,7 +121,6 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdClipboardContext =
 {
   CD_CAP_ALL & ~(CD_CAP_GETIMAGERGB | CD_CAP_IMAGESRV | CD_CAP_FONTDIM | CD_CAP_TEXTSIZE ),  /* same as CD_MF */
-  0,
   CD_CTX_DEVICE,
   cdcreatecanvas,  
   cdinittable,
diff --git a/src/gdk/cdgdkdbuf.c b/src/gdk/cdgdkdbuf.c
index 3df8ec3..ad409ed 100644
--- a/src/gdk/cdgdkdbuf.c
+++ b/src/gdk/cdgdkdbuf.c
@@ -128,7 +128,6 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdDBufferContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_PATH | CD_CAP_BEZIER | CD_CAP_FPRIMTIVES ),
-  0,
   CD_CTX_IMAGE,
   cdcreatecanvas,  
   cdinittable,
diff --git a/src/gdk/cdgdkimg.c b/src/gdk/cdgdkimg.c
index aab9a1b..b9532e5 100644
--- a/src/gdk/cdgdkimg.c
+++ b/src/gdk/cdgdkimg.c
@@ -31,7 +31,6 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdImageContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_FPRIMTIVES | CD_CAP_PATH | CD_CAP_BEZIER ),
-  0,
   CD_CTX_IMAGE,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/gdk/cdgdknative.c b/src/gdk/cdgdknative.c
index 8e66dbe..bbad84c 100644
--- a/src/gdk/cdgdknative.c
+++ b/src/gdk/cdgdknative.c
@@ -96,7 +96,6 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdNativeWindowContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_FPRIMTIVES | CD_CAP_PATH | CD_CAP_BEZIER ),
-  0,
   CD_CTX_WINDOW,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/lua5/cdvoid5.c b/src/lua5/cdvoid5.c
index ebc965c..67c2c99 100644
--- a/src/lua5/cdvoid5.c
+++ b/src/lua5/cdvoid5.c
@@ -115,7 +115,6 @@ void cdinittable(cdCanvas* canvas)
 
 static cdContext cdVoidContext =
 {
-  0,
   0,
   0,
   cdcreatecanvas,
diff --git a/src/svg/cdsvg.c b/src/svg/cdsvg.c
index 64d6be7..ca495e3 100644
--- a/src/svg/cdsvg.c
+++ b/src/svg/cdsvg.c
@@ -1342,7 +1342,6 @@ static cdContext cdSVGContext =
                  CD_CAP_REGION | CD_CAP_IMAGESRV | CD_CAP_WRITEMODE | 
                  CD_CAP_FONTDIM | CD_CAP_TEXTSIZE | 
                  CD_CAP_GETIMAGERGB),
-  0,
   CD_CTX_FILE,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/win32/cdwclp.c b/src/win32/cdwclp.c
index 3c31569..f532bf5 100644
--- a/src/win32/cdwclp.c
+++ b/src/win32/cdwclp.c
@@ -530,7 +530,6 @@ static cdContext cdClipboardContext =
   CD_CAP_ALL & ~(CD_CAP_CLEAR | CD_CAP_YAXIS | 
                  CD_CAP_IMAGERGBA | CD_CAP_GETIMAGERGB | CD_CAP_IMAGESRV | 
                  CD_CAP_FPRIMTIVES ),
-  0,
   CD_CTX_DEVICE,
   cdcreatecanvas,  
   cdinittable,
diff --git a/src/win32/cdwdbuf.c b/src/win32/cdwdbuf.c
index 54dbf16..82ccb56 100644
--- a/src/win32/cdwdbuf.c
+++ b/src/win32/cdwdbuf.c
@@ -141,7 +141,6 @@ static cdContext cdDBufferContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | 
                  CD_CAP_FPRIMTIVES ),
-  0,
   CD_CTX_IMAGE,
   cdcreatecanvas,  
   cdinittable,
diff --git a/src/win32/cdwemf.c b/src/win32/cdwemf.c
index 3932c36..f9a0598 100644
--- a/src/win32/cdwemf.c
+++ b/src/win32/cdwemf.c
@@ -97,7 +97,6 @@ static cdContext cdEMFContext =
   CD_CAP_ALL & ~(CD_CAP_CLEAR | CD_CAP_YAXIS | 
                  CD_CAP_IMAGERGBA | CD_CAP_GETIMAGERGB | CD_CAP_IMAGESRV | 
                  CD_CAP_FPRIMTIVES ),
-  0,
   CD_CTX_FILE,
   cdcreatecanvas,  
   cdinittable,
diff --git a/src/win32/cdwimg.c b/src/win32/cdwimg.c
index 294a8d7..3fe912e 100644
--- a/src/win32/cdwimg.c
+++ b/src/win32/cdwimg.c
@@ -63,7 +63,6 @@ static cdContext cdImageContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | 
                  CD_CAP_FPRIMTIVES ),
-  0,
   CD_CTX_IMAGE,
   cdcreatecanvas,  
   cdinittable,
diff --git a/src/win32/cdwnative.c b/src/win32/cdwnative.c
index bd9d4dd..ab5df6b 100644
--- a/src/win32/cdwnative.c
+++ b/src/win32/cdwnative.c
@@ -185,7 +185,6 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdNativeContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_FPRIMTIVES ),
-  0,
   CD_CTX_WINDOW,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/win32/cdwprn.c b/src/win32/cdwprn.c
index 1ffcd03..f158ac0 100644
--- a/src/win32/cdwprn.c
+++ b/src/win32/cdwprn.c
@@ -185,7 +185,6 @@ static cdContext cdPrinterContext =
   CD_CAP_ALL & ~(CD_CAP_CLEAR | CD_CAP_PLAY | CD_CAP_YAXIS | 
                  CD_CAP_IMAGERGBA | CD_CAP_GETIMAGERGB | CD_CAP_IMAGESRV | 
                  CD_CAP_FPRIMTIVES ),
-  0,
   CD_CTX_DEVICE,
   cdcreatecanvas,  
   cdinittable,
diff --git a/src/win32/cdwwmf.c b/src/win32/cdwwmf.c
index 26d8fa9..d0e9a6c 100644
--- a/src/win32/cdwwmf.c
+++ b/src/win32/cdwwmf.c
@@ -96,8 +96,7 @@ static cdContext cdWMFContext =
                  CD_CAP_IMAGERGBA | CD_CAP_GETIMAGERGB | CD_CAP_IMAGESRV | 
                  CD_CAP_LINECAP | CD_CAP_LINEJOIN |
                  CD_CAP_FPRIMTIVES ),
-  0,
-  CD_CTX_FILE,
+  CD_CTX_FILE|CD_CTX_PLUS,
   cdcreatecanvas,  
   cdinittable,
   cdplayWMF,          
diff --git a/src/x11/cdxclp.c b/src/x11/cdxclp.c
index ed3b0db..6d3e3b4 100644
--- a/src/x11/cdxclp.c
+++ b/src/x11/cdxclp.c
@@ -124,7 +124,6 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdClipboardContext =
 {
   CD_CAP_ALL & ~(CD_CAP_GETIMAGERGB | CD_CAP_IMAGESRV | CD_CAP_FONTDIM | CD_CAP_TEXTSIZE ),  /* same as CD_MF */
-  0,
   CD_CTX_DEVICE,
   cdcreatecanvas,  
   cdinittable,
diff --git a/src/x11/cdxdbuf.c b/src/x11/cdxdbuf.c
index 7d29467..e57e800 100644
--- a/src/x11/cdxdbuf.c
+++ b/src/x11/cdxdbuf.c
@@ -127,7 +127,6 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdDBufferContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_FPRIMTIVES | CD_CAP_PATH | CD_CAP_BEZIER ),
-  0,
   CD_CTX_IMAGE,
   cdcreatecanvas,  
   cdinittable,
diff --git a/src/x11/cdximg.c b/src/x11/cdximg.c
index 12db352..0bb1b34 100644
--- a/src/x11/cdximg.c
+++ b/src/x11/cdximg.c
@@ -31,7 +31,6 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdImageContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_FPRIMTIVES | CD_CAP_PATH | CD_CAP_BEZIER ),
-  0,
   CD_CTX_IMAGE,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/x11/cdxnative.c b/src/x11/cdxnative.c
index ddf6670..4ab65e0 100644
--- a/src/x11/cdxnative.c
+++ b/src/x11/cdxnative.c
@@ -144,7 +144,6 @@ static void cdinittable(cdCanvas* canvas)
 static cdContext cdNativeWindowContext =
 {
   CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_FPRIMTIVES | CD_CAP_PATH | CD_CAP_BEZIER),
-  0,
   CD_CTX_WINDOW,
   cdcreatecanvas,
   cdinittable,
diff --git a/src/xrender/cdxrender.c b/src/xrender/cdxrender.c
index dfd4370..421dfa5 100644
--- a/src/xrender/cdxrender.c
+++ b/src/xrender/cdxrender.c
@@ -1013,11 +1013,11 @@ static void xrInitTableDBUFFER(cdCanvas* canvas)
 
 cdContext* cdContextDBufferPlus(void)
 {
-  if (!cdDBufferContext.plus)
+  if (!(cdDBufferContext.type & CD_CTX_PLUS))
   {
     int old_plus = cdUseContextPlus(0);  /* disable context plus */
     cdDBufferContext = *cdContextDBuffer();  /* copy original context */
-    cdDBufferContext.plus = 1; /* mark as plus */
+    cdDBufferContext.type |= CD_CTX_PLUS; /* mark as plus */
     cdDBufferContext.caps |= CD_CAP_FPRIMTIVES;
 
     /* save original methods */
@@ -1049,7 +1049,7 @@ static void xrInitTableNATIVE(cdCanvas* canvas)
 
 cdContext* cdContextNativeWindowPlus(void)
 {
-  if (!cdNativeWindowContext.plus)
+  if (!(cdNativeWindowContext.type & CD_CTX_PLUS))
   {
     int old_plus = cdUseContextPlus(0);
     cdNativeWindowContext = *cdContextNativeWindow();
@@ -1057,7 +1057,7 @@ cdContext* cdContextNativeWindowPlus(void)
     cdinittableNATIVE = cdNativeWindowContext.cxInitTable;
     cdNativeWindowContext.cxCreateCanvas = xrCreateCanvasNATIVE;
     cdNativeWindowContext.cxInitTable = xrInitTableNATIVE;
-    cdNativeWindowContext.plus = 1;
+    cdNativeWindowContext.type |= CD_CTX_PLUS;
     cdNativeWindowContext.caps |= CD_CAP_FPRIMTIVES;
     cdUseContextPlus(old_plus);
   }
@@ -1080,7 +1080,7 @@ static void xrInitTableIMAGE(cdCanvas* canvas)
 
 cdContext* cdContextImagePlus(void)
 {
-  if (!cdImageContext.plus)
+  if (!(cdImageContext.type & CD_CTX_PLUS))
   {
     int old_plus = cdUseContextPlus(0);
     cdImageContext = *cdContextImage();
@@ -1088,7 +1088,7 @@ cdContext* cdContextImagePlus(void)
     cdinittableIMAGE = cdImageContext.cxInitTable;
     cdImageContext.cxCreateCanvas = xrCreateCanvasIMAGE;
     cdImageContext.cxInitTable = xrInitTableIMAGE;
-    cdImageContext.plus = 1;
+    cdImageContext.type |= CD_CTX_PLUS;
     cdImageContext.caps |= CD_CAP_FPRIMTIVES;
     cdUseContextPlus(old_plus);
   }
diff --git a/src/xrender/cdxrplus.c b/src/xrender/cdxrplus.c
index 589aa3c..af3bbde 100644
--- a/src/xrender/cdxrplus.c
+++ b/src/xrender/cdxrplus.c
@@ -15,7 +15,7 @@ cdContext* cdContextDBufferPlus(void);
 
 void cdInitContextPlus(void)
 {
-  cdContext* ctx_list[NUM_CONTEXTPLUS];
+  cdContext* ctx_list[CD_CTXPLUS_COUNT];
   memset(ctx_list, 0, sizeof(ctx_list));
 
   ctx_list[CD_CTXPLUS_NATIVEWINDOW] = cdContextNativeWindowPlus();
-- 
cgit v1.2.3