Skip to main content

core.rootview

local rootview = require "core.rootview"

__index

(field) __index: core.object

context

(field) context: 'application'|'session'

current_scale

(field) current_scale: number

cursor

(field) cursor: 'arrow'|'hand'|'ibeam'|'sizeh'|'sizev'

deferred_draws

(field) deferred_draws: table

drag_overlay

(field) drag_overlay: table

drag_overlay_tab

(field) drag_overlay_tab: table

dragged_divider

(field) dragged_divider: core.node|unknown

dragged_node

(field) dragged_node: table

first_dnd_processed

(field) first_dnd_processed: boolean

set this to true because at this point there are no dnd requests that are caused by the initial dnd into dock user action


grab

(field) grab: table

h_scrollbar

(field) h_scrollbar: core.scrollbar

Scrollbar Use Scrollbar:set_size to set the bounding box of the view the scrollbar belongs to. Use Scrollbar:update to update the scrollbar animations. Use Scrollbar:draw to draw the scrollbar. Use Scrollbar:on_mouse_pressed, Scrollbar:on_mouse_released, Scrollbar:on_mouse_moved and Scrollbar:on_mouse_left to react to mouse movements; the scrollbar won't update automatically. Use Scrollbar:set_percent to set the scrollbar location externally.

To manage all the orientations, the scrollbar changes the coordinates system accordingly. The "normal" coordinate system adapts the scrollbar coordinates as if it's always a vertical scrollbar, positioned at the end of the bounding box.


hovered_scrollbar

(field) hovered_scrollbar: boolean

mouse

(field) mouse: core.view.position

overlapping_view

(field) overlapping_view: any

position

(field) position: core.view.position

root_node

(field) root_node: core.node

scroll

(field) scroll: core.view.scroll

scrollable

(field) scrollable: boolean

size

(field) size: core.view.position

super

(field) super: core.view

Base view.


touched_view

(field) touched_view: any

v_scrollbar

(field) v_scrollbar: core.scrollbar

Scrollbar Use Scrollbar:set_size to set the bounding box of the view the scrollbar belongs to. Use Scrollbar:update to update the scrollbar animations. Use Scrollbar:draw to draw the scrollbar. Use Scrollbar:on_mouse_pressed, Scrollbar:on_mouse_released, Scrollbar:on_mouse_moved and Scrollbar:on_mouse_left to react to mouse movements; the scrollbar won't update automatically. Use Scrollbar:set_percent to set the scrollbar location externally.

To manage all the orientations, the scrollbar changes the coordinates system accordingly. The "normal" coordinate system adapts the scrollbar coordinates as if it's always a vertical scrollbar, positioned at the end of the bounding box.


on_view_mouse_pressed

function core.rootview.on_view_mouse_pressed(button: 'left'|'right', x: number, y: number, clicks: integer)

Function to intercept mouse pressed events on the active view. Do nothing by default.

button:
| 'left'
| 'right'

__call

(method) core.object:__call(...any)
-> core.object

Metamethod to allow using the object call as a constructor.


__tostring

(method) core.object:__tostring()
-> string

Metamethod to get a string representation of an object.


clamp_scroll_position

(method) core.view:clamp_scroll_position()

close_all_docviews

(method) core.rootview:close_all_docviews(keep_active: boolean)

defer_draw

(method) core.rootview:defer_draw(fn: any, ...any)

draw

(method) core.rootview:draw()

draw_background

(method) core.view:draw_background(color: renderer.color)

draw_drag_overlay

(method) core.rootview:draw_drag_overlay(ov: any)

draw_grabbed_tab

(method) core.rootview:draw_grabbed_tab()

draw_scrollbar

(method) core.view:draw_scrollbar()

extend

(method) core.object:extend()
-> core.object

extends

(method) core.object:extends(T: any)
-> boolean

Check if the object inherits from the given type.


get_active_node

(method) core.rootview:get_active_node()
-> core.node

get_active_node_default

(method) core.rootview:get_active_node_default()
-> core.node

get_content_bounds

(method) core.view:get_content_bounds()
-> number
2. number
3. number
4. number

