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

📄 gtk-server.cfg.1.html

📁 gtk_server的源代码
💻 HTML
字号:
Content-type: text/html<HTML><HEAD><TITLE>Manpage of gtk-server.cfg</TITLE></HEAD><BODY><H1>gtk-server.cfg</H1>Section: User Commands  (1)<BR><A HREF="#index">Index</A><A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR><A NAME="lbAB">&nbsp;</A><H2>NAME</H2>gtk-server.cfg - Configfile for the gtk-server.<A NAME="lbAC">&nbsp;</A><H2>SYNOPSIS </H2><B>gtk-server.cfg</B><A NAME="lbAD">&nbsp;</A><H2>DESCRIPTION</H2>The 'gtk-server.cfg' file is a configfile which is used by the GTK-server. Ifthe 'gtk-server.cfg' file is available in the same directory as your client script, the GTK-server will read this local configfile(preferred). This way each client program can use it's own GTK configuration.If the configfile is not available locally, the GTK-server will follow the next logic:1) try reading the environment variable GTK_SERVER_CONFIG. This variable shouldcontain the full path and name to the configfile.2) try finding the (hidden) configfile in the homedir of the user. The name of the configfile should be preceded by a dot, e.g. '.gtk-server.cfg'.3) try finding the configfile in the /etc directory.4) try finding the configfile in the /usr/local/etc directory.The 'gtk-server.cfg' file contains the decriptions of the GTK functions whichwill be used by your client script. The format of the file is &lt;KEYWORD = VALUE&gt;. Linesstarting with a hash '#' will be skipped. The keywords must be written using capitals.The following keywords are recognized by the GTK-server:<DL COMPACT><DT><B>LIB_NAME = &lt;library name 1, library name 2, ...&gt;</B><DD>Describes the name of the libraries (.so or .dll) to open.This keyword may occur multiple times in the configfile. At a maximum 32 libraries can be opened simultanously.<BR><P>Example:<B>LIB_NAME = libgtk-x11-2.0.so, libgdk-x11-2.0.so, libglib-2.0.so, libgobject-2.0.so</B><DT><B>INCLUDE = &lt;file&gt;</B><DD>Define an additional configuration file with additional GTK function descriptions or macros.<BR><P>Example:<B>INCLUDE = /etc/gtk-extra.cfg</B><DT><B>FUNCTION_NAME = &lt;func&gt;, &lt;callback&gt;, &lt;type&gt;, &lt;amount&gt;, &lt;arg1&gt;...&lt;argx&gt;</B><DD>Every GTK function used by a script must be described here. First the name ofthe function itself must be mentioned, after that a callback signal if applicable. The realnames for the GTK callback signals must be used here. Then the type of the returnvalue must be specified. The type can be one of the following: NONE, VOID, WIDGET, POINTER, BOOL, STRING, INT, LONG, DOUBLE, FLOAT or ADDRESS. After that, it must be clear how many arguments the GTK function needs.Finally, the type of each indivdual argument must be declared. The type of the arguments canbe one of the following: NULL, WIDGET, POINTER, BOOL, STRING, INT, LONG, DOUBLE, FLOAT, ENUM, MACRO, DATA or BASE64.<P>The ADDRESS returntype is used to return the address of a function in memory. The BASE64 type is used to sendbase64 encoded binary data to the GTK-server. The POINTER type can be used for generic pointers and non-GTKlibraries. The ENUM type is used to define an enumeration name (see below).<P>The MACRO type can be used in case a user function needs to be registered. In case GTK must execute a userfunction, the described macro will be used. A MACRO type always needs an DATA type, in which additional datacan be specified. Macros are explained in the MACRO section of this manpage.<P>The 'gtk-server.cfg' file may not contain duplicate function definitions. This is verifiedby the GTK-server during startup.<BR><P>Example:<B>FUNCTION_NAME = gtk_window_new, delete-event, WIDGET, 1, LONG</B><DT><B>ENUM_NAME = &lt;name&gt;, &lt;integer&gt;</B><DD>The GTK and also the XForms API use a lot of predefined constants and enumerations. With this optionalconfiguration line these can be defined also. The clientscript can use the same enumeration name, and theGTK-server will substitute to the corresponding value automatically. Values may be entered in decimal, octalor hexadecimal format. With octal use a preceding '0', and hexadecimal a preceding '0x' or '0X'.<P>Please note that enumeration names only may contain integer values. So in a defined GTK function, only at argumentsdefined as 'INT', 'LONG' or 'ENUM' the GTK-server will check for an enumeration name. If it cannot match anenumeration name, it is assumed there is a real value.<P>Duplicate enumeration names are not allowed. This is verified by the GTK-server during startup.<P>Example:<B>ENUM_NAME = GTK_WINDOW_TOPLEVEL, 0</B><DT><B>ALIAS_NAME = &lt;alias&gt;, &lt;real name&gt;</B><DD>Some functions in external libraries may have the same name as an existing statement in a programming language. Forexample, shell scripts can use the statement 'read', while the function 'read' also can be imported from libc. Inorder to avoid the client interpreter mixing up these statements, it is possible to define an alias. So instead ofusing the real name, the client program can use the defined alias to invoke the external function.<P>Aliasing also allows the programmer to rename external functions so they comply to the standard of the client language.<P>Duplicate alias names are not allowed. This is verified by the GTK-server during startup.<P>Example:<B>ALIAS_NAME = libc_read, read</B><DT><B>MACRO &lt;name&gt; &lt;...&gt; ENDMACRO</B><DD>For an explanation on macros see below.</DL><A NAME="lbAE">&nbsp;</A><H2>Pointer arguments</H2>Some GTK functions return a result in their pointer arguments. The way to retrieve the value fromsuch arguments is to create a definition for the GTK function with special parameters. For example:<P>FUNCTION_NAME = gdk_window_get_pointer, NONE, WIDGET, 4, WIDGET, PTR_INT, PTR_INT, NULL<P>In this case, a call to 'gdk_window_get_pointer' will return a widget but also the values stored in thesecond and third argument. The returned result will be formatted in S-expression syntax, just asthe GTK-server also accepts S-expression syntax. Next to the type PTR_INT the types PTR_LONG, PTR_FLOAT,PTR_DOUBLE, PTR_STRING, PTR_BOOL and PTR_WIDGET can be used.<A NAME="lbAF">&nbsp;</A><H2>Macros</H2>In GTK sometimes more than one function is needed to define a widget. These functions can begrouped into a macro. From a clientscript the name of the macro can be used to invoke the macro. A macro can have the following layout:<P><B>MACRO &lt;name&gt;</B><BR><B>$a : GTK_function</B><BR><B>GTK_function $1 $2 $3</B><BR><B>...</B><BR><B>RETURN &lt;value&gt;</B><BR><B>ENDMACRO</B><P>Each line in the macro may contain only one GTK function. A macro can be invoked with arguments.Within the macro these arguments are denoted with $1, $2, $3 an so on. The $0 points to the macroname itself. It is possible to refer to all arguments at once with $@. A macro can accept up to 9 arguments. If there are more arguments then these are ignored.<P>Macros may also use variables. Variablenames must start with a dollarsign '$'. After that, only the first letter ofthe variablename is important, which means that there are at most 26 variables in each macro (lowercase).<P>Within a macro, it is possible to assign a result of a GTK function to a variable. However, it is importantthat the colon symbol, which is the assignment operator, is not attached to the variablename or the GTKfunctionname. For example:<P><B>$window : gtk_window_new GTK_WINDOW_TOPLEVEL</B><P>Also it is possible to assign a string to a variable. To do this, the string should be precededby the '&amp;' sign. For example:<P><B>$var : &amp;Hello world</B><P>Variables in macros are initialized to zero automatically, but keep their values after the macro object has been executed. Afterwards the variables can be retrieved in your clientscript by using the call 'gtk_server_macro_var'. For example:<P><B>gtk_server_macro_var &lt;macroname&gt; var</B><P>There are a few commands to use in macros. These should be written in capitals. For example, it is possibleto perform a relative jump on the condition of the value of a variable. The command 'VALUE' jumpswhen a variable contains a value not equal to zero, and the command 'EMPTY' jumps when a variable is zero. The command 'JUMP' alwaysjumps, no matter what condition. For example:<P><B>$var VALUE 3</B><P>In this example, the GTK-server will jump three statements forward in case the variable 'var' is not equal to zero. Thecommands 'EMPTY', 'VALUE' and 'JUMP' can jump forward and backward, but only within the macro object. Jumps outsidethe macro will just go to the end of the macro, or to the beginning if the jump is negative.<P>Next to jumps, a comparison between variables can be made with 'COMPARE'. When two variables are compared, theresult of the comparison will be put into the local z-variable. So if the contents of the compared variables are equal, the z-variablewill be '0'. Else the local z-variable will be '1'. For example:<P><B>$event COMPARE $window</B><BR><B>$z EMPTY -5</B><P>Also it is possible to setup associative arrays. An associative array is globally visible to all macro's. Withassociative arrays the main returnvalue of a macro can be connected to another value. This way multipleresults can be returned from a macro. An array with one element can be defined as follows:<P><B>$ebox ASSOC $pix</B><P>If, to another macro, the 'ebox' is passed as an argument, the associated value can be retrieved in that macro as follows:<P><B>$pix GET $1</B><P>In this example, the 'pix' variable will be assigned the value associated to the first argument of the macro. There is no limitto the amount of associations; associative arrays can be of endless length, for example:<P><B>$ebox ASSOC $pix</B><BR><B>$pix ASSOC $widget</B><BR><B>$widget ASSOC $window</B><BR><B>[...]</B><P>All values can be retrieved using an inverse GET:<P><B>$pix GET $1</B><BR><B>$widget GET $pix</B><BR><B>$window GET $widget</B><BR><B>[...]</B><P>Note that with all operator commands, which are 'GET', 'ASSOC', 'COMPARE', 'VALUE', 'EMPTY', and the ':', the leftoperand must be a variable.<P>It is not allowed to define a macro within a macro. Also, duplicate macro names are not allowed. However, macros mayinvoke other macros. Also, macros may return a value to the client script with the keyword 'RETURN'. For example:<P><B>RETURN $window</B><P>To find out which value is assigned to a variable, the command DEBUG can be used. This will print the resultin the logfile, if logging is enabled. Example:<P><B>DEBUG $button</B><P>The Highlevel Universal GUI (HUG) defined in the GTK-server configfile is implemented using macro objects.<A NAME="lbAG">&nbsp;</A><H2>EXAMPLES</H2>An example of a 'gtk-server.cfg' file can be found in the sourcepackage.<A NAME="lbAH">&nbsp;</A><H2>LICENSE</H2>GPL license.<P>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.<P>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.<P>You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.<A NAME="lbAI">&nbsp;</A><H2>SEE ALSO</H2><A HREF="http://www.gtk-server.org/gtk-server.1.html">gtk-server</A>(1), stop-gtk-server(1)<A NAME="lbAJ">&nbsp;</A><H2>AUTHORS</H2>Orignal concept, design and implementation by Peter van Eerten, e-mail : peter AT gtk-server DOT org</A><P>Current version of the GTK-server was created with help of many others - see the CREDITS file inthe sourcepackage for credits.<P><HR><A NAME="index">&nbsp;</A><H2>Index</H2><DL><DT><A HREF="#lbAB">NAME</A><DD><DT><A HREF="#lbAC">SYNOPSIS </A><DD><DT><A HREF="#lbAD">DESCRIPTION</A><DD><DT><A HREF="#lbAE">Pointer arguments</A><DD><DT><A HREF="#lbAF">Macros</A><DD><DT><A HREF="#lbAG">EXAMPLES</A><DD><DT><A HREF="#lbAH">LICENSE</A><DD><DT><A HREF="#lbAI">SEE ALSO</A><DD><DT><A HREF="#lbAJ">AUTHORS</A><DD></DL><HR>This document was created by<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,using the manual pages.<BR>Time: 20:27:05 GMT, January 02, 2009</BODY></HTML>

⌨️ 快捷键说明

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