summaryrefslogtreecommitdiffstats
path: root/src/bltGrPenOp.C
diff options
context:
space:
mode:
authorjoye <joye>2014-03-28 20:18:43 (GMT)
committerjoye <joye>2014-03-28 20:18:43 (GMT)
commit01082bf9a06f36853fe3b0b4a2f1709adcc3c9c9 (patch)
tree4341733a8c187249a77fd87510e8ed94229d18e9 /src/bltGrPenOp.C
parent74050d79a4b0d0a97c5f9f2530a17cde9ca004c5 (diff)
downloadblt-01082bf9a06f36853fe3b0b4a2f1709adcc3c9c9.zip
blt-01082bf9a06f36853fe3b0b4a2f1709adcc3c9c9.tar.gz
blt-01082bf9a06f36853fe3b0b4a2f1709adcc3c9c9.tar.bz2
*** empty log message ***
Diffstat (limited to 'src/bltGrPenOp.C')
-rw-r--r--src/bltGrPenOp.C32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/bltGrPenOp.C b/src/bltGrPenOp.C
index 8da39ec..4273ebb 100644
--- a/src/bltGrPenOp.C
+++ b/src/bltGrPenOp.C
@@ -38,10 +38,17 @@ extern "C" {
#include "bltOp.h"
};
-#include "bltGrElem.h"
+#include "bltGrPenOp.h"
+#include "bltGrPenLine.h"
+#include "bltGrPenBar.h"
// Defs
+extern int Blt_GetPenFromObj(Tcl_Interp* interp, Graph* graphPtr, Tcl_Obj *objPtr, ClassId classId, Pen **penPtrPtr);
+extern void Blt_FreePen(Pen* penPtr);
+
+static Pen* CreateBarPen(Graph* graphPtr, const char *penName);
+static Pen* CreateLinePen(Graph* graphPtr, const char* penName);
static void DestroyPen(Pen* penPtr);
static int GetPenFromObj(Tcl_Interp* interp, Graph* graphPtr, Tcl_Obj *objPtr,
Pen **penPtrPtr);
@@ -129,10 +136,10 @@ int Blt_CreatePen(Graph* graphPtr, Tcl_Interp* interp,
Pen* penPtr;
switch (classId) {
case CID_ELEM_BAR:
- penPtr = Blt_BarPen(graphPtr, penName);
+ penPtr = CreateBarPen(graphPtr, penName);
break;
case CID_ELEM_LINE:
- penPtr = Blt_LinePen(graphPtr, penName);
+ penPtr = CreateLinePen(graphPtr, penName);
break;
default:
return TCL_ERROR;
@@ -441,3 +448,22 @@ static int GetPenFromObj(Tcl_Interp* interp, Graph* graphPtr, Tcl_Obj *objPtr,
return TCL_OK;
}
+static Pen* CreateBarPen(Graph* graphPtr, const char *penName)
+{
+ BarPen* penPtr = (BarPen*)calloc(1, sizeof(BarPen));
+ InitBarPen(graphPtr, penPtr);
+ penPtr->name = Blt_Strdup(penName);
+
+ return (Pen*)penPtr;
+}
+
+static Pen* CreateLinePen(Graph* graphPtr, const char* penName)
+{
+ LinePen* penPtr = (LinePen*)calloc(1, sizeof(LinePen));
+ InitLinePen(graphPtr, penPtr);
+ penPtr->name = Blt_Strdup(penName);
+ penPtr->classId = CID_ELEM_LINE;
+
+ return (Pen*)penPtr;
+}
+