COMDRAW(1)

πŸ“¦
version 2.1.1+git.2025.07.26.a1 Β· 2 versions
, in ubuntu stonking

πŸ‘‘ comdraw β€” NAME πŸ’…

comdraw β€” bestie it's a drawtool with a distributed command interpreter ✨


πŸ¦‹ SYNOPSIS

comdraw [-port n] [-import n] ['X-params'] [file]

πŸŽ€ DESCRIPTION

okay so listen. comdraw is a drawing editor with a whole command interpreter built right into it, and you get to talk to it through stdin and stdout β€” or over telnet if ACE is built in. it's giving "I contain a whole language and also I draw" 🌸

The command syntax is a semi-colon separated list of commands, each with an arbitrary number of parameters wrapped in parentheses, and yes it supports optional parameters and keyword arguments, like literally:

command1(arg1 arg2 arg3 :key1 val1 :key2 val2);
command2(arg1 arg2 arg3 :key1 val1 :key2 val2)

All the literals and operators of C are supported πŸ’― β€” except for the syntax of the conditional operator "?:". no ?: for you, bestie, sorry 😭. peep the comterp documentation for more details.

fr fr: every argument to the commands below is an integer unless it's got a suffix. str means strings embedded in quotes, flt means conventional floating point numbers. and "compview" is a graphical object assigned to an interpreter variable 🫢.


✨ DRAWING COMMANDS ✨

create-the-things hours πŸ’–

  • compview=rect(x0,y0,x1,y1) β€” create a rectangle
  • compview=rectangle(x0,y0,x1,y1) β€” same as rect (twin behavior, different name, iconic)
  • compview=line(x0,y0,x1,y1) β€” create a line
  • compview=arrowline(x0,y0,x1,y1) β€” create a line with arrows
  • compview=ellipse(x0,y0,r1,r2) β€” create an ellipse
  • compview=text(x0,y0 textstr) β€” create a text string
  • compview=multiline(x0,y0[,x1,y1,...]) β€” create a multiline
  • compview=arrowmultiline(x0,y0[,x1,y1,...]) β€” create a multiline with arrows
  • compview=openspline(x0,y0[,x1,y1,...]) β€” create an open spline
  • compview=arrowspline(x0,y0[,x1,y1,...]) β€” create an open spline with arrows
  • compview=polygon(x0,y0[,x1,y1,...]) β€” create a polygon
  • compview=closedspline(x0,y0[,x1,y1,...]) β€” create a closed spline
  • compview=raster(x0,y0,x1,y1) β€” create an empty raster

πŸ’œ GRAPHIC STATS COMMANDS πŸ’œ

math but make it glam πŸ“

  • xylist=center(compview :xy :yx :x :y :scrn) β€” the center of compview (dflt :xy)
  • rectlist=mbr(compview :lbrt :lrbt :scrn) β€” the minimum bounding rectangle of compview (dflt :lbrt)
  • ptlist=points(compview :raw) β€” hand over the point list from a compview graphic

🌸 GRAPHIC STATE COMMANDS 🌸

setting the current vibe of your drawing tools πŸ’…

  • font(fontnum) β€” set the current font from the menu
  • brush(brushnum) β€” set the current brush from the menu
  • pattern(patternnum) β€” set the current pattern from the menu
  • patternmask(int|list) β€” set the current pattern from a 16 bit int (4x4) or a list of 16 ints (16x16)
  • colors(fgcolornum bgcolornum) β€” set the current colors from the menu
  • colorsrgb(fgcolornum bgcolornum) β€” set the current colors by RGB name. the colorname format is "#RGB" for 4 bits, "#RRGGBB" for 8 bits, #RRRGGGBBB for 12 bits, and #RRRRGGGGBBBB for 16 bits ✨
  • nfonts() β€” return the size of the font menu
  • nbrushes() β€” return the size of the brush menu
  • npatterns() β€” return the size of the pattern menu
  • ncolors() β€” return the size of the color menus

πŸ”₯ DIRECT MANIPULATION COMMANDS πŸ”₯

moving your stuff around, main character energy only

  • select([compview ...] :all :clear) β€” make these graphics the current selection
  • delete(compview [compview ...]) β€” delete graphic(s)
  • move(dx dy) β€” move the current selection
  • scale(xflt yflt) β€” scale the current selection
  • rotate(degflt) β€” rotate the current selection
  • fliph() β€” horizontally flip the current selection
  • flipv() β€” vertically flip the current selection

🧚 GROUP/UNGROUP COMMANDS 🧚

  • newgroup=growgroup(groupview compview) β€” add a graphic to an existing group graphic
  • newgroup=trimgroup(groupview compview) β€” remove a graphic from an existing group graphic

πŸ’– COMPONENT AND ATTRIBUTE COMMANDS πŸ’–

  • compview=setattr(compview [:keyword value [:keyword value [...]]]) β€” set attributes of a graphic component
  • attrlist(compview) β€” return the attribute list of a component
  • compview=frame([index]) β€” return the composite component for a frame, defaults to the current one
  • val=at(list|attrlist|compview n :set val :ins val) β€” return (or set, or insert after) the nth item in a list
  • num=size(list|attrlist|compview) β€” return the size of a list
  • compview=parent(compview) β€” get the parent of a graphic
  • comp=depth(comps) β€” depth-first walk of a comp tree 🌳

🌈 VIEWER COMMANDS 🌈

this section is LONG bestie, hydrate πŸ’§

  • update([usec]) β€” update the viewer, with an optional delay
  • error=save([pathstr]) β€” the command to save the document (to a pathname)
  • compview=import(pathstr :popen :next) β€” import a graphic file from a pathname or URL, or from a command if :popen. (:next imports the next one in the numeric series)
  • export(compview[,compview[,...compview]] [path] :host str :port int :socket :string|:str :eps :idraw) β€” export remotely in drawtool (or other) format
  • compview=paste(compview [xscl yscl xoff yoff | a00,a01,a10,a11,a20,a21]) β€” paste a graphic into the viewer
  • val=pastemode([val] :get) β€” toggle or set paste mode. default is 0, which always pastes new graphics
  • compview=readonly(compview :clear) β€” set or clear the read-only attribute of a graphic component
  • ncols() β€” onscreen horizontal extent in pixels
  • nrows() β€” onscreen vertical extent in pixels
  • dx,dy=stod(sx,sy) β€” convert from screen to drawing coordinates
  • sx,sy=dtos(dx,dy) β€” convert from drawing to screen coordinates
  • dx,dy=gtod(compview gx,gy) β€” convert from graphic to drawing coordinates
  • gx,gy=dtog(compview dx,dy) β€” convert from drawing to graphic coordinates
  • sx,sy=ssize() β€” size of the screen
  • dx,dy=dsize() β€” size of the drawing
  • handles([flag]) β€” disable/enable the current selection tic marks and/or highlighting
  • highlight(compview compviewgs) β€” set the highlight graphic state for a graphic
  • zoom(zoomflt) β€” zoom by a factor
  • zoomin() β€” zoom in by 2
  • zoomout() β€” zoom out by 2
  • pan(px py) β€” pan the viewer
  • smallpanup() β€” small pan up
  • smallpandown() β€” small pan down
  • smallpanleft() β€” small pan left
  • smallpanright() β€” small pan right
  • largepanup() β€” large pan up
  • largepandown() β€” large pan down
  • largepanleft() β€” large pan left
  • largepanright() β€” large pan right
  • gravity([flag]) β€” set/get the drawing editor gravity
  • gridspacing([xsize ysize]) β€” set/get the drawing editor grid spacing
  • hide(compview) β€” hide a graphic component
  • show(compview) β€” show a graphic component
  • desensitize(compview) β€” desensitize a graphic component
  • sensitize(compview) β€” desensitize a graphic component
ngl, that last one really does say "desensitize" in the original too 😭 not me editorializing, I'm just the messenger bestie. sensitize is listed with the same description. periodt.

πŸ“ IMAGING COMMANDS πŸ“

pixels, pixels, pixels πŸ”₯

  • tilefile(inpath outpath [xsize] [ysiz]) β€” tile a pgm or ppm image file
  • val=peek(compview x y) β€” peek a pixel value into a raster
  • poke(compview x y val) β€” poke a pixel value into a raster
  • pokeline(compview x y vallist) β€” poke a list of values into a raster line
  • pcols(compview) β€” number of columns in a raster
  • pcols(compview) β€” number of rows in a raster
  • pflush(compview) β€” flush pixels poked into a raster
  • pclip(compview x1,y1,x2,y2,x3,y3[,...,xn,yn]|compview) β€” clip a raster with a polygon
  • alpha(compview [alphaval]) β€” set/get alpha transparency
okay yes, pcols appears twice up there and the second one says "rows" πŸ’€ that is genuinely what the page says. I am NOT fixing it. keeping every detail, no cap.

πŸŽ† PLOTTING COMMANDS πŸŽ†

requires plotmtv and pstoedit ⚠️ (heads up, this whole section needs those)

  • barplot([var_str value_float] [...] :title str :xtitle str :ytitle str :valtitle str :newview) β€” display a barplot

⭐ OTHER COMMANDS ⭐

the lil grab-bag section

  • acknowledgebox(msgstr) β€” popup an acknowledge dialog box
  • confirmbox(msgstr) β€” popup a confirmation dialog box, and return 1, 0, or -1 if cancelled
  • run(filename) β€” run commands from a file
  • quit() β€” quit this interpreter
  • exit() β€” exit the entire application
  • pause([msgstr] :usec num) β€” pause script execution until C/R

🌟 OPTIONS 🌟

  • -port n β€” specifies the port number to accept command interpreter connections on
  • -import n β€” specifies the port number to run the import service on. the import service accepts connections over the net and reads drawtool format data
  • -stripped n β€” brings up a comdraw without any menubar, toolbar, panner, slider, or zoomer. it can be controlled via stdin or telnet if built with ACE
  • -rampsize n β€” selects the rampsize used for gray-level image processing
  • -theight n (or "-th n") β€” selects the automatic raster tiling height
  • -twidth n (or "-tw n") β€” selects the automatic raster tiling width
  • -tile β€” enables the automatic raster tiling
also peep the -help message and the drawtool and idraw man pages for further options πŸ‘€

πŸ’œ SEE ALSO πŸ’œ

comterp, drawtool, idraw


🌐 WEB PAGES 🌐

http://www.ivtools.org/ivtools/comdraw.html


aaaand that's the whole thing bestie πŸ’…βœ¨ this whole page lives in the General Commands Manual and it signs off as COMDRAW(1) β€” that's the footer, that's the header, that's just the vibe. so go forth, draw stuff, speak fluent command-interpreter, and slay πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from