summaryrefslogtreecommitdiffstats
path: root/kjsembed/qtbindings/qframe_imp.cpp
blob: 146e6bb2b1ef3370cd152b21f02ca012b24e83b9 (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

#include <kjs/object.h>

#include <kjsembed/global.h>
#include <kjsembed/jsobjectproxy.h>
#include <kjsembed/jsbinding.h>

#include <tqframe.h>
#include "qframe_imp.h"

/**
 * Namespace containing the KJSEmbed library.
 */
namespace KJSEmbed {
void QFrameImp::addBindings( KJS::ExecState *exec, KJS::Object &object )
{
    //
    // Define the enum constants
    //
    struct EnumValue {
	const char *id;
	int val;
    };

    EnumValue enums[] = {

        // enum Shape
        { "NoFrame", TQFrame::NoFrame },
        { "Box", TQFrame::Box },
        { "Panel", TQFrame::Panel },
        { "WinPanel", TQFrame::WinPanel },
        { "HLine", TQFrame::HLine },
        { "VLine", TQFrame::VLine },
        { "StyledPanel", TQFrame::StyledPanel },
        { "PopupPanel", TQFrame::PopupPanel },
        { "MenuBarPanel", TQFrame::MenuBarPanel },
        { "ToolBarPanel", TQFrame::ToolBarPanel },
        { "LineEditPanel", TQFrame::LineEditPanel },
        { "TabWidgetPanel", TQFrame::TabWidgetPanel },
        { "GroupBoxPanel", TQFrame::GroupBoxPanel },
        { "MShape", TQFrame::MShape },
        // enum Shadow
        { "Plain", TQFrame::Plain },
        { "Raised", TQFrame::Raised },
        { "Sunken", TQFrame::Sunken },
        { "MShadow", TQFrame::MShadow },
	{ 0, 0 }
    };

    int enumidx = 0;
    do {
        object.put( exec, enums[enumidx].id, KJS::Number(enums[enumidx].val), KJS::ReadOnly );
        ++enumidx;
    } while( enums[enumidx].id );

}

} // namespace KJSEmbed

// Local Variables:
// c-basic-offset: 4
// End: