Skip to content

Commit

Permalink
(Cocoa) Cut down on some ifdefs
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Feb 9, 2019
1 parent 47ed8d3 commit bc8b348
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions ui/drivers/cocoa/ui_cocoa_window.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,15 @@ static void ui_window_cocoa_destroy(void *data)
static void ui_window_cocoa_set_focused(void *data)
{
ui_window_cocoa_t *cocoa = (ui_window_cocoa_t*)data;
#if defined(HAVE_COCOA_METAL)
CocoaView *cocoa_view = (BRIDGE CocoaView*)cocoa->data;
#elif defined(HAVE_COCOA)
CocoaView *cocoa_view = (CocoaView*)cocoa->data;
#endif
[[cocoa_view window] makeKeyAndOrderFront:nil];
}

static void ui_window_cocoa_set_visible(void *data,
bool set_visible)
{
ui_window_cocoa_t *cocoa = (ui_window_cocoa_t*)data;
#if defined(HAVE_COCOA_METAL)
CocoaView *cocoa_view = (BRIDGE CocoaView*)cocoa->data;
#elif defined(HAVE_COCOA)
CocoaView *cocoa_view = (CocoaView*)cocoa->data;
#endif
if (set_visible)
[[cocoa_view window] makeKeyAndOrderFront:nil];
else
Expand All @@ -68,23 +60,15 @@ static void ui_window_cocoa_set_visible(void *data,
static void ui_window_cocoa_set_title(void *data, char *buf)
{
ui_window_cocoa_t *cocoa = (ui_window_cocoa_t*)data;
#if defined(HAVE_COCOA_METAL)
CocoaView *cocoa_view = (BRIDGE CocoaView*)cocoa->data;
#else
CocoaView *cocoa_view = (CocoaView*)cocoa->data;
#endif
const char* const text = buf; /* < Can't access buffer directly in the block */
[[cocoa_view window] setTitle:[NSString stringWithCString:text encoding:NSUTF8StringEncoding]];
}

static void ui_window_cocoa_set_droppable(void *data, bool droppable)
{
ui_window_cocoa_t *cocoa = (ui_window_cocoa_t*)data;
#if defined(HAVE_COCOA_METAL)
CocoaView *cocoa_view = (BRIDGE CocoaView*)cocoa->data;
#else
CocoaView *cocoa_view = (CocoaView*)cocoa->data;
#endif

if (droppable)
{
Expand All @@ -103,11 +87,7 @@ static void ui_window_cocoa_set_droppable(void *data, bool droppable)
static bool ui_window_cocoa_focused(void *data)
{
ui_window_cocoa_t *cocoa = (ui_window_cocoa_t*)data;
#if defined(HAVE_COCOA_METAL)
CocoaView *cocoa_view = (BRIDGE CocoaView*)cocoa->data;
#else
CocoaView *cocoa_view = (CocoaView*)cocoa->data;
#endif
return cocoa_view.window.isMainWindow;
}

Expand Down

0 comments on commit bc8b348

Please sign in to comment.