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