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
932a65dd
Commit
932a65dd
authored
Jan 31, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIN_ListParents no longer needs to be exported, make it static.
parent
f777d70a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
72 deletions
+70
-72
user32.spec
dlls/user/user32.spec
+0
-1
win.h
include/win.h
+0
-1
win.c
windows/win.c
+70
-70
No files found.
dlls/user/user32.spec
View file @
932a65dd
...
...
@@ -735,7 +735,6 @@
@ cdecl WIN_GetPtr(long)
@ cdecl WIN_LinkWindow(long long long)
@ cdecl WIN_ListChildren(long)
@ cdecl WIN_ListParents(long)
@ cdecl WIN_ReleaseWndPtr(ptr)
@ cdecl WIN_SetExStyle(long long)
@ cdecl WIN_SetStyle(long long long)
...
...
include/win.h
View file @
932a65dd
...
...
@@ -93,7 +93,6 @@ extern LRESULT WIN_DestroyWindow( HWND hwnd );
extern
void
WIN_DestroyThreadWindows
(
HWND
hwnd
);
extern
BOOL
WIN_CreateDesktopWindow
(
void
);
extern
BOOL
WIN_IsWindowDrawable
(
HWND
hwnd
,
BOOL
);
extern
HWND
*
WIN_ListParents
(
HWND
hwnd
);
extern
HWND
*
WIN_ListChildren
(
HWND
hwnd
);
extern
void
MDI_CalcDefaultChildPos
(
HWND
hwndClient
,
INT
total
,
LPPOINT
lpPos
,
INT
delta
);
...
...
windows/win.c
View file @
932a65dd
...
...
@@ -194,6 +194,72 @@ static HWND *list_window_children( HWND hwnd, ATOM atom, DWORD tid )
/*******************************************************************
* list_window_parents
*
* Build an array of all parents of a given window, starting with
* the immediate parent. The array must be freed with HeapFree.
* Returns NULL if window is a top-level window.
*/
static
HWND
*
list_window_parents
(
HWND
hwnd
)
{
WND
*
win
;
HWND
current
,
*
list
;
int
pos
=
0
,
size
=
16
,
count
=
0
;
if
(
!
(
list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
HWND
)
)))
return
NULL
;
current
=
hwnd
;
for
(;;)
{
if
(
!
(
win
=
WIN_GetPtr
(
current
)))
goto
empty
;
if
(
win
==
WND_OTHER_PROCESS
)
break
;
/* need to do it the hard way */
list
[
pos
]
=
win
->
parent
;
WIN_ReleasePtr
(
win
);
if
(
!
(
current
=
list
[
pos
]))
{
if
(
!
pos
)
goto
empty
;
return
list
;
}
if
(
++
pos
==
size
-
1
)
{
/* need to grow the list */
HWND
*
new_list
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
list
,
(
size
+
16
)
*
sizeof
(
HWND
)
);
if
(
!
new_list
)
goto
empty
;
list
=
new_list
;
size
+=
16
;
}
}
/* at least one parent belongs to another process, have to query the server */
for
(;;)
{
count
=
0
;
SERVER_START_REQ
(
get_window_parents
)
{
req
->
handle
=
hwnd
;
wine_server_set_reply
(
req
,
list
,
(
size
-
1
)
*
sizeof
(
HWND
)
);
if
(
!
wine_server_call
(
req
))
count
=
reply
->
count
;
}
SERVER_END_REQ
;
if
(
!
count
)
goto
empty
;
if
(
size
>
count
)
{
list
[
count
]
=
0
;
return
list
;
}
HeapFree
(
GetProcessHeap
(),
0
,
list
);
size
=
count
+
1
;
if
(
!
(
list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
HWND
)
)))
return
NULL
;
}
empty:
HeapFree
(
GetProcessHeap
(),
0
,
list
);
return
NULL
;
}
/*******************************************************************
* send_parent_notify
*/
static
void
send_parent_notify
(
HWND
hwnd
,
UINT
msg
)
...
...
@@ -2549,7 +2615,7 @@ HWND WINAPI GetAncestor( HWND hwnd, UINT type )
break
;
case
GA_ROOT
:
if
(
!
(
list
=
WIN_ListP
arents
(
hwnd
)))
return
0
;
if
(
!
(
list
=
list_window_p
arents
(
hwnd
)))
return
0
;
if
(
!
list
[
0
]
||
!
list
[
1
])
ret
=
WIN_GetFullHandle
(
hwnd
);
/* top-level window */
else
...
...
@@ -2647,7 +2713,7 @@ HWND WINAPI SetParent( HWND hwnd, HWND parent )
*/
BOOL
WINAPI
IsChild
(
HWND
parent
,
HWND
child
)
{
HWND
*
list
=
WIN_ListP
arents
(
child
);
HWND
*
list
=
list_window_p
arents
(
child
);
int
i
;
BOOL
ret
;
...
...
@@ -2670,7 +2736,7 @@ BOOL WINAPI IsWindowVisible( HWND hwnd )
int
i
;
if
(
!
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_VISIBLE
))
return
FALSE
;
if
(
!
(
list
=
WIN_ListP
arents
(
hwnd
)))
return
TRUE
;
if
(
!
(
list
=
list_window_p
arents
(
hwnd
)))
return
TRUE
;
for
(
i
=
0
;
list
[
i
];
i
++
)
if
(
!
(
GetWindowLongW
(
list
[
i
],
GWL_STYLE
)
&
WS_VISIBLE
))
break
;
retval
=
!
list
[
i
];
...
...
@@ -2696,7 +2762,7 @@ BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL icon )
if
(
!
(
style
&
WS_VISIBLE
))
return
FALSE
;
if
((
style
&
WS_MINIMIZE
)
&&
icon
&&
GetClassLongA
(
hwnd
,
GCL_HICON
))
return
FALSE
;
if
(
!
(
list
=
WIN_ListP
arents
(
hwnd
)))
return
TRUE
;
if
(
!
(
list
=
list_window_p
arents
(
hwnd
)))
return
TRUE
;
for
(
i
=
0
;
list
[
i
];
i
++
)
if
((
GetWindowLongW
(
list
[
i
],
GWL_STYLE
)
&
(
WS_VISIBLE
|
WS_MINIMIZE
))
!=
WS_VISIBLE
)
break
;
...
...
@@ -2847,72 +2913,6 @@ HWND WINAPI GetLastActivePopup( HWND hwnd )
/*******************************************************************
* WIN_ListParents
*
* Build an array of all parents of a given window, starting with
* the immediate parent. The array must be freed with HeapFree.
* Returns NULL if window is a top-level window.
*/
HWND
*
WIN_ListParents
(
HWND
hwnd
)
{
WND
*
win
;
HWND
current
,
*
list
;
int
pos
=
0
,
size
=
16
,
count
=
0
;
if
(
!
(
list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
HWND
)
)))
return
NULL
;
current
=
hwnd
;
for
(;;)
{
if
(
!
(
win
=
WIN_GetPtr
(
current
)))
goto
empty
;
if
(
win
==
WND_OTHER_PROCESS
)
break
;
/* need to do it the hard way */
list
[
pos
]
=
win
->
parent
;
WIN_ReleasePtr
(
win
);
if
(
!
(
current
=
list
[
pos
]))
{
if
(
!
pos
)
goto
empty
;
return
list
;
}
if
(
++
pos
==
size
-
1
)
{
/* need to grow the list */
HWND
*
new_list
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
list
,
(
size
+
16
)
*
sizeof
(
HWND
)
);
if
(
!
new_list
)
goto
empty
;
list
=
new_list
;
size
+=
16
;
}
}
/* at least one parent belongs to another process, have to query the server */
for
(;;)
{
count
=
0
;
SERVER_START_REQ
(
get_window_parents
)
{
req
->
handle
=
hwnd
;
wine_server_set_reply
(
req
,
list
,
(
size
-
1
)
*
sizeof
(
HWND
)
);
if
(
!
wine_server_call
(
req
))
count
=
reply
->
count
;
}
SERVER_END_REQ
;
if
(
!
count
)
goto
empty
;
if
(
size
>
count
)
{
list
[
count
]
=
0
;
return
list
;
}
HeapFree
(
GetProcessHeap
(),
0
,
list
);
size
=
count
+
1
;
if
(
!
(
list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
HWND
)
)))
return
NULL
;
}
empty:
HeapFree
(
GetProcessHeap
(),
0
,
list
);
return
NULL
;
}
/*******************************************************************
* WIN_ListChildren
*
* Build an array of the children of a given window. The array must be
...
...
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