Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0480bbfb
Commit
0480bbfb
authored
Sep 30, 2014
by
Shuai Meng
Committed by
Alexandre Julliard
Oct 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Implemented RGB.
parent
fdd8454e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
global.c
dlls/vbscript/global.c
+18
-2
api.vbs
dlls/vbscript/tests/api.vbs
+22
-0
No files found.
dlls/vbscript/global.c
View file @
0480bbfb
...
...
@@ -778,8 +778,24 @@ static HRESULT Global_UBound(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VA
static
HRESULT
Global_RGB
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
HRESULT
hres
;
int
i
,
color
[
3
];
TRACE
(
"%s %s %s
\n
"
,
debugstr_variant
(
arg
),
debugstr_variant
(
arg
+
1
),
debugstr_variant
(
arg
+
2
));
assert
(
args_cnt
==
3
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
hres
=
to_int
(
arg
+
i
,
color
+
i
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
color
[
i
]
>
255
)
color
[
i
]
=
255
;
if
(
color
[
i
]
<
0
)
return
MAKE_VBSERROR
(
VBSE_ILLEGAL_FUNC_CALL
);
}
return
return_int
(
res
,
RGB
(
color
[
0
],
color
[
1
],
color
[
2
]));
}
static
HRESULT
Global_Len
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
0480bbfb
...
...
@@ -1242,4 +1242,26 @@ Call ok(getVT(Log(CByte(2))) = "VT_R8", "getVT(Log(CByte(2))) = " & getVT(Log(CB
Call
ok
(
getVT
(
Date
)
=
"VT_DATE"
,
"getVT(Date) = "
&
getVT
(
Date
))
Call
ok
(
getVT
(
Time
)
=
"VT_DATE"
,
"getVT(Time) = "
&
getVT
(
Time
))
Sub
testRGBError
(
arg1
,
arg2
,
arg3
,
error_num
)
on
error
resume
next
Dim
x
Call
Err
.
clear
()
x
=
RGB
(
arg1
,
arg2
,
arg3
)
Call
ok
(
Err
.
number
=
error_num
,
"Err.number1 = "
&
Err
.
number
)
Call
Err
.
clear
()
Call
RGB
(
arg1
,
arg2
,
arg3
)
Call
ok
(
Err
.
number
=
error_num
,
"Err.number2 = "
&
Err
.
number
)
End
Sub
Call
ok
(
RGB
(
0
,
&
h1f&
,
&
hf1&
)
=
&
hf11f00&
,
"RGB(0, &h1f&, &hf1&) = "
&
RGB
(
0
,
&
h1f&
,
&
hf1&
))
Call
ok
(
getVT
(
RGB
(
0
,
&
h1f&
,
&
hf1&
))
=
"VT_I4"
,
"getVT(RGB(&hf1&, &h1f&, &hf1&)) = "
&
getVT
(
RGB
(
&
hf1&
,
&
h1f&
,
&
hf1&
)))
Call
ok
(
RGB
(
&
hef&
,
&
hab&
,
&
hcd&
)
=
&
hcdabef&
,
"RGB(&hef&, &hab&, &hcd&) = "
&
RGB
(
&
hef&
,
&
hab&
,
&
hcd&
))
Call
ok
(
getVT
(
RGB
(
&
hef&
,
&
hab&
,
&
hcd&
))
=
"VT_I4"
,
"getVT(RGB(&hef&, &hab&, &hcd&)) = "
&
getVT
(
RGB
(
&
hef&
,
&
hab&
,
&
hcd&
)))
Call
ok
(
RGB
(
&
h1&
,
&
h100&
,
&
h111&
)
=
&
hffff01&
,
"RGB(&h1&, &h100&, &h111&) = "
&
RGB
(
&
h1&
,
&
h100&
,
&
h111&
))
Call
ok
(
getVT
(
RGB
(
&
h1&
,
&
h100&
,
&
h111&
))
=
"VT_I4"
,
"getVT(RGB(&h1&, &h100&, &h111&)) = "
&
getVT
(
RGB
(
&
h1&
,
&
h100&
,
&
h111&
)))
Call
testRGBError
(
-
1
,
&
h1e&
,
&
h3b&
,
5
)
Call
testRGBError
(
&
h4d&
,
-
2
,
&
h2f&
,
5
)
Call
reportSuccess
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment