# The "xtmisc" Package

These routines are meant to provide miscellaneuos Xt support. NOTE: THIS PACKAGE IS WORK IN PROGRESS. THE INTERFACE MAY CHANGE IN THE NEXT RELEASE, POSSIBLY WITHOUT NOTICE.

Library: karmaXt
Link With: -lkarmaXt

#### Functions

xtmisc_destroy_cbk | Destroy a popup widget.
xtmisc_event_init | Initialise periodic event management support under Xt.
xtmisc_ext_call | Call an extension function.
xtmisc_set_icon | Create an icon for an application's top level widget.
xtmisc_init_app_initialise | Initialise an application for Xt.
xtmisc_init_post_realise_arg_process | Process and remove arguments after main widget realisation.
xtmisc_init_get_pc_colourmap | Get PseudoColour colourmap with a minimum of free colourcells.
xtmisc_popup_cbk | Pop up a popup widget.
xtmisc_exclusive_popup_cbk | Pop up a popup widget with exclusive grab.
xtmisc_popdown_cbk | Pop down a popup widget.
xtmisc_sensitive_cbk | Make a widget sensitive.
xtmisc_insensitive_cbk | Make a widget insensitive.
xtmisc_toggle_cbk | Default toggle callback.
xtmisc_support_work_funcs | Register support for work functions within an Xt application.

#### Prototype Functions

xtmisc_PROTO_icon_func | Write an icon pixmap.

#### Tables

xtmisc_INIT_ATTRIBUTES | List of attributes for xtmisc_init_app_initialise

## Functions

#### EXPERIMENTAL FUNCTION: subject to change without notice

void xtmisc_destroy_cbk (Widget w, XtPointer client_data, XtPointer call_data)

This routine will destroy a widget. This routine is a convenience routine to be used as a callback.

Parameters:

- w : The widget on which the event occurred. This is ignored.
- client_data : The callback client data. This must be the widget to destroy.
- call_data : The callback call data. This is ignored.

Returns: Nothing.
Multithreading Level: Unsafe

#### EXPERIMENTAL FUNCTION: subject to change without notice

void xtmisc_event_init (XtAppContext app_context)

Initialise periodic event management support under Xt.

Parameters:

- app_context : The application context to use.

Returns: Nothing on success, else the process aborts.
Multithreading Level: Unsafe

#### EXPERIMENTAL FUNCTION: subject to change without notice

void xtmisc_ext_call (Widget w, CONST char *function, unsigned int max_func, unsigned int *num_ok, flag allow_consumption, void *arg1, void *arg2, void *arg3)

Call an extension function.

Parameters:

- w : The widget to take the class name from.
- function : The function to call.
- max_func : The maximum number of functions to call. If this is 0 there is no limit.
- num_ok : The number of functions which returned TRUE is written here. This may be NULL.
- allow_consumption : If TRUE, the first function that returns TRUE will consume the event, preventing further functions from being called.
- arg1 : An optional argument.
- arg2 : An optional argument.
- arg3 : An optional argument.

Returns: Nothing.
Multithreading Level: Unsafe

void xtmisc_set_icon ( Widget top_level, void (*icon_func) (Display *display, Pixmap pixmap, int width, int height) )

Create an icon for an application's top level widget.

Parameters:

- top_level : The top level widget.
- icon_func : The function to use when writing the icon. The prototype function is xtmisc_PROTO_icon_func.

Returns: Nothing.
Multithreading Level: Unsafe

Widget xtmisc_init_app_initialise (XtAppContext *app_context_return, CONST char* application_class, XrmOptionDescList options, Cardinal num_options, int *argc_in_out, String *argv_in_out, String *fallback_resources, ...)

This routine will initialise an application to use Xt. This routine is similar to the XtVaAppInitialize routine, except that a new colourmap for the application may be created.

Parameters:

- app_context_return : As for XtVaAppInitialize.
- application_class : As for XtVaAppInitialize.
- options : As for XtVaAppInitialize.
- num_options : As for XtVaAppInitialize.
- argc_in_out : As for XtVaAppInitialize.
- argv_in_out : As for XtVaAppInitialize.
- fallback_resources : As for XtVaAppInitialize.
- ... : Two separate lists of optional pairs of attribute-key attribute-value. The first list is processed by this routine and must be terminated with XTMISC_INIT_ATT_END. The second list is processed by XtVaAppInitialize and must be terminated by NULL.

Returns: The application shell.
Multithreading Level: Unsafe

#### EXPERIMENTAL FUNCTION: subject to change without notice

void xtmisc_init_post_realise_arg_process (int *argc_in_out, String *argv_in_out)

Process and remove arguments after main widget realisation.

Parameters:

- argc_in_out : As for XtVaAppInitialize.
- argv_in_out : As for XtVaAppInitialize.

Returns: Nothing.
Multithreading Level: Unsafe

