FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
OneScript/tests/native-api/AddInNative.h at develop · yukon39/OneScript · GitHub
yukon39
/
OneScript
Public
forked from
EvilBeaver/OneScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
OneScript
/
tests
/
native-api
/
AddInNative.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
96 lines (90 loc) · 3 KB
Breadcrumbs
OneScript
/
tests
/
native-api
/
AddInNative.h
Copy path
File metadata and controls
96 lines (90 loc) · 3 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#ifnde
f __ADDINNATIVE_H__
#
define
__ADDINNATIVE_H__
#
include
"
ComponentBase.h
"
#
include
"
AddInDefBase.h
"
#
include
"
IMemoryManager.h
"
#
include
<
string
>
//
/////////////////////////////////////////////////////////////////////////////
//
class CAddInNative
class
CAddInNative
:
public
IComponentBase
{
public:
enum
Props
{
ePropIsEnabled =
0
,
ePropStringRW,
ePropStringRO,
ePropStringWO,
ePropLast
//
Always last
};
enum
Methods
{
eMethEnable =
0
,
eMethDisable,
eMethDefaultParam,
eMethShowInStatusLine,
eMethLoadPicture,
eMethShowMsgBox,
eMethExchange,
eMethConcatenate,
eMethLoopback,
eMethLast
//
Always last
};
CAddInNative
(
void
);
virtual
~CAddInNative
();
//
IInitDoneBase
virtual
bool
ADDIN_API
Init
(
void
*);
virtual
bool
ADDIN_API
setMemManager
(
void
* mem);
virtual
long
ADDIN_API
GetInfo
();
virtual
void
ADDIN_API
Done
();
//
ILanguageExtenderBase
virtual
bool
ADDIN_API
RegisterExtensionAs
(
WCHAR_T
**);
virtual
long
ADDIN_API
GetNProps
();
virtual
long
ADDIN_API
FindProp
(
const
WCHAR_T
* wsPropName);
virtual
const
WCHAR_T
*
ADDIN_API
GetPropName
(
long
lPropNum,
long
lPropAlias);
virtual
bool
ADDIN_API
GetPropVal
(
const
long
lPropNum, tVariant* pvarPropVal);
virtual
bool
ADDIN_API
SetPropVal
(
const
long
lPropNum, tVariant* pvarPropVal);
virtual
bool
ADDIN_API
IsPropReadable
(
const
long
lPropNum);
virtual
bool
ADDIN_API
IsPropWritable
(
const
long
lPropNum);
virtual
long
ADDIN_API
GetNMethods
();
virtual
long
ADDIN_API
FindMethod
(
const
WCHAR_T
* wsMethodName);
virtual
const
WCHAR_T
*
ADDIN_API
GetMethodName
(
const
long
lMethodNum,
const
long
lMethodAlias);
virtual
long
ADDIN_API
GetNParams
(
const
long
lMethodNum);
virtual
bool
ADDIN_API
GetParamDefValue
(
const
long
lMethodNum,
const
long
lParamNum, tVariant* pvarParamDefValue);
virtual
bool
ADDIN_API
HasRetVal
(
const
long
lMethodNum);
virtual
bool
ADDIN_API
CallAsProc
(
const
long
lMethodNum, tVariant* paParams,
const
long
lSizeArray);
virtual
bool
ADDIN_API
CallAsFunc
(
const
long
lMethodNum, tVariant* pvarRetValue, tVariant* paParams,
const
long
lSizeArray);
//
LocaleBase
virtual
void
ADDIN_API
SetLocale
(
const
WCHAR_T
* loc);
private:
long
findName
(
const
wchar_t
* names[],
const
wchar_t
* name,
const
uint32_t
size)
const
;
void
addError
(
uint32_t
wcode,
const
wchar_t
* source,
const
wchar_t
* descriptor,
long
code);
IAddInDefBase* m_iConnect;
IMemoryManager* m_iMemory;
bool
m_Enabled =
false
;
std::wstring m_String;
};
class
WcharWrapper
{
public:
#
ifdef
LINUX_OR_MACOS
WcharWrapper
(
const
WCHAR_T
* str);
#
endif
WcharWrapper
(
const
wchar_t
* str);
~WcharWrapper
();
#
ifdef
LINUX_OR_MACOS
operator
const
WCHAR_T
* () {
return
m_str_WCHAR; }
operator
WCHAR_T
* () {
return
m_str_WCHAR; }
#
endif
operator
const
wchar_t
* () {
return
m_str_wchar; }
operator
wchar_t
* () {
return
m_str_wchar; }
private:
WcharWrapper&
operator
= (
const
WcharWrapper& other) {
return
*
this
; }
WcharWrapper
(
const
WcharWrapper& other) { }
private:
#
ifdef
LINUX_OR_MACOS
WCHAR_T
* m_str_WCHAR;
#
endif
wchar_t
* m_str_wchar;
};
#
endif
//
__ADDINNATIVE_H__
Back
|
FazBrowse Home
|
New Git URL