]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/ribbon/art.h
support retina display
[wxWidgets.git] / include / wx / ribbon / art.h
index f0cc1596e705d7678452440ccc988251cd7ed975..86229f6698086dba599b7f4b1b28a7e813a9df10 100644 (file)
 
 #if wxUSE_RIBBON
 
 
 #if wxUSE_RIBBON
 
-#include <wx/brush.h>
-#include <wx/pen.h>
+#include "wx/brush.h"
+#include "wx/colour.h"
+#include "wx/font.h"
+#include "wx/pen.h"
+#include "wx/bitmap.h"
+#include "wx/ribbon/bar.h"
+
+class WXDLLIMPEXP_FWD_CORE wxDC;
+class WXDLLIMPEXP_FWD_CORE wxWindow;
 
 enum wxRibbonArtSetting
 {
 
 enum wxRibbonArtSetting
 {
@@ -95,6 +102,12 @@ enum wxRibbonArtSetting
     wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR,
     wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_COLOUR,
     wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_GRADIENT_COLOUR,
     wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR,
     wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_COLOUR,
     wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_GRADIENT_COLOUR,
+    wxRIBBON_ART_PANEL_BUTTON_FACE_COLOUR,
+    wxRIBBON_ART_PANEL_BUTTON_HOVER_FACE_COLOUR,
+
+    wxRIBBON_ART_PAGE_TOGGLE_FACE_COLOUR,
+    wxRIBBON_ART_PAGE_TOGGLE_HOVER_FACE_COLOUR,
+
     wxRIBBON_ART_PAGE_BORDER_COLOUR,
     wxRIBBON_ART_PAGE_BACKGROUND_TOP_COLOUR,
     wxRIBBON_ART_PAGE_BACKGROUND_TOP_GRADIENT_COLOUR,
     wxRIBBON_ART_PAGE_BORDER_COLOUR,
     wxRIBBON_ART_PAGE_BACKGROUND_TOP_COLOUR,
     wxRIBBON_ART_PAGE_BACKGROUND_TOP_GRADIENT_COLOUR,
@@ -119,6 +132,7 @@ enum wxRibbonArtSetting
     wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR,
     wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_COLOUR,
     wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_GRADIENT_COLOUR,
     wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR,
     wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_COLOUR,
     wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_GRADIENT_COLOUR,
+    wxRIBBON_ART_BUTTON_BAR_LABEL_DISABLED_COLOUR
 };
 
 enum wxRibbonScrollButtonStyle
 };
 
 enum wxRibbonScrollButtonStyle
@@ -140,7 +154,7 @@ enum wxRibbonScrollButtonStyle
     wxRIBBON_SCROLL_BTN_FOR_TABS = 16,
     wxRIBBON_SCROLL_BTN_FOR_PAGE = 32,
 
     wxRIBBON_SCROLL_BTN_FOR_TABS = 16,
     wxRIBBON_SCROLL_BTN_FOR_PAGE = 32,
 
-    wxRIBBON_SCROLL_BTN_FOR_MASK = 48,
+    wxRIBBON_SCROLL_BTN_FOR_MASK = 48
 };
 
 enum wxRibbonButtonKind
 };
 
 enum wxRibbonButtonKind
@@ -148,6 +162,7 @@ enum wxRibbonButtonKind
     wxRIBBON_BUTTON_NORMAL    = 1 << 0,
     wxRIBBON_BUTTON_DROPDOWN  = 1 << 1,
     wxRIBBON_BUTTON_HYBRID    = wxRIBBON_BUTTON_NORMAL | wxRIBBON_BUTTON_DROPDOWN,
     wxRIBBON_BUTTON_NORMAL    = 1 << 0,
     wxRIBBON_BUTTON_DROPDOWN  = 1 << 1,
     wxRIBBON_BUTTON_HYBRID    = wxRIBBON_BUTTON_NORMAL | wxRIBBON_BUTTON_DROPDOWN,
+    wxRIBBON_BUTTON_TOGGLE    = 1 << 2
 };
 
 enum wxRibbonButtonBarButtonState
 };
 
 enum wxRibbonButtonBarButtonState
