Skip to content

Commit

Permalink
Adding bind_id
Browse files Browse the repository at this point in the history
- V wrapper does not use/need `bind_id`, but let's add it anyway to be up to date.
  • Loading branch information
hassandraga committed Oct 6, 2023
1 parent 631ae1e commit 47adaf2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub:
event_type EventType // Event type
element &char // HTML element ID
event_number usize // Internal WebUI
bind_id usize // Bind ID
}

// -- Definitions ---------------------
Expand Down Expand Up @@ -69,8 +70,7 @@ fn C.webui_return_string(e &C.webui_event_t, s &char)
fn C.webui_return_bool(e &C.webui_event_t, b bool)

// -- Interface ----------------------- // not wrapped
fn C.webui_interface_bind(win Window, element &char, func fn (win Window, event_type EventType, element &char, event_num usize)) Function
fn C.webui_interface_bind(win Window, element &char, func fn (win Window, event_type EventType, element &char, event_num usize, bind_id usize)) Function
fn C.webui_interface_set_response(win Window, event_num usize, resp &char)
fn C.webui_interface_is_app_running() bool
fn C.webui_interface_get_window_id(win Window) Window
fn C.webui_interface_get_bind_id(win Window, element &char) Function
2 changes: 2 additions & 0 deletions src/lib.v
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub:
event_type EventType // Event type
element string // HTML element ID
event_number usize // Internal WebUI
bind_id usize // Bind ID
}

[params]
Expand Down Expand Up @@ -111,6 +112,7 @@ pub fn (w Window) bind[T](element string, func fn (&Event) T) Function {
event_type: c_event.event_type
element: unsafe { if c_event.element != nil { c_event.element.vstring() } else { '' } }
event_number: c_event.event_number
bind_id: c_event.bind_id
}
// Call user callback function and return response.
e.@return(func(e))
Expand Down

0 comments on commit 47adaf2

Please sign in to comment.