summaryrefslogtreecommitdiff
path: root/vcl/inc/WidgetThemeLibrary.hxx
blob: cfd10522b30df7400e330a7252fac4d4dc3d9125 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 */

#ifndef INCLUDED_VCL_INC_WIDGETTHEME_HXX
#define INCLUDED_VCL_INC_WIDGETTHEME_HXX

/**
 * This file expects cairo.h and the definition of
 * the other types used here to be defined before
 * including it.
 */

namespace vcl
{
struct WidgetDrawStyle
{
    Color maFaceColor;
    Color maLightColor;
    Color maLightBorderColor;
    Color maShadowColor;
    Color maDarkShadowColor;
    Color maHighlightColor;
    Color maHighlightTextColor;
    Color maActiveTabColor;
    Color maInactiveTabColor;
    Color maWindowColor;
    Color maWindowTextColor;
    Color maDialogColor;
    Color maDialogTextColor;
};

struct ControlDrawParameters
{
    ControlDrawParameters(cairo_t* i_pCairo, ControlPart i_ePart, ControlState i_eState)
        : pCairo(i_pCairo)
        , ePart(i_ePart)
        , eState(i_eState)
        , eButtonValue(ButtonValue::DontKnow)
        , bIsStock(false)
        , nValue(0)
    {
    }

    cairo_t* pCairo;
    ControlPart ePart;
    ControlState eState;
    ButtonValue eButtonValue;
    bool bIsStock;
    int64_t nValue;
};

typedef struct _WidgetThemeLibrary WidgetThemeLibrary;

struct _WidgetThemeLibrary
{
    uint32_t nSize;

    bool (*isNativeControlSupported)(ControlType eType, ControlPart ePart);
    bool (*getRegion)(ControlType eType, ControlPart ePart, ControlState eState,
                      const tools::Rectangle& rBoundingControlRegion,
                      tools::Rectangle& rNativeBoundingRegion,
                      tools::Rectangle& rNativeContentRegion);

    bool (*drawPushButton)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawRadiobutton)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawCheckbox)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawCombobox)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawEditbox)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawScrollbar)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawSpinButtons)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawSpinbox)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawTabItem)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawTabPane)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawTabHeader)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawTabBody)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawSlider)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawFixedline)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawToolbar)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawProgress)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawWindowsBackground)(ControlDrawParameters const& rParameters, long nWidth,
                                  long nHeight);
    bool (*drawListbox)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawFrame)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawListNode)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawListNet)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);
    bool (*drawListHeader)(ControlDrawParameters const& rParameters, long nWidth, long nHeight);

    bool (*updateSettings)(WidgetDrawStyle& rSettings);
};

extern "C" vcl::WidgetThemeLibrary* CreateWidgetThemeLibrary();

} // end vcl namespace

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */