mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-22 02:38:11 +00:00
Add set_droppable
This commit is contained in:
parent
80b194f491
commit
47c7330cc8
@ -64,7 +64,9 @@ void *glkitview_init(void);
|
||||
|
||||
#if defined(HAVE_COCOA)
|
||||
[self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
||||
[self registerForDraggedTypes:[NSArray arrayWithObjects:NSColorPboardType, NSFilenamesPboardType, nil]];
|
||||
ui_window_cocoa_t view;
|
||||
view.data = (CocoaView*)self;
|
||||
ui_window_cocoa_set_droppable(&view, true);
|
||||
#elif defined(HAVE_COCOATOUCH)
|
||||
self.view = (__bridge GLKView*)glkitview_init();
|
||||
|
||||
|
@ -43,6 +43,8 @@ void ui_window_cocoa_destroy(void *data);
|
||||
|
||||
void ui_window_cocoa_set_title(void *data, char *buf);
|
||||
|
||||
void ui_window_cocoa_set_droppable(void *data, bool droppable);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -55,10 +55,26 @@ void ui_window_cocoa_set_title(void *data, char *buf)
|
||||
[[cocoa_view window] setTitle:[NSString stringWithCString:text encoding:NSUTF8StringEncoding]];
|
||||
}
|
||||
|
||||
void ui_window_cocoa_set_droppable(void *data, bool droppable)
|
||||
{
|
||||
ui_window_cocoa_t *cocoa = (ui_window_cocoa_t*)data;
|
||||
CocoaView *cocoa_view = (CocoaView*)cocoa->data;
|
||||
|
||||
if (droppable)
|
||||
{
|
||||
[[cocoa_view window] registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[cocoa_view window] unregisterDraggedTypes];
|
||||
}
|
||||
}
|
||||
|
||||
const ui_window_t ui_window_cocoa = {
|
||||
ui_window_cocoa_destroy,
|
||||
ui_window_cocoa_set_focused,
|
||||
ui_window_cocoa_set_visible,
|
||||
ui_window_cocoa_set_title,
|
||||
ui_window_cocoa_set_droppable,
|
||||
"cocoa"
|
||||
};
|
||||
|
@ -38,10 +38,15 @@ static void ui_window_null_set_title(void *data, char *buf)
|
||||
{
|
||||
}
|
||||
|
||||
static void ui_window_null_set_droppable(void *data, bool droppable)
|
||||
{
|
||||
}
|
||||
|
||||
const ui_window_t ui_window_null = {
|
||||
ui_window_null_destroy,
|
||||
ui_window_null_set_focused,
|
||||
ui_window_null_set_visible,
|
||||
ui_window_null_set_title,
|
||||
ui_window_null_set_droppable,
|
||||
"null"
|
||||
};
|
||||
|
@ -73,10 +73,15 @@ void ui_window_win32_set_title(void *data, char *buf)
|
||||
SetWindowText(window->hwnd, buf);
|
||||
}
|
||||
|
||||
void ui_window_win32_set_droppable(void *data, bool droppable)
|
||||
{
|
||||
}
|
||||
|
||||
const ui_window_t ui_window_win32 = {
|
||||
ui_window_win32_destroy,
|
||||
ui_window_win32_set_focused,
|
||||
ui_window_win32_set_visible,
|
||||
ui_window_win32_set_title,
|
||||
ui_window_win32_set_droppable,
|
||||
"win32"
|
||||
};
|
||||
|
@ -46,6 +46,8 @@ void ui_window_win32_destroy(void *data);
|
||||
|
||||
void ui_window_win32_set_title(void *data, char *buf);
|
||||
|
||||
void ui_window_win32_set_droppable(void *data, bool droppable);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -37,6 +37,7 @@ typedef struct ui_window
|
||||
void (*set_focused)(void *data);
|
||||
void (*set_visible)(void *data, bool visible);
|
||||
void (*set_title)(void *data, char *buf);
|
||||
void (*set_droppable)(void *data, bool droppable);
|
||||
const char *ident;
|
||||
} ui_window_t;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user