-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathBluePythonThunkers.h
More file actions
160 lines (123 loc) · 4.17 KB
/
Copy pathBluePythonThunkers.h
File metadata and controls
160 lines (123 loc) · 4.17 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// Copyright (c) 2026 CCP Games
/*
*************************************************************************
BluePythonThunkers.h
Author: Matthias Gudmundsson
Created: Nov. 2000
OS: Win32
Project: Blue
Description:
Generic interface thunkers
Dependencies:
Blue
*************************************************************************
*/
#ifndef _BLUEPYTHONTHUNKERS_H_
#define _BLUEPYTHONTHUNKERS_H_
#if BLUE_WITH_PYTHON
#include "include/IList.h"
#include "include/BlueExposureMacros.h"
#include "include/BlueExposureMacrosDeprecated.h"
//////////////////////////////////////////////////////////////////////
//
// IRoot Thunkers
//
//////////////////////////////////////////////////////////////////////
class IRoot_Thunk : public IRoot
{
public:
typedef IRoot_Thunk _Class;
typedef IRoot _Interface;
static const Be::IID& IID()
{
static Be::IID iid( "IRoot" );
return iid;
}
const Be::Clsid* Clsid()
{
return ClassType()->mClassId;
}
static const PyMethodDef* Defs()
{
THUNKER_BEGIN()
MAPPYTHON( CopyTo, "Copies data from this object")
MAPPYTHON( CloneTo, "Clones this object, preserving topology")
MAPPYTHON( TypeInfo, "Returns various type info for this object")
MAPPYTHON( Find,
"Find a Trinity class type, or list of path objects to it"
"\n"
"\nKeyword arguments:"
"\nclass name -- class name or list of class names, e.g. ['trinity.TriEffect']"
"\nmaxLevel -- maximum depth to search to (default -1)"
"\nprune -- prune duplicate instances (default False)"
"\nnParents -- number of parents to return in a list (default -1)"
)
MAPPYTHON( Validate, "Traverses hierarchy and validates")
MAPPYTHON( GetRefCounts,"Returns the python and blue reference counts")
THUNKER_END()
}
// compatible python methods
DECLARE_PYMETHODTHUNK( CopyTo );
DECLARE_PYMETHODTHUNK( CloneTo );
DECLARE_PYMETHODTHUNK( TypeInfo );
DECLARE_PYMETHODTHUNK( Find );
DECLARE_PYMETHODTHUNK( Validate );
DECLARE_PYMETHODTHUNK( GetRefCounts );
private:
PyObject* CloneCopyImpl(PyObject *args, bool clone);
};
//////////////////////////////////////////////////////////////////////
//
// IList Thunkers
//
//////////////////////////////////////////////////////////////////////
class IList_Thunk : public IList
{
public:
typedef IList_Thunk _Class;
typedef IList _Interface;
static const Be::IID& IID()
{
static Be::IID iid( "IList" );
return iid;
}
const Be::Clsid* Clsid()
{
return ClassType()->mClassId;
}
static const PyMethodDef* Defs()
{
THUNKER_BEGIN()
// compatible python methods
MAPPYTHON( append, "L.append(object) -- append object to end")
MAPPYTHON( insert, "L.insert(index, object) -- insert object before index")
MAPPYTHON( extend, "L.extend(list) -- extend list by appending list elements")
MAPPYTHON( pop, "L.pop([index]) -> item -- remove and return item at index (default last)")
MAPPYTHON( remove, "L.remove(value) -- remove first occurrence of value")
MAPPYTHON( removeAt, "L.removeAt(index) -- remove value at index, if -1 all values are removed")
MAPPYTHON( index, "L.index(value) -> integer -- return index of first occurrence of value")
MAPPYTHON( count, "L.count(value) -> integer -- return number of occurrences of value")
MAPPYTHON( reverse, "L.reverse() -- reverse *IN PLACE*")
MAPPYTHON( sort, "L.sort([cmpfunc]) -- sort *IN PLACE*; if given, cmpfunc(x, y) -> -1, 0, 1")
MAPPYTHON( fremove, "L.fremove(value) -- returns true if object was removed. list order is not preserved.")
MAPPYTHON( FindByName, "L.FindByName(name) -- returns list element with name attribute equal to passed name or None if not found.")
MAPPYTHON( GetInfo, "GetInfo")
THUNKER_END()
}
// compatible python methods
DECLARE_PYMETHODTHUNK( append );
DECLARE_PYMETHODTHUNK( insert );
DECLARE_PYMETHODTHUNK( extend );
DECLARE_PYMETHODTHUNK( pop );
DECLARE_PYMETHODTHUNK( remove );
DECLARE_PYMETHODTHUNK( removeAt );
DECLARE_PYMETHODTHUNK( index );
DECLARE_PYMETHODTHUNK( count );
DECLARE_PYMETHODTHUNK( reverse );
DECLARE_PYMETHODTHUNK( sort );
DECLARE_PYMETHODTHUNK( fremove );
DECLARE_PYMETHODTHUNK( FindByName );
DECLARE_PYMETHODTHUNK( GetInfo );
};
#endif
#endif