sciter

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

Go bindings for Sciter

Build status Build Status License

Check this page for other language bindings (Delphi / D / Go / .NET / Python / Rust).


Attention

The ownership of project is transferred to this new organization. Thus the import path for golang should now be github.com/iwctwbai/sciter-go, but the package name is still sciter.

Introduction

This package provides a Golang bindings of Sciter using cgo. Using go sciter you must have the platform specified sciter dynamic library downloaded from sciter-sdk, the library itself is rather small (under 5MB, less than 2MB when upxed) .

Most Sciter API are supported, including:

  • Html string/file loading
  • DOM manipulation/callback/event handling
  • DOM state/attribute handling
  • Custom resource loading
  • Sciter Behavior
  • Sciter Options
  • Sciter Value support
  • NativeFunctor (used in sciter scripting)

And the API are organized in more or less a gopher friendly way.

Things that are not supported:

  • Sciter Node API
  • TIScript Engine API

Getting Started

At the moment only Go 1.10 or higher is supported (issue #136).
  1. Download the sciter-sdk

  2. Extract the sciter runtime library from sciter-sdk to system PATH

    The runtime libraries lives in bin bin.lnx bin.osx with suffix like dll so or dylib

    • Windows: simply copying bin\64\sciter.dll to c:\windows\system32 is just enough
    • Linux:
      • cd sciter-sdk/bin.lnx/x64
      • export LIBRARY_PATH=$PWD
      • echo $PWD >> libsciter.conf
      • sudo cp libsciter.conf /etc/ld.so.conf.d/
      • sudo ldconfig
      • ldconfig -p | grep sciter should print libsciter-gtk.so location
    • OSX:
      • cd sciter-sdk/bin.osx/
      • export DYLD_LIBRARY_PATH=$PWD
  3. Set up GCC envrionmnet for CGO

    mingw64-gcc (5.2.0 and 7.2.0 are tested) is recommended for Windows users.

    Under Linux gcc(4.8 or above) and gtk+-3.0 are needed.

  4. go get -x github.com/iwctwbai/sciter-go

  5. Run the example and enjoy :)

Sciter Desktop UI Examples

Sciter Version Support

Currently supports Sciter version 4.0.0.0 and higher.

About Sciter

Sciter is an Embeddable HTML/CSS/script engine for modern UI development, Web designers, and developers, can reuse their experience and expertise in creating modern looking desktop applications.

In my opinion, Sciter , though not open sourced, is an great desktop UI development envrionment using the full stack of web technologies, which is rather small (under 5MB) especially compared to CEF,Node Webkit and Atom Electron. :)

Finally, according to Andrew Fedoniouk the author and the Sciter END USER LICENSE AGREEMENT , the binary form of the Sciter dynamic libraries are totally free to use for commercial or non-commercial applications.

The Tailored Sciter C Headers

This binding ueses a tailored version of the sciter C Headers, which lives in directory: include. The included c headers are a modified version of the sciter-sdk standard headers.

It seems Sciter is developed using C++, and the included headers in the Sciter SDK are a mixture of C and C++, which is not quite suitable for an easy golang binding.

I'm not much fond of C++ since I started to use Golang, so I made this modification and hope Andrew Fedoniouk the author would provide pure C header files for Sciter. :)

Documentation

Overview

This package provides a Golang bindings of Sciter using cgo. Using go sciter you must have the platform specified sciter dynamic library downloaded from sciter-sdk, the library itself is rather small (under 5MB, less than 2MB when upxed) .

Index

Constants

View Source
const (
	REQUEST_PANIC = iota - 1 // e.g. not enough memory
	REQUEST_OK
	REQUEST_BAD_PARAM    // bad parameter
	REQUEST_FAILURE      // operation failed, e.g. index out of bounds
	REQUEST_NOTSUPPORTED // the platform does not support requested feature
)

enum REQUEST_RESULT

View Source
const (
	RRT_GET = 1 + iota
	RRT_POST
	RRT_PUT
	RRT_DELETE

	RRT_FORCE_DWORD = 0xFFFFFFFF
)

enum REQUEST_RQ_TYPE

View Source
const (
	RS_PENDING = iota
	RS_SUCCESS // completed successfully
	RS_FAILURE // completed with failure

	RS_FORCE_DWORD = 0xFFFFFFFF
)

enum REQUEST_STATE

View Source
const (
	OT_DOM  = iota // html parser & runtime
	OT_CSSS        // csss! parser & runtime
	OT_CSS         // css parser
	OT_TIS         // TIS parser & runtime
)

enum OUTPUT_SUBSYTEMS

View Source
const (
	OS_INFO = iota
	OS_WARNING
	OS_ERROR
)

enum OUTPUT_SEVERITY

View Source
const (
	HANDLE_INITIALIZATION = 0x0000 /** attached/detached */
	HANDLE_MOUSE          = 0x0001 /** mouse events */
	HANDLE_KEY            = 0x0002 /** key events */
	HANDLE_FOCUS          = 0x0004 /** focus events if this flag is set it also means that element it attached to is focusable */
	HANDLE_SCROLL         = 0x0008 /** scroll events */
	HANDLE_TIMER          = 0x0010 /** timer event */
	HANDLE_SIZE           = 0x0020 /** size changed event */
	HANDLE_DRAW           = 0x0040 /** drawing request (event) */
	HANDLE_DATA_ARRIVED   = 0x080  /** requested data () has been delivered */
	HANDLE_BEHAVIOR_EVENT = 0x0100 /** logical synthetic events:
	BUTTON_CLICK HYPERLINK_CLICK etc.
	a.k.a. notifications from intrinsic behaviors */
	HANDLE_METHOD_CALL           = 0x0200 /** behavior specific methods */
	HANDLE_SCRIPTING_METHOD_CALL = 0x0400 /** behavior specific methods */
	HANDLE_TISCRIPT_METHOD_CALL  = 0x0800 /** behavior specific methods using direct tiscript::value's */

	HANDLE_EXCHANGE = 0x1000 /** system drag-n-drop */
	HANDLE_GESTURE  = 0x2000 /** touch input events */
	HANDLE_SOM      = 0x8000 /** som_asset_t request */

	HANDLE_ALL = 0xFFFF /* all of them */

	SUBSCRIPTIONS_REQUEST = 0xFFFFFFFF /** special value for getting subscription flags */
)

enum EVENT_GROUPS

View Source
const (
	BUBBLING        = 0       // bubbling (emersion) phase
	SINKING         = 0x8000  // capture (immersion) phase, this flag is or'ed with EVENTS codes below
	HANDLED         = 0x10000 // a bubbling event consumed by some element
	SINKING_HANDLED = 0x18000 // a sinking event consumed by some child element

)

enum PHASE_MASK

View Source
const (
	BEHAVIOR_DETACH = 0
	BEHAVIOR_ATTACH = 1
)

parameters of evtg == HANDLE_INITIALIZATION enum INITIALIZATION_EVENTS

View Source
const (
	NO_DRAGGING = iota
	DRAGGING_MOVE
	DRAGGING_COPY
)

enum DRAGGING_TYPE

View Source
const (
	CONTENT_ADDED   = 0x01
	CONTENT_REMOVED = 0x02
)

