Outdated egg!

This is an egg for CHICKEN 3, the unsupported old release. You're almost certainly looking for the CHICKEN 4 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

japi

  1. Outdated egg!
  2. japi
    1. Description
    2. Author
    3. Requirements
    4. Download
    5. Documentation
    6. Examples
    7. Changelog

Description

A set of bindings for the JAPI GUI toolkit.

Author

felix winkelmann

Requirements

None

Download

japi.egg

Documentation

The following constants and procedures are available:

[constant] j/left
[constant] j/center
[constant] j/right
[constant] j/top
[constant] j/bottom
[constant] j/topleft
[constant] j/topright
[constant] j/bottomleft
[constant] j/bottomright
[constant] j/default-cursor
[constant] j/crosshair-cursor
[constant] j/text-cursor
[constant] j/wait-cursor
[constant] j/sw-resize-cursor
[constant] j/se-resize-cursor
[constant] j/nw-resize-cursor
[constant] j/ne-resize-cursor
[constant] j/n-resize-cursor
[constant] j/s-resize-cursor
[constant] j/w-resize-cursor
[constant] j/e-resize-cursor
[constant] j/hand-cursor
[constant] j/move-cursor
[constant] j/horizontal
[constant] j/vertical
[constant] j/plain
[constant] j/bold
[constant] j/italic
[constant] j/courier
[constant] j/helvetia
[constant] j/times
[constant] j/dialogin
[constant] j/dialogout
[constant] j/black
[constant] j/white
[constant] j/red
[constant] j/green
[constant] j/blue
[constant] j/cyan
[constant] j/magenta
[constant] j/yellow
[constant] j/orange
[constant] j/green-yellow
[constant] j/green-cyan
[constant] j/blue-cyan
[constant] j/blue-magenta
[constant] j/red-magenta
[constant] j/dark-gray
[constant] j/light-gray
[constant] j/gray
[constant] j/none
[constant] j/linedown
[constant] j/lineup
[constant] j/areadown
[constant] j/areaup
[constant] j/moved
[constant] j/dragged
[constant] j/pressed
[constant] j/released
[constant] j/entered
[constant] j/exited
[constant] j/doubleclick
[constant] j/resized
[constant] j/hidden
[constant] j/shown
[constant] j/activated
[constant] j/deactivated
[constant] j/opened
[constant] j/closed
[constant] j/iconified
[constant] j/deiconified
[constant] j/closing
[constant] j/gif
[constant] j/jpg
[constant] j/ppm
[constant] j/bmp
[constant] j/round
[constant] j/rect
[constant] j/randmax

Variables containing JAPI constants.

