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
04ed24fb
Commit
04ed24fb
authored
May 14, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledlg: Partially implement OleUIAddVerbMenuW(), with basic tests.
parent
ec8e1df8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
120 additions
and
11 deletions
+120
-11
configure
configure
+1
-0
configure.ac
configure.ac
+1
-0
oledlg_main.c
dlls/oledlg/oledlg_main.c
+113
-11
Makefile.in
dlls/oledlg/tests/Makefile.in
+5
-0
main.c
dlls/oledlg/tests/main.c
+0
-0
No files found.
configure
View file @
04ed24fb
...
...
@@ -17488,6 +17488,7 @@ wine_fn_config_dll olecli32 enable_olecli32 implib
wine_fn_config_dll oledb32 enable_oledb32 clean
wine_fn_config_test dlls/oledb32/tests oledb32_test clean
wine_fn_config_dll oledlg enable_oledlg implib,po
wine_fn_config_test dlls/oledlg/tests oledlg_test
wine_fn_config_dll olepro32 enable_olepro32 implib
wine_fn_config_dll olesvr.dll16 enable_win16
wine_fn_config_dll olesvr32 enable_olesvr32 implib
...
...
configure.ac
View file @
04ed24fb
...
...
@@ -3178,6 +3178,7 @@ WINE_CONFIG_DLL(olecli32,,[implib])
WINE_CONFIG_DLL(oledb32,,[clean])
WINE_CONFIG_TEST(dlls/oledb32/tests,[clean])
WINE_CONFIG_DLL(oledlg,,[implib,po])
WINE_CONFIG_TEST(dlls/oledlg/tests)
WINE_CONFIG_DLL(olepro32,,[implib])
WINE_CONFIG_DLL(olesvr.dll16,enable_win16)
WINE_CONFIG_DLL(olesvr32,,[implib])
...
...
dlls/oledlg/oledlg_main.c
View file @
04ed24fb
...
...
@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include <stdarg.h>
#include "windef.h"
...
...
@@ -30,6 +32,7 @@
#include "oledlg_private.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
...
...
@@ -122,21 +125,120 @@ BOOL WINAPI OleUIAddVerbMenuA(IOleObject *object, LPCSTR shorttype,
return
ret
;
}
static
inline
BOOL
is_verb_in_range
(
const
OLEVERB
*
verb
,
UINT
idmin
,
UINT
idmax
)
{
if
(
idmax
==
0
)
return
TRUE
;
return
(
verb
->
lVerb
+
idmin
<=
idmax
);
}
static
HRESULT
get_next_insertable_verb
(
IEnumOLEVERB
*
enumverbs
,
UINT
idmin
,
UINT
idmax
,
OLEVERB
*
verb
)
{
memset
(
verb
,
0
,
sizeof
(
*
verb
));
while
(
IEnumOLEVERB_Next
(
enumverbs
,
1
,
verb
,
NULL
)
==
S_OK
)
{
if
(
is_verb_in_range
(
verb
,
idmin
,
idmax
)
&&
(
verb
->
grfAttribs
&
OLEVERBATTRIB_ONCONTAINERMENU
))
return
S_OK
;
CoTaskMemFree
(
verb
->
lpszVerbName
);
memset
(
verb
,
0
,
sizeof
(
*
verb
));
}
return
S_FALSE
;
}
static
void
insert_verb_to_menu
(
HMENU
menu
,
UINT
idmin
,
const
OLEVERB
*
verb
)
{
InsertMenuW
(
menu
,
~
0
,
verb
->
fuFlags
|
MF_BYPOSITION
|
MF_STRING
,
verb
->
lVerb
+
idmin
,
verb
->
lpszVerbName
);
}
/***********************************************************************
* OleUIAddVerbMenuW (OLEDLG.14)
*/
BOOL
WINAPI
OleUIAddVerbMenuW
(
LPOLEOBJECT
lpOleObj
,
LPCWSTR
lpszShortType
,
HMENU
hMenu
,
UINT
uPos
,
UINT
uIDVerbMin
,
UINT
uIDVerbMax
,
BOOL
bAddConvert
,
UINT
idConvert
,
HMENU
*
lphMenu
)
BOOL
WINAPI
OleUIAddVerbMenuW
(
IOleObject
*
object
,
LPCWSTR
shorttype
,
HMENU
hMenu
,
UINT
uPos
,
UINT
idmin
,
UINT
idmax
,
BOOL
addConvert
,
UINT
idConvert
,
HMENU
*
ret_submenu
)
{
FIXME
(
"(%p, %s, %p, %d, %d, %d, %d, %d, %p): stub
\n
"
,
lpOleObj
,
debugstr_w
(
lpszShortType
),
hMenu
,
uPos
,
uIDVerbMin
,
uIDVerbMax
,
bAddConvert
,
idConvert
,
lphMenu
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
static
const
WCHAR
objectW
[]
=
{
'O'
,
'b'
,
'j'
,
'e'
,
'c'
,
't'
,
0
};
/* FIXME: this should be localized */
static
const
WCHAR
spaceW
[]
=
{
' '
,
0
};
IEnumOLEVERB
*
enumverbs
=
NULL
;
WCHAR
*
rootname
,
*
objecttype
;
LPOLESTR
usertype
=
NULL
;
OLEVERB
firstverb
,
verb
;
HMENU
submenu
;
TRACE
(
"(%p, %s, %p, %d, %d, %d, %d, %d, %p)
\n
"
,
object
,
debugstr_w
(
shorttype
),
hMenu
,
uPos
,
idmin
,
idmax
,
addConvert
,
idConvert
,
ret_submenu
);
if
(
addConvert
)
FIXME
(
"convert menu item is not supported.
\n
"
);
if
(
ret_submenu
)
*
ret_submenu
=
NULL
;
if
(
!
hMenu
||
!
ret_submenu
)
return
FALSE
;
/* check if we can get verbs at all */
if
(
object
)
IOleObject_EnumVerbs
(
object
,
&
enumverbs
);
/* no object, or object without enumeration support */
if
(
!
object
||
(
object
&&
!
enumverbs
))
{
InsertMenuW
(
hMenu
,
uPos
,
MF_BYPOSITION
|
MF_STRING
|
MF_GRAYED
,
idmin
,
objectW
);
return
FALSE
;
}
/* root entry string */
if
(
!
shorttype
&&
(
IOleObject_GetUserType
(
object
,
USERCLASSTYPE_SHORT
,
&
usertype
)
==
S_OK
))
objecttype
=
usertype
;
else
objecttype
=
(
WCHAR
*
)
shorttype
;
rootname
=
CoTaskMemAlloc
((
strlenW
(
objecttype
)
+
strlenW
(
objectW
)
+
2
)
*
sizeof
(
WCHAR
));
strcpyW
(
rootname
,
objecttype
);
strcatW
(
rootname
,
spaceW
);
strcatW
(
rootname
,
objectW
);
CoTaskMemFree
(
usertype
);
/* iterate through verbs */
/* find first suitable verb */
get_next_insertable_verb
(
enumverbs
,
idmin
,
idmax
,
&
firstverb
);
if
(
get_next_insertable_verb
(
enumverbs
,
idmin
,
idmax
,
&
verb
)
!=
S_OK
)
{
WCHAR
*
str
=
CoTaskMemAlloc
((
strlenW
(
rootname
)
+
strlenW
(
firstverb
.
lpszVerbName
)
+
2
)
*
sizeof
(
WCHAR
));
strcpyW
(
str
,
firstverb
.
lpszVerbName
);
strcatW
(
str
,
spaceW
);
strcatW
(
str
,
rootname
);
RemoveMenu
(
hMenu
,
uPos
,
MF_BYPOSITION
);
InsertMenuW
(
hMenu
,
uPos
,
MF_BYPOSITION
|
MF_STRING
,
idmin
,
str
);
CoTaskMemFree
(
firstverb
.
lpszVerbName
);
CoTaskMemFree
(
rootname
);
CoTaskMemFree
(
str
);
IEnumOLEVERB_Release
(
enumverbs
);
return
TRUE
;
}
submenu
=
CreatePopupMenu
();
insert_verb_to_menu
(
submenu
,
idmin
,
&
firstverb
);
insert_verb_to_menu
(
submenu
,
idmin
,
&
verb
);
CoTaskMemFree
(
firstverb
.
lpszVerbName
);
CoTaskMemFree
(
verb
.
lpszVerbName
);
while
(
get_next_insertable_verb
(
enumverbs
,
idmin
,
idmax
,
&
verb
)
==
S_OK
)
{
insert_verb_to_menu
(
submenu
,
idmin
,
&
verb
);
CoTaskMemFree
(
verb
.
lpszVerbName
);
}
if
(
submenu
)
*
ret_submenu
=
submenu
;
/* now submenu is ready, add root entry to original menu, attach submenu */
InsertMenuW
(
hMenu
,
uPos
,
MF_BYPOSITION
|
MF_POPUP
|
MF_STRING
,
(
UINT_PTR
)
submenu
,
rootname
);
IEnumOLEVERB_Release
(
enumverbs
);
CoTaskMemFree
(
rootname
);
return
TRUE
;
}
/***********************************************************************
...
...
dlls/oledlg/tests/Makefile.in
0 → 100644
View file @
04ed24fb
TESTDLL
=
oledlg.dll
IMPORTS
=
oledlg ole32 user32
C_SRCS
=
\
main.c
dlls/oledlg/tests/main.c
0 → 100644
View file @
04ed24fb
This diff is collapsed.
Click to expand it.
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