Prolog "react"

Admin User, erstellt 15. März 2024
         
/**
* This file provides dom writing predicates.
*
* Warranty & Liability
* To the extent permitted by applicable law and unless explicitly
* otherwise agreed upon, XLOG Technologies AG makes no warranties
* regarding the provided information. XLOG Technologies AG assumes
* no liability that any problems might be solved with the information
* provided by XLOG Technologies AG.
*
* Rights & License
* All industrial property rights regarding the information - copyright
* and patent rights in particular - are the sole property of XLOG
* Technologies AG. If the company was not the originator of some
* excerpts, XLOG Technologies AG has at least obtained the right to
* reproduce, change and translate the information.
*
* Reproduction is restricted to the whole unaltered document. Reproduction
* of the information is only allowed for non-commercial uses. Selling,
* giving away or letting of the execution of the library is prohibited.
* The library can be distributed as part of your applications and libraries
* for execution provided this comment remains unchanged.
*
* Restrictions
* Only to be distributed with programs that add significant and primary
* functionality to the library. Not to be distributed with additional
* software intended to replace any components of the library.
*
* Trademarks
* Jekejeke is a registered trademark of XLOG Technologies AG.
*/
:- ensure_loaded(library(misc/markup)).
/*******************************************************************/
/* Output Clear */
/*******************************************************************/
/**
* clear:
* The predicate clears the content of the cursor.
*/
% clear
clear :-
dom_cell_current(Elem),
dom_cell_clear(Elem).
/**
* goto(I):
* The predicate changes the cursor to the element with id I.
*/
% goto(+Atom)
goto(Id) :-
dom_cell_goto(Id, Elem),
dom_cell_set(Elem).
/*******************************************************************/
/* Event Bind */
/*******************************************************************/
/**
* bind(T, P, G):
* bind(C, T, P, G):
* The predicate succeeds. As a side effect it adds a type T stackless
* event handler with formal event parameter P and callback goal G
* to the cursor. The quaternary predicate allows specifiying an element.
*/
% bind(+Atom, +Term, +Goal)
bind(Type, Para, Goal) :-
dom_cell_current(Elem),
bind(Elem, Type, Para, Goal).
% bind(+Element, +Atom, +Term, +Goal)
bind(Elem, Type, Para, Goal) :-
sys_frost_horn((''(Para) :- Goal), Native),
dom_cell_listen(Elem, Type, Native, 0rFalse).
/**
* bind_capture(T, P, G):
* bind_capture(C, T, P, G):
* The predicate succeeds. As a side effect it adds a type T stackless
* event handler with formal event parameter P and callback goal G
* to the cursor. The quaternary predicate allows specifiying an element.
*/
% bind_capture(+Atom, +Term, +Goal)
bind_capture(Type, Para, Goal) :-
dom_cell_current(Elem),
bind_capture(Elem, Type, Para, Goal).
% bind_capture(+Element, +Atom, +Term, +Goal)
bind_capture(Elem, Type, Para, Goal) :-
sys_frost_horn((''(Para) :- Goal), Native),
dom_cell_listen(Elem, Type, Native, 0rTrue).
/*******************************************************************/
/* Foreign Predicates */
/*******************************************************************/
% dom_cell_clear(E):
% defined in foreign(misc/emitlib)
% dom_cell_goto(I, E):
% defined in foreign(misc/emitlib)
% dom_cell_listen(E, T, N, F):
% defined in foreign(misc/emitlib)
% dom_prevent_default(E):
% defined in foreign(misc/emitlib)
% dom_stop_propagation(E):
% defined in foreign(misc/emitlib)
% ir_float_current(K, O, V):
% defined in foreign(misc/emitlib)
% ir_float_set(K, O, V):
% defined in foreign(misc/emitlib)
:- ensure_loaded(foreign(misc/emitlib)).