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
daf0fd75
Commit
daf0fd75
authored
Jan 07, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Jan 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Add a custom NSApplication subclass, WineApplication.
parent
b5dc5567
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
0 deletions
+89
-0
Makefile.in
dlls/winemac.drv/Makefile.in
+1
-0
cocoa_app.h
dlls/winemac.drv/cocoa_app.h
+30
-0
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+58
-0
No files found.
dlls/winemac.drv/Makefile.in
View file @
daf0fd75
...
...
@@ -9,6 +9,7 @@ C_SRCS = \
window.c
OBJC_SRCS
=
\
cocoa_app.m
\
cocoa_display.m
@MAKE_DLL_RULES@
dlls/winemac.drv/cocoa_app.h
0 → 100644
View file @
daf0fd75
/*
* MACDRV Cocoa application class declaration
*
* 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
*/
#import <AppKit/AppKit.h>
#include "macdrv_cocoa.h"
@interface
WineApplication
:
NSApplication
<
NSApplicationDelegate
>
-
(
void
)
transformProcessToForeground
;
@end
dlls/winemac.drv/cocoa_app.m
0 → 100644
View file @
daf0fd75
/*
* MACDRV Cocoa application class
*
* 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
*/
#import "cocoa_app.h"
@implementation
WineApplication
-
(
void
)
transformProcessToForeground
{
if
([
self
activationPolicy
]
!=
NSApplicationActivationPolicyRegular
)
{
NSMenu
*
mainMenu
;
NSMenu
*
submenu
;
NSString
*
bundleName
;
NSString
*
title
;
NSMenuItem
*
item
;
[
self
setActivationPolicy
:
NSApplicationActivationPolicyRegular
];
[
self
activateIgnoringOtherApps
:
YES
];
mainMenu
=
[[[
NSMenu
alloc
]
init
]
autorelease
];
submenu
=
[[[
NSMenu
alloc
]
initWithTitle
:
@"Wine"
]
autorelease
];
bundleName
=
[[
NSBundle
mainBundle
]
objectForInfoDictionaryKey
:(
NSString
*
)
kCFBundleNameKey
];
if
([
bundleName
length
])
title
=
[
NSString
stringWithFormat
:
@"Quit %@"
,
bundleName
];
else
title
=
@"Quit"
;
item
=
[
submenu
addItemWithTitle
:
title
action
:
@selector
(
terminate
:
)
keyEquivalent
:
@"q"
];
[
item
setKeyEquivalentModifierMask
:
NSCommandKeyMask
|
NSAlternateKeyMask
];
item
=
[[[
NSMenuItem
alloc
]
init
]
autorelease
];
[
item
setTitle
:
@"Wine"
];
[
item
setSubmenu
:
submenu
];
[
mainMenu
addItem
:
item
];
[
self
setMainMenu
:
mainMenu
];
}
}
@end
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