[procedure] (j:connect STRING) -> INT
[procedure] (j:setport INT)
[procedure] (j:setdebug INT)
[procedure] (j:frame STRING) -> INT
[procedure] (j:button INT STRING) -> INT
[procedure] (j:graphicbutton INT STRING) -> INT
[procedure] (j:checkbox INT STRING) -> INT
[procedure] (j:label INT STRING) -> INT
[procedure] (j:graphiclabel INT STRING) -> INT
[procedure] (j:canvas INT INT INT) -> INT
[procedure] (j:panel INT) -> INT
[procedure] (j:borderpanel INT INT) -> INT
[procedure] (j:radiogroup INT) -> INT
[procedure] (j:radiobutton INT STRING) -> INT
[procedure] (j:list INT INT) -> INT
[procedure] (j:choice INT) -> INT
[procedure] (j:dialog INT STRING) -> INT
[procedure] (j:window INT) -> INT
[procedure] (j:popupmenu INT STRING) -> INT
[procedure] (j:scrollpane INT) -> INT
[procedure] (j:hscrollbar INT) -> INT
[procedure] (j:vscrollbar INT) -> INT
[procedure] (j:line INT INT INT INT) -> INT
[procedure] (j:printer INT) -> INT
[procedure] (j:image INT INT) -> INT
[procedure] (j:filedialog INT STRING STRING STRING) -> STRING
[procedure] (j:fileselect INT STRING STRING STRING) -> STRING
[procedure] (j:messagebox INT STRING STRING) -> INT
[procedure] (j:alertbox INT STRING STRING STRING) -> INT
[procedure] (j:progressbar INT INT) -> INT
[procedure] (j:led INT INT INT) -> INT
[procedure] (j:sevensegment INT INT) -> INT
[procedure] (j:meter INT STRING) -> INT
[procedure] (j:additem INT STRING)
[procedure] (j:textfield INT INT) -> INT
[procedure] (j:textarea INT INT INT) -> INT
[procedure] (j:menubar INT) -> INT
[procedure] (j:menu INT STRING) -> INT
[procedure] (j:helpmenu INT STRING) -> INT
[procedure] (j:menuitem INT STRING) -> INT
[procedure] (j:checkmenuitem INT STRING) -> INT
[procedure] (j:pack INT)
[procedure] (j:print INT)
[procedure] (j:playsoundfile STRING)
[procedure] (j:play INT)
[procedure] (j:sound STRING) -> INT
[procedure] (j:setfont INT INT INT INT)
[procedure] (j:setfontname INT INT)
[procedure] (j:setfontsize INT INT)
[procedure] (j:setfontstyle INT INT)
[procedure] (j:seperator INT)
[procedure] (j:disable INT)
[procedure] (j:enable INT)
[procedure] (j:getstate INT) -> bool
[procedure] (j:getrows INT) -> INT
[procedure] (j:getcolumns INT) -> INT
[procedure] (j:getselect INT) -> INT
[procedure] (j:isselect INT INT) -> bool
[procedure] (j:isvisible INT) -> bool
[procedure] (j:isparent INT INT) -> bool
[procedure] (j:isresizable INT) -> bool
[procedure] (j:select INT INT)
[procedure] (j:deselect INT INT)
[procedure] (j:multiplemode INT bool)
[procedure] (j:insert INT INT STRING)
[procedure] (j:remove INT INT)
[procedure] (j:removeitem INT STRING)
[procedure] (j:removeall INT)
[procedure] (j:setstate INT bool)
[procedure] (j:setrows INT INT)
[procedure] (j:setcolumns INT INT)
[procedure] (j:seticon INT INT)
[procedure] (j:setimage INT INT)
[procedure] (j:setvalue INT INT)
[procedure] (j:setradiogroup INT INT)
[procedure] (j:setunitinc INT INT)
[procedure] (j:setblockinc INT INT)
[procedure] (j:setmin INT INT)
[procedure] (j:setmax INT INT)
[procedure] (j:setdanger INT INT)
[procedure] (j:setslidesize INT INT)
[procedure] (j:setcursor INT INT)
[procedure] (j:setresizable INT bool)
[procedure] (j:getlength INT) -> INT
[procedure] (j:getvalue INT) -> INT
[procedure] (j:getdanger INT) -> INT
[procedure] (j:getheight INT) -> INT
[procedure] (j:getwidth INT) -> INT
[procedure] (j:getinsets INT INT) -> INT
[procedure] (j:getlayoutid INT) -> INT
[procedure] (j:getinheight INT) -> INT
[procedure] (j:getinwidth INT) -> INT
[procedure] (j:gettext INT STRING) -> STRING
[procedure] (j:getitem INT INT) -> STRING
[procedure] (j:getitemcount INT) -> INT
[procedure] (j:delete INT INT INT)
[procedure] (j:replacetext INT STRING INT INT)
[procedure] (j:appendtext INT STRING)
[procedure] (j:inserttext INT STRING INT)
[procedure] (j:settext INT STRING)
[procedure] (j:selectall INT)
[procedure] (j:selecttext INT INT INT)
[procedure] (j:getselstart INT) -> INT
[procedure] (j:getselend INT) -> INT
[procedure] (j:getseltext INT) -> STRING
[procedure] (j:getcurpos INT) -> INT
[procedure] (j:setcurpos INT INT)
[procedure] (j:setechochar INT char)
[procedure] (j:seteditable INT bool)
[procedure] (j:setshortcut INT char)
[procedure] (j:setsize INT INT INT)
[procedure] (j:show INT)
[procedure] (j:showpopup INT INT INT)
[procedure] (j:add INT INT)
[procedure] (j:release INT)
[procedure] (j:releaseall INT)
[procedure] (j:hide INT)
[procedure] (j:dispose INT)
[procedure] (j:setpos INT INT INT)
[procedure] (j:getviewportheight INT) -> INT
[procedure] (j:getviewportwidth INT) -> INT
[procedure] (j:getxpos INT) -> INT
[procedure] (j:getypos INT) -> INT
[procedure] (j:getparentid INT) -> INT
[procedure] (j:setfocus INT)
[procedure] (j:hasfocus INT) -> bool
[procedure] (j:getstringwidth INT STRING) -> INT
[procedure] (j:getfontheight INT) -> INT
[procedure] (j:getfontascent INT) -> INT
[procedure] (j:keylistener INT) -> INT
[procedure] (j:getkeycode INT) -> INT
[procedure] (j:getkeychar INT) -> INT
[procedure] (j:mouselistener INT INT) -> INT
[procedure] (j:getmousex INT) -> INT
[procedure] (j:getmousey INT) -> INT
[procedure] (j:getmousebutton INT) -> INT
[procedure] (j:focuslistener INT) -> INT
[procedure] (j:componentlistener INT INT) -> INT
[procedure] (j:windowlistener INT INT) -> INT
[procedure] (j:setflowlayout INT INT)
[procedure] (j:setborderlayout INT)
[procedure] (j:setgridlayout INT INT INT)
[procedure] (j:setfixlayout INT)
[procedure] (j:setnolayout INT)
[procedure] (j:setborderpos INT INT)
[procedure] (j:sethgap INT INT)
[procedure] (j:setvgap INT INT)
[procedure] (j:setinsets INT INT INT INT INT)
[procedure] (j:setalign INT INT)
[procedure] (j:setflowfill INT bool)
[procedure] (j:translate INT INT INT)
[procedure] (j:cliprect INT INT INT INT INT)
[procedure] (j:drawrect INT INT INT INT INT)
[procedure] (j:fillrect INT INT INT INT INT)
[procedure] (j:drawroundrect INT INT INT INT INT INT INT)
[procedure] (j:fillroundrect INT INT INT INT INT INT INT)
[procedure] (j:drawoval INT INT INT INT INT)
[procedure] (j:filloval INT INT INT INT INT)
[procedure] (j:drawcircle INT INT INT INT)
[procedure] (j:fillcircle INT INT INT INT)
[procedure] (j:drawarc INT INT INT INT INT INT INT)
[procedure] (j:fillarc INT INT INT INT INT INT INT)
[procedure] (j:drawline INT INT INT INT INT)
[procedure] (j:drawpolyline INT INT VECTOR VECTOR)
[procedure] (j:drawpolygon INT INT VECTOR VECTOR)
[procedure] (j:fillpolygon INT INT VECTOR VECTOR)
[procedure] (j:drawpixel INT INT INT)
[procedure] (j:drawstring INT INT INT STRING)
[procedure] (j:setxor INT bool)
[procedure] (j:getimage INT) -> INT
[procedure] (j:getimagesource INT INT INT INT INT VECTOR VECTOR VECTOR)
[procedure] (j:drawimagesource INT INT INT INT INT VECTOR VECTOR VECTOR)
[procedure] (j:getscaledimage INT INT INT INT INT INT INT) -> INT
[procedure] (j:drawimage INT INT INT INT)
[procedure] (j:drawscaledimage INT INT INT INT INT INT INT INT INT INT)
[procedure] (j:setcolor INT INT INT INT)
[procedure] (j:setcolorbg INT INT INT INT)
[procedure] (j:setnamedcolor INT INT)
[procedure] (j:setnamedcolorbg INT INT)
[procedure] (j:loadimage STRING) -> INT
[procedure] (j:saveimage INT STRING INT) -> INT
[procedure] (j:sync)
[procedure] (j:beep)
[procedure] (j:random) -> INTEGER
[procedure] (j:sleep INT)

Calls the associated JAPI function. Integer-arrays are passed as vectors of exact numbers.

Examples

(require 'japi)

; The canonical example
(j:start)
(define f (j:frame "Hello, world!"))
(j:show f)
(read-line)
(j:quit)
(require 'japi)

; The "vumeter" example in Scheme
(require 'japi)

(j:setdebug 2)
(define value 50)

(unless (j:start)
  (error "can't connect to server") )

(define frame (j:frame "Meter"))
(j:setborderlayout frame)
(j:setinsets frame (+ (j:getinsets frame j/top) 10) 10 10 10)
(j:setvgap frame 10)
(define progress (j:progressbar frame j/horizontal))
(j:setborderpos progress j/bottom)
(define meter (j:meter frame "Volt"))
(j:setsize frame 150 170)
(j:show frame)
(j:setmin meter -100)
(j:setmax meter 200)
(j:setdanger meter 100)

(do ()
    ((eq? frame (j:getaction)))
  (set! value (sub1 value))
  (when (< (j:random) (/ j/randmax 2))
    (set! value (+ value 2)) )
  (j:setvalue meter value)
  (j:setvalue progress value)
  (j:sync)
  (j:sleep 50) )

(j:quit)

Changelog