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