Expose API to control surfaces z-order #73
|
@ -1750,6 +1750,9 @@ void oc_osx_update_layers(oc_window_data* window)
|
||||||
|
|
||||||
void oc_osx_surface_bring_to_front(oc_surface_data* surface)
|
void oc_osx_surface_bring_to_front(oc_surface_data* surface)
|
||||||
{
|
{
|
||||||
|
dispatch_block_t block = ^{
|
||||||
|
@autoreleasepool
|
||||||
|
{
|
||||||
oc_window_data* window = oc_window_ptr_from_handle(surface->layer.window);
|
oc_window_data* window = oc_window_ptr_from_handle(surface->layer.window);
|
||||||
if(window)
|
if(window)
|
||||||
{
|
{
|
||||||
|
@ -1757,10 +1760,24 @@ void oc_osx_surface_bring_to_front(oc_surface_data* surface)
|
||||||
oc_list_push_back(&window->osx.layers, &surface->layer.listElt);
|
oc_list_push_back(&window->osx.layers, &surface->layer.listElt);
|
||||||
oc_osx_update_layers(window);
|
oc_osx_update_layers(window);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if([NSThread isMainThread])
|
||||||
|
{
|
||||||
|
block();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dispatch_sync(dispatch_get_main_queue(), block);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void oc_osx_surface_send_to_back(oc_surface_data* surface)
|
void oc_osx_surface_send_to_back(oc_surface_data* surface)
|
||||||
{
|
{
|
||||||
|
dispatch_block_t block = ^{
|
||||||
|
@autoreleasepool
|
||||||
|
{
|
||||||
oc_window_data* window = oc_window_ptr_from_handle(surface->layer.window);
|
oc_window_data* window = oc_window_ptr_from_handle(surface->layer.window);
|
||||||
if(window)
|
if(window)
|
||||||
{
|
{
|
||||||
|
@ -1768,6 +1785,17 @@ void oc_osx_surface_send_to_back(oc_surface_data* surface)
|
||||||
oc_list_push(&window->osx.layers, &surface->layer.listElt);
|
oc_list_push(&window->osx.layers, &surface->layer.listElt);
|
||||||
oc_osx_update_layers(window);
|
oc_osx_update_layers(window);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if([NSThread isMainThread])
|
||||||
|
{
|
||||||
|
block();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dispatch_sync(dispatch_get_main_queue(), block);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void oc_surface_cleanup(oc_surface_data* surface)
|
void oc_surface_cleanup(oc_surface_data* surface)
|
||||||
|
|
|
@ -675,6 +675,8 @@ i32 orca_runloop(void* user)
|
||||||
|
|
||||||
if(app->debugOverlay.show)
|
if(app->debugOverlay.show)
|
||||||
{
|
{
|
||||||
|
oc_surface_bring_to_front(app->debugOverlay.surface);
|
||||||
|
|
||||||
oc_ui_style debugUIDefaultStyle = { .bgColor = { 0 },
|
oc_ui_style debugUIDefaultStyle = { .bgColor = { 0 },
|
||||||
.color = { 1, 1, 1, 1 },
|
.color = { 1, 1, 1, 1 },
|
||||||
.font = app->debugOverlay.fontReg,
|
.font = app->debugOverlay.fontReg,
|
||||||
|
|
|
@ -36,6 +36,30 @@
|
||||||
{"name": "pixels",
|
{"name": "pixels",
|
||||||
"type": {"name": "u8*", "tag": "p"}}]
|
"type": {"name": "u8*", "tag": "p"}}]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "oc_surface_contents_scaling",
|
||||||
|
"cname": "oc_surface_contents_scaling",
|
||||||
|
"ret": {"name": "oc_vec2", "tag": "S"},
|
||||||
|
"args": [
|
||||||
|
{"name": "surface",
|
||||||
|
"type": {"name": "oc_surface", "tag": "S"}}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "oc_surface_bring_to_front",
|
||||||
|
"cname": "oc_surface_bring_to_front",
|
||||||
|
"ret": {"name": "void", "tag": "v"},
|
||||||
|
"args": [
|
||||||
|
{"name": "surface",
|
||||||
|
"type": {"name": "oc_surface", "tag": "S"}}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "oc_surface_send_to_back",
|
||||||
|
"cname": "oc_surface_send_to_back",
|
||||||
|
"ret": {"name": "void", "tag": "v"},
|
||||||
|
"args": [
|
||||||
|
{"name": "surface",
|
||||||
|
"type": {"name": "oc_surface", "tag": "S"}}]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "oc_surface_select",
|
"name": "oc_surface_select",
|
||||||
"cname": "oc_surface_select",
|
"cname": "oc_surface_select",
|
||||||
|
@ -52,14 +76,6 @@
|
||||||
{"name": "surface",
|
{"name": "surface",
|
||||||
"type": {"name": "oc_surface", "tag": "S"}}]
|
"type": {"name": "oc_surface", "tag": "S"}}]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "oc_surface_contents_scaling",
|
|
||||||
"cname": "oc_surface_contents_scaling",
|
|
||||||
"ret": {"name": "oc_vec2", "tag": "S"},
|
|
||||||
"args": [
|
|
||||||
{"name": "surface",
|
|
||||||
"type": {"name": "oc_surface", "tag": "S"}}]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "oc_surface_render_commands",
|
"name": "oc_surface_render_commands",
|
||||||
"cname": "orca_surface_render_commands",
|
"cname": "orca_surface_render_commands",
|
||||||
|
|
Loading…
Reference in New Issue