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