#### EXPERIMENTAL FUNCTION: subject to change without notice

Colormap xtmisc_init_get_pc_colourmap (Screen *screen, unsigned int min_ccells, unsigned int num_ccells, flag verbose, flag *avoid_flash)

Get PseudoColour colourmap with a minimum of free colourcells.

Parameters:

- screen : The screen.
- min_ccells : The minimum number of free colourcells required.
- num_ccells : The number of free colourcells desired.
- verbose : If TRUE, verbose messages are given.
- avoid_flash : If this is not NULL and a PseudoColour colourmap has to be created to satisfy colour requirements and a TrueColour visual is available then TRUE is written here, else FALSE is written here.

Returns: The colourmap.
Multithreading Level: Unsafe

void xtmisc_popup_cbk (Widget w, XtPointer client_data, XtPointer call_data)

This routine will pop up a popup widget. This routine is a convenience routine to be used as a callback.

Parameters:

- w : The widget on which the event occurred. This is ignored.
- client_data : The callback client data. This must be the popup widget.
- call_data : The callback call data. This is ignored.

Returns: Nothing.
Multithreading Level: Unsafe

void xtmisc_exclusive_popup_cbk (Widget w, XtPointer client_data, XtPointer call_data)

This routine will pop up a popup widget. This routine is a convenience routine to be used as a callback. An exclusive grab is performed on the popped up widget.

Parameters:

- w : The widget on which the event occurred. This is ignored.
- client_data : The callback client data. This must be the popup widget.
- call_data : The callback call data. This is ignored.

Returns: Nothing.
Multithreading Level: Unsafe

void xtmisc_popdown_cbk (Widget w, XtPointer client_data, XtPointer call_data)

This routine will pop down a popup widget. This routine is a convenience routine to be used as a callback.

Parameters:

- w : The widget on which the event occurred. This is ignored.
- client_data : The callback client data. This must be the popup widget.
- call_data : The callback call data. This is ignored.

Returns: Nothing.
Multithreading Level: Unsafe

#### EXPERIMENTAL FUNCTION: subject to change without notice

void xtmisc_sensitive_cbk (Widget w, XtPointer client_data, XtPointer call_data)

This routine will make a widget sensitive. This routine is a convenience routine to be used as a callback.

Parameters:

- w : The widget on which the event occurred. This is ignored.
- client_data : The callback client data. This must be the widget to set the sensitivity state of.
- call_data : The callback call data. This is ignored.

Returns: Nothing.
Multithreading Level: Unsafe

#### EXPERIMENTAL FUNCTION: subject to change without notice

void xtmisc_insensitive_cbk (Widget w, XtPointer client_data, XtPointer call_data)

This routine will make a widget insensitive. This routine is a convenience routine to be used as a callback.

Parameters:

- w : The widget on which the event occurred. This is ignored.
- client_data : The callback client data. This must be the widget to set the sensitivity state of.
- call_data : The callback call data. This is ignored.

Returns: Nothing.
Multithreading Level: Unsafe

void xtmisc_toggle_cbk (Widget w, XtPointer client_data, XtPointer call_data)

This routine will set a flag. This routine is a convenience routine to be used as a callback.

Parameters:

- w : The widget on which the event occurred. This is ignored.
- client_data : The callback client data. This must be the pointer to the (flag) type.
- call_data : The callback call data. This is the toggle state.

Returns: Nothing.
Multithreading Level: Unsafe

void xtmisc_support_work_funcs (XtAppContext app_context)

This routine will register Xt support for work functions using the w package.

Parameters:

- app_context : The Xt application context.

Returns: Nothing. On failure the process aborts.
Multithreading Level: Unsafe

## Prototype Functions

void xtmisc_PROTO_icon_func (Display *display, Pixmap pixmap, int width, int height)

Write an icon pixmap.

Parameters:

- display : The display pointer.
- pixmap : The pixmap to write to.
- width : The width of the pixmap.
- height : The height of the pixmap.

Returns: Nothing.
Multithreading Level: Unsafe

## Tables

xtmisc_INIT_ATTRIBUTES List of attributes for xtmisc_init_app_initialise

Name | Type | Meaning
XTMISC_INIT_ATT_END |  | End of varargs list
XTMISC_INIT_ATT_MIN_CCELLS | unsigned int | The min. number of colourcells that the application will want to allocate.
XTMISC_INIT_ATT_COMMS_SETUP | flag | If TRUE, communications setting up is performed
XTMISC_INIT_ATT_CONTROLLED | flag * | TRUE is written here if an external agent is controlling
XTMISC_INIT_ATT_VERBOSE | flag * | TRUE is written here if the "-verbose" flag is given by user
XTMISC_INIT_ATT_BECOME_SERVER | flag | If TRUE, become a server
XTMISC_INIT_ATT_TITLE | char * | Title string is written here

Back to Karma Home Page