enum CONTENT_CHANGE_BITS { // for CONTENT_CHANGED reason

View Source
const (
	T_UNDEFINED = iota
	T_NULL
	T_BOOL
	T_INT
	T_FLOAT
	T_STRING
	T_DATE     // INT64 - contains a 64-bit value representing the number of 100-nanosecond intervals since January 1 1601 (UTC) a.k.a. FILETIME on Windows
	T_CURRENCY // INT64 - 14.4 fixed number. E.g. dollars = int64 / 10000;
	T_LENGTH   // length units value is int or float units are VALUE_UNIT_TYPE
	T_ARRAY
	T_MAP
	T_FUNCTION
	T_BYTES      // sequence of bytes - e.g. image data
	T_OBJECT     // scripting object proxy (TISCRIPT/SCITER)
	T_DOM_OBJECT // DOM object (CSSS!) use get_object_data to get HELEMENT
	T_RESOURCE   // 15 - other thing derived from tool::resource
	T_RANGE      // 16 - N..M, integer range.
	T_DURATION   // double, seconds
	T_ANGLE      // double, radians
	T_COLOR      // [unsigned] INT, ABGR
	T_ENUM
	T_ASSET // sciter::om::iasset* add_ref'ed pointer
)

enum VALUE_TYPE

View Source
const (
	UT_EM = 1 //height of the element's font.
	UT_EX = 2 //height of letter 'x'
	UT_PR = 3 //%
	UT_SP = 4 //%% "springs" a.k.a. flex units

	UT_PX  = 7  //pixels
	UT_IN  = 8  //inches (1 inch = 2.54 centimeters).
	UT_CM  = 9  //centimeters.
	UT_MM  = 10 //millimeters.
	UT_PT  = 11 //points (1 point = 1/72 inches).
	UT_PC  = 12 //picas (1 pica = 12 points).
	UT_DIP = 13

	UT_COLOR  = 15     // color in int
	UT_URL    = 16     // url in string
	UT_SYMBOL = 0xFFFF // for T_STRINGs designates symbol string ( so called NAME_TOKEN - CSS or JS identifier )
)

enum VALUE_UNIT_TYPE

View Source
const (
	DT_HAS_DATE    = 0x01 // date contains date portion
	DT_HAS_TIME    = 0x02 // date contains time portion HH:MM
	DT_HAS_SECONDS = 0x04 // date contains time and seconds HH:MM:SS
	DT_UTC         = 0x10 // T_DATE is known to be UTC. Otherwise it is local date/time
)

enum VALUE_UNIT_TYPE_DATE

View Source
const (
	UT_OBJECT_ARRAY    = 0 // type T_OBJECT of type Array
	UT_OBJECT_OBJECT   = 1 // type T_OBJECT of type Object
	UT_OBJECT_CLASS    = 2 // type T_OBJECT of type Type (class or namespace)
	UT_OBJECT_NATIVE   = 3 // type T_OBJECT of native Type with data slot (LPVOID)
	UT_OBJECT_FUNCTION = 4 // type T_OBJECT of type Function
	UT_OBJECT_ERROR    = 5 // type T_OBJECT of type Error
)

Sciter or TIScript specific enum VALUE_UNIT_TYPE_OBJECT

View Source
const (
	SOM_GET_PASSPORT = 0
	SOM_GET_ASSET    = 1
)
View Source
const (
	LOAD_OK      = 0 // do default loading if data not set
	LOAD_DISCARD = 1 // discard request completely
	LOAD_DELAYED = 2 // data will be delivered later by the host application.
)
View Source
const (
	/**Notifies that Sciter is about to download a referred resource.
	 *
	 * \param lParam #LPSCN_LOAD_DATA.
	 * \return #LOAD_OK or #LOAD_DISCARD
	 *
	 * This notification gives application a chance to override built-in loader and
	 * implement loading of resources in its own way (for example images can be loaded from
	 * database or other resource). To do this set #SCN_LOAD_DATA::outData and
	 * #SCN_LOAD_DATA::outDataSize members of SCN_LOAD_DATA. Sciter does not
	 * store pointer to this data. You can call #SciterDataReady() function instead
	 * of filling these fields. This allows you to free your outData buffer
	 * immediately.
	**/
	SC_LOAD_DATA = 0x01

	/**This notification indicates that external data (for example image) download process
	 * completed.
	 *
	 * \param lParam #LPSCN_DATA_LOADED
	 *
	 * This notifiaction is sent for each external resource used by document when
	 * this resource has been completely downloaded. Sciter will send this
	 * notification asynchronously.
	 **/
	SC_DATA_LOADED = 0x02

	/**This notification is sent on parsing the document and while processing
	 * elements having non empty style.behavior attribute value.
	 *
	 * \param lParam #LPSCN_ATTACH_BEHAVIOR
	 *
	 * Application has to provide implementation of #sciter::behavior interface.
	 * Set #SCN_ATTACH_BEHAVIOR::impl to address of this implementation.
	 **/
	SC_ATTACH_BEHAVIOR = 0x04

	/**This notification is sent when instance of the engine is destroyed.
	 * It is always final notification.
	 *
	 * \param lParam #LPSCN_ENGINE_DESTROYED
	 *
	 **/
	SC_ENGINE_DESTROYED = 0x05

	/**Posted notification.

	 * \param lParam #LPSCN_POSTED_NOTIFICATION
	 *
	 **/
	SC_POSTED_NOTIFICATION = 0x06

	/**This notification is sent when the engine encounters critical rendering error: e.g. DirectX gfx driver error.
	  Most probably bad gfx drivers.

	* \param lParam #LPSCN_GRAPHICS_CRITICAL_FAILURE
	*
	**/
	SC_GRAPHICS_CRITICAL_FAILURE = 0x07

	/**This notification is sent when the engine needs keyboard to be present on screen
	  E.g. when <input|text> gets focus

	* \param lParam #LPSCN_KEYBOARD_REQUEST
	*
	**/
	SC_KEYBOARD_REQUEST = 0x08

	/**This notification is sent when the engine needs some area to be redrawn

	 * \param lParam #LPSCN_INVLIDATE_RECT
	 *
	 **/
	SC_INVALIDATE_RECT = 0x09
)
View Source
const (
	ROOT_RELATIVE = 0x01 // - or this flag if you want to get HTMLayout window relative coordinates
	//   otherwise it will use nearest windowed container e.g. popup window.
	SELF_RELATIVE = 0x02 // - "or" this flag if you want to get coordinates relative to the origin
	//   of element iself.
	CONTAINER_RELATIVE = 0x03 // - position inside immediate container.
	VIEW_RELATIVE      = 0x04 // - position relative to view - HTMLayout window

	CONTENT_BOX = 0x00 // content (inner)  box
	PADDING_BOX = 0x10 // content + paddings
	BORDER_BOX  = 0x20 // content + paddings + border
	MARGIN_BOX  = 0x30 // content + paddings + border + margins

	BACK_IMAGE_AREA = 0x40 // relative to content origin - location of background image (if it set no-repeat)
	FORE_IMAGE_AREA = 0x50 // relative to content origin - location of foreground image (if it set no-repeat)

	SCROLLABLE_AREA = 0x60 // scroll_area - scrollable area in content box
)

enum ELEMENT_AREAS

View Source
const (
	ALLOW_FILE_IO   = 0x00000001
	ALLOW_SOCKET_IO = 0x00000002
	ALLOW_EVAL      = 0x00000004
	ALLOW_SYSINFO   = 0x00000008
)

enum SCRIPT_RUNTIME_FEATURES {

View Source
const (
	GFX_LAYER_GDI         = 1
	GFX_LAYER_CG          = 1
	GFX_LAYER_CAIRO       = 1
	GFX_LAYER_WARP        = 2
	GFX_LAYER_D2D         = 3
	GFX_LAYER_SKIA        = 4
	GFX_LAYER_SKIA_OPENGL = 5
	GFX_LAYER_AUTO        = 0xFFFF
)

enum GFX_LAYER {

View Source
const (
	SCITER_SMOOTH_SCROLL      Sciter_RT_OPTIONS = 1 // value:TRUE - enable, value:FALSE - disable, enabled by default
	SCITER_CONNECTION_TIMEOUT                   = 2 // value: milliseconds, connection timeout of http client
	SCITER_HTTPS_ERROR                          = 3 // value: 0 - drop connection, 1 - use builtin dialog, 2 - accept connection silently
	SCITER_FONT_SMOOTHING                       = 4 // value: 0 - system default, 1 - no smoothing, 2 - std smoothing, 3 - clear type

	SCITER_TRANSPARENT_WINDOW = 6 // Windows Aero support, value:
	// 0 - normal drawing,
	// 1 - window has transparent background after calls DwmExtendFrameIntoClientArea() or DwmEnableBlurBehindWindow().
	SCITER_SET_GPU_BLACKLIST = 7 // hWnd = NULL,
	// value = LPCBYTE, json - GPU black list, see: gpu-blacklist.json resource.
	SCITER_SET_SCRIPT_RUNTIME_FEATURES = 8  // value - combination of SCRIPT_RUNTIME_FEATURES flags.
	SCITER_SET_GFX_LAYER               = 9  // hWnd = NULL, value - GFX_LAYER
	SCITER_SET_DEBUG_MODE              = 10 // hWnd, value - TRUE/FALSE
	SCITER_SET_UX_THEMING              = 11 // hWnd = NULL, value - BOOL, TRUE - the engine will use "unisex" theme that is common for all platforms.

	SCITER_ALPHA_WINDOW = 12 //  hWnd, value - TRUE/FALSE - window uses per pixel alpha (e.g. WS_EX_LAYERED/UpdateLayeredWindow() window)

	SCITER_SET_INIT_SCRIPT = 13 // hWnd - N/A , value LPCSTR - UTF-8 encoded script source to be loaded into each view before any other script execution.

	SCITER_SET_MAIN_WINDOW = 14 //  hWnd, value - TRUE/FALSE - window is main, will destroy all other dependent windows on close

	SCITER_SET_MAX_HTTP_DATA_LENGTH = 15 // hWnd - N/A , value - max request length in megabytes (1024*1024 bytes)
)
View Source
const (
	UT_NOTHING = 1
)

enum VALUE_UNIT_UNDEFINED

Variables

View Source
var (
	BAD_HELEMENT = C.HELEMENT(unsafe.Pointer(uintptr(0)))
)
View Source
var (
	BAD_HREQUEST = C.HREQUEST(unsafe.Pointer(uintptr(0)))
)
View Source
var (
	BAD_HWINDOW C.HWINDOW = nil
)
View Source
var (
	DefaultRect = &Rect{0, 0, 300, 400}
)
View Source
var (
	// create an resizable main window with minimize/maximize controls
	// linux must use this combination to create the main window correctly
	DefaultWindowCreateFlag = SW_TITLEBAR | SW_RESIZEABLE | SW_CONTROLS | SW_MAIN | SW_ENABLE_DEBUG
)

Functions

func AppendMasterCSS

func AppendMasterCSS(data string) (ok bool)

Append Master style sheet.

\param[in] utf8 \b LPCBYTE, start of CSS buffer.
\param[in] numBytes \b UINT, number of bytes in utf8.

func ByteCPtrToBytes

func ByteCPtrToBytes(bp C.LPCBYTE, size C.UINT) []byte

func BytePtrToBytes

func BytePtrToBytes(bp *byte, size uint) []byte

func ClassName

func ClassName() string

func CreateWindow

func CreateWindow(createFlags WindowCreationFlag, rect *Rect, delegate uintptr, delegateParam uintptr, parent C.HWINDOW) C.HWINDOW

rect is the display area

func SetDLL

func SetDLL(dir string)

func SetMasterCSS

func SetMasterCSS(data string) (ok bool)

Set Master style sheet.

\param[in] utf8 \b LPCBYTE, start of CSS buffer.
\param[in] numBytes \b UINT, number of bytes in utf8.

func SetOption

func SetOption(option Sciter_RT_OPTIONS, value uint) (ok bool)

BOOL SciterSetOption (NULL, UINT option, UINT_PTR value )

func StringToBytePtr

func StringToBytePtr(s string) *byte

func StringToUTF16Ptr

func StringToUTF16Ptr(s string) *uint16

func StringToUTF16PtrWithLen

func StringToUTF16PtrWithLen(s string) (*uint16, int)

func StringToWcharPtr

func StringToWcharPtr(s string) *C.WCHAR

func Utf16FromString

func Utf16FromString(s string) ([]uint16, error)

returns a UTF-16 string, including the trailing zero

func Utf16ToString

func Utf16ToString(s *uint16) string

Returns the utf-8 encoding of the utf-16 sequence s, with a terminating NUL removed.

func Utf16ToStringLength

func Utf16ToStringLength(s *uint16, length int) string

func Version

func Version(major bool) uint

func VersionAsString

func VersionAsString() string

Types

type BehaviorEvent

type BehaviorEvent uint32
const (
	BUTTON_CLICK             BehaviorEvent = 0 // click on button
	BUTTON_PRESS             BehaviorEvent = 1 // mouse down or key down in button
	BUTTON_STATE_CHANGED     BehaviorEvent = 2 // checkbox/radio/slider changed its state/value
	EDIT_VALUE_CHANGING      BehaviorEvent = 3 // before text change
	EDIT_VALUE_CHANGED       BehaviorEvent = 4 // after text change
	SELECT_SELECTION_CHANGED BehaviorEvent = 5 // selection in <select> changed
	SELECT_STATE_CHANGED     BehaviorEvent = 6 // node in select expanded/collapsed heTarget is the node

	POPUP_REQUEST BehaviorEvent = 7 // request to show popup just received
	//     here DOM of popup element can be modifed.
	POPUP_READY BehaviorEvent = 8 // popup element has been measured and ready to be shown on screen
	//     here you can use functions like ScrollToView.
	POPUP_DISMISSED BehaviorEvent = 9 // popup element is closed

	MENU_ITEM_ACTIVE BehaviorEvent = 0xA // menu item activated by mouse hover or by keyboard
	MENU_ITEM_CLICK  BehaviorEvent = 0xB // menu item click

	CONTEXT_MENU_REQUEST BehaviorEvent = 0x10 // "right-click" BEHAVIOR_EVENT_PARAMS::he is current popup menu HELEMENT being processed or NULL.

	VISIUAL_STATUS_CHANGED  BehaviorEvent = 0x11 // broadcast notification sent to all elements of some container being shown or hidden
	DISABLED_STATUS_CHANGED BehaviorEvent = 0x12 // broadcast notification sent to all elements of some container that got new value of :disabled state

	POPUP_DISMISSING BehaviorEvent = 0x13 // popup is about to be closed

	CONTENT_CHANGED BehaviorEvent = 0x15 // content has been changed is posted to the element that gets content changed  reason is combination of CONTENT_CHANGE_BITS.

	// "grey" event codes  - notfications from behaviors from this SDK
	HYPERLINK_CLICK BehaviorEvent = 0x80 // hyperlink click

)

enum BEHAVIOR_EVENTS

const (
	ELEMENT_COLLAPSED BehaviorEvent = iota + 0x90 // element was collapsed so far only behavior:tabs is sending these two to the panels
	ELEMENT_EXPANDED                              // element was expanded

	ACTIVATE_CHILD // activate (select) child

	INIT_DATA_VIEW // request to virtual grid to initialize its view

	ROWS_DATA_REQUEST // request from virtual grid to data source behavior to fill data in the table

	UI_STATE_CHANGED // ui state changed observers shall update their visual states.

	FORM_SUBMIT // behavior:form detected submission event. BEHAVIOR_EVENT_PARAMS::data field contains data to be posted.
	// BEHAVIOR_EVENT_PARAMS::data is of type T_MAP in this case key/value pairs of data that is about
	// to be submitted. You can modify the data or discard submission by returning true from the handler.
	FORM_RESET // behavior:form detected reset event (from button type=reset). BEHAVIOR_EVENT_PARAMS::data field contains data to be reset.

	DOCUMENT_COMPLETE // document in behavior:frame or root document is complete.

	HISTORY_PUSH // requests to behavior:history (commands)
	HISTORY_DROP
	HISTORY_PRIOR
	HISTORY_NEXT
	HISTORY_STATE_CHANGED // behavior:history notification - history stack has changed

	CLOSE_POPUP     // close popup request
	REQUEST_TOOLTIP // request tooltip evt.source <- is the tooltip element.

	ANIMATION BehaviorEvent = 0xA0 // animation started (reason=1) or ended(reason=0) on the element.

	DOCUMENT_CREATED       BehaviorEvent = 0xC0 // document created script namespace initialized. target -> the document
	DOCUMENT_CLOSE_REQUEST BehaviorEvent = 0xC1 // document is about to be closed to cancel closing do: evt.data = sciter::value("cancel");
	DOCUMENT_CLOSE         BehaviorEvent = 0xC2 // last notification before document removal from the DOM
	DOCUMENT_READY         BehaviorEvent = 0xC3 // document has got DOM structure styles and behaviors of DOM elements. Script loading run is complete at this moment.

	VIDEO_INITIALIZED BehaviorEvent = 0xD1 // <video> "ready" notification
	VIDEO_STARTED     BehaviorEvent = 0xD2 // <video> playback started notification
	VIDEO_STOPPED     BehaviorEvent = 0xD3 // <video> playback stoped/paused notification
	VIDEO_BIND_RQ     BehaviorEvent = 0xD4 // <video> request for frame source binding

	FIRST_APPLICATION_EVENT_CODE = 0x100
)

func (BehaviorEvent) String

func (i BehaviorEvent) String() string

type BehaviorEventParams

type BehaviorEventParams C.BEHAVIOR_EVENT_PARAMS

typedef struct BEHAVIOR_EVENT_PARAMS

{
  UINT     cmd;        // BEHAVIOR_EVENTS
  HELEMENT heTarget;   // target element handler, in MENU_ITEM_CLICK this is owner element that caused this menu - e.g. context menu owner
                       // In scripting this field named as Event.owner
  HELEMENT he;         // source element e.g. in SELECTION_CHANGED it is new selected <option>, in MENU_ITEM_CLICK it is menu item (LI) element
  UINT_PTR reason;     // EVENT_REASON or EDIT_CHANGED_REASON - UI action causing change.
                       // In case of custom event notifications this may be any
                       // application specific value.
  SCITER_VALUE
           data;       // auxiliary data accompanied with the event. E.g. FORM_SUBMIT event is using this field to pass collection of values.
} BEHAVIOR_EVENT_PARAMS;

func (*BehaviorEventParams) Cmd

func (*BehaviorEventParams) Phase

func (b *BehaviorEventParams) Phase() PhaseMask

type BehaviorMethodIdentifier

type BehaviorMethodIdentifier uint32
const (
	DO_CLICK BehaviorMethodIdentifier = iota
	GET_TEXT_VALUE
	SET_TEXT_VALUE

	TEXT_EDIT_GET_SELECTION

	TEXT_EDIT_SET_SELECTION

	// Replace selection content or insert text at current caret position.
	// Replaced text will be selected.
	TEXT_EDIT_REPLACE_SELECTION

	// Set value of type="vscrollbar"/"hscrollbar"
	SCROLL_BAR_GET_VALUE
	SCROLL_BAR_SET_VALUE

	TEXT_EDIT_GET_CARET_POSITION
	TEXT_EDIT_GET_SELECTION_TEXT // p - TEXT_SELECTION_PARAMS
	TEXT_EDIT_GET_SELECTION_HTML // p - TEXT_SELECTION_PARAMS
	TEXT_EDIT_CHAR_POS_AT_XY     // p - TEXT_EDIT_CHAR_POS_AT_XY_PARAMS

	IS_EMPTY  BehaviorMethodIdentifier = 0xFC // p - IS_EMPTY_PARAMS // set VALUE_PARAMS::is_empty (false/true) reflects :empty state of the element.
	GET_VALUE BehaviorMethodIdentifier = 0xFD // p - VALUE_PARAMS
	SET_VALUE BehaviorMethodIdentifier = 0xFE // p - VALUE_PARAMS

	FIRST_APPLICATION_METHOD_ID BehaviorMethodIdentifier = 0x100
)

enum BEHAVIOR_METHOD_IDENTIFIERS

func (BehaviorMethodIdentifier) String

func (i BehaviorMethodIdentifier) String() string

type CallbackHandler

type CallbackHandler struct {
	Behaviors map[string]*EventHandler
	// Notifies that Sciter is about to download a referred resource.
	OnLoadData func(params *ScnLoadData) int
	// This notification indicates that external data (for example image) download process
	OnDataLoaded func(params *ScnDataLoaded) int
	/**This notification is sent on parsing the document and while processing
	 * elements having non empty style.behavior attribute value.
	 *
	 * \param lParam #LPSCN_ATTACH_BEHAVIOR
	 *
	 * Application has to provide implementation of #sciter::behavior interface.
	 * Set #SCN_ATTACH_BEHAVIOR::impl to address of this implementation.
	 **/
	OnAttachBehavior func(params *ScnAttachBehavior) int
	/**This notification is sent when instance of the engine is destroyed.
	 * It is always final notification.
	 *
	 * \param lParam #LPSCN_ENGINE_DESTROYED
	 *
	 **/
	OnEngineDestroyed func() int
	/**Posted notification.

	 * \param lParam #LPSCN_POSTED_NOTIFICATION
	 *
	 **/
	OnPostedNotification func(params *ScnPostedNotification) int

	/**This notification is sent when the engine encounters critical rendering error: e.g. DirectX gfx driver error.
	  Most probably bad gfx drivers.

	* \param lParam #LPSCN_GRAPHICS_CRITICAL_FAILURE
	*
	**/
	OnGraphicsCriticalFailure func() int

	/**This notification is sent when the engine needs keyboard to be present on screen
	  E.g. when <input|text> gets focus

	* \param lParam #LPSCN_KEYBOARD_REQUEST
	*
	**/
	OnKeyboardRequest func(params *ScnKeyboardRequest) int

	/**This notification is sent when the engine needs some area to be redrawn

	 * \param lParam #LPSCN_INVLIDATE_RECT
	 *
	 **/
	OnInvalidateRect func(params *ScnInvalidateRect) int
}

type CursorType

type CursorType uint32
const (
	CURSOR_ARROW       CursorType = iota //0
	CURSOR_IBEAM                         //1
	CURSOR_WAIT                          //2
	CURSOR_CROSS                         //3
	CURSOR_UPARROW                       //4
	CURSOR_SIZENWSE                      //5
	CURSOR_SIZENESW                      //6
	CURSOR_SIZEWE                        //7
	CURSOR_SIZENS                        //8
	CURSOR_SIZEALL                       //9
	CURSOR_NO                            //10
	CURSOR_APPSTARTING                   //11
	CURSOR_HELP                          //12
	CURSOR_HAND                          //13
	CURSOR_DRAG_MOVE                     //14
	CURSOR_DRAG_COPY                     //15
)

enum CURSOR_TYPE

func (CursorType) String

func (i CursorType) String() string

type DDMode

type DDMode uint32
enum DD_MODES {
	DD_MODE_NONE = 0, // DROPEFFECT_NONE	( 0 )
	DD_MODE_COPY = 1, // DROPEFFECT_COPY	( 1 )
	DD_MODE_MOVE = 2, // DROPEFFECT_MOVE	( 2 )
	DD_MODE_COPY_OR_MOVE = 3, // DROPEFFECT_COPY	( 1 ) | DROPEFFECT_MOVE	( 2 )
	DD_MODE_LINK = 4, // DROPEFFECT_LINK	( 4 )
};
const (
	DD_MODE_NONE DDMode = 0
	DD_MODE_COPY
	DD_MODE_MOVE
	DD_MODE_COPY_OR_MOVE
	DD_MODE_LINK
)

type DataArrivedParams

type DataArrivedParams C.DATA_ARRIVED_PARAMS

typedef struct DATA_ARRIVED_PARAMS

{
    HELEMENT  initiator;    // element intiator of HTMLayoutRequestElementData request,
    LPCBYTE   data;         // data buffer
    UINT      dataSize;     // size of data
    UINT      dataType;     // data type passed "as is" from HTMLayoutRequestElementData
    UINT      status;       // status = 0 (dataSize == 0) - unknown error.
                            // status = 100..505 - http response status, Note: 200 - OK!
                            // status > 12000 - wininet error code, see ERROR_INTERNET_*** in wininet.h
    LPCWSTR   uri;          // requested url
} DATA_ARRIVED_PARAMS;

func (*DataArrivedParams) Data

func (d *DataArrivedParams) Data() []byte

func (*DataArrivedParams) Uri

func (d *DataArrivedParams) Uri() string

type DraggingType

type DraggingType uint32

type DrawEvent

type DrawEvent uint32
const (
	DRAW_CONTENT    DrawEvent = 1
	DRAW_FOREGROUND DrawEvent = 2
)

enum DRAW_EVENTS

func (DrawEvent) String

func (i DrawEvent) String() string

type DrawParams

type DrawParams struct {
	Cmd  DrawEvent // DrawEvents
	Hdc  uintptr
	Area Rect
	// contains filtered or unexported fields
}

type EditChangedReason

type EditChangedReason uint
const (
	BY_INS_CHAR  EditChangedReason = iota // single char insertion
	BY_INS_CHARS                          // character range insertion clipboard
	BY_DEL_CHAR                           // single char deletion
	BY_DEL_CHARS                          // character range deletion (selection)
	BY_UNDO_REDO                          // undo/redo
)

enum EDIT_CHANGED_REASON

func (EditChangedReason) String

func (i EditChangedReason) String() string

type Element

type Element struct {
	// contains filtered or unexported fields
}

Represents a single DOM element, owns and manages a Handle

func CreateElement

func CreateElement(tagname, textOrNull string) (*Element, error)

Create new element, the element is disconnected initially from the DOM.

