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