-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdc.cpp
More file actions
499 lines (383 loc) · 9.86 KB
/
dc.cpp
File metadata and controls
499 lines (383 loc) · 9.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
/////////////////////////////////////////////////////////////////////////////
// Name: src/palmos/dc.cpp
// Purpose: wxDC class
// Author: William Osborne - minimal working wxPalmOS port
// Modified by:
// Created: 10/13/04
// RCS-ID: $Id: dc.cpp 40943 2006-08-31 19:31:43Z ABX $
// Copyright: (c) William Osborne
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ===========================================================================
// declarations
// ===========================================================================
// ---------------------------------------------------------------------------
// headers
// ---------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/window.h"
#include "wx/dc.h"
#include "wx/utils.h"
#include "wx/dialog.h"
#include "wx/app.h"
#include "wx/bitmap.h"
#include "wx/dcmemory.h"
#include "wx/log.h"
#include "wx/icon.h"
#include "wx/dcprint.h"
#include "wx/module.h"
#endif
#include "wx/sysopt.h"
#include "wx/dynload.h"
#ifdef wxHAVE_RAW_BITMAP
#include "wx/rawbmp.h"
#endif
#include <string.h>
#ifndef AC_SRC_ALPHA
#define AC_SRC_ALPHA 1
#endif
/* Quaternary raster codes */
#ifndef MAKEROP4
#define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore))
#endif
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxDCBase)
// ---------------------------------------------------------------------------
// constants
// ---------------------------------------------------------------------------
static const int VIEWPORT_EXTENT = 1000;
static const int MM_POINTS = 9;
static const int MM_METRIC = 10;
#define DSTCOPY 0x00AA0029
// ---------------------------------------------------------------------------
// private functions
// ---------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
// ===========================================================================
// implementation
// ===========================================================================
// ---------------------------------------------------------------------------
// wxDC
// ---------------------------------------------------------------------------
// Default constructor
wxDC::wxDC()
{
}
wxDC::~wxDC()
{
}
// This will select current objects out of the DC,
// which is what you have to do before deleting the
// DC.
void wxDC::SelectOldObjects(WXHDC dc)
{
}
// ---------------------------------------------------------------------------
// clipping
// ---------------------------------------------------------------------------
void wxDC::UpdateClipBox()
{
}
void
wxDC::DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const
{
}
// common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion()
void wxDC::SetClippingHrgn(WXHRGN hrgn)
{
}
void wxDC::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
{
}
void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
{
}
void wxDC::DestroyClippingRegion()
{
}
// ---------------------------------------------------------------------------
// query capabilities
// ---------------------------------------------------------------------------
bool wxDC::CanDrawBitmap() const
{
return false;
}
bool wxDC::CanGetTextExtent() const
{
return false;
}
int wxDC::GetDepth() const
{
return 0;
}
// ---------------------------------------------------------------------------
// drawing
// ---------------------------------------------------------------------------
void wxDC::Clear()
{
}
bool wxDC::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style)
{
return false;
}
bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
{
return false;
}
void wxDC::DoCrossHair(wxCoord x, wxCoord y)
{
}
void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{
}
// Draws an arc of a circle, centred on (xc, yc), with starting point (x1, y1)
// and ending at (x2, y2)
void wxDC::DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc)
{
}
void wxDC::DoDrawCheckMark(wxCoord x1, wxCoord y1,
wxCoord width, wxCoord height)
{
}
void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
{
}
void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int fillStyle)
{
}
void
wxDC::DoDrawPolyPolygon(int n,
int count[],
wxPoint points[],
wxCoord xoffset,
wxCoord yoffset,
int fillStyle)
{
}
void wxDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
{
}
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
}
void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
{
}
void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
}
void wxDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea)
{
}
void wxDC::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
{
}
void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
{
}
void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
{
}
void wxDC::DrawAnyText(const wxString& text, wxCoord x, wxCoord y)
{
}
void wxDC::DoDrawRotatedText(const wxString& text,
wxCoord x, wxCoord y,
double angle)
{
}
// ---------------------------------------------------------------------------
// set GDI objects
// ---------------------------------------------------------------------------
#if wxUSE_PALETTE
void wxDC::DoSelectPalette(bool realize)
{
}
void wxDC::SetPalette(const wxPalette& palette)
{
}
void wxDC::InitializePalette()
{
}
#endif // wxUSE_PALETTE
void wxDC::SetFont(const wxFont& font)
{
}
void wxDC::SetPen(const wxPen& pen)
{
}
void wxDC::SetBrush(const wxBrush& brush)
{
}
void wxDC::SetBackground(const wxBrush& brush)
{
}
void wxDC::SetBackgroundMode(int mode)
{
}
void wxDC::SetLogicalFunction(int function)
{
}
void wxDC::SetRop(WXHDC dc)
{
}
bool wxDC::StartDoc(const wxString& WXUNUSED(message))
{
return true;
}
void wxDC::EndDoc()
{
}
void wxDC::StartPage()
{
}
void wxDC::EndPage()
{
}
// ---------------------------------------------------------------------------
// text metrics
// ---------------------------------------------------------------------------
wxCoord wxDC::GetCharHeight() const
{
return 0;
}
wxCoord wxDC::GetCharWidth() const
{
return 0;
}
void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
wxCoord *descent, wxCoord *externalLeading,
wxFont *font) const
{
}
bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
{
return false;
}
void wxDC::SetMapMode(int mode)
{
}
void wxDC::SetUserScale(double x, double y)
{
}
void wxDC::SetAxisOrientation(bool xLeftRight, bool yBottomUp)
{
}
void wxDC::SetSystemScale(double x, double y)
{
}
void wxDC::SetLogicalOrigin(wxCoord x, wxCoord y)
{
}
void wxDC::SetDeviceOrigin(wxCoord x, wxCoord y)
{
}
// ---------------------------------------------------------------------------
// coordinates transformations
// ---------------------------------------------------------------------------
wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
{
return 0;
}
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
{
return 0;
}
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
{
return 0;
}
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
{
return 0;
}
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
{
return 0;
}
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
{
return 0;
}
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
{
return 0;
}
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
{
return 0;
}
// ---------------------------------------------------------------------------
// bit blit
// ---------------------------------------------------------------------------
bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
int rop, bool useMask,
wxCoord xsrcMask, wxCoord ysrcMask)
{
return false;
}
void wxDC::DoGetSize(int *w, int *h) const
{
}
void wxDC::DoGetSizeMM(int *w, int *h) const
{
}
wxSize wxDC::GetPPI() const
{
return wxSize(0, 0);
}
void wxDC::SetLogicalScale(double x, double y)
{
}
// ----------------------------------------------------------------------------
// DC caching
// ----------------------------------------------------------------------------
#if wxUSE_DC_CACHEING
wxList wxDC::sm_bitmapCache;
wxList wxDC::sm_dcCache;
wxDCCacheEntry::wxDCCacheEntry(WXHBITMAP hBitmap, int w, int h, int depth)
{
}
wxDCCacheEntry::wxDCCacheEntry(WXHDC hDC, int depth)
{
}
wxDCCacheEntry::~wxDCCacheEntry()
{
}
wxDCCacheEntry* wxDC::FindBitmapInCache(WXHDC dc, int w, int h)
{
return NULL;
}
wxDCCacheEntry* wxDC::FindDCInCache(wxDCCacheEntry* notThis, WXHDC dc)
{
return NULL;
}
void wxDC::AddToBitmapCache(wxDCCacheEntry* entry)
{
}
void wxDC::AddToDCCache(wxDCCacheEntry* entry)
{
}
void wxDC::ClearCache()
{
}
class wxDCModule : public wxModule
{
public:
virtual bool OnInit() { return true; }
virtual void OnExit() { wxDC::ClearCache(); }
private:
DECLARE_DYNAMIC_CLASS(wxDCModule)
};
IMPLEMENT_DYNAMIC_CLASS(wxDCModule, wxModule)
#endif // wxUSE_DC_CACHEING