@@ -164,7 +179,8 @@ enum wxRibbonButtonBarButtonState
     wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE   = 1 << 6,
     wxRIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK       = wxRIBBON_BUTTONBAR_BUTTON_NORMAL_ACTIVE | wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE,
     wxRIBBON_BUTTONBAR_BUTTON_DISABLED          = 1 << 7,
     wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE   = 1 << 6,
     wxRIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK       = wxRIBBON_BUTTONBAR_BUTTON_NORMAL_ACTIVE | wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE,
     wxRIBBON_BUTTONBAR_BUTTON_DISABLED          = 1 << 7,
-    wxRIBBON_BUTTONBAR_BUTTON_STATE_MASK        = 0xF8,
+    wxRIBBON_BUTTONBAR_BUTTON_TOGGLED           = 1 << 8,
+    wxRIBBON_BUTTONBAR_BUTTON_STATE_MASK        = 0x1F8
 };
 
 enum wxRibbonGalleryButtonState
 };
 
 enum wxRibbonGalleryButtonState
@@ -172,9 +188,10 @@ enum wxRibbonGalleryButtonState
     wxRIBBON_GALLERY_BUTTON_NORMAL,
     wxRIBBON_GALLERY_BUTTON_HOVERED,
     wxRIBBON_GALLERY_BUTTON_ACTIVE,
     wxRIBBON_GALLERY_BUTTON_NORMAL,
     wxRIBBON_GALLERY_BUTTON_HOVERED,
     wxRIBBON_GALLERY_BUTTON_ACTIVE,
-    wxRIBBON_GALLERY_BUTTON_DISABLED,
+    wxRIBBON_GALLERY_BUTTON_DISABLED
 };
 
 };
 
+class wxRibbonBar;
 class wxRibbonPage;
 class wxRibbonPanel;
 class wxRibbonGallery;
 class wxRibbonPage;
 class wxRibbonPanel;
 class wxRibbonGallery;
@@ -287,6 +304,17 @@ public:
                         wxRibbonButtonKind kind,
                         long state) = 0;
 
                         wxRibbonButtonKind kind,
                         long state) = 0;
 
+    virtual void DrawToggleButton(
+                        wxDC& dc,
+                        wxRibbonBar* wnd,
+                        const wxRect& rect,
+                        wxRibbonDisplayMode mode) = 0;
+
+    virtual void DrawHelpButton(
+                        wxDC& dc,
+                        wxRibbonBar* wnd,
+                        const wxRect& rect) = 0;
+
     virtual void GetBarTabWidth(
                         wxDC& dc,
                         wxWindow* wnd,
     virtual void GetBarTabWidth(
                         wxDC& dc,
                         wxWindow* wnd,
@@ -319,6 +347,11 @@ public:
                         wxSize size,
                         wxPoint* client_offset) = 0;
 
                         wxSize size,
                         wxPoint* client_offset) = 0;
 
+    virtual wxRect GetPanelExtButtonArea(
+                        wxDC& dc,
+                        const wxRibbonPanel* wnd,
+                        wxRect rect) = 0;
+
     virtual wxSize GetGallerySize(
                         wxDC& dc,
                         const wxRibbonGallery* wnd,
     virtual wxSize GetGallerySize(
                         wxDC& dc,
                         const wxRibbonGallery* wnd,
@@ -365,6 +398,10 @@ public:
                         bool is_first,
                         bool is_last,
                         wxRect* dropdown_region) = 0;
                         bool is_first,
                         bool is_last,
                         wxRect* dropdown_region) = 0;
+
+    virtual wxRect GetBarToggleButtonArea(const wxRect& rect)= 0;
+
+    virtual wxRect GetRibbonHelpButtonArea(const wxRect& rect) = 0;
 };
 
 class WXDLLIMPEXP_RIBBON wxRibbonMSWArtProvider : public wxRibbonArtProvider
 };
 
 class WXDLLIMPEXP_RIBBON wxRibbonMSWArtProvider : public wxRibbonArtProvider
@@ -476,6 +513,16 @@ public:
                 wxRibbonButtonKind kind,
                 long state);
 
                 wxRibbonButtonKind kind,
                 long state);
 