   Element created with ref_count = 1 thus you \b must call Sciter_UnuseElement on returned handler.
\param[in] tagname \b LPCSTR, html tag of the element e.g. "div", "option", etc.
\param[in] textOrNull \b LPCWSTR, initial text of the element or NULL. text here is a plain text - method does no parsing.
\param[out ] phe \b #HELEMENT*, variable to receive handle of the element

func WrapElement

func WrapElement(he C.HELEMENT) *Element

Wrap C.HELEMENT to a go side *Element, doing Sciter_UseElement/Sciter_UnuseElement automatically

func (*Element) Append

func (e *Element) Append(el *Element) error

Append element e as last child of this element.

func (*Element) AttachEventHandler

func (e *Element) AttachEventHandler(handler *EventHandler) error

SCDOM_RESULT SciterAttachEventHandler( HELEMENT he, LPELEMENT_EVENT_PROC pep, LPVOID tag ) ;//{ return SAPI()->SciterAttachEventHandler( he,pep,tag ); }

Any Element that calls this function would not be gc collected any more thus prevent the handler missing in sciter callbacks

func (*Element) Attr

func (e *Element) Attr(name string) (string, error)

Get value of any element's attribute by name.

\param[in] he \b #HELEMENT
\param[in] name \b LPCSTR, attribute name
\param[out] p_value \b LPCWSTR*, will be set to address of the string
containing attribute value
\return \b #SCDOM_RESULT SCAPI

func (*Element) AttrCount

func (e *Element) AttrCount() (int, error)

Get number of element's attributes.

\param[in] he \b #HELEMENT
\param[out] p_count \b LPUINT, variable to receive number of element
attributes.
\return \b #SCDOM_RESULT SCAPI

func (*Element) CallFunction

func (e *Element) CallFunction(functionName string, args ...*Value) (retval *Value, err error)

call scripting function defined on global level Example, script:

function foo() {...}

Native code:

dom::element root = ... get root element of main document or some frame inside it
root.call_function("foo"); // call the function

func (*Element) CallMethod

func (e *Element) CallMethod(methodName string, args ...*Value) (retval *Value, err error)

call scripting method attached to the element (directly or through of scripting behavior) Example, script:

var elem = ...
elem.foo = function() {...}

Native code:

dom::element elem = ...
elem.call_method("foo");

func (*Element) Capture

func (e *Element) Capture() error

Set the mouse capture to the specified element.

\param[in] he \b #HELEMENT
\return \b #SCDOM_RESULT SCAPI

After call to this function all mouse events will be targeted to the element.
To remove mouse capture call ReleaseCapture() function.

func (*Element) ChildrenCount

func (e *Element) ChildrenCount() (int, error)

Get number of child elements.

\param[in] he \b #HELEMENT, element which child elements you need to count
\param[out] count \b UINT*, variable to receive number of child elements
\return \b #SCDOM_RESULT SCAPI

\par Example:
for paragraph defined as
\verbatim <p>Hello <b>wonderfull</b> world!</p> \endverbatim
count will be set to 1 as the paragraph has only one sub element:
\verbatim <b>wonderfull</b> \endverbatim

func (*Element) Clear

func (e *Element) Clear() error

Clear contents and all children of the element.

func (*Element) ClearAttr

func (e *Element) ClearAttr() error

Remove all attributes from the element.

\param[in] he \b #HELEMENT
\return \b #SCDOM_RESULT SCAPI

func (*Element) Clone

func (e *Element) Clone() (*Element, error)

Create new element as copy of existing element, new element is a full (deep) copy of the element and

