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