get_content_offset

(method) core.view:get_content_offset()
-> x: number
2. y: number

get_h_scrollable_size

(method) core.view:get_h_scrollable_size()
-> number

get_name

(method) core.view:get_name()
-> string

get_overlay_base_color

(method) core.rootview:get_overlay_base_color(overlay: any)
-> unknown

get_primary_node

(method) core.rootview:get_primary_node()
-> core.node

get_scrollable_size

(method) core.view:get_scrollable_size()
-> number

grab_mouse

(method) core.rootview:grab_mouse(button: 'left'|'right', view: core.view)

Obtain mouse grab.

This means that mouse movements will be sent to the specified view, even when those occur outside of it. There can't be multiple mouse grabs, even for different buttons.

button:
| 'left'
| 'right'

See: RootView ungrab_mouse


interpolate_drag_overlay

(method) core.rootview:interpolate_drag_overlay(overlay: any)

is

(method) core.object:is(T: any)
-> boolean

Check if the object is strictly of the given type.


is_class_of

(method) core.object:is_class_of(T: any)
-> boolean

Check if the parameter is strictly of the object type.


is_extended_by

(method) core.object:is_extended_by(T: any)
-> boolean

Check if the parameter inherits from the object.


move_towards

(method) core.view:move_towards(t: any, k: any, dest: any, rate: any, name: any)

new

(method) core.rootview:new()

on_file_dropped

(method) core.rootview:on_file_dropped(filename: string, x: number, y: number)
-> boolean

on_focus_lost

(method) core.rootview:on_focus_lost(...any)

on_ime_text_editing

(method) core.rootview:on_ime_text_editing(...any)

on_mouse_left

(method) core.rootview:on_mouse_left()

on_mouse_moved

(method) core.rootview:on_mouse_moved(x: number, y: number, dx: number, dy: number)

on_mouse_pressed

(method) core.rootview:on_mouse_pressed(button: 'left'|'right', x: number, y: number, clicks: integer)
-> boolean
button:
| 'left'
| 'right'

on_mouse_released

(method) core.rootview:on_mouse_released(button: 'left'|'right', x: number, y: number, ...any)
button:
| 'left'
| 'right'

on_mouse_wheel

(method) core.rootview:on_mouse_wheel(...any)

on_scale_change

(method) core.view:on_scale_change(new_scale: number, prev_scale: number)

Can be overriden to listen for scale change events to apply any neccesary changes in sizes, padding, etc...


on_text_input

(method) core.rootview:on_text_input(...any)

on_touch_moved

(method) core.rootview:on_touch_moved(x: number, y: number, dx: number, dy: number, ...any)

on_touch_pressed

(method) core.rootview:on_touch_pressed(x: any, y: any, ...any)

on_touch_released

(method) core.rootview:on_touch_released(x: any, y: any, ...any)

open_doc

(method) core.rootview:open_doc(doc: core.doc)
-> core.docview

scrollbar_dragging

(method) core.view:scrollbar_dragging()
-> boolean

scrollbar_hovering

(method) core.view:scrollbar_hovering()
-> boolean

scrollbar_overlaps_point

(method) core.view:scrollbar_overlaps_point(x: number, y: number)
-> boolean

select_next_primary_node

(method) core.rootview:select_next_primary_node()
-> core.node

set_drag_overlay

(method) core.rootview:set_drag_overlay(overlay: any, x: any, y: any, w: any, h: any, immediate: any)

set_show_overlay

(method) core.rootview:set_show_overlay(overlay: any, status: any)

supports_text_input

(method) core.view:supports_text_input()
-> boolean

try_close

(method) core.view:try_close(do_close: any)

ungrab_mouse

(method) core.rootview:ungrab_mouse(button: 'left'|'right')

Release mouse grab.

The specified button must be the last button that grabbed the mouse.

button:
| 'left'
| 'right'

See: RootView grab_mouse


update

(method) core.rootview:update()

update_drag_overlay

(method) core.rootview:update_drag_overlay()

update_scrollbar

(method) core.view:update_scrollbar()