   is disconnected initially from the DOM.
   Element created with ref_count = 1 thus you \b must call Sciter_UnuseElement on returned handler.
\param[in] he \b #HELEMENT, source element.
\param[out ] phe \b #HELEMENT*, variable to receive handle of the new element.

func (*Element) CombineURL

func (e *Element) CombineURL(url string) (combinedUrl string, err error)

Combine given URL with URL of the document element belongs to.

\param[in] he \b #HELEMENT
\param[in, out] szUrlBuffer \b LPWSTR, at input this buffer contains
zero-terminated URL to be combined, after function call it contains
zero-terminated combined URL
\param[in] UrlBufferSize \b UINT, size of the buffer pointed by
\c szUrlBuffer
\return \b #SCDOM_RESULT SCAPI

This function is used for resolving relative references.

func (*Element) DefineMethod

func (e *Element) DefineMethod(name string, nf func(args ...*Value) *Value)

DefineMethod defines Element locally scripting function in tiscript

The local method must be access as the element attribute.

func (*Element) Delete

func (e *Element) Delete() error

Take element out of its container (and DOM tree).

Element will be destroyed when its reference counter will become zero

func (*Element) Detach

func (e *Element) Detach() error

Take element out of its container (and DOM tree).

Element will be destroyed when its reference counter will become zero

func (*Element) DetachEventHandler

func (e *Element) DetachEventHandler(handler *EventHandler) error

SCDOM_RESULT SciterDetachEventHandler( HELEMENT he, LPELEMENT_EVENT_PROC pep, LPVOID tag )

func (*Element) GetHwnd

func (e *Element) GetHwnd(rootWindow bool) (hwnd C.HWINDOW, err error)

Get HWINDOW of containing window.

func (*Element) GetValue

func (e *Element) GetValue() (*Value, error)

SciterGetValue - get value of the element. 'value' is value of correspondent behavior attached to the element or its text.

\param[in] he \b HELEMENT, element which value will be retrieved.
\param[out] pval \b VALUE*, pointer to VALUE that will get elements value.
 ATTN: if you are not using json::value wrapper then you shall call ValueClear aginst the returned value
       otherwise memory will leak.

func (*Element) HidePopup

func (e *Element) HidePopup() error

SCDOM_RESULT SciterHidePopup(HELEMENT he)

func (*Element) Html

func (e *Element) Html(outer bool) (string, error)

Get html representation of the element.

\param[in] he \b #HELEMENT
\param[in] outer \b BOOL, if TRUE will retunr outer HTML otherwise inner.
\param[in] rcv \b pointer to function receiving UTF8 encoded HTML.
\param[in] rcv_param \b parameter that passed to rcv as it is.
\return \b #SCDOM_RESULT SCAPI

func (*Element) HttpRequest

func (e *Element) HttpRequest(url string, dataType SciterResourceType, requestType RequestType, params ...RequestParam) error

SciterSendRequest - send GET or POST request for the element

event handler on the 'he' element (if any) will be notified
when data will be ready by receiving HANDLE_DATA_DELIVERY event.

func (*Element) Index

func (e *Element) Index() (idx int, err error)

Get element index.

\param[in] he \b #HELEMENT
\param[out] p_index \b LPUINT, variable to receive number of the element
among parent element's subelements.
\return \b #SCDOM_RESULT SCAPI

func (*Element) Insert

func (e *Element) Insert(el *Element, index int) error

SCDOM_RESULT SciterInsertElement( HELEMENT he, HELEMENT hparent, UINT index )

Insert element at the index position of parent.

It is not an error to insert element which already has parent - it will be disconnected first, but
you need to update elements parent in this case.

func (*Element) IsEnabled

func (e *Element) IsEnabled() bool

SciterIsElementEnabled - deep enable state, determines if element enabled - is not disabled by itself or no one

of its parents is disabled.

\param[in] he \b HELEMENT, element. \param[out] pEnabled \b LPBOOL, enabled state.

func (*Element) IsVisible

func (e *Element) IsVisible() bool

SciterIsElementVisible - deep visibility, determines if element visible - has no visiblity:hidden and no display:none defined

   for itself or for any its parents.
\param[in] he \b HELEMENT, element.
\param[out] pVisible \b LPBOOL, visibility state.

func (*Element) Load

func (e *Element) Load(url string, dataType SciterResourceType) error

SciterRequestElementData - request data download for the element. as jQuery.load :)

\param[in] he \b HELEMENT, element to deleiver data to.
\param[in] url \b LPCWSTR, url to download data from.
\param[in] dataType \b UINT, data type, see SciterResourceType.
\param[in] hInitiator \b HELEMENT, element - initiator, can be NULL.

event handler on the he element (if any) will be notified
when data will be ready by receiving HANDLE_DATA_DELIVERY event.

func (*Element) MustSelectById

func (e *Element) MustSelectById(id string) *Element

func (*Element) MustSelectUnique

func (e *Element) MustSelectUnique(selector string) *Element

Returns the only child element that matches the selector. If no elements match or more than one element matches, the function panics.

func (*Element) NthAttr

func (e *Element) NthAttr(n int) (value string, err error)

Get value of any element's attribute by attribute's number.

\param[in] he \b #HELEMENT
\param[in] n \b UINT, number of desired attribute
\param[out] p_name \b LPCSTR*, will be set to address of the string
containing attribute name
\param[out] p_value \b LPCWSTR*, will be set to address of the string
containing attribute value
\return \b #SCDOM_RESULT SCAPI

func (*Element) NthAttrName

func (e *Element) NthAttrName(n int) (name string, err error)

func (*Element) NthChild

func (e *Element) NthChild(n int) (*Element, error)

Get handle of every element's child element.

\param[in] he \b #HELEMENT
\param[in] n \b UINT, number of the child element
\param[out] phe \b #HELEMENT*, variable to receive handle of the child
element
\return \b #SCDOM_RESULT SCAPI

\par Example:
for paragraph defined as
\verbatim <p>Hello <b>wonderfull</b> world!</p> \endverbatim
*phe will be equal to handle of &lt;b&gt; element:
\verbatim <b>wonderfull</b> \endverbatim

func (*Element) OnClick

func (e *Element) OnClick(fn func())

func (*Element) ParentElement

func (e *Element) ParentElement() (*Element, error)

Get parent element.

func (*Element) ReleaseCapture

func (e *Element) ReleaseCapture() error

SCDOM_RESULT SciterReleaseCapture(HELEMENT he)

func (*Element) ScrollToView

func (e *Element) ScrollToView(flag SCITER_SCROLL_FLAGS) error

Scroll to view.

func (*Element) Select

func (e *Element) Select(css_selectors string) ([]*Element, error)

SCDOM_RESULT SciterSelectElementsW(HELEMENT he, LPCWSTR CSS_selectors, SciterElementCallback* callback, LPVOID param)

func (*Element) SelectById

func (e *Element) SelectById(id string) (*Element, error)

A wrapper of SelectUnique that auto-prepends a hash to the provided id. Useful when selecting elements base on a programmatically retrieved id (which does not already have the hash on it)

func (*Element) SelectFirst

func (e *Element) SelectFirst(css_selectors string) (*Element, error)

Returns the only child element that matches the selector.

func (*Element) SelectParent

func (e *Element) SelectParent(css_selector string, depth int) (*Element, error)

SCDOM_RESULT SciterSelectParentW(HELEMENT he, LPCWSTR selector, UINT depth, HELEMENT* heFound)

func (*Element) SelectUnique

func (e *Element) SelectUnique(selector string) (*Element, error)

Returns the only child element that matches the selector. If no elements match or more than one element matches, the function returns error.

func (*Element) SetAttr

func (e *Element) SetAttr(name, val string) error

Set attribute's value.

\param[in] he \b #HELEMENT
\param[in] name \b LPCSTR, attribute name
\param[in] value \b LPCWSTR, new attribute value or 0 if you want to remove attribute.
\return \b #SCDOM_RESULT SCAPI

func (*Element) SetHtml

func (e *Element) SetHtml(html string, where SET_ELEMENT_HTML) error

SCDOM_RESULT SciterSetElementHtml(HELEMENT he, const BYTE* html, UINT htmlLength, UINT where)

func (*Element) SetState

func (e *Element) SetState(bitsToSet, bitsToClear ElementState, updateView bool) error

SCDOM_RESULT SciterSetElementState( HELEMENT he, UINT stateBitsToSet, UINT stateBitsToClear, BOOL updateView)

func (*Element) SetStyle

func (e *Element) SetStyle(name, val string) error

func (*Element) SetText

func (e *Element) SetText(text string) error

Set inner text of the element from LPCWSTR buffer (utf16 words).

\param[in] he \b #HELEMENT
\param[in] utf16words \b pointer, UTF16 encoded plain text
\param[in] length \b UINT, number of words in utf16words sequence
\return \b #SCDOM_RESULT SCAPI

func (*Element) SetTimer

func (e *Element) SetTimer(milliseconds int) error

Start Timer for the element.

Element will receive on_timer event
To stop timer call SciterSetTimer( he, 0 );

func (*Element) SetValue

func (e *Element) SetValue(v *Value) error

SciterSetValue - set value of the element.

\param[in] he \b HELEMENT, element which value will be changed.
\param[in] pval \b VALUE*, pointer to the VALUE to set.

func (*Element) ShowPopup

func (e *Element) ShowPopup(eAnchor *Element, placement PopupPlacement) error

Shows block element (DIV) in popup window. \param[in] hePopup \b HELEMENT, element to show as popup \param[in] heAnchor \b HELEMENT, anchor element - hePopup will be shown near this element \param[in] placement \b UINT, values:

2 - popup element below of anchor
8 - popup element above of anchor
4 - popup element on left side of anchor
6 - popup element on right side of anchor
( see numpad on keyboard to get an idea of the numbers)

\return \b #SCDOM_RESULT SCAPI

func (*Element) ShowPopupAt

func (e *Element) ShowPopupAt(pos Point, placement uint) error

Shows block element (DIV) in popup window at given position.

\param[in] hePopup \b HELEMENT, element to show as popup
\param[in] pos \b POINT, popup element position, relative to origin of Sciter window.
\param[in] placement \b UINT, values:
    2 - popup element below of anchor
    8 - popup element above of anchor
    4 - popup element on left side of anchor
    6 - popup element on right side of anchor
    ( see numpad on keyboard to get an idea of the numbers)

func (*Element) Sort

func (e *Element) Sort(start, count int, comparator func(*Element, *Element) int) error

* SciterSortElements - sort children of the element.

