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