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