  • \param[in] he \b HELEMENT, element which children to be sorted.
  • \param[in] firstIndex \b UINT, first child index to start sorting from.
  • \param[in] lastIndex \b UINT, last index of the sorting range, element with this index will not be included in the sorting.
  • \param[in] cmpFunc \b ELEMENT_COMPARATOR, comparator function.
  • \param[in] cmpFuncParam \b LPVOID, parameter to be passed in comparator function. *

func (*Element) SortChildren

func (e *Element) SortChildren(comparator func(*Element, *Element) int) error

func (*Element) State

func (e *Element) State() (ElementState, error)

Get/set state bits, stateBits*** accept or'ed values above

func (*Element) Style

func (e *Element) Style(name string) (string, error)

Get element's style attribute.

\param[in] he \b #HELEMENT
\param[in] name \b LPCSTR, name of the style attribute
\param[in] rcv \b pointer to the function receiving UTF16 encoded plain text
\param[in] rcv_param \b param passed that passed to LPCWSTR_RECEIVER "as is"

Style attributes are those that are set using css. E.g. "font-face: arial" or "display: block".

\sa #SciterSetStyleAttribute()

func (*Element) Swap

func (e *Element) Swap(t *Element) error

SciterSwapElements - swap element positions.

Function changes "insertion points" of two elements. So it swops indexes and parents of two elements.
\param[in] he1 \b HELEMENT, first element.
\param[in] he2 \b HELEMENT, second element.

func (*Element) Text

func (e *Element) Text() (string, error)

Get inner text of the element as LPCWSTR (utf16 words).

\param[in] he \b #HELEMENT
\param[in] rcv \b pointer to the function receiving UTF16 encoded plain text
\param[in] rcv_param \b param passed that passed to LPCWSTR_RECEIVER "as is"
\return \b #SCDOM_RESULT SCAPI

func (*Element) Type

func (e *Element) Type() (string, error)

Get element's type.

func (*Element) UID

func (e *Element) UID() (uint, error)

SCDOM_RESULT SciterGetElementUID(HELEMENT he, UINT* puid)

func (*Element) Update

func (e *Element) Update(forceRender bool) error

Apply changes and refresh element area in its window.

\param[in] he \b #HELEMENT
\param[in] andForceRender \b BOOL, TRUE to force UpdateWindow() call.
\return \b #SCDOM_RESULT SCAPI

type ElementState

type ElementState uint32
const (
	STATE_LINK       ElementState = 0x00000001
	STATE_HOVER      ElementState = 0x00000002
	STATE_ACTIVE     ElementState = 0x00000004
	STATE_FOCUS      ElementState = 0x00000008
	STATE_VISITED    ElementState = 0x00000010
	STATE_CURRENT    ElementState = 0x00000020 // current (hot) item
	STATE_CHECKED    ElementState = 0x00000040 // element is checked (or selected)
	STATE_DISABLED   ElementState = 0x00000080 // element is disabled
	STATE_READONLY   ElementState = 0x00000100 // readonly input element
	STATE_EXPANDED   ElementState = 0x00000200 // expanded state - nodes in tree view
	STATE_COLLAPSED  ElementState = 0x00000400 // collapsed state - nodes in tree view - mutually exclusive with
	STATE_INCOMPLETE ElementState = 0x00000800 // one of fore/back images requested but not delivered
	STATE_ANIMATING  ElementState = 0x00001000 // is animating currently
	STATE_FOCUSABLE  ElementState = 0x00002000 // will accept focus
	STATE_ANCHOR     ElementState = 0x00004000 // anchor in selection (used with current in selects)
	STATE_SYNTHETIC  ElementState = 0x00008000 // this is a synthetic element - don't emit it's head/tail
	STATE_OWNS_POPUP ElementState = 0x00010000 // this is a synthetic element - don't emit it's head/tail
	STATE_TABFOCUS   ElementState = 0x00020000 // focus gained by tab traversal
	STATE_EMPTY      ElementState = 0x00040000 // empty - element is empty (text.size() == 0 && subs.size() == 0)
	//  if element has behavior attached then the behavior is responsible for the value of this flag.
	STATE_BUSY ElementState = 0x00080000 // busy; loading

	STATE_DRAG_OVER   ElementState = 0x00100000 // drag over the block that can accept it (so is current drop target). Flag is set for the drop target block
	STATE_DROP_TARGET ElementState = 0x00200000 // active drop target.
	STATE_MOVING      ElementState = 0x00400000 // dragging/moving - the flag is set for the moving block.
	STATE_COPYING     ElementState = 0x00800000 // dragging/copying - the flag is set for the copying block.
	STATE_DRAG_SOURCE ElementState = 0x01000000 // element that is a drag source.
	STATE_DROP_MARKER ElementState = 0x02000000 // element is drop marker

	STATE_PRESSED ElementState = 0x04000000 // pressed - close to active but has wider life span - e.g. in MOUSE_UP it
	//   is still on; so behavior can check it in MOUSE_UP to discover CLICK condition.
	STATE_POPUP ElementState = 0x08000000 // this element is out of flow - popup

	STATE_IS_LTR ElementState = 0x10000000 // the element or one of its containers has dir=ltr declared
	STATE_IS_RTL ElementState = 0x20000000 // the element or one of its containers has dir=rtl declared
)

enum ELEMENT_STATE_BITS

type EventHandler

type EventHandler struct {
	OnAttached func(he *Element)
	OnDetached func(he *Element)
	OnMouse    func(he *Element, params *MouseParams) bool
	OnKey      func(he *Element, params *KeyParams) bool
	OnFocus    func(he *Element, params *FocusParams) bool
	OnDraw     func(he *Element, params *DrawParams) bool
	OnTimer    func(he *Element, params *TimerParams) bool
	// notification events from builtin behaviors - synthesized events: BUTTON_CLICK, VALUE_CHANGED
	// see enum BEHAVIOR_EVENTS
	OnBehaviorEvent func(he *Element, params *BehaviorEventParams) bool
	OnMethodCall    func(he *Element, params *MethodParams) bool

	// If needed your application may expose some [native] functions to be called by script code.
	// Usually this is made by implementing your own event_handler and overriding
	// its on_script_call(helement, name, argc, argv, retval) method.
	// If you will do this then you can invoke this callback from script as:
	//     "global" native functions: var r = view.funcName( p0, p1, ... );
	//              - calling  on_script_call of event_handler instance attached to the window.
	//     As element's methods: var r = el.funcName( p0, p1, ... );
	//              - calling  on_script_call of event_handler instance (native behavior) attached to the element.
	// This way you can establish interaction between scipt and native code inside your application.
	OnScriptingMethodCall func(he *Element, params *ScriptingMethodParams) bool
	// Calls from TIScript. Override this if you want your own methods accessible directly from tiscript engine.
	// Use tiscript::args to access parameters.
	OnTiscriptMethodCall func(he *Element, params *TiscriptMethodParams) bool
	// call when resource is loaded but not used
	// return true would cancel the resource usage
	// return false would follow the normal procedure
	OnDataArrived func(he *Element, params *DataArrivedParams) bool
	OnSize        func(he *Element)
	OnScroll      func(he *Element, params *ScrollParams) bool
	OnExchange    func(he *Element, params *ExchangeParams) bool
	OnGesture     func(he *Element, params *GestureParams) bool
	OnSom         func(he *Element, params *SomParams) bool
}

type EventReason

type EventReason uint
const (
	BY_MOUSE_CLICK EventReason = iota
	BY_KEY_CLICK
	SYNTHESIZED // synthesized programmatically generated.
	BY_MOUSE_ON_ICON
)

enum EVENT_REASON

func (EventReason) String

func (i EventReason) String() string

type ExchangeCmd

type ExchangeCmd uint32
enum EXCHANGE_CMD {
	X_DRAG_ENTER = 0,       // drag enters the element
	X_DRAG_LEAVE = 1,       // drag leaves the element
	X_DRAG = 2,             // drag over the element
	X_DROP = 3,             // data dropped on the element
	X_PASTE = 4,            // N/A
	X_DRAG_REQUEST = 5,     // N/A
	X_DRAG_CANCEL = 6,      // drag cancelled (e.g. by pressing VK_ESCAPE)
	X_WILL_ACCEPT_DROP = 7, // drop target element shall consume this event in order to receive X_DROP
};
const (
	X_DRAG_ENTER ExchangeCmd = iota
	X_DRAG_LEAVE
	X_DRAG
	X_DROP
	X_PASTE
	X_DRAG_REQUEST
	X_DRAG_CANCEL
	X_WILL_ACCEPT_DROP
)

type ExchangeParams

type ExchangeParams struct {
	Cmd     ExchangeCmd
	Target  C.HELEMENT
	Source  C.HELEMENT
	Pos     Point
	PosView Point
	Mode    DDMode
	Data    Value
}

struct EXCHANGE_PARAMS

{
  UINT         cmd;          // EXCHANGE_EVENTS
  HELEMENT     target;       // target element
  HELEMENT     source;       // source element (can be null if D&D from external window)
  POINT        pos;          // position of cursor, element relative
  POINT        pos_view;     // position of cursor, view relative
  UINT         mode;         // DD_MODE
  SCITER_VALUE data;         // packaged drag data
};

type FocusEvent

type FocusEvent uint32
const (
	FOCUS_LOST FocusEvent = iota
	FOCUS_GOT
)

enum FOCUS_EVENTS

func (FocusEvent) String

func (i FocusEvent) String() string

type FocusParams

type FocusParams struct {
	Cmd          FocusEvent // FocusEvents
	Target       C.HELEMENT
	ByMouseClick int32 // boolean // true if focus is being set by mouse click
	Cancel       int32 // boolean // in FOCUS_LOST phase setting this field to true will cancel transfer focus from old element to the new one.
}

type GestureCmd

type GestureCmd uint32
const (
	GESTURE_REQUEST GestureCmd = iota // return true and fill flags if it will handle gestures.
	GESTURE_ZOOM                      // The zoom gesture.
	GESTURE_PAN                       // The pan gesture.
	GESTURE_ROTATE                    // The rotation gesture.
	GESTURE_TAP1                      // The tap gesture.
	GESTURE_TAP2                      // The two-finger tap gesture.
)

enum GESTURE_CMD

func (GestureCmd) String

func (i GestureCmd) String() string

type GestureParams

type GestureParams struct {
	Cmd       GestureCmd
	Target    C.HELEMENT
	Pos       Point
	PosView   Point
	Flags     uint32
	DeltaTime uint32
	DeltaXY   Size
	DeltaV    float64
}

struct GESTURE_PARAMS { UINT cmd; // GESTURE_EVENTS HELEMENT target; // target element POINT pos; // position of cursor, element relative POINT pos_view; // position of cursor, view relative UINT flags; // for GESTURE_REQUEST combination of GESTURE_FLAGs.

// for others it is a combination of GESTURE_STATe's

UINT delta_time; // period of time from previous event. SIZE delta_xy; // for GESTURE_PAN it is a direction vector double delta_v; // for GESTURE_ROTATE - delta angle (radians)

