]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/palmos/dc.cpp
check that the version of __sync_sub_and_fetch that returns a value is supported...
[wxWidgets.git] / src / palmos / dc.cpp
... / ...
CommitLineData
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
59IMPLEMENT_ABSTRACT_CLASS(wxDC, wxDCBase)
60
61// ---------------------------------------------------------------------------
62// constants
63// ---------------------------------------------------------------------------
64
65static const int VIEWPORT_EXTENT = 1000;
66
67static const int MM_POINTS = 9;
68static 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
89wxDC::wxDC()
90{
91}
92
93wxDC::~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.
100void wxDC::SelectOldObjects(WXHDC dc)
101{
102}
103
104// ---------------------------------------------------------------------------
105// clipping
106// ---------------------------------------------------------------------------
107
108void wxDC::UpdateClipBox()
109{
110}
111
112void
113wxDC::DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const
114{
115}
116
117// common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion()
118void wxDC::SetClippingHrgn(WXHRGN hrgn)
119{
120}
121
122void wxDC::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
123{
124}
125
126void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
127{
128}
129
130void wxDC::DestroyClippingRegion()
131{
132}
133
134// ---------------------------------------------------------------------------
135// query capabilities
136// ---------------------------------------------------------------------------
137
138bool wxDC::CanDrawBitmap() const
139{
140 return false;
141}
142
143bool wxDC::CanGetTextExtent() const
144{
145 return false;
146}
147
148int wxDC::GetDepth() const
149{
150 return 0;
151}
152
153// ---------------------------------------------------------------------------
154// drawing
155// ---------------------------------------------------------------------------
156
157void wxDC::Clear()
158{
159}
160
161bool wxDC::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style)
162{
163 return false;
164}
165
166bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
167{
168 return false;
169}
170
171void wxDC::DoCrossHair(wxCoord x, wxCoord y)
172{
173}
174
175void 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)
181void wxDC::DoDrawArc(wxCoord x1, wxCoord y1,
182 wxCoord x2, wxCoord y2,
183 wxCoord xc, wxCoord yc)
184{
185}
186
187void wxDC::DoDrawCheckMark(wxCoord x1, wxCoord y1,
188 wxCoord width, wxCoord height)
189{
190}
191
192void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
193{
194}
195
196void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int fillStyle)
197{
198}
199
200void
201wxDC::DoDrawPolyPolygon(int n,
202 int count[],
203 wxPoint points[],
204 wxCoord xoffset,
205 wxCoord yoffset,
206 int fillStyle)
207{
208}
209
210void wxDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
211{
212}
213
214void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
215{
216}
217
218void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
219{
220}
221
222void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
223{
224}
225
226void wxDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea)
227{
228}
229
230void wxDC::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
231{
232}
233
234void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
235{
236}
237
238void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
239{
240}
241
242void wxDC::DrawAnyText(const wxString& text, wxCoord x, wxCoord y)
243{
244}
245
246void 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
258void wxDC::DoSelectPalette(bool realize)
259{
260}
261
262void wxDC::SetPalette(const wxPalette& palette)
263{
264}
265
266void wxDC::InitializePalette()
267{
268}
269
270#endif // wxUSE_PALETTE
271
272void wxDC::SetFont(const wxFont& font)
273{
274}
275
276void wxDC::SetPen(const wxPen& pen)
277{
278}
279
280void wxDC::SetBrush(const wxBrush& brush)
281{
282}
283
284void wxDC::SetBackground(const wxBrush& brush)
285{
286}
287
288void wxDC::SetBackgroundMode(int mode)
289{
290}
291
292void wxDC::SetLogicalFunction(int function)
293{
294}
295
296void wxDC::SetRop(WXHDC dc)
297{
298}
299
300bool wxDC::StartDoc(const wxString& WXUNUSED(message))
301{
302 return true;
303}
304
305void wxDC::EndDoc()
306{
307}
308
309void wxDC::StartPage()
310{
311}
312
313void wxDC::EndPage()
314{
315}
316
317// ---------------------------------------------------------------------------
318// text metrics
319// ---------------------------------------------------------------------------
320
321wxCoord wxDC::GetCharHeight() const
322{
323 return 0;
324}
325
326wxCoord wxDC::GetCharWidth() const
327{
328 return 0;
329}
330
331void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
332 wxCoord *descent, wxCoord *externalLeading,
333 const wxFont *font) const
334{
335}
336
337
338bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
339{
340 return false;
341}
342
343
344
345
346void wxDC::SetMapMode(int mode)
347{
348}
349
350void wxDC::SetUserScale(double x, double y)
351{
352}
353
354void wxDC::SetAxisOrientation(bool xLeftRight, bool yBottomUp)
355{
356}
357
358void wxDC::SetSystemScale(double x, double y)
359{
360}
361
362void wxDC::SetLogicalOrigin(wxCoord x, wxCoord y)
363{
364}
365
366void wxDC::SetDeviceOrigin(wxCoord x, wxCoord y)
367{
368}
369
370// ---------------------------------------------------------------------------
371// coordinates transformations
372// ---------------------------------------------------------------------------
373
374wxCoord wxDC::DeviceToLogicalX(wxCoord x) const
375{
376 return 0;
377}
378
379wxCoord wxDC::DeviceToLogicalXRel(wxCoord x) const
380{
381 return 0;
382}
383
384wxCoord wxDC::DeviceToLogicalY(wxCoord y) const
385{
386 return 0;
387}
388
389wxCoord wxDC::DeviceToLogicalYRel(wxCoord y) const
390{
391 return 0;
392}
393
394wxCoord wxDC::LogicalToDeviceX(wxCoord x) const
395{
396 return 0;
397}
398
399wxCoord wxDC::LogicalToDeviceXRel(wxCoord x) const
400{
401 return 0;
402}
403
404wxCoord wxDC::LogicalToDeviceY(wxCoord y) const
405{
406 return 0;
407}
408
409wxCoord wxDC::LogicalToDeviceYRel(wxCoord y) const
410{
411 return 0;
412}
413
414// ---------------------------------------------------------------------------
415// bit blit
416// ---------------------------------------------------------------------------
417
418bool 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
427void wxDC::DoGetSize(int *w, int *h) const
428{
429}
430
431void wxDC::DoGetSizeMM(int *w, int *h) const
432{
433}
434
435wxSize wxDC::GetPPI() const
436{
437 return wxSize(0, 0);
438}
439
440void wxDC::SetLogicalScale(double x, double y)
441{
442}
443
444// ----------------------------------------------------------------------------
445// DC caching
446// ----------------------------------------------------------------------------
447
448#if wxUSE_DC_CACHEING
449
450wxList wxDC::sm_bitmapCache;
451wxList wxDC::sm_dcCache;
452
453wxDCCacheEntry::wxDCCacheEntry(WXHBITMAP hBitmap, int w, int h, int depth)
454{
455}
456
457wxDCCacheEntry::wxDCCacheEntry(WXHDC hDC, int depth)
458{
459}
460
461wxDCCacheEntry::~wxDCCacheEntry()
462{
463}
464
465wxDCCacheEntry* wxDC::FindBitmapInCache(WXHDC dc, int w, int h)
466{
467 return NULL;
468}
469
470wxDCCacheEntry* wxDC::FindDCInCache(wxDCCacheEntry* notThis, WXHDC dc)
471{
472 return NULL;
473}
474
475void wxDC::AddToBitmapCache(wxDCCacheEntry* entry)
476{
477}
478
479void wxDC::AddToDCCache(wxDCCacheEntry* entry)
480{
481}
482
483void wxDC::ClearCache()
484{
485}
486
487class wxDCModule : public wxModule
488{
489public:
490 virtual bool OnInit() { return true; }
491 virtual void OnExit() { wxDC::ClearCache(); }
492
493private:
494 DECLARE_DYNAMIC_CLASS(wxDCModule)
495};
496
497IMPLEMENT_DYNAMIC_CLASS(wxDCModule, wxModule)
498
499#endif // wxUSE_DC_CACHEING