]>
Commit | Line | Data |
---|---|---|
1e6feb95 VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: univ/themes/gtk.cpp | |
3 | // Purpose: wxUniversal theme implementing GTK-like LNF | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 06.08.00 | |
7 | // RCS-ID: $Id$ | |
442b35b5 | 8 | // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) |
1e6feb95 VZ |
9 | // Licence: wxWindows license |
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/intl.h" | |
29 | #include "wx/log.h" | |
30 | #include "wx/dcmemory.h" | |
31 | #include "wx/window.h" | |
32 | ||
0fe5e8fe VZ |
33 | #include "wx/menu.h" |
34 | ||
e4606ed9 | 35 | #include "wx/bmpbuttn.h" |
1e6feb95 VZ |
36 | #include "wx/button.h" |
37 | #include "wx/checkbox.h" | |
38 | #include "wx/listbox.h" | |
39 | #include "wx/checklst.h" | |
8cb172b4 | 40 | #include "wx/combobox.h" |
1e6feb95 VZ |
41 | #include "wx/scrolbar.h" |
42 | #include "wx/slider.h" | |
43 | #include "wx/textctrl.h" | |
3216dbf5 | 44 | #include "wx/toolbar.h" |
0fe5e8fe VZ |
45 | |
46 | #include "wx/settings.h" | |
1e6feb95 VZ |
47 | #endif // WX_PRECOMP |
48 | ||
49 | #include "wx/notebook.h" | |
50 | #include "wx/spinbutt.h" | |
536b70ac VS |
51 | #include "wx/toplevel.h" |
52 | #include "wx/artprov.h" | |
1e6feb95 VZ |
53 | |
54 | #include "wx/univ/renderer.h" | |
55 | #include "wx/univ/inphand.h" | |
56 | #include "wx/univ/colschem.h" | |
57 | #include "wx/univ/theme.h" | |
58 | ||
0fe5e8fe VZ |
59 | class WXDLLEXPORT wxGTKMenuGeometryInfo; |
60 | ||
1e6feb95 VZ |
61 | // ---------------------------------------------------------------------------- |
62 | // constants (to be removed, for testing only) | |
63 | // ---------------------------------------------------------------------------- | |
64 | ||
e44d6a1f | 65 | static const size_t BORDER_THICKNESS = 1; |
1e6feb95 VZ |
66 | |
67 | // ---------------------------------------------------------------------------- | |
68 | // wxGTKRenderer: draw the GUI elements in GTK style | |
69 | // ---------------------------------------------------------------------------- | |
70 | ||
71 | class wxGTKRenderer : public wxRenderer | |
72 | { | |
73 | public: | |
74 | wxGTKRenderer(const wxColourScheme *scheme); | |
75 | ||
76 | // implement the base class pure virtuals | |
77 | virtual void DrawBackground(wxDC& dc, | |
78 | const wxColour& col, | |
79 | const wxRect& rect, | |
80 | int flags = 0); | |
81 | virtual void DrawLabel(wxDC& dc, | |
82 | const wxString& label, | |
83 | const wxRect& rect, | |
84 | int flags = 0, | |
85 | int alignment = wxALIGN_LEFT | wxALIGN_TOP, | |
86 | int indexAccel = -1, | |
87 | wxRect *rectBounds = NULL); | |
88 | virtual void DrawButtonLabel(wxDC& dc, | |
89 | const wxString& label, | |
90 | const wxBitmap& image, | |
91 | const wxRect& rect, | |
92 | int flags = 0, | |
93 | int alignment = wxALIGN_LEFT | wxALIGN_TOP, | |
94 | int indexAccel = -1, | |
95 | wxRect *rectBounds = NULL); | |
96 | virtual void DrawBorder(wxDC& dc, | |
97 | wxBorder border, | |
98 | const wxRect& rect, | |
99 | int flags = 0, | |
100 | wxRect *rectIn = (wxRect *)NULL); | |
101 | virtual void DrawHorizontalLine(wxDC& dc, | |
102 | wxCoord y, wxCoord x1, wxCoord x2); | |
103 | virtual void DrawVerticalLine(wxDC& dc, | |
104 | wxCoord x, wxCoord y1, wxCoord y2); | |
105 | virtual void DrawFrame(wxDC& dc, | |
106 | const wxString& label, | |
107 | const wxRect& rect, | |
108 | int flags = 0, | |
109 | int alignment = wxALIGN_LEFT, | |
110 | int indexAccel = -1); | |
111 | virtual void DrawTextBorder(wxDC& dc, | |
112 | wxBorder border, | |
113 | const wxRect& rect, | |
114 | int flags = 0, | |
115 | wxRect *rectIn = (wxRect *)NULL); | |
116 | virtual void DrawButtonBorder(wxDC& dc, | |
117 | const wxRect& rect, | |
118 | int flags = 0, | |
119 | wxRect *rectIn = (wxRect *)NULL); | |
120 | virtual void DrawArrow(wxDC& dc, | |
121 | wxDirection dir, | |
122 | const wxRect& rect, | |
123 | int flags = 0); | |
124 | virtual void DrawScrollbarArrow(wxDC& dc, | |
125 | wxDirection dir, | |
126 | const wxRect& rect, | |
127 | int flags = 0); | |
128 | virtual void DrawScrollbarThumb(wxDC& dc, | |
129 | wxOrientation orient, | |
130 | const wxRect& rect, | |
131 | int flags = 0); | |
132 | virtual void DrawScrollbarShaft(wxDC& dc, | |
133 | wxOrientation orient, | |
134 | const wxRect& rect, | |
135 | int flags = 0); | |
136 | virtual void DrawScrollCorner(wxDC& dc, | |
137 | const wxRect& rect); | |
138 | virtual void DrawItem(wxDC& dc, | |
139 | const wxString& label, | |
140 | const wxRect& rect, | |
141 | int flags = 0); | |
142 | virtual void DrawCheckItem(wxDC& dc, | |
143 | const wxString& label, | |
144 | const wxBitmap& bitmap, | |
145 | const wxRect& rect, | |
146 | int flags = 0); | |
147 | virtual void DrawCheckButton(wxDC& dc, | |
148 | const wxString& label, | |
149 | const wxBitmap& bitmap, | |
150 | const wxRect& rect, | |
151 | int flags = 0, | |
152 | wxAlignment align = wxALIGN_LEFT, | |
153 | int indexAccel = -1); | |
154 | ||
155 | virtual void DrawRadioButton(wxDC& dc, | |
156 | const wxString& label, | |
157 | const wxBitmap& bitmap, | |
158 | const wxRect& rect, | |
159 | int flags = 0, | |
160 | wxAlignment align = wxALIGN_LEFT, | |
161 | int indexAccel = -1); | |
162 | ||
3216dbf5 VZ |
163 | virtual void DrawToolBarButton(wxDC& dc, |
164 | const wxString& label, | |
165 | const wxBitmap& bitmap, | |
166 | const wxRect& rect, | |
167 | int flags); | |
168 | ||
1e6feb95 VZ |
169 | virtual void DrawTextLine(wxDC& dc, |
170 | const wxString& text, | |
171 | const wxRect& rect, | |
172 | int selStart = -1, | |
173 | int selEnd = -1, | |
174 | int flags = 0); | |
175 | virtual void DrawLineWrapMark(wxDC& dc, const wxRect& rect); | |
176 | virtual void DrawTab(wxDC& dc, | |
177 | const wxRect& rect, | |
178 | wxDirection dir, | |
179 | const wxString& label, | |
180 | const wxBitmap& bitmap = wxNullBitmap, | |
181 | int flags = 0, | |
182 | int indexAccel = -1); | |
183 | ||
184 | virtual void DrawSliderShaft(wxDC& dc, | |
185 | const wxRect& rect, | |
186 | wxOrientation orient, | |
187 | int flags = 0, | |
188 | wxRect *rectShaft = NULL); | |
189 | virtual void DrawSliderThumb(wxDC& dc, | |
190 | const wxRect& rect, | |
191 | wxOrientation orient, | |
192 | int flags = 0); | |
193 | virtual void DrawSliderTicks(wxDC& dc, | |
194 | const wxRect& rect, | |
195 | const wxSize& sizeThumb, | |
196 | wxOrientation orient, | |
197 | int start, | |
198 | int end, | |
199 | int step, | |
200 | int flags) | |
201 | { | |
202 | // we don't have the ticks in GTK version | |
203 | } | |
204 | ||
205 | virtual void DrawMenuBarItem(wxDC& dc, | |
206 | const wxRect& rect, | |
207 | const wxString& label, | |
208 | int flags = 0, | |
209 | int indexAccel = -1); | |
210 | virtual void DrawMenuItem(wxDC& dc, | |
211 | wxCoord y, | |
212 | const wxMenuGeometryInfo& geometryInfo, | |
213 | const wxString& label, | |
214 | const wxString& accel, | |
215 | const wxBitmap& bitmap = wxNullBitmap, | |
216 | int flags = 0, | |
217 | int indexAccel = -1); | |
218 | virtual void DrawMenuSeparator(wxDC& dc, | |
219 | wxCoord y, | |
220 | const wxMenuGeometryInfo& geomInfo); | |
71e03035 VZ |
221 | |
222 | virtual void DrawStatusField(wxDC& dc, | |
223 | const wxRect& rect, | |
224 | const wxString& label, | |
225 | int flags = 0); | |
24a23c35 VS |
226 | |
227 | virtual void DrawFrameTitleBar(wxDC& dc, | |
228 | const wxRect& rect, | |
229 | const wxString& title, | |
230 | const wxIcon& icon, | |
231 | int flags, | |
813edf09 VS |
232 | int specialButton = 0, |
233 | int specialButtonFlag = 0); | |
24a23c35 VS |
234 | virtual void DrawFrameBorder(wxDC& dc, |
235 | const wxRect& rect, | |
236 | int flags); | |
237 | virtual void DrawFrameBackground(wxDC& dc, | |
238 | const wxRect& rect, | |
239 | int flags); | |
240 | virtual void DrawFrameTitle(wxDC& dc, | |
241 | const wxRect& rect, | |
242 | const wxString& title, | |
243 | int flags); | |
244 | virtual void DrawFrameIcon(wxDC& dc, | |
245 | const wxRect& rect, | |
246 | const wxIcon& icon, | |
247 | int flags); | |
248 | virtual void DrawFrameButton(wxDC& dc, | |
249 | wxCoord x, wxCoord y, | |
250 | int button, | |
251 | int flags = 0); | |
252 | ||
253 | // titlebars | |
254 | virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const; | |
255 | virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const; | |
e7dda1ff | 256 | virtual wxSize GetFrameMinSize(int flags) const; |
24a23c35 | 257 | virtual wxSize GetFrameIconSize() const; |
813edf09 | 258 | virtual int HitTestFrame(const wxRect& rect, const wxPoint& pt, int flags) const; |
63f06c22 | 259 | |
1e6feb95 | 260 | virtual void GetComboBitmaps(wxBitmap *bmpNormal, |
1b488c0e | 261 | wxBitmap *bmpFocus, |
1e6feb95 VZ |
262 | wxBitmap *bmpPressed, |
263 | wxBitmap *bmpDisabled); | |
264 | ||
265 | virtual void AdjustSize(wxSize *size, const wxWindow *window); | |
266 | virtual wxRect GetBorderDimensions(wxBorder border) const; | |
267 | virtual bool AreScrollbarsInsideBorder() const; | |
268 | ||
269 | // geometry and hit testing | |
270 | virtual wxSize GetScrollbarArrowSize() const | |
271 | { return m_sizeScrollbarArrow; } | |
272 | virtual wxRect GetScrollbarRect(const wxScrollBar *scrollbar, | |
273 | wxScrollBar::Element elem, | |
274 | int thumbPos = -1) const; | |
275 | virtual wxCoord GetScrollbarSize(const wxScrollBar *scrollbar); | |
276 | virtual wxHitTest HitTestScrollbar(const wxScrollBar *scrollbar, | |
277 | const wxPoint& pt) const; | |
278 | virtual wxCoord ScrollbarToPixel(const wxScrollBar *scrollbar, | |
279 | int thumbPos = -1); | |
280 | virtual int PixelToScrollbar(const wxScrollBar *scrollbar, wxCoord coord); | |
281 | virtual wxCoord GetListboxItemHeight(wxCoord fontHeight) | |
282 | { return fontHeight + 2; } | |
283 | virtual wxSize GetCheckBitmapSize() const | |
284 | { return wxSize(10, 10); } | |
285 | virtual wxSize GetRadioBitmapSize() const | |
286 | { return wxSize(11, 11); } | |
287 | virtual wxCoord GetCheckItemMargin() const | |
288 | { return 2; } | |
289 | ||
3216dbf5 VZ |
290 | virtual wxSize GetToolBarButtonSize(wxCoord *separator) const |
291 | { if ( separator ) *separator = 5; return wxSize(16, 15); } | |
292 | virtual wxSize GetToolBarMargin() const | |
293 | { return wxSize(6, 6); } | |
294 | ||
1e6feb95 | 295 | virtual wxRect GetTextTotalArea(const wxTextCtrl *text, |
3216dbf5 | 296 | const wxRect& rect) const; |
1e6feb95 VZ |
297 | virtual wxRect GetTextClientArea(const wxTextCtrl *text, |
298 | const wxRect& rect, | |
3216dbf5 | 299 | wxCoord *extraSpaceBeyond) const; |
1e6feb95 VZ |
300 | |
301 | virtual wxSize GetTabIndent() const { return wxSize(2, 2); } | |
302 | virtual wxSize GetTabPadding() const { return wxSize(6, 6); } | |
303 | ||
304 | virtual wxCoord GetSliderDim() const { return 15; } | |
305 | virtual wxCoord GetSliderTickLen() const { return 0; } | |
306 | virtual wxRect GetSliderShaftRect(const wxRect& rect, | |
307 | wxOrientation orient) const; | |
308 | virtual wxSize GetSliderThumbSize(const wxRect& rect, | |
309 | wxOrientation orient) const; | |
310 | virtual wxSize GetProgressBarStep() const { return wxSize(16, 32); } | |
311 | ||
312 | virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const; | |
313 | virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win, | |
314 | const wxMenu& menu) const; | |
71e03035 VZ |
315 | |
316 | virtual wxSize GetStatusBarBorders(wxCoord *borderBetweenFields) const; | |
317 | ||
1e6feb95 VZ |
318 | // helpers for "wxBitmap wxColourScheme::Get()" |
319 | void DrawCheckBitmap(wxDC& dc, const wxRect& rect); | |
320 | void DrawUncheckBitmap(wxDC& dc, const wxRect& rect, bool isPressed); | |
321 | ||
322 | protected: | |
323 | // DrawBackground() helpers | |
324 | ||
325 | // get the colour to use for background | |
326 | wxColour GetBackgroundColour(int flags) const | |
327 | { | |
328 | if ( flags & wxCONTROL_PRESSED ) | |
329 | return wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED); | |
330 | else if ( flags & wxCONTROL_CURRENT ) | |
331 | return wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT); | |
332 | else | |
333 | return wxSCHEME_COLOUR(m_scheme, CONTROL); | |
334 | } | |
335 | ||
336 | // draw the background with any colour, not only the default one(s) | |
337 | void DoDrawBackground(wxDC& dc, | |
338 | const wxColour& col, | |
339 | const wxRect& rect); | |
340 | ||
341 | // DrawBorder() helpers: all of them shift and clip the DC after drawing | |
342 | // the border | |
343 | ||
344 | // just draw a rectangle with the given pen | |
345 | void DrawRect(wxDC& dc, wxRect *rect, const wxPen& pen); | |
346 | ||
347 | // draw the lower left part of rectangle | |
348 | void DrawHalfRect(wxDC& dc, wxRect *rect, const wxPen& pen); | |
349 | ||
350 | // draw the rectange using the first brush for the left and top sides and | |
351 | // the second one for the bottom and right ones | |
352 | void DrawShadedRect(wxDC& dc, wxRect *rect, | |
353 | const wxPen& pen1, const wxPen& pen2); | |
354 | ||
355 | // as DrawShadedRect() but the pixels in the bottom left and upper right | |
356 | // border are drawn with the pen1, not pen2 | |
357 | void DrawAntiShadedRect(wxDC& dc, wxRect *rect, | |
358 | const wxPen& pen1, const wxPen& pen2); | |
359 | ||
360 | // used for drawing opened rectangles - draws only one side of it at once | |
361 | // (and doesn't adjust the rect) | |
362 | void DrawAntiShadedRectSide(wxDC& dc, | |
363 | const wxRect& rect, | |
364 | const wxPen& pen1, | |
365 | const wxPen& pen2, | |
366 | wxDirection dir); | |
367 | ||
368 | // draw an opened rect for the arrow in given direction | |
369 | void DrawArrowBorder(wxDC& dc, | |
370 | wxRect *rect, | |
371 | wxDirection dir); | |
372 | ||
373 | // draw two sides of the rectangle | |
374 | void DrawThumbBorder(wxDC& dc, | |
375 | wxRect *rect, | |
376 | wxOrientation orient); | |
377 | ||
378 | // draw the normal 3D border | |
379 | void DrawRaisedBorder(wxDC& dc, wxRect *rect); | |
380 | ||
381 | // just as DrawRaisedBorder() except that the bottom left and up right | |
382 | // pixels of the interior rect are drawn in another colour (i.e. the inner | |
383 | // rect is drawn with DrawAntiShadedRect() and not DrawShadedRect()) | |
384 | void DrawAntiRaisedBorder(wxDC& dc, wxRect *rect); | |
385 | ||
386 | // returns the size of the arrow for the scrollbar (depends on | |
387 | // orientation) | |
388 | wxSize GetScrollbarArrowSize(const wxScrollBar *scrollbar) const | |
389 | { | |
390 | wxSize size; | |
391 | if ( scrollbar->IsVertical() ) | |
392 | { | |
393 | size = m_sizeScrollbarArrow; | |
394 | } | |
395 | else | |
396 | { | |
397 | size.x = m_sizeScrollbarArrow.y; | |
398 | size.y = m_sizeScrollbarArrow.x; | |
399 | } | |
400 | ||
401 | return size; | |
402 | } | |
403 | ||
404 | // get the line wrap indicator bitmap | |
3216dbf5 | 405 | wxBitmap GetLineWrapBitmap() const; |
1e6feb95 VZ |
406 | |
407 | // DrawCheckBitmap and DrawRadioBitmap helpers | |
408 | ||
409 | // draw the check bitmaps once and cache them for later use | |
410 | wxBitmap GetCheckBitmap(int flags); | |
411 | ||
412 | // draw a /\ or \/ line from (x1, y1) to (x2, y1) passing by the point | |
413 | // ((x1 + x2)/2, y2) | |
414 | void DrawUpZag(wxDC& dc, | |
415 | wxCoord x1, wxCoord x2, | |
416 | wxCoord y1, wxCoord y2); | |
417 | void DrawDownZag(wxDC& dc, | |
418 | wxCoord x1, wxCoord x2, | |
419 | wxCoord y1, wxCoord y2); | |
420 | ||
421 | // draw the radio button bitmap for the given state | |
422 | void DrawRadioBitmap(wxDC& dc, const wxRect& rect, int flags); | |
423 | ||
424 | // draw check/radio - the bitmap must be a valid one by now | |
425 | void DoDrawCheckOrRadioBitmap(wxDC& dc, | |
426 | const wxString& label, | |
427 | const wxBitmap& bitmap, | |
428 | const wxRect& rectTotal, | |
429 | int flags, | |
430 | wxAlignment align, | |
431 | int indexAccel); | |
432 | ||
0fe5e8fe VZ |
433 | // common part of DrawMenuItem() and DrawMenuBarItem() |
434 | void DoDrawMenuItem(wxDC& dc, | |
435 | const wxRect& rect, | |
436 | const wxString& label, | |
437 | int flags, | |
438 | int indexAccel, | |
439 | const wxString& accel = _T(""), | |
440 | const wxBitmap& bitmap = wxNullBitmap, | |
441 | const wxGTKMenuGeometryInfo *geometryInfo = NULL); | |
442 | ||
1b488c0e VZ |
443 | // initialize the combo bitmaps |
444 | void InitComboBitmaps(); | |
445 | ||
1e6feb95 VZ |
446 | private: |
447 | const wxColourScheme *m_scheme; | |
448 | ||
449 | // data | |
450 | wxSize m_sizeScrollbarArrow; | |
451 | ||
452 | // GDI objects | |
453 | wxPen m_penBlack, | |
454 | m_penDarkGrey, | |
455 | m_penGrey, | |
456 | m_penLightGrey, | |
457 | m_penHighlight; | |
458 | ||
459 | // the checkbox bitmaps: first row is for the normal, second for the | |
460 | // pressed state and the columns are for checked and unchecked status | |
461 | // respectively | |
462 | wxBitmap m_bitmapsCheckbox[2][2]; | |
463 | ||
464 | // the line wrap bitmap (drawn at the end of wrapped lines) | |
465 | wxBitmap m_bmpLineWrap; | |
1b488c0e VZ |
466 | |
467 | // the combobox bitmaps | |
468 | enum | |
469 | { | |
470 | ComboState_Normal, | |
471 | ComboState_Focus, | |
472 | ComboState_Pressed, | |
473 | ComboState_Disabled, | |
474 | ComboState_Max | |
475 | }; | |
476 | ||
477 | wxBitmap m_bitmapsCombo[ComboState_Max]; | |
1e6feb95 VZ |
478 | }; |
479 | ||
480 | // ---------------------------------------------------------------------------- | |
481 | // wxGTKInputHandler and derived classes: process the keyboard and mouse | |
482 | // messages according to GTK standards | |
483 | // ---------------------------------------------------------------------------- | |
484 | ||
485 | class wxGTKInputHandler : public wxInputHandler | |
486 | { | |
487 | public: | |
488 | wxGTKInputHandler(wxGTKRenderer *renderer); | |
489 | ||
67e49a98 | 490 | virtual bool HandleKey(wxInputConsumer *control, |
1e6feb95 VZ |
491 | const wxKeyEvent& event, |
492 | bool pressed); | |
67e49a98 | 493 | virtual bool HandleMouse(wxInputConsumer *control, |
1e6feb95 | 494 | const wxMouseEvent& event); |
67e49a98 | 495 | virtual bool HandleMouseMove(wxInputConsumer *control, const wxMouseEvent& event); |
1e6feb95 VZ |
496 | |
497 | protected: | |
498 | wxGTKRenderer *m_renderer; | |
499 | }; | |
500 | ||
501 | class wxGTKScrollBarInputHandler : public wxStdScrollBarInputHandler | |
502 | { | |
503 | public: | |
504 | wxGTKScrollBarInputHandler(wxRenderer *renderer, wxInputHandler *handler) | |
505 | : wxStdScrollBarInputHandler(renderer, handler) { } | |
506 | ||
507 | protected: | |
508 | virtual void Highlight(wxScrollBar *scrollbar, bool doIt) | |
509 | { | |
510 | // only arrows and the thumb can be highlighted | |
511 | if ( !IsArrow() && m_htLast != wxHT_SCROLLBAR_THUMB ) | |
512 | return; | |
513 | ||
514 | wxStdScrollBarInputHandler::Highlight(scrollbar, doIt); | |
515 | } | |
516 | ||
517 | virtual void Press(wxScrollBar *scrollbar, bool doIt) | |
518 | { | |
519 | // only arrows can be pressed | |
520 | if ( !IsArrow() ) | |
521 | return; | |
522 | ||
523 | wxStdScrollBarInputHandler::Press(scrollbar, doIt); | |
524 | } | |
525 | ||
526 | virtual bool IsAllowedButton(int WXUNUSED(button)) { return TRUE; } | |
527 | ||
528 | bool IsArrow() const | |
529 | { | |
530 | return m_htLast == wxHT_SCROLLBAR_ARROW_LINE_1 || | |
531 | m_htLast == wxHT_SCROLLBAR_ARROW_LINE_2; | |
532 | } | |
533 | }; | |
534 | ||
535 | class wxGTKCheckboxInputHandler : public wxStdCheckboxInputHandler | |
536 | { | |
537 | public: | |
538 | wxGTKCheckboxInputHandler(wxInputHandler *handler) | |
539 | : wxStdCheckboxInputHandler(handler) { } | |
540 | ||
67e49a98 | 541 | virtual bool HandleKey(wxInputConsumer *control, |
1e6feb95 VZ |
542 | const wxKeyEvent& event, |
543 | bool pressed); | |
544 | }; | |
545 | ||
546 | class wxGTKTextCtrlInputHandler : public wxStdTextCtrlInputHandler | |
547 | { | |
548 | public: | |
549 | wxGTKTextCtrlInputHandler(wxInputHandler *handler) | |
550 | : wxStdTextCtrlInputHandler(handler) { } | |
551 | ||
67e49a98 | 552 | virtual bool HandleKey(wxInputConsumer *control, |
1e6feb95 VZ |
553 | const wxKeyEvent& event, |
554 | bool pressed); | |
555 | }; | |
556 | ||
557 | // ---------------------------------------------------------------------------- | |
558 | // wxGTKColourScheme: uses the standard GTK colours | |
559 | // ---------------------------------------------------------------------------- | |
560 | ||
561 | class wxGTKColourScheme : public wxColourScheme | |
562 | { | |
563 | public: | |
564 | virtual wxColour Get(StdColour col) const; | |
565 | virtual wxColour GetBackground(wxWindow *win) const; | |
566 | }; | |
567 | ||
536b70ac VS |
568 | // ---------------------------------------------------------------------------- |
569 | // wxGTKArtProvider | |
570 | // ---------------------------------------------------------------------------- | |
571 | ||
572 | class wxGTKArtProvider : public wxArtProvider | |
573 | { | |
574 | protected: | |
575 | virtual wxBitmap CreateBitmap(const wxArtID& id, | |
576 | const wxArtClient& client, | |
577 | const wxSize& size); | |
578 | }; | |
579 | ||
1e6feb95 VZ |
580 | // ---------------------------------------------------------------------------- |
581 | // wxGTKTheme | |
582 | // ---------------------------------------------------------------------------- | |
583 | ||
584 | WX_DEFINE_ARRAY(wxInputHandler *, wxArrayHandlers); | |
585 | ||
586 | class wxGTKTheme : public wxTheme | |
587 | { | |
588 | public: | |
589 | wxGTKTheme(); | |
590 | virtual ~wxGTKTheme(); | |
591 | ||
240889a1 | 592 | virtual wxRenderer *GetRenderer(); |
536b70ac | 593 | virtual wxArtProvider *GetArtProvider(); |
1e6feb95 | 594 | virtual wxInputHandler *GetInputHandler(const wxString& control); |
240889a1 | 595 | virtual wxColourScheme *GetColourScheme(); |
1e6feb95 VZ |
596 | |
597 | private: | |
598 | // get the default input handler | |
599 | wxInputHandler *GetDefaultInputHandler(); | |
600 | ||
601 | wxGTKRenderer *m_renderer; | |
536b70ac VS |
602 | |
603 | wxGTKArtProvider *m_artProvider; | |
1e6feb95 VZ |
604 | |
605 | // the names of the already created handlers and the handlers themselves | |
606 | // (these arrays are synchronized) | |
607 | wxSortedArrayString m_handlerNames; | |
608 | wxArrayHandlers m_handlers; | |
609 | ||
610 | wxGTKInputHandler *m_handlerDefault; | |
611 | ||
612 | wxGTKColourScheme *m_scheme; | |
613 | ||
614 | WX_DECLARE_THEME(gtk) | |
615 | }; | |
616 | ||
617 | // ============================================================================ | |
618 | // implementation | |
619 | // ============================================================================ | |
620 | ||
621 | WX_IMPLEMENT_THEME(wxGTKTheme, gtk, wxTRANSLATE("GTK+ theme")); | |
622 | ||
623 | // ---------------------------------------------------------------------------- | |
624 | // wxGTKTheme | |
625 | // ---------------------------------------------------------------------------- | |
626 | ||
627 | wxGTKTheme::wxGTKTheme() | |
628 | { | |
240889a1 VS |
629 | m_scheme = NULL; |
630 | m_renderer = NULL; | |
1e6feb95 VZ |
631 | m_handlerDefault = NULL; |
632 | } | |
633 | ||
634 | wxGTKTheme::~wxGTKTheme() | |
635 | { | |
636 | size_t count = m_handlers.GetCount(); | |
637 | for ( size_t n = 0; n < count; n++ ) | |
638 | { | |
639 | if ( m_handlers[n] != m_handlerDefault ) | |
640 | delete m_handlers[n]; | |
641 | } | |
642 | ||
643 | delete m_handlerDefault; | |
644 | delete m_renderer; | |
645 | delete m_scheme; | |
646 | } | |
647 | ||
240889a1 VS |
648 | wxRenderer *wxGTKTheme::GetRenderer() |
649 | { | |
650 | if ( !m_renderer ) | |
651 | { | |
652 | m_renderer = new wxGTKRenderer(GetColourScheme()); | |
653 | } | |
654 | ||
655 | return m_renderer; | |
656 | } | |
657 | ||
536b70ac VS |
658 | wxArtProvider *wxGTKTheme::GetArtProvider() |
659 | { | |
660 | if ( !m_artProvider ) | |
661 | { | |
662 | m_artProvider = new wxGTKArtProvider; | |
663 | } | |
664 | ||
665 | return m_artProvider; | |
666 | } | |
667 | ||
240889a1 VS |
668 | wxColourScheme *wxGTKTheme::GetColourScheme() |
669 | { | |
670 | if ( !m_scheme ) | |
671 | { | |
672 | m_scheme = new wxGTKColourScheme; | |
673 | } | |
674 | return m_scheme; | |
675 | } | |
676 | ||
1e6feb95 VZ |
677 | wxInputHandler *wxGTKTheme::GetDefaultInputHandler() |
678 | { | |
679 | if ( !m_handlerDefault ) | |
680 | { | |
681 | m_handlerDefault = new wxGTKInputHandler(m_renderer); | |
682 | } | |
683 | ||
684 | return m_handlerDefault; | |
685 | } | |
686 | ||
687 | wxInputHandler *wxGTKTheme::GetInputHandler(const wxString& control) | |
688 | { | |
689 | wxInputHandler *handler; | |
690 | int n = m_handlerNames.Index(control); | |
691 | if ( n == wxNOT_FOUND ) | |
692 | { | |
693 | // create a new handler | |
694 | if ( control == wxINP_HANDLER_SCROLLBAR ) | |
695 | handler = new wxGTKScrollBarInputHandler(m_renderer, | |
696 | GetDefaultInputHandler()); | |
697 | #if wxUSE_BUTTON | |
698 | else if ( control == wxINP_HANDLER_BUTTON ) | |
699 | handler = new wxStdButtonInputHandler(GetDefaultInputHandler()); | |
700 | #endif // wxUSE_CHECKBOX | |
701 | #if wxUSE_CHECKBOX | |
702 | else if ( control == wxINP_HANDLER_CHECKBOX ) | |
703 | handler = new wxGTKCheckboxInputHandler(GetDefaultInputHandler()); | |
704 | #endif // wxUSE_CHECKBOX | |
705 | #if wxUSE_COMBOBOX | |
706 | else if ( control == wxINP_HANDLER_COMBOBOX ) | |
707 | handler = new wxStdComboBoxInputHandler(GetDefaultInputHandler()); | |
708 | #endif // wxUSE_COMBOBOX | |
709 | #if wxUSE_LISTBOX | |
710 | else if ( control == wxINP_HANDLER_LISTBOX ) | |
711 | handler = new wxStdListboxInputHandler(GetDefaultInputHandler()); | |
712 | #endif // wxUSE_LISTBOX | |
713 | #if wxUSE_CHECKLISTBOX | |
714 | else if ( control == wxINP_HANDLER_CHECKLISTBOX ) | |
715 | handler = new wxStdCheckListboxInputHandler(GetDefaultInputHandler()); | |
716 | #endif // wxUSE_CHECKLISTBOX | |
717 | #if wxUSE_TEXTCTRL | |
718 | else if ( control == wxINP_HANDLER_TEXTCTRL ) | |
719 | handler = new wxGTKTextCtrlInputHandler(GetDefaultInputHandler()); | |
720 | #endif // wxUSE_TEXTCTRL | |
721 | #if wxUSE_SLIDER | |
722 | else if ( control == wxINP_HANDLER_SLIDER ) | |
723 | handler = new wxStdSliderButtonInputHandler(GetDefaultInputHandler()); | |
724 | #endif // wxUSE_SLIDER | |
725 | #if wxUSE_SPINBTN | |
726 | else if ( control == wxINP_HANDLER_SPINBTN ) | |
727 | handler = new wxStdSpinButtonInputHandler(GetDefaultInputHandler()); | |
728 | #endif // wxUSE_SPINBTN | |
729 | #if wxUSE_NOTEBOOK | |
730 | else if ( control == wxINP_HANDLER_NOTEBOOK ) | |
731 | handler = new wxStdNotebookInputHandler(GetDefaultInputHandler()); | |
732 | #endif // wxUSE_NOTEBOOK | |
3216dbf5 VZ |
733 | #if wxUSE_TOOLBAR |
734 | else if ( control == wxINP_HANDLER_TOOLBAR ) | |
735 | handler = new wxStdToolbarInputHandler(GetDefaultInputHandler()); | |
736 | #endif // wxUSE_TOOLBAR | |
813edf09 VS |
737 | else if ( control == wxINP_HANDLER_TOPLEVEL ) |
738 | handler = new wxStdFrameInputHandler(GetDefaultInputHandler()); | |
1e6feb95 VZ |
739 | else |
740 | handler = GetDefaultInputHandler(); | |
741 | ||
742 | n = m_handlerNames.Add(control); | |
743 | m_handlers.Insert(handler, n); | |
744 | } | |
745 | else // we already have it | |
746 | { | |
747 | handler = m_handlers[n]; | |
748 | } | |
749 | ||
750 | return handler; | |
751 | } | |
752 | ||
753 | // ============================================================================ | |
754 | // wxGTKColourScheme | |
755 | // ============================================================================ | |
756 | ||
757 | wxColour wxGTKColourScheme::GetBackground(wxWindow *win) const | |
758 | { | |
759 | wxColour col; | |
760 | if ( win->UseBgCol() ) | |
761 | { | |
762 | // use the user specified colour | |
763 | col = win->GetBackgroundColour(); | |
764 | } | |
765 | ||
766 | if ( win->IsContainerWindow() ) | |
767 | { | |
768 | // doesn't depend on the state | |
769 | if ( !col.Ok() ) | |
770 | { | |
771 | col = Get(WINDOW); | |
772 | } | |
773 | } | |
774 | else | |
775 | { | |
776 | int flags = win->GetStateFlags(); | |
777 | ||
778 | // the colour set by the user should be used for the normal state | |
779 | // and for the states for which we don't have any specific colours | |
780 | if ( !col.Ok() || (flags != 0) ) | |
781 | { | |
782 | if ( wxDynamicCast(win, wxScrollBar) ) | |
783 | col = Get(SCROLLBAR); | |
784 | else if ( (flags & wxCONTROL_CURRENT) && win->CanBeHighlighted() ) | |
785 | col = Get(CONTROL_CURRENT); | |
786 | else if ( flags & wxCONTROL_PRESSED ) | |
787 | col = Get(CONTROL_PRESSED); | |
788 | else | |
789 | col = Get(CONTROL); | |
790 | } | |
791 | } | |
792 | ||
793 | return col; | |
794 | } | |
795 | ||
796 | wxColour wxGTKColourScheme::Get(wxGTKColourScheme::StdColour col) const | |
797 | { | |
798 | switch ( col ) | |
799 | { | |
800 | case WINDOW: return *wxWHITE; | |
801 | ||
802 | case SHADOW_DARK: return *wxBLACK; | |
803 | case SHADOW_HIGHLIGHT: return *wxWHITE; | |
804 | case SHADOW_IN: return wxColour(0xd6d6d6); | |
805 | case SHADOW_OUT: return wxColour(0x969696); | |
806 | ||
807 | case CONTROL: return wxColour(0xd6d6d6); | |
808 | case CONTROL_PRESSED: return wxColour(0xc3c3c3); | |
809 | case CONTROL_CURRENT: return wxColour(0xeaeaea); | |
810 | ||
811 | case CONTROL_TEXT: return *wxBLACK; | |
812 | case CONTROL_TEXT_DISABLED: | |
813 | return wxColour(0x757575); | |
814 | case CONTROL_TEXT_DISABLED_SHADOW: | |
815 | return *wxWHITE; | |
816 | ||
817 | case SCROLLBAR: | |
818 | case SCROLLBAR_PRESSED: return wxColour(0xc3c3c3); | |
819 | ||
820 | case HIGHLIGHT: return wxColour(0x9c0000); | |
821 | case HIGHLIGHT_TEXT: return wxColour(0xffffff); | |
822 | ||
a407ff6a VZ |
823 | case GAUGE: return Get(CONTROL_CURRENT); |
824 | ||
1e6feb95 VZ |
825 | case MAX: |
826 | default: | |
827 | wxFAIL_MSG(_T("invalid standard colour")); | |
828 | return *wxBLACK; | |
829 | } | |
830 | } | |
831 | ||
832 | // ============================================================================ | |
833 | // wxGTKRenderer | |
834 | // ============================================================================ | |
835 | ||
836 | // ---------------------------------------------------------------------------- | |
837 | // construction | |
838 | // ---------------------------------------------------------------------------- | |
839 | ||
840 | wxGTKRenderer::wxGTKRenderer(const wxColourScheme *scheme) | |
841 | { | |
842 | // init data | |
843 | m_scheme = scheme; | |
844 | m_sizeScrollbarArrow = wxSize(15, 14); | |
845 | ||
846 | // init pens | |
847 | m_penBlack = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_DARK), 0, wxSOLID); | |
848 | m_penDarkGrey = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_OUT), 0, wxSOLID); | |
849 | m_penGrey = wxPen(wxSCHEME_COLOUR(scheme, SCROLLBAR), 0, wxSOLID); | |
850 | m_penLightGrey = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_IN), 0, wxSOLID); | |
851 | m_penHighlight = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_HIGHLIGHT), 0, wxSOLID); | |
852 | } | |
853 | ||
854 | // ---------------------------------------------------------------------------- | |
855 | // border stuff | |
856 | // ---------------------------------------------------------------------------- | |
857 | ||
858 | void wxGTKRenderer::DrawRect(wxDC& dc, wxRect *rect, const wxPen& pen) | |
859 | { | |
860 | // draw | |
861 | dc.SetPen(pen); | |
862 | dc.SetBrush(*wxTRANSPARENT_BRUSH); | |
863 | dc.DrawRectangle(*rect); | |
864 | ||
865 | // adjust the rect | |
866 | rect->Inflate(-1); | |
867 | } | |
868 | ||
869 | void wxGTKRenderer::DrawHalfRect(wxDC& dc, wxRect *rect, const wxPen& pen) | |
870 | { | |
871 | // draw the bottom and right sides | |
872 | dc.SetPen(pen); | |
873 | dc.DrawLine(rect->GetLeft(), rect->GetBottom(), | |
874 | rect->GetRight() + 1, rect->GetBottom()); | |
875 | dc.DrawLine(rect->GetRight(), rect->GetTop(), | |
876 | rect->GetRight(), rect->GetBottom()); | |
877 | ||
878 | // adjust the rect | |
879 | rect->width--; | |
880 | rect->height--; | |
881 | } | |
882 | ||
883 | void wxGTKRenderer::DrawShadedRect(wxDC& dc, wxRect *rect, | |
884 | const wxPen& pen1, const wxPen& pen2) | |
885 | { | |
886 | // draw the rectangle | |
887 | dc.SetPen(pen1); | |
888 | dc.DrawLine(rect->GetLeft(), rect->GetTop(), | |
889 | rect->GetLeft(), rect->GetBottom()); | |
890 | dc.DrawLine(rect->GetLeft() + 1, rect->GetTop(), | |
891 | rect->GetRight(), rect->GetTop()); | |
892 | dc.SetPen(pen2); | |
893 | dc.DrawLine(rect->GetRight(), rect->GetTop(), | |
894 | rect->GetRight(), rect->GetBottom()); | |
895 | dc.DrawLine(rect->GetLeft(), rect->GetBottom(), | |
896 | rect->GetRight() + 1, rect->GetBottom()); | |
897 | ||
898 | // adjust the rect | |
899 | rect->Inflate(-1); | |
900 | } | |
901 | ||
902 | void wxGTKRenderer::DrawAntiShadedRectSide(wxDC& dc, | |
903 | const wxRect& rect, | |
904 | const wxPen& pen1, | |
905 | const wxPen& pen2, | |
906 | wxDirection dir) | |
907 | { | |
908 | dc.SetPen(dir == wxLEFT || dir == wxUP ? pen1 : pen2); | |
909 | ||
910 | switch ( dir ) | |
911 | { | |
912 | case wxLEFT: | |
913 | dc.DrawLine(rect.GetLeft(), rect.GetTop(), | |
914 | rect.GetLeft(), rect.GetBottom() + 1); | |
915 | break; | |
916 | ||
917 | case wxUP: | |
918 | dc.DrawLine(rect.GetLeft(), rect.GetTop(), | |
919 | rect.GetRight() + 1, rect.GetTop()); | |
920 | break; | |
921 | ||
922 | case wxRIGHT: | |
923 | dc.DrawLine(rect.GetRight(), rect.GetTop(), | |
924 | rect.GetRight(), rect.GetBottom() + 1); | |
925 | break; | |
926 | ||
927 | case wxDOWN: | |
928 | dc.DrawLine(rect.GetLeft(), rect.GetBottom(), | |
929 | rect.GetRight() + 1, rect.GetBottom()); | |
930 | break; | |
931 | ||
932 | default: | |
933 | wxFAIL_MSG(_T("unknown rectangle side")); | |
934 | } | |
935 | } | |
936 | ||
937 | void wxGTKRenderer::DrawAntiShadedRect(wxDC& dc, wxRect *rect, | |
938 | const wxPen& pen1, const wxPen& pen2) | |
939 | { | |
940 | // draw the rectangle | |
941 | dc.SetPen(pen1); | |
942 | dc.DrawLine(rect->GetLeft(), rect->GetTop(), | |
943 | rect->GetLeft(), rect->GetBottom() + 1); | |
944 | dc.DrawLine(rect->GetLeft() + 1, rect->GetTop(), | |
945 | rect->GetRight() + 1, rect->GetTop()); | |
946 | dc.SetPen(pen2); | |
947 | dc.DrawLine(rect->GetRight(), rect->GetTop() + 1, | |
948 | rect->GetRight(), rect->GetBottom()); | |
949 | dc.DrawLine(rect->GetLeft() + 1, rect->GetBottom(), | |
950 | rect->GetRight() + 1, rect->GetBottom()); | |
951 | ||
952 | // adjust the rect | |
953 | rect->Inflate(-1); | |
954 | } | |
955 | ||
956 | void wxGTKRenderer::DrawRaisedBorder(wxDC& dc, wxRect *rect) | |
957 | { | |
958 | DrawShadedRect(dc, rect, m_penHighlight, m_penBlack); | |
959 | DrawShadedRect(dc, rect, m_penLightGrey, m_penDarkGrey); | |
960 | } | |
961 | ||
962 | void wxGTKRenderer::DrawAntiRaisedBorder(wxDC& dc, wxRect *rect) | |
963 | { | |
964 | DrawShadedRect(dc, rect, m_penHighlight, m_penBlack); | |
965 | DrawAntiShadedRect(dc, rect, m_penLightGrey, m_penDarkGrey); | |
966 | } | |
967 | ||
968 | void wxGTKRenderer::DrawBorder(wxDC& dc, | |
969 | wxBorder border, | |
970 | const wxRect& rectTotal, | |
971 | int flags, | |
972 | wxRect *rectIn) | |
973 | { | |
974 | size_t width; | |
975 | ||
976 | wxRect rect = rectTotal; | |
977 | ||
978 | switch ( border ) | |
979 | { | |
980 | case wxBORDER_SUNKEN: | |
89e7a223 | 981 | for ( width = 0; width < BORDER_THICKNESS; width++ ) |
1e6feb95 VZ |
982 | { |
983 | DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); | |
984 | DrawShadedRect(dc, &rect, m_penBlack, m_penLightGrey); | |
985 | } | |
986 | break; | |
987 | ||
988 | case wxBORDER_STATIC: | |
89e7a223 | 989 | for ( width = 0; width < BORDER_THICKNESS; width++ ) |
e4606ed9 VZ |
990 | { |
991 | DrawShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); | |
992 | } | |
1e6feb95 VZ |
993 | break; |
994 | ||
995 | case wxBORDER_RAISED: | |
89e7a223 | 996 | for ( width = 0; width < BORDER_THICKNESS; width++ ) |
1e6feb95 VZ |
997 | { |
998 | DrawRaisedBorder(dc, &rect); | |
999 | } | |
1000 | break; | |
1001 | ||
1002 | case wxBORDER_DOUBLE: | |
89e7a223 | 1003 | for ( width = 0; width < BORDER_THICKNESS; width++ ) |
e4606ed9 VZ |
1004 | { |
1005 | DrawShadedRect(dc, &rect, m_penLightGrey, m_penBlack); | |
1006 | DrawShadedRect(dc, &rect, m_penHighlight, m_penDarkGrey); | |
1007 | DrawRect(dc, &rect, m_penLightGrey); | |
1008 | } | |
1e6feb95 VZ |
1009 | break; |
1010 | ||
1011 | case wxBORDER_SIMPLE: | |
e4606ed9 VZ |
1012 | for ( width = 0; width < BORDER_THICKNESS; width++ ) |
1013 | { | |
1014 | DrawRect(dc, &rect, m_penBlack); | |
1015 | } | |
1e6feb95 VZ |
1016 | break; |
1017 | ||
1018 | default: | |
1019 | wxFAIL_MSG(_T("unknown border type")); | |
1020 | // fall through | |
1021 | ||
1022 | case wxBORDER_DEFAULT: | |
1023 | case wxBORDER_NONE: | |
1024 | break; | |
1025 | } | |
1026 | ||
1027 | if ( rectIn ) | |
1028 | *rectIn = rect; | |
1029 | } | |
1030 | ||
1031 | wxRect wxGTKRenderer::GetBorderDimensions(wxBorder border) const | |
1032 | { | |
1033 | wxCoord width; | |
1034 | switch ( border ) | |
1035 | { | |
1036 | case wxBORDER_RAISED: | |
1037 | case wxBORDER_SUNKEN: | |
1038 | width = 2*BORDER_THICKNESS; | |
1039 | break; | |
1040 | ||
1041 | case wxBORDER_SIMPLE: | |
1042 | case wxBORDER_STATIC: | |
e4606ed9 | 1043 | width = BORDER_THICKNESS; |
1e6feb95 VZ |
1044 | break; |
1045 | ||
1046 | case wxBORDER_DOUBLE: | |
e4606ed9 | 1047 | width = 3*BORDER_THICKNESS; |
1e6feb95 VZ |
1048 | break; |
1049 | ||
1050 | default: | |
1051 | wxFAIL_MSG(_T("unknown border type")); | |
1052 | // fall through | |
1053 | ||
1054 | case wxBORDER_DEFAULT: | |
1055 | case wxBORDER_NONE: | |
1056 | width = 0; | |
1057 | break; | |
1058 | } | |
1059 | ||
1060 | wxRect rect; | |
1061 | rect.x = | |
1062 | rect.y = | |
1063 | rect.width = | |
1064 | rect.height = width; | |
1065 | ||
1066 | return rect; | |
1067 | } | |
1068 | ||
1069 | bool wxGTKRenderer::AreScrollbarsInsideBorder() const | |
1070 | { | |
1071 | // no, the scrollbars are outside the border in GTK+ | |
1072 | return FALSE; | |
1073 | } | |
1074 | ||
1075 | // ---------------------------------------------------------------------------- | |
1076 | // special borders | |
1077 | // ---------------------------------------------------------------------------- | |
1078 | ||
1079 | void wxGTKRenderer::DrawTextBorder(wxDC& dc, | |
1080 | wxBorder border, | |
1081 | const wxRect& rectOrig, | |
1082 | int flags, | |
1083 | wxRect *rectIn) | |
1084 | { | |
1085 | wxRect rect = rectOrig; | |
1086 | ||
89e7a223 | 1087 | if ( border != wxBORDER_NONE ) |
1e6feb95 | 1088 | { |
e4606ed9 VZ |
1089 | if ( flags & wxCONTROL_FOCUSED ) |
1090 | { | |
1091 | DrawRect(dc, &rect, m_penBlack); | |
1092 | DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); | |
1093 | } | |
1094 | else // !focused | |
1095 | { | |
1096 | DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); | |
1097 | DrawAntiShadedRect(dc, &rect, m_penBlack, m_penHighlight); | |
1098 | } | |
1e6feb95 VZ |
1099 | } |
1100 | ||
1101 | if ( rectIn ) | |
1102 | *rectIn = rect; | |
1103 | } | |
1104 | ||
1105 | void wxGTKRenderer::DrawButtonBorder(wxDC& dc, | |
1106 | const wxRect& rectTotal, | |
1107 | int flags, | |
1108 | wxRect *rectIn) | |
1109 | { | |
1110 | wxRect rect = rectTotal; | |
1111 | ||
1112 | if ( flags & wxCONTROL_PRESSED ) | |
1113 | { | |
1114 | // button pressed: draw a black border around it and an inward shade | |
1115 | DrawRect(dc, &rect, m_penBlack); | |
e4606ed9 | 1116 | |
89e7a223 | 1117 | for ( size_t width = 0; width < BORDER_THICKNESS; width++ ) |
e4606ed9 VZ |
1118 | { |
1119 | DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); | |
1120 | DrawAntiShadedRect(dc, &rect, m_penBlack, m_penDarkGrey); | |
1121 | } | |
1e6feb95 VZ |
1122 | } |
1123 | else | |
1124 | { | |
1125 | // button not pressed | |
1126 | ||
1127 | if ( flags & wxCONTROL_ISDEFAULT ) | |
1128 | { | |
1129 | // TODO | |
1130 | } | |
1131 | ||
1132 | if ( flags & wxCONTROL_FOCUSED ) | |
1133 | { | |
1134 | // button is currently default: add an extra border around it | |
1135 | DrawRect(dc, &rect, m_penBlack); | |
1136 | } | |
1137 | ||
1138 | // now draw a normal button | |
89e7a223 | 1139 | for ( size_t width = 0; width < BORDER_THICKNESS; width++ ) |
e4606ed9 VZ |
1140 | { |
1141 | DrawShadedRect(dc, &rect, m_penHighlight, m_penBlack); | |
1142 | DrawAntiShadedRect(dc, &rect, | |
1143 | wxPen(GetBackgroundColour(flags), 0, wxSOLID), | |
1144 | m_penDarkGrey); | |
1145 | } | |
1e6feb95 VZ |
1146 | } |
1147 | ||
1148 | if ( rectIn ) | |
1149 | { | |
1150 | *rectIn = rect; | |
1151 | } | |
1152 | } | |
1153 | ||
1154 | // ---------------------------------------------------------------------------- | |
1155 | // lines and frames | |
1156 | // ---------------------------------------------------------------------------- | |
1157 | ||
1158 | void wxGTKRenderer::DrawHorizontalLine(wxDC& dc, | |
1159 | wxCoord y, wxCoord x1, wxCoord x2) | |
1160 | { | |
1161 | dc.SetPen(m_penDarkGrey); | |
1162 | dc.DrawLine(x1, y, x2 + 1, y); | |
1163 | dc.SetPen(m_penHighlight); | |
1164 | y++; | |
1165 | dc.DrawLine(x1, y, x2 + 1, y); | |
1166 | } | |
1167 | ||
1168 | void wxGTKRenderer::DrawVerticalLine(wxDC& dc, | |
1169 | wxCoord x, wxCoord y1, wxCoord y2) | |
1170 | { | |
1171 | dc.SetPen(m_penDarkGrey); | |
1172 | dc.DrawLine(x, y1, x, y2 + 1); | |
1173 | dc.SetPen(m_penHighlight); | |
1174 | x++; | |
1175 | dc.DrawLine(x, y1, x, y2 + 1); | |
1176 | } | |
1177 | ||
1178 | void wxGTKRenderer::DrawFrame(wxDC& dc, | |
1179 | const wxString& label, | |
1180 | const wxRect& rect, | |
1181 | int flags, | |
1182 | int alignment, | |
1183 | int indexAccel) | |
1184 | { | |
1185 | wxCoord height = 0; // of the label | |
1186 | wxRect rectFrame = rect; | |
1187 | if ( !label.empty() ) | |
1188 | { | |
1189 | // the text should touch the top border of the rect, so the frame | |
1190 | // itself should be lower | |
1191 | dc.GetTextExtent(label, NULL, &height); | |
1192 | rectFrame.y += height / 2; | |
1193 | rectFrame.height -= height / 2; | |
1194 | ||
1195 | // TODO: the +4 should be customizable | |
1196 | ||
1197 | wxRect rectText; | |
1198 | rectText.x = rectFrame.x + 4; | |
1199 | rectText.y = rect.y; | |
1200 | rectText.width = rectFrame.width - 8; | |
1201 | rectText.height = height; | |
1202 | ||
1203 | wxRect rectLabel; | |
1204 | DrawLabel(dc, label, rectText, flags, alignment, indexAccel, &rectLabel); | |
1205 | rectLabel.x -= 1; | |
1206 | rectLabel.width += 2; | |
1207 | ||
1208 | StandardDrawFrame(dc, rectFrame, rectLabel); | |
1209 | ||
1210 | // GTK+ does it like this | |
1211 | dc.SetPen(m_penHighlight); | |
1212 | dc.DrawPoint(rectText.x, rectFrame.y); | |
1213 | dc.DrawPoint(rectText.x + rectLabel.width - 3, rectFrame.y); | |
1214 | } | |
1215 | else | |
1216 | { | |
1217 | // just draw the complete frame | |
1218 | DrawShadedRect(dc, &rectFrame, m_penDarkGrey, m_penHighlight); | |
1219 | DrawShadedRect(dc, &rectFrame, m_penHighlight, m_penDarkGrey); | |
1220 | } | |
1221 | } | |
1222 | ||
1223 | // ---------------------------------------------------------------------------- | |
1224 | // label | |
1225 | // ---------------------------------------------------------------------------- | |
1226 | ||
1227 | void wxGTKRenderer::DrawLabel(wxDC& dc, | |
1228 | const wxString& label, | |
1229 | const wxRect& rect, | |
1230 | int flags, | |
1231 | int alignment, | |
1232 | int indexAccel, | |
1233 | wxRect *rectBounds) | |
1234 | { | |
1235 | DrawButtonLabel(dc, label, wxNullBitmap, rect, flags, | |
1236 | alignment, indexAccel, rectBounds); | |
1237 | } | |
1238 | ||
1239 | void wxGTKRenderer::DrawButtonLabel(wxDC& dc, | |
1240 | const wxString& label, | |
1241 | const wxBitmap& image, | |
1242 | const wxRect& rect, | |
1243 | int flags, | |
1244 | int alignment, | |
1245 | int indexAccel, | |
1246 | wxRect *rectBounds) | |
1247 | { | |
1248 | if ( flags & wxCONTROL_DISABLED ) | |
1249 | { | |
1250 | // make the text grey and draw a shade for it | |
1251 | dc.SetTextForeground(*wxWHITE); // FIXME hardcoded colour | |
1252 | wxRect rectShadow = rect; | |
1253 | rectShadow.x++; | |
1254 | rectShadow.y++; | |
1255 | dc.DrawLabel(label, rectShadow, alignment, indexAccel); | |
1256 | dc.SetTextForeground(wxSCHEME_COLOUR(m_scheme, CONTROL_TEXT_DISABLED)); | |
1257 | } | |
0fe5e8fe VZ |
1258 | else |
1259 | { | |
1260 | dc.SetTextForeground(wxSCHEME_COLOUR(m_scheme, CONTROL_TEXT)); | |
1261 | } | |
1e6feb95 VZ |
1262 | |
1263 | dc.DrawLabel(label, image, rect, alignment, indexAccel, rectBounds); | |
1264 | } | |
1265 | ||
1266 | void wxGTKRenderer::DrawItem(wxDC& dc, | |
1267 | const wxString& label, | |
1268 | const wxRect& rect, | |
1269 | int flags) | |
1270 | { | |
1271 | wxLogTrace(_T("listbox"), _T("drawing item '%s' at (%d, %d)-(%d, %d)"), | |
1272 | label.c_str(), | |
1273 | rect.x, rect.y, | |
1274 | rect.x + rect.width, rect.y + rect.height); | |
1275 | ||
1276 | wxColour colFg; | |
1277 | if ( flags & wxCONTROL_SELECTED ) | |
1278 | { | |
1279 | dc.SetBrush(wxBrush(wxSCHEME_COLOUR(m_scheme, HIGHLIGHT), wxSOLID)); | |
1280 | dc.SetPen(*wxTRANSPARENT_PEN); | |
1281 | dc.DrawRectangle(rect); | |
1282 | ||
1283 | colFg = dc.GetTextForeground(); | |
1284 | dc.SetTextForeground(wxSCHEME_COLOUR(m_scheme, HIGHLIGHT_TEXT)); | |
1285 | } | |
1286 | ||
1287 | if ( flags & wxCONTROL_FOCUSED ) | |
1288 | { | |
1289 | dc.SetBrush(*wxTRANSPARENT_BRUSH); | |
1290 | wxRect rectFocus = rect; | |
1291 | DrawRect(dc, &rectFocus, m_penBlack); | |
1292 | } | |
1293 | ||
1294 | wxRect rectText = rect; | |
1295 | rectText.x += 2; | |
1296 | rectText.y++; | |
1297 | dc.DrawLabel(label, wxNullBitmap, rectText); | |
1298 | ||
1299 | if ( flags & wxCONTROL_SELECTED ) | |
1300 | { | |
1301 | dc.SetBackgroundMode(wxTRANSPARENT); | |
1302 | } | |
1303 | ||
1304 | // restore the text colour | |
1305 | if ( colFg.Ok() ) | |
1306 | { | |
1307 | dc.SetTextForeground(colFg); | |
1308 | } | |
1309 | } | |
1310 | ||
1311 | void wxGTKRenderer::DrawCheckItem(wxDC& dc, | |
1312 | const wxString& label, | |
1313 | const wxBitmap& bitmap, | |
1314 | const wxRect& rect, | |
1315 | int flags) | |
1316 | { | |
1317 | wxRect rectBitmap = rect; | |
1318 | rectBitmap.x -= 1; | |
1319 | rectBitmap.width = GetCheckBitmapSize().x; | |
0fe5e8fe | 1320 | |
1e6feb95 VZ |
1321 | // never draw the focus rect around the check indicators here |
1322 | DrawCheckButton(dc, _T(""), bitmap, rectBitmap, flags & ~wxCONTROL_FOCUSED); | |
1323 | ||
1324 | wxRect rectLabel = rect; | |
1325 | wxCoord shift = rectBitmap.width + 2*GetCheckItemMargin(); | |
1326 | rectLabel.x += shift; | |
1327 | rectLabel.width -= shift; | |
1328 | DrawItem(dc, label, rectLabel, flags); | |
1329 | } | |
1330 | ||
1331 | // ---------------------------------------------------------------------------- | |
1332 | // check/radion buttons | |
1333 | // ---------------------------------------------------------------------------- | |
1334 | ||
1335 | void wxGTKRenderer::DrawUncheckBitmap(wxDC& dc, | |
1336 | const wxRect& rectTotal, | |
1337 | bool isPressed) | |
1338 | { | |
1339 | wxRect rect = rectTotal; | |
1340 | DrawAntiRaisedBorder(dc, &rect); | |
1341 | ||
1342 | wxColour col = wxSCHEME_COLOUR(m_scheme, SHADOW_IN); | |
1343 | dc.SetPen(wxPen(col, 0, wxSOLID)); | |
1344 | dc.DrawPoint(rect.GetRight() - 1, rect.GetBottom() - 1); | |
1345 | ||
1346 | if ( isPressed ) | |
1347 | col = wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED); | |
1348 | //else: it is SHADOW_IN, leave as is | |
1349 | ||
1350 | dc.SetPen(*wxTRANSPARENT_PEN); | |
1351 | dc.SetBrush(wxBrush(col, wxSOLID)); | |
1352 | dc.DrawRectangle(rect); | |
1353 | } | |
1354 | ||
1355 | void wxGTKRenderer::DrawCheckBitmap(wxDC& dc, const wxRect& rectTotal) | |
1356 | { | |
1357 | wxRect rect = rectTotal; | |
1358 | DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); | |
1359 | DrawShadedRect(dc, &rect, m_penBlack, m_penLightGrey); | |
1360 | ||
1361 | dc.SetPen(*wxTRANSPARENT_PEN); | |
1362 | dc.SetBrush(wxBrush(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), wxSOLID)); | |
1363 | dc.DrawRectangle(rect); | |
1364 | } | |
1365 | ||
1366 | void wxGTKRenderer::DrawRadioBitmap(wxDC& dc, | |
1367 | const wxRect& rect, | |
1368 | int flags) | |
1369 | { | |
1370 | wxCoord x = rect.x, | |
1371 | y = rect.y, | |
1372 | xRight = rect.GetRight(), | |
1373 | yBottom = rect.GetBottom(); | |
1374 | ||
1375 | wxCoord yMid = (y + yBottom) / 2; | |
1376 | ||
1377 | // this looks ugly when the background colour of the control is not the | |
1378 | // same ours - radiobox is not transparent as it should be | |
1379 | #if 0 | |
1380 | // first fill the middle: as FloodFill() is not implemented on all | |
1381 | // platforms, this is the only thing to do | |
1382 | wxColour colBg = flags & wxCONTROL_CURRENT | |
1383 | ? wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT) | |
1384 | : wxSCHEME_COLOUR(m_scheme, SHADOW_IN); | |
1385 | dc.SetBrush(wxBrush(colBg, wxSOLID)); | |
1386 | dc.SetPen(*wxTRANSPARENT_PEN); | |
1387 | dc.DrawRectangle(rect); | |
1388 | #endif // 0 | |
1389 | ||
1390 | // then draw the upper half | |
1391 | dc.SetPen(flags & wxCONTROL_CHECKED ? m_penDarkGrey : m_penHighlight); | |
1392 | DrawUpZag(dc, x, xRight, yMid, y); | |
1393 | DrawUpZag(dc, x + 1, xRight - 1, yMid, y + 1); | |
1394 | ||
1395 | bool drawIt = TRUE; | |
1396 | if ( flags & wxCONTROL_CHECKED ) | |
1397 | dc.SetPen(m_penBlack); | |
1398 | else if ( flags & wxCONTROL_PRESSED ) | |
1399 | dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID)); | |
1400 | else // unchecked and unpressed | |
1401 | drawIt = FALSE; | |
1402 | ||
1403 | if ( drawIt ) | |
1404 | DrawUpZag(dc, x + 2, xRight - 2, yMid, y + 2); | |
1405 | ||
1406 | // and then the lower one | |
1407 | dc.SetPen(flags & wxCONTROL_CHECKED ? m_penHighlight : m_penBlack); | |
1408 | DrawDownZag(dc, x, xRight, yMid, yBottom); | |
1409 | if ( !(flags & wxCONTROL_CHECKED) ) | |
1410 | dc.SetPen(m_penDarkGrey); | |
1411 | DrawDownZag(dc, x + 1, xRight - 1, yMid, yBottom - 1); | |
1412 | ||
1413 | if ( !(flags & wxCONTROL_CHECKED) ) | |
1414 | drawIt = TRUE; // with the same pen | |
1415 | else if ( flags & wxCONTROL_PRESSED ) | |
1416 | { | |
1417 | dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID)); | |
1418 | drawIt = TRUE; | |
1419 | } | |
1420 | else // checked and unpressed | |
1421 | drawIt = FALSE; | |
1422 | ||
1423 | if ( drawIt ) | |
1424 | DrawDownZag(dc, x + 2, xRight - 2, yMid, yBottom - 2); | |
1425 | } | |
1426 | ||
1427 | void wxGTKRenderer::DrawUpZag(wxDC& dc, | |
1428 | wxCoord x1, | |
1429 | wxCoord x2, | |
1430 | wxCoord y1, | |
1431 | wxCoord y2) | |
1432 | { | |
1433 | wxCoord xMid = (x1 + x2) / 2; | |
1434 | dc.DrawLine(x1, y1, xMid, y2); | |
1435 | dc.DrawLine(xMid, y2, x2 + 1, y1 + 1); | |
1436 | } | |
1437 | ||
1438 | void wxGTKRenderer::DrawDownZag(wxDC& dc, | |
1439 | wxCoord x1, | |
1440 | wxCoord x2, | |
1441 | wxCoord y1, | |
1442 | wxCoord y2) | |
1443 | { | |
1444 | wxCoord xMid = (x1 + x2) / 2; | |
1445 | dc.DrawLine(x1 + 1, y1 + 1, xMid, y2); | |
1446 | dc.DrawLine(xMid, y2, x2, y1); | |
1447 | } | |
1448 | ||
1449 | wxBitmap wxGTKRenderer::GetCheckBitmap(int flags) | |
1450 | { | |
1451 | if ( !m_bitmapsCheckbox[0][0].Ok() ) | |
1452 | { | |
1453 | // init the bitmaps once only | |
1454 | wxRect rect; | |
1455 | wxSize size = GetCheckBitmapSize(); | |
1456 | rect.width = size.x; | |
1457 | rect.height = size.y; | |
1458 | for ( int i = 0; i < 2; i++ ) | |
1459 | { | |
1460 | for ( int j = 0; j < 2; j++ ) | |
1461 | m_bitmapsCheckbox[i][j].Create(rect.width, rect.height); | |
1462 | } | |
1463 | ||
1464 | wxMemoryDC dc; | |
1465 | ||
1466 | // normal checked | |
1467 | dc.SelectObject(m_bitmapsCheckbox[0][0]); | |
1468 | DrawCheckBitmap(dc, rect); | |
1469 | ||
1470 | // normal unchecked | |
1471 | dc.SelectObject(m_bitmapsCheckbox[0][1]); | |
1472 | DrawUncheckBitmap(dc, rect, FALSE); | |
1473 | ||
1474 | // pressed checked | |
1475 | m_bitmapsCheckbox[1][0] = m_bitmapsCheckbox[0][0]; | |
1476 | ||
1477 | // pressed unchecked | |
1478 | dc.SelectObject(m_bitmapsCheckbox[1][1]); | |
1479 | DrawUncheckBitmap(dc, rect, TRUE); | |
1480 | } | |
1481 | ||
1482 | int row = flags & wxCONTROL_PRESSED ? 1 : 0; | |
1483 | int col = flags & wxCONTROL_CHECKED ? 0 : 1; | |
1484 | ||
1485 | return m_bitmapsCheckbox[row][col]; | |
1486 | } | |
1487 | ||
3216dbf5 | 1488 | wxBitmap wxGTKRenderer::GetLineWrapBitmap() const |
1e6feb95 VZ |
1489 | { |
1490 | if ( !m_bmpLineWrap.Ok() ) | |
1491 | { | |
1492 | // the line wrap bitmap as used by GTK+ | |
1493 | #define line_wrap_width 6 | |
1494 | #define line_wrap_height 9 | |
1495 | static const char line_wrap_bits[] = | |
1496 | { | |
1497 | 0x1e, 0x3e, 0x30, 0x30, 0x39, 0x1f, 0x0f, 0x0f, 0x1f, | |
1498 | }; | |
1499 | ||
1500 | wxBitmap bmpLineWrap(line_wrap_bits, line_wrap_width, line_wrap_height); | |
1501 | if ( !bmpLineWrap.Ok() ) | |
1502 | { | |
1503 | wxFAIL_MSG( _T("Failed to create line wrap XBM") ); | |
1504 | } | |
1505 | else | |
1506 | { | |
3216dbf5 | 1507 | wxConstCast(this, wxGTKRenderer)->m_bmpLineWrap = bmpLineWrap; |
1e6feb95 VZ |
1508 | } |
1509 | } | |
1510 | ||
1511 | return m_bmpLineWrap; | |
1512 | } | |
1513 | ||
1514 | void wxGTKRenderer::DrawCheckButton(wxDC& dc, | |
1515 | const wxString& label, | |
1516 | const wxBitmap& bitmapOrig, | |
1517 | const wxRect& rectTotal, | |
1518 | int flags, | |
1519 | wxAlignment align, | |
1520 | int indexAccel) | |
1521 | { | |
1522 | wxBitmap bitmap; | |
1523 | if ( bitmapOrig.Ok() ) | |
1524 | { | |
1525 | bitmap = bitmapOrig; | |
1526 | } | |
1527 | else | |
1528 | { | |
1529 | bitmap = GetCheckBitmap(flags); | |
1530 | } | |
1531 | ||
1532 | DoDrawCheckOrRadioBitmap(dc, label, bitmap, rectTotal, | |
1533 | flags, align, indexAccel); | |
1534 | } | |
1535 | ||
1536 | void wxGTKRenderer::DoDrawCheckOrRadioBitmap(wxDC& dc, | |
1537 | const wxString& label, | |
1538 | const wxBitmap& bitmap, | |
1539 | const wxRect& rectTotal, | |
1540 | int flags, | |
1541 | wxAlignment align, | |
1542 | int indexAccel) | |
1543 | { | |
1544 | wxRect rect = rectTotal; | |
1545 | ||
1546 | if ( flags & wxCONTROL_FOCUSED ) | |
1547 | { | |
1548 | // draw the focus border around everything | |
1549 | DrawRect(dc, &rect, m_penBlack); | |
1550 | } | |
1551 | else | |
1552 | { | |
1553 | // the border does not offset the string under GTK | |
1554 | rect.Inflate(-1); | |
1555 | } | |
1556 | ||
1557 | // calculate the position of the bitmap and of the label | |
1558 | wxCoord xBmp, | |
1559 | yBmp = rect.y + (rect.height - bitmap.GetHeight()) / 2; | |
1560 | ||
1561 | wxRect rectLabel; | |
1562 | dc.GetMultiLineTextExtent(label, NULL, &rectLabel.height); | |
1563 | rectLabel.y = rect.y + (rect.height - rectLabel.height) / 2; | |
1564 | ||
1565 | if ( align == wxALIGN_RIGHT ) | |
1566 | { | |
1567 | xBmp = rect.GetRight() - bitmap.GetWidth(); | |
1568 | rectLabel.x = rect.x + 2; | |
1569 | rectLabel.SetRight(xBmp); | |
1570 | } | |
1571 | else // normal (checkbox to the left of the text) case | |
1572 | { | |
1573 | xBmp = rect.x + 2; | |
1574 | rectLabel.x = xBmp + bitmap.GetWidth() + 4; | |
1575 | rectLabel.SetRight(rect.GetRight()); | |
1576 | } | |
1577 | ||
1578 | dc.DrawBitmap(bitmap, xBmp, yBmp, TRUE /* use mask */); | |
1579 | ||
1580 | DrawLabel(dc, label, rectLabel, flags, | |
1581 | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL, indexAccel); | |
1582 | } | |
1583 | ||
1584 | void wxGTKRenderer::DrawRadioButton(wxDC& dc, | |
1585 | const wxString& label, | |
1586 | const wxBitmap& bitmapOrig, | |
1587 | const wxRect& rectTotal, | |
1588 | int flags, | |
1589 | wxAlignment align, | |
1590 | int indexAccel) | |
1591 | { | |
1592 | wxBitmap bitmap; | |
1593 | if ( bitmapOrig.Ok() ) | |
1594 | { | |
1595 | bitmap = bitmapOrig; | |
1596 | } | |
1597 | else | |
1598 | { | |
1599 | wxRect rect; | |
1600 | wxSize size = GetRadioBitmapSize(); | |
1601 | rect.width = size.x; | |
1602 | rect.height = size.y; | |
1603 | bitmap.Create(rect.width, rect.height); | |
1604 | wxMemoryDC dc; | |
1605 | dc.SelectObject(bitmap); | |
1606 | dc.SetBackground(*wxLIGHT_GREY_BRUSH); | |
1607 | dc.Clear(); | |
1608 | DrawRadioBitmap(dc, rect, flags); | |
1609 | bitmap.SetMask(new wxMask(bitmap, *wxLIGHT_GREY)); | |
1610 | } | |
1611 | ||
1612 | DoDrawCheckOrRadioBitmap(dc, label, bitmap, rectTotal, | |
1613 | flags, align, indexAccel); | |
1614 | } | |
1615 | ||
3216dbf5 VZ |
1616 | void wxGTKRenderer::DrawToolBarButton(wxDC& dc, |
1617 | const wxString& label, | |
1618 | const wxBitmap& bitmap, | |
1619 | const wxRect& rectOrig, | |
1620 | int flags) | |
1621 | { | |
1622 | // we don't draw the separators at all | |
1623 | if ( !label.empty() || bitmap.Ok() ) | |
1624 | { | |
1625 | wxRect rect = rectOrig; | |
1626 | rect.Deflate(BORDER_THICKNESS); | |
1627 | ||
1628 | if ( flags & wxCONTROL_PRESSED ) | |
1629 | { | |
2e7b0a16 VZ |
1630 | DrawBorder(dc, wxBORDER_SUNKEN, rect, flags, &rect); |
1631 | ||
1632 | DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), rect); | |
3216dbf5 VZ |
1633 | } |
1634 | else if ( flags & wxCONTROL_CURRENT ) | |
1635 | { | |
2e7b0a16 VZ |
1636 | DrawBorder(dc, wxBORDER_RAISED, rect, flags, &rect); |
1637 | ||
1638 | DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT), rect); | |
3216dbf5 VZ |
1639 | } |
1640 | ||
1641 | dc.DrawLabel(label, bitmap, rect, wxALIGN_CENTRE); | |
1642 | } | |
1643 | } | |
1644 | ||
1e6feb95 VZ |
1645 | // ---------------------------------------------------------------------------- |
1646 | // text control | |
1647 | // ---------------------------------------------------------------------------- | |
1648 | ||
1649 | wxRect wxGTKRenderer::GetTextTotalArea(const wxTextCtrl *text, | |
3216dbf5 | 1650 | const wxRect& rect) const |
1e6feb95 VZ |
1651 | { |
1652 | wxRect rectTotal = rect; | |
89e7a223 | 1653 | rectTotal.Inflate(2*BORDER_THICKNESS); |
1e6feb95 VZ |
1654 | return rectTotal; |
1655 | } | |
1656 | ||
1657 | wxRect wxGTKRenderer::GetTextClientArea(const wxTextCtrl *text, | |
1658 | const wxRect& rect, | |
3216dbf5 | 1659 | wxCoord *extraSpaceBeyond) const |
1e6feb95 VZ |
1660 | { |
1661 | wxRect rectText = rect; | |
5836c908 | 1662 | rectText.Deflate(2*BORDER_THICKNESS); |
1e6feb95 VZ |
1663 | |
1664 | if ( text->WrapLines() ) | |
1665 | { | |
1666 | // leave enough for the line wrap bitmap indicator | |
1667 | wxCoord widthMark = GetLineWrapBitmap().GetWidth() + 2; | |
1668 | ||
1669 | rectText.width -= widthMark; | |
1670 | ||
1671 | if ( extraSpaceBeyond ) | |
1672 | *extraSpaceBeyond = widthMark; | |
1673 | } | |
1674 | ||
1675 | return rectText; | |
1676 | } | |
1677 | ||
1678 | void wxGTKRenderer::DrawTextLine(wxDC& dc, | |
1679 | const wxString& text, | |
1680 | const wxRect& rect, | |
1681 | int selStart, | |
1682 | int selEnd, | |
1683 | int flags) | |
1684 | { | |
1685 | // TODO: GTK+ draws selection even for unfocused controls, just with | |
1686 | // different colours | |
1687 | StandardDrawTextLine(dc, text, rect, selStart, selEnd, flags); | |
1688 | } | |
1689 | ||
1690 | void wxGTKRenderer::DrawLineWrapMark(wxDC& dc, const wxRect& rect) | |
1691 | { | |
1692 | wxBitmap bmpLineWrap = GetLineWrapBitmap(); | |
1693 | ||
1694 | // for a mono bitmap he colours it appears in depends on the current text | |
1695 | // colours, so set them correctly | |
1696 | wxColour colFgOld; | |
1697 | if ( bmpLineWrap.GetDepth() == 1 ) | |
1698 | { | |
1699 | colFgOld = dc.GetTextForeground(); | |
1700 | ||
1701 | // FIXME: I wonder what should we do if the background is black too? | |
1702 | dc.SetTextForeground(*wxBLACK); | |
1703 | } | |
1704 | ||
1705 | dc.DrawBitmap(bmpLineWrap, | |
1706 | rect.x, rect.y + (rect.height - bmpLineWrap.GetHeight())/2); | |
1707 | ||
1708 | if ( colFgOld.Ok() ) | |
1709 | { | |
1710 | // restore old colour | |
1711 | dc.SetTextForeground(colFgOld); | |
1712 | } | |
1713 | } | |
1714 | ||
1715 | // ---------------------------------------------------------------------------- | |
1716 | // notebook | |
1717 | // ---------------------------------------------------------------------------- | |
1718 | ||
1719 | void wxGTKRenderer::DrawTab(wxDC& dc, | |
1720 | const wxRect& rectOrig, | |
1721 | wxDirection dir, | |
1722 | const wxString& label, | |
1723 | const wxBitmap& bitmap, | |
1724 | int flags, | |
1725 | int indexAccel) | |
1726 | { | |
1727 | wxRect rect = rectOrig; | |
1728 | ||
1729 | // the current tab is drawn indented (to the top for default case) and | |
1730 | // bigger than the other ones | |
1731 | const wxSize indent = GetTabIndent(); | |
1732 | if ( flags & wxCONTROL_SELECTED ) | |
1733 | { | |
1734 | switch ( dir ) | |
1735 | { | |
1736 | default: | |
1737 | wxFAIL_MSG(_T("invaild notebook tab orientation")); | |
1738 | // fall through | |
1739 | ||
1740 | case wxTOP: | |
1741 | rect.Inflate(indent.x, 0); | |
1742 | rect.y -= indent.y; | |
1743 | rect.height += indent.y; | |
1744 | break; | |
1745 | ||
1746 | case wxBOTTOM: | |
1747 | rect.Inflate(indent.x, 0); | |
1748 | rect.height += indent.y; | |
1749 | break; | |
1750 | ||
1751 | case wxLEFT: | |
1752 | case wxRIGHT: | |
1753 | wxFAIL_MSG(_T("TODO")); | |
1754 | break; | |
1755 | } | |
1756 | } | |
1757 | ||
1758 | // selected tab has different colour | |
1759 | wxColour col = flags & wxCONTROL_SELECTED | |
1760 | ? wxSCHEME_COLOUR(m_scheme, SHADOW_IN) | |
1761 | : wxSCHEME_COLOUR(m_scheme, SCROLLBAR); | |
1762 | DoDrawBackground(dc, col, rect); | |
1763 | ||
1764 | if ( flags & wxCONTROL_FOCUSED ) | |
1765 | { | |
1766 | // draw the focus rect | |
1767 | wxRect rectBorder = rect; | |
1768 | rectBorder.Deflate(4, 3); | |
1769 | if ( dir == wxBOTTOM ) | |
1770 | rectBorder.Offset(0, -1); | |
1771 | ||
1772 | DrawRect(dc, &rectBorder, m_penBlack); | |
1773 | } | |
1774 | ||
1775 | // draw the text, image and the focus around them (if necessary) | |
1776 | wxRect rectLabel = rect; | |
1777 | rectLabel.Deflate(1, 1); | |
1778 | dc.DrawLabel(label, bitmap, rectLabel, wxALIGN_CENTRE, indexAccel); | |
1779 | ||
1780 | // now draw the tab itself | |
1781 | wxCoord x = rect.x, | |
1782 | y = rect.y, | |
1783 | x2 = rect.GetRight(), | |
1784 | y2 = rect.GetBottom(); | |
1785 | switch ( dir ) | |
1786 | { | |
1787 | default: | |
1788 | case wxTOP: | |
1789 | dc.SetPen(m_penHighlight); | |
1790 | dc.DrawLine(x, y2, x, y); | |
1791 | dc.DrawLine(x + 1, y, x2, y); | |
1792 | ||
1793 | dc.SetPen(m_penBlack); | |
1794 | dc.DrawLine(x2, y2, x2, y); | |
1795 | ||
1796 | dc.SetPen(m_penDarkGrey); | |
1797 | dc.DrawLine(x2 - 1, y2, x2 - 1, y + 1); | |
1798 | ||
1799 | if ( flags & wxCONTROL_SELECTED ) | |
1800 | { | |
1801 | dc.SetPen(m_penLightGrey); | |
1802 | ||
1803 | // overwrite the part of the border below this tab | |
1804 | dc.DrawLine(x + 1, y2 + 1, x2 - 1, y2 + 1); | |
1805 | ||
1806 | // and the shadow of the tab to the left of us | |
1807 | dc.DrawLine(x + 1, y + 2, x + 1, y2 + 1); | |
1808 | } | |
1809 | break; | |
1810 | ||
1811 | case wxBOTTOM: | |
1812 | dc.SetPen(m_penHighlight); | |
1813 | ||
1814 | // we need to continue one pixel further to overwrite the corner of | |
1815 | // the border for the selected tab | |
1816 | dc.DrawLine(x, y - (flags & wxCONTROL_SELECTED ? 1 : 0), | |
1817 | x, y2); | |
1818 | ||
1819 | // it doesn't work like this (TODO: implement it properly) | |
1820 | #if 0 | |
1821 | // erase the corner of the tab to the right | |
1822 | dc.SetPen(m_penLightGrey); | |
1823 | dc.DrawPoint(x2 - 1, y - 2); | |
1824 | dc.DrawPoint(x2 - 2, y - 2); | |
1825 | dc.DrawPoint(x2 - 2, y - 1); | |
1826 | #endif // 0 | |
1827 | ||
1828 | dc.SetPen(m_penBlack); | |
1829 | dc.DrawLine(x + 1, y2, x2, y2); | |
1830 | dc.DrawLine(x2, y, x2, y2); | |
1831 | ||
1832 | dc.SetPen(m_penDarkGrey); | |
1833 | dc.DrawLine(x + 2, y2 - 1, x2 - 1, y2 - 1); | |
1834 | dc.DrawLine(x2 - 1, y, x2 - 1, y2); | |
1835 | ||
1836 | if ( flags & wxCONTROL_SELECTED ) | |
1837 | { | |
1838 | dc.SetPen(m_penLightGrey); | |
1839 | ||
1840 | // overwrite the part of the (double!) border above this tab | |
1841 | dc.DrawLine(x + 1, y - 1, x2 - 1, y - 1); | |
1842 | dc.DrawLine(x + 1, y - 2, x2 - 1, y - 2); | |
1843 | ||
1844 | // and the shadow of the tab to the left of us | |
1845 | dc.DrawLine(x + 1, y2 - 1, x + 1, y - 1); | |
1846 | } | |
1847 | break; | |
1848 | ||
1849 | case wxLEFT: | |
1850 | case wxRIGHT: | |
1851 | wxFAIL_MSG(_T("TODO")); | |
1852 | } | |
1853 | } | |
1854 | ||
1855 | // ---------------------------------------------------------------------------- | |
1856 | // slider | |
1857 | // ---------------------------------------------------------------------------- | |
1858 | ||
1859 | wxSize wxGTKRenderer::GetSliderThumbSize(const wxRect& rect, | |
1860 | wxOrientation orient) const | |
1861 | { | |
1862 | static const wxCoord SLIDER_THUMB_LENGTH = 30; | |
1863 | ||
1864 | wxSize size; | |
1865 | ||
1866 | wxRect rectShaft = GetSliderShaftRect(rect, orient); | |
1867 | if ( orient == wxHORIZONTAL ) | |
1868 | { | |
1869 | size.x = wxMin(SLIDER_THUMB_LENGTH, rectShaft.width); | |
1870 | size.y = rectShaft.height; | |
1871 | } | |
1872 | else // vertical | |
1873 | { | |
1874 | size.y = wxMin(SLIDER_THUMB_LENGTH, rectShaft.height); | |
1875 | size.x = rectShaft.width; | |
1876 | } | |
1877 | ||
1878 | return size; | |
1879 | } | |
1880 | ||
1881 | wxRect wxGTKRenderer::GetSliderShaftRect(const wxRect& rect, | |
1882 | wxOrientation WXUNUSED(orient)) const | |
1883 | { | |
1884 | return rect.Deflate(2*BORDER_THICKNESS, 2*BORDER_THICKNESS); | |
1885 | } | |
1886 | ||
1887 | void wxGTKRenderer::DrawSliderShaft(wxDC& dc, | |
1888 | const wxRect& rectOrig, | |
1889 | wxOrientation orient, | |
1890 | int flags, | |
1891 | wxRect *rectShaft) | |
1892 | { | |
1893 | wxRect rect = rectOrig; | |
1894 | ||
1895 | // draw the border first | |
1896 | if ( flags & wxCONTROL_FOCUSED ) | |
1897 | { | |
1898 | DrawRect(dc, &rect, m_penBlack); | |
1899 | DrawAntiShadedRect(dc, &rect, m_penBlack, m_penLightGrey); | |
1900 | } | |
1901 | else // not focused, normal | |
1902 | { | |
1903 | DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); | |
1904 | DrawAntiShadedRect(dc, &rect, m_penBlack, m_penLightGrey); | |
1905 | } | |
1906 | ||
1907 | // and the background | |
1908 | DoDrawBackground(dc, wxSCHEME_COLOUR(m_scheme, SCROLLBAR), rect); | |
1909 | ||
1910 | if ( rectShaft ) | |
1911 | *rectShaft = rect; | |
1912 | } | |
1913 | ||
1914 | void wxGTKRenderer::DrawSliderThumb(wxDC& dc, | |
1915 | const wxRect& rectOrig, | |
1916 | wxOrientation orient, | |
1917 | int flags) | |
1918 | { | |
1919 | // draw the thumb border | |
1920 | wxRect rect = rectOrig; | |
1921 | DrawAntiRaisedBorder(dc, &rect); | |
1922 | ||
1923 | // draw the handle in the middle | |
1924 | if ( orient == wxVERTICAL ) | |
1925 | { | |
1926 | rect.height = 2*BORDER_THICKNESS; | |
1927 | rect.y = rectOrig.y + (rectOrig.height - rect.height) / 2; | |
1928 | } | |
1929 | else // horz | |
1930 | { | |
1931 | rect.width = 2*BORDER_THICKNESS; | |
1932 | rect.x = rectOrig.x + (rectOrig.width - rect.width) / 2; | |
1933 | } | |
1934 | ||
1935 | DrawShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); | |
1936 | } | |
1937 | ||
1938 | // ---------------------------------------------------------------------------- | |
1939 | // menu and menubar | |
1940 | // ---------------------------------------------------------------------------- | |
1941 | ||
0fe5e8fe VZ |
1942 | // wxGTKMenuGeometryInfo: the wxMenuGeometryInfo used by wxGTKRenderer |
1943 | class WXDLLEXPORT wxGTKMenuGeometryInfo : public wxMenuGeometryInfo | |
1944 | { | |
1945 | public: | |
1946 | virtual wxSize GetSize() const { return m_size; } | |
1947 | ||
1948 | wxCoord GetLabelOffset() const { return m_ofsLabel; } | |
1949 | wxCoord GetAccelOffset() const { return m_ofsAccel; } | |
1950 | ||
1951 | wxCoord GetItemHeight() const { return m_heightItem; } | |
1952 | ||
1953 | private: | |
1954 | // the total size of the menu | |
1955 | wxSize m_size; | |
1956 | ||
1957 | // the offset of the start of the menu item label | |
1958 | wxCoord m_ofsLabel; | |
1959 | ||
1960 | // the offset of the start of the accel label | |
1961 | wxCoord m_ofsAccel; | |
1962 | ||
1963 | // the height of a normal (not separator) item | |
1964 | wxCoord m_heightItem; | |
1965 | ||
1966 | friend wxMenuGeometryInfo * | |
1967 | wxGTKRenderer::GetMenuGeometry(wxWindow *, const wxMenu&) const; | |
1968 | }; | |
1969 | ||
1970 | // FIXME: all constants are hardcoded but shouldn't be | |
1971 | static const wxCoord MENU_LEFT_MARGIN = 9; | |
1972 | static const wxCoord MENU_RIGHT_MARGIN = 6; | |
1973 | ||
1974 | static const wxCoord MENU_HORZ_MARGIN = 6; | |
1975 | static const wxCoord MENU_VERT_MARGIN = 3; | |
1976 | ||
1977 | // the margin around bitmap/check marks (on each side) | |
1978 | static const wxCoord MENU_BMP_MARGIN = 2; | |
1979 | ||
1980 | // the margin between the labels and accel strings | |
1981 | static const wxCoord MENU_ACCEL_MARGIN = 8; | |
1982 | ||
1983 | // the separator height in pixels: in fact, strangely enough, the real height | |
1984 | // is 2 but Windows adds one extra pixel in the bottom margin, so take it into | |
1985 | // account here | |
1986 | static const wxCoord MENU_SEPARATOR_HEIGHT = 3; | |
1987 | ||
1988 | // the size of the standard checkmark bitmap | |
1989 | static const wxCoord MENU_CHECK_SIZE = 9; | |
1990 | ||
1e6feb95 VZ |
1991 | void wxGTKRenderer::DrawMenuBarItem(wxDC& dc, |
1992 | const wxRect& rect, | |
1993 | const wxString& label, | |
1994 | int flags, | |
1995 | int indexAccel) | |
1996 | { | |
0fe5e8fe | 1997 | DoDrawMenuItem(dc, rect, label, flags, indexAccel); |
1e6feb95 VZ |
1998 | } |
1999 | ||
2000 | void wxGTKRenderer::DrawMenuItem(wxDC& dc, | |
2001 | wxCoord y, | |
0fe5e8fe | 2002 | const wxMenuGeometryInfo& gi, |
1e6feb95 VZ |
2003 | const wxString& label, |
2004 | const wxString& accel, | |
2005 | const wxBitmap& bitmap, | |
2006 | int flags, | |
2007 | int indexAccel) | |
2008 | { | |
0fe5e8fe VZ |
2009 | const wxGTKMenuGeometryInfo& geomInfo = (const wxGTKMenuGeometryInfo&)gi; |
2010 | ||
2011 | wxRect rect; | |
2012 | rect.x = 0; | |
2013 | rect.y = y; | |
2014 | rect.width = geomInfo.GetSize().x; | |
2015 | rect.height = geomInfo.GetItemHeight(); | |
2016 | ||
2017 | DoDrawMenuItem(dc, rect, label, flags, indexAccel, accel, bitmap, &geomInfo); | |
2018 | } | |
2019 | ||
2020 | void wxGTKRenderer::DoDrawMenuItem(wxDC& dc, | |
2021 | const wxRect& rectOrig, | |
2022 | const wxString& label, | |
2023 | int flags, | |
2024 | int indexAccel, | |
2025 | const wxString& accel, | |
2026 | const wxBitmap& bitmap, | |
2027 | const wxGTKMenuGeometryInfo *geometryInfo) | |
2028 | { | |
2029 | wxRect rect = rectOrig; | |
2030 | ||
2031 | // draw the selected item specially | |
2032 | if ( flags & wxCONTROL_SELECTED ) | |
2033 | { | |
2034 | wxRect rectIn; | |
2035 | DrawBorder(dc, wxBORDER_RAISED, rect, flags, &rectIn); | |
2036 | ||
2037 | DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT), rectIn); | |
2038 | } | |
2039 | ||
2040 | rect.Deflate(MENU_HORZ_MARGIN, MENU_VERT_MARGIN); | |
2041 | ||
2042 | // draw the bitmap: use the bitmap provided or the standard checkmark for | |
2043 | // the checkable items | |
2044 | if ( geometryInfo ) | |
2045 | { | |
2046 | wxBitmap bmp = bitmap; | |
2047 | if ( !bmp.Ok() && (flags & wxCONTROL_CHECKABLE) ) | |
2048 | { | |
2049 | bmp = GetCheckBitmap(flags); | |
2050 | } | |
2051 | ||
2052 | if ( bmp.Ok() ) | |
2053 | { | |
2054 | rect.SetRight(geometryInfo->GetLabelOffset()); | |
2055 | wxControlRenderer::DrawBitmap(dc, bmp, rect); | |
2056 | } | |
2057 | } | |
2058 | //else: menubar items don't have bitmaps | |
2059 | ||
2060 | // draw the label | |
2061 | if ( geometryInfo ) | |
2062 | { | |
2063 | rect.x = geometryInfo->GetLabelOffset(); | |
2064 | rect.SetRight(geometryInfo->GetAccelOffset()); | |
2065 | } | |
2066 | ||
2067 | DrawLabel(dc, label, rect, flags, wxALIGN_CENTRE_VERTICAL, indexAccel); | |
2068 | ||
2069 | // draw the accel string | |
2070 | if ( !accel.empty() ) | |
2071 | { | |
2072 | // menubar items shouldn't have them | |
2073 | wxCHECK_RET( geometryInfo, _T("accel strings only valid for menus") ); | |
2074 | ||
2075 | rect.x = geometryInfo->GetAccelOffset(); | |
2076 | rect.SetRight(geometryInfo->GetSize().x); | |
2077 | ||
2078 | // NB: no accel index here | |
2079 | DrawLabel(dc, accel, rect, flags, wxALIGN_CENTRE_VERTICAL); | |
2080 | } | |
2081 | ||
2082 | // draw the submenu indicator | |
2083 | if ( flags & wxCONTROL_ISSUBMENU ) | |
2084 | { | |
2085 | wxCHECK_RET( geometryInfo, _T("wxCONTROL_ISSUBMENU only valid for menus") ); | |
2086 | ||
2087 | rect.x = geometryInfo->GetSize().x - MENU_RIGHT_MARGIN; | |
2088 | rect.width = MENU_RIGHT_MARGIN; | |
2089 | ||
2090 | DrawArrow(dc, wxRIGHT, rect, flags); | |
2091 | } | |
1e6feb95 VZ |
2092 | } |
2093 | ||
2094 | void wxGTKRenderer::DrawMenuSeparator(wxDC& dc, | |
2095 | wxCoord y, | |
2096 | const wxMenuGeometryInfo& geomInfo) | |
2097 | { | |
0fe5e8fe | 2098 | DrawHorizontalLine(dc, y + MENU_VERT_MARGIN, 0, geomInfo.GetSize().x); |
1e6feb95 VZ |
2099 | } |
2100 | ||
2101 | wxSize wxGTKRenderer::GetMenuBarItemSize(const wxSize& sizeText) const | |
2102 | { | |
0fe5e8fe VZ |
2103 | wxSize size = sizeText; |
2104 | ||
2105 | // TODO: make this configurable | |
2106 | size.x += 2*MENU_HORZ_MARGIN; | |
2107 | size.y += 2*MENU_VERT_MARGIN; | |
2108 | ||
2109 | return size; | |
1e6feb95 VZ |
2110 | } |
2111 | ||
2112 | wxMenuGeometryInfo *wxGTKRenderer::GetMenuGeometry(wxWindow *win, | |
2113 | const wxMenu& menu) const | |
2114 | { | |
0fe5e8fe VZ |
2115 | // prepare the dc: for now we draw all the items with the system font |
2116 | wxClientDC dc(win); | |
2117 | dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); | |
2118 | ||
2119 | // the height of a normal item | |
2120 | wxCoord heightText = dc.GetCharHeight(); | |
2121 | ||
2122 | // the total height | |
2123 | wxCoord height = 0; | |
2124 | ||
2125 | // the max length of label and accel strings: the menu width is the sum of | |
2126 | // them, even if they're for different items (as the accels should be | |
2127 | // aligned) | |
2128 | // | |
2129 | // the max length of the bitmap is never 0 as Windows always leaves enough | |
2130 | // space for a check mark indicator | |
2131 | wxCoord widthLabelMax = 0, | |
2132 | widthAccelMax = 0, | |
2133 | widthBmpMax = MENU_LEFT_MARGIN; | |
2134 | ||
2135 | for ( wxMenuItemList::Node *node = menu.GetMenuItems().GetFirst(); | |
2136 | node; | |
2137 | node = node->GetNext() ) | |
2138 | { | |
2139 | // height of this item | |
2140 | wxCoord h; | |
2141 | ||
2142 | wxMenuItem *item = node->GetData(); | |
2143 | if ( item->IsSeparator() ) | |
2144 | { | |
2145 | h = MENU_SEPARATOR_HEIGHT; | |
2146 | } | |
2147 | else // not separator | |
2148 | { | |
2149 | h = heightText; | |
2150 | ||
2151 | wxCoord widthLabel; | |
2152 | dc.GetTextExtent(item->GetLabel(), &widthLabel, NULL); | |
2153 | if ( widthLabel > widthLabelMax ) | |
2154 | { | |
2155 | widthLabelMax = widthLabel; | |
2156 | } | |
2157 | ||
2158 | wxCoord widthAccel; | |
2159 | dc.GetTextExtent(item->GetAccelString(), &widthAccel, NULL); | |
2160 | if ( widthAccel > widthAccelMax ) | |
2161 | { | |
2162 | widthAccelMax = widthAccel; | |
2163 | } | |
2164 | ||
2165 | const wxBitmap& bmp = item->GetBitmap(); | |
2166 | if ( bmp.Ok() ) | |
2167 | { | |
2168 | wxCoord widthBmp = bmp.GetWidth(); | |
2169 | if ( widthBmp > widthBmpMax ) | |
2170 | widthBmpMax = widthBmp; | |
2171 | } | |
2172 | //else if ( item->IsCheckable() ): no need to check for this as | |
2173 | // MENU_LEFT_MARGIN is big enough to show the check mark | |
2174 | } | |
2175 | ||
2176 | h += 2*MENU_VERT_MARGIN; | |
2177 | ||
2178 | // remember the item position and height | |
2179 | item->SetGeometry(height, h); | |
2180 | ||
2181 | height += h; | |
2182 | } | |
2183 | ||
2184 | // bundle the metrics into a struct and return it | |
2185 | wxGTKMenuGeometryInfo *gi = new wxGTKMenuGeometryInfo; | |
2186 | ||
2187 | gi->m_ofsLabel = widthBmpMax + 2*MENU_BMP_MARGIN; | |
2188 | gi->m_ofsAccel = gi->m_ofsLabel + widthLabelMax; | |
2189 | if ( widthAccelMax > 0 ) | |
2190 | { | |
2191 | // if we actually have any accesl, add a margin | |
2192 | gi->m_ofsAccel += MENU_ACCEL_MARGIN; | |
2193 | } | |
2194 | ||
2195 | gi->m_heightItem = heightText + 2*MENU_VERT_MARGIN; | |
2196 | ||
2197 | gi->m_size.x = gi->m_ofsAccel + widthAccelMax + MENU_RIGHT_MARGIN; | |
2198 | gi->m_size.y = height; | |
1e6feb95 | 2199 | |
0fe5e8fe | 2200 | return gi; |
1e6feb95 | 2201 | } |
71e03035 VZ |
2202 | |
2203 | // ---------------------------------------------------------------------------- | |
2204 | // status bar | |
2205 | // ---------------------------------------------------------------------------- | |
2206 | ||
2207 | wxSize wxGTKRenderer::GetStatusBarBorders(wxCoord *borderBetweenFields) const | |
2208 | { | |
2209 | return wxSize(0, 0); | |
2210 | } | |
2211 | ||
2212 | void wxGTKRenderer::DrawStatusField(wxDC& dc, | |
2213 | const wxRect& rect, | |
2214 | const wxString& label, | |
2215 | int flags) | |
2216 | { | |
2217 | } | |
1b488c0e | 2218 | |
1e6feb95 VZ |
2219 | // ---------------------------------------------------------------------------- |
2220 | // combobox | |
2221 | // ---------------------------------------------------------------------------- | |
2222 | ||
1b488c0e VZ |
2223 | void wxGTKRenderer::InitComboBitmaps() |
2224 | { | |
2225 | wxSize sizeArrow = m_sizeScrollbarArrow; | |
2226 | sizeArrow.x -= 2; | |
2227 | sizeArrow.y -= 2; | |
2228 | ||
2229 | size_t n; | |
2230 | ||
2231 | for ( n = ComboState_Normal; n < ComboState_Max; n++ ) | |
2232 | { | |
2233 | m_bitmapsCombo[n].Create(sizeArrow.x, sizeArrow.y); | |
2234 | } | |
2235 | ||
2236 | static const int comboButtonFlags[ComboState_Max] = | |
2237 | { | |
2238 | 0, | |
2239 | wxCONTROL_CURRENT, | |
2240 | wxCONTROL_PRESSED, | |
2241 | wxCONTROL_DISABLED, | |
2242 | }; | |
2243 | ||
2244 | wxRect rect(wxPoint(0, 0), sizeArrow); | |
2245 | ||
2246 | wxMemoryDC dc; | |
2247 | for ( n = ComboState_Normal; n < ComboState_Max; n++ ) | |
2248 | { | |
2249 | int flags = comboButtonFlags[n]; | |
2250 | ||
2251 | dc.SelectObject(m_bitmapsCombo[n]); | |
2252 | DoDrawBackground(dc, GetBackgroundColour(flags), rect); | |
2253 | DrawArrow(dc, wxDOWN, rect, flags); | |
2254 | } | |
2255 | } | |
2256 | ||
1e6feb95 | 2257 | void wxGTKRenderer::GetComboBitmaps(wxBitmap *bmpNormal, |
1b488c0e | 2258 | wxBitmap *bmpFocus, |
1e6feb95 VZ |
2259 | wxBitmap *bmpPressed, |
2260 | wxBitmap *bmpDisabled) | |
2261 | { | |
1b488c0e VZ |
2262 | if ( !m_bitmapsCombo[ComboState_Normal].Ok() ) |
2263 | { | |
2264 | InitComboBitmaps(); | |
2265 | } | |
2266 | ||
2267 | if ( bmpNormal ) | |
2268 | *bmpNormal = m_bitmapsCombo[ComboState_Normal]; | |
2269 | if ( bmpFocus ) | |
2270 | *bmpFocus = m_bitmapsCombo[ComboState_Focus]; | |
2271 | if ( bmpPressed ) | |
2272 | *bmpPressed = m_bitmapsCombo[ComboState_Pressed]; | |
2273 | if ( bmpDisabled ) | |
2274 | *bmpDisabled = m_bitmapsCombo[ComboState_Disabled]; | |
1e6feb95 VZ |
2275 | } |
2276 | ||
2277 | // ---------------------------------------------------------------------------- | |
2278 | // background | |
2279 | // ---------------------------------------------------------------------------- | |
2280 | ||
2281 | void wxGTKRenderer::DoDrawBackground(wxDC& dc, | |
2282 | const wxColour& col, | |
2283 | const wxRect& rect) | |
2284 | { | |
2285 | wxBrush brush(col, wxSOLID); | |
2286 | dc.SetBrush(brush); | |
2287 | dc.SetPen(*wxTRANSPARENT_PEN); | |
2288 | dc.DrawRectangle(rect); | |
2289 | } | |
2290 | ||
2291 | void wxGTKRenderer::DrawBackground(wxDC& dc, | |
2292 | const wxColour& col, | |
2293 | const wxRect& rect, | |
2294 | int flags) | |
2295 | { | |
2296 | wxColour colBg = col.Ok() ? col : GetBackgroundColour(flags); | |
2297 | DoDrawBackground(dc, colBg, rect); | |
2298 | } | |
2299 | ||
2300 | // ---------------------------------------------------------------------------- | |
2301 | // scrollbar | |
2302 | // ---------------------------------------------------------------------------- | |
2303 | ||
2304 | void wxGTKRenderer::DrawArrowBorder(wxDC& dc, | |
2305 | wxRect *rect, | |
2306 | wxDirection dir) | |
2307 | { | |
2308 | static const wxDirection sides[] = | |
2309 | { | |
2310 | wxUP, wxLEFT, wxRIGHT, wxDOWN | |
2311 | }; | |
2312 | ||
2313 | wxRect rect1, rect2, rectInner; | |
2314 | rect1 = | |
2315 | rect2 = | |
2316 | rectInner = *rect; | |
2317 | ||
2318 | rect2.Inflate(-1); | |
2319 | rectInner.Inflate(-2); | |
2320 | ||
2321 | DoDrawBackground(dc, wxSCHEME_COLOUR(m_scheme, SCROLLBAR), *rect); | |
2322 | ||
2323 | // find the side not to draw and also adjust the rectangles to compensate | |
2324 | // for it | |
2325 | wxDirection sideToOmit; | |
2326 | switch ( dir ) | |
2327 | { | |
2328 | case wxUP: | |
2329 | sideToOmit = wxDOWN; | |
2330 | rect2.height += 1; | |
2331 | rectInner.height += 1; | |
2332 | break; | |
2333 | ||
2334 | case wxDOWN: | |
2335 | sideToOmit = wxUP; | |
2336 | rect2.y -= 1; | |
2337 | rect2.height += 1; | |
2338 | rectInner.y -= 2; | |
2339 | rectInner.height += 1; | |
2340 | break; | |
2341 | ||
2342 | case wxLEFT: | |
2343 | sideToOmit = wxRIGHT; | |
2344 | rect2.width += 1; | |
2345 | rectInner.width += 1; | |
2346 | break; | |
2347 | ||
2348 | case wxRIGHT: | |
2349 | sideToOmit = wxLEFT; | |
2350 | rect2.x -= 1; | |
2351 | rect2.width += 1; | |
2352 | rectInner.x -= 2; | |
2353 | rectInner.width += 1; | |
2354 | break; | |
2355 | ||
2356 | default: | |
2357 | wxFAIL_MSG(_T("unknown arrow direction")); | |
2358 | return; | |
2359 | } | |
2360 | ||
2361 | // the outer rect first | |
2362 | size_t n; | |
2363 | for ( n = 0; n < WXSIZEOF(sides); n++ ) | |
2364 | { | |
2365 | wxDirection side = sides[n]; | |
2366 | if ( side == sideToOmit ) | |
2367 | continue; | |
2368 | ||
2369 | DrawAntiShadedRectSide(dc, rect1, m_penDarkGrey, m_penHighlight, side); | |
2370 | } | |
2371 | ||
2372 | // and then the inner one | |
2373 | for ( n = 0; n < WXSIZEOF(sides); n++ ) | |
2374 | { | |
2375 | wxDirection side = sides[n]; | |
2376 | if ( side == sideToOmit ) | |
2377 | continue; | |
2378 | ||
2379 | DrawAntiShadedRectSide(dc, rect2, m_penBlack, m_penGrey, side); | |
2380 | } | |
2381 | ||
2382 | *rect = rectInner; | |
2383 | } | |
2384 | ||
2385 | void wxGTKRenderer::DrawScrollbarArrow(wxDC& dc, | |
2386 | wxDirection dir, | |
2387 | const wxRect& rectArrow, | |
2388 | int flags) | |
2389 | { | |
2390 | // first of all, draw the border around it - but we don't want the border | |
2391 | // on the side opposite to the arrow point | |
2392 | wxRect rect = rectArrow; | |
2393 | DrawArrowBorder(dc, &rect, dir); | |
2394 | ||
2395 | // then the arrow itself | |
2396 | DrawArrow(dc, dir, rect, flags); | |
2397 | } | |
2398 | ||
2399 | // gtk_default_draw_arrow() takes ~350 lines and we can't do much better here | |
2400 | // these people are just crazy :-( | |
2401 | void wxGTKRenderer::DrawArrow(wxDC& dc, | |
2402 | wxDirection dir, | |
2403 | const wxRect& rect, | |
2404 | int flags) | |
2405 | { | |
2406 | enum | |
2407 | { | |
2408 | Point_First, | |
2409 | Point_Second, | |
2410 | Point_Third, | |
2411 | Point_Max | |
2412 | }; | |
2413 | ||
2414 | wxPoint ptArrow[Point_Max]; | |
2415 | ||
2416 | wxColour colInside = GetBackgroundColour(flags); | |
2417 | wxPen penShadow[4]; | |
2418 | if ( flags & wxCONTROL_DISABLED ) | |
2419 | { | |
2420 | penShadow[0] = m_penDarkGrey; | |
2421 | penShadow[1] = m_penDarkGrey; | |
2422 | penShadow[2] = wxNullPen; | |
2423 | penShadow[3] = wxNullPen; | |
2424 | } | |
2425 | else if ( flags & wxCONTROL_PRESSED ) | |
2426 | { | |
2427 | penShadow[0] = m_penDarkGrey; | |
2428 | penShadow[1] = m_penHighlight; | |
2429 | penShadow[2] = wxNullPen; | |
2430 | penShadow[3] = m_penBlack; | |
2431 | } | |
2432 | else // normal arrow | |
2433 | { | |
2434 | penShadow[0] = m_penHighlight; | |
2435 | penShadow[1] = m_penBlack; | |
2436 | penShadow[2] = m_penDarkGrey; | |
2437 | penShadow[3] = wxNullPen; | |
2438 | } | |
2439 | ||
2440 | wxCoord middle; | |
2441 | if ( dir == wxUP || dir == wxDOWN ) | |
2442 | { | |
2443 | // horz middle | |
2444 | middle = (rect.GetRight() + rect.GetLeft() + 1) / 2; | |
2445 | } | |
2446 | else // horz arrow | |
2447 | { | |
2448 | middle = (rect.GetTop() + rect.GetBottom() + 1) / 2; | |
2449 | } | |
2450 | ||
2451 | // draw the arrow interior | |
2452 | dc.SetPen(*wxTRANSPARENT_PEN); | |
2453 | dc.SetBrush(wxBrush(colInside, wxSOLID)); | |
2454 | ||
2455 | switch ( dir ) | |
2456 | { | |
2457 | case wxUP: | |
2458 | ptArrow[Point_First].x = rect.GetLeft(); | |
2459 | ptArrow[Point_First].y = rect.GetBottom(); | |
2460 | ptArrow[Point_Second].x = middle; | |
2461 | ptArrow[Point_Second].y = rect.GetTop(); | |
2462 | ptArrow[Point_Third].x = rect.GetRight(); | |
2463 | ptArrow[Point_Third].y = rect.GetBottom(); | |
2464 | break; | |
2465 | ||
2466 | case wxDOWN: | |
2467 | ptArrow[Point_First] = rect.GetPosition(); | |
2468 | ptArrow[Point_Second].x = middle; | |
2469 | ptArrow[Point_Second].y = rect.GetBottom(); | |
2470 | ptArrow[Point_Third].x = rect.GetRight(); | |
2471 | ptArrow[Point_Third].y = rect.GetTop(); | |
2472 | break; | |
2473 | ||
2474 | case wxLEFT: | |
2475 | ptArrow[Point_First].x = rect.GetRight(); | |
2476 | ptArrow[Point_First].y = rect.GetTop(); | |
2477 | ptArrow[Point_Second].x = rect.GetLeft(); | |
2478 | ptArrow[Point_Second].y = middle; | |
2479 | ptArrow[Point_Third].x = rect.GetRight(); | |
2480 | ptArrow[Point_Third].y = rect.GetBottom(); | |
2481 | break; | |
2482 | ||
2483 | case wxRIGHT: | |
2484 | ptArrow[Point_First] = rect.GetPosition(); | |
2485 | ptArrow[Point_Second].x = rect.GetRight(); | |
2486 | ptArrow[Point_Second].y = middle; | |
2487 | ptArrow[Point_Third].x = rect.GetLeft(); | |
2488 | ptArrow[Point_Third].y = rect.GetBottom(); | |
2489 | break; | |
2490 | ||
2491 | default: | |
2492 | wxFAIL_MSG(_T("unknown arrow direction")); | |
2493 | } | |
2494 | ||
2495 | dc.DrawPolygon(WXSIZEOF(ptArrow), ptArrow); | |
2496 | ||
2497 | // draw the arrow border | |
2498 | dc.SetPen(penShadow[0]); | |
2499 | switch ( dir ) | |
2500 | { | |
2501 | case wxUP: | |
2502 | dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]); | |
2503 | dc.DrawPoint(ptArrow[Point_First]); | |
2504 | if ( penShadow[3].Ok() ) | |
2505 | { | |
2506 | dc.SetPen(penShadow[3]); | |
2507 | dc.DrawLine(ptArrow[Point_First].x + 1, ptArrow[Point_First].y, | |
2508 | ptArrow[Point_Second].x, ptArrow[Point_Second].y); | |
2509 | } | |
2510 | dc.SetPen(penShadow[1]); | |
2511 | dc.DrawLine(ptArrow[Point_Second].x + 1, ptArrow[Point_Second].y + 1, | |
2512 | ptArrow[Point_Third].x, ptArrow[Point_Third].y); | |
2513 | dc.DrawPoint(ptArrow[Point_Third]); | |
2514 | dc.DrawLine(ptArrow[Point_Third].x - 2, ptArrow[Point_Third].y, | |
2515 | ptArrow[Point_First].x + 1, ptArrow[Point_First].y); | |
2516 | if ( penShadow[2].Ok() ) | |
2517 | { | |
2518 | dc.SetPen(penShadow[2]); | |
2519 | dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y, | |
2520 | ptArrow[Point_Second].x, ptArrow[Point_Second].y + 1); | |
2521 | dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y - 1, | |
2522 | ptArrow[Point_First].x + 2, ptArrow[Point_First].y - 1); | |
2523 | } | |
2524 | break; | |
2525 | ||
2526 | case wxDOWN: | |
2527 | dc.DrawLine(ptArrow[Point_First], ptArrow[Point_Second]); | |
2528 | dc.DrawLine(ptArrow[Point_First].x + 2, ptArrow[Point_First].y, | |
2529 | ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y); | |
2530 | if ( penShadow[2].Ok() ) | |
2531 | { | |
2532 | dc.SetPen(penShadow[2]); | |
2533 | dc.DrawLine(ptArrow[Point_Second].x, ptArrow[Point_Second].y - 1, | |
2534 | ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y - 1); | |
2535 | } | |
2536 | dc.SetPen(penShadow[1]); | |
2537 | dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_Third]); | |
2538 | dc.DrawPoint(ptArrow[Point_Third]); | |
2539 | break; | |
2540 | ||
2541 | case wxLEFT: | |
2542 | dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]); | |
2543 | dc.DrawPoint(ptArrow[Point_First]); | |
2544 | if ( penShadow[2].Ok() ) | |
2545 | { | |
2546 | dc.SetPen(penShadow[2]); | |
2547 | dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y, | |
2548 | ptArrow[Point_First].x - 1, ptArrow[Point_First].y + 2); | |
2549 | dc.DrawLine(ptArrow[Point_Third].x, ptArrow[Point_Third].y, | |
2550 | ptArrow[Point_Second].x + 2, ptArrow[Point_Second].y + 1); | |
2551 | } | |
2552 | dc.SetPen(penShadow[1]); | |
2553 | dc.DrawLine(ptArrow[Point_Third].x, ptArrow[Point_Third].y, | |
2554 | ptArrow[Point_First].x, ptArrow[Point_First].y + 1); | |
2555 | dc.DrawLine(ptArrow[Point_Second].x + 1, ptArrow[Point_Second].y + 1, | |
2556 | ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y); | |
2557 | break; | |
2558 | ||
2559 | case wxRIGHT: | |
2560 | dc.DrawLine(ptArrow[Point_First], ptArrow[Point_Third]); | |
2561 | dc.DrawLine(ptArrow[Point_First].x + 2, ptArrow[Point_First].y + 1, | |
2562 | ptArrow[Point_Second].x, ptArrow[Point_Second].y); | |
2563 | dc.SetPen(penShadow[1]); | |
2564 | dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_Third]); | |
2565 | dc.DrawPoint(ptArrow[Point_Third]); | |
2566 | break; | |
2567 | ||
2568 | default: | |
2569 | wxFAIL_MSG(_T("unknown arrow direction")); | |
2570 | return; | |
2571 | } | |
2572 | } | |
2573 | ||
2574 | void wxGTKRenderer::DrawThumbBorder(wxDC& dc, | |
2575 | wxRect *rect, | |
2576 | wxOrientation orient) | |
2577 | { | |
2578 | if ( orient == wxVERTICAL ) | |
2579 | { | |
2580 | DrawAntiShadedRectSide(dc, *rect, m_penDarkGrey, m_penHighlight, | |
2581 | wxLEFT); | |
2582 | DrawAntiShadedRectSide(dc, *rect, m_penDarkGrey, m_penHighlight, | |
2583 | wxRIGHT); | |
2584 | rect->Inflate(-1, 0); | |
2585 | ||
2586 | DrawAntiShadedRectSide(dc, *rect, m_penBlack, m_penGrey, | |
2587 | wxLEFT); | |
2588 | DrawAntiShadedRectSide(dc, *rect, m_penBlack, m_penGrey, | |
2589 | wxRIGHT); | |
2590 | rect->Inflate(-1, 0); | |
2591 | } | |
2592 | else | |
2593 | { | |
2594 | DrawAntiShadedRectSide(dc, *rect, m_penDarkGrey, m_penHighlight, | |
2595 | wxUP); | |
2596 | DrawAntiShadedRectSide(dc, *rect, m_penDarkGrey, m_penHighlight, | |
2597 | wxDOWN); | |
2598 | rect->Inflate(0, -1); | |
2599 | ||
2600 | DrawAntiShadedRectSide(dc, *rect, m_penBlack, m_penGrey, | |
2601 | wxUP); | |
2602 | DrawAntiShadedRectSide(dc, *rect, m_penBlack, m_penGrey, | |
2603 | wxDOWN); | |
2604 | rect->Inflate(0, -1); | |
2605 | } | |
2606 | } | |
2607 | ||
2608 | void wxGTKRenderer::DrawScrollbarThumb(wxDC& dc, | |
2609 | wxOrientation orient, | |
2610 | const wxRect& rect, | |
2611 | int flags) | |
2612 | { | |
2613 | // the thumb is never pressed never has focus border under GTK and the | |
2614 | // scrollbar background never changes at all | |
2615 | int flagsThumb = flags & ~(wxCONTROL_PRESSED | wxCONTROL_FOCUSED); | |
2616 | ||
2617 | // we don't want the border in the direction of the scrollbar movement | |
2618 | wxRect rectThumb = rect; | |
2619 | DrawThumbBorder(dc, &rectThumb, orient); | |
2620 | ||
2621 | DrawButtonBorder(dc, rectThumb, flagsThumb, &rectThumb); | |
2622 | DrawBackground(dc, wxNullColour, rectThumb, flagsThumb); | |
2623 | } | |
2624 | ||
2625 | void wxGTKRenderer::DrawScrollbarShaft(wxDC& dc, | |
2626 | wxOrientation orient, | |
2627 | const wxRect& rect, | |
2628 | int flags) | |
2629 | { | |
2630 | wxRect rectBar = rect; | |
2631 | DrawThumbBorder(dc, &rectBar, orient); | |
2632 | DoDrawBackground(dc, wxSCHEME_COLOUR(m_scheme, SCROLLBAR), rectBar); | |
2633 | } | |
2634 | ||
2635 | void wxGTKRenderer::DrawScrollCorner(wxDC& dc, const wxRect& rect) | |
2636 | { | |
2637 | DoDrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rect); | |
2638 | } | |
2639 | ||
2640 | wxRect wxGTKRenderer::GetScrollbarRect(const wxScrollBar *scrollbar, | |
2641 | wxScrollBar::Element elem, | |
2642 | int thumbPos) const | |
2643 | { | |
2644 | // as GTK scrollbars can't be disabled, it makes no sense to remove the | |
2645 | // thumb for a scrollbar with range 0 - instead, make it fill the entire | |
2646 | // scrollbar shaft | |
2647 | if ( (elem == wxScrollBar::Element_Thumb) && !scrollbar->GetRange() ) | |
2648 | { | |
2649 | elem = wxScrollBar::Element_Bar_2; | |
2650 | } | |
2651 | ||
2652 | return StandardGetScrollbarRect(scrollbar, elem, | |
2653 | thumbPos, | |
2654 | GetScrollbarArrowSize(scrollbar)); | |
2655 | } | |
2656 | ||
2657 | wxCoord wxGTKRenderer::GetScrollbarSize(const wxScrollBar *scrollbar) | |
2658 | { | |
2659 | return StandardScrollBarSize(scrollbar, GetScrollbarArrowSize(scrollbar)); | |
2660 | } | |
2661 | ||
2662 | wxHitTest wxGTKRenderer::HitTestScrollbar(const wxScrollBar *scrollbar, | |
2663 | const wxPoint& pt) const | |
2664 | { | |
2665 | return StandardHitTestScrollbar(scrollbar, pt, | |
2666 | GetScrollbarArrowSize(scrollbar)); | |
2667 | } | |
2668 | ||
2669 | wxCoord wxGTKRenderer::ScrollbarToPixel(const wxScrollBar *scrollbar, | |
2670 | int thumbPos) | |
2671 | { | |
2672 | return StandardScrollbarToPixel(scrollbar, thumbPos, | |
2673 | GetScrollbarArrowSize(scrollbar)); | |
2674 | } | |
2675 | ||
2676 | int wxGTKRenderer::PixelToScrollbar(const wxScrollBar *scrollbar, | |
2677 | wxCoord coord) | |
2678 | { | |
2679 | return StandardPixelToScrollbar(scrollbar, coord, | |
2680 | GetScrollbarArrowSize(scrollbar)); | |
2681 | } | |
2682 | ||
2683 | // ---------------------------------------------------------------------------- | |
2684 | // size adjustments | |
2685 | // ---------------------------------------------------------------------------- | |
2686 | ||
2687 | void wxGTKRenderer::AdjustSize(wxSize *size, const wxWindow *window) | |
2688 | { | |
e4606ed9 VZ |
2689 | #if wxUSE_BMPBUTTON |
2690 | if ( wxDynamicCast(window, wxBitmapButton) ) | |
2691 | { | |
2692 | size->x += 4; | |
2693 | size->y += 4; | |
2694 | } else | |
2695 | #endif // wxUSE_BMPBUTTON | |
2696 | #if wxUSE_BUTTON | |
1e6feb95 VZ |
2697 | if ( wxDynamicCast(window, wxButton) ) |
2698 | { | |
1b465102 VZ |
2699 | if ( !(window->GetWindowStyle() & wxBU_EXACTFIT) ) |
2700 | { | |
2701 | // TODO: this is ad hoc... | |
2702 | size->x += 3*window->GetCharWidth(); | |
2703 | wxCoord minBtnHeight = 18; | |
2704 | if ( size->y < minBtnHeight ) | |
2705 | size->y = minBtnHeight; | |
2706 | ||
2707 | // button border width | |
2708 | size->y += 4; | |
2709 | } | |
e4606ed9 | 2710 | } else |
ee1e43a7 | 2711 | #endif //wxUSE_BUTTON |
e4606ed9 | 2712 | if ( wxDynamicCast(window, wxScrollBar) ) |
1e6feb95 VZ |
2713 | { |
2714 | // we only set the width of vert scrollbars and height of the | |
2715 | // horizontal ones | |
2716 | if ( window->GetWindowStyle() & wxSB_HORIZONTAL ) | |
2717 | size->y = m_sizeScrollbarArrow.x; | |
2718 | else | |
2719 | size->x = m_sizeScrollbarArrow.x; | |
2720 | } | |
2721 | else | |
2722 | { | |
2723 | // take into account the border width | |
2724 | wxRect rectBorder = GetBorderDimensions(window->GetBorder()); | |
2725 | size->x += rectBorder.x + rectBorder.width; | |
2726 | size->y += rectBorder.y + rectBorder.height; | |
2727 | } | |
2728 | } | |
2729 | ||
24a23c35 VS |
2730 | // ---------------------------------------------------------------------------- |
2731 | // top level windows | |
2732 | // ---------------------------------------------------------------------------- | |
2733 | ||
2734 | void wxGTKRenderer::DrawFrameTitleBar(wxDC& dc, | |
2735 | const wxRect& rect, | |
2736 | const wxString& title, | |
2737 | const wxIcon& icon, | |
2738 | int flags, | |
813edf09 VS |
2739 | int specialButton, |
2740 | int specialButtonFlag) | |
24a23c35 VS |
2741 | { |
2742 | } | |
2743 | ||
2744 | void wxGTKRenderer::DrawFrameBorder(wxDC& dc, | |
2745 | const wxRect& rect, | |
2746 | int flags) | |
2747 | { | |
2748 | } | |
2749 | ||
2750 | void wxGTKRenderer::DrawFrameBackground(wxDC& dc, | |
2751 | const wxRect& rect, | |
2752 | int flags) | |
2753 | { | |
2754 | } | |
2755 | ||
2756 | void wxGTKRenderer::DrawFrameTitle(wxDC& dc, | |
2757 | const wxRect& rect, | |
2758 | const wxString& title, | |
2759 | int flags) | |
2760 | { | |
2761 | } | |
2762 | ||
2763 | void wxGTKRenderer::DrawFrameIcon(wxDC& dc, | |
2764 | const wxRect& rect, | |
2765 | const wxIcon& icon, | |
2766 | int flags) | |
2767 | { | |
2768 | } | |
2769 | ||
2770 | void wxGTKRenderer::DrawFrameButton(wxDC& dc, | |
2771 | wxCoord x, wxCoord y, | |
2772 | int button, | |
2e9f62da | 2773 | int flags) |
24a23c35 VS |
2774 | { |
2775 | } | |
2776 | ||
2777 | wxRect wxGTKRenderer::GetFrameClientArea(const wxRect& rect, int flags) const | |
2778 | { | |
2779 | return rect; | |
2780 | } | |
2781 | ||
2782 | wxSize wxGTKRenderer::GetFrameTotalSize(const wxSize& clientSize, int flags) const | |
2783 | { | |
2784 | return clientSize; | |
2785 | } | |
2786 | ||
e7dda1ff VS |
2787 | wxSize wxGTKRenderer::GetFrameMinSize(int flags) const |
2788 | { | |
2789 | return wxSize(0,0); | |
2790 | } | |
2791 | ||
24a23c35 VS |
2792 | wxSize wxGTKRenderer::GetFrameIconSize() const |
2793 | { | |
2794 | return wxSize(-1, -1); | |
2795 | } | |
2796 | ||
813edf09 VS |
2797 | int wxGTKRenderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int flags) const |
2798 | { | |
2799 | return wxHT_TOPLEVEL_CLIENT_AREA; | |
2800 | } | |
2801 | ||
24a23c35 | 2802 | |
63f06c22 VS |
2803 | // ---------------------------------------------------------------------------- |
2804 | // standard icons | |
2805 | // ---------------------------------------------------------------------------- | |
2806 | ||
2807 | static char *error_xpm[] = { | |
2808 | /* columns rows colors chars-per-pixel */ | |
2809 | "48 48 537 2", | |
2810 | " c Gray0", | |
2811 | ". c #000001010101", | |
2812 | "X c #010101010101", | |
2813 | "o c #010102020202", | |
2814 | "O c #020202020202", | |
2815 | "+ c #020203030303", | |
2816 | "@ c #030302020202", | |
2817 | "# c Gray1", | |
2818 | "$ c #020204040404", | |
2819 | "% c #030304040404", | |
2820 | "& c #070703030202", | |
2821 | "* c #040404040404", | |
2822 | "= c #040405050505", | |
2823 | "- c Gray2", | |
2824 | "; c #050507070707", | |
2825 | ": c #060606060606", | |
2826 | "> c #060607070707", | |
2827 | ", c #070707070707", | |
2828 | "< c #070709090909", | |
2829 | "1 c #0c0c04040303", | |
2830 | "2 c #0d0d04040404", | |
2831 | "3 c #0d0d05050404", | |
2832 | "4 c Gray3", | |
2833 | "5 c #080809090909", | |
2834 | "6 c #090909090909", | |
2835 | "7 c #0b0b0b0b0b0b", | |
2836 | "8 c #0a0a0d0d0d0d", | |
2837 | "9 c #0b0b0d0d0d0d", | |
2838 | "0 c #0c0c0c0c0c0c", | |
2839 | "q c Gray5", | |
2840 | "w c #0d0d0f0f1010", | |
2841 | "e c #101006060505", | |
2842 | "r c #141404040303", | |
2843 | "t c #141407070606", | |
2844 | "y c #171707070606", | |
2845 | "u c #1d1d09090707", | |
2846 | "i c #181809090808", | |
2847 | "p c #1d1d09090808", | |
2848 | "a c #1e1e0a0a0808", | |
2849 | "s c #1e1e0b0b0909", | |
2850 | "d c #101010101010", | |
2851 | "f c #101011111212", | |
2852 | "g c Gray7", | |
2853 | "h c #131313131313", | |
2854 | "j c Gray9", | |
2855 | "k c #181818181818", | |
2856 | "l c #191919191919", | |
2857 | "z c Gray11", | |
2858 | "x c #1d1d1d1d1d1d", | |
2859 | "c c Gray12", | |
2860 | "v c #24240b0b0a0a", | |
2861 | "b c #27270d0d0b0b", | |
2862 | "n c #2b2b0e0e0c0c", | |
2863 | "m c #2d2d0e0e0b0b", | |
2864 | "M c #30300e0e0b0b", | |
2865 | "N c #33330d0d0909", | |
2866 | "B c #3a3a0f0f0b0b", | |
2867 | "V c #333310100e0e", | |
2868 | "C c #373710100d0d", | |
2869 | "Z c #373711110e0e", | |
2870 | "A c #363612120f0f", | |
2871 | "S c #3d3d13130f0f", | |
2872 | "D c #363612121010", | |
2873 | "F c Gray14", | |
2874 | "G c #252525252525", | |
2875 | "H c #2a2a2a2a2a2a", | |
2876 | "J c Gray18", | |
2877 | "K c #323232323232", | |
2878 | "L c Gray20", | |
2879 | "P c Gray22", | |
2880 | "I c #3f3f3f3f3f3f", | |
2881 | "U c #414113130e0e", | |
2882 | "Y c #414113130f0f", | |
2883 | "T c #404013131010", | |
2884 | "R c #404014141111", | |
2885 | "E c #404015151212", | |
2886 | "W c #4d4d17171212", | |
2887 | "Q c #4e4e18181313", | |
2888 | "! c #4e4e18181414", | |
2889 | "~ c #4e4e19191515", | |
2890 | "^ c #4e4e1a1a1616", | |
2891 | "/ c #57571b1b1515", | |
2892 | "( c #595917171010", | |
2893 | ") c #5b5b1a1a1313", | |
2894 | "_ c #58581b1b1616", | |
2895 | "` c #58581c1c1717", | |
2896 | "' c #5c5c1e1e1a1a", | |
2897 | "] c #5c5c1f1f1b1b", | |
2898 | "[ c #6e6e19190f0f", | |
2899 | "{ c #67671c1c1616", | |
2900 | "} c #6b6b1b1b1212", | |
2901 | "| c #68681e1e1717", | |
2902 | " . c #6e6e1e1e1616", | |
2903 | ".. c #79791e1e1515", | |
2904 | "X. c #666622221d1d", | |
2905 | "o. c #6b6b24241e1e", | |
2906 | "O. c #6c6c22221d1d", | |
2907 | "+. c #6d6d24241f1f", | |
2908 | "@. c #7d7d23231c1c", | |
2909 | "#. c #727226262020", | |
2910 | "$. c #757526262020", | |
2911 | "%. c #777728282222", | |
2912 | "&. c #7f7f28282121", | |
2913 | "*. c #484848484848", | |
2914 | "=. c Gray33", | |
2915 | "-. c #555555555555", | |
2916 | ";. c #656565656565", | |
2917 | ":. c Gray", | |
2918 | ">. c #94941f1f1212", | |
2919 | ",. c #96961f1f1111", | |
2920 | "<. c #98981f1f1111", | |
2921 | "1. c #818126261e1e", | |
2922 | "2. c #858523231919", | |
2923 | "3. c #858525251c1c", | |
2924 | "4. c #878728281e1e", | |
2925 | "5. c #898921211717", | |
2926 | "6. c #8a8a22221616", | |
2927 | "7. c #8b8b25251c1c", | |
2928 | "8. c #8c8c27271d1d", | |
2929 | "9. c #888828281f1f", | |
2930 | "0. c #8a8a29291f1f", | |
2931 | "q. c #959520201111", | |
2932 | "w. c #969620201111", | |
2933 | "e. c #949424241717", | |
2934 | "r. c #969624241717", | |
2935 | "t. c #909024241919", | |
2936 | "y. c #929225251919", | |
2937 | "u. c #929225251b1b", | |
2938 | "i. c #959526261b1b", | |
2939 | "p. c #969624241818", | |
2940 | "a. c #90902a2a1f1f", | |
2941 | "s. c #969629291f1f", | |
2942 | "d. c #9b9b20201313", | |
2943 | "f. c #999924241616", | |
2944 | "g. c #9c9c21211212", | |
2945 | "h. c #9f9f21211212", | |
2946 | "j. c #9d9d22221414", | |
2947 | "k. c #9d9d23231414", | |
2948 | "l. c #9c9c23231616", | |
2949 | "z. c #989827271b1b", | |
2950 | "x. c #999927271b1b", | |
2951 | "c. c #9a9a26261b1b", | |
2952 | "v. c #989827271c1c", | |
2953 | "b. c #9c9c25251818", | |
2954 | "n. c #9c9c27271b1b", | |
2955 | "m. c #9d9d27271b1b", | |
2956 | "M. c #999928281c1c", | |
2957 | "N. c #999929291e1e", | |
2958 | "B. c #9b9b28281c1c", | |
2959 | "V. c #9b9b28281d1d", | |
2960 | "C. c #9a9a29291e1e", | |
2961 | "Z. c #9a9a2a2a1e1e", | |
2962 | "A. c #9a9a2b2b1f1f", | |
2963 | "S. c #9b9b2a2a1f1f", | |
2964 | "D. c #9c9c28281c1c", | |
2965 | "F. c #9e9e29291f1f", | |
2966 | "G. c #9f9f29291e1e", | |
2967 | "H. c #9e9e2a2a1e1e", | |
2968 | "J. c #83832b2b2424", | |
2969 | "K. c #83832c2c2525", | |
2970 | "L. c #84842a2a2424", | |
2971 | "P. c #8b8b29292121", | |
2972 | "I. c #89892b2b2424", | |
2973 | "U. c #8b8b2c2c2626", | |
2974 | "Y. c #8f8f2a2a2222", | |
2975 | "T. c #8f8f2b2b2323", | |
2976 | "R. c #8d8d2e2e2828", | |
2977 | "E. c #8f8f2f2f2828", | |
2978 | "W. c #8f8f38383232", | |
2979 | "Q. c #919129292020", | |
2980 | "!. c #90902b2b2222", | |
2981 | "~. c #91912d2d2525", | |
2982 | "^. c #90902d2d2626", | |
2983 | "/. c #969629292020", | |
2984 | "(. c #95952c2c2323", | |
2985 | "). c #97972c2c2222", | |
2986 | "_. c #94942d2d2525", | |
2987 | "`. c #94942e2e2626", | |
2988 | "'. c #97972d2d2525", | |
2989 | "]. c #96962e2e2424", | |
2990 | "[. c #97972e2e2626", | |
2991 | "{. c #97972f2f2727", | |
2992 | "}. c #99992b2b2020", | |
2993 | "|. c #99992c2c2121", | |
2994 | " X c #98982d2d2323", | |
2995 | ".X c #99992c2c2222", | |
2996 | "XX c #9b9b2c2c2121", | |
2997 | "oX c #9a9a2c2c2323", | |
2998 | "OX c #98982d2d2424", | |
2999 | "+X c #98982e2e2525", | |
3000 | "@X c #98982e2e2626", | |
3001 | "#X c #9d9d2b2b2121", | |
3002 | "$X c #9e9e2a2a2020", | |
3003 | "%X c #9c9c2c2c2121", | |
3004 | "&X c #9c9c2d2d2323", | |
3005 | "*X c #9d9d2e2e2323", | |
3006 | "=X c #9f9f2d2d2323", | |
3007 | "-X c #9e9e2e2e2020", | |
3008 | ";X c #9f9f2e2e2323", | |
3009 | ":X c #9c9c2d2d2424", | |
3010 | ">X c #9d9d2f2f2525", | |
3011 | ",X c #9c9c2f2f2626", | |
3012 | "<X c #9d9d2f2f2626", | |
3013 | "1X c #9f9f2e2e2424", | |
3014 | "2X c #9f9f2f2f2525", | |
3015 | "3X c #9f9f2f2f2626", | |
3016 | "4X c #939330302828", | |
3017 | "5X c #909036362f2f", | |
3018 | "6X c #949430302929", | |
3019 | "7X c #959530302828", | |
3020 | "8X c #949430302a2a", | |
3021 | "9X c #969630302828", | |
3022 | "0X c #969630302929", | |
3023 | "qX c #9d9d30302727", | |
3024 | "wX c #9e9e30302626", | |
3025 | "eX c #9e9e30302727", | |
3026 | "rX c #9e9e31312727", | |
3027 | "tX c #9f9f30302626", | |
3028 | "yX c #989831312929", | |
3029 | "uX c #9a9a30302929", | |
3030 | "iX c #9a9a31312a2a", | |
3031 | "pX c #9a9a32322a2a", | |
3032 | "aX c #9d9d31312929", | |
3033 | "sX c #9d9d32322929", | |
3034 | "dX c #9c9c32322a2a", | |
3035 | "fX c #9d9d32322a2a", | |
3036 | "gX c #9d9d33332a2a", | |
3037 | "hX c #9d9d33332b2b", | |
3038 | "jX c #9e9e31312828", | |
3039 | "kX c #9e9e31312929", | |
3040 | "lX c #9f9f31312828", | |
3041 | "zX c #9e9e32322929", | |
3042 | "xX c #9f9f32322a2a", | |
3043 | "cX c #9f9f33332a2a", | |
3044 | "vX c #9f9f33332b2b", | |
3045 | "bX c #9d9d3a3a3232", | |
3046 | "nX c #9f9f39393030", | |
3047 | "mX c #9f9f3e3e3636", | |
3048 | "MX c #a3a323231313", | |
3049 | "NX c #a0a022221414", | |
3050 | "BX c #a2a223231414", | |
3051 | "VX c #a0a024241616", | |
3052 | "CX c #a4a422221212", | |
3053 | "ZX c #a4a423231313", | |
3054 | "AX c #a5a522221212", | |
3055 | "SX c #a6a622221212", | |
3056 | "DX c #a6a622221313", | |
3057 | "FX c #a7a722221212", | |
3058 | "GX c #a4a424241515", | |
3059 | "HX c #a5a525251616", | |
3060 | "JX c #a7a724241414", | |
3061 | "KX c #a7a724241515", | |
3062 | "LX c #a6a625251717", | |
3063 | "PX c #a7a725251616", | |
3064 | "IX c #a7a725251717", | |
3065 | "UX c #a6a626261717", | |
3066 | "YX c #a0a025251818", | |
3067 | "TX c #a3a325251818", | |
3068 | "RX c #a2a226261818", | |
3069 | "EX c #a3a326261818", | |
3070 | "WX c #a2a227271a1a", | |
3071 | "QX c #a2a227271b1b", | |
3072 | "!X c #a3a327271a1a", | |
3073 | "~X c #a5a527271919", | |
3074 | "^X c #a5a527271a1a", | |
3075 | "/X c #a6a626261818", | |
3076 | "(X c #a6a627271818", | |
3077 | ")X c #a6a627271919", | |
3078 | "_X c #a3a328281b1b", | |
3079 | "`X c #a1a128281c1c", | |
3080 | "'X c #a1a129291d1d", | |
3081 | "]X c #a1a129291e1e", | |
3082 | "[X c #a0a02a2a1f1f", | |
3083 | "{X c #a1a12a2a1f1f", | |
3084 | "}X c #a2a228281c1c", | |
3085 | "|X c #a2a229291c1c", | |
3086 | " o c #a3a32b2b1f1f", | |
3087 | ".o c #a5a528281a1a", | |
3088 | "Xo c #a5a528281b1b", | |
3089 | "oo c #a5a529291b1b", | |
3090 | "Oo c #a4a429291c1c", | |
3091 | "+o c #a4a429291d1d", | |
3092 | "@o c #a5a529291c1c", | |
3093 | "#o c #a5a529291d1d", | |
3094 | "$o c #a4a42a2a1d1d", | |
3095 | "%o c #a4a42a2a1e1e", | |
3096 | "&o c #a4a42b2b1e1e", | |
3097 | "*o c #a4a42b2b1f1f", | |
3098 | "=o c #a9a921211010", | |
3099 | "-o c #a9a921211111", | |
3100 | ";o c #a8a822221111", | |
3101 | ":o c #a9a922221111", | |
3102 | ">o c #a8a822221212", | |
3103 | ",o c #a8a823231212", | |
3104 | "<o c #a8a823231313", | |
3105 | "1o c #abab23231313", | |
3106 | "2o c #a8a823231414", | |
3107 | "3o c #a9a924241313", | |
3108 | "4o c #a8a824241414", | |
3109 | "5o c #acac22221111", | |
3110 | "6o c #aeae22221212", | |
3111 | "7o c #aeae23231212", | |
3112 | "8o c #afaf24241313", | |
3113 | "9o c #a9a927271818", | |
3114 | "0o c #abab27271919", | |
3115 | "qo c #a8a829291b1b", | |
3116 | "wo c #abab28281a1a", | |
3117 | "eo c #a8a829291c1c", | |
3118 | "ro c #a8a82a2a1d1d", | |
3119 | "to c #abab29291c1c", | |
3120 | "yo c #adad29291b1b", | |
3121 | "uo c #adad2a2a1b1b", | |
3122 | "io c #aeae28281a1a", | |
3123 | "po c #adad2b2b1d1d", | |
3124 | "ao c #b1b123231111", | |
3125 | "so c #b3b323231010", | |
3126 | "do c #b3b323231111", | |
3127 | "fo c #b1b126261515", | |
3128 | "go c #b1b126261717", | |
3129 | "ho c #b2b225251414", | |
3130 | "jo c #b6b624241212", | |
3131 | "ko c #b5b525251414", | |
3132 | "lo c #b5b526261515", | |
3133 | "zo c #b4b427271717", | |
3134 | "xo c #b1b127271818", | |
3135 | "co c #b3b32a2a1a1a", | |
3136 | "vo c #b6b628281919", | |
3137 | "bo c #b7b728281919", | |
3138 | "no c #b5b52a2a1c1c", | |
3139 | "mo c #b4b42c2c1d1d", | |
3140 | "Mo c #b9b923231111", | |
3141 | "No c #bbbb25251313", | |
3142 | "Bo c #baba26261414", | |
3143 | "Vo c #bebe25251212", | |
3144 | "Co c #bdbd27271616", | |
3145 | "Zo c #baba2b2b1a1a", | |
3146 | "Ao c #bcbc2a2a1818", | |
3147 | "So c #bebe2b2b1b1b", | |
3148 | "Do c #bdbd2c2c1d1d", | |
3149 | "Fo c #a0a02a2a2020", | |
3150 | "Go c #a0a02b2b2020", | |
3151 | "Ho c #a2a22b2b2020", | |
3152 | "Jo c #a0a02c2c2020", | |
3153 | "Ko c #a0a02c2c2121", | |
3154 | "Lo c #a0a02d2d2222", | |
3155 | "Po c #a0a02d2d2323", | |
3156 | "Io c #a1a12d2d2222", | |
3157 | "Uo c #a0a02e2e2323", | |
3158 | "Yo c #a1a12f2f2222", | |
3159 | "To c #a2a22d2d2121", | |
3160 | "Ro c #a3a32c2c2020", | |
3161 | "Eo c #a3a32c2c2121", | |
3162 | "Wo c #a3a32d2d2121", | |
3163 | "Qo c #a2a22d2d2222", | |
3164 | "!o c #a2a22e2e2323", | |
3165 | "~o c #a0a02e2e2424", | |
3166 | "^o c #a0a02f2f2525", | |
3167 | "/o c #a1a12f2f2424", | |
3168 | "(o c #a1a12f2f2525", | |
3169 | ")o c #a2a22e2e2424", | |
3170 | "_o c #a2a22f2f2424", | |
3171 | "`o c #a9a92f2f2020", | |
3172 | "'o c #aaaa2f2f2020", | |
3173 | "]o c #a0a031312727", | |
3174 | "[o c #a1a130302626", | |
3175 | "{o c #a1a130302727", | |
3176 | "}o c #a0a031312828", | |
3177 | "|o c #a0a032322929", | |
3178 | " O c #a0a032322a2a", | |
3179 | ".O c #a1a137372d2d", | |
3180 | "XO c #a2a236362c2c", | |
3181 | "oO c #a6a636362b2b", | |
3182 | "OO c #a3a338382e2e", | |
3183 | "+O c #a7a739392f2f", | |
3184 | "@O c #a7a73a3a2f2f", | |
3185 | "#O c #abab32322424", | |
3186 | "$O c #abab32322525", | |
3187 | "%O c #aaaa33332626", | |
3188 | "&O c #aaaa33332727", | |
3189 | "*O c #abab33332626", | |
3190 | "=O c #aaaa34342727", | |
3191 | "-O c #acac30302121", | |
3192 | ";O c #acac30302222", | |
3193 | ":O c #acac31312323", | |
3194 | ">O c #a9a935352929", | |
3195 | ",O c #a9a936362a2a", | |
3196 | "<O c #a9a936362b2b", | |
3197 | "1O c #a9a937372b2b", | |
3198 | "2O c #aaaa34342828", | |
3199 | "3O c #aaaa35352929", | |
3200 | "4O c #a8a837372c2c", | |
3201 | "5O c #a9a937372c2c", | |
3202 | "6O c #a8a838382d2d", | |
3203 | "7O c #a8a838382e2e", | |
3204 | "8O c #a8a839392e2e", | |
3205 | "9O c #a9a93f3f2f2f", | |
3206 | "0O c #a2a23b3b3232", | |
3207 | "qO c #a2a23d3d3535", | |
3208 | "wO c #a2a23e3e3636", | |
3209 | "eO c #a6a63b3b3131", | |
3210 | "rO c #a5a53d3d3434", | |
3211 | "tO c #a5a53e3e3535", | |
3212 | "yO c #afaf3f3f3333", | |
3213 | "uO c #c3c325251212", | |
3214 | "iO c #c3c326261313", | |
3215 | "pO c #c3c327271414", | |
3216 | "aO c #c7c728281616", | |
3217 | "sO c #c6c62c2c1a1a", | |
3218 | "dO c #c7c72e2e1d1d", | |
3219 | "fO c #cdcd2e2e1c1c", | |
3220 | "gO c #cfcf2f2f1c1c", | |
3221 | "hO c #d0d028281313", | |
3222 | "jO c #d3d329291414", | |
3223 | "kO c #d5d529291313", | |
3224 | "lO c #d0d02e2e1b1b", | |
3225 | "zO c #d8d829291414", | |
3226 | "xO c #dddd2a2a1414", | |
3227 | "cO c #dddd2d2d1717", | |
3228 | "vO c #dfdf30301c1c", | |
3229 | "bO c #e2e22b2b1515", | |
3230 | "nO c #ebeb2d2d1414", | |
3231 | "mO c #eded2e2e1717", | |
3232 | "MO c #e4e431311b1b", | |
3233 | "NO c #e9e930301a1a", | |
3234 | "BO c #ebeb31311b1b", | |
3235 | "VO c #e8e833331d1d", | |
3236 | "CO c #e9e932321c1c", | |
3237 | "ZO c #ebeb33331e1e", | |
3238 | "AO c #eeee30301a1a", | |
3239 | "SO c #eeee32321b1b", | |
3240 | "DO c #eaea3a3a1b1b", | |
3241 | "FO c #f1f132321b1b", | |
3242 | "GO c #f3f331311919", | |
3243 | "HO c #f7f732321b1b", | |
3244 | "JO c #f6f636361b1b", | |
3245 | "KO c #f6f638381c1c", | |
3246 | "LO c #fcfc30301717", | |
3247 | "PO c #fefe33331717", | |
3248 | "IO c #ffff32321616", | |
3249 | "UO c #fdfd35351717", | |
3250 | "YO c #ffff34341717", | |
3251 | "TO c #fafa30301919", | |
3252 | "RO c #fafa31311818", | |
3253 | "EO c #fafa36361919", | |
3254 | "WO c #fdfd33331919", | |
3255 | "QO c #ffff33331818", | |
3256 | "!O c #fdfd35351818", | |
3257 | "~O c #fafa3c3c1a1a", | |
3258 | "^O c #fafa3d3d1a1a", | |
3259 | "/O c #fbfb3d3d1d1d", | |
3260 | "(O c #fdfd38381919", | |
3261 | ")O c #fcfc39391a1a", | |
3262 | "_O c #ffff3a3a1a1a", | |
3263 | "`O c #ffff3f3f1b1b", | |
3264 | "'O c #ffff3c3c1d1d", | |
3265 | "]O c #ffff3e3e1d1d", | |
3266 | "[O c #c1c178782e2e", | |
3267 | "{O c #ffff40401e1e", | |
3268 | "}O c #d4d48d8d1d1d", | |
3269 | "|O c #cdcd86862222", | |
3270 | " + c #c1c181813838", | |
3271 | ".+ c #c7c79d9d3737", | |
3272 | "X+ c #c5c59c9c3939", | |
3273 | "o+ c #c4c49c9c3a3a", | |
3274 | "O+ c #c8c89b9b3030", | |
3275 | "++ c #cbcb9d9d3131", | |
3276 | "@+ c #caca9e9e3434", | |
3277 | "#+ c #cccc9d9d3030", | |
3278 | "$+ c #cccc9f9f3232", | |
3279 | "%+ c #cbcba0a03737", | |
3280 | "&+ c #cfcfa3a33737", | |
3281 | "*+ c #cfcfa3a33838", | |
3282 | "=+ c #cfcfa5a53e3e", | |
3283 | "-+ c #d5d5a8a82e2e", | |
3284 | ";+ c #dadaa8a82f2f", | |
3285 | ":+ c #dadaacac2f2f", | |
3286 | ">+ c #dbdbacac2e2e", | |
3287 | ",+ c #dddda8a82a2a", | |
3288 | "<+ c #ddddacac2a2a", | |
3289 | "1+ c #dedeadad2929", | |
3290 | "2+ c #dfdfaeae2828", | |
3291 | "3+ c #dcdcadad2d2d", | |
3292 | "4+ c #d0d0a1a13131", | |
3293 | "5+ c #d1d1a2a23030", | |
3294 | "6+ c #d1d1a3a33333", | |
3295 | "7+ c #d2d2a3a33232", | |
3296 | "8+ c #d3d3a3a33232", | |
3297 | "9+ c #d3d3a4a43333", | |
3298 | "0+ c #d1d1a4a43636", | |
3299 | "q+ c #d1d1a4a43737", | |
3300 | "w+ c #d2d2a4a43535", | |
3301 | "e+ c #d2d2a4a43636", | |
3302 | "r+ c #d5d5a5a53333", | |
3303 | "t+ c #d5d5a6a63434", | |
3304 | "y+ c #d4d4a6a63737", | |
3305 | "u+ c #d6d6a7a73535", | |
3306 | "i+ c #d7d7a7a73434", | |
3307 | "p+ c #d2d2a5a53939", | |
3308 | "a+ c #d3d3a6a63838", | |
3309 | "s+ c #d3d3a6a63a3a", | |
3310 | "d+ c #d0d0a5a53d3d", | |
3311 | "f+ c #d1d1a5a53c3c", | |
3312 | "g+ c #d0d0a5a53f3f", | |
3313 | "h+ c #d8d8a7a73333", | |
3314 | "j+ c #d9d9a8a83232", | |
3315 | "k+ c #d9d9acac3232", | |
3316 | "l+ c #dfdfadad3636", | |
3317 | "z+ c #d9d9abab3e3e", | |
3318 | "x+ c #dadaaeae3939", | |
3319 | "c+ c #dbdbafaf3a3a", | |
3320 | "v+ c #dadaacac3f3f", | |
3321 | "b+ c #dbdbadad3e3e", | |
3322 | "n+ c #dfdfb1b13535", | |
3323 | "m+ c #dfdfb0b03636", | |
3324 | "M+ c #dcdcb0b03b3b", | |
3325 | "N+ c #ddddb0b03a3a", | |
3326 | "B+ c #dedeb1b13939", | |
3327 | "V+ c #e3e3afaf2222", | |
3328 | "C+ c #e0e0adad2525", | |
3329 | "Z+ c #e1e1aeae2424", | |
3330 | "A+ c #e4e4afaf2121", | |
3331 | "S+ c #e2e2b2b23232", | |
3332 | "D+ c #e0e0b2b23434", | |
3333 | "F+ c #cfcfa5a54040", | |
3334 | "G+ c #d3d3aaaa4747", | |
3335 | "H+ c #d5d5abab4343", | |
3336 | "J+ c #d6d6abab4242", | |
3337 | "K+ c #d4d4aaaa4444", | |
3338 | "L+ c #d2d2aaaa4848", | |
3339 | "P+ c #d8d8acac4040", | |
3340 | "I+ c #dfdfb4b44545", | |
3341 | "U+ c #fbfbfbfbfbfb", | |
3342 | "Y+ c Gray99", | |
3343 | "T+ c #fdfdfdfdfdfd", | |
3344 | "R+ c #fefefefefefe", | |
3345 | "E+ c Gray100", | |
3346 | "W+ c None", | |
3347 | /* pixels */ | |
3348 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3349 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3350 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3351 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3352 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3353 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3354 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3355 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3356 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+'O(OWOTOGOAOBONOCOZOVO W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3357 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+]O_OQOmOjOpOBokohohofozoAosOfOgOSo W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3358 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+)OIOxOiOdo7o1o>oAX,.q.BXPXPX9o0ocoDono W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3359 | "W+W+W+W+W+W+W+W+W+W+W+W+`O!OnOuOao5o:o>o,oSXh.MXKXPXPXUXTX(X)Xqouoto5. W+W+W+W+W+W+W+W+W+W+W+W+", | |
3360 | "W+W+W+W+W+W+W+W+W+W+W+^OPOzOMo5o-o:o>oFXSXw.NXKXPXIXUX/X)X)XWXXoooro#o.. W+W+W+W+W+W+W+W+W+W+", | |
3361 | "W+W+W+W+W+W+W+W+W+W+~OYOhOso=o-o;o>o<o<oZXd.ZXPXLXUX/X*O*O.oXooo}X$o$ov.( W+W+W+W+W+W+W+W+W+", | |
3362 | "W+W+W+W+W+W+W+W+W+{OUOkOao=o:o>o>o<o2oJXKXGXj.VXHX/X)X~X=O2OooOoB.'X]XH.2.s W+W+W+W+W+W+W+W+W+", | |
3363 | "W+W+W+W+W+W+W+W+W+)ObOjo=o:o>o,o<o2o-O;OPXPXHXl.f.RX^X.oXo3O>O,O%o&o[XFoN.{ w W+W+W+W+W+W+W+W+", | |
3364 | "W+W+W+W+W+W+W+W+/OLOVo5o:o>o,o<o'o`oKX:O:OUX/X(XYXr.b.Xo@oOo$o<O1O oRoGo$X8.Z q W+W+W+W+W+W+W+", | |
3365 | "W+W+W+W+W+W+W+W+EOjO6o;o>o<o<o4o>.-X:OIX#O$O)X)X.o!Xe.p.`X$o%o*o4O6OEoJoKo/.) $ W+W+W+W+W+W+", | |
3366 | "W+W+W+W+W+W+W+DORONo;o>oCX<.JXKXk.PXLX#O$O*O%O.oXooo_Xy.t.m.*o oRo7O8OQoLoXX@.i f W+W+W+W+W+W+", | |
3367 | "W+W+W+W+W+W+W+KOcO8oFX<oDXg.KXPXPXUX/X/X*O&OyO2O@oOo$o|Xx.u.V.RoEoTo+O9OYoUo9.M 8 W+W+W+W+W+W+", | |
3368 | "W+W+W+W+W+W+ JOaO3o}OA+A+V+Z+Z+C+2+2+1+,+<+B+I+N+:+j+k+h+7+O+6+y+y+a+[OIo1X!.Y = 7 W+W+W+W+W+", | |
3369 | "W+W+W+W+W+W+ HOCo<oA+V+V+Z+Z+C+2+2+1+<+<+3+>+x+c+b+k+h+i+i+t+e+y+a+s+p+(o2X(.W % 9 W+W+W+W+W+", | |
3370 | "W+W+W+W+W+W+ FOloJXV+V+Z+S+C+2+1+1+<+3+3+>+;+-+5+z+v+i+u+u+y+a+a+s+f+f+[o3X]./ + < F W+W+W+W+W+", | |
3371 | "W+W+W+W+W+W+ SOfoKXV+Z+C+C+D+n+1+<+3+3+>+:+:+j+8+4+r+P+P+y+a+a+.+X+X+o+{owX_._ o ; z W+W+W+W+W+", | |
3372 | "W+W+W+W+W+W+ MOgoPXZ+C+2+2+1+l+m+3+>+>+:+j+k+h+i+9+$+w+J+H+H+s+f+f+d+g+]oeX~.! . + l W+W+W+W+W+", | |
3373 | "W+W+W+W+W+W+ vOxoPXC+2+2+1+<+<+B+N+>+:+j+k+#+i+i+u+0+@+&+s+K+G+d+d+=+F+}ojXI.S . + l W+W+W+W+W+", | |
3374 | "W+W+W+W+W+W+ lOvoUX|O1+1+<+<+3+>+N+M+j+k+h+++++u+y+y+q+%+*+f+L+L+=+F+ +|ouX&.v . + l E+W+W+W+W+", | |
3375 | "W+W+W+W+W+W+ boZo/XEX)X.oXooon.c.$o<O5O oRoEoA.}.!o|..X~o&X2X{o]orO|o|oaX7XO.2 o > z E+W+W+W+W+", | |
3376 | "W+W+W+W+W+W+ [ dOwo~X.oXoooOo$oz.i.G.oORoEoWoQoa.a._o X(o^o<XtX}o|otOcXfXU.~ X + 5 F E+W+W+W+W+", | |
3377 | "W+W+W+W+W+W+ 4 ioyo.oQX@oOo$o%o&oM.F.C.XOKoQo!o)o4.0.OXOX{otX,XlX|ocXwOyX$.p O * q K W+W+W+W+W+", | |
3378 | "W+W+W+W+W+W+ q } moeo@oOo$o%o&o oRoZ.HoOO.O%X=X/ooX>X[o'.}o}oqXkXcXvXmXW.^ X + - j =.W+W+W+W+W+", | |
3379 | "W+W+W+W+W+W+W+ - 6.po+o'X%o&o oRoRoA.}.Qo@OPo*X~o[o[o]o[.[.|oxXzXvXhXE.X.e O + 6 J Y+W+W+W+W+W+", | |
3380 | "W+W+W+W+W+W+W+ X r n.$o]X{X oRoEoWoQo|.|.)oeO(o[o{o]o}o|o{.xXvXvXdX8X#.b X + o d I Y+W+W+W+W+W+", | |
3381 | "W+W+W+W+W+W+W+W+ - B D.[X[XGoEoWoQo!o!o_o(oeOnXY.+X}o|o|o9X0XvXhX8X%.D X O # 6 H :.W+W+W+W+W+W+", | |
3382 | "W+W+W+W+W+W+W+W+ * N 7.S.GoKoKo!o)o/o(o[oOX0O5X@X|o OcXvXgXpXR.+.V X O + + j =.E+W+W+W+W+W+W+", | |
3383 | "W+W+W+W+W+W+W+W+W+L # u .s.#XLoPo;X(o[o[o]o[.bXtOxXcXfXpX6XK.] a X O + - j *.T+W+W+W+W+W+W+W+", | |
3384 | "W+W+W+W+W+W+W+W+W+W+ - U 3.Q.).:X2X2XwXeXrXjXqOsXiX4XJ.o.E & O O + O 0 K T+E+W+W+W+W+W+W+W+", | |
3385 | "W+W+W+W+W+W+W+W+W+W+ - 1 C | 1.P.T._.`.`.^.U.L.$.' A 3 X O O # - q J :.Y+W+W+W+W+W+W+W+W+", | |
3386 | "W+W+W+W+W+W+W+W+W+W+W+ # - # O y m T Q _ ` ~ R n t @ O O O + O # g P :.E+W+W+W+W+W+W+W+W+W+", | |
3387 | "W+W+W+W+W+W+W+W+W+W+W+W+W+ - # # # O O O O O O O O O O O + # + 7 x ;.T+Y+W+W+W+W+W+W+W+W+W+W+", | |
3388 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+ G k : # - # # X X + . # # # O , g j -.:.R+E+W+W+W+W+W+W+W+W+W+W+W+", | |
3389 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+ h 6 : 6 6 # # # 6 6 0 g F *.:.T+E+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3390 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+ L F c z z z c F K =.T+E+U+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3391 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+E+E+E+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3392 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3393 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3394 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+", | |
3395 | "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+" | |
3396 | }; | |
3397 | ||
3398 | static char *info_xpm[] = { | |
3399 | /* columns rows colors chars-per-pixel */ | |
3400 | "48 48 478 2", | |
3401 | " c Gray0", | |
3402 | ". c #010101010101", | |
3403 | "X c #020202020202", | |
3404 | "o c #050505050404", | |
3405 | "O c Gray2", | |
3406 | "+ c #080808080707", | |
3407 | "@ c #090909090808", | |
3408 | "# c #0b0b0b0b0909", | |
3409 | "$ c #0b0b0b0b0b0b", | |
3410 | "% c #0c0c0c0c0b0b", | |
3411 | "& c #0d0d0d0d0a0a", | |
3412 | "* c #0c0c0c0c0c0c", | |
3413 | "= c #0f0f0e0e0c0c", | |
3414 | "- c #0f0f0f0f0e0e", | |
3415 | "; c Gray6", | |
3416 | ": c #101010100e0e", | |
3417 | "> c #121212120f0f", | |
3418 | ", c #101010101010", | |
3419 | "< c #121212121111", | |
3420 | "1 c #131313131111", | |
3421 | "2 c #131313131313", | |
3422 | "3 c #141414141111", | |
3423 | "4 c #141414141212", | |
3424 | "5 c #161616161313", | |
3425 | "6 c #161616161414", | |
3426 | "7 c #1a1a1a1a1717", | |
3427 | "8 c #1d1d1d1d1616", | |
3428 | "9 c #191919191919", | |
3429 | "0 c #1e1e1e1e1e1e", | |
3430 | "q c #20201d1d1313", | |
3431 | "w c #202020201c1c", | |
3432 | "e c #212121211d1d", | |
3433 | "r c #212120201e1e", | |
3434 | "t c #232323231f1f", | |
3435 | "y c #242421211919", | |
3436 | "u c Gray15", | |
3437 | "i c #272727272727", | |
3438 | "p c #2a2a2a2a2727", | |
3439 | "a c #282828282828", | |
3440 | "s c #2a2a2a2a2a2a", | |
3441 | "d c #2c2c2c2c2a2a", | |
3442 | "f c #2f2f2f2f2929", | |
3443 | "g c #2d2d2d2d2d2d", | |
3444 | "h c Gray18", | |
3445 | "j c #313131312b2b", | |
3446 | "k c #303030302f2f", | |
3447 | "l c #333333332f2f", | |
3448 | "z c #353535352e2e", | |
3449 | "x c #383835352626", | |
3450 | "c c #3b3b37372424", | |
3451 | "v c #333333333131", | |
3452 | "b c Gray20", | |
3453 | "n c #343434343434", | |
3454 | "m c #353535353535", | |
3455 | "M c #393937373232", | |
3456 | "N c #383838383737", | |
3457 | "B c #3d3d3d3d3535", | |
3458 | "V c Gray23", | |
3459 | "C c #3e3e3e3e3e3e", | |
3460 | "Z c #42423f3f3636", | |
3461 | "A c #434340403232", | |
3462 | "S c #424242423a3a", | |
3463 | "D c #434343433d3d", | |
3464 | "F c #444444443b3b", | |
3465 | "G c #474744443939", | |
3466 | "H c #4f4f49493838", | |
3467 | "J c #4d4d49493c3c", | |
3468 | "K c #434343434242", | |
3469 | "L c #434343434343", | |
3470 | "P c #474747474242", | |
3471 | "I c #464646464444", | |
3472 | "U c #464646464646", | |
3473 | "Y c Gray28", | |
3474 | "T c #4b4b4b4b4444", | |
3475 | "R c #4d4d4c4c4747", | |
3476 | "E c #4e4e4e4e4545", | |
3477 | "W c #494949494949", | |
3478 | "Q c #4b4b4b4b4b4b", | |
3479 | "! c #4e4e4e4e4e4e", | |
3480 | "~ c #4f4f4f4f4e4e", | |
3481 | "^ c #525252524848", | |
3482 | "/ c #525252524949", | |
3483 | "( c #555555554e4e", | |
3484 | ") c #565656564f4f", | |
3485 | "_ c #5a5a59594c4c", | |
3486 | "` c #5f5f5c5c4f4f", | |
3487 | "' c Gray32", | |
3488 | "] c Gray33", | |
3489 | "[ c #585858585151", | |
3490 | "{ c #585858585858", | |
3491 | "} c #595959595858", | |
3492 | "| c #5c5c5c5c5b5b", | |
3493 | " . c #5f5f5e5e5959", | |
3494 | ".. c #6d6d66664d4d", | |
3495 | "X. c #646461615959", | |
3496 | "o. c #71716d6d5b5b", | |
3497 | "O. c #797971715757", | |
3498 | "+. c #626262626262", | |
3499 | "@. c Gray39", | |
3500 | "#. c #646464646464", | |
3501 | "$. c #696969696464", | |
3502 | "%. c #6d6d6d6d6464", | |
3503 | "&. c #696969696868", | |
3504 | "*. c #6b6b6b6b6a6a", | |
3505 | "=. c #6d6d6d6d6d6d", | |
3506 | "-. c #6f6f6f6f6f6f", | |
3507 | ";. c #73736f6f6161", | |
3508 | ":. c #707070706b6b", | |
3509 | ">. c #717171716f6f", | |
3510 | ",. c #757575756c6c", | |
3511 | "<. c #797976766c6c", | |
3512 | "1. c #7f7f7a7a6464", | |
3513 | "2. c Gray45", | |
3514 | "3. c #757575757171", | |
3515 | "4. c #7b7b7b7b7a7a", | |
3516 | "5. c #7b7b7b7b7b7b", | |
3517 | "6. c #7f7f7f7f7b7b", | |
3518 | "7. c Gray49", | |
3519 | "8. c #818179795959", | |
3520 | "9. c #808079795f5f", | |
3521 | "0. c #8f8f82825555", | |
3522 | "q. c #959588885757", | |
3523 | "w. c #9b9b8c8c5a5a", | |
3524 | "e. c #929289896363", | |
3525 | "r. c #9d9d91916464", | |
3526 | "t. c #a9a999995959", | |
3527 | "y. c #abab9b9b5b5b", | |
3528 | "u. c #b3b3a0a05e5e", | |
3529 | "i. c #a9a9a0a07777", | |
3530 | "p. c #aeaea4a47575", | |
3531 | "a. c #b9b9a9a96464", | |
3532 | "s. c #babaa8a86464", | |
3533 | "d. c #b7b7aaaa7c7c", | |
3534 | "f. c #c1c1aeae6767", | |
3535 | "g. c #c4c4b2b26969", | |
3536 | "h. c #c4c4b3b36b6b", | |
3537 | "j. c #c6c6b3b36a6a", | |
3538 | "k. c #c9c9b7b76d6d", | |
3539 | "l. c #ccccb9b96e6e", | |
3540 | "z. c #c1c1b3b37272", | |
3541 | "x. c #c2c2b0b07171", | |
3542 | "c. c #c6c6b6b67777", | |
3543 | "v. c #cacab8b87171", | |
3544 | "b. c #cdcdbcbc7070", | |
3545 | "n. c #d1d1bcbc7070", | |
3546 | "m. c #d1d1bfbf7373", | |
3547 | "M. c #d1d1c0c07676", | |
3548 | "N. c #d9d9c5c57777", | |
3549 | "B. c #d9d9c6c67777", | |
3550 | "V. c #dadac7c77777", | |
3551 | "C. c #d9d9c6c67979", | |
3552 | "Z. c #dbdbc7c77c7c", | |
3553 | "A. c #dbdbc8c87878", | |
3554 | "S. c #dbdbc9c97c7c", | |
3555 | "D. c #dadac8c87e7e", | |
3556 | "F. c #dbdbc9c97e7e", | |
3557 | "G. c #e2e2cdcd7f7f", | |
3558 | "H. c #e4e4d0d07e7e", | |
3559 | "J. c #e4e4d0d07f7f", | |
3560 | "K. c #e4e4d1d17e7e", | |
3561 | "L. c #e6e6d2d27e7e", | |
3562 | "P. c #818181818181", | |
3563 | "I. c #838383838383", | |
3564 | "U. c #848484848484", | |
3565 | "Y. c Gray53", | |
3566 | "T. c #898987878282", | |
3567 | "R. c #8d8d8d8d8585", | |
3568 | "E. c #8d8d8d8d8787", | |
3569 | "W. c #929292928d8d", | |
3570 | "Q. c #969696968e8e", | |
3571 | "!. c #989895958585", | |
3572 | "~. c #9b9b95958484", | |
3573 | "^. c #929292929292", | |
3574 | "/. c #939393939393", | |
3575 | "(. c Gray58", | |
3576 | "). c Gray60", | |
3577 | "_. c #9d9d9d9d9999", | |
3578 | "`. c #9e9e9e9e9a9a", | |
3579 | "'. c #a2a29c9c8484", | |
3580 | "]. c None", | |
3581 | "[. c #b8b8b0b09595", | |
3582 | "{. c #a0a0a0a0a0a0", | |
3583 | "}. c Gray63", | |
3584 | "|. c #a5a5a5a5a5a5", | |
3585 | " X c #a7a7a7a7a7a7", | |
3586 | ".X c #a9a9a9a9a4a4", | |
3587 | "XX c #aeaeaeaea9a9", | |
3588 | "oX c #babab6b6a9a9", | |
3589 | "OX c #b3b3b3b3b0b0", | |
3590 | "+X c #b3b3b3b3b1b1", | |
3591 | "@X c #b4b4b4b4b2b2", | |
3592 | "#X c #b4b4b4b4b4b4", | |
3593 | "$X c #b6b6b6b6b6b6", | |
3594 | "%X c #b9b9b9b9b1b1", | |
3595 | "&X c Gray73", | |
3596 | "*X c #bbbbbbbbbbbb", | |
3597 | "=X c #bcbcbcbcb9b9", | |
3598 | "-X c Gray75", | |
3599 | ";X c #c1c1b9b99999", | |
3600 | ":X c #c2c2bebeafaf", | |
3601 | ">X c #d7d7c4c48080", | |
3602 | ",X c #d8d8c7c78e8e", | |
3603 | "<X c #dfdfcbcb8080", | |
3604 | "1X c #dcdccbcb8484", | |
3605 | "2X c #d7d7c8c89696", | |
3606 | "3X c #c4c4c4c4b5b5", | |
3607 | "4X c #c8c8c8c8b9b9", | |
3608 | "5X c #cbcbcbcbbcbc", | |
3609 | "6X c #dfdfd2d2a9a9", | |
3610 | "7X c #e0e0cece8a8a", | |
3611 | "8X c #e3e3d1d18686", | |
3612 | "9X c #e7e7d1d18080", | |
3613 | "0X c #e5e5d1d18787", | |
3614 | "qX c #e7e7d4d48080", | |
3615 | "wX c #e5e5d4d48d8d", | |
3616 | "eX c #e6e6d6d68c8c", | |
3617 | "rX c #eeeed6d68181", | |
3618 | "tX c #efefd7d78282", | |
3619 | "yX c #e8e8d6d68b8b", | |
3620 | "uX c #e8e8d4d48d8d", | |
3621 | "iX c #ececd7d78c8c", | |
3622 | "pX c #efefd8d88181", | |
3623 | "aX c #efefd8d88282", | |
3624 | "sX c #efefd9d98686", | |
3625 | "dX c #eeeedbdb8b8b", | |
3626 | "fX c #eeeedada8d8d", | |
3627 | "gX c #efefdada8e8e", | |
3628 | "hX c #efefdcdc8b8b", | |
3629 | "jX c #efefdddd8f8f", | |
3630 | "kX c #eaeadada9191", | |
3631 | "lX c #e9e9dada9696", | |
3632 | "zX c #ededd9d99090", | |
3633 | "xX c #efefdddd9292", | |
3634 | "cX c #efefdddd9393", | |
3635 | "vX c #ebebdbdb9999", | |
3636 | "bX c #f1f1dcdc8686", | |
3637 | "nX c #f3f3dede8787", | |
3638 | "mX c #f4f4dede8787", | |
3639 | "MX c #f2f2dcdc8a8a", | |
3640 | "NX c #f3f3dfdf8d8d", | |
3641 | "BX c #f0f0dcdc9191", | |
3642 | "VX c #f1f1dcdc9292", | |
3643 | "CX c #f0f0dfdf9292", | |
3644 | "ZX c #f0f0dddd9c9c", | |
3645 | "AX c #f1f1dfdfa1a1", | |
3646 | "SX c #f1f1e0e08e8e", | |
3647 | "DX c #f6f6e3e38f8f", | |
3648 | "FX c #f7f7e5e58f8f", | |
3649 | "GX c #f2f2e0e09090", | |
3650 | "HX c #f2f2e0e09393", | |
3651 | "JX c #f3f3e0e09393", | |
3652 | "KX c #f3f3e2e29090", | |
3653 | "LX c #f1f1e1e19595", | |
3654 | "PX c #f2f2e0e09797", | |
3655 | "IX c #f3f3e2e29595", | |
3656 | "UX c #f3f3e2e29696", | |
3657 | "YX c #f4f4e1e19191", | |
3658 | "TX c #f5f5e1e19090", | |
3659 | "RX c #f5f5e3e39191", | |
3660 | "EX c #f5f5e2e29393", | |
3661 | "WX c #f5f5e3e39393", | |
3662 | "QX c #f4f4e3e39595", | |
3663 | "!X c #f6f6e5e59191", | |
3664 | "~X c #f6f6e4e49393", | |
3665 | "^X c #f6f6e5e59393", | |
3666 | "/X c #f7f7e4e49393", | |
3667 | "(X c #f7f7e6e69191", | |
3668 | ")X c #f6f6e4e49696", | |
3669 | "_X c #f7f7e6e69595", | |
3670 | "`X c #f6f6e6e69797", | |
3671 | "'X c #f1f1e1e19b9b", | |
3672 | "]X c #f2f2e2e29a9a", | |
3673 | "[X c #f4f4e2e29898", | |
3674 | "{X c #f6f6e4e49898", | |
3675 | "}X c #f6f6e4e49999", | |
3676 | "|X c #f6f6e5e59b9b", | |
3677 | " o c #f4f4e4e49d9d", | |
3678 | ".o c #f5f5e4e49c9c", | |
3679 | "Xo c #f6f6e5e59d9d", | |
3680 | "oo c #f7f7e6e69f9f", | |
3681 | "Oo c #f8f8e6e69191", | |
3682 | "+o c #f8f8e7e79191", | |
3683 | "@o c #f8f8e7e79393", | |
3684 | "#o c #f8f8e7e79595", | |
3685 | "$o c #f8f8e7e79696", | |
3686 | "%o c #f9f9e8e89b9b", | |
3687 | "&o c #f9f9e9e99b9b", | |
3688 | "*o c #f9f9e8e89e9e", | |
3689 | "=o c #edede7e7baba", | |
3690 | "-o c #f1f1e3e3a4a4", | |
3691 | ";o c #f3f3e3e3a7a7", | |
3692 | ":o c #f2f2e4e4a1a1", | |
3693 | ">o c #f3f3e4e4a1a1", | |
3694 | ",o c #f3f3e6e6a3a3", | |
3695 | "<o c #f4f4e5e5a0a0", | |
3696 | "1o c #f5f5e4e4a3a3", | |
3697 | "2o c #f5f5e7e7a2a2", | |
3698 | "3o c #f6f6e6e6a0a0", | |
3699 | "4o c #f7f7e7e7a0a0", | |
3700 | "5o c #f7f7e7e7a5a5", | |
3701 | "6o c #f6f6e7e7a7a7", | |
3702 | "7o c #f1f1e6e6adad", | |
3703 | "8o c #f3f3e6e6adad", | |
3704 | "9o c #f3f3e7e7adad", | |
3705 | "0o c #f7f7e8e8a6a6", | |
3706 | "qo c #f7f7e8e8a7a7", | |
3707 | "wo c #f7f7eaeaafaf", | |
3708 | "eo c #f9f9e9e9a7a7", | |
3709 | "ro c #fafaeaeaa6a6", | |
3710 | "to c #f8f8e8e8a9a9", | |
3711 | "yo c #f8f8eaeaaeae", | |
3712 | "uo c #f8f8eaeaafaf", | |
3713 | "io c #fafaececafaf", | |
3714 | "po c #f4f4e7e7b2b2", | |
3715 | "ao c #f5f5e7e7b2b2", | |
3716 | "so c #f4f4e7e7bbbb", | |
3717 | "do c #f7f7ebebb1b1", | |
3718 | "fo c #f4f4e9e9bbbb", | |
3719 | "go c #f6f6ebebbebe", | |
3720 | "ho c #f8f8ebebb1b1", | |
3721 | "jo c #f9f9ebebb1b1", | |
3722 | "ko c #fafaededb7b7", | |
3723 | "lo c #f8f8ececb8b8", | |
3724 | "zo c #f8f8ececb9b9", | |
3725 | "xo c #f8f8ededbaba", | |
3726 | "co c #fafaeeeebbbb", | |
3727 | "vo c #c2c2c2c2c1c1", | |
3728 | "bo c #c3c3c3c3c1c1", | |
3729 | "no c Gray76", | |
3730 | "mo c #c3c3c3c3c2c2", | |
3731 | "Mo c #c7c7c7c7c5c5", | |
3732 | "No c #cacacacac4c4", | |
3733 | "Bo c Gray79", | |
3734 | "Vo c #cacacacacaca", | |
3735 | "Co c #cbcbcbcbcbcb", | |
3736 | "Zo c #cfcfcfcfc8c8", | |
3737 | "Ao c Gray80", | |
3738 | "So c #cfcfcfcfcece", | |
3739 | "Do c #d8d8d8d8cdcd", | |
3740 | "Fo c #ddddd9d9caca", | |
3741 | "Go c #d4d4d4d4d1d1", | |
3742 | "Ho c #d7d7d7d7d3d3", | |
3743 | "Jo c #d5d5d5d5d5d5", | |
3744 | "Ko c Gray85", | |
3745 | "Lo c #dadadadad8d8", | |
3746 | "Po c #dadadadadada", | |
3747 | "Io c gainsboro", | |
3748 | "Uo c #dddddddddddd", | |
3749 | "Yo c #dededededddd", | |
3750 | "To c #dfdfdfdfdede", | |
3751 | "Ro c #e0e0e0e0d7d7", | |
3752 | "Eo c #e5e5e5e5dddd", | |
3753 | "Wo c #f3f3eaeac1c1", | |
3754 | "Qo c #f4f4e9e9c1c1", | |
3755 | "!o c #f5f5e9e9c2c2", | |
3756 | "~o c #f4f4e9e9c4c4", | |
3757 | "^o c #f7f7eeeec3c3", | |
3758 | "/o c #f4f4eaeac9c9", | |
3759 | "(o c #f4f4eaeacaca", | |
3760 | ")o c #f9f9efefcbcb", | |
3761 | "_o c #f8f8efefcfcf", | |
3762 | "`o c #f7f7efefd0d0", | |
3763 | "'o c #f7f7eeeed9d9", | |
3764 | "]o c #f7f7efefd8d8", | |
3765 | "[o c #f9f9f0f0c7c7", | |
3766 | "{o c #fafaf3f3d0d0", | |
3767 | "}o c #fafaf2f2d2d2", | |
3768 | "|o c #fafaf2f2d3d3", | |
3769 | " O c #f8f8f1f1dbdb", | |
3770 | ".O c #f9f9f1f1dbdb", | |
3771 | "XO c #f8f8f2f2dbdb", | |
3772 | "oO c #f9f9f2f2dbdb", | |
3773 | "OO c #fafaf3f3dada", | |
3774 | "+O c #fafaf3f3dbdb", | |
3775 | "@O c #f8f8f1f1dcdc", | |
3776 | "#O c #f8f8f2f2dede", | |
3777 | "$O c #fafaf4f4d9d9", | |
3778 | "%O c #fafaf5f5dede", | |
3779 | "&O c #e7e7e7e7e1e1", | |
3780 | "*O c #e4e4e4e4e4e4", | |
3781 | "=O c #e9e9e9e9e2e2", | |
3782 | "-O c #ebebebebe6e6", | |
3783 | ";O c Gray91", | |
3784 | ":O c #edededede8e8", | |
3785 | ">O c #ecececececec", | |
3786 | ",O c Gray93", | |
3787 | "<O c #efefefefeeee", | |
3788 | "1O c #efefefefefef", | |
3789 | "2O c #f1f1f1f1ecec", | |
3790 | "3O c #f2f2f2f2eeee", | |
3791 | "4O c #fafaf3f3e5e5", | |
3792 | "5O c #f9f9f4f4e0e0", | |
3793 | "6O c #f9f9f4f4e2e2", | |
3794 | "7O c #f9f9f4f4e3e3", | |
3795 | "8O c #f9f9f5f5e3e3", | |
3796 | "9O c #fafaf4f4e1e1", | |
3797 | "0O c #f9f9f4f4e5e5", | |
3798 | "qO c #f9f9f5f5e4e4", | |
3799 | "wO c #f9f9f5f5e5e5", | |
3800 | "eO c #f9f9f4f4e6e6", | |
3801 | "rO c #f9f9f4f4e7e7", | |
3802 | "tO c #f9f9f5f5e6e6", | |
3803 | "yO c #f9f9f6f6e5e5", | |
3804 | "uO c #f9f9f6f6e7e7", | |
3805 | "iO c #fafaf5f5e4e4", | |
3806 | "pO c #fafaf5f5e5e5", | |
3807 | "aO c #fafaf5f5e6e6", | |
3808 | "sO c #fafaf5f5e7e7", | |
3809 | "dO c #fbfbf5f5e6e6", | |
3810 | "fO c #fafaf6f6e6e6", | |
3811 | "gO c #fafaf6f6e7e7", | |
3812 | "hO c #fbfbf6f6e7e7", | |
3813 | "jO c #f9f9f6f6eaea", | |
3814 | "kO c #fafaf5f5e8e8", | |
3815 | "lO c #fafaf6f6e8e8", | |
3816 | "zO c #fafaf6f6e9e9", | |
3817 | "xO c #fafaf7f7eaea", | |
3818 | "cO c #fafaf7f7ebeb", | |
3819 | "vO c #fbfbf7f7eaea", | |
3820 | "bO c #fbfbf7f7ecec", | |
3821 | "nO c #fbfbf7f7eded", | |
3822 | "mO c #fafaf8f8ecec", | |
3823 | "MO c #fbfbf8f8eded", | |
3824 | "NO c #fbfbf8f8eeee", | |
3825 | "BO c #fbfbf9f9efef", | |
3826 | "VO c Gray94", | |
3827 | "CO c #f1f1f1f1f1f1", | |
3828 | "ZO c #f4f4f4f4f0f0", | |
3829 | "AO c #f4f4f4f4f1f1", | |
3830 | "SO c #f5f5f5f5f2f2", | |
3831 | "DO c #f6f6f6f6f3f3", | |
3832 | "FO c #f4f4f4f4f4f4", | |
3833 | "GO c Gray96", | |
3834 | "HO c #f6f6f6f6f4f4", | |
3835 | "JO c #f7f7f7f7f5f5", | |
3836 | "KO c #f6f6f6f6f6f6", | |
3837 | "LO c Gray97", | |
3838 | "PO c #f8f8f8f8f5f5", | |
3839 | "IO c #f8f8f8f8f6f6", | |
3840 | "UO c #f8f8f8f8f7f7", | |
3841 | "YO c #f9f9f9f9f7f7", | |
3842 | "TO c #fafaf9f9f4f4", | |
3843 | "RO c #fafafafaf6f6", | |
3844 | "EO c #fbfbfbfbf7f7", | |
3845 | "WO c #fefefcfcf0f0", | |
3846 | "QO c #fefefcfcf1f1", | |
3847 | "!O c #fefefcfcf3f3", | |
3848 | "~O c #fefefcfcf4f4", | |
3849 | "^O c #fefefcfcf5f5", | |
3850 | "/O c #fefefdfdf5f5", | |
3851 | "(O c #fefefdfdf6f6", | |
3852 | ")O c #fefefdfdf7f7", | |
3853 | "_O c #f9f9f9f9f8f8", | |
3854 | "`O c #f9f9f9f9f9f9", | |
3855 | "'O c #fafafafaf8f8", | |
3856 | "]O c #fafafafaf9f9", | |
3857 | "[O c #fbfbfbfbf8f8", | |
3858 | "{O c #fbfbfbfbf9f9", | |
3859 | "}O c Gray98", | |
3860 | "|O c #fbfbfbfbfafa", | |
3861 | " + c #fbfbfbfbfbfb", | |
3862 | ".+ c #fcfcfcfcf9f9", | |
3863 | "X+ c #fcfcfcfcfafa", | |
3864 | "o+ c #fcfcfcfcfbfb", | |
3865 | "O+ c #fefefdfdf8f8", | |
3866 | "++ c #fefefdfdf9f9", | |
3867 | "@+ c #fefefdfdfafa", | |
3868 | "#+ c #fefefdfdfbfb", | |
3869 | "$+ c #fefefefefafa", | |
3870 | "%+ c #fefefefefbfb", | |
3871 | "&+ c Gray99", | |
3872 | "*+ c #fdfdfdfdfcfc", | |
3873 | "=+ c #fdfdfdfdfdfd", | |
3874 | "-+ c #fefefefefcfc", | |
3875 | ";+ c #fefefefefdfd", | |
3876 | ":+ c #fefefefefefe", | |
3877 | ">+ c None", | |
3878 | ",+ c None", | |
3879 | /* pixels */ | |
3880 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+>+>+>+>+>+>+>+>+>+>+>+>+>+>+>+>+>+>+>+>+>+,+,+,+,+,+,+,+,+", | |
3881 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+>+>+>+>+>+>+>+>+>+>+>+>+>+>+>+>+(O>+>+>+>+>+>+>+>+,+,+,+,+,+,+", | |
3882 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+>+>+>+>+>+>+>+QOO+>+>+>+>+>+>+>+++!OO+>+>+>+>+>+>+>+>+,+,+,+,+,+", | |
3883 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+,+>+>+>+>+>+>+>+++/O$+>+>+>+>+>+>+>+(O(O/O>+>+>+>+>+>+>+>+>+,+,+,+,+", | |
3884 | ",+,+,+,+,+,+,+,+,+,+,+,+,+>+>+>+>+>+>+>+>+>+$+)OO+>+>+>+>+>+>+%+$+++O+>+>+>+>+>+>+>+>+>+>+>+,+,+", | |
3885 | ",+,+,+,+,+,+,+,+,+,+,+,+,+>+>+>+>+>+>+>+>+>+O+++++-+>+>+>+>+;+-+;+-+@+>+>+>+>+>+>+)O>+>+>+>+,+,+", | |
3886 | ",+,+,+,+,+,+,+,+,+,+,+,+>+>+>+>+>+>+>+>+>+>+@+;+;+-+>+>+>+>+;+:+:+;+%+>+>+>+>+%+/O~O>+>+>+>+>+,+", | |
3887 | ",+,+,+,+,+,+,+,+,+,+,+>+>+>+>+>+>+>+>+>+>+>+-+;+:+:+:+>+>+:+:+:+:+:+:+>+;+-+++++)O$+>+>+>+>+>+>+", | |
3888 | ",+,+,+,+,+,+,+,+,+,+>+>+>+/OQO++>+>+>+>+>+>+;+:+:+:+:+:+:+:+:+:+:+:+:+:+;+-+-+;+++%+>+>+>+>+>+>+", | |
3889 | ",+,+,+,+,+,+,+,+,+,+>+>+>+)O~O/O)O@+;+>+>+>+:+:+:+:+:+:+:+:+:+:+:+:+:+:+:+:+:+;+@+>+>+>+>+>+>+>+", | |
3890 | ",+,+,+,+,+,+,+,+,+>+>+>+>+>+$+)O#+;+;+;+:+:+:+:+:+:+COVoCoCo,O:+:+:+:+:+:+:+:+;+;+>+>+>+>+>+>+>+", | |
3891 | ",+,+,+,+,+,+,+,+,+>+>+>+>+>+>+++-+:+:+:+:+:+:+,O).Q 2 h M Z y a +.no}O:+:+:+:+:+>+>+>+>+>+>+>+>+", | |
3892 | ",+,+,+,+,+,+,+,+>+>+>+>+>+>+>+>+-+:+:+:+:+:+nog ;.7XjX[XYXJXiX,Xd.w.` $X:+:+:+:+>+>+>+>+>+>+>+>+", | |
3893 | ",+,+,+,+,+,+,+,+>+>+>+>+>+>+>+>+;+;+:+:+:+}.0 :XVXTX5oyoeo#o$o.ovXG.>Xr I.`O:+:+>+>+>+>+>+>+>+>+", | |
3894 | ",+,+,+,+,+,+,+,+>+>+>+>+>+>+>+>+>+:+:+:+no0 FosXgXuo[o%O{oro*o@o/XcX0X6X} /.:+:+:+:+;+;+%+@+/OQO", | |
3895 | ",+,+,+,+,+,+,+>+>+>+(O!O(OO+@+-+;+:+:+}OY oX1omXpo8OfOMOBOmOOO&o+oDXxX<X2Xb Bo:+:+:+:+;+-+O+(O>+", | |
3896 | ",+,+,+,+,+,+,+>+>+>+WO~O)O@+-+;+:+:+:+#X] ZXNXoo_opO6OhOsOzOfOko%oOoRXyXn.'.' :+:+:+:+;+%+%+>+>+", | |
3897 | ",+,+,+,+,+,+,+>+>+>+>+++)O$+;+:+:+:+:+U.!.rXEXto9OgO6OqO6OtOsO^o4o(XFXSXA.c.p Po:+:+:+;+;+>+>+>+", | |
3898 | ",+,+,+,+,+,+,+>+>+>+>+>+>+-+%+;+:+:+:+#.;XaX}XxoiOpOdOaO.O7OXOgo3oOoOoKXH.f.X.{.:+:+:+:+>+>+>+>+", | |
3899 | ",+,+,+,+,+,+,+>+>+>+>+>+>+>+>+:+:+:+:+#.;XpX{XxoqOlOlOwO6O#O`o!o<o_X_XIXL.j.<.5.:+:+>+>+>+>+>+>+", | |
3900 | ",+,+,+,+,+,+,+>+>+>+>+>+>+>+>+>+:+:+:+@.[.pXEXxosONOcOyOjO5O/odo2o`X|XHXqXl.O.(.:+>+>+>+>+>+>+>+", | |
3901 | ",+,+,+,+,+,+,+>+>+>+>+>+>+>+>+;+:+:+:+P.T.BX)XwopObOuOkOnOcolo(o,o^X~XGXK.g...|.:+:+>+>+>+>+>+>+", | |
3902 | ",+,+,+,+,+,+,+>+>+>+>+>+>+>+>+-+:+:+:+-XU zXMX0o$ONO OrO)oioao=o]X!XWXhXB.y.q Jo:+:+:+>+>+>+>+>+", | |
3903 | ",+,+,+,+,+,+,+>+>+>+>+>+>+>+EOX+&+&+*+`O-.~.bXXo|ovO0O4Ozo6o9o-oQXRXkXJ.b.8.! `O:+:+:+;+>+>+>+>+", | |
3904 | ",+,+,+,+,+,+,+>+>+>+>+>+>+++[OX+&+&+*+*+YoC fXqo}oxOeO'o7o o:o'XCXwXF.N.a.H X:+:+:+:+;+-+>+>+>+", | |
3905 | ",+,+,+,+,+,+,+>+>+>+>+++(O++[O|Oo+&+*+*+=+u PXjo+O@O]o~o>oUXLXlXeXD.V.h.q.m FO:+:+:+:+;+$+%+>+>+", | |
3906 | ",+,+,+,+,+,+,+,+>+>+>+O+(OO+TO[O.+o+&+*+*OA nXhooOWoQo8o'XjXdX1XM.m.k.r.D }.:+:+:+:+;+-+++O+$+>+", | |
3907 | ",+,+,+,+,+,+,+,+>+>+>+)O++%+ROo+{OX+o+&+voJ tXfosoAX;oPXjX8XC.v.z.p.1.$ 7.}O:+:+:+;+-+@+O+)O^O>+", | |
3908 | ",+,+,+,+,+,+,+,+>+>+>+>+>+>+'O|Oo+*+=+=+%.< x ._ i.uX9XZ.S.s.0.c = W *X:+:+>+>+>+>+>+>+>+>+>+>+", | |
3909 | ",+,+,+,+,+,+,+,+,+>+>+>+>+>+_O]Oo+&+*+=+z _.@X<OLo$.8 e.x.u.t.G +.IoGO:+:+:+>+>+>+>+>+>+>+>+>+>+", | |
3910 | ",+,+,+,+,+,+,+,+,+>+>+>+>+>+YO'O|Oo+&+`Oo 6 ( R.GoKONo[ R 9.o.s Ko*+*+:+:+:+>+>+>+>+>+>+>+>+>+>+", | |
3911 | ",+,+,+,+,+,+,+,+,+,+>+>+>+>+IOYO]O|Oo+{ t Mo.XB 1 E.bo4.| & V &X*+*+*+:+:+;+>+>+>+>+>+>+>+>+>+>+", | |
3912 | ",+,+,+,+,+,+,+,+,+,+>+>+>+>+HOIOYOVO|O9 ^ Ho=+LOZof P >.3.; >O&+&+&+&+:+:+-+>+>+>+>+>+>+>+>+>+>+", | |
3913 | ",+,+,+,+,+,+,+,+,+,+,+>+>+>+AOHOIO>OVO + f Q.To ++X:.~ S L =+=+=+o+o+:+:+%+>+>+>+>+>+>+>+>+>+>+", | |
3914 | ",+,+,+,+,+,+,+,+,+,+,+,+>+>+3OAOHO;O9 =XXXT - W.^.-.&.4 Y.*+*+*+X+[O;+;+@+>+>+>+>+>+>+>+>+>+,+", | |
3915 | ",+,+,+,+,+,+,+,+,+,+,+,+>+>+:O3OAOHO ,.moVOVO%X/ I 6.=.O LO&+o+o+o+'O++@+O+%+>+>+>+>+>+>+>+>+,+", | |
3916 | ",+,+,+,+,+,+,+,+,+,+,+,+,+>+Eo:O3OAO F v OX1OSo&.K ) i + +|O|O|O]O>+%+(O@+>+>+>+>+>+>+>+,+,+", | |
3917 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+5XEo-O2O* 5 > f d `.-.*. n ]O]O]O'O'O_O>+>+++O+>+>+>+>+>+>+,+,+,+", | |
3918 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+].5XRo-OAo : e w N &.2. UOYOYOYOUOIOPO>+>+>+>+>+>+>+>+>+,+,+,+,+", | |
3919 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+].].].Do&O3 @ 5 1 # j l k , JOJOJOHOHODOSO>+>+>+>+>+>+>+,+,+,+,+,+,+", | |
3920 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+].].].].5XE . 3 7 % : PoUoAOAOAOAOZO3O3O>+>+>+>+>+>+,+,+,+,+,+,+,+", | |
3921 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+].].].].].].X X . X * -O:O2O2O2O2O2O:O-O-O>+>+>+>+,+,+,+,+,+,+,+,+,+", | |
3922 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+].].].].].].].].3X4XDoRoRo=O=O=O=O=ORoRoDo>+>+,+,+,+,+,+,+,+,+,+,+,+", | |
3923 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+].].].].].].].].].].].].].5X5X5X5X5X].].].,+,+,+,+,+,+,+,+,+,+,+,+,+", | |
3924 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+].].].].].].].].].].].].].].].].].].].].].,+,+,+,+,+,+,+,+,+,+,+,+,+", | |
3925 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+].].].].].].].].].].].].].].].].].].].].].,+,+,+,+,+,+,+,+,+,+,+,+,+", | |
3926 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+", | |
3927 | ",+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+" | |
3928 | }; | |
3929 | ||
3930 | /* XPM */ | |
3931 | static char *warning_xpm[] = { | |
3932 | /* columns rows colors chars-per-pixel */ | |
3933 | "48 48 270 2", | |
3934 | " c Gray0", | |
3935 | ". c #010100000000", | |
3936 | "X c #010101010000", | |
3937 | "o c #010101010101", | |
3938 | "O c #020201010000", | |
3939 | "+ c #030301010000", | |
3940 | "@ c #020202020000", | |
3941 | "# c #020202020202", | |
3942 | "$ c Gray1", | |
3943 | "% c #040403030000", | |
3944 | "& c #050504040000", | |
3945 | "* c #070704040000", | |
3946 | "= c #040404040404", | |
3947 | "- c Gray2", | |
3948 | "; c #060606060606", | |
3949 | ": c #090907070000", | |
3950 | "> c #090907070101", | |
3951 | ", c #0e0e03030202", | |
3952 | "< c #0d0d04040303", | |
3953 | "1 c #0a0a08080000", | |
3954 | "2 c #0b0b09090000", | |
3955 | "3 c #0e0e0b0b0000", | |
3956 | "4 c Gray3", | |
3957 | "5 c #090909090909", | |
3958 | "6 c Gray4", | |
3959 | "7 c #0b0b0b0b0b0b", | |
3960 | "8 c Gray6", | |
3961 | "9 c #171704040202", | |
3962 | "0 c #10100d0d0101", | |
3963 | "q c #13130f0f0000", | |
3964 | "w c #13130f0f0101", | |
3965 | "e c #1c1c07070505", | |
3966 | "r c #151510100101", | |
3967 | "t c #191913130000", | |
3968 | "y c #1d1d16160202", | |
3969 | "u c #1e1e17170202", | |
3970 | "i c #111111111111", | |
3971 | "p c #161616161616", | |
3972 | "a c #212107070505", | |
3973 | "s c #222207070505", | |
3974 | "d c #232307070404", | |
3975 | "f c #232307070505", | |
3976 | "g c #262608080606", | |
3977 | "h c #2b2b0a0a0707", | |
3978 | "j c #2c2c08080505", | |
3979 | "k c #2e2e08080505", | |
3980 | "l c #2e2e09090606", | |
3981 | "z c #2e2e0a0a0808", | |
3982 | "x c #24241c1c0303", | |
3983 | "c c #25251d1d0202", | |
3984 | "v c #25251d1d0303", | |
3985 | "b c #27271e1e0202", | |
3986 | "n c #3b3b0b0b0707", | |
3987 | "m c #3b3b0c0c0909", | |
3988 | "M c #3c3c0c0c0909", | |
3989 | "N c #3d3d0c0c0909", | |
3990 | "B c #3e3e0c0c0808", | |
3991 | "V c #292920200303", | |
3992 | "C c #2c2c23230303", | |
3993 | "Z c #313126260404", | |
3994 | "A c #313126260505", | |
3995 | "S c #333327270404", | |
3996 | "D c #38382c2c0505", | |
3997 | "F c #3c3c2e2e0505", | |
3998 | "G c Gray17", | |
3999 | "H c #41410c0c0707", | |
4000 | "J c #42420c0c0606", | |
4001 | "K c #42420c0c0707", | |
4002 | "L c #42420d0d0808", | |
4003 | "P c #44440e0e0909", | |
4004 | "I c #44440e0e0a0a", | |
4005 | "U c #47470e0e0909", | |
4006 | "Y c #46460e0e0a0a", | |
4007 | "T c #49490d0d0707", | |
4008 | "R c #4d4d0d0d0707", | |
4009 | "E c #49490e0e0909", | |
4010 | "W c #49490e0e0a0a", | |
4011 | "Q c #4d4d10100c0c", | |
4012 | "! c #52520e0e0707", | |
4013 | "~ c #575711110909", | |
4014 | "^ c #5a5a12120d0d", | |
4015 | "/ c #5d5d11110b0b", | |
4016 | "( c #5e5e11110a0a", | |
4017 | ") c #5c5c12120d0d", | |
4018 | "_ c #5e5e12120c0c", | |
4019 | "` c #404031310404", | |
4020 | "' c #404031310505", | |
4021 | "] c #414132320606", | |
4022 | "[ c #424233330505", | |
4023 | "{ c #454535350606", | |
4024 | "} c #4b4b3a3a0707", | |
4025 | "| c #4e4e3d3d0606", | |
4026 | " . c #51513f3f0707", | |
4027 | ".. c #606012120b0b", | |
4028 | "X. c #636311110909", | |
4029 | "o. c #616113130e0e", | |
4030 | "O. c #646412120909", | |
4031 | "+. c #6a6a13130b0b", | |
4032 | "@. c #6e6e13130a0a", | |
4033 | "#. c #6e6e14140a0a", | |
4034 | "$. c #6f6f14140b0b", | |
4035 | "%. c #6d6d16160e0e", | |
4036 | "&. c #6e6e15150c0c", | |
4037 | "*. c #717115150d0d", | |
4038 | "=. c #727215150d0d", | |
4039 | "-. c #737315150c0c", | |
4040 | ";. c #737316160e0e", | |
4041 | ":. c #777715150c0c", | |
4042 | ">. c #787815150b0b", | |
4043 | ",. c #787815150c0c", | |
4044 | "<. c #737317171111", | |
4045 | "1. c #7a7a17171010", | |
4046 | "2. c #787818181212", | |
4047 | "3. c #7b7b19191212", | |
4048 | "4. c #525240400707", | |
4049 | "5. c #676750500909", | |
4050 | "6. c #696952520a0a", | |
4051 | "7. c #717157570a0a", | |
4052 | "8. c #74745a5a0c0c", | |
4053 | "9. c #7a7a61610909", | |
4054 | "0. c #7c7c61610c0c", | |
4055 | "q. c #858517170c0c", | |
4056 | "w. c #868618180d0d", | |
4057 | "e. c #8a8a18180c0c", | |
4058 | "r. c #8a8a19190f0f", | |
4059 | "t. c #808018181010", | |
4060 | "y. c #80801a1a1313", | |
4061 | "u. c #868619191010", | |
4062 | "i. c #86861b1b1313", | |
4063 | "p. c #87871b1b1212", | |
4064 | "a. c #85851b1b1414", | |
4065 | "s. c #88881a1a1111", | |
4066 | "d. c #89891a1a1111", | |
4067 | "f. c #8b8b1c1c1515", | |
4068 | "g. c #8d8d1b1b1212", | |
4069 | "h. c #8f8f1b1b1010", | |
4070 | "j. c #8c8c1c1c1414", | |
4071 | "k. c #90901a1a0f0f", | |
4072 | "l. c #91911a1a0f0f", | |
4073 | "z. c #92921a1a0e0e", | |
4074 | "x. c #9b9b1b1b0e0e", | |
4075 | "c. c #9a9a1c1c0f0f", | |
4076 | "v. c #93931b1b1010", | |
4077 | "b. c #90901e1e1212", | |
4078 | "n. c #97971e1e1515", | |
4079 | "m. c #99991d1d1313", | |
4080 | "M. c #98981d1d1414", | |
4081 | "N. c #98981f1f1717", | |
4082 | "B. c #99991f1f1616", | |
4083 | "V. c #9a9a1f1f1515", | |
4084 | "C. c #9b9b1e1e1414", | |
4085 | "Z. c #9b9b1f1f1717", | |
4086 | "A. c #9c9c1e1e1313", | |
4087 | "S. c #9d9d1e1e1212", | |
4088 | "D. c #9e9e1d1d1111", | |
4089 | "F. c #9f9f1d1d1010", | |
4090 | "G. c #9f9f1e1e1313", | |
4091 | "H. c #9d9d1f1f1515", | |
4092 | "J. c #9c9c1f1f1616", | |
4093 | "K. c #9e9e1e1e1414", | |
4094 | "L. c #a0a01d1d0f0f", | |
4095 | "P. c #a1a11c1c0e0e", | |
4096 | "I. c #a2a21d1d0f0f", | |
4097 | "U. c #a3a31c1c0e0e", | |
4098 | "Y. c #a3a31d1d0f0f", | |
4099 | "T. c #a4a41c1c0e0e", | |
4100 | "R. c #a6a61d1d0f0f", | |
4101 | "E. c #a7a71d1d0e0e", | |
4102 | "W. c #a9a91d1d0f0f", | |
4103 | "Q. c #a1a11d1d1010", | |
4104 | "!. c #a1a11d1d1111", | |
4105 | "~. c #a0a01e1e1212", | |
4106 | "^. c #a2a21d1d1010", | |
4107 | "/. c #b3b31f1f0f0f", | |
4108 | "(. c #b2b21f1f1010", | |
4109 | "). c #b9b920200f0f", | |
4110 | "_. c #b6b621211111", | |
4111 | "`. c #b7b720201010", | |
4112 | "'. c #baba20201010", | |
4113 | "]. c #bdbd21211111", | |
4114 | "[. c #bfbf22221212", | |
4115 | "{. c #abab42421616", | |
4116 | "}. c #b1b140401010", | |
4117 | "|. c #b9b95b5b1313", | |
4118 | " X c #bbbb5b5b1111", | |
4119 | ".X c #bfbf6f6f1616", | |
4120 | "XX c #92924f4f4848", | |
4121 | "oX c #c6c622221010", | |
4122 | "OX c #c8c823231212", | |
4123 | "+X c #caca23231010", | |
4124 | "@X c #cdcd25251313", | |
4125 | "#X c #d1d124241212", | |
4126 | "$X c #d2d224241111", | |
4127 | "%X c #d2d226261414", | |
4128 | "&X c #d5d525251111", | |
4129 | "*X c #d4d425251313", | |
4130 | "=X c #d9d926261313", | |
4131 | "-X c #dbdb26261212", | |
4132 | ";X c #d8d827271515", | |
4133 | ":X c #dcdc26261313", | |
4134 | ">X c #dede26261212", | |
4135 | ",X c #e0e027271212", | |
4136 | "<X c #e3e327271313", | |
4137 | "1X c #e6e627271212", | |
4138 | "2X c #e4e42e2e1a1a", | |
4139 | "3X c #ebeb27271313", | |
4140 | "4X c #ebeb28281212", | |
4141 | "5X c #e8e828281414", | |
4142 | "6X c #eaea29291515", | |
4143 | "7X c #eaea2a2a1616", | |
4144 | "8X c #ecec29291313", | |
4145 | "9X c #eeee29291313", | |
4146 | "0X c #eded29291414", | |
4147 | "qX c #ecec2a2a1616", | |
4148 | "wX c #efef29291414", | |
4149 | "eX c #f1f129291212", | |
4150 | "rX c #f3f329291212", | |
4151 | "tX c #f4f429291313", | |
4152 | "yX c #f5f529291313", | |
4153 | "uX c #f5f52a2a1313", | |
4154 | "iX c #f6f629291313", | |
4155 | "pX c #f7f729291313", | |
4156 | "aX c #f4f429291414", | |
4157 | "sX c #f4f42a2a1414", | |
4158 | "dX c #f6f62b2b1414", | |
4159 | "fX c #c1c169691616", | |
4160 | "gX c #c2c26f6f1212", | |
4161 | "hX c #c1c16f6f1414", | |
4162 | "jX c #c5c56b6b1212", | |
4163 | "kX c #c5c57e7e1616", | |
4164 | "lX c #c7c77e7e1414", | |
4165 | "zX c #c8c87e7e1414", | |
4166 | "xX c #b9b993930e0e", | |
4167 | "cX c #bdbd93931212", | |
4168 | "vX c #c9c985851717", | |
4169 | "bX c #cbcb86861717", | |
4170 | "nX c #cdcd87871313", | |
4171 | "mX c #cccc86861414", | |
4172 | "MX c #cccc86861515", | |
4173 | "NX c #cbcb89891414", | |
4174 | "BX c #cfcf88881212", | |
4175 | "VX c #cfcf8c8c1212", | |
4176 | "CX c #c3c39b9b0f0f", | |
4177 | "ZX c #c4c498981313", | |
4178 | "AX c #c7c79a9a1414", | |
4179 | "SX c #cbcb9e9e1313", | |
4180 | "DX c #d1d189891212", | |
4181 | "FX c #d2d288881414", | |
4182 | "GX c #d0d08c8c1313", | |
4183 | "HX c #d7d7a8a81616", | |
4184 | "JX c #d7d7a8a81a1a", | |
4185 | "KX c #d8d8a5a51c1c", | |
4186 | "LX c #dadaaaaa1616", | |
4187 | "PX c #dadaaaaa1717", | |
4188 | "IX c #dbdbaaaa1616", | |
4189 | "UX c #dbdbabab1717", | |
4190 | "YX c #dcdcabab1515", | |
4191 | "TX c #dcdcaeae1111", | |
4192 | "RX c #dedeacac1313", | |
4193 | "EX c #dfdfadad1313", | |
4194 | "WX c #d8d8a9a91919", | |
4195 | "QX c #d8d8a9a91a1a", | |
4196 | "!X c #d9d9aaaa1919", | |
4197 | "~X c #dfdfb1b11212", | |
4198 | "^X c #e0e0adad1111", | |
4199 | "/X c #e1e1aeae1212", | |
4200 | "(X c #e0e0aeae1414", | |
4201 | ")X c #e0e0b2b21313", | |
4202 | "_X c #808080808080", | |
4203 | "`X c None", | |
4204 | /* pixels */ | |
4205 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4206 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4207 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4208 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4209 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4210 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4211 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4212 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X9XsXoXb._X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4213 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X8XdX$XW.q. `X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4214 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`XE.iX&XE.P.x.O. `X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4215 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`XE.pX,X/.T.T.P.e.k i `X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4216 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X4X8X).T.T.}.T.c.X. `X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4217 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`XE.uX+XT.T. XgXY.L.z.n `X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4218 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`XE.yX-XR.T.T.^X~XY.Y.L.:. `X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4219 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X4X8X`.T.U./X~X~XFXY.F.l.R `X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4220 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`XE.uX+XT.T.jX~X~X~X~XQ.^.F.-. `X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4221 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`XE.tX>XR.T.T.^XTXxXTXRXBX^.F.k.T `X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4222 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X1XwX'.T.T.DXCXX 3 ' RXRX^.!.D.-. `X`X`X`X`X`X`X`X`X`X`X`X", | |
4223 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`XE.rX#XT.T.T.~X9.* q @ RXRXnX!.D.k.E `X`X`X`X`X`X`X`X`X`X`X`X", | |
4224 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X4X5X(.T.T.)X~XC + . t RXRXYX!.!.S.=. `X`X`X`X`X`X`X`X`X`X`X", | |
4225 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`XE.uXOXT.T.FX~X~Xc % V RXYXYXnX~.S.h.E `X`X`X`X`X`X`X`X`X`X`X", | |
4226 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`XE.eX:XR.T.Y.~X~X~Xb y [ YXYXYXYX~.~.S.*. `X`X`X`X`X`X`X`X`X`X", | |
4227 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X@.0X].T.T.GX~X~XRX| ` { YXYXYXIXmX~.S.d.U `X`X`X`X`X`X`X`X`X`X", | |
4228 | "`X`X`X`X`X`X`X`X`X`X`X`X`XR.aX=XR.T.Y.~X~X~XRXu X v ] YXYXIXIXIX~.G.m.( `X`X`X`X`X`X`X`X`X", | |
4229 | "`X`X`X`X`X`X`X`X`X`X`X`X`X<X6X`.T.I.)X~X~XRXRX: X 2 v YXIXIXIXIXMXG.A.u.j `X`X`X`X`X`X`X`X`X", | |
4230 | "`X`X`X`X`X`X`X`X`X`X`X`XR.wX*XT.Y.FX~X~XRXRXRX& 0 1 S IXIXIXIXPXPXG.G.M._ p `X`X`X`X`X`X`X`X", | |
4231 | "`X`X`X`X`X`X`X`X`X`X`X`X2X6X`.Y.Y.~X~XRXRXRXRX& w % 4.IXIXIXPXPXPXMXK.C.1.e `X`X`X`X`X`X`X`X", | |
4232 | "`X`X`X`X`X`X`X`X`X`X`XR.wX*XY.Y.GX~XRXRXRXRXYXD .r 7.IXIXPXPXPXPXWXK.K.g.W `X`X`X`X`X`X`X`X", | |
4233 | "`X`X`X`X`X`X`X`X`X`X`X2X6X`.Y.Y.~XRXRXRXRXYXYXcX5.Z AXIXIXPXPXPXWXWXbXK.V.%.$ `X`X`X`X`X`X`X", | |
4234 | "`X`X`X`X`X`X`X`X`X`XR.wX*XY.Y.GX~XRXRXRXYXYXYXYXIXIXIXIXPXPXPXPXWXWXWXH.V.p.P `X`X`X`X`X`X`X", | |
4235 | "`X`X`X`X`X`X`X`X`X`X2X6X_.Y.Y.~XRXRXRXYXYXYXYXSXv x ZXPXPXPXPXWXWXWXJXfXH.n.) = `X`X`X`X`X`X", | |
4236 | "`X`X`X`X`X`X`X`X`XR.wX%XY.Y.VXRXRXRXRXYXYXYXIX} O O 6.PXPXPXWXWXWXWXJXvXH.B.3.h `X`X`X`X`X`X", | |
4237 | "`X`X`X`X`X`X`X`X`XXXqX_.Y.Y.RXRXRXRXYXYXYXYXIXF % > 8.PXPXWXWXWXWXJXJXJXH.J.j.Y - `X`X`X`X`X`X", | |
4238 | "`X`X`X`X`X`X`X`XR.3X;XY.Y.zX(XEXRXYXYXYXYXIXIXcXA 0.HXPXWXWXWXWXJXJXJXJX.XJ.B.o. 7 `X`X`X`X`X", | |
4239 | "`X`X`X`X`X`X`X`X#.7X[.Y.^.^.^.^.!.!.!.|.hXlXNXLXUXUXUX!X!X!X!XQXQXQXQXKXkX{.B.2.g G `X`X`X`X`X", | |
4240 | "`X`X`X`X`X`X`X`XJ @XY.L.^.^.^.!.!.!.!.~.~.~.~.G.G.G.G.K.K.K.H.H.H.H.J.J.J.J.Z.f.I `X`X`X`X", | |
4241 | "`X`X`X`X`X`X`X`X9 >.! +.$.,.w.r.v.D.S.~.~.~.G.G.G.G.K.K.K.H.H.H.H.J.J.J.J.Z.Z.N.^ o `X`X`X`X", | |
4242 | "`X`X`X`X`X`X`X`X - # # , d l H K ~ / ..&.;.;.;.t.s.s.s.s.p.p.p.i.i.i.i.a.a.y.<.Q # ; `X`X`X`X", | |
4243 | "`X`X`X`X`X`X`X`X # # # # # # # # # < s a a f L B B B B B B N N N M M M m z e # `X`X`X`X", | |
4244 | "`X`X`X`X`X`X`X`X $ $ # # # # # # # # # # # # # # # # # # # # # # # # # o `X`X`X`X", | |
4245 | "`X`X`X`X`X`X`X`X`X 8 6 o o = = $ $ # # # # # # # # # # # # # # $ $ `X`X`X`X", | |
4246 | "`X`X`X`X`X`X`X`X`X`X`X`X`X 5 5 4 `X`X`X`X", | |
4247 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X `X`X`X`X`X`X", | |
4248 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4249 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4250 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4251 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X", | |
4252 | "`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X`X" | |
4253 | }; | |
4254 | ||
4255 | /* XPM */ | |
4256 | static char *question_xpm[] = { | |
4257 | /* columns rows colors chars-per-pixel */ | |
4258 | "48 48 101 2", | |
4259 | " c Gray0", | |
4260 | ". c Transparent", | |
4261 | "X c #010101010101", | |
4262 | "o c #000000000202", | |
4263 | "O c #000001010202", | |
4264 | "+ c #010101010202", | |
4265 | "@ c #010102020303", | |
4266 | "# c #020202020202", | |
4267 | "$ c #020202020303", | |
4268 | "% c Gray1", | |
4269 | "& c #030305050707", | |
4270 | "* c #040404040404", | |
4271 | "= c #040404040606", | |
4272 | "- c #070707070707", | |
4273 | "; c #060607070808", | |
4274 | ": c #060608080a0a", | |
4275 | "> c #060608080b0b", | |
4276 | ", c Gray3", | |
4277 | "< c #0d0d0d0d0c0c", | |
4278 | "1 c Gray6", | |
4279 | "2 c #191915150d0d", | |
4280 | "3 c Gray8", | |
4281 | "4 c Gray10", | |
4282 | "5 c #22221c1c1212", | |
4283 | "6 c #393939393939", | |
4284 | "7 c #2b2b3d3d6161", | |
4285 | "8 c #353545456464", | |
4286 | "9 c #65654f4f2424", | |
4287 | "0 c #6b6b55552727", | |
4288 | "q c #6e6e55552626", | |
4289 | "w c #707056562727", | |
4290 | "e c #717159592929", | |
4291 | "r c #73735f5f3b3b", | |
4292 | "t c #7c7c62622d2d", | |
4293 | "y c #7f7f69694141", | |
4294 | "u c Gray39", | |
4295 | "i c #727272727272", | |
4296 | "p c #737375757979", | |
4297 | "a c Gray50", | |
4298 | "s c #808063632d2d", | |
4299 | "d c #828266662f2f", | |
4300 | "f c #87876a6a3131", | |
4301 | "g c #8c8c6d6d3131", | |
4302 | "h c #929273733535", | |
4303 | "j c #939374743535", | |
4304 | "k c #949475753636", | |
4305 | "l c #979777773737", | |
4306 | "z c #99997a7a3b3b", | |
4307 | "x c #9d9d7d7d3a3a", | |
4308 | "c c #a2a27f7f3b3b", | |
4309 | "v c #92927c7c5252", | |
4310 | "b c #a6a682823c3c", | |
4311 | "n c #a8a884843d3d", | |
4312 | "m c #aaaa86863e3e", | |
4313 | "M c #a6a687874848", | |
4314 | "N c #a3a38e8e5555", | |
4315 | "B c #a4a48b8b5a5a", | |
4316 | "V c #b3b38d8d4040", | |
4317 | "C c #b8b892924343", | |
4318 | "Z c #b9b993934444", | |
4319 | "A c #bebe95954444", | |
4320 | "S c #bebe9b9b5353", | |
4321 | "D c #bebea3a36363", | |
4322 | "F c #bfbfa1a16a6a", | |
4323 | "G c #bebea2a27272", | |
4324 | "H c #c0c097974545", | |
4325 | "J c #c3c39f9f5555", | |
4326 | "K c #c3c39f9f5757", | |
4327 | "L c #c9c9a4a45b5b", | |
4328 | "P c #d2d2a6a64c4c", | |
4329 | "I c #d2d2a6a64d4d", | |
4330 | "U c #d8d8abab4e4e", | |
4331 | "Y c #d8d8acac5858", | |
4332 | "T c #d8d8acac5b5b", | |
4333 | "R c #d8d8b1b15f5f", | |
4334 | "E c #c3c3a4a46666", | |
4335 | "W c #c6c6a7a76a6a", | |
4336 | "Q c #c9c9acac7373", | |
4337 | "! c #d2d2b0b06c6c", | |
4338 | "~ c #d8d8b1b16363", | |
4339 | "^ c #d8d8b1b16565", | |
4340 | "/ c #dcdcb4b46363", | |
4341 | "( c #d8d8b5b56e6e", | |
4342 | ") c #d8d8b6b66e6e", | |
4343 | "_ c #dadab8b87272", | |
4344 | "` c #ddddbcbc7474", | |
4345 | "' c #d8d8baba7b7b", | |
4346 | "] c #f7f7c3c35a5a", | |
4347 | "[ c #f7f7c9c96d6d", | |
4348 | "{ c #f7f7cfcf7e7e", | |
4349 | "} c #aaaaaaaaaaaa", | |
4350 | "| c #d8d8bebe8686", | |
4351 | " . c #dcdcc4c49494", | |
4352 | ".. c #f7f7d4d48c8c", | |
4353 | "X. c #f7f7d8d89999", | |
4354 | "o. c #f7f7dcdca5a5", | |
4355 | "O. c #f7f7dfdfafaf", | |
4356 | "+. c #f7f7e2e2b8b8", | |
4357 | "@. c #f7f7e5e5c0c0", | |
4358 | "#. c Gray100", | |
4359 | "$. c None", | |
4360 | /* pixels */ | |
4361 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4362 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4363 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4364 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4365 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4366 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4367 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4368 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4369 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.< $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4370 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. c C U x b t $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4371 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. U X.X.+.X.' ' ' S b $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4372 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. ] O.@.X...] ] ] { ' R b q $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4373 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.< ] O.o.] n j j m ] ] { ) R b * $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4374 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$. D X.+.] k h ] ] [ R R s 1 $.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4375 | "$.$.$.$.$.$.$.$.$.$.$.$.$.< [ @.{ k o 7 @ K ] { U R b % $.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4376 | "$.$.$.$.$.$.$.$.$.$.$.$.$. N ..O.U o 8 a a B ] [ R U b # #.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4377 | "$.$.$.$.$.$.$.$.$.$.$.$.$. I { ] b 8 a #.#. B [ [ ) U d # } #.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4378 | "$.$.$.$.$.$.$.$.$.$.$.$.$. ] { ] b a #.#.$. B ] ) ) U 9 % } #.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4379 | "$.$.$.$.$.$.$.$.$.$.$.$.$. / R A d a #.$. E [ ' U b a } #.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4380 | "$.$.$.$.$.$.$.$.$.$.$.$.$. a #.$. g ! | R U e + a } #.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4381 | "$.$.$.$.$.$.$.$.$.$.$.$.$. : a #. Z ..| U A 3 a #.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4382 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$. a a a a a a - V [ | U U $ a } #.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4383 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. a a a a #. ] ..( Y z . 3 a #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4384 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. 0 J ._ Q F 2 3 a } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4385 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. f ! ( L W y & a } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4386 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. l ' ^ T G . p } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4387 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. H ' ~ T v = a #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4388 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. U | R U r a } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4389 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. S ' U A X a #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4390 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. M M b s ; } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4391 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. 4 6 O a } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4392 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. O > a #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4393 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. a i u a a } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4394 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.5 , #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4395 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. ` { ..A $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4396 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. { X.X.U # $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4397 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. ....R A # } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4398 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. ..) U A # } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4399 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. P R A w # } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4400 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. # } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4401 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. + a } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4402 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. , , , a a } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4403 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$. a a a } #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4404 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4405 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4406 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4407 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.", | |
4408 | "$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$." | |
4409 | }; | |
4410 | ||
536b70ac VS |
4411 | wxBitmap wxGTKArtProvider::CreateBitmap(const wxArtID& id, |
4412 | const wxArtClient& WXUNUSED(client), | |
4413 | const wxSize& WXUNUSED(size)) | |
63f06c22 | 4414 | { |
536b70ac VS |
4415 | if ( id == wxART_INFORMATION ) |
4416 | return wxBitmap(info_xpm); | |
4417 | if ( id == wxART_ERROR ) | |
4418 | return wxBitmap(error_xpm); | |
4419 | if ( id == wxART_WARNING ) | |
4420 | return wxBitmap(warning_xpm); | |
4421 | if ( id == wxART_QUESTION ) | |
4422 | return wxBitmap(question_xpm); | |
4423 | return wxNullBitmap; | |
63f06c22 VS |
4424 | } |
4425 | ||
24a23c35 | 4426 | |
1e6feb95 VZ |
4427 | // ============================================================================ |
4428 | // wxInputHandler | |
4429 | // ============================================================================ | |
4430 | ||
4431 | // ---------------------------------------------------------------------------- | |
4432 | // wxGTKInputHandler | |
4433 | // ---------------------------------------------------------------------------- | |
4434 | ||
4435 | wxGTKInputHandler::wxGTKInputHandler(wxGTKRenderer *renderer) | |
4436 | { | |
4437 | m_renderer = renderer; | |
4438 | } | |
4439 | ||
67e49a98 | 4440 | bool wxGTKInputHandler::HandleKey(wxInputConsumer *control, |
1e6feb95 VZ |
4441 | const wxKeyEvent& event, |
4442 | bool pressed) | |
4443 | { | |
4444 | return FALSE; | |
4445 | } | |
4446 | ||
67e49a98 | 4447 | bool wxGTKInputHandler::HandleMouse(wxInputConsumer *control, |
1e6feb95 VZ |
4448 | const wxMouseEvent& event) |
4449 | { | |
4450 | // clicking on the control gives it focus | |
67e49a98 | 4451 | if ( event.ButtonDown() && wxWindow::FindFocus() != control->GetInputWindow() ) |
1e6feb95 | 4452 | { |
67e49a98 | 4453 | control->GetInputWindow()->SetFocus(); |
1e6feb95 VZ |
4454 | |
4455 | return TRUE; | |
4456 | } | |
4457 | ||
4458 | return FALSE; | |
4459 | } | |
4460 | ||
67e49a98 | 4461 | bool wxGTKInputHandler::HandleMouseMove(wxInputConsumer *control, |
1e6feb95 VZ |
4462 | const wxMouseEvent& event) |
4463 | { | |
4464 | if ( event.Entering() ) | |
4465 | { | |
67e49a98 | 4466 | control->GetInputWindow()->SetCurrent(TRUE); |
1e6feb95 VZ |
4467 | } |
4468 | else if ( event.Leaving() ) | |
4469 | { | |
67e49a98 | 4470 | control->GetInputWindow()->SetCurrent(FALSE); |
1e6feb95 VZ |
4471 | } |
4472 | else | |
4473 | { | |
4474 | return FALSE; | |
4475 | } | |
4476 | ||
4477 | return TRUE; | |
4478 | } | |
4479 | ||
4480 | // ---------------------------------------------------------------------------- | |
4481 | // wxGTKCheckboxInputHandler | |
4482 | // ---------------------------------------------------------------------------- | |
4483 | ||
67e49a98 | 4484 | bool wxGTKCheckboxInputHandler::HandleKey(wxInputConsumer *control, |
1e6feb95 VZ |
4485 | const wxKeyEvent& event, |
4486 | bool pressed) | |
4487 | { | |
4488 | if ( pressed ) | |
4489 | { | |
4490 | int keycode = event.GetKeyCode(); | |
4491 | if ( keycode == WXK_SPACE || keycode == WXK_RETURN ) | |
4492 | { | |
4493 | control->PerformAction(wxACTION_CHECKBOX_TOGGLE); | |
4494 | ||
4495 | return TRUE; | |
4496 | } | |
4497 | } | |
4498 | ||
4499 | return FALSE; | |
4500 | } | |
4501 | ||
4502 | // ---------------------------------------------------------------------------- | |
4503 | // wxGTKTextCtrlInputHandler | |
4504 | // ---------------------------------------------------------------------------- | |
4505 | ||
67e49a98 | 4506 | bool wxGTKTextCtrlInputHandler::HandleKey(wxInputConsumer *control, |
1e6feb95 VZ |
4507 | const wxKeyEvent& event, |
4508 | bool pressed) | |
4509 | { | |
4510 | // handle only GTK-specific text bindings here, the others are handled in | |
4511 | // the base class | |
4512 | if ( pressed ) | |
4513 | { | |
4514 | wxControlAction action; | |
4515 | int keycode = event.GetKeyCode(); | |
4516 | if ( event.ControlDown() ) | |
4517 | { | |
4518 | switch ( keycode ) | |
4519 | { | |
4520 | case 'A': | |
4521 | action = wxACTION_TEXT_HOME; | |
4522 | break; | |
4523 | ||
4524 | case 'B': | |
4525 | action = wxACTION_TEXT_LEFT; | |
4526 | break; | |
4527 | ||
4528 | case 'D': | |
4529 | action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_RIGHT; | |
4530 | break; | |
4531 | ||
4532 | case 'E': | |
4533 | action = wxACTION_TEXT_END; | |
4534 | break; | |
4535 | ||
4536 | case 'F': | |
4537 | action = wxACTION_TEXT_RIGHT; | |
4538 | break; | |
4539 | ||
4540 | case 'H': | |
4541 | action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_LEFT; | |
4542 | break; | |
4543 | ||
4544 | case 'K': | |
4545 | action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_END; | |
4546 | break; | |
4547 | ||
4548 | case 'N': | |
4549 | action = wxACTION_TEXT_DOWN; | |
4550 | break; | |
4551 | ||
4552 | case 'P': | |
4553 | action = wxACTION_TEXT_UP; | |
4554 | break; | |
4555 | ||
4556 | case 'U': | |
4557 | //delete the entire line | |
4558 | control->PerformAction(wxACTION_TEXT_HOME); | |
4559 | action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_END; | |
4560 | break; | |
4561 | ||
4562 | case 'W': | |
4563 | action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_WORD_LEFT; | |
4564 | break; | |
4565 | } | |
4566 | } | |
4567 | else if ( event.AltDown() ) | |
4568 | { | |
4569 | switch ( keycode ) | |
4570 | { | |
4571 | case 'B': | |
4572 | action = wxACTION_TEXT_WORD_LEFT; | |
4573 | break; | |
4574 | ||
4575 | case 'D': | |
4576 | action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_WORD_RIGHT; | |
4577 | break; | |
4578 | ||
4579 | case 'F': | |
4580 | action = wxACTION_TEXT_WORD_RIGHT; | |
4581 | break; | |
4582 | } | |
4583 | } | |
4584 | ||
4585 | if ( action != wxACTION_NONE ) | |
4586 | { | |
4587 | control->PerformAction(action); | |
4588 | ||
4589 | return TRUE; | |
4590 | } | |
4591 | } | |
4592 | ||
4593 | return wxStdTextCtrlInputHandler::HandleKey(control, event, pressed); | |
4594 | } |