From 64a0b5ebb41d36a7db87d24c5451f7db925e24f8 Mon Sep 17 00:00:00 2001
From: scuri <scuri>
Date: Fri, 18 Mar 2011 22:23:38 +0000
Subject: New: functions cdContextIsPlus and cdContextType.

---
 include/cd.h         | 12 +++++++++++-
 include/cd_private.h |  5 +++--
 2 files changed, 14 insertions(+), 3 deletions(-)

(limited to 'include')

diff --git a/include/cd.h b/include/cd.h
index 556afa1..70c266e 100644
--- a/include/cd.h
+++ b/include/cd.h
@@ -57,6 +57,8 @@ void        cdInitContextPlus(void);   /* need an external library */
 typedef int (*cdCallback)(cdCanvas* canvas, ...);
 int cdContextRegisterCallback(cdContext *context, int cb, cdCallback func);
 unsigned long cdContextCaps(cdContext *context);
+int cdContextIsPlus(cdContext *context);
+int cdContextType(cdContext *context);
 
 /* control */
 int      cdCanvasSimulate(cdCanvas* canvas, int mode);
@@ -394,7 +396,7 @@ enum {                          /* some font sizes */
  CD_LARGE    = 18
 };
 
-/* Canvas Capabilities */
+/* Context Capabilities */
 #define CD_CAP_NONE             0x00000000
 #define CD_CAP_FLUSH            0x00000001
 #define CD_CAP_CLEAR            0x00000002
@@ -430,6 +432,14 @@ enum {                          /* some font sizes */
 #define CD_CAP_BEZIER           0x80000000
 #define CD_CAP_ALL              0xFFFFFFFF
 
+/* Context Types */
+enum { 
+  CD_CTX_WINDOW, 
+  CD_CTX_DEVICE, 
+  CD_CTX_IMAGE,
+  CD_CTX_FILE
+};
+
 /* cdPlay definitions */
 #define CD_SIZECB 0        /* size callback */
 typedef int(*cdSizeCB)(cdCanvas *canvas, int w, int h, double w_mm, double h_mm);
diff --git a/include/cd_private.h b/include/cd_private.h
index c85ddbf..672d23c 100644
--- a/include/cd_private.h
+++ b/include/cd_private.h
@@ -68,7 +68,8 @@ struct _cdImage
 struct _cdContext
 {
   unsigned long caps;  /* canvas capabilities, combination of CD_CAP_*  */
-  int plus; /* indicates if the canvas is context plus */
+  int plus; /* indicates if the context is a context plus */
+  int type; /* context type WINDOW, DEVICE, IMAGE or FILE */
 
   /* can NOT be NULL */
   void  (*cxCreateCanvas)(cdCanvas* canvas, void *data);
@@ -262,7 +263,7 @@ void wdSetDefaults(cdCanvas* canvas);
 /********************/
 void cdInitContextPlusList(cdContext* ctx_list[]);
 cdContext* cdGetContextPlus(int ctx);
-enum{CD_CTX_NATIVEWINDOW, CD_CTX_IMAGE, CD_CTX_DBUFFER, CD_CTX_PRINTER, CD_CTX_EMF, CD_CTX_CLIPBOARD}; 
+enum{CD_CTXPLUS_NATIVEWINDOW, CD_CTXPLUS_IMAGE, CD_CTXPLUS_DBUFFER, CD_CTXPLUS_PRINTER, CD_CTXPLUS_EMF, CD_CTXPLUS_CLIPBOARD}; 
 #define NUM_CONTEXTPLUS 6
 
 /*************/
-- 
cgit v1.2.3