                        // for GESTURE_ZOOM - zoom value, is less or greater than 1.0
};

type GestureState

type GestureState uint32
const (
	GESTURE_STATE_BEGIN   GestureState = 1 // starts
	GESTURE_STATE_INERTIA GestureState = 2 // events generated by inertia processor
	GESTURE_STATE_END     GestureState = 4 // end last event of the gesture sequence
)

enum GESTURE_STATE

func (GestureState) String

func (i GestureState) String() string

type GestureTypeFlag

type GestureTypeFlag uint32
const (
	GESTURE_FLAG_ZOOM                          GestureTypeFlag = 0x0001
	GESTURE_FLAG_ROTATE                        GestureTypeFlag = 0x0002
	GESTURE_FLAG_PAN_VERTICAL                  GestureTypeFlag = 0x0004
	GESTURE_FLAG_PAN_HORIZONTALGestureTypeFlag                 = 0x0008
	GESTURE_FLAG_TAP1                          GestureTypeFlag = 0x0010 // press & tap
	GESTURE_FLAG_TAP2                          GestureTypeFlag = 0x0020 // two fingers tap

	GESTURE_FLAG_PAN_WITH_GUTTER  GestureTypeFlag = 0x4000 // PAN_VERTICAL and PAN_HORIZONTAL modifiers
	GESTURE_FLAG_PAN_WITH_INERTIA GestureTypeFlag = 0x8000 //
	GESTURE_FLAGS_ALL             GestureTypeFlag = 0xFFFF //
)

enum GESTURE_TYPE_FLAGS // requested

func (GestureTypeFlag) String

func (i GestureTypeFlag) String() string

type HVM

type HVM PTiscriptVM

type InitializationParams

type InitializationParams struct {
	Cmd uint32
}

type KeyEvent

type KeyEvent uint32
const (
	KEY_DOWN KeyEvent = iota
	KEY_UP
	KEY_CHAR
)

enum KEY_EVENTS

func (KeyEvent) String

func (i KeyEvent) String() string

type KeyParams

type KeyParams struct {
	Cmd      KeyEvent // KeyEvents
	Target   C.HELEMENT
	KeyCode  uint32
	AltState KeyboardState
}

type KeyValueCallback

type KeyValueCallback func(key, value *Value) bool

type KeyboardState

type KeyboardState uint32
const (
	CONTROL_KEY_PRESSED KeyboardState = 0x1
	SHIFT_KEY_PRESSED   KeyboardState = 0x2
	ALT_KEY_PRESSED     KeyboardState = 0x4
)

enum KEYBOARD_STATES

type MethodParams

type MethodParams struct {
	MethodId BehaviorMethodIdentifier
}

type MouseButton

type MouseButton uint32
const (
	MAIN_MOUSE_BUTTON   MouseButton = 1 //aka left button
	PROP_MOUSE_BUTTON   MouseButton = 2 //aka right button
	MIDDLE_MOUSE_BUTTON MouseButton = 4
)

enum MOUSE_BUTTONS

type MouseEvent

type MouseEvent uint32
const (
	MOUSE_ENTER MouseEvent = iota
	MOUSE_LEAVE
	MOUSE_MOVE
	MOUSE_UP
	MOUSE_DOWN
	MOUSE_DCLICK
	MOUSE_WHEEL
	MOUSE_TICK // mouse pressed ticks
	MOUSE_IDLE // mouse stay idle for some time

	DROP         // item dropped target is that dropped item
	DRAG_ENTER   // drag arrived to the target element that is one of current drop targets.
	DRAG_LEAVE   // drag left one of current drop targets. target is the drop target element.
	DRAG_REQUEST // drag src notification before drag start. To cancel - return true from handler.

	MOUSE_CLICK MouseEvent = 0xFF // mouse click event

	DRAGGING MouseEvent = 0x100 // This flag is 'ORed' with MOUSE_ENTER..MOUSE_DOWN codes if dragging operation is in effect.

)

parameters of evtg == HANDLE_MOUSE enum MOUSE_EVENTS

func (MouseEvent) String

func (i MouseEvent) String() string

type MouseParams

type MouseParams struct {
	Cmd         MouseEvent // MouseEvents
	Target      C.HELEMENT
	Pos         Point
	DocumentPos Point
	ButtonState MouseButton
	AltState    KeyboardState
	CursorType  CursorType
	IsOnIcon    int32

	Dragging     C.HELEMENT
	DraggingMode DraggingType
}

type NativeFunctor

type NativeFunctor func(args ...*Value) *Value

type PTiscriptVM

type PTiscriptVM uintptr

type PhaseMask

type PhaseMask uint32

type Point

type Point struct {
	X int32
	Y int32
}

type PopupPlacement

type PopupPlacement uint32

* \param[in] placement \b UINT, values: * 2 - popup element below of anchor * 8 - popup element above of anchor * 4 - popup element on left side of anchor * 6 - popup element on right side of anchor * ( see numpad on keyboard to get an idea of the numbers)

const (
	BelowAnchor PopupPlacement = 2

	LeftOfAnchor  PopupPlacement = 4
	RightOfAnchor PopupPlacement = 6
)

type REQUEST_RESULT

type REQUEST_RESULT int32

func (REQUEST_RESULT) String

func (i REQUEST_RESULT) String() string

type Rect

type Rect struct {
	Left   int32
	Top    int32
	Right  int32
	Bottom int32
}

func NewRect

func NewRect(top, left, width, height int) *Rect

type Request

type Request struct {
	// contains filtered or unexported fields
}

Request represents a request issued by sciter e.g. el.request(...) or view.request(...)

func WrapRequest

func WrapRequest(requestId C.HREQUEST) *Request

WrapRequest wraps C.HREQUEST to a go side *Request, doing RequestUse/RequestUnUse automatically

func (*Request) AppendDataChunk

func (r *Request) AppendDataChunk(data []byte) error

func (*Request) CompletionStatus

func (r *Request) CompletionStatus() (uint, uint, error)

func (*Request) ContentUrl

func (r *Request) ContentUrl() (string, error)

func (*Request) Data

func (r *Request) Data() ([]byte, error)

func (*Request) NthParameterName

func (r *Request) NthParameterName(idx uint) (string, error)

func (*Request) NthParameterValue

func (r *Request) NthParameterValue(idx uint) (string, error)

func (*Request) NthRqHeaderName

func (r *Request) NthRqHeaderName(idx uint) (string, error)

func (*Request) NthRqHeaderValue

func (r *Request) NthRqHeaderValue(idx uint) (string, error)

func (*Request) NthRspHeaderName

func (r *Request) NthRspHeaderName(idx uint) (string, error)

func (*Request) NthRspHeaderValue

func (r *Request) NthRspHeaderValue(idx uint) (string, error)

func (*Request) NumberOfParameters

func (r *Request) NumberOfParameters() (uint, error)

func (*Request) NumberOfRqHeaders

func (r *Request) NumberOfRqHeaders() (uint, error)

func (*Request) NumberOfRspHeaders

func (r *Request) NumberOfRspHeaders() (uint, error)

func (*Request) ProxyHost

func (r *Request) ProxyHost() (string, error)

func (*Request) ProxyPort

func (r *Request) ProxyPort() (uint, error)

func (*Request) ReceivedDataType

func (r *Request) ReceivedDataType() (string, error)

func (*Request) RequestSetReceivedDataEncoding

func (r *Request) RequestSetReceivedDataEncoding(encoding string) error

func (*Request) RequestType

func (r *Request) RequestType() (uint, error)

func (*Request) RequestedDataType

func (r *Request) RequestedDataType() (SciterResourceType, error)

func (*Request) SetFailed

func (r *Request) SetFailed(status uint, data []byte) error

func (*Request) SetReceivedDataType

func (r *Request) SetReceivedDataType(dataType string) error

func (*Request) SetRqHeader

func (r *Request) SetRqHeader(name, value string) error

func (*Request) SetRspHeader

func (r *Request) SetRspHeader(name, value string) error

func (*Request) SetSucceeded

func (r *Request) SetSucceeded(status uint, data []byte) error

func (*Request) Times

func (r *Request) Times() (time.Time, time.Time, error)

func (*Request) Url

func (r *Request) Url() (string, error)

type RequestParam

type RequestParam struct {
	Name  string
	Value string
}

type RequestType

type RequestType uint32
const (
	GET_ASYNC  RequestType = iota // async GET
	POST_ASYNC                    // async POST
	GET_SYNC                      // synchronous GET
	POST_SYNC                     // synchronous POST
)

enum REQUEST_TYPE

type SCDOM_RESULT

type SCDOM_RESULT int32

typedef int SCDOM_RESULT;

const (
	SCDOM_OK SCDOM_RESULT = iota
	SCDOM_INVALID_HWND
	SCDOM_INVALID_HANDLE
	SCDOM_PASSIVE_HANDLE
	SCDOM_INVALID_PARAMETER
	SCDOM_OPERATION_FAILED
	SCDOM_OK_NOT_HANDLED SCDOM_RESULT = (-1)
)

func (SCDOM_RESULT) String

func (i SCDOM_RESULT) String() string

type SCITER_SCROLL_FLAGS

type SCITER_SCROLL_FLAGS uint32
const (
	SCROLL_TO_TOP SCITER_SCROLL_FLAGS = 0x01
	SCROLL_SMOOTH SCITER_SCROLL_FLAGS = 0x10
)

enum SCITER_SCROLL_FLAGS

type SET_ELEMENT_HTML

type SET_ELEMENT_HTML int32
const (
	SIH_REPLACE_CONTENT   SET_ELEMENT_HTML = 0
	SIH_INSERT_AT_START   SET_ELEMENT_HTML = 1
	SIH_APPEND_AFTER_LAST SET_ELEMENT_HTML = 2
	SOH_REPLACE           SET_ELEMENT_HTML = 3
	SOH_INSERT_BEFORE     SET_ELEMENT_HTML = 4
	SOH_INSERT_AFTER      SET_ELEMENT_HTML = 5
)

enum SET_ELEMENT_HTML

type Sciter

type Sciter struct {
	// contains filtered or unexported fields
}

func Wrap

func Wrap(hwnd C.HWINDOW) *Sciter

func (*Sciter) AttachWindowEventHandler

func (s *Sciter) AttachWindowEventHandler(handler *EventHandler) error

SCDOM_RESULT SciterWindowAttachEventHandler( HWINDOW hwndLayout, LPELEMENT_EVENT_PROC pep, LPVOID tag, UINT subscription )

func (*Sciter) Call

func (s *Sciter) Call(functionName string, args ...*Value) (retval *Value, err error)

To call global function defined in script using its full name (may include name of namespaces where it resides)

func (*Sciter) CloseArchive

func (s *Sciter) CloseArchive()

Close the archive.

func (*Sciter) DataReady

func (s *Sciter) DataReady(uri string, data []byte) bool

This function is used in response to SCN_LOAD_DATA request.

\param[in] hwnd \b HWINDOW, Sciter window handle.
\param[in] uri \b LPCWSTR, URI of the data requested by Sciter.
\param[in] data \b LPBYTE, pointer to data buffer.
\param[in] dataLength \b UINT, length of the data in bytes.
\return \b BOOL, TRUE if Sciter accepts the data or \c FALSE if error occured
(for example this function was called outside of #SCN_LOAD_DATA request).

\warning If used, call of this function MUST be done ONLY while handling
SCN_LOAD_DATA request and in the same thread. For asynchronous resource loading
use SciterDataReadyAsync

func (*Sciter) DataReadyAsync

func (s *Sciter) DataReadyAsync(uri string, data []byte, requestId C.HREQUEST) bool

Use this function outside of SCN_LOAD_DATA request. This function is needed when you

you have your own http client implemented in your application.

\param[in] hwnd \b HWINDOW, Sciter window handle.
\param[in] uri \b LPCWSTR, URI of the data requested by Sciter.
\param[in] data \b LPBYTE, pointer to data buffer.
\param[in] requestId \b LPVOID, SCN_LOAD_DATA requestId.
\return \b BOOL, TRUE if Sciter accepts the data or \c FALSE if error occured

func (*Sciter) DefineFunction

func (s *Sciter) DefineFunction(name string, nf func(args ...*Value) *Value)

DefineFunction defines global scripting function which works for tiscript and csss! script.

The global function must be access via the `view` namespace

func (*Sciter) DetachWindowEventHandler

func (s *Sciter) DetachWindowEventHandler(handler *EventHandler) error

SCDOM_RESULT SciterWindowDetachEventHandler( HWINDOW hwndLayout, LPELEMENT_EVENT_PROC pep, LPVOID tag )

func (*Sciter) Eval

func (s *Sciter) Eval(script string) (retval *Value, ok bool)

To evaluate arbitrary script in context of current document loaded into the window

func (*Sciter) FindElement

func (s *Sciter) FindElement(pt Point) (*Element, error)

Find DOM element by coordinate.

\param[in] hwnd \b HWINDOW, Sciter window for which you need to find
elementz
\param[in] pt \b POINT, coordinates, window client area relative.
\param[out ] phe \b #HELEMENT*, variable to receive found element handle.
\return \b #SCDOM_RESULT SCAPI

If element was not found then *phe will be set to zero.

func (*Sciter) GetArchiveItem

func (s *Sciter) GetArchiveItem(uri string) []byte

Get an archive item referenced by \c uri.

Usually it is passed to \c Sciter.DataReady().

func (*Sciter) GetElementByUID

func (s *Sciter) GetElementByUID(uid uint) (*Element, error)

SCDOM_RESULT SciterGetElementByUID(HWINDOW hwnd, UINT uid, HELEMENT* phe)

func (*Sciter) GetFocusElement

func (s *Sciter) GetFocusElement() (*Element, error)

Get focused DOM element of HTML document.

\param[in] hwnd \b HWINDOW, Sciter window for which you need to get focus
element
\param[out ] phe \b #HELEMENT*, variable to receive focus element
\return \b #SCDOM_RESULT SCAPI

phe can have null value (0).

COMMENT: To set focus on element use SciterSetElementState(STATE_FOCUS,0)

func (*Sciter) GetHwnd

func (s *Sciter) GetHwnd() C.HWINDOW

func (*Sciter) GetRootElement

func (s *Sciter) GetRootElement() (*Element, error)

Get root DOM element of HTML document.

\param[in] hwnd \b HWINDOW, Sciter window for which you need to get root
element
\param[out ] phe \b #HELEMENT*, variable to receive root element
\return \b #SCDOM_RESULT SCAPI

Root DOM object is always a 'HTML' element of the document.

func (*Sciter) LoadFile

func (s *Sciter) LoadFile(filename string) error

func (*Sciter) LoadHtml

func (s *Sciter) LoadHtml(html, baseUrl string) error

Load HTML from in memory buffer with base.

\param[in] hWndSciter \b HWINDOW, Sciter window handle.
\param[in] html \b LPCBYTE, Address of HTML to load.
\param[in] htmlSize \b UINT, Length of the array pointed by html parameter.
\param[in] baseUrl \b LPCWSTR, base URL. All relative links will be resolved against
                               this URL.
\return \b BOOL, \c TRUE if the text was parsed and loaded successfully, FALSE otherwise.

func (*Sciter) MinHeight

func (s *Sciter) MinHeight(width int) int

UINT SciterGetMinHeight (HWINDOW hWndSciter, UINT width)

func (*Sciter) MinWidth

func (s *Sciter) MinWidth() int

UINT SciterGetMinWidth (HWINDOW hWndSciter)

func (*Sciter) OpenArchive

func (s *Sciter) OpenArchive(data []byte)

Open data blob of the provided compressed Sciter archive.

func (*Sciter) SetCSS

func (s *Sciter) SetCSS(css, baseUrl, mediaType string) (ok bool)

Set (reset) style sheet of current document. Will reset styles for all elements according to given CSS (utf8)

\param[in] hWndSciter \b HWINDOW, Sciter window handle.
\param[in] utf8 \b LPCBYTE, start of CSS buffer.
\param[in] numBytes \b UINT, number of bytes in utf8.

func (*Sciter) SetCallback

func (s *Sciter) SetCallback(handler *CallbackHandler)

Set \link #SCITER_NOTIFY() notification callback function \endlink.

\param[in] hWndSciter \b HWINDOW, Sciter window handle.
\param[in] cb \b SCITER_NOTIFY*, \link #SCITER_NOTIFY() callback function \endlink.
\param[in] cbParam \b LPVOID, parameter that will be passed to \link #SCITER_NOTIFY() callback function \endlink as vParam paramter.

func (*Sciter) SetHomeURL

func (s *Sciter) SetHomeURL(baseUrl string) (ok bool)

Set sciter home url.

 home url is used for resolving sciter: urls
 If you will set it like SciterSetHomeURL(hwnd,"http://sciter.com/modules/")
 then <script src="sciter:lib/root-extender.tis"> will load
 root-extender.tis from http://sciter.com/modules/lib/root-extender.tis

\param[in] hWndSciter \b HWINDOW, Sciter window handle.
\param[in] baseUrl \b LPCWSTR, URL of sciter home.

func (*Sciter) SetMediaType

func (s *Sciter) SetMediaType(mediaType string) (ok bool)

Set media type of this sciter instance.

\param[in] hWndSciter \b HWINDOW, Sciter window handle.
\param[in] mediaType \b LPCWSTR, media type name.

For example media type can be "handheld", "projection", "screen", "screen-hires", etc.
By default sciter window has "screen" media type.

Media type name is used while loading and parsing style sheets in the engine so
you should call this function *before* loading document in it.

func (*Sciter) SetOption

func (s *Sciter) SetOption(option Sciter_RT_OPTIONS, value uint) (ok bool)

BOOL SciterSetOption (HWINDOW hWnd, UINT option, UINT_PTR value )

func (*Sciter) SetResourceArchive

func (s *Sciter) SetResourceArchive(data []byte)

Register `this://app/` URLs to be loaded from the given Sciter archive.

Pack resources using `packfolder` tool:

`$ packfolder res_folder res_packed.go -v resource_name -go`

Usage:

```

win.SetResourceArchive(resource_name)
win.LoadFile("this://app//index.htm")

```

func (*Sciter) UpdateWindow

func (s *Sciter) UpdateWindow()

VOID SciterUpdateWindow(HWINDOW hwnd)

type SciterCallbackNotification

type SciterCallbackNotification struct {
	Code uint32
	Hwnd C.HWINDOW
}

Notify structures *Notification callback structure.

*

typedef struct SCITER_CALLBACK_NOTIFICATION

{
  UINT code; /**< [in] one of the codes above.*/
  HWINDOW hwnd; /**< [in] HWINDOW of the window this callback was attached to.*/
} SCITER_CALLBACK_NOTIFICATION;

type SciterResourceType

type SciterResourceType uint32

* Resource data type.

  • Used by SciterDataReadyAsync() function. *
const (
	RT_DATA_HTML SciterResourceType = iota
	RT_DATA_IMAGE
	RT_DATA_STYLE
	RT_DATA_CURSOR
	RT_DATA_SCRIPT
	RT_DATA_RAW
	RT_DATA_FONT
	RT_DATA_SOUND // wav bytes

	RT_DATA_FORCE_DWORD = 0xffffffff
)

typedef enum SciterResourceType

type Sciter_RT_OPTIONS

type Sciter_RT_OPTIONS uint32

type ScnAttachBehavior

type ScnAttachBehavior C.SCN_ATTACH_BEHAVIOR

typedef struct SCN_ATTACH_BEHAVIOR

{
   UINT code; /**< [in] one of the codes above.*/
   HWINDOW hwnd; /**< [in] HWINDOW of the window this callback was attached to.*/

   HELEMENT element;          /**< [in] target DOM element handle*/
   LPCSTR   behaviorName;     /**< [in] zero terminated string, string appears as value of CSS behavior:"???" attribute.*/

   ElementEventProc* elementProc;    /**< [out] pointer to ElementEventProc function.*/
   LPVOID            elementTag;     /**< [out] tag value, passed as is into pointer ElementEventProc function.*/

} SCN_ATTACH_BEHAVIOR;

func (*ScnAttachBehavior) BehaviorName

func (s *ScnAttachBehavior) BehaviorName() string

func (*ScnAttachBehavior) Element

func (s *ScnAttachBehavior) Element() C.HELEMENT

type ScnDataLoaded

type ScnDataLoaded struct {
	SciterCallbackNotification

	DataSize uint32
	DataType SciterResourceType
	Status   uint32
	// contains filtered or unexported fields
}

*This structure is used by #SCN_DATA_LOADED notification.

*\copydoc SCN_DATA_LOADED
*

typedef struct SCN_DATA_LOADED

{
   UINT code; /**< [in] one of the codes above.*/
   HWINDOW hwnd; /**< [in] HWINDOW of the window this callback was attached to.*/

   LPCWSTR  uri;              /**< [in] zero terminated string, fully qualified uri, for example "http://server/folder/file.ext".*/
   LPCBYTE  data;             /**< [in] pointer to loaded data.*/
   UINT    dataSize;         /**< [in] loaded data size (in bytes).*/
   UINT     dataType;         /**< [in] SciterResourceType */
   UINT     status;           /**< [in]
                                        status = 0 (dataSize == 0) - unknown error.
                                        status = 100..505 - http response status, Note: 200 - OK!
                                        status > 12000 - wininet error code, see ERROR_INTERNET_*** in wininet.h
                                */
} SCN_DATA_LOADED;

func (*ScnDataLoaded) Data

func (s *ScnDataLoaded) Data() []byte

func (*ScnDataLoaded) Uri

func (s *ScnDataLoaded) Uri() string

type ScnEngineDestroyed

type ScnEngineDestroyed SciterCallbackNotification

*This structure is used by #SC_ENGINE_DESTROYED notification.

*\copydoc SCN_ENGINE_DESTROYED *

typedef struct SCN_ENGINE_DESTROYED

{
    UINT code; /**< [in] one of the codes above.*/
    HWINDOW hwnd; /**< [in] HWINDOW of the window this callback was attached to.*/
} SCN_ENGINE_DESTROYED;

type ScnGraphicsCriticalFailure

type ScnGraphicsCriticalFailure SciterCallbackNotification

*This structure is used by #SC_GRAPHICS_CRITICAL_FAILURE notification.

*\copydoc SC_GRAPHICS_CRITICAL_FAILURE *

type ScnInvalidateRect

type ScnInvalidateRect struct {
	SciterCallbackNotification
	// contains filtered or unexported fields
}

*This structure is used by #SC_INVALIDATE_RECT notification.

*\copydoc SC_INVALIDATE_RECT *

type ScnKeyboardRequest

type ScnKeyboardRequest struct {
	SciterCallbackNotification
	// contains filtered or unexported fields
}

*This structure is used by #SC_KEYBOARD_REQUEST notification.

*\copydoc SC_KEYBOARD_REQUEST *

type ScnLoadData

type ScnLoadData C.SCN_LOAD_DATA

func (*ScnLoadData) Data

func (s *ScnLoadData) Data() []byte

func (*ScnLoadData) RequestId

func (s *ScnLoadData) RequestId() C.HREQUEST

func (*ScnLoadData) SetData

func (s *ScnLoadData) SetData(data []byte)

func (*ScnLoadData) Uri

func (s *ScnLoadData) Uri() string

type ScnPostedNotification

type ScnPostedNotification struct {
	SciterCallbackNotification
	Wparam  *uint
	Lparam  *uint
	Lreturn *uint
}

*This structure is used by #SC_ENGINE_DESTROYED notification.

*\copydoc SCN_ENGINE_DESTROYED *

typedef struct SCN_POSTED_NOTIFICATION

{
   UINT      code; /**< [in] one of the codes above.*/
   HWINDOW   hwnd; /**< [in] HWINDOW of the window this callback was attached to.*/
   UINT_PTR  wparam;
   UINT_PTR  lparam;
   UINT_PTR  lreturn;
} SCN_POSTED_NOTIFICATION;

type ScriptingMethodParams

type ScriptingMethodParams C.SCRIPTING_METHOD_PARAMS

func (*ScriptingMethodParams) Arg

func (r *ScriptingMethodParams) Arg(i int) *Value

func (*ScriptingMethodParams) Argc

func (s *ScriptingMethodParams) Argc() int

func (*ScriptingMethodParams) Args

func (r *ScriptingMethodParams) Args() []*Value

func (*ScriptingMethodParams) Name

func (s *ScriptingMethodParams) Name() string

func (*ScriptingMethodParams) Return

func (s *ScriptingMethodParams) Return(val interface{})

set the return val for the scripting func if not set return undefined

type ScrollEvent

type ScrollEvent uint32
const (
	SCROLL_HOME ScrollEvent = iota
	SCROLL_END
	SCROLL_STEP_PLUS
	SCROLL_STEP_MINUS
	SCROLL_PAGE_PLUS
	SCROLL_PAGE_MINUS
	SCROLL_POS
	SCROLL_SLIDER_RELEASED
	SCROLL_CORNER_PRESSED
	SCROLL_CORNER_RELEASED
)

enum SCROLL_EVENTS

func (ScrollEvent) String

func (i ScrollEvent) String() string

type ScrollParams

type ScrollParams struct {
	Cmd      ScrollEvent
	Target   C.HELEMENT
	Pos      int32
	Vertical int32 // bool
}

struct SCROLL_PARAMS

{
  UINT      cmd;          // SCROLL_EVENTS
  HELEMENT  target;       // target element
  INT       pos;          // scroll position if SCROLL_POS
  BOOL      vertical;     // true if from vertical scrollbar
};

type Size

type Size struct {
	Cx int32
	Cy int32
}

type SomEvents

type SomEvents uint32

type SomParams

type SomParams C.SOM_PARAMS

type TimerParams

type TimerParams struct {
	TimerId uintptr
}

type TiscriptMethodParams

type TiscriptMethodParams struct {
	// tiscript_VM    *vm
	VM HVM
	// tiscript_value tag    //< method id (symbol)
	Tag TiscriptValue
	// tiscript_value result //< return value
	Result TiscriptValue
}

typedef struct TISCRIPT_METHOD_PARAMS

{
    tiscript_VM*   vm;
    tiscript_value tag;    //< method id (symbol)
    tiscript_value result; //< return value
    // parameters are accessible through tiscript::args.
} TISCRIPT_METHOD_PARAMS;

type TiscriptPvalue

type TiscriptPvalue struct {
	Val TiscriptValue
	VM  HVM
	// contains filtered or unexported fields
}

// pinned tiscript_value, val here will survive GC. typedef struct tiscript_pvalue

{
   tiscript_value val;
   struct tiscript_VM* vm;
   void *d1,*d2;
} tiscript_pvalue;

type TiscriptValue

type TiscriptValue uint64

// tiscript_value typedef UINT64 tiscript_value;

type VALUE_RESULT

type VALUE_RESULT int32 //C.VALUE_RESULT
const (
	HV_OK_TRUE VALUE_RESULT = iota - 1
	HV_OK
	HV_BAD_PARAMETER
	HV_INCOMPATIBLE_TYPE
)

enum VALUE_RESULT

func (VALUE_RESULT) String

func (i VALUE_RESULT) String() string

type Value

type Value C.VALUE

typedef struct

{
  UINT   t;
  UINT   u;
  UINT64 d;
} VALUE;

func NewSymbol

func NewSymbol(sym string) *Value

func NewValue

func NewValue(val ...interface{}) *Value

Only supported basic types: int/bool/string/float/NativeFunctor/Value

for creating array: a := NewValue(); a.SetIndex(0, 123)|a.Append(123)
for creating map/object: obj := NewValue(); obj.Set("key", "value")

The creating process would call ValueInit/VlaueClear automatically

func NothingValue

func NothingValue() *Value

static value nothing() { value n; n.t = T_UNDEFINED; n.u = UT_NOTHING; return n; }

func NullValue

func NullValue() *Value

// static value null() { value n; n.t = T_NULL; return n; }

func (*Value) Append

func (pdst *Value) Append(val interface{}) error

func (*Value) Assign

func (v *Value) Assign(val interface{})

Assign go value to Sciter Value currently supported go types: bool integer float string and NativeFunctor

func (*Value) Bool

func (v *Value) Bool() bool

func (*Value) Bytes

func (pdst *Value) Bytes() []byte

ValueBinaryData - retreive integer data of T_BYTES type

func (*Value) Clone

func (v *Value) Clone() *Value

func (*Value) Compare

func (pdst *Value) Compare(val *Value) error

ValueCompare - compares two values, returns HV_OK_TRUE if val1 == val2.

func (*Value) ConvertFromString

func (pdst *Value) ConvertFromString(str string, how ValueStringConvertType) error

ValueFromString - parses string into value:

  • CVT_SIMPLE - parse/emit terminal values (T_INT, T_FLOAT, T_LENGTH, T_STRING), "guess" non-strict parsing
  • CVT_JSON_LITERAL - parse/emit value using JSON literal rules: {}, [], "string", true, false, null
  • CVT_JSON_MAP - parse/emit MAP value without enclosing '{' and '}' brackets.

Returns:

Number of non-parsed characters in case of errors. Thus if string was parsed in full it returns 0 (success)

func (*Value) ConvertToString

func (pdst *Value) ConvertToString(how ValueStringConvertType) error

ValueToString - converts value to T_STRING inplace:

  • CVT_SIMPLE - parse/emit terminal values (T_INT, T_FLOAT, T_LENGTH, T_STRING)
  • CVT_JSON_LITERAL - parse/emit value using JSON literal rules: {}, [], "string", true, false, null
  • CVT_JSON_MAP - parse/emit MAP value without enclosing '{' and '}' brackets.

func (*Value) Copy

func (pdst *Value) Copy(psrc *Value) error

ValueCopy - copies src VALUE to dst VALUE. dst VALUE must be in ValueInit state.

func (*Value) EnumerateKeyValue

func (pdst *Value) EnumerateKeyValue(fn KeyValueCallback) error

*

  • ValueEnumElements - enumeartes key/value pairs of T_MAP, T_FUNCTION and T_OBJECT values
  • - T_MAP - key of nth key/value pair in the map;
  • - T_FUNCTION - name of nth argument of the function (if any);

UINT ValueEnumElements ( VALUE* pval, KeyValueCallback* penum, LPVOID param) ;//{ return SAPI()->ValueEnumElements (pval,penum,param); }

func (*Value) Float

func (pdst *Value) Float() float64

UINT ValueFloatData ( const VALUE* pval, FLOAT_VALUE* pData ) ;//{ return SAPI()->ValueFloatData ( pval,pData ); }

func (*Value) Get

func (pdst *Value) Get(key string) (val *Value)

ValueGetValueOfKey - retrieves value of sub-element by key:

  • T_MAP - value of key/value pair with the key;
  • T_FUNCTION - value of argument with the name key;
  • T_OBJECT (tiscript) - value of property of the object

Otherwise *pretval will have T_UNDEFINED value.

func (*Value) Index

func (pdst *Value) Index(n int) *Value

ValueNthElementValue - retreive value of sub-element at index n for: - T_ARRAY - nth element of the array; - T_MAP - value of nth key/value pair in the map; - T_FUNCTION - value of nth argument of the function;

func (*Value) Int

func (pdst *Value) Int() int

UINT ValueIntData ( const VALUE* pval, INT* pData ) ;//{ return SAPI()->ValueIntData ( pval, pData ); }

func (*Value) Int64

func (pdst *Value) Int64() int64

UINT ValueInt64Data ( const VALUE* pval, INT64* pData ) ;//{ return SAPI()->ValueInt64Data ( pval,pData ); }

func (*Value) Invoke

func (v *Value) Invoke(self *Value, nameOrUrl string, args ...*Value) (retval *Value, err error)

ValueInvoke - function invocation (Sciter/TIScript). Usually as callbacks for asynchronous tasks

  • VALUE* pval is a value of type T_OBJECT/UT_OBJECT_FUNCTION
  • VALUE* self - object that will be known as 'this' inside that function. 'self' here is what will be known as 'this' inside the function, can be undefined for invocations of global functions
  • UINT argc, const VALUE* argv - vector of arguments to pass to the function.
  • VALUE* pretval - parse/emit MAP value without enclosing '{' and '}' brackets.
  • LPCWSTR url - url or name of the script - used for error reporting in the script.

Returns:

HV_OK, HV_BAD_PARAMETER or HV_INCOMPATIBLE_TYPE

func (*Value) IsAngle

func (v *Value) IsAngle() bool

bool is_angle() const { return t == T_ANGLE; }

func (*Value) IsArray

func (v *Value) IsArray() bool

bool is_array() const { return t == T_ARRAY; }

func (*Value) IsAsset

func (v *Value) IsAsset() bool

bool is_asset() const { return t == T_ASSET; }

func (*Value) IsBool

func (v *Value) IsBool() bool

bool is_bool() const { return t == T_BOOL; }

func (*Value) IsByte

func (v *Value) IsByte() bool

bool is_bytes() const { return t == T_BYTES; }

func (*Value) IsColor

func (v *Value) IsColor() bool

bool is_color() const { return t == T_COLOR; }

func (*Value) IsCurrency

func (v *Value) IsCurrency() bool

bool is_currency() const { return t == T_CURRENCY; }

func (*Value) IsDate

func (v *Value) IsDate() bool

bool is_date() const { return t == T_DATE; }

func (*Value) IsDomElement

func (v *Value) IsDomElement() bool

bool is_dom_element() const { return t == T_DOM_OBJECT; }

func (*Value) IsDuration

func (v *Value) IsDuration() bool

bool is_duration() const { return t == T_DURATION; }

func (*Value) IsFloat

func (v *Value) IsFloat() bool

bool is_float() const { return t == T_FLOAT; }

func (*Value) IsFunction

func (v *Value) IsFunction() bool

bool is_function() const { return t == T_FUNCTION; }

func (*Value) IsInt

func (v *Value) IsInt() bool

bool is_int() const { return t == T_INT; }

func (*Value) IsMap

func (v *Value) IsMap() bool

bool is_map() const { return t == T_MAP; }

func (*Value) IsNativeFunctor

func (pdst *Value) IsNativeFunctor() bool

BOOL ValueIsNativeFunctor ( const VALUE* pval) ;//{ return SAPI()->ValueIsNativeFunctor (pval); }

func (*Value) IsNothing

func (v *Value) IsNothing() bool

bool is_nothing() const { return t == T_UNDEFINED && u == UT_NOTHING; }

func (*Value) IsNull

func (v *Value) IsNull() bool

bool is_null() const { return t == T_NULL; }

func (*Value) IsObject

func (v *Value) IsObject() bool

bool is_object() const { return t == T_OBJECT; }

func (*Value) IsObjectArray

func (v *Value) IsObjectArray() bool

bool is_object_array() const { return t == T_OBJECT && u == UT_OBJECT_ARRAY; }

func (*Value) IsObjectClass

func (v *Value) IsObjectClass() bool

bool is_object_class() const { return t == T_OBJECT && u == UT_OBJECT_CLASS; } // that is TS class

func (*Value) IsObjectE

func (v *Value) IsObjectE() bool

bool is_object_error() const { return t == T_OBJECT && u == UT_OBJECT_ERROR; } // that is TS error

func (*Value) IsObjectFunction

func (v *Value) IsObjectFunction() bool

bool is_object_function() const { return t == T_OBJECT && u == UT_OBJECT_FUNCTION; }

func (*Value) IsObjectNative

func (v *Value) IsObjectNative() bool

bool is_object_native() const { return t == T_OBJECT && u == UT_OBJECT_NATIVE; }

func (*Value) IsObjectObject

func (v *Value) IsObjectObject() bool

bool is_object_object() const { return t == T_OBJECT && u == UT_OBJECT_OBJECT; } // that is plain TS object

func (*Value) IsString

func (v *Value) IsString() bool

bool is_string() const { return t == T_STRING; }

func (*Value) IsSymbol

func (v *Value) IsSymbol() bool

bool is_symbol() const { return t == T_STRING && u == UT_SYMBOL; }

func (*Value) IsUndefined

func (v *Value) IsUndefined() bool

bool is_undefined() const { return t == T_UNDEFINED; }

func (*Value) Isolate

func (pdst *Value) Isolate() error

ValueIsolate - converts T_OBJECT value types to T_MAP or T_ARRAY. use this method if you need to pass values between different threads. The fanction is applicable for the Sciter

func (*Value) Length

func (pdst *Value) Length() int

ValueElementsCount - retreive number of sub-elements for: - T_ARRAY - number of elements in the array; - T_MAP - number of key/value pairs in the map; - T_FUNCTION - number of arguments in the function;

func (*Value) NthElementKey

func (pdst *Value) NthElementKey(idx int) (val *Value)

UINT ValueNthElementKey ( const VALUE* pval, INT n, VALUE* pretval) ;//{ return SAPI()->ValueNthElementKey ( pval,n,pretval); }

func (*Value) Release

func (v *Value) Release()

release the object from sciter and go world

func (*Value) Set

func (pdst *Value) Set(key string, val interface{}) error

ValueSetValueToKey - sets value of sub-element by key:

  • T_MAP - value of key/value pair with the key;
  • T_FUNCTION - value of argument with the name key;
  • T_OBJECT (tiscript) - value of property of the object

If the VALUE is not of one of types above then it makes it of type T_MAP with single pair - 'key'/'val_to_set'.

key usually is a value of type T_STRING

func (*Value) SetBool

func (pdst *Value) SetBool(b bool) error

func (*Value) SetBytes

func (pdst *Value) SetBytes(data []byte) error

UINT ValueBinaryDataSet ( VALUE* pval, LPCBYTE pBytes, UINT nBytes, UINT type, UINT units )

func (*Value) SetFloat

func (pdst *Value) SetFloat(data float64) error

UINT ValueFloatDataSet ( VALUE* pval, FLOAT_VALUE data, UINT type, UINT units ) ;//{ return SAPI()->ValueFloatDataSet ( pval,data,type,units ); }

func (*Value) SetIndex

func (pdst *Value) SetIndex(idx int, val interface{}) error

ValueNthElementValueSet - sets value of sub-element at index n for:

  • T_ARRAY - nth element of the array;
  • T_MAP - value of nth key/value pair in the map;
  • T_FUNCTION - value of nth argument of the function;

If the VALUE is not of one of types above then it makes it of type T_ARRAY with single element - 'val_to_set'.

func (*Value) SetInt

func (pdst *Value) SetInt(data int) error

UINT ValueIntDataSet ( VALUE* pval, INT data, UINT type, UINT units ) ;//{ return SAPI()->ValueIntDataSet ( pval, data,type,units ); }

func (*Value) SetInt64

func (pdst *Value) SetInt64(data int64, typ uint) error

UINT ValueInt64DataSet ( VALUE* pval, INT64 data, UINT type, UINT units ) ;//{ return SAPI()->ValueInt64DataSet ( pval,data,type,units ); }

func (*Value) SetNativeFunctor

func (pdst *Value) SetNativeFunctor(nf NativeFunctor) error

ValueNativeFunctorSet - set reference to native function

  • VALUE* pval - value to be initialized
  • NATIVE_FUNCTOR_INVOKE* pinvoke - reference to native functor implementation.
  • NATIVE_FUNCTOR_RELEASE* prelease - reference to native functor dtor implementation.
  • VOID* tag - optional tag, passed as it is to pinvoke and prelease

Returns:

HV_OK, HV_BAD_PARAMETER

func (*Value) SetString

func (pdst *Value) SetString(str string, uintType ...int) error

ValueStringDataSet - sets VALUE to T_STRING type and copies chars/numChars to internal refcounted buffer assosiated with the value.

func (*Value) String

func (v *Value) String() string

func (*Value) Type

func (pdst *Value) Type(pType, pUints *uint) uint

ValueType - returns VALUE_TYPE and VALUE_UNIT_TYPE flags of the VALUE

type ValueStringConvertType

type ValueStringConvertType uint32
const (
	CVT_SIMPLE        ValueStringConvertType = iota ///< simple conversion of terminal values
	CVT_JSON_LITERAL                                ///< json literal parsing/emission
	CVT_JSON_MAP                                    ///< json parsing/emission it parses as if token '{' already recognized
	CVT_XJSON_LITERAL                               ///< x-json parsing/emission, date is emitted as ISO8601 date literal, currency is emitted in the form DDDD$CCC
)

enum VALUE_STRING_CVT_TYPE

type WindowCreationFlag

type WindowCreationFlag uint32
enum SCITER_CREATE_WINDOW_FLAGS {
   SW_CHILD      = (1 << 0), // child window only, if this flag is set all other flags ignored
   SW_TITLEBAR   = (1 << 1), // toplevel window, has titlebar
   SW_RESIZEABLE = (1 << 2), // has resizeable frame
   SW_TOOL       = (1 << 3), // is tool window
   SW_CONTROLS   = (1 << 4), // has minimize / maximize buttons
   SW_GLASSY     = (1 << 5), // glassy window ( DwmExtendFrameIntoClientArea on windows )
   SW_ALPHA      = (1 << 6), // transparent window ( e.g. WS_EX_LAYERED on Windows )
   SW_MAIN       = (1 << 7), // main window of the app, will terminate the app on close
   SW_POPUP      = (1 << 8), // the window is created as topmost window.
   SW_ENABLE_DEBUG = (1 << 9), // make this window inspector ready
   SW_OWNS_VM      = (1 << 10), // it has its own script VM
};
const (
	SW_CHILD        WindowCreationFlag = (1 << iota) // child window only, if this flag is set all other flags ignored
	SW_TITLEBAR                                      // toplevel window, has titlebar
	SW_RESIZEABLE                                    // has resizeable frame
	SW_TOOL                                          // is tool window
	SW_CONTROLS                                      // has minimize / maximize buttons
	SW_GLASSY                                        // glassy window ( DwmExtendFrameIntoClientArea on windows )
	SW_ALPHA                                         // transparent window ( e.g. WS_EX_LAYERED on Windows )
	SW_MAIN                                          // main window of the app, will terminate the app on close
	SW_POPUP                                         // the window is created as topmost window.
	SW_ENABLE_DEBUG                                  // make this window inspector ready
	SW_OWNS_VM                                       // it has its own script VM
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL