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