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