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