remove no longer needed code

This commit is contained in:
Kovid Goyal
2017-11-20 14:45:31 +05:30
parent d457abdee4
commit ba40bf5e6f
3 changed files with 8 additions and 30 deletions

View File

@@ -20,13 +20,6 @@
#define NSEventModifierFlagControl NSControlKeyMask
#endif
@interface MenuDispatcher : NSObject
@end
@implementation MenuDispatcher
@end
static NSObject* menu_dispatcher = NULL;
static NSMenuItem* title_menu = NULL;
static NSString*
@@ -62,21 +55,9 @@ find_app_name(void) {
}
PyObject*
cocoa_init(PyObject UNUSED *_self) {
// Press and Hold prevents some keys from emitting repeated characters
// See https://github.com/glfw/glfw/issues/1010
NSDictionary* defaults = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], @"ApplePressAndHoldEnabled", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
Py_RETURN_NONE;
}
PyObject*
cocoa_create_global_menu(PyObject UNUSED *_self) {
if (menu_dispatcher != NULL) { Py_RETURN_NONE; }
void
cocoa_create_global_menu(void) {
NSString* app_name = find_app_name();
menu_dispatcher = [[MenuDispatcher alloc] init];
NSMenu* bar = [[NSMenu alloc] init];
[NSApp setMainMenu:bar];
@@ -141,7 +122,6 @@ cocoa_create_global_menu(PyObject UNUSED *_self) {
[bar release];
Py_RETURN_NONE;
}
void
@@ -188,9 +168,7 @@ cocoa_get_lang(PyObject UNUSED *self) {
}
static PyMethodDef module_methods[] = {
{"cocoa_get_lang", (PyCFunction)cocoa_get_lang, METH_NOARGS, ""}, \
{"cocoa_create_global_menu", (PyCFunction)cocoa_create_global_menu, METH_NOARGS, ""}, \
{"cocoa_init", (PyCFunction)cocoa_init, METH_NOARGS, ""}, \
{"cocoa_get_lang", (PyCFunction)cocoa_get_lang, METH_NOARGS, ""},
{NULL, NULL, 0, NULL} /* Sentinel */
};