mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge pull request #4887 from Skytrias/skytrias-orca-ui-update
Update to newest orca bindings (UI Update)
This commit is contained in:
+47
-30
@@ -37,12 +37,7 @@ log_info :: proc "contextless" (msg: cstring, loc := #caller_location) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abort :: proc "contextless" (msg: cstring, loc := #caller_location) {
|
abort :: proc "contextless" (msg: cstring, loc := #caller_location) {
|
||||||
abort_ext(
|
abort_ext(cstring(raw_data(loc.procedure)), cstring(raw_data(loc.file_path)), loc.line, msg)
|
||||||
cstring(raw_data(loc.procedure)),
|
|
||||||
cstring(raw_data(loc.file_path)),
|
|
||||||
loc.line,
|
|
||||||
msg,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -55,7 +50,12 @@ list_entry :: proc "contextless" (elt: ^list_elt, $T: typeid, $member: string) -
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the next entry in a list.
|
// Get the next entry in a list.
|
||||||
list_next_entry :: proc "contextless" (list: ^list, elt: ^list_elt, $T: typeid, $member: string) -> ^T {
|
list_next_entry :: proc "contextless" (
|
||||||
|
list: ^list,
|
||||||
|
elt: ^list_elt,
|
||||||
|
$T: typeid,
|
||||||
|
$member: string,
|
||||||
|
) -> ^T {
|
||||||
if elt.next != list.last {
|
if elt.next != list.last {
|
||||||
return list_entry(elt.next, T, member)
|
return list_entry(elt.next, T, member)
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,12 @@ list_next_entry :: proc "contextless" (list: ^list, elt: ^list_elt, $T: typeid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the previous entry in a list.
|
// Get the previous entry in a list.
|
||||||
list_prev_entry :: proc "contextless" (list: ^list, elt: ^list_elt, $T: typeid, $member: string) -> ^T {
|
list_prev_entry :: proc "contextless" (
|
||||||
|
list: ^list,
|
||||||
|
elt: ^list_elt,
|
||||||
|
$T: typeid,
|
||||||
|
$member: string,
|
||||||
|
) -> ^T {
|
||||||
if elt.prev != list.last {
|
if elt.prev != list.last {
|
||||||
return list_entry(elt.prev, T, member)
|
return list_entry(elt.prev, T, member)
|
||||||
}
|
}
|
||||||
@@ -94,9 +99,23 @@ list_last_entry :: proc "contextless" (list: ^list, $T: typeid, $member: string)
|
|||||||
// _elt: ^list_elt
|
// _elt: ^list_elt
|
||||||
// for elt in oc.list_for(list, &_elt, int, "elt") {
|
// for elt in oc.list_for(list, &_elt, int, "elt") {
|
||||||
// }
|
// }
|
||||||
list_for :: proc "contextless" (list: ^list, elt: ^^list_elt, $T: typeid, $member: string) -> (^T, bool) {
|
list_for :: proc "contextless" (
|
||||||
|
list: ^list,
|
||||||
|
elt: ^^list_elt,
|
||||||
|
$T: typeid,
|
||||||
|
$member: string,
|
||||||
|
) -> (
|
||||||
|
^T,
|
||||||
|
bool,
|
||||||
|
) {
|
||||||
if elt == nil {
|
if elt == nil {
|
||||||
assert_fail(#file, #procedure, #line, "elt != nil", "misuse of `list_for`, expected `elt` to not be nil")
|
assert_fail(
|
||||||
|
#file,
|
||||||
|
#procedure,
|
||||||
|
#line,
|
||||||
|
"elt != nil",
|
||||||
|
"misuse of `list_for`, expected `elt` to not be nil",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if elt^ == nil {
|
if elt^ == nil {
|
||||||
@@ -112,7 +131,15 @@ list_for :: proc "contextless" (list: ^list, elt: ^^list_elt, $T: typeid, $membe
|
|||||||
|
|
||||||
list_iter :: list_for
|
list_iter :: list_for
|
||||||
|
|
||||||
list_for_reverse :: proc "contextless" (list: ^list, elt: ^^list_elt, $T: typeid, $member: string) -> (^T, bool) {
|
list_for_reverse :: proc "contextless" (
|
||||||
|
list: ^list,
|
||||||
|
elt: ^^list_elt,
|
||||||
|
$T: typeid,
|
||||||
|
$member: string,
|
||||||
|
) -> (
|
||||||
|
^T,
|
||||||
|
bool,
|
||||||
|
) {
|
||||||
if elt^ == nil {
|
if elt^ == nil {
|
||||||
elt^ = list.last
|
elt^ = list.last
|
||||||
entry := list_checked_entry(elt^, T, member)
|
entry := list_checked_entry(elt^, T, member)
|
||||||
@@ -226,27 +253,17 @@ str32_list_for :: proc "contextless" (list: ^str32_list, elt: ^^list_elt) -> (^s
|
|||||||
return list_for(&list.list, elt, str32_elt, "listElt")
|
return list_for(&list.list, elt, str32_elt, "listElt")
|
||||||
}
|
}
|
||||||
|
|
||||||
@(deferred_none=ui_box_end)
|
@(deferred_none = ui_box_end)
|
||||||
ui_container :: proc "contextless" (name: string, flags: ui_flags = {}) -> ^ui_box {
|
ui_container :: proc "contextless" (name: string) -> ^ui_box {
|
||||||
return ui_box_begin_str8(name, flags)
|
return ui_box_begin_str8(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
@(deferred_none=ui_end_frame)
|
@(deferred_none = ui_menu_end)
|
||||||
ui_frame :: proc "contextless" (frame_size: [2]f32, style: ui_style, mask: ui_style_mask) {
|
ui_menu :: proc "contextless" (key, name: string) {
|
||||||
ui_begin_frame(frame_size, style, mask)
|
ui_menu_begin_str8(key, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
@(deferred_none=ui_panel_end)
|
@(deferred_none = ui_menu_bar_end)
|
||||||
ui_panel :: proc "contextless" (name: cstring, flags: ui_flags) {
|
ui_menu_bar :: proc "contextless" (key: string) {
|
||||||
ui_panel_begin(name, flags)
|
ui_menu_bar_begin_str8(key)
|
||||||
}
|
|
||||||
|
|
||||||
@(deferred_none=ui_menu_end)
|
|
||||||
ui_menu :: proc "contextless" (name: cstring) {
|
|
||||||
ui_menu_begin(name)
|
|
||||||
}
|
|
||||||
|
|
||||||
@(deferred_none=ui_menu_bar_end)
|
|
||||||
ui_menu_bar :: proc "contextless" (name: cstring) {
|
|
||||||
ui_menu_bar_begin(name)
|
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-3
@@ -8,15 +8,25 @@ create_odin_logger :: proc(lowest := runtime.Logger_Level.Debug, ident := "") ->
|
|||||||
return runtime.Logger{odin_logger_proc, nil, lowest, {}}
|
return runtime.Logger{odin_logger_proc, nil, lowest, {}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log_typed :: proc "contextless" (level: log_level, msg: cstring, loc := #caller_location) {
|
||||||
|
log_ext(
|
||||||
|
level,
|
||||||
|
cstring(raw_data(loc.procedure)),
|
||||||
|
cstring(raw_data(loc.file_path)),
|
||||||
|
loc.line,
|
||||||
|
msg,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
odin_logger_proc :: proc(logger_data: rawptr, level: runtime.Logger_Level, text: string, options: runtime.Logger_Options, location := #caller_location) {
|
odin_logger_proc :: proc(logger_data: rawptr, level: runtime.Logger_Level, text: string, options: runtime.Logger_Options, location := #caller_location) {
|
||||||
cbuf := make([]byte, len(text)+1, context.temp_allocator)
|
cbuf := make([]byte, len(text)+1, context.temp_allocator)
|
||||||
copy(cbuf, text)
|
copy(cbuf, text)
|
||||||
ctext := cstring(raw_data(cbuf))
|
ctext := cstring(raw_data(cbuf))
|
||||||
|
|
||||||
switch level {
|
switch level {
|
||||||
case .Debug, .Info: log_info(ctext, location)
|
case .Debug, .Info: log_typed(.INFO, ctext, location)
|
||||||
case .Warning: log_warning(ctext, location)
|
case .Warning: log_typed(.WARNING, ctext, location)
|
||||||
case: fallthrough
|
case: fallthrough
|
||||||
case .Error, .Fatal: log_error(ctext, location)
|
case .Error, .Fatal: log_typed(.ERROR, ctext, location)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+526
-562
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user