]> git.saurik.com Git - wxWidgets.git/blame - include/wx/pen.h
restore previous encoding, changed for error to UTF8
[wxWidgets.git] / include / wx / pen.h
CommitLineData
99d80019
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/pen.h
3// Purpose: Base header for wxPen
4// Author: Julian Smart
5// Modified by:
6// Created:
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows Licence
10/////////////////////////////////////////////////////////////////////////////
11
34138703
JS
12#ifndef _WX_PEN_H_BASE_
13#define _WX_PEN_H_BASE_
c801d85f 14
e45689df
MW
15#include "wx/defs.h"
16
6cef0db2
FM
17#if WXWIN_COMPATIBILITY_2_8
18#include "wx/brush.h" // needed for some deprecated declarations
19#endif
20
82cddbd9
FM
21enum wxPenStyle
22{
23#if WXWIN_COMPATIBILITY_2_8
24 /* start of deprecated values */
25 /* wxSOLID, wxTRANSPARENT, wxSTIPPLE are already defined in wxBrushStyle */
26 wxDOT = 101,
27 wxLONG_DASH = 102,
28 wxSHORT_DASH = 103,
29 wxDOT_DASH = 104,
30 wxUSER_DASH = 105,
31 /* end of deprecated values */
32
33 wxPENSTYLE_SOLID = wxSOLID,
34 wxPENSTYLE_DOT = wxDOT,
35 wxPENSTYLE_LONG_DASH = wxLONG_DASH,
36 wxPENSTYLE_SHORT_DASH = wxSHORT_DASH,
37 wxPENSTYLE_DOT_DASH = wxDOT_DASH,
777819af 38 wxPENSTYLE_USER_DASH = wxUSER_DASH,
82cddbd9
FM
39
40 wxPENSTYLE_TRANSPARENT = wxTRANSPARENT,
41
42 wxPENSTYLE_STIPPLE_MASK_OPAQUE = wxSTIPPLE_MASK_OPAQUE,
43 wxPENSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK,
44 wxPENSTYLE_STIPPLE = wxSTIPPLE,
45
46 wxPENSTYLE_BDIAGONAL_HATCH = wxBDIAGONAL_HATCH,
47 wxPENSTYLE_CROSSDIAG_HATCH = wxCROSSDIAG_HATCH,
48 wxPENSTYLE_FDIAGONAL_HATCH = wxFDIAGONAL_HATCH,
49 wxPENSTYLE_CROSS_HATCH = wxCROSS_HATCH,
50 wxPENSTYLE_HORIZONTAL_HATCH = wxHORIZONTAL_HATCH,
51 wxPENSTYLE_VERTICAL_HATCH = wxVERTICAL_HATCH,
52
53 wxPENSTYLE_FIRST_HATCH = wxFIRST_HATCH,
54 wxPENSTYLE_LAST_HATCH = wxLAST_HATCH,
55
56 wxPENSTYLE_MAX
57#else
58 wxPENSTYLE_SOLID,
59 wxPENSTYLE_DOT,
60 wxPENSTYLE_LONG_DASH,
61 wxPENSTYLE_SHORT_DASH,
62 wxPENSTYLE_DOT_DASH,
777819af 63 wxPENSTYLE_USER_DASH,
82cddbd9
FM
64
65 wxPENSTYLE_TRANSPARENT,
66
67 /* Pen Stippling. */
68 wxPENSTYLE_STIPPLE_MASK_OPAQUE,
69 /* mask is used for blitting monochrome using text fore and back ground colors */
70
71 wxPENSTYLE_STIPPLE_MASK,
72 /* mask is used for masking areas in the stipple bitmap (TO DO) */
73
74 wxPENSTYLE_STIPPLE,
75 /* drawn with a Pen, and without any Brush -- and it can be stippled. */
76
77 /* In wxWidgets < 2.6 use WX_HATCH macro */
78 /* to verify these wx*_HATCH are in style */
79 /* of wxBrush. In wxWidgets >= 2.6 use */
80 /* wxBrush::IsHatch() instead. */
81 wxPENSTYLE_BDIAGONAL_HATCH,
82 wxPENSTYLE_CROSSDIAG_HATCH,
83 wxPENSTYLE_FDIAGONAL_HATCH,
84 wxPENSTYLE_CROSS_HATCH,
85 wxPENSTYLE_HORIZONTAL_HATCH,
86 wxPENSTYLE_VERTICAL_HATCH,
87
88 wxPENSTYLE_FIRST_HATCH = wxPENSTYLE_BDIAGONAL_HATCH,
89 wxPENSTYLE_LAST_HATCH = wxPENSTYLE_VERTICAL_HATCH,
90
91 wxPENSTYLE_MAX
92#endif
93};
94
95enum wxPenJoin
96{
97 wxJOIN_INVALID = -1,
98
99 wxJOIN_BEVEL = 120,
100 wxJOIN_MITER,
101 wxJOIN_ROUND,
102};
103
104enum wxPenCap
105{
106 wxCAP_INVALID = -1,
107
108 wxCAP_ROUND = 130,
109 wxCAP_PROJECTING,
110 wxCAP_BUTT
111};
112
113
114class WXDLLEXPORT wxPenBase : public wxGDIObject
115{
116public:
117 virtual ~wxPenBase() { }
118
119 virtual void SetColour(const wxColour& col) = 0;
120 virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) = 0;
121
122 virtual void SetWidth(int width) = 0;
123 virtual void SetStyle(wxPenStyle style) = 0;
124 virtual void SetStipple(const wxBitmap& stipple) = 0;
125 virtual void SetDashes(int nb_dashes, const wxDash *dash) = 0;
126 virtual void SetJoin(wxPenJoin join) = 0;
127 virtual void SetCap(wxPenCap cap) = 0;
128
129 virtual wxColour& GetColour() const = 0;
130 virtual wxBitmap *GetStipple() const = 0;
131 virtual wxPenStyle GetStyle() const = 0;
132 virtual wxPenJoin GetJoin() const = 0;
133 virtual wxPenCap GetCap() const = 0;
134 virtual int GetWidth() const = 0;
135 virtual int GetDashes(wxDash **ptr) const = 0;
136
137#if WXWIN_COMPATIBILITY_2_8
138 void SetStyle(wxBrushStyle style)
139 { SetStyle((wxPenStyle)style); }
140#endif
141};
142
4055ed82 143#if defined(__WXPALMOS__)
ffecfa5a
JS
144#include "wx/palmos/pen.h"
145#elif defined(__WXMSW__)
c801d85f 146#include "wx/msw/pen.h"
4f535231 147#elif defined(__WXMOTIF__) || defined(__WXX11__)
69c44812 148#include "wx/x11/pen.h"
1be7a35c 149#elif defined(__WXGTK20__)
c801d85f 150#include "wx/gtk/pen.h"
1be7a35c
MR
151#elif defined(__WXGTK__)
152#include "wx/gtk1/pen.h"
b2a19d94
VS
153#elif defined(__WXMGL__)
154#include "wx/mgl/pen.h"
b3c86150
VS
155#elif defined(__WXDFB__)
156#include "wx/dfb/pen.h"
34138703
JS
157#elif defined(__WXMAC__)
158#include "wx/mac/pen.h"
e64df9bc
DE
159#elif defined(__WXCOCOA__)
160#include "wx/cocoa/pen.h"
1777b9bb
DW
161#elif defined(__WXPM__)
162#include "wx/os2/pen.h"
c801d85f
KB
163#endif
164
82cddbd9
FM
165class WXDLLIMPEXP_CORE wxPenList: public wxGDIObjListBase
166{
167public:
168 wxPen *FindOrCreatePen(const wxColour& colour, int width, wxPenStyle style);
169#if WXWIN_COMPATIBILITY_2_6
170 wxDEPRECATED( void AddPen(wxPen*) );
171 wxDEPRECATED( void RemovePen(wxPen*) );
172#endif
173};
174
175extern WXDLLEXPORT_DATA(wxPenList*) wxThePenList;
176
c801d85f 177#endif
34138703 178 // _WX_PEN_H_BASE_