Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
XmtRegisterProcedures(3)   Library Functions Manual   XmtRegisterProcedures(3)

NAME
       XmtRegisterProcedures(),	XmtRegisterCallbackProcedure(),	XmtVaRegister-
       CallbackProcedures() - register procedures for use with the  Xmt	 call-
       back converter.

SYNOPSIS
       #include	<Xmt/Procedures.h>

       void XmtRegisterProcedures(XmtProcedureInfo *procedures,	Cardinal
		      num_procedures)

       void XmtRegisterCallbackProcedure(String	name, XtCallbackProc proc,
		      String type)

       void XmtVaRegisterCallbackProcedures(String name, XtCallbackProc	proc,
		      String type,
		      {	String name, XtCallbackProc proc, String type, }
		      NULL)

       typedef struct {
		      String name;
		      XmtProcedure function;
		      String argument_types[8];
		      /* private, internal fields omitted */
       } XmtProcedureInfo;

ARGUMENTS
       INPUTS

	    procedures
		   An array of procedure names,	pointers and argument descrip-
		   tions to be registered.

	    num_procedures
		   The number of elements in procedures.

	    name   The	name  of an XtCallbackProc to be registered.  For Xmt-
		   VaRegisterCallbackProcedures(), this	 argument  may	appear
		   any	number	of times as part of a NULL-terminated argument
		   list.

	    proc   The XtCallbackProc to be registered for use	with  the  Xmt
		   callback converter. For XmtVaRegister CallbackProcedures(),
		   this	argument may appear any	number of times	as part	 of  a
		   NULL-terminated argument list.

	    type   The	representation	type  of the client_data argument that
		   proc	expects	For XmtVaRegisterCallback  Procedures(),  this
		   argument  may appear	any number of times as part of a NULL-
		   terminated argument list.

DESCRIPTION
       XmtRegisterProcedures() is the general way  to  register	 C  procedures
       with the	Xmt String-to-Callback converter so that they can be called in
       resource	files.

       Each element of the procedures array is an  XmtProcedureInfo  structure
       that  one procedure to be registered. The function field	of this	struc-
       ture specifies the procedure to be registered. You will	have  to  cast
       your  procedure to the special type XmtProcedure	to set this field. The
       name field of the structure specifies the name under which  the	proce-
       dure   will   be	  registered.	The   argument_types   field   of  the
       XmtProcedureInfo	structure is an	array of strings that let you  specify
       the representation type of up to	8 arguments for	the procedure. The Xmt
       callback	converter will parse arguments specified in  a	resource  file
       and  automatically  convert them	to the appropriate type	before calling
       the procedure. If the procedure being registered	expects	fewer  than  8
       arguments, leave	the unused arguments uninitialized as NULL.

       You  may	also specify some special argument types in the	argument_types
       array. These special representation types are listed in the table. When
       a registered procedure takes one	of these types,	the callback converter
       will automatically pass a value,	and you	will not  have	to  specify  a
       value in	the resource file.

       Type			Meaning
       --------------------------------------------------------------------------
       XmtRCallbackWidget	Pass the widget	that invoked the callback.
       XmtRCallbackData		Pass the call_data argument.
       XmtRCallbackAppContext	Pass the application context of	the widget.
       XmtRCallbackWindow	Pass the window	ID of the invoking widget.
       XmtRCallbackDisplay	Pass the display pointer of the	invoking widget.
       XmtRCallbackUnused	Pass NULL; good	for unused arguments.

       See  Chapter  10,  Callbacks  in	Resource Files for more	information on
       using the Xmt callback converter, and on	registering procedures for it.

       XmtRegisterCallbackProcedure() is a simplified interface	 to  XmtRegis-
       terProcedures()	that you can use when registering a ``standard'' call-
       back procedure of type XtCallbackProc. It creates and registers an Xmt-
       ProcedureInfo  structure	using the specified name and proc. It uses the
       argument_types field to specify that the	 procedure  proc  takes	 three
       arguments, of types XmtRCallbackWidget, type, and XmtRCallbackData. The
       first and last of these types specify standard callback	arguments,  as
       shown  in the table. The	second argument	is the type that was passed to
       the function.

       XmtVaRegisterCallbackProcedures()  is  like   XmtRegisterCallbackProce-
       dure(),	but  it	 takes	a  NULL-terminated  list of (name, proc, type)
       triples to register.

SEE ALSO
       Chapter 10, Callbacks in	Resource Files,
       XmtRegisterCallbackConverter(), XmtRegisterUnixProcedures(),
       XmtRegisterXmtProcedures(), XmtRegisterXtProcedures().

Xmt				  Motif	Tools	      XmtRegisterProcedures(3)

NAME | SYNOPSIS | ARGUMENTS | DESCRIPTION | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=XmtRegisterProcedures&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help