sciter: github.com/oskca/sciter Index | Files

package sciter

import "github.com/oskca/sciter"

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

Package Files

generate.go sciter.go sciter_linux.go types.go types_string.go utils.go value.go wrapper.go

Constants

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

enum OUTPUT_SUBSYTEMS

const (
    OS_INFO = iota
    OS_WARNING
    OS_ERROR
)

enum OUTPUT_SEVERITY

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_ALL = 0xFFFF /* all of them */

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

enum EVENT_GROUPS

const (
    BUBBLING = 0      // bubbling (emersion) phase
    SINKING  = 0x8000 // capture (immersion) phase, this flag is or'ed with EVENTS codes below
    HANDLED  = 0x10000
)

enum PHASE_MASK

const (
    BEHAVIOR_DETACH = 0
    BEHAVIOR_ATTACH = 1
)

parameters of evtg == HANDLE_INITIALIZATION enum INITIALIZATION_EVENTS

const (
    NO_DRAGGING = iota
    DRAGGING_MOVE
    DRAGGING_COPY
)

enum DRAGGING_TYPE

const (
    CONTENT_ADDED   = 0x01
    CONTENT_REMOVED = 0x02
)

enum CONTENT_CHANGE_BITS { // for CONTENT_CHANGED reason

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
)

enum VALUE_TYPE

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

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

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

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.
)
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
)
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

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

enum SCRIPT_RUNTIME_FEATURES {

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 {

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)
)

Variables

var (
    BAD_HELEMENT = C.HELEMENT(unsafe.Pointer(uintptr(0)))
)
var (
    BAD_HWINDOW C.HWINDOW = nil
)
var (
    DefaultRect = &Rect{0, 0, 300, 400}
)
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
)

func AppendMasterCSS Uses

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 Uses

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

func BytePtrToBytes Uses

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

func ClassName Uses

func ClassName() string

func CreateWindow Uses

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

rect is the display area

func SetDLL Uses

func SetDLL(dir string)

func SetMasterCSS Uses

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 Uses

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

BOOL SciterSetOption (NULL, UINT option, UINT_PTR value )

func StringToBytePtr Uses

func StringToBytePtr(s string) *byte

func StringToUTF16Ptr Uses

func StringToUTF16Ptr(s string) *uint16

func StringToUTF16PtrWithLen Uses

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

func StringToWcharPtr Uses

func StringToWcharPtr(s string) *C.WCHAR

func Utf16FromString Uses

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

func Utf16ToString Uses

func Utf16ToString(s *uint16) string

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

func Utf16ToStringLength Uses

func Utf16ToStringLength(s *uint16, length int) string

func Version Uses

func Version(major bool) uint

func VersionAsString Uses

func VersionAsString() string

type BehaviorEvent Uses

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 Uses

func (i BehaviorEvent) String() string

type BehaviorEventParams Uses

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 Uses

func (b *BehaviorEventParams) Cmd() BehaviorEvent

type BehaviorMethodIdentifier Uses

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 Uses

func (i BehaviorMethodIdentifier) String() string

type CallbackHandler Uses

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
}

type CursorType Uses

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 Uses

func (i CursorType) String() string

type DataArrivedParams Uses

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 Uses

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

func (*DataArrivedParams) Uri Uses

func (d *DataArrivedParams) Uri() string

type DraggingType Uses

type DraggingType uint32

type DrawEvent Uses

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

enum DRAW_EVENTS

func (DrawEvent) String Uses

func (i DrawEvent) String() string

type DrawParams Uses

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

type EditChangedReason Uses

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 Uses

func (i EditChangedReason) String() string

type Element Uses

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

Represents a single DOM element, owns and manages a Handle

func CreateElement Uses

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 Uses

func WrapElement(he C.HELEMENT) *Element

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

func (*Element) Append Uses

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

Append element e as last child of this element.

func (*Element) AttachEventHandler Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (e *Element) Clear() error

Clear contents and all children of the element.

func (*Element) ClearAttr Uses

func (e *Element) ClearAttr() error

Remove all attributes from the element.

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

func (*Element) Clone Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

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

func (*Element) GetHwnd Uses

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

Get HWINDOW of containing window.

func (*Element) GetValue Uses

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 Uses

func (e *Element) HidePopup() error

SCDOM_RESULT SciterHidePopup(HELEMENT he)

func (*Element) Html Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

func (*Element) MustSelectUnique Uses

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 Uses

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 Uses

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

func (*Element) NthChild Uses

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 Uses

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

func (*Element) ParentElement Uses

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

Get parent element.

func (*Element) ReleaseCapture Uses

func (e *Element) ReleaseCapture() error

SCDOM_RESULT SciterReleaseCapture(HELEMENT he)

func (*Element) ScrollToView Uses

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