+    void DrawToggleButton(
+                        wxDC& dc,
+                        wxRibbonBar* wnd,
+                        const wxRect& rect,
+                        wxRibbonDisplayMode mode);
+
+    void DrawHelpButton(wxDC& dc,
+                        wxRibbonBar* wnd,
+                        const wxRect& rect);
+
     void GetBarTabWidth(
                         wxDC& dc,
                         wxWindow* wnd,
     void GetBarTabWidth(
                         wxDC& dc,
                         wxWindow* wnd,
@@ -503,6 +550,11 @@ public:
                         wxSize size,
                         wxPoint* client_offset);
 
                         wxSize size,
                         wxPoint* client_offset);
 
+    wxRect GetPanelExtButtonArea(
+                        wxDC& dc,
+                        const wxRibbonPanel* wnd,
+                        wxRect rect);
+
     wxSize GetGallerySize(
                         wxDC& dc,
                         const wxRibbonGallery* wnd,
     wxSize GetGallerySize(
                         wxDC& dc,
                         const wxRibbonGallery* wnd,
@@ -550,6 +602,10 @@ public:
                         bool is_last,
                         wxRect* dropdown_region);
 
                         bool is_last,
                         wxRect* dropdown_region);
 
+    wxRect GetBarToggleButtonArea(const wxRect& rect);
+
+    wxRect GetRibbonHelpButtonArea(const wxRect& rect);
+
 protected:
     void ReallyDrawTabSeparator(wxWindow* wnd, const wxRect& rect, double visibility);
     void DrawPartialPageBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect,
 protected:
     void ReallyDrawTabSeparator(wxWindow* wnd, const wxRect& rect, double visibility);
     void DrawPartialPageBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect,
@@ -584,12 +640,18 @@ protected:
     wxBitmap m_gallery_down_bitmap[4];
     wxBitmap m_gallery_extension_bitmap[4];
     wxBitmap m_toolbar_drop_bitmap;
     wxBitmap m_gallery_down_bitmap[4];
     wxBitmap m_gallery_extension_bitmap[4];
     wxBitmap m_toolbar_drop_bitmap;
+    wxBitmap m_panel_extension_bitmap[2];
+    wxBitmap m_ribbon_toggle_up_bitmap[2];
+    wxBitmap m_ribbon_toggle_down_bitmap[2];
+    wxBitmap m_ribbon_toggle_pin_bitmap[2];
+    wxBitmap m_ribbon_bar_help_button_bitmap[2];
 
     wxColour m_primary_scheme_colour;
     wxColour m_secondary_scheme_colour;
     wxColour m_tertiary_scheme_colour;
 
     wxColour m_button_bar_label_colour;
 
     wxColour m_primary_scheme_colour;
     wxColour m_secondary_scheme_colour;
     wxColour m_tertiary_scheme_colour;
 
     wxColour m_button_bar_label_colour;
+    wxColour m_button_bar_label_disabled_colour;
     wxColour m_tab_label_colour;
     wxColour m_tab_separator_colour;
     wxColour m_tab_separator_gradient_colour;
     wxColour m_tab_label_colour;
     wxColour m_tab_separator_colour;
     wxColour m_tab_separator_gradient_colour;
@@ -606,6 +668,10 @@ protected:
     wxColour m_panel_active_background_gradient_colour;
     wxColour m_panel_active_background_top_colour;
     wxColour m_panel_active_background_top_gradient_colour;
     wxColour m_panel_active_background_gradient_colour;
     wxColour m_panel_active_background_top_colour;
     wxColour m_panel_active_background_top_gradient_colour;
+    wxColour m_panel_button_face_colour;
+    wxColour m_panel_button_hover_face_colour;
+    wxColour m_page_toggle_face_colour;
+    wxColour m_page_toggle_hover_face_colour;
     wxColour m_page_background_colour;
     wxColour m_page_background_gradient_colour;
     wxColour m_page_background_top_colour;
     wxColour m_page_background_colour;
     wxColour m_page_background_gradient_colour;
     wxColour m_page_background_top_colour;
@@ -623,7 +689,7 @@ protected:
     wxColour m_button_bar_active_background_top_colour;
     wxColour m_button_bar_active_background_top_gradient_colour;
     wxColour m_gallery_button_background_colour;
     wxColour m_button_bar_active_background_top_colour;
     wxColour m_button_bar_active_background_top_gradient_colour;
     wxColour m_gallery_button_background_colour;
