Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xmprintsetup(3) [redhat man page]

XmPrintSetup(library call)												XmPrintSetup(library call)

NAME
XmPrintSetup -- setup and create a Print Shell widget SYNOPSIS
#include <Xm/Print.h> Widget XmPrintSetup( Widget video_widget, Screen *print_screen, String print_shell_name, ArgList args, Cardinal num_args); DESCRIPTION
A function that does the appropriate setting and creates a realized XmPrintShell that it returns to the caller. This function hides the details of the Xt to set up a valid print shell heirarchy for the application. It is also meant to encourage consistency in the way appli- cations root their print widget hierarchy. print_screen must belong to a Display connection that has already been initialized with Xt. The video_widget is used to get at the application context, application name and class, and argc/argv stored on the applicationShell that roots this widget. If no applicationShell is found, NULL argv/argc are used. XmPrintSetup then creates an unrealized ApplicationShell with the same name and class as the one given by the video display, on the print display and on the print screen specified. An XmPrintShell is then created as a child of this toplevel shell, using XtCreatePopupShell, with the name print_shell_name, and using the args provided. It then realizes and maps the print shell, using XtPopup with XtGrabNone. This way, application resource files and users can specify print specific attributes using the following syntax (if print_shell_name is "Print"): Dtpad.Print*textFontList: somefont *Print*background:white *Print*highlightThickness:0 video_widget A video widget to fetch app video data from. print_screen A print screen on the print display - specifies the screen onto which the new shell is created. print_shell_name Specifies the name of the XmPrintShell created on the X Print server. args Specifies the argument list from which to get the resources for the XmPrintShell. num_args Specifies the number of arguments in the argument list. RETURN VALUE
The id the XmPrintShell widget created on the X Print Server connection, or NULL if an error has occured. ERRORS
/WARNINGS None. EXAMPLES
From the OK callback and the SetUp callback of the primary print dialog widget: static void printOKCB(Widget, XtPointer call_data, XtPointer client_data) { AppPrint *p = (AppPrint *) client_data; DtPrintSetupCallbackStruct *pbs = (XmPrintCallbackStruct *) call_data; /* connect if not already done. the print dialog callback always provides valid printer name, print display and screen already initialized: XpInitContext called */ */ p->print_shell = XmPrintSetup (widget, pbs->print_screen, "Print", NULL, 0); ... } SEE ALSO
XmPrintShell(3), XmRedisplayWidget(3), XmPrintToFile(3), XmPrintPopupPDM(3) XmPrintSetup(library call)

Check Out this Related Man Page

XmPrintPopupPDM(library call)											     XmPrintPopupPDM(library call)

NAME
XmPrintPopupPDM -- Send a notification for the PDM to be popped up SYNOPSIS
#include <Xm/Print.h> XtEnum XmPrintPopupPDM( Widgetprint_shell, Widgetvideo_transient_for); DESCRIPTION
A convenience function that sends a notification to start a Print Dialog Manager on behalf of the application, XmPrintPopupPDM hides the details of the X selection mechanism used to notify the PDM that a new dialog must be popped up for this application. XmPrintPopupPDM sends a selection request to either the print display of the print shell, or the video display of the transient_for video widget (depending on the environment variable XPDMDISPLAY, which can only takes the value "print" or "video"), asking for the PDM windows to be popped up on behalf of the app. Return right away with status of XmPDM_NOTIFY_FAIL (e.g. if the function couldn't malloc memory for the selection value, or if XPDMDISPLAY is not "print" or "video") or with XmPDM_NOTIFY_SUCCESS , which only means a "message" was sent out to the PDM specified by XPDMSELECTION , not that it's already up on the screen yet. In order to know if the PDM is up, or not running, the application must register a XmNpdmNotificationCallback with the Print Shell. XmPrintPopupPDM puts up an InputOnly window on top of the dialog, so that the end user doesn't use the print setup dialog while the PDM is trying to come up. This window is automatically removed when the shell is about to call the callback for the first time. print_shell The Print Shell used for this print job and context. video_transient_for The video widget dealing with application print setup. RETURN VALUE
Returns XmPDM_NOTIFY_SUCCESS if the function was able to send the notification out to the PDM process, XmPDM_NOTIFY_FAIL otherwise. ERRORS
/WARNINGS Not applicable. EXAMPLES
Example of callback from a Print set up dialog box "Setup..." button: PrintSetupCallback(print_dialog...) /*-------------*/ { if (XmPrintPopupPDM (pshell, XtParent(print_dialog)) != XmPDM_NOTIFY_SUCCESS) { /* some error dialog */ } } Example of XmNpdmNotificationCallback from a Print Shell: pdmNotifyCB(print_shell...) { XmPrintShellCallBackStruct * pr_cb = ... switch (pr_cb->reason) { case XmCR_PDM_NONE: /* no PDM available */ PostErrorDialog(...); break; case XmCR_PDM_VXAUTH: /* PDM is not authorized ... */ PostErrorDialog(...); break; case XmCR_PDM_UP: the PDM is up and running /* everything is fine */ break; default: /* other cases */ } } SEE ALSO
XmPrintSetup(3), XmPrintShell(3), XmRedisplayWidget(3), XmPrintToFile(3) XmPrintPopupPDM(library call)
Man Page