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
a97ee602
Commit
a97ee602
authored
Aug 20, 2006
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleview: Added idl displaying.
- Added idl displaying. - Fixed AddToTLDataStrWithTabsW function.
parent
96a0da24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
7 deletions
+80
-7
main.h
programs/oleview/main.h
+1
-0
typelib.c
programs/oleview/typelib.c
+79
-7
No files found.
programs/oleview/main.h
View file @
a97ee602
...
...
@@ -117,6 +117,7 @@ typedef struct
WCHAR
*
idl
;
WCHAR
wszInsertAfter
[
MAX_LOAD_STRING
];
INT
idlLen
;
BOOL
bPredefine
;
}
TYPELIB_DATA
;
extern
GLOBALS
globals
;
...
...
programs/oleview/typelib.c
View file @
a97ee602
...
...
@@ -105,35 +105,43 @@ void AddToTLDataStrW(TYPELIB_DATA *pTLData, const WCHAR *wszSource)
pTLData
->
idlLen
+=
SourceLen
;
}
void
AddToTLDataStrWithTabsW
(
TYPELIB_DATA
*
pTLData
,
const
WCHAR
*
wszSource
)
void
AddToTLDataStrWithTabsW
(
TYPELIB_DATA
*
pTLData
,
WCHAR
*
wszSource
)
{
int
lineLen
=
lstrlenW
(
wszSource
);
int
newLinesNo
=
0
;
WCHAR
*
pSourcePos
=
(
WCHAR
*
)
wszSource
;
WCHAR
*
pSourceBeg
;
if
(
!
lineLen
)
return
;
while
(
*
pSourcePos
)
{
if
(
*
pSourcePos
==
*
wszNewLine
)
newLinesNo
++
;
pSourcePos
+=
1
;
}
if
(
*
(
pSourcePos
-
1
)
!=
*
wszNewLine
)
newLinesNo
++
;
pTLData
->
idl
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
pTLData
->
idl
,
sizeof
(
WCHAR
)
*
(
pTLData
->
idlLen
+
lineLen
+
4
*
newLinesNo
+
1
));
pSourcePos
=
(
WCHAR
*
)
wszSource
;
pSourceBeg
=
(
WCHAR
*
)
wszSource
;
while
(
*
pSourcePos
)
while
(
newLinesNo
)
{
if
(
*
pSourcePos
!=
*
wszNewLine
)
if
(
*
pSourcePos
!=
*
wszNewLine
&&
*
pSourcePos
)
{
pSourcePos
+=
1
;
continue
;
}
*
pSourcePos
=
'\0'
;
lineLen
=
lstrlenW
(
pSourceBeg
)
+
1
;
*
pSourcePos
=
'\n'
;
pSourcePos
+=
1
;
newLinesNo
--
;
if
(
pSourcePos
)
{
*
pSourcePos
=
'\0'
;
lineLen
=
lstrlenW
(
pSourceBeg
)
+
1
;
*
pSourcePos
=
'\n'
;
pSourcePos
+=
1
;
}
else
lineLen
=
lstrlenW
(
pSourceBeg
)
+
1
;
pTLData
->
idl
[
pTLData
->
idlLen
]
=
*
wszSpace
;
pTLData
->
idl
[
pTLData
->
idlLen
+
1
]
=
*
wszSpace
;
...
...
@@ -464,6 +472,56 @@ int EnumImplTypes(ITypeInfo *pTypeInfo, int cImplTypes, HTREEITEM hParent)
return
0
;
}
void
AddIdlData
(
HTREEITEM
hCur
,
TYPELIB_DATA
*
pTLData
)
{
TVITEM
tvi
;
hCur
=
TreeView_GetChild
(
typelib
.
hTree
,
hCur
);
memset
(
&
tvi
,
0
,
sizeof
(
TVITEM
));
tvi
.
mask
=
TVIF_PARAM
;
while
(
hCur
)
{
tvi
.
hItem
=
hCur
;
SendMessage
(
typelib
.
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
tvi
);
AddToTLDataStrW
(
pTLData
,
wszNewLine
);
AddToTLDataStrWithTabsW
(
pTLData
,
((
TYPELIB_DATA
*
)(
tvi
.
lParam
))
->
idl
);
hCur
=
TreeView_GetNextSibling
(
typelib
.
hTree
,
hCur
);
}
}
void
AddPredefinitions
(
HTREEITEM
hFirst
,
TYPELIB_DATA
*
pTLData
)
{
HTREEITEM
hCur
;
TVITEM
tvi
;
WCHAR
wszText
[
MAX_LOAD_STRING
];
WCHAR
wszPredefinition
[]
=
{
'/'
,
'/'
,
' '
,
'T'
,
'L'
,
'i'
,
'b'
,
' '
,
':'
,
'\n'
,
'/'
,
'/'
,
' '
,
'F'
,
'o'
,
'r'
,
'w'
,
'a'
,
'r'
,
'd'
,
' '
,
'd'
,
'e'
,
'c'
,
'l'
,
'a'
,
'r'
,
'e'
,
' '
,
'a'
,
'l'
,
'l'
,
' '
,
't'
,
'y'
,
'p'
,
'e'
,
's'
,
' '
,
'd'
,
'e'
,
'f'
,
'i'
,
'n'
,
'e'
,
'd'
,
' '
,
'i'
,
'n'
,
' '
,
't'
,
'h'
,
'i'
,
's'
,
' '
,
't'
,
'y'
,
'p'
,
'e'
,
'l'
,
'i'
,
'b'
,
'\0'
};
hFirst
=
TreeView_GetChild
(
typelib
.
hTree
,
hFirst
);
AddToTLDataStrWithTabsW
(
pTLData
,
wszPredefinition
);
hCur
=
hFirst
;
memset
(
&
tvi
,
0
,
sizeof
(
TVITEM
));
tvi
.
mask
=
TVIF_TEXT
|
TVIF_PARAM
;
tvi
.
cchTextMax
=
MAX_LOAD_STRING
;
tvi
.
pszText
=
wszText
;
while
(
hCur
)
{
tvi
.
hItem
=
hCur
;
SendMessage
(
typelib
.
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
tvi
);
if
(((
TYPELIB_DATA
*
)(
tvi
.
lParam
))
->
bPredefine
)
{
AddToStrW
(
wszText
,
wszSemicolon
);
AddToTLDataStrWithTabsW
(
pTLData
,
wszText
);
}
hCur
=
TreeView_GetNextSibling
(
typelib
.
hTree
,
hCur
);
}
}
void
CreateInterfaceInfo
(
ITypeInfo
*
pTypeInfo
,
int
cImplTypes
,
WCHAR
*
wszName
,
WCHAR
*
wszHelpString
,
unsigned
long
ulHelpContext
,
TYPEATTR
*
pTypeAttr
,
TYPELIB_DATA
*
pTLData
)
...
...
@@ -602,6 +660,7 @@ void CreateInterfaceInfo(ITypeInfo *pTypeInfo, int cImplTypes, WCHAR *wszName,
int
PopulateTree
(
void
)
{
TVINSERTSTRUCT
tvis
;
TVITEM
tvi
;
ITypeLib
*
pTypeLib
;
TLIBATTR
*
pTLibAttr
;
ITypeInfo
*
pTypeInfo
,
*
pRefTypeInfo
;
...
...
@@ -755,6 +814,7 @@ int PopulateTree(void)
CreateInterfaceInfo
(
pTypeInfo
,
pTypeAttr
->
cImplTypes
,
bstrName
,
bstrData
,
ulHelpContext
,
pTypeAttr
,
(
TYPELIB_DATA
*
)(
U
(
tvis
).
item
.
lParam
));
((
TYPELIB_DATA
*
)(
U
(
tvis
).
item
.
lParam
))
->
bPredefine
=
TRUE
;
AddToStrW
(
wszText
,
wszTKIND_INTERFACE
);
AddToStrW
(
wszText
,
bstrName
);
...
...
@@ -768,6 +828,7 @@ int PopulateTree(void)
AddToStrW
(
wszText
,
bstrName
);
break
;
case
TKIND_DISPATCH
:
((
TYPELIB_DATA
*
)(
U
(
tvis
).
item
.
lParam
))
->
bPredefine
=
TRUE
;
AddToStrW
(
wszText
,
wszTKIND_DISPATCH
);
AddToStrW
(
wszText
,
bstrName
);
if
(
SUCCEEDED
(
ITypeInfo_GetRefTypeOfImplType
(
pTypeInfo
,
-
1
,
&
hRefType
)))
...
...
@@ -787,6 +848,7 @@ int PopulateTree(void)
CreateInterfaceInfo
(
pTypeInfo
,
pTypeAttr
->
cImplTypes
,
bstrName
,
bstrData
,
ulHelpContext
,
pTypeAttr
,
(
TYPELIB_DATA
*
)(
U
(
tvis
).
item
.
lParam
));
((
TYPELIB_DATA
*
)(
U
(
tvis
).
item
.
lParam
))
->
bPredefine
=
TRUE
;
AddToStrW
(
wszText
,
wszTKIND_INTERFACE
);
AddToStrW
(
wszText
,
bstrName
);
...
...
@@ -823,6 +885,16 @@ int PopulateTree(void)
}
SendMessage
(
typelib
.
hTree
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
tvis
.
hParent
);
memset
(
&
tvi
,
0
,
sizeof
(
TVITEM
));
tvi
.
mask
=
TVIF_PARAM
;
tvi
.
hItem
=
tvis
.
hParent
;
SendMessage
(
typelib
.
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
tvi
);
AddPredefinitions
(
tvi
.
hItem
,
(
TYPELIB_DATA
*
)(
tvi
.
lParam
));
AddIdlData
(
tvi
.
hItem
,
(
TYPELIB_DATA
*
)(
tvi
.
lParam
));
AddToTLDataStrW
((
TYPELIB_DATA
*
)(
tvi
.
lParam
),
((
TYPELIB_DATA
*
)(
tvi
.
lParam
))
->
wszInsertAfter
);
ITypeLib_Release
(
pTypeLib
);
return
0
;
}
...
...
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