-    wxColour m_gallery_button_background_gradient_colour;    
+    wxColour m_gallery_button_background_gradient_colour;
     wxColour m_gallery_button_hover_background_colour;
     wxColour m_gallery_button_hover_background_gradient_colour;
     wxColour m_gallery_button_active_background_colour;
     wxColour m_gallery_button_hover_background_colour;
     wxColour m_gallery_button_hover_background_gradient_colour;
     wxColour m_gallery_button_active_background_colour;
@@ -652,11 +718,13 @@ protected:
     wxBrush m_tab_ctrl_background_brush;
     wxBrush m_panel_label_background_brush;
     wxBrush m_panel_hover_label_background_brush;
     wxBrush m_tab_ctrl_background_brush;
     wxBrush m_panel_label_background_brush;
     wxBrush m_panel_hover_label_background_brush;
+    wxBrush m_panel_hover_button_background_brush;
     wxBrush m_gallery_hover_background_brush;
     wxBrush m_gallery_button_background_top_brush;
     wxBrush m_gallery_button_hover_background_top_brush;
     wxBrush m_gallery_button_active_background_top_brush;
     wxBrush m_gallery_button_disabled_background_top_brush;
     wxBrush m_gallery_hover_background_brush;
     wxBrush m_gallery_button_background_top_brush;
     wxBrush m_gallery_button_hover_background_top_brush;
     wxBrush m_gallery_button_active_background_top_brush;
     wxBrush m_gallery_button_disabled_background_top_brush;
+    wxBrush m_ribbon_toggle_brush;
 
     wxFont m_tab_label_font;
     wxFont m_panel_label_font;
 
     wxFont m_tab_label_font;
     wxFont m_panel_label_font;
@@ -667,12 +735,14 @@ protected:
     wxPen m_panel_border_gradient_pen;
     wxPen m_panel_minimised_border_pen;
     wxPen m_panel_minimised_border_gradient_pen;
     wxPen m_panel_border_gradient_pen;
     wxPen m_panel_minimised_border_pen;
     wxPen m_panel_minimised_border_gradient_pen;
+    wxPen m_panel_hover_button_border_pen;
     wxPen m_tab_border_pen;
     wxPen m_button_bar_hover_border_pen;
     wxPen m_button_bar_active_border_pen;
     wxPen m_gallery_border_pen;
     wxPen m_gallery_item_border_pen;
     wxPen m_toolbar_border_pen;
     wxPen m_tab_border_pen;
     wxPen m_button_bar_hover_border_pen;
     wxPen m_button_bar_active_border_pen;
     wxPen m_gallery_border_pen;
     wxPen m_gallery_item_border_pen;
     wxPen m_toolbar_border_pen;
+    wxPen m_ribbon_toggle_pen;
 
     double m_cached_tab_separator_visibility;
     long m_flags;
 
     double m_cached_tab_separator_visibility;
     long m_flags;
@@ -689,6 +759,8 @@ protected:
     int m_gallery_bitmap_padding_right_size;
     int m_gallery_bitmap_padding_top_size;
     int m_gallery_bitmap_padding_bottom_size;
     int m_gallery_bitmap_padding_right_size;
     int m_gallery_bitmap_padding_top_size;
     int m_gallery_bitmap_padding_bottom_size;
+    int m_toggle_button_offset;
+    int m_help_button_offset;
 };
 
 class WXDLLIMPEXP_RIBBON wxRibbonAUIArtProvider : public wxRibbonMSWArtProvider
 };
 
 class WXDLLIMPEXP_RIBBON wxRibbonAUIArtProvider : public wxRibbonMSWArtProvider
@@ -729,6 +801,11 @@ public:
                         wxSize size,
                         wxPoint* client_offset);
 
                         wxSize size,
                         wxPoint* client_offset);
 
+    wxRect GetPanelExtButtonArea(
+                        wxDC& dc,
+                        const wxRibbonPanel* wnd,
+                        wxRect rect);
+
     void DrawTabCtrlBackground(
                         wxDC& dc,
                         wxWindow* wnd,
     void DrawTabCtrlBackground(
                         wxDC& dc,
                         wxWindow* wnd,