1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* 3 * This file is part of the LibreOffice project. 4 * 5 * This Source Code Form is subject to the terms of the Mozilla Public 6 * License, v. 2.0. If a copy of the MPL was not distributed with this 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 * 9 */ 10 11 #ifndef INCLUDED_VCL_INC_WIDGETTHEME_HXX 12 #define INCLUDED_VCL_INC_WIDGETTHEME_HXX 13 14 #include <cstdint> 15 16 namespace vcl 17 { 18 struct WidgetDrawStyle 19 { 20 uint32_t nSize; 21 uint32_t maFaceColor; 22 uint32_t maCheckedColor; 23 uint32_t maLightColor; 24 uint32_t maLightBorderColor; 25 uint32_t maShadowColor; 26 uint32_t maDarkShadowColor; 27 uint32_t maDefaultButtonTextColor; 28 uint32_t maButtonTextColor; 29 uint32_t maDefaultActionButtonTextColor; 30 uint32_t maActionButtonTextColor; 31 uint32_t maFlatButtonTextColor; 32 uint32_t maDefaultButtonRolloverTextColor; 33 uint32_t maButtonRolloverTextColor; 34 uint32_t maDefaultActionButtonRolloverTextColor; 35 uint32_t maActionButtonRolloverTextColor; 36 uint32_t maFlatButtonRolloverTextColor; 37 uint32_t maDefaultButtonPressedRolloverTextColor; 38 uint32_t maButtonPressedRolloverTextColor; 39 uint32_t maDefaultActionButtonPressedRolloverTextColor; 40 uint32_t maActionButtonPressedRolloverTextColor; 41 uint32_t maFlatButtonPressedRolloverTextColor; 42 uint32_t maRadioCheckTextColor; 43 uint32_t maGroupTextColor; 44 uint32_t maLabelTextColor; 45 uint32_t maWindowColor; 46 uint32_t maWindowTextColor; 47 uint32_t maDialogColor; 48 uint32_t maDialogTextColor; 49 uint32_t maWorkspaceColor; 50 uint32_t maMonoColor; 51 uint32_t maFieldColor; 52 uint32_t maFieldTextColor; 53 uint32_t maFieldRolloverTextColor; 54 uint32_t maActiveColor; 55 uint32_t maActiveTextColor; 56 uint32_t maActiveBorderColor; 57 uint32_t maDeactiveColor; 58 uint32_t maDeactiveTextColor; 59 uint32_t maDeactiveBorderColor; 60 uint32_t maMenuColor; 61 uint32_t maMenuBarColor; 62 uint32_t maMenuBarRolloverColor; 63 uint32_t maMenuBorderColor; 64 uint32_t maMenuTextColor; 65 uint32_t maMenuBarTextColor; 66 uint32_t maMenuBarRolloverTextColor; 67 uint32_t maMenuBarHighlightTextColor; 68 uint32_t maMenuHighlightColor; 69 uint32_t maMenuHighlightTextColor; 70 uint32_t maHighlightColor; 71 uint32_t maHighlightTextColor; 72 uint32_t maActiveTabColor; 73 uint32_t maInactiveTabColor; 74 uint32_t maTabTextColor; 75 uint32_t maTabRolloverTextColor; 76 uint32_t maTabHighlightTextColor; 77 uint32_t maDisableColor; 78 uint32_t maHelpColor; 79 uint32_t maHelpTextColor; 80 uint32_t maLinkColor; 81 uint32_t maVisitedLinkColor; 82 uint32_t maToolTextColor; 83 uint32_t maFontColor; 84 }; 85 86 struct ControlDrawParameters 87 { 88 typedef struct _cairo cairo_t; ControlDrawParametersvcl::ControlDrawParameters89 ControlDrawParameters(cairo_t* i_pCairo, ControlPart i_ePart, ControlState i_eState) 90 : nSize(sizeof(ControlDrawParameters)) 91 , pCairo(i_pCairo) 92 , ePart(i_ePart) 93 , eState(i_eState) 94 , eButtonValue(ButtonValue::DontKnow) 95 , bIsAction(false) 96 , nValue(0) 97 { 98 } 99 100 uint32_t nSize; 101 cairo_t* pCairo; 102 ControlPart ePart; 103 ControlState eState; 104 ButtonValue eButtonValue; 105 bool bIsAction; 106 int64_t nValue; 107 }; 108 109 typedef struct WidgetThemeLibrary_t WidgetThemeLibrary; 110 111 typedef struct _rectangle 112 { 113 tools::Long x, y; 114 tools::Long width, height; 115 } rectangle_t; 116 117 struct WidgetThemeLibrary_t 118 { 119 uint32_t nSize; 120 121 bool (*isNativeControlSupported)(ControlType eType, ControlPart ePart); 122 bool (*getRegion)(ControlType eType, ControlPart ePart, ControlState eState, 123 const rectangle_t& rBoundingControlRegion, rectangle_t& rNativeBoundingRegion, 124 rectangle_t& rNativeContentRegion); 125 126 bool (*drawPushButton)(ControlDrawParameters const& rParameters, tools::Long nWidth, 127 tools::Long nHeight); 128 bool (*drawRadiobutton)(ControlDrawParameters const& rParameters, tools::Long nWidth, 129 tools::Long nHeight); 130 bool (*drawCheckbox)(ControlDrawParameters const& rParameters, tools::Long nWidth, 131 tools::Long nHeight); 132 bool (*drawCombobox)(ControlDrawParameters const& rParameters, tools::Long nWidth, 133 tools::Long nHeight); 134 bool (*drawEditbox)(ControlDrawParameters const& rParameters, tools::Long nWidth, 135 tools::Long nHeight); 136 bool (*drawScrollbar)(ControlDrawParameters const& rParameters, tools::Long nWidth, 137 tools::Long nHeight); 138 bool (*drawSpinButtons)(ControlDrawParameters const& rParameters, tools::Long nWidth, 139 tools::Long nHeight); 140 bool (*drawSpinbox)(ControlDrawParameters const& rParameters, tools::Long nWidth, 141 tools::Long nHeight); 142 bool (*drawTabItem)(ControlDrawParameters const& rParameters, tools::Long nWidth, 143 tools::Long nHeight); 144 bool (*drawTabPane)(ControlDrawParameters const& rParameters, tools::Long nWidth, 145 tools::Long nHeight); 146 bool (*drawTabHeader)(ControlDrawParameters const& rParameters, tools::Long nWidth, 147 tools::Long nHeight); 148 bool (*drawTabBody)(ControlDrawParameters const& rParameters, tools::Long nWidth, 149 tools::Long nHeight); 150 bool (*drawSlider)(ControlDrawParameters const& rParameters, tools::Long nWidth, 151 tools::Long nHeight); 152 bool (*drawFixedline)(ControlDrawParameters const& rParameters, tools::Long nWidth, 153 tools::Long nHeight); 154 bool (*drawToolbar)(ControlDrawParameters const& rParameters, tools::Long nWidth, 155 tools::Long nHeight); 156 bool (*drawProgress)(ControlDrawParameters const& rParameters, tools::Long nWidth, 157 tools::Long nHeight); 158 bool (*drawWindowsBackground)(ControlDrawParameters const& rParameters, tools::Long nWidth, 159 tools::Long nHeight); 160 bool (*drawListbox)(ControlDrawParameters const& rParameters, tools::Long nWidth, 161 tools::Long nHeight); 162 bool (*drawFrame)(ControlDrawParameters const& rParameters, tools::Long nWidth, 163 tools::Long nHeight); 164 bool (*drawListNode)(ControlDrawParameters const& rParameters, tools::Long nWidth, 165 tools::Long nHeight); 166 bool (*drawListNet)(ControlDrawParameters const& rParameters, tools::Long nWidth, 167 tools::Long nHeight); 168 bool (*drawListHeader)(ControlDrawParameters const& rParameters, tools::Long nWidth, 169 tools::Long nHeight); 170 171 bool (*updateSettings)(WidgetDrawStyle& rStyle); 172 }; 173 174 extern "C" vcl::WidgetThemeLibrary* CreateWidgetThemeLibrary(); 175 176 } // end vcl namespace 177 178 #endif 179 180 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 181