1 //******************************************************************************
2 //  Copyright (c) 2005-2013 by Jan Van hijfte
3 //
4 //  See the included file COPYING.TXT for details about the copyright.
5 //
6 //  This program is distributed in the hope that it will be useful,
7 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
8 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 //******************************************************************************
10 
11 
12 #include "qpen_c.h"
13 
QPen_Create()14 QPenH QPen_Create()
15 {
16 	return (QPenH) new QPen();
17 }
18 
QPen_Destroy(QPenH handle)19 void QPen_Destroy(QPenH handle)
20 {
21 	delete (QPen *)handle;
22 }
23 
QPen_Create2(Qt::PenStyle AnonParam1)24 QPenH QPen_Create2(Qt::PenStyle AnonParam1)
25 {
26 	return (QPenH) new QPen(AnonParam1);
27 }
28 
QPen_Create3(const QColorH color)29 QPenH QPen_Create3(const QColorH color)
30 {
31 	return (QPenH) new QPen(*(const QColor*)color);
32 }
33 
QPen_Create4(const QBrushH brush,qreal width,Qt::PenStyle s,Qt::PenCapStyle c,Qt::PenJoinStyle j)34 QPenH QPen_Create4(const QBrushH brush, qreal width, Qt::PenStyle s, Qt::PenCapStyle c, Qt::PenJoinStyle j)
35 {
36 	return (QPenH) new QPen(*(const QBrush*)brush, width, s, c, j);
37 }
38 
QPen_Create5(const QPenH pen)39 QPenH QPen_Create5(const QPenH pen)
40 {
41 	return (QPenH) new QPen(*(const QPen*)pen);
42 }
43 
QPen_swap(QPenH handle,QPenH other)44 void QPen_swap(QPenH handle, QPenH other)
45 {
46 	((QPen *)handle)->swap(*(QPen*)other);
47 }
48 
QPen_style(QPenH handle)49 Qt::PenStyle QPen_style(QPenH handle)
50 {
51 	return (Qt::PenStyle) ((QPen *)handle)->style();
52 }
53 
QPen_setStyle(QPenH handle,Qt::PenStyle AnonParam1)54 void QPen_setStyle(QPenH handle, Qt::PenStyle AnonParam1)
55 {
56 	((QPen *)handle)->setStyle(AnonParam1);
57 }
58 
QPen_dashPattern(QPenH handle,PQRealArray retval)59 void QPen_dashPattern(QPenH handle, PQRealArray retval)
60 {
61 	QVector<qreal> t_retval;
62 	t_retval = ((QPen *)handle)->dashPattern();
63 	copyQVectorQRealToQRealArray(t_retval, retval);
64 }
65 
QPen_setDashPattern(QPenH handle,PQRealArray pattern)66 void QPen_setDashPattern(QPenH handle, PQRealArray pattern)
67 {
68 	QVector<qreal> t_pattern;
69 	copyQRealArrayToQVectorQReal(pattern, t_pattern);
70 	((QPen *)handle)->setDashPattern(t_pattern);
71 }
72 
QPen_dashOffset(QPenH handle)73 qreal QPen_dashOffset(QPenH handle)
74 {
75 	return (qreal) ((QPen *)handle)->dashOffset();
76 }
77 
QPen_setDashOffset(QPenH handle,qreal doffset)78 void QPen_setDashOffset(QPenH handle, qreal doffset)
79 {
80 	((QPen *)handle)->setDashOffset(doffset);
81 }
82 
QPen_miterLimit(QPenH handle)83 qreal QPen_miterLimit(QPenH handle)
84 {
85 	return (qreal) ((QPen *)handle)->miterLimit();
86 }
87 
QPen_setMiterLimit(QPenH handle,qreal limit)88 void QPen_setMiterLimit(QPenH handle, qreal limit)
89 {
90 	((QPen *)handle)->setMiterLimit(limit);
91 }
92 
QPen_widthF(QPenH handle)93 qreal QPen_widthF(QPenH handle)
94 {
95 	return (qreal) ((QPen *)handle)->widthF();
96 }
97 
QPen_setWidthF(QPenH handle,qreal width)98 void QPen_setWidthF(QPenH handle, qreal width)
99 {
100 	((QPen *)handle)->setWidthF(width);
101 }
102 
QPen_width(QPenH handle)103 int QPen_width(QPenH handle)
104 {
105 	return (int) ((QPen *)handle)->width();
106 }
107 
QPen_setWidth(QPenH handle,int width)108 void QPen_setWidth(QPenH handle, int width)
109 {
110 	((QPen *)handle)->setWidth(width);
111 }
112 
QPen_color(QPenH handle,PQColor retval)113 void QPen_color(QPenH handle, PQColor retval)
114 {
115 	*(QColor *)retval = ((QPen *)handle)->color();
116 }
117 
QPen_setColor(QPenH handle,const QColorH color)118 void QPen_setColor(QPenH handle, const QColorH color)
119 {
120 	((QPen *)handle)->setColor(*(const QColor*)color);
121 }
122 
QPen_brush(QPenH handle,QBrushH retval)123 void QPen_brush(QPenH handle, QBrushH retval)
124 {
125 	*(QBrush *)retval = ((QPen *)handle)->brush();
126 }
127 
QPen_setBrush(QPenH handle,const QBrushH brush)128 void QPen_setBrush(QPenH handle, const QBrushH brush)
129 {
130 	((QPen *)handle)->setBrush(*(const QBrush*)brush);
131 }
132 
QPen_isSolid(QPenH handle)133 bool QPen_isSolid(QPenH handle)
134 {
135 	return (bool) ((QPen *)handle)->isSolid();
136 }
137 
QPen_capStyle(QPenH handle)138 Qt::PenCapStyle QPen_capStyle(QPenH handle)
139 {
140 	return (Qt::PenCapStyle) ((QPen *)handle)->capStyle();
141 }
142 
QPen_setCapStyle(QPenH handle,Qt::PenCapStyle pcs)143 void QPen_setCapStyle(QPenH handle, Qt::PenCapStyle pcs)
144 {
145 	((QPen *)handle)->setCapStyle(pcs);
146 }
147 
QPen_joinStyle(QPenH handle)148 Qt::PenJoinStyle QPen_joinStyle(QPenH handle)
149 {
150 	return (Qt::PenJoinStyle) ((QPen *)handle)->joinStyle();
151 }
152 
QPen_setJoinStyle(QPenH handle,Qt::PenJoinStyle pcs)153 void QPen_setJoinStyle(QPenH handle, Qt::PenJoinStyle pcs)
154 {
155 	((QPen *)handle)->setJoinStyle(pcs);
156 }
157 
QPen_isCosmetic(QPenH handle)158 bool QPen_isCosmetic(QPenH handle)
159 {
160 	return (bool) ((QPen *)handle)->isCosmetic();
161 }
162 
QPen_setCosmetic(QPenH handle,bool cosmetic)163 void QPen_setCosmetic(QPenH handle, bool cosmetic)
164 {
165 	((QPen *)handle)->setCosmetic(cosmetic);
166 }
167 
QPen_isDetached(QPenH handle)168 bool QPen_isDetached(QPenH handle)
169 {
170 	return (bool) ((QPen *)handle)->isDetached();
171 }
172 
173