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
6289a612
Commit
6289a612
authored
Feb 06, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Feb 07, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Add WineApplication methods to convert from Cocoa to Win32 coordinate space.
Cocoa coordinate space has its origin in the lower left of the primary screen and y increases up.
parent
5f06bf80
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
cocoa_app.h
dlls/winemac.drv/cocoa_app.h
+3
-0
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+31
-0
No files found.
dlls/winemac.drv/cocoa_app.h
View file @
6289a612
...
...
@@ -43,6 +43,9 @@
CGEventSourceKeyboardType
keyboardType
;
NSEvent
*
lastFlagsChanged
;
CGFloat
primaryScreenHeight
;
BOOL
primaryScreenHeightValid
;
}
@property
(
nonatomic
)
CGEventSourceKeyboardType
keyboardType
;
...
...
dlls/winemac.drv/cocoa_app.m
View file @
6289a612
...
...
@@ -225,6 +225,32 @@ int macdrv_err_on;
}
}
-
(
CGFloat
)
primaryScreenHeight
{
if
(
!
primaryScreenHeightValid
)
{
NSArray
*
screens
=
[
NSScreen
screens
];
if
([
screens
count
])
{
primaryScreenHeight
=
NSHeight
([[
screens
objectAtIndex
:
0
]
frame
]);
primaryScreenHeightValid
=
TRUE
;
}
else
return
1280
;
/* arbitrary value */
}
return
primaryScreenHeight
;
}
-
(
NSPoint
)
flippedMouseLocation
:
(
NSPoint
)
point
{
/* This relies on the fact that Cocoa's mouse location points are
actually off by one (precisely because they were flipped from
Quartz screen coordinates using this same technique). */
point
.
y
=
[
self
primaryScreenHeight
]
-
point
.
y
;
return
point
;
}
/*
* ---------- NSApplication method overrides ----------
...
...
@@ -241,6 +267,11 @@ int macdrv_err_on;
/*
* ---------- NSApplicationDelegate methods ----------
*/
-
(
void
)
applicationDidChangeScreenParameters
:
(
NSNotification
*
)
notification
{
primaryScreenHeightValid
=
FALSE
;
}
-
(
void
)
applicationDidResignActive
:
(
NSNotification
*
)
notification
{
macdrv_event
event
;
...
...
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