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
4e83d2fc
Commit
4e83d2fc
authored
Jan 21, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Jan 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Implement MsgWaitForMultipleObjectsEx and infrastructure for processing events.
parent
177b67e6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
128 additions
and
0 deletions
+128
-0
Makefile.in
dlls/winemac.drv/Makefile.in
+1
-0
event.c
dlls/winemac.drv/event.c
+125
-0
macdrv.h
dlls/winemac.drv/macdrv.h
+1
-0
winemac.drv.spec
dlls/winemac.drv/winemac.drv.spec
+1
-0
No files found.
dlls/winemac.drv/Makefile.in
View file @
4e83d2fc
...
...
@@ -4,6 +4,7 @@ EXTRALIBS = -framework AppKit
C_SRCS
=
\
display.c
\
event.c
\
gdi.c
\
macdrv_main.c
\
surface.c
\
...
...
dlls/winemac.drv/event.c
0 → 100644
View file @
4e83d2fc
/*
* MACDRV event driver
*
* Copyright 1993 Alexandre Julliard
* 1999 Noel Borthwick
* Copyright 2011, 2012, 2013 Ken Thomases for CodeWeavers Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "macdrv.h"
#include "winuser.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
event
);
/* return the name of an Mac event */
static
const
char
*
dbgstr_event
(
int
type
)
{
return
wine_dbg_sprintf
(
"Unknown event %d"
,
type
);
}
/***********************************************************************
* get_event_mask
*/
static
macdrv_event_mask
get_event_mask
(
DWORD
mask
)
{
if
((
mask
&
QS_ALLINPUT
)
==
QS_ALLINPUT
)
return
-
1
;
return
0
;
}
/***********************************************************************
* macdrv_handle_event
*/
void
macdrv_handle_event
(
macdrv_event
*
event
)
{
HWND
hwnd
=
macdrv_get_window_hwnd
(
event
->
window
);
const
macdrv_event
*
prev
;
struct
macdrv_thread_data
*
thread_data
=
macdrv_thread_data
();
TRACE
(
"%s for hwnd/window %p/%p
\n
"
,
dbgstr_event
(
event
->
type
),
hwnd
,
event
->
window
);
prev
=
thread_data
->
current_event
;
thread_data
->
current_event
=
event
;
switch
(
event
->
type
)
{
default:
TRACE
(
" ignoring
\n
"
);
break
;
}
thread_data
->
current_event
=
prev
;
}
/***********************************************************************
* process_events
*/
static
int
process_events
(
macdrv_event_queue
queue
,
macdrv_event_mask
mask
)
{
macdrv_event
event
;
int
count
=
0
;
while
(
macdrv_get_event_from_queue
(
queue
,
mask
,
&
event
))
{
count
++
;
macdrv_handle_event
(
&
event
);
macdrv_cleanup_event
(
&
event
);
}
if
(
count
)
TRACE
(
"processed %d events
\n
"
,
count
);
return
count
;
}
/***********************************************************************
* MsgWaitForMultipleObjectsEx (MACDRV.@)
*/
DWORD
CDECL
macdrv_MsgWaitForMultipleObjectsEx
(
DWORD
count
,
const
HANDLE
*
handles
,
DWORD
timeout
,
DWORD
mask
,
DWORD
flags
)
{
DWORD
ret
;
struct
macdrv_thread_data
*
data
=
macdrv_thread_data
();
macdrv_event_mask
event_mask
=
get_event_mask
(
mask
);
TRACE
(
"count %d, handles %p, timeout %u, mask %x, flags %x
\n
"
,
count
,
handles
,
timeout
,
mask
,
flags
);
if
(
!
data
)
{
if
(
!
count
&&
!
timeout
)
return
WAIT_TIMEOUT
;
return
WaitForMultipleObjectsEx
(
count
,
handles
,
flags
&
MWMO_WAITALL
,
timeout
,
flags
&
MWMO_ALERTABLE
);
}
if
(
data
->
current_event
)
event_mask
=
0
;
/* don't process nested events */
if
(
process_events
(
data
->
queue
,
event_mask
))
ret
=
count
-
1
;
else
if
(
count
||
timeout
)
{
ret
=
WaitForMultipleObjectsEx
(
count
,
handles
,
flags
&
MWMO_WAITALL
,
timeout
,
flags
&
MWMO_ALERTABLE
);
if
(
ret
==
count
-
1
)
process_events
(
data
->
queue
,
event_mask
);
}
else
ret
=
WAIT_TIMEOUT
;
return
ret
;
}
dlls/winemac.drv/macdrv.h
View file @
4e83d2fc
...
...
@@ -83,6 +83,7 @@ enum macdrv_window_messages
struct
macdrv_thread_data
{
macdrv_event_queue
queue
;
const
macdrv_event
*
current_event
;
};
extern
DWORD
thread_data_tls_index
DECLSPEC_HIDDEN
;
...
...
dlls/winemac.drv/winemac.drv.spec
View file @
4e83d2fc
...
...
@@ -9,6 +9,7 @@
@ cdecl DestroyWindow(long) macdrv_DestroyWindow
@ cdecl EnumDisplayMonitors(long ptr ptr long) macdrv_EnumDisplayMonitors
@ cdecl GetMonitorInfo(long ptr) macdrv_GetMonitorInfo
@ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) macdrv_MsgWaitForMultipleObjectsEx
@ cdecl SetLayeredWindowAttributes(long long long long) macdrv_SetLayeredWindowAttributes
@ cdecl SetParent(long long long) macdrv_SetParent
@ cdecl SetWindowRgn(long long long) macdrv_SetWindowRgn
...
...
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