Docs: ui and compiler
							parent
							
								
									a6f159eb17
								
							
						
					
					
						commit
						d5cb972a71
					
				| 
						 | 
					@ -9,10 +9,6 @@ HELP: ##alien-invoke
 | 
				
			||||||
{ $class-description
 | 
					{ $class-description
 | 
				
			||||||
  "An instruction for calling a function in a dynamically linked library. It has the following slots:"
 | 
					  "An instruction for calling a function in a dynamically linked library. It has the following slots:"
 | 
				
			||||||
  { $table
 | 
					  { $table
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        { $slot "gc-map" }
 | 
					 | 
				
			||||||
        { "If the invoked c-function calls Factor code which triggers a gc, then a " { $link gc-map } " might be necessary." }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        { $slot "reg-inputs" }
 | 
					        { $slot "reg-inputs" }
 | 
				
			||||||
        { "Registers to use for the arguments to the function call. Each sequence item is a 3-tuple consisting of a " { $link spill-slot } ", register representation and a register." }
 | 
					        { "Registers to use for the arguments to the function call. Each sequence item is a 3-tuple consisting of a " { $link spill-slot } ", register representation and a register." }
 | 
				
			||||||
| 
						 | 
					@ -25,10 +21,14 @@ HELP: ##alien-invoke
 | 
				
			||||||
        { $slot "reg-outputs" }
 | 
					        { $slot "reg-outputs" }
 | 
				
			||||||
        { "If the called function returns a value, then this slot is a one-element sequence containing a 3-tuple describing which register is used for the return value." }
 | 
					        { "If the called function returns a value, then this slot is a one-element sequence containing a 3-tuple describing which register is used for the return value." }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        { $slot "gc-map" }
 | 
				
			||||||
 | 
					        { "If the invoked C function calls Factor code which triggers a GC, then a " { $link gc-map } " is necessary to find the roots." }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    { { $slot "symbols" } { "Name of the function to call." } }
 | 
					    { { $slot "symbols" } { "Name of the function to call." } }
 | 
				
			||||||
    { { $slot "dll" } { "A dll handle." } }
 | 
					    { { $slot "dll" } { "A dll handle or " { $link f } "." } }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  "Which function arguments that goes in " { $slot "reg-inputs" } " and which goes in " { $slot "stack-inputs" } " depend on the calling convention. In " { $link cdecl } " on " { $link x86.32 } ", all arguments goes in " { $slot "stack-inputs" } " but on " { $link x86.64 } " the first six arguments are passed in registers and only then is the stack used."
 | 
					  "Which function arguments that goes in " { $slot "reg-inputs" } " and which goes in " { $slot "stack-inputs" } " depend on the calling convention. In " { $link cdecl } " on " { $link x86.32 } ", all arguments goes in " { $slot "stack-inputs" } ", in " { $link x86.64 } " the first six arguments are passed in registers and then stack parameters are used for the remainder."
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
{ $see-also %alien-invoke } ;
 | 
					{ $see-also %alien-invoke } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,6 +43,11 @@ HELP: ##allot
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
} ;
 | 
					} ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					HELP: ##box
 | 
				
			||||||
 | 
					{ $class-description
 | 
				
			||||||
 | 
					  "This instruction boxes a value into a tagged pointer."
 | 
				
			||||||
 | 
					} { $see-also %box } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HELP: ##box-alien
 | 
					HELP: ##box-alien
 | 
				
			||||||
{ $class-description
 | 
					{ $class-description
 | 
				
			||||||
  "An instruction for boxing an alien value."
 | 
					  "An instruction for boxing an alien value."
 | 
				
			||||||
| 
						 | 
					@ -220,10 +225,9 @@ HELP: ##set-slot-imm
 | 
				
			||||||
    { { $slot "slot" } { "Slot index." } }
 | 
					    { { $slot "slot" } { "Slot index." } }
 | 
				
			||||||
    { { $slot "tag" } { "Type tag for obj." } }
 | 
					    { { $slot "tag" } { "Type tag for obj." } }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
} ;
 | 
					}
 | 
				
			||||||
 | 
					{ $see-also ##set-slot %set-slot-imm } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{ ##set-slot %set-slot } related-words
 | 
					 | 
				
			||||||
{ ##set-slot-imm %set-slot-imm } related-words
 | 
					 | 
				
			||||||
{ ##set-slot-imm ##set-slot } related-words
 | 
					{ ##set-slot-imm ##set-slot } related-words
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HELP: ##single>double-float
 | 
					HELP: ##single>double-float
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,6 +2,10 @@ USING: accessors concurrency.flags help.markup help.syntax kernel
 | 
				
			||||||
math.rectangles models strings ui.gadgets.private ;
 | 
					math.rectangles models strings ui.gadgets.private ;
 | 
				
			||||||
IN: ui.gadgets
 | 
					IN: ui.gadgets
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					HELP: <gadget>
 | 
				
			||||||
 | 
					{ $values { "gadget" "a new " { $link gadget } } }
 | 
				
			||||||
 | 
					{ $description "Creates a new gadget." } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HELP: control-value
 | 
					HELP: control-value
 | 
				
			||||||
{ $values { "control" gadget } { "value" object } }
 | 
					{ $values { "control" gadget } { "value" object } }
 | 
				
			||||||
{ $description "Outputs the value of the control's model." } ;
 | 
					{ $description "Outputs the value of the control's model." } ;
 | 
				
			||||||
| 
						 | 
					@ -10,15 +14,16 @@ HELP: gadget-child
 | 
				
			||||||
{ $values { "gadget" gadget } { "child" gadget } }
 | 
					{ $values { "gadget" gadget } { "child" gadget } }
 | 
				
			||||||
{ $description "Outputs the first child of the gadget. Typically this word is used with gadgets which are known to have an only child." } ;
 | 
					{ $description "Outputs the first child of the gadget. Typically this word is used with gadgets which are known to have an only child." } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					HELP: notify
 | 
				
			||||||
 | 
					{ $values { "gadget" gadget } }
 | 
				
			||||||
 | 
					{ $description "Notifies the gadget that it has a graft message to handle." }
 | 
				
			||||||
 | 
					{ $see-also graft* ungraft* } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HELP: nth-gadget
 | 
					HELP: nth-gadget
 | 
				
			||||||
{ $values { "n" "a non-negative integer" } { "gadget" gadget } { "child" gadget } }
 | 
					{ $values { "n" "a non-negative integer" } { "gadget" gadget } { "child" gadget } }
 | 
				
			||||||
{ $description "Outputs the " { $snippet "n" } "th child of the gadget." }
 | 
					{ $description "Outputs the " { $snippet "n" } "th child of the gadget." }
 | 
				
			||||||
{ $errors "Throws an error if " { $snippet "n" } " is negative or greater than or equal to the number of children." } ;
 | 
					{ $errors "Throws an error if " { $snippet "n" } " is negative or greater than or equal to the number of children." } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HELP: <gadget>
 | 
					 | 
				
			||||||
{ $values { "gadget" "a new " { $link gadget } } }
 | 
					 | 
				
			||||||
{ $description "Creates a new gadget." } ;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
HELP: relative-loc
 | 
					HELP: relative-loc
 | 
				
			||||||
{ $values { "fromgadget" gadget } { "togadget" gadget } { "loc" "a pair of integers" } }
 | 
					{ $values { "fromgadget" gadget } { "togadget" gadget } { "loc" "a pair of integers" } }
 | 
				
			||||||
{ $description
 | 
					{ $description
 | 
				
			||||||
| 
						 | 
					@ -145,10 +150,6 @@ HELP: add-gadgets
 | 
				
			||||||
{ $notes "This may result in " { $link graft* } " being called on the children, if the parent is visible on the screen." }
 | 
					{ $notes "This may result in " { $link graft* } " being called on the children, if the parent is visible on the screen." }
 | 
				
			||||||
{ $side-effects "parent" } ;
 | 
					{ $side-effects "parent" } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HELP: parents
 | 
					 | 
				
			||||||
{ $values { "gadget" gadget } { "seq" "a sequence of gadgets" } }
 | 
					 | 
				
			||||||
{ $description "Outputs a sequence of all parents of the gadget, with the first element being the gadget itself." } ;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
HELP: child?
 | 
					HELP: child?
 | 
				
			||||||
{ $values { "parent" gadget } { "child" gadget } { "?" boolean } }
 | 
					{ $values { "parent" gadget } { "child" gadget } { "?" boolean } }
 | 
				
			||||||
{ $description "Tests if " { $snippet "child" } " is contained inside " { $snippet "parent" } "." } ;
 | 
					{ $description "Tests if " { $snippet "child" } " is contained inside " { $snippet "parent" } "." } ;
 | 
				
			||||||
| 
						 | 
					@ -176,6 +177,10 @@ HELP: layout-later
 | 
				
			||||||
{ $values { "gadget" gadget } }
 | 
					{ $values { "gadget" gadget } }
 | 
				
			||||||
{ $description "Adds the gadget to the " { $link layout-queue } " and notifies the UI thread that there is a gadget to layout. If the length of the queue is larger than " { $link layout-queue-limit } ", then the current thread is yielded so that the UI thread has a chance to run." } ;
 | 
					{ $description "Adds the gadget to the " { $link layout-queue } " and notifies the UI thread that there is a gadget to layout. If the length of the queue is larger than " { $link layout-queue-limit } ", then the current thread is yielded so that the UI thread has a chance to run." } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					HELP: parents
 | 
				
			||||||
 | 
					{ $values { "gadget" gadget } { "seq" "a sequence of gadgets" } }
 | 
				
			||||||
 | 
					{ $description "Outputs a sequence of all parents of the gadget, with the first element being the gadget itself." } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HELP: screen-loc
 | 
					HELP: screen-loc
 | 
				
			||||||
{ $values { "gadget" gadget } { "loc" "a pair of integers" } }
 | 
					{ $values { "gadget" gadget } { "loc" "a pair of integers" } }
 | 
				
			||||||
{ $description "Outputs the location of the gadget relative to the top-left corner of the world containing the gadget. This word does not output a useful value if the gadget is not grafted." } ;
 | 
					{ $description "Outputs the location of the gadget relative to the top-left corner of the world containing the gadget. This word does not output a useful value if the gadget is not grafted." } ;
 | 
				
			||||||
| 
						 | 
					@ -184,6 +189,10 @@ HELP: set-control-value
 | 
				
			||||||
{ $values { "value" object } { "control" gadget } }
 | 
					{ $values { "value" object } { "control" gadget } }
 | 
				
			||||||
{ $description "Sets the value of the control's model." } ;
 | 
					{ $description "Sets the value of the control's model." } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					HELP: unqueue-graft
 | 
				
			||||||
 | 
					{ $values { "gadget" gadget } }
 | 
				
			||||||
 | 
					{ $description "Removes the gadget from the " { $link graft-queue } "." } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HELP: ui-notify-flag
 | 
					HELP: ui-notify-flag
 | 
				
			||||||
{ $var-description "A " { $link flag } " raised to notify the UI thread that there is work to do." }
 | 
					{ $var-description "A " { $link flag } " raised to notify the UI thread that there is work to do." }
 | 
				
			||||||
{ $see-also notify-ui-thread } ;
 | 
					{ $see-also notify-ui-thread } ;
 | 
				
			||||||
| 
						 | 
					@ -196,4 +205,11 @@ $nl
 | 
				
			||||||
    control-value
 | 
					    control-value
 | 
				
			||||||
    set-control-value
 | 
					    set-control-value
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					"Graft handling:"
 | 
				
			||||||
 | 
					{ $subsections
 | 
				
			||||||
 | 
					  graft
 | 
				
			||||||
 | 
					  notify
 | 
				
			||||||
 | 
					  ungraft
 | 
				
			||||||
 | 
					  unqueue-graft
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
{ $see-also "models" } ;
 | 
					{ $see-also "models" } ;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,14 @@ ui.gadgets.panes.private ;
 | 
				
			||||||
IN: ui.gadgets.panes
 | 
					IN: ui.gadgets.panes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HELP: pane
 | 
					HELP: pane
 | 
				
			||||||
{ $class-description "A pane " { $link gadget } " displays formatted text which is written to a " { $link pane-stream } " targetting the pane. Panes are created by calling " { $link <pane> } " or " { $link <pane-control> } "." } ;
 | 
					{ $class-description "A pane " { $link gadget } " displays formatted text which is written to a " { $link pane-stream } " targetting the pane. Panes are created by calling " { $link <pane> } " or " { $link <pane-control> } ". Panes have the following slots"
 | 
				
			||||||
 | 
					  { $table
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        { $slot "input" }
 | 
				
			||||||
 | 
					        { "A gadget that receives input events and writes to the pane's input stream." }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					} ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HELP: <pane>
 | 
					HELP: <pane>
 | 
				
			||||||
{ $values { "pane" "a new " { $link pane } } }
 | 
					{ $values { "pane" "a new " { $link pane } } }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue