⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commands.c

📁 LastWave
💻 C
📖 第 1 页 / 共 4 页
字号:
  "source",C_Source,"{{{*filename1*...*filenameN*} {Source each file *filename1*...*filenameN*.}}}",      "setproc",C_SetProc,"{{{(*name* | -) {{[*&varType1*] *varName1* [<varDef1>]} ... {[*&varTypeN*] *varNameN* [<varDefN>]}} \[\"{{{*usageAction1*} {*helpAction1*}} ... {{*usageActionN*} {*helpActionN*}}}\"] <bodyScript>} \{Defines a new script procedure whose name is *name* (a non evaluated string) and returns it. \If the name is '-' then the created procedure is anonymous (you can create anonymous procedure using the syntax '%{a b}`script`' too). \The variables of the procedure are defined as a list where the type of each variable *&varTypeN* can be specified  along with a default value <varDefN> \if the argument is optional. When no type is specified the '&val' type is used (i.e., evaluation will take place with no apriori on the type of the result). \The last variable can be of the dotted form (e.g., .l) in which \case all the remaining arguments will be affected to this argument. There are 2 cases : if the type '&wordlist' is specified for the dotted \variable, the remaining arguments are not evaluated and the dotted variable \will be a string list made of the argument names. \If no type is specified each remaining argument is evaluated and the so-obtained values are stored in the dotted variable as a '&listv'. \One can specify usage form and a one line help. A simple form is for instance \"{{{<arg1> <arg2>} {The one line help}}}\". \If the procedure admits several 'actions' (as the 'var' C-procedure for instance), a simple form is \for instance \"{{{action1<arg1> <arg2>} {The one line help for action1}} \{{action2 <arg1> <arg2>} {The one line help for action2}}}\".}}}",  "proc",C_Proc,"{\{{undef <name1>  [<name2> ... <nameN>]} {Removes N script procedures from the procedure table. If any variable still \points to the procedure, the procedure becomes 'anonymous', consequently its name name is changed to an anonymous name.}} \{{Old Lastwave command} {Not to be used.}} \{{get <proc_name>} {returns the script procedure or the C-procedure whose name is <proc_name>. The type of the result is '&proc'.}} \{{var <sc_name>} {Gets the variable list of a script command.}} \{{ctable [<tableNameRegexp>='*'] [<packageNameRegexp>='*']} {Gets the listv of all the C-procedure tables that belongs to a \package whose name matches <packageNameRegexp>.}} \{{list [<nameRegexp>='[^_]*'] [<tableNameRegexp>='*'] [<packageNameRegexp>='*'] [-m]} {Gets the listv of all the procedure names which match <nameRegexp> and (in the case of C-commands) which belongs to \a procedure table whose name matches <tableNameRegexp>. If '-m' is on then it looks for a command named <nameRegexp> (exact string). The listv is organized as 2 sublistv, one for script commands and one for C-commands}} \{{clist [<nameRegexp>='[^_]*'] [<tableNameRegexp>='*'] [<packageNameRegexp>='*'] [-m]} {Same as 'list' action but looks for C-commands only.}} \{{slist [<nameRegexp>='[^_]*'] [<tableNameRegexp>='*'] [<packageNameRegexp>='*'] [-m]} {Same as 'list' action but looks for script commands only.}}}",  /*     * CProcs in int_package.c    */      "package",C_Package,"{{{load [<regexp>='*']} {Load the packages whose name matches <regexp>.}} \{{name [<regexp>='*']} {Gets the list of all the package whose name matches <regexp>.}} \{{new <name> <year> <version> <authors> <info>} {Creates a new package named <name> that is copyrighted by <authors> and which was \written in year <year> and whose version number is <version>. <info> is a text decribing the package.}} \{{dir [<directory>]} {Sets/Gets the directory where all the package script files are to be searched. Whenever a package named 'name' \is loaded, the source directory '<directory>/name' will be added \and the script file <directory>/name.pkg is sourced if it exists.}} \{{list [<regexp>='*']} {Gets the listv of all the available packages. Each element of the listv is a listv with the name of the package, a flag indicating whether the corresponding \package is loaded (flag==1) or not (flag==0), the year the package has been written, the version number, a list of authors and a one-line help.}}}",     NULL,NULL,NULL};/************************************************************ *          CProcs related to graphics ***********************************************************//* In window.c */extern void C_Window(char **),C_Msge(char **),C_Setg(char **),C_SetgU(char **),C_GClass(char **),C_GUpdate(char **);/* In color.c */extern void C_Color(char **), C_SetColor(char **),C_ColorMap(char **); /* In window_manager.c */extern void C_Draw(char **),C_Font(char **);/* In macwindow.c or X11window.c */extern void C_System(char **);/* In event.c */extern void C_SetBinding(char **),C_Binding(char **),C_Event(char **);/* In postscript.c.c */extern void C_PS(char **);CProc graphicsTable[] = {    /*   * CProcs in gobject.c    */        "window",C_Window,"{{{list [<regexp>='*'] } {Gets the list of all the windows whose name matches <regexp>}} \{{new [<class> = 'Window'] <name> [list of fields...]} {Creates a window of class <class> named <name> and sends all the [list of fields...] to the 'setg' command.}}}",   "gupdate",C_GUpdate,"{{{start} {When called, it creates a new 'update' table and makes it current (the old current update table will become active as soon as \this new one is closed). Any gobjects whose fields change and who are not explicitely redrawn \are saved in the current 'update' table. The current table is emptied when 'gupdate do' is called. At that time all the gobjects of this table are \redrawn as well as all the gobjects in front of them and the ones in the back (if the background color is invisible). \These commands must be used inside a script command (all the update tables are deleted when terminal is waiting for a command line to be typed \in). Let us note that whenever a 'setgu' command is executed, a 'gupdate start' is executed before changing any field and a 'gupdate do' \is executed at the end of the 'setgu' command. Warning : only gobjects belonging to the same window can be put in an update table.}} \{{do} {Performs the current update. It redraws all the gobjects that needs to be updated since 'gupdate start' was called.}} \{{add <gobjectlist>} {Adds a list of gobjects to the current update table so that these gobjects will be redrawn when 'gupdate do' is called.}}}",  "msge",C_Msge,"{{{*gobjectRegexp* *msge* <arg1>...<argN>} {Sends a message to all the gobjects whose name matches \*gobjectRegexp*. The message is *msge* and <arg1>...<argN> are the arguments to the message. If the message is \unknown it returns '' otherwise it returns a value different from ''.}}}",\  "setg",C_Setg,"{{{[-] *gobjectRegexp* -*field1* [..<val>..] ... -*fieldN* [..<val>..>]} {Sets/Gets the fields *field1*...*fieldN* \of all the gobjects whose name matches *gobjectRegexp*. If no <val> are specified then just one field should be used and its value is returned. \Otherwise, it sets the fields *field1*...*fieldN* with the respective values specified by the <val>s (a single field might need several \<val> to be set). In any case 'setg' returns 0 if the field does not exist. If a field is changed then it can return either 1 or -1.  \If it returns 1, it means that the object should be redrawn, thus, consequently, the corresponding gobject is stored in the \current update table if any. \If it returns -1, it means that the gobject should not be redrawn and thus it it is not stored in the current update table. \In any case, if one wants to keep lastwave from storing the gobject in the current update table (i.e., from redrawing it later), \one must \insert a '-' before the object name. Let us note that one can send \messages to the sons of any gobject that matches *gobjectRegexp* on the same command line by inserting in the command line the string \'-*gobjectRegexp*' followed by a regular 'setg' list of argument. For instance, if you want to set the background color \of any gobject inside the window 'win' to black and at the same time change the foreground color of the object 'win.view' to red, you would type \\"setg win -..* -bg 'black' -.view -fg 'red'\"}}}",    "setgu",C_SetgU,"{{{*gobjectRegexp* -*field1* [..<val>..] ... -*fieldN* [..<val>..>]} {Same as the 'setg' command but it updates the display of the corresponding gobjects. \It is basically equivalent to perform successively : 1- 'gupdate start' \2- a 'setg' and 3- a 'gupdate do'. Thus any gobject which has changed will be redrawn.}}}",   "gclass",C_GClass,"{{{father <class> [<fatherClass>]} {Gets the name of the father class of the class <class> if <fatherClass> is not specified. \Otherwise it tests whether <class> inherits from <fatherClass> and returns 1 (if it is) or 0 (if not)}} \{{type <class>} {Gets the eventual variable type associated to the class 'class' (returns it or returns '').}} \{{objlist (<class> | '*') *objlist*} {Gets a listv of the complete names of all the gobjects of class <class> (or of any class \if '*' is used) which matches the pattern *objlist*.}} \{{package <class>} {Gets the package name the class is defined in.}} \{{help <class> (setg | msge)} {Gets the help listv on the 'setg' or 'msge' class procedure. It is a listv made of several listv (one for each field or each message) with 2 elements :\ a usage and a one-line help.}} \{{list [<nameRegexp>='*'] [<packageNameRegexp>='*'] [<&type>]} {Gets all the names of gclasses which name matches the <nameRegexp>, who belongs to \a package whose name matches <packageNameRegexp> and who can display the content of <&type> variables (or of any type if <&type> is not specified).}} \{{new *name* *fatherClass* (<setSCommand> | null) (<messageSCommand> | null) (<drawSCommand> | null) <info> [<isinSCommand>] [-t <&type>] [-lm]} {Creating a new \gclass of name *name* based on the class *fatherClass*.  The arguments are :\n\- <setSCommand> : A procedure that will be used to set/get the fields of the newly defined gobjects. \Its argument must be 'obj field .l' where 'obj' is the gobject name, 'field' is the name of the field (excluding '-', e.g., 'pos' or 'size') \and 'l' is a listv that groups whatever is left. If it is empty, it means that the procedure must return the value of the field (i.e., this corresponds to \a 'get'), otherwise the procedure must set the field using the arguments in 'l'. If the field 'field' is not taken care by the \procedure <setSCommand>, the procedure MUST not return any value. Let us note that in the case of a 'set', it must return either '1' if the gobject \must be added to the current update list or '-1' if not. If the field name starts with '-?' (e.g., '-?bound' for Views or '-?wtrans' for \GraphWtrans), then it means that \this field is a 'read-only' field that can use the arguments in 'l'. Thus, the procedure should just return the field value. \n\- <messageSCommand> : A procedure name that will be used to perform messages sent to the newly defined gobjects. Its argument \must be 'obj msge .l' where 'obj' is the gobject name, 'msge' is the name of the msge and 'l' the listv of all the remaining arguments. \If the message is accepted, the procedure <messageSCommand> should return something (1 for instance)  and it should return nothing if not. \Let us note that there are 3 special messages that \you can redirect : the 'init' message that is sent right after a new gobject of class *name* is created ('l' is empty and this message is first sent \to the gobject as an object of the class 'GObject' and so on to all the classes it inherits from, from top to bottom), \the 'delete' message that is sent right before a gobject of class *name* is deleted, ('l' is empty, and it is sent to the gobject as an object of all \the gclasses it inherits from, from bottom to top) and the 'deleteNotify' message that is sent to a 'GList' (and all the classes that \inherit from GList) whenever one \of its gobject is asked to be deleted, the name of the gobject is 'l' and it must return 1 if it accepts that the object is deleted \or 0 to forbid deletion. \n\- <drawSCommand> : A procedure name that will be used to draw the newly defined gobjects. \Its argument must be 'obj .l' where 'obj' is the gobject name and 'l' is a listv of 4 floats representing the rectangle {x y w h} that \must be redrawn (using local coordinates). The clip rectangle is automatically set to this rectangle before the procedure is called, \thus you should not worry redrawing more than what is asked if it is easier to manage. \n\- <isinSCommand> : An optional procedure name that will be used to check whether the mouse is in one of the newly defined gobjects (if \it is not specified then the mouse will be considered to be in the gobject if it is in the rectangle given by '-pos' and '-size'). \Its argument must be 'obj x y' where 'obj' is the gobject name and 'x' and 'y' the local coordinates of the mouse. \It must return a strictly negative number if the mouse is not in the gobject and otherwise a positive number which quantifies the distance \between the mouse and the gobject. Lastwave always sends mouse events to the 'closest' gobject. If it returns 0, then lastwave will not try \any other gobject and will consider this gobject to be the closest. \n\- <info> : This is just a one-line help to describe what the class is meant for \n\-m : If set then the gobjects of the newly defined class cannot be moved or resized. \n\-l : If set then the system of local coordinate system of the gobjects of the newly defined class will be the same one as the father\\'s system \(this is the case of GraphSignal for instance). \n\-t : If set, the newly defined class is meant to display the content of variables of type <&type>. In that case, the <setSCommand> procedure of the class \should know about the following fields : \'-graph <value>' to load the value <value> of type <&type> into the gobject,  \'-cgraph <value>' same as '-graph' but copies the value first (unless it is really too big in which case it just does \the same thing as '-graph') and '-?<type> <variable>' (such as '-?signal' or '-?wtrans') to get the value that is currently \displayed in a gobject and put it into the variable <variable>.}}}",      /*   * CProcs in window_color.c    */    "color",C_Color,"{{{nnew <name> (rgb <r> <g> <b> | hsv <h> <s> <v>)} {Creates a new named color using either RGB or HSV convention.}} \{{inew [<colorMap>=<currentColorMap>] <index> (rgb <r> <g> <b> | hsv <h> <s> <v>)} {Creates a new indexed color of a colormap using either RGB or HSV convention.}} \{{ilist [<colormap>=<currentColorMap>] [<index>]} {Gets a rgb definition listv '{r g b}' of the color <index> in <colormap> or (if <index> is not specified) a listv of all the colors {r g b}.}} \{{nlist [<nameRegexp>='*']} {Gets a listv of the rgb definition '{name r g b}' of colors whose name matches <nameRegexp>.}} \{{install} {Install all the colors that were defined with the 'color' command.}} \{{animate <color> (rgb <r> <g> <b> | hsv <h> <s> <v>)} {Changes interactively the definition of the color <color> using RGB or HSV convention (Warning : It only works on Unix computers).}} \{{nb} {Returns the total number of available colors for lastWave.}}}",  "setcolor",C_SetColor,"{{{[-bg <color>] [-fg <color>] [-mouse [<color>]]} {Sets any (or all)  of the background (-bg), foreground (-fg) or mouse (used for inverse mode on Unix computers only) color.}}}",

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -