]> git.saurik.com Git - wxWidgets.git/blob - include/wx/ribbon/art.h
Compilation fix for wxPreferencesPage.
[wxWidgets.git] / include / wx / ribbon / art.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/ribbon/art.h
3 // Purpose: Art providers for ribbon-bar-style interface
4 // Author: Peter Cawley
5 // Modified by:
6 // Created: 2009-05-25
7 // RCS-ID: $Id$
8 // Copyright: (C) Peter Cawley
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_RIBBON_ART_H_
13 #define _WX_RIBBON_ART_H_
14
15 #include "wx/defs.h"
16
17 #if wxUSE_RIBBON
18
19 #include "wx/brush.h"
20 #include "wx/colour.h"
21 #include "wx/font.h"
22 #include "wx/pen.h"
23 #include "wx/bitmap.h"
24 #include "wx/ribbon/bar.h"
25
26 class WXDLLIMPEXP_FWD_CORE wxDC;
27 class WXDLLIMPEXP_FWD_CORE wxWindow;
28
29 enum wxRibbonArtSetting
30 {
31 wxRIBBON_ART_TAB_SEPARATION_SIZE,
32 wxRIBBON_ART_PAGE_BORDER_LEFT_SIZE,
33 wxRIBBON_ART_PAGE_BORDER_TOP_SIZE,
34 wxRIBBON_ART_PAGE_BORDER_RIGHT_SIZE,
35 wxRIBBON_ART_PAGE_BORDER_BOTTOM_SIZE,
36 wxRIBBON_ART_PANEL_X_SEPARATION_SIZE,
37 wxRIBBON_ART_PANEL_Y_SEPARATION_SIZE,
38 wxRIBBON_ART_TOOL_GROUP_SEPARATION_SIZE,
39 wxRIBBON_ART_GALLERY_BITMAP_PADDING_LEFT_SIZE,
40 wxRIBBON_ART_GALLERY_BITMAP_PADDING_RIGHT_SIZE,
41 wxRIBBON_ART_GALLERY_BITMAP_PADDING_TOP_SIZE,
42 wxRIBBON_ART_GALLERY_BITMAP_PADDING_BOTTOM_SIZE,
43 wxRIBBON_ART_PANEL_LABEL_FONT,
44 wxRIBBON_ART_BUTTON_BAR_LABEL_FONT,
45 wxRIBBON_ART_TAB_LABEL_FONT,
46 wxRIBBON_ART_BUTTON_BAR_LABEL_COLOUR,
47 wxRIBBON_ART_BUTTON_BAR_HOVER_BORDER_COLOUR,
48 wxRIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_TOP_COLOUR,
49 wxRIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR,
50 wxRIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_COLOUR,
51 wxRIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_GRADIENT_COLOUR,
52 wxRIBBON_ART_BUTTON_BAR_ACTIVE_BORDER_COLOUR,
53 wxRIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_TOP_COLOUR,
54 wxRIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR,
55 wxRIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_COLOUR,
56 wxRIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_GRADIENT_COLOUR,
57 wxRIBBON_ART_GALLERY_BORDER_COLOUR,
58 wxRIBBON_ART_GALLERY_HOVER_BACKGROUND_COLOUR,
59 wxRIBBON_ART_GALLERY_BUTTON_BACKGROUND_COLOUR,
60 wxRIBBON_ART_GALLERY_BUTTON_BACKGROUND_GRADIENT_COLOUR,
61 wxRIBBON_ART_GALLERY_BUTTON_BACKGROUND_TOP_COLOUR,
62 wxRIBBON_ART_GALLERY_BUTTON_FACE_COLOUR,
63 wxRIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_COLOUR,
64 wxRIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_GRADIENT_COLOUR,
65 wxRIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_TOP_COLOUR,
66 wxRIBBON_ART_GALLERY_BUTTON_HOVER_FACE_COLOUR,
67 wxRIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_COLOUR,
68 wxRIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_GRADIENT_COLOUR,
69 wxRIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_TOP_COLOUR,
70 wxRIBBON_ART_GALLERY_BUTTON_ACTIVE_FACE_COLOUR,
71 wxRIBBON_ART_GALLERY_BUTTON_DISABLED_BACKGROUND_COLOUR,
72 wxRIBBON_ART_GALLERY_BUTTON_DISABLED_BACKGROUND_GRADIENT_COLOUR,
73 wxRIBBON_ART_GALLERY_BUTTON_DISABLED_BACKGROUND_TOP_COLOUR,
74 wxRIBBON_ART_GALLERY_BUTTON_DISABLED_FACE_COLOUR,
75 wxRIBBON_ART_GALLERY_ITEM_BORDER_COLOUR,
76 wxRIBBON_ART_TAB_LABEL_COLOUR,
77 wxRIBBON_ART_TAB_SEPARATOR_COLOUR,
78 wxRIBBON_ART_TAB_SEPARATOR_GRADIENT_COLOUR,
79 wxRIBBON_ART_TAB_CTRL_BACKGROUND_COLOUR,
80 wxRIBBON_ART_TAB_CTRL_BACKGROUND_GRADIENT_COLOUR,
81 wxRIBBON_ART_TAB_HOVER_BACKGROUND_TOP_COLOUR,
82 wxRIBBON_ART_TAB_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR,
83 wxRIBBON_ART_TAB_HOVER_BACKGROUND_COLOUR,
84 wxRIBBON_ART_TAB_HOVER_BACKGROUND_GRADIENT_COLOUR,
85 wxRIBBON_ART_TAB_ACTIVE_BACKGROUND_TOP_COLOUR,
86 wxRIBBON_ART_TAB_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR,
87 wxRIBBON_ART_TAB_ACTIVE_BACKGROUND_COLOUR,
88 wxRIBBON_ART_TAB_ACTIVE_BACKGROUND_GRADIENT_COLOUR,
89 wxRIBBON_ART_TAB_BORDER_COLOUR,
90 wxRIBBON_ART_PANEL_BORDER_COLOUR,
91 wxRIBBON_ART_PANEL_BORDER_GRADIENT_COLOUR,
92 wxRIBBON_ART_PANEL_MINIMISED_BORDER_COLOUR,
93 wxRIBBON_ART_PANEL_MINIMISED_BORDER_GRADIENT_COLOUR,
94 wxRIBBON_ART_PANEL_LABEL_BACKGROUND_COLOUR,
95 wxRIBBON_ART_PANEL_LABEL_BACKGROUND_GRADIENT_COLOUR,
96 wxRIBBON_ART_PANEL_LABEL_COLOUR,
97 wxRIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_COLOUR,
98 wxRIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_GRADIENT_COLOUR,
99 wxRIBBON_ART_PANEL_HOVER_LABEL_COLOUR,
100 wxRIBBON_ART_PANEL_MINIMISED_LABEL_COLOUR,
101 wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_COLOUR,
102 wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR,
103 wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_COLOUR,
104 wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_GRADIENT_COLOUR,
105 wxRIBBON_ART_PANEL_BUTTON_FACE_COLOUR,
106 wxRIBBON_ART_PANEL_BUTTON_HOVER_FACE_COLOUR,
107
108 wxRIBBON_ART_PAGE_TOGGLE_FACE_COLOUR,
109 wxRIBBON_ART_PAGE_TOGGLE_HOVER_FACE_COLOUR,
110
111 wxRIBBON_ART_PAGE_BORDER_COLOUR,
112 wxRIBBON_ART_PAGE_BACKGROUND_TOP_COLOUR,
113 wxRIBBON_ART_PAGE_BACKGROUND_TOP_GRADIENT_COLOUR,
114 wxRIBBON_ART_PAGE_BACKGROUND_COLOUR,
115 wxRIBBON_ART_PAGE_BACKGROUND_GRADIENT_COLOUR,
116 wxRIBBON_ART_PAGE_HOVER_BACKGROUND_TOP_COLOUR,
117 wxRIBBON_ART_PAGE_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR,
118 wxRIBBON_ART_PAGE_HOVER_BACKGROUND_COLOUR,
119 wxRIBBON_ART_PAGE_HOVER_BACKGROUND_GRADIENT_COLOUR,
120 wxRIBBON_ART_TOOLBAR_BORDER_COLOUR,
121 wxRIBBON_ART_TOOLBAR_HOVER_BORDER_COLOUR,
122 wxRIBBON_ART_TOOLBAR_FACE_COLOUR,
123 wxRIBBON_ART_TOOL_BACKGROUND_TOP_COLOUR,
124 wxRIBBON_ART_TOOL_BACKGROUND_TOP_GRADIENT_COLOUR,
125 wxRIBBON_ART_TOOL_BACKGROUND_COLOUR,
126 wxRIBBON_ART_TOOL_BACKGROUND_GRADIENT_COLOUR,
127 wxRIBBON_ART_TOOL_HOVER_BACKGROUND_TOP_COLOUR,
128 wxRIBBON_ART_TOOL_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR,
129 wxRIBBON_ART_TOOL_HOVER_BACKGROUND_COLOUR,
130 wxRIBBON_ART_TOOL_HOVER_BACKGROUND_GRADIENT_COLOUR,
131 wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_TOP_COLOUR,
132 wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR,
133 wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_COLOUR,
134 wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_GRADIENT_COLOUR,
135 wxRIBBON_ART_BUTTON_BAR_LABEL_DISABLED_COLOUR
136 };
137
138 enum wxRibbonScrollButtonStyle
139 {
140 wxRIBBON_SCROLL_BTN_LEFT = 0,
141 wxRIBBON_SCROLL_BTN_RIGHT = 1,
142 wxRIBBON_SCROLL_BTN_UP = 2,
143 wxRIBBON_SCROLL_BTN_DOWN = 3,
144
145 wxRIBBON_SCROLL_BTN_DIRECTION_MASK = 3,
146
147 wxRIBBON_SCROLL_BTN_NORMAL = 0,
148 wxRIBBON_SCROLL_BTN_HOVERED = 4,
149 wxRIBBON_SCROLL_BTN_ACTIVE = 8,
150
151 wxRIBBON_SCROLL_BTN_STATE_MASK = 12,
152
153 wxRIBBON_SCROLL_BTN_FOR_OTHER = 0,
154 wxRIBBON_SCROLL_BTN_FOR_TABS = 16,
155 wxRIBBON_SCROLL_BTN_FOR_PAGE = 32,
156
157 wxRIBBON_SCROLL_BTN_FOR_MASK = 48
158 };
159
160 enum wxRibbonButtonKind
161 {
162 wxRIBBON_BUTTON_NORMAL = 1 << 0,
163 wxRIBBON_BUTTON_DROPDOWN = 1 << 1,
164 wxRIBBON_BUTTON_HYBRID = wxRIBBON_BUTTON_NORMAL | wxRIBBON_BUTTON_DROPDOWN,
165 wxRIBBON_BUTTON_TOGGLE = 1 << 2
166 };
167
168 enum wxRibbonButtonBarButtonState
169 {
170 wxRIBBON_BUTTONBAR_BUTTON_SMALL = 0 << 0,
171 wxRIBBON_BUTTONBAR_BUTTON_MEDIUM = 1 << 0,
172 wxRIBBON_BUTTONBAR_BUTTON_LARGE = 2 << 0,
173 wxRIBBON_BUTTONBAR_BUTTON_SIZE_MASK = 3 << 0,
174
175 wxRIBBON_BUTTONBAR_BUTTON_NORMAL_HOVERED = 1 << 3,
176 wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_HOVERED = 1 << 4,
177 wxRIBBON_BUTTONBAR_BUTTON_HOVER_MASK = wxRIBBON_BUTTONBAR_BUTTON_NORMAL_HOVERED | wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_HOVERED,
178 wxRIBBON_BUTTONBAR_BUTTON_NORMAL_ACTIVE = 1 << 5,
179 wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE = 1 << 6,
180 wxRIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK = wxRIBBON_BUTTONBAR_BUTTON_NORMAL_ACTIVE | wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE,
181 wxRIBBON_BUTTONBAR_BUTTON_DISABLED = 1 << 7,
182 wxRIBBON_BUTTONBAR_BUTTON_TOGGLED = 1 << 8,
183 wxRIBBON_BUTTONBAR_BUTTON_STATE_MASK = 0x1F8
184 };
185
186 enum wxRibbonGalleryButtonState
187 {
188 wxRIBBON_GALLERY_BUTTON_NORMAL,
189 wxRIBBON_GALLERY_BUTTON_HOVERED,
190 wxRIBBON_GALLERY_BUTTON_ACTIVE,
191 wxRIBBON_GALLERY_BUTTON_DISABLED
192 };
193
194 class wxRibbonBar;
195 class wxRibbonPage;
196 class wxRibbonPanel;
197 class wxRibbonGallery;
198 class wxRibbonGalleryItem;
199 class wxRibbonPageTabInfo;
200 class wxRibbonPageTabInfoArray;
201
202 class WXDLLIMPEXP_RIBBON wxRibbonArtProvider
203 {
204 public:
205 wxRibbonArtProvider();
206 virtual ~wxRibbonArtProvider();
207
208 virtual wxRibbonArtProvider* Clone() const = 0;
209 virtual void SetFlags(long flags) = 0;
210 virtual long GetFlags() const = 0;
211
212 virtual int GetMetric(int id) const = 0;
213 virtual void SetMetric(int id, int new_val) = 0;
214 virtual void SetFont(int id, const wxFont& font) = 0;
215 virtual wxFont GetFont(int id) const = 0;
216 virtual wxColour GetColour(int id) const = 0;
217 virtual void SetColour(int id, const wxColor& colour) = 0;
218 wxColour GetColor(int id) const { return GetColour(id); }
219 void SetColor(int id, const wxColour& color) { SetColour(id, color); }
220 virtual void GetColourScheme(wxColour* primary,
221 wxColour* secondary,
222 wxColour* tertiary) const = 0;
223 virtual void SetColourScheme(const wxColour& primary,
224 const wxColour& secondary,
225 const wxColour& tertiary) = 0;
226
227 virtual void DrawTabCtrlBackground(
228 wxDC& dc,
229 wxWindow* wnd,
230 const wxRect& rect) = 0;
231
232 virtual void DrawTab(wxDC& dc,
233 wxWindow* wnd,
234 const wxRibbonPageTabInfo& tab) = 0;
235
236 virtual void DrawTabSeparator(wxDC& dc,
237 wxWindow* wnd,
238 const wxRect& rect,
239 double visibility) = 0;
240
241 virtual void DrawPageBackground(
242 wxDC& dc,
243 wxWindow* wnd,
244 const wxRect& rect) = 0;
245
246 virtual void DrawScrollButton(
247 wxDC& dc,
248 wxWindow* wnd,
249 const wxRect& rect,
250 long style) = 0;
251
252 virtual void DrawPanelBackground(
253 wxDC& dc,
254 wxRibbonPanel* wnd,
255 const wxRect& rect) = 0;
256
257 virtual void DrawGalleryBackground(
258 wxDC& dc,
259 wxRibbonGallery* wnd,
260 const wxRect& rect) = 0;
261
262 virtual void DrawGalleryItemBackground(
263 wxDC& dc,
264 wxRibbonGallery* wnd,
265 const wxRect& rect,
266 wxRibbonGalleryItem* item) = 0;
267
268 virtual void DrawMinimisedPanel(
269 wxDC& dc,
270 wxRibbonPanel* wnd,
271 const wxRect& rect,
272 wxBitmap& bitmap) = 0;
273
274 virtual void DrawButtonBarBackground(
275 wxDC& dc,
276 wxWindow* wnd,
277 const wxRect& rect) = 0;
278
279 virtual void DrawButtonBarButton(
280 wxDC& dc,
281 wxWindow* wnd,
282 const wxRect& rect,
283 wxRibbonButtonKind kind,
284 long state,
285 const wxString& label,
286 const wxBitmap& bitmap_large,
287 const wxBitmap& bitmap_small) = 0;
288
289 virtual void DrawToolBarBackground(
290 wxDC& dc,
291 wxWindow* wnd,
292 const wxRect& rect) = 0;
293
294 virtual void DrawToolGroupBackground(
295 wxDC& dc,
296 wxWindow* wnd,
297 const wxRect& rect) = 0;
298
299 virtual void DrawTool(
300 wxDC& dc,
301 wxWindow* wnd,
302 const wxRect& rect,
303 const wxBitmap& bitmap,
304 wxRibbonButtonKind kind,
305 long state) = 0;
306
307 virtual void DrawToggleButton(
308 wxDC& dc,
309 wxRibbonBar* wnd,
310 const wxRect& rect,
311 wxRibbonDisplayMode mode) = 0;
312
313 virtual void DrawHelpButton(
314 wxDC& dc,
315 wxRibbonBar* wnd,
316 const wxRect& rect) = 0;
317
318 virtual void GetBarTabWidth(
319 wxDC& dc,
320 wxWindow* wnd,
321 const wxString& label,
322 const wxBitmap& bitmap,
323 int* ideal,
324 int* small_begin_need_separator,
325 int* small_must_have_separator,
326 int* minimum) = 0;
327
328 virtual int GetTabCtrlHeight(
329 wxDC& dc,
330 wxWindow* wnd,
331 const wxRibbonPageTabInfoArray& pages) = 0;
332
333 virtual wxSize GetScrollButtonMinimumSize(
334 wxDC& dc,
335 wxWindow* wnd,
336 long style) = 0;
337
338 virtual wxSize GetPanelSize(
339 wxDC& dc,
340 const wxRibbonPanel* wnd,
341 wxSize client_size,
342 wxPoint* client_offset) = 0;
343
344 virtual wxSize GetPanelClientSize(
345 wxDC& dc,
346 const wxRibbonPanel* wnd,
347 wxSize size,
348 wxPoint* client_offset) = 0;
349
350 virtual wxRect GetPanelExtButtonArea(
351 wxDC& dc,
352 const wxRibbonPanel* wnd,
353 wxRect rect) = 0;
354
355 virtual wxSize GetGallerySize(
356 wxDC& dc,
357 const wxRibbonGallery* wnd,
358 wxSize client_size) = 0;
359
360 virtual wxSize GetGalleryClientSize(
361 wxDC& dc,
362 const wxRibbonGallery* wnd,
363 wxSize size,
364 wxPoint* client_offset,
365 wxRect* scroll_up_button,
366 wxRect* scroll_down_button,
367 wxRect* extension_button) = 0;
368
369 virtual wxRect GetPageBackgroundRedrawArea(
370 wxDC& dc,
371 const wxRibbonPage* wnd,
372 wxSize page_old_size,
373 wxSize page_new_size) = 0;
374
375 virtual bool GetButtonBarButtonSize(
376 wxDC& dc,
377 wxWindow* wnd,
378 wxRibbonButtonKind kind,
379 wxRibbonButtonBarButtonState size,
380 const wxString& label,
381 wxSize bitmap_size_large,
382 wxSize bitmap_size_small,
383 wxSize* button_size,
384 wxRect* normal_region,
385 wxRect* dropdown_region) = 0;
386
387 virtual wxSize GetMinimisedPanelMinimumSize(
388 wxDC& dc,
389 const wxRibbonPanel* wnd,
390 wxSize* desired_bitmap_size,
391 wxDirection* expanded_panel_direction) = 0;
392
393 virtual wxSize GetToolSize(
394 wxDC& dc,
395 wxWindow* wnd,
396 wxSize bitmap_size,
397 wxRibbonButtonKind kind,
398 bool is_first,
399 bool is_last,
400 wxRect* dropdown_region) = 0;
401
402 virtual wxRect GetBarToggleButtonArea(const wxRect& rect)= 0;
403
404 virtual wxRect GetRibbonHelpButtonArea(const wxRect& rect) = 0;
405 };
406
407 class WXDLLIMPEXP_RIBBON wxRibbonMSWArtProvider : public wxRibbonArtProvider
408 {
409 public:
410 wxRibbonMSWArtProvider(bool set_colour_scheme = true);
411 virtual ~wxRibbonMSWArtProvider();
412
413 wxRibbonArtProvider* Clone() const;
414 void SetFlags(long flags);
415 long GetFlags() const;
416
417 int GetMetric(int id) const;
418 void SetMetric(int id, int new_val);
419 void SetFont(int id, const wxFont& font);
420 wxFont GetFont(int id) const;
421 wxColour GetColour(int id) const;
422 void SetColour(int id, const wxColor& colour);
423 void GetColourScheme(wxColour* primary,
424 wxColour* secondary,
425 wxColour* tertiary) const;
426 void SetColourScheme(const wxColour& primary,
427 const wxColour& secondary,
428 const wxColour& tertiary);
429
430 int GetTabCtrlHeight(
431 wxDC& dc,
432 wxWindow* wnd,
433 const wxRibbonPageTabInfoArray& pages);
434
435 void DrawTabCtrlBackground(
436 wxDC& dc,
437 wxWindow* wnd,
438 const wxRect& rect);
439
440 void DrawTab(wxDC& dc,
441 wxWindow* wnd,
442 const wxRibbonPageTabInfo& tab);
443
444 void DrawTabSeparator(
445 wxDC& dc,
446 wxWindow* wnd,
447 const wxRect& rect,
448 double visibility);
449
450 void DrawPageBackground(
451 wxDC& dc,
452 wxWindow* wnd,
453 const wxRect& rect);
454
455 void DrawScrollButton(
456 wxDC& dc,
457 wxWindow* wnd,
458 const wxRect& rect,
459 long style);
460
461 void DrawPanelBackground(
462 wxDC& dc,
463 wxRibbonPanel* wnd,
464 const wxRect& rect);
465
466 void DrawGalleryBackground(
467 wxDC& dc,
468 wxRibbonGallery* wnd,
469 const wxRect& rect);
470
471 void DrawGalleryItemBackground(
472 wxDC& dc,
473 wxRibbonGallery* wnd,
474 const wxRect& rect,
475 wxRibbonGalleryItem* item);
476
477 void DrawMinimisedPanel(
478 wxDC& dc,
479 wxRibbonPanel* wnd,
480 const wxRect& rect,
481 wxBitmap& bitmap);
482
483 void DrawButtonBarBackground(
484 wxDC& dc,
485 wxWindow* wnd,
486 const wxRect& rect);
487
488 void DrawButtonBarButton(
489 wxDC& dc,
490 wxWindow* wnd,
491 const wxRect& rect,
492 wxRibbonButtonKind kind,
493 long state,
494 const wxString& label,
495 const wxBitmap& bitmap_large,
496 const wxBitmap& bitmap_small);
497
498 void DrawToolBarBackground(
499 wxDC& dc,
500 wxWindow* wnd,
501 const wxRect& rect);
502
503 void DrawToolGroupBackground(
504 wxDC& dc,
505 wxWindow* wnd,
506 const wxRect& rect);
507
508 void DrawTool(
509 wxDC& dc,
510 wxWindow* wnd,
511 const wxRect& rect,
512 const wxBitmap& bitmap,
513 wxRibbonButtonKind kind,
514 long state);
515
516 void DrawToggleButton(
517 wxDC& dc,
518 wxRibbonBar* wnd,
519 const wxRect& rect,
520 wxRibbonDisplayMode mode);
521
522 void DrawHelpButton(wxDC& dc,
523 wxRibbonBar* wnd,
524 const wxRect& rect);
525
526 void GetBarTabWidth(
527 wxDC& dc,
528 wxWindow* wnd,
529 const wxString& label,
530 const wxBitmap& bitmap,
531 int* ideal,
532 int* small_begin_need_separator,
533 int* small_must_have_separator,
534 int* minimum);
535
536 wxSize GetScrollButtonMinimumSize(
537 wxDC& dc,
538 wxWindow* wnd,
539 long style);
540
541 wxSize GetPanelSize(
542 wxDC& dc,
543 const wxRibbonPanel* wnd,
544 wxSize client_size,
545 wxPoint* client_offset);
546
547 wxSize GetPanelClientSize(
548 wxDC& dc,
549 const wxRibbonPanel* wnd,
550 wxSize size,
551 wxPoint* client_offset);
552
553 wxRect GetPanelExtButtonArea(
554 wxDC& dc,
555 const wxRibbonPanel* wnd,
556 wxRect rect);
557
558 wxSize GetGallerySize(
559 wxDC& dc,
560 const wxRibbonGallery* wnd,
561 wxSize client_size);
562
563 wxSize GetGalleryClientSize(
564 wxDC& dc,
565 const wxRibbonGallery* wnd,
566 wxSize size,
567 wxPoint* client_offset,
568 wxRect* scroll_up_button,
569 wxRect* scroll_down_button,
570 wxRect* extension_button);
571
572 wxRect GetPageBackgroundRedrawArea(
573 wxDC& dc,
574 const wxRibbonPage* wnd,
575 wxSize page_old_size,
576 wxSize page_new_size);
577
578 bool GetButtonBarButtonSize(
579 wxDC& dc,
580 wxWindow* wnd,
581 wxRibbonButtonKind kind,
582 wxRibbonButtonBarButtonState size,
583 const wxString& label,
584 wxSize bitmap_size_large,
585 wxSize bitmap_size_small,
586 wxSize* button_size,
587 wxRect* normal_region,
588 wxRect* dropdown_region);
589
590 wxSize GetMinimisedPanelMinimumSize(
591 wxDC& dc,
592 const wxRibbonPanel* wnd,
593 wxSize* desired_bitmap_size,
594 wxDirection* expanded_panel_direction);
595
596 wxSize GetToolSize(
597 wxDC& dc,
598 wxWindow* wnd,
599 wxSize bitmap_size,
600 wxRibbonButtonKind kind,
601 bool is_first,
602 bool is_last,
603 wxRect* dropdown_region);
604
605 wxRect GetBarToggleButtonArea(const wxRect& rect);
606
607 wxRect GetRibbonHelpButtonArea(const wxRect& rect);
608
609 protected:
610 void ReallyDrawTabSeparator(wxWindow* wnd, const wxRect& rect, double visibility);
611 void DrawPartialPageBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect,
612 bool allow_hovered = true);
613 void DrawPartialPageBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect,
614 wxRibbonPage* page, wxPoint offset, bool hovered = false);
615 void DrawPanelBorder(wxDC& dc, const wxRect& rect, wxPen& primary_colour,
616 wxPen& secondary_colour);
617 void RemovePanelPadding(wxRect* rect);
618 void DrawDropdownArrow(wxDC& dc, int x, int y, const wxColour& colour);
619 void DrawGalleryBackgroundCommon(wxDC& dc, wxRibbonGallery* wnd,
620 const wxRect& rect);
621 virtual void DrawGalleryButton(wxDC& dc, wxRect rect,
622 wxRibbonGalleryButtonState state, wxBitmap* bitmaps);
623 void DrawButtonBarButtonForeground(
624 wxDC& dc,
625 const wxRect& rect,
626 wxRibbonButtonKind kind,
627 long state,
628 const wxString& label,
629 const wxBitmap& bitmap_large,
630 const wxBitmap& bitmap_small);
631 void DrawMinimisedPanelCommon(
632 wxDC& dc,
633 wxRibbonPanel* wnd,
634 const wxRect& rect,
635 wxRect* preview_rect);
636 void CloneTo(wxRibbonMSWArtProvider* copy) const;
637
638 wxBitmap m_cached_tab_separator;
639 wxBitmap m_gallery_up_bitmap[4];
640 wxBitmap m_gallery_down_bitmap[4];
641 wxBitmap m_gallery_extension_bitmap[4];
642 wxBitmap m_toolbar_drop_bitmap;
643 wxBitmap m_panel_extension_bitmap[2];
644 wxBitmap m_ribbon_toggle_up_bitmap[2];
645 wxBitmap m_ribbon_toggle_down_bitmap[2];
646 wxBitmap m_ribbon_toggle_pin_bitmap[2];
647 wxBitmap m_ribbon_bar_help_button_bitmap[2];
648
649 wxColour m_primary_scheme_colour;
650 wxColour m_secondary_scheme_colour;
651 wxColour m_tertiary_scheme_colour;
652
653 wxColour m_button_bar_label_colour;
654 wxColour m_button_bar_label_disabled_colour;
655 wxColour m_tab_label_colour;
656 wxColour m_tab_separator_colour;
657 wxColour m_tab_separator_gradient_colour;
658 wxColour m_tab_active_background_colour;
659 wxColour m_tab_active_background_gradient_colour;
660 wxColour m_tab_hover_background_colour;
661 wxColour m_tab_hover_background_gradient_colour;
662 wxColour m_tab_hover_background_top_colour;
663 wxColour m_tab_hover_background_top_gradient_colour;
664 wxColour m_panel_label_colour;
665 wxColour m_panel_minimised_label_colour;
666 wxColour m_panel_hover_label_colour;
667 wxColour m_panel_active_background_colour;
668 wxColour m_panel_active_background_gradient_colour;
669 wxColour m_panel_active_background_top_colour;
670 wxColour m_panel_active_background_top_gradient_colour;
671 wxColour m_panel_button_face_colour;
672 wxColour m_panel_button_hover_face_colour;
673 wxColour m_page_toggle_face_colour;
674 wxColour m_page_toggle_hover_face_colour;
675 wxColour m_page_background_colour;
676 wxColour m_page_background_gradient_colour;
677 wxColour m_page_background_top_colour;
678 wxColour m_page_background_top_gradient_colour;
679 wxColour m_page_hover_background_colour;
680 wxColour m_page_hover_background_gradient_colour;
681 wxColour m_page_hover_background_top_colour;
682 wxColour m_page_hover_background_top_gradient_colour;
683 wxColour m_button_bar_hover_background_colour;
684 wxColour m_button_bar_hover_background_gradient_colour;
685 wxColour m_button_bar_hover_background_top_colour;
686 wxColour m_button_bar_hover_background_top_gradient_colour;
687 wxColour m_button_bar_active_background_colour;
688 wxColour m_button_bar_active_background_gradient_colour;
689 wxColour m_button_bar_active_background_top_colour;
690 wxColour m_button_bar_active_background_top_gradient_colour;
691 wxColour m_gallery_button_background_colour;
692 wxColour m_gallery_button_background_gradient_colour;
693 wxColour m_gallery_button_hover_background_colour;
694 wxColour m_gallery_button_hover_background_gradient_colour;
695 wxColour m_gallery_button_active_background_colour;
696 wxColour m_gallery_button_active_background_gradient_colour;
697 wxColour m_gallery_button_disabled_background_colour;
698 wxColour m_gallery_button_disabled_background_gradient_colour;
699 wxColour m_gallery_button_face_colour;
700 wxColour m_gallery_button_hover_face_colour;
701 wxColour m_gallery_button_active_face_colour;
702 wxColour m_gallery_button_disabled_face_colour;
703
704 wxColour m_tool_face_colour;
705 wxColour m_tool_background_top_colour;
706 wxColour m_tool_background_top_gradient_colour;
707 wxColour m_tool_background_colour;
708 wxColour m_tool_background_gradient_colour;
709 wxColour m_tool_hover_background_top_colour;
710 wxColour m_tool_hover_background_top_gradient_colour;
711 wxColour m_tool_hover_background_colour;
712 wxColour m_tool_hover_background_gradient_colour;
713 wxColour m_tool_active_background_top_colour;
714 wxColour m_tool_active_background_top_gradient_colour;
715 wxColour m_tool_active_background_colour;
716 wxColour m_tool_active_background_gradient_colour;
717
718 wxBrush m_tab_ctrl_background_brush;
719 wxBrush m_panel_label_background_brush;
720 wxBrush m_panel_hover_label_background_brush;
721 wxBrush m_panel_hover_button_background_brush;
722 wxBrush m_gallery_hover_background_brush;
723 wxBrush m_gallery_button_background_top_brush;
724 wxBrush m_gallery_button_hover_background_top_brush;
725 wxBrush m_gallery_button_active_background_top_brush;
726 wxBrush m_gallery_button_disabled_background_top_brush;
727 wxBrush m_ribbon_toggle_brush;
728
729 wxFont m_tab_label_font;
730 wxFont m_panel_label_font;
731 wxFont m_button_bar_label_font;
732
733 wxPen m_page_border_pen;
734 wxPen m_panel_border_pen;
735 wxPen m_panel_border_gradient_pen;
736 wxPen m_panel_minimised_border_pen;
737 wxPen m_panel_minimised_border_gradient_pen;
738 wxPen m_panel_hover_button_border_pen;
739 wxPen m_tab_border_pen;
740 wxPen m_button_bar_hover_border_pen;
741 wxPen m_button_bar_active_border_pen;
742 wxPen m_gallery_border_pen;
743 wxPen m_gallery_item_border_pen;
744 wxPen m_toolbar_border_pen;
745 wxPen m_ribbon_toggle_pen;
746
747 double m_cached_tab_separator_visibility;
748 long m_flags;
749
750 int m_tab_separation_size;
751 int m_page_border_left;
752 int m_page_border_top;
753 int m_page_border_right;
754 int m_page_border_bottom;
755 int m_panel_x_separation_size;
756 int m_panel_y_separation_size;
757 int m_tool_group_separation_size;
758 int m_gallery_bitmap_padding_left_size;
759 int m_gallery_bitmap_padding_right_size;
760 int m_gallery_bitmap_padding_top_size;
761 int m_gallery_bitmap_padding_bottom_size;
762 int m_toggle_button_offset;
763 int m_help_button_offset;
764 };
765
766 class WXDLLIMPEXP_RIBBON wxRibbonAUIArtProvider : public wxRibbonMSWArtProvider
767 {
768 public:
769 wxRibbonAUIArtProvider();
770 virtual ~wxRibbonAUIArtProvider();
771
772 wxRibbonArtProvider* Clone() const;
773
774 wxColour GetColour(int id) const;
775 void SetColour(int id, const wxColor& colour);
776 void SetColourScheme(const wxColour& primary,
777 const wxColour& secondary,
778 const wxColour& tertiary);
779 void SetFont(int id, const wxFont& font);
780
781 wxSize GetScrollButtonMinimumSize(
782 wxDC& dc,
783 wxWindow* wnd,
784 long style);
785
786 void DrawScrollButton(
787 wxDC& dc,
788 wxWindow* wnd,
789 const wxRect& rect,
790 long style);
791
792 wxSize GetPanelSize(
793 wxDC& dc,
794 const wxRibbonPanel* wnd,
795 wxSize client_size,
796 wxPoint* client_offset);
797
798 wxSize GetPanelClientSize(
799 wxDC& dc,
800 const wxRibbonPanel* wnd,
801 wxSize size,
802 wxPoint* client_offset);
803
804 wxRect GetPanelExtButtonArea(
805 wxDC& dc,
806 const wxRibbonPanel* wnd,
807 wxRect rect);
808
809 void DrawTabCtrlBackground(
810 wxDC& dc,
811 wxWindow* wnd,
812 const wxRect& rect);
813
814 int GetTabCtrlHeight(
815 wxDC& dc,
816 wxWindow* wnd,
817 const wxRibbonPageTabInfoArray& pages);
818
819 void GetBarTabWidth(
820 wxDC& dc,
821 wxWindow* wnd,
822 const wxString& label,
823 const wxBitmap& bitmap,
824 int* ideal,
825 int* small_begin_need_separator,
826 int* small_must_have_separator,
827 int* minimum);
828
829 void DrawTab(wxDC& dc,
830 wxWindow* wnd,
831 const wxRibbonPageTabInfo& tab);
832
833 void DrawTabSeparator(
834 wxDC& dc,
835 wxWindow* wnd,
836 const wxRect& rect,
837 double visibility);
838
839 void DrawPageBackground(
840 wxDC& dc,
841 wxWindow* wnd,
842 const wxRect& rect);
843
844 void DrawPanelBackground(
845 wxDC& dc,
846 wxRibbonPanel* wnd,
847 const wxRect& rect);
848
849 void DrawMinimisedPanel(
850 wxDC& dc,
851 wxRibbonPanel* wnd,
852 const wxRect& rect,
853 wxBitmap& bitmap);
854
855 void DrawGalleryBackground(
856 wxDC& dc,
857 wxRibbonGallery* wnd,
858 const wxRect& rect);
859
860 void DrawGalleryItemBackground(
861 wxDC& dc,
862 wxRibbonGallery* wnd,
863 const wxRect& rect,
864 wxRibbonGalleryItem* item);
865
866 void DrawButtonBarBackground(
867 wxDC& dc,
868 wxWindow* wnd,
869 const wxRect& rect);
870
871 void DrawButtonBarButton(
872 wxDC& dc,
873 wxWindow* wnd,
874 const wxRect& rect,
875 wxRibbonButtonKind kind,
876 long state,
877 const wxString& label,
878 const wxBitmap& bitmap_large,
879 const wxBitmap& bitmap_small);
880
881 void DrawToolBarBackground(
882 wxDC& dc,
883 wxWindow* wnd,
884 const wxRect& rect);
885
886 void DrawToolGroupBackground(
887 wxDC& dc,
888 wxWindow* wnd,
889 const wxRect& rect);
890
891 void DrawTool(
892 wxDC& dc,
893 wxWindow* wnd,
894 const wxRect& rect,
895 const wxBitmap& bitmap,
896 wxRibbonButtonKind kind,
897 long state);
898
899 protected:
900 void DrawPartialPanelBackground(wxDC& dc, wxWindow* wnd,
901 const wxRect& rect);
902 void DrawGalleryButton(wxDC& dc, wxRect rect,
903 wxRibbonGalleryButtonState state, wxBitmap* bitmaps);
904
905 wxColour m_tab_ctrl_background_colour;
906 wxColour m_tab_ctrl_background_gradient_colour;
907 wxColour m_panel_label_background_colour;
908 wxColour m_panel_label_background_gradient_colour;
909 wxColour m_panel_hover_label_background_colour;
910 wxColour m_panel_hover_label_background_gradient_colour;
911
912 wxBrush m_background_brush;
913 wxBrush m_tab_active_top_background_brush;
914 wxBrush m_tab_hover_background_brush;
915 wxBrush m_button_bar_hover_background_brush;
916 wxBrush m_button_bar_active_background_brush;
917 wxBrush m_gallery_button_active_background_brush;
918 wxBrush m_gallery_button_hover_background_brush;
919 wxBrush m_gallery_button_disabled_background_brush;
920 wxBrush m_tool_hover_background_brush;
921 wxBrush m_tool_active_background_brush;
922
923 wxPen m_toolbar_hover_borden_pen;
924
925 wxFont m_tab_active_label_font;
926 };
927
928 #if defined(__WXMSW__)
929 typedef wxRibbonMSWArtProvider wxRibbonDefaultArtProvider;
930 #elif defined(__WXOSX_CARBON__) || \
931 defined(__WXOSX_COCOA__) || \
932 defined(__WXOSX_IPHONE__) || \
933 defined(__WXCOCOA__)
934 // TODO: Once implemented, change typedef to OSX
935 // typedef wxRibbonOSXArtProvider wxRibbonDefaultArtProvider;
936 typedef wxRibbonAUIArtProvider wxRibbonDefaultArtProvider;
937 #else
938 // TODO: Once implemented, change typedef to AUI
939 typedef wxRibbonAUIArtProvider wxRibbonDefaultArtProvider;
940 #endif
941
942 #endif // wxUSE_RIBBON
943
944 #endif // _WX_RIBBON_ART_H_