Scroll to view.

func (*Element) Select Uses

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

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

func (*Element) SelectById Uses

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 Uses

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

Returns the only child element that matches the selector.

func (*Element) SelectParent Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

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

func (*Element) SetStyle Uses

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

func (*Element) SetText Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (e *Element) ShowPopupAt(pos Point, animate bool) 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] animate \b BOOL, true if animation is needed.

func (*Element) Sort Uses

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 Uses

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

func (*Element) State Uses

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

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

func (*Element) Style Uses

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 Uses

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 Uses

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 Uses

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

Get element's type.

func (*Element) UID Uses

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

SCDOM_RESULT SciterGetElementUID(HELEMENT he, UINT* puid)

func (*Element) Update Uses

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 Uses

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 Uses

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
    OnGesture     func(he *Element, params *GestureParams) bool
}

type EventReason Uses

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 Uses

func (i EventReason) String() string

type ExchangeParams Uses

type ExchangeParams struct {
    Cmd       uint32
    Target    C.HELEMENT
    Pos       Point
    PosView   Point
    DataTypes uint32
    DragCmd   uint32
    FetchData uintptr // func pointer: typedef BOOL CALLBACK FETCH_EXCHANGE_DATA(EXCHANGE_PARAMS* params, UINT data_type, LPCBYTE* ppDataStart, UINT* pDataLength );
}

type FocusEvent Uses

type FocusEvent uint32
const (
    FOCUS_LOST FocusEvent = iota
    FOCUS_GOT
)

enum FOCUS_EVENTS

func (FocusEvent) String Uses

func (i FocusEvent) String() string

type FocusParams Uses

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 Uses

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 Uses

func (i GestureCmd) String() string

type GestureParams Uses

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 Uses

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 Uses

func (i GestureState) String() string

type GestureTypeFlag Uses

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 Uses

func (i GestureTypeFlag) String() string

type HVM Uses

type HVM PTiscriptVM

type InitializationParams Uses

type InitializationParams struct {
    Cmd uint32
}

type KeyEvent Uses

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

enum KEY_EVENTS

func (KeyEvent) String Uses

func (i KeyEvent) String() string

type KeyParams Uses

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

type KeyValueCallback Uses

type KeyValueCallback func(key, value *Value) bool

type KeyboardState Uses

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

enum KEYBOARD_STATES

type MethodParams Uses

type MethodParams struct {
    MethodId BehaviorMethodIdentifier
}

type MouseButton Uses

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 Uses

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 Uses

func (i MouseEvent) String() string

type MouseParams Uses

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 Uses

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

type PTiscriptVM Uses

type PTiscriptVM uintptr

type Point Uses

type Point struct {
    X   int32
    Y   int32
}

type PopupPlacement Uses

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 Rect Uses

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

func NewRect Uses

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

type RequestParam Uses

type RequestParam struct {
    Name  string
    Value string
}

type RequestType Uses

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 Uses

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 Uses

func (i SCDOM_RESULT) String() string

type SCITER_SCROLL_FLAGS Uses

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 Uses

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 Uses

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

func Wrap Uses

func Wrap(hwnd C.HWINDOW) *Sciter

func (*Sciter) AttachWindowEventHandler Uses

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

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

func (*Sciter) Call Uses

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 Uses

func (s *Sciter) CloseArchive()

Close the archive.

func (*Sciter) DataReady Uses

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 Uses

func (s *Sciter) DataReadyAsync(uri string, data []byte, requestId unsafe.Pointer) 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 Uses

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 Uses

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

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

func (*Sciter) Eval Uses

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 Uses

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 Uses

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 Uses

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

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

func (*Sciter) GetFocusElement Uses

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 Uses

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

func (*Sciter) GetRootElement Uses

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 Uses

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

func (*Sciter) LoadHtml Uses

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 Uses

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

UINT SciterGetMinHeight (HWINDOW hWndSciter, UINT width)

func (*Sciter) MinWidth Uses

func (s *Sciter) MinWidth() int

UINT SciterGetMinWidth (HWINDOW hWndSciter)

func (*Sciter) OpenArchive Uses

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

Open data blob of the provided compressed Sciter archive.

func (*Sciter) SetCSS Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

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

func (*Sciter) SetResourceArchive Uses

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 Uses

func (s *Sciter) UpdateWindow()

VOID SciterUpdateWindow(HWINDOW hwnd)

type SciterCallbackNotification Uses

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 Uses

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
)

typedef enum SciterResourceType

type Sciter_RT_OPTIONS Uses

type Sciter_RT_OPTIONS uint32

type ScnAttachBehavior Uses

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 Uses

func (s *ScnAttachBehavior) BehaviorName() string

func (*ScnAttachBehavior) Element Uses

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

type ScnDataLoaded Uses

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 Uses

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

func (*ScnDataLoaded) Uri Uses

func (s *ScnDataLoaded) Uri() string

type ScnEngineDestroyed Uses

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 ScnLoadData Uses

type ScnLoadData C.SCN_LOAD_DATA

func (*ScnLoadData) Data Uses

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

func (*ScnLoadData) SetData Uses

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

func (*ScnLoadData) Uri Uses

func (s *ScnLoadData) Uri() string

type ScnPostedNotification Uses

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 Uses

type ScriptingMethodParams C.SCRIPTING_METHOD_PARAMS

func (*ScriptingMethodParams) Arg Uses

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

func (*ScriptingMethodParams) Argc Uses

func (s *ScriptingMethodParams) Argc() int

func (*ScriptingMethodParams) Args Uses

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

func (*ScriptingMethodParams) Name Uses

func (s *ScriptingMethodParams) Name() string

func (*ScriptingMethodParams) Return Uses

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

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

type ScrollEvent Uses

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 Uses

func (i ScrollEvent) String() string

type ScrollParams Uses

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 Uses

type Size struct {
    Cx  int32
    Cy  int32
}

type TimerParams Uses

type TimerParams struct {
    TimerId uintptr
}

type TiscriptMethodParams Uses

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 Uses

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 Uses

type TiscriptValue uint64

// tiscript_value typedef UINT64 tiscript_value;

type VALUE_RESULT Uses

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 Uses

func (i VALUE_RESULT) String() string

type Value Uses

type Value C.VALUE

typedef struct {

UINT   t;
UINT   u;
UINT64 d;

} VALUE;

func NewSymbol Uses

func NewSymbol(sym string) *Value

func NewValue Uses

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 NullValue Uses

func NullValue() *Value

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

func (*Value) Append Uses

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

func (*Value) Assign Uses

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 Uses

func (v *Value) Bool() bool

func (*Value) Bytes Uses

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

ValueBinaryData - retreive integer data of T_BYTES type

func (*Value) Clone Uses

func (v *Value) Clone() *Value

func (*Value) Compare Uses

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

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

func (*Value) ConvertFromString Uses

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 Uses

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 Uses

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

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

func (*Value) EnumerateKeyValue Uses

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 Uses

func (pdst *Value) Float() float64

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

func (*Value) Get Uses

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 Uses

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 Uses

func (pdst *Value) Int() int

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

func (*Value) Int64 Uses

func (pdst *Value) Int64() int64

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

func (*Value) Invoke Uses

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) IsArray Uses

func (v *Value) IsArray() bool

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

func (*Value) IsBool Uses

func (v *Value) IsBool() bool

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

func (*Value) IsByte Uses

func (v *Value) IsByte() bool

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

func (*Value) IsCurrency Uses

func (v *Value) IsCurrency() bool

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

func (*Value) IsDate Uses

func (v *Value) IsDate() bool

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

func (*Value) IsDomElement Uses

func (v *Value) IsDomElement() bool

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

func (*Value) IsFloat Uses

func (v *Value) IsFloat() bool

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

func (*Value) IsFunction Uses

func (v *Value) IsFunction() bool

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

func (*Value) IsInt Uses

func (v *Value) IsInt() bool

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

func (*Value) IsMap Uses

func (v *Value) IsMap() bool

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

func (*Value) IsNativeFunctor Uses

func (pdst *Value) IsNativeFunctor() bool

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

func (*Value) IsNull Uses

func (v *Value) IsNull() bool

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

func (*Value) IsObject Uses

func (v *Value) IsObject() bool

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

func (*Value) IsObjectArray Uses

func (v *Value) IsObjectArray() bool

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

func (*Value) IsObjectClass Uses

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 Uses

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 Uses

func (v *Value) IsObjectFunction() bool

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

func (*Value) IsObjectNative Uses

func (v *Value) IsObjectNative() bool

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

func (*Value) IsObjectObject Uses

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 Uses

func (v *Value) IsString() bool

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

func (*Value) IsSymbol Uses

func (v *Value) IsSymbol() bool

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

func (*Value) IsUndefined Uses

func (v *Value) IsUndefined() bool

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

func (*Value) Isolate Uses

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 Uses

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 Uses

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 Uses

func (v *Value) Release()

release the object from sciter and go world

func (*Value) Set Uses

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 Uses

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

func (*Value) SetBytes Uses

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

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

func (*Value) SetFloat Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (v *Value) String() string

func (*Value) Type Uses

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

ValueType - returns VALUE_TYPE and VALUE_UNIT_TYPE flags of the VALUE

type ValueStringConvertType Uses

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 Uses

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
)

Package sciter imports 8 packages (graph) and is imported by 2 packages. Updated 2018-12-23. Refresh now. Tools for package owners.