[PATCH app-xedit 4/4] xprint: remove conditionally defined related C code

Jeremy Huddleston jeremyhu at freedesktop.org
Fri Mar 26 12:54:01 PDT 2010


Reviewed-by: Jeremy Huddleston <jeremyhu at freedestop.org>

On Mar 26, 2010, at 05:27, Gaetan Nadon wrote:

> Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
> ---
> commands.c |  114 ------------------------------------------------------------
> xedit.c    |   24 -------------
> xedit.h    |    6 ---
> 3 files changed, 0 insertions(+), 144 deletions(-)
> 
> diff --git a/commands.c b/commands.c
> index 2947dda..90a64ec 100644
> --- a/commands.c
> +++ b/commands.c
> @@ -29,10 +29,6 @@
> #include <X11/Xfuncs.h>
> #include <X11/Xos.h>
> #include "xedit.h"
> -#ifdef INCLUDE_XPRINT_SUPPORT
> -#include "printdialog.h"
> -#include "print.h"
> -#endif /* INCLUDE_XPRINT_SUPPORT */
> #ifdef CRAY
> #include <unistd.h>
> #endif
> @@ -54,12 +50,6 @@
> #define Assertion(expr, msg) { if (!(expr)) { Error msg } }
> #define Log(x)   { if (True) printf x; }
> 
> -#ifdef INCLUDE_XPRINT_SUPPORT
> -static Widget printdialog_shell = NULL;
> -static Widget printdialog       = NULL;
> -static char   printJobNameBuffer[PATH_MAX+256];
> -#endif /* INCLUDE_XPRINT_SUPPORT */
> -
> void ResetSourceChanged(xedit_flist_item*);
> static void ResetDC(Widget, XtPointer, XtPointer);
> 
> @@ -523,110 +513,6 @@ ReallyDoLoad(char *name, char *filename)
>     return (True);
> }
> 
> -#ifdef INCLUDE_XPRINT_SUPPORT
> -static void
> -printshellDestroyXtProc(Widget w, XtPointer client_data, XtPointer callData)
> -{
> -    XawPrintDialogClosePrinterConnection(printdialog, False);
> -}
> -
> -static void
> -printOKXtProc(Widget w, XtPointer client_data, XtPointer callData)
> -{
> -    XawPrintDialogCallbackStruct *pdcs = (XawPrintDialogCallbackStruct *)callData;
> -    Cardinal                      n;
> -    Arg                           args[2];
> -    Widget                        textsource;
> -
> -    Log(("printOKXtProc: OK.\n"));
> -    
> -    /* Get TextSource object */
> -    n = 0;
> -    XtSetArg(args[n], XtNtextSource, &textsource); n++;
> -    XtGetValues(textwindow, args, n);
> -    
> -    Assertion(textsource != NULL, (("printOKXtProc: textsource == NULL.\n")));
> -   
> -    /* ||printJobNameBuffer| must live as long the print job prints
> -     * because it is used for the job title AND the page headers... */
> -    sprintf(printJobNameBuffer, "Xedit print job");
> -
> -    DoPrintTextSource("Xedit",
> -                      textsource, topwindow,
> -                      pdcs->pdpy, pdcs->pcontext, pdcs->colorspace,
> -                      printshellDestroyXtProc,
> -                      printJobNameBuffer,
> -                      pdcs->printToFile?pdcs->printToFileName:NULL);
> -
> -    XtPopdown(printdialog_shell);
> -}
> -
> -static void
> -printCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
> -{
> -    Log(("printCancelXtProc: cancel.\n"));
> -    XtPopdown(printdialog_shell);
> -    
> -    Log(("destroying print dialog shell...\n"));
> -    XtDestroyWidget(printdialog_shell);
> -    printdialog_shell = NULL;
> -    printdialog       = NULL;
> -    Log(("... done\n"));
> -}
> -
> -
> -/*ARGSUSED*/
> -void
> -PrintFile(Widget w, XEvent *event, String *params, Cardinal *num_params)
> -{
> -    DoPrint(w, NULL, NULL);
> -}
> -
> -/*ARGSUSED*/
> -void
> -DoPrint(Widget w, XtPointer client_data, XtPointer call_data)
> -{
> -  Dimension   width, height;
> -  Position    x, y;
> -  Widget      parent = topwindow;
> -  Log(("print!\n"));
> -  
> -  if (!printdialog) {
> -    int n;
> -    Arg args[20];
> -
> -    n = 0;
> -    XtSetArg(args[n], XtNallowShellResize, True); n++;
> -    printdialog_shell = XtCreatePopupShell("printdialogshell",
> -                                           transientShellWidgetClass,
> -                                           topwindow, args, n);
> -    n = 0;
> -    printdialog = XtCreateManagedWidget("printdialog", printDialogWidgetClass,
> -                                        printdialog_shell, args, n);
> -    XtAddCallback(printdialog, XawNOkCallback,     printOKXtProc,     NULL);
> -    XtAddCallback(printdialog, XawNCancelCallback, printCancelXtProc, NULL);
> -
> -    XtRealizeWidget(printdialog_shell);
> -  }
> -
> -  /* Center dialog */
> -  XtVaGetValues(printdialog_shell,
> -      XtNwidth,  &width,
> -      XtNheight, &height,
> -      NULL);
> -
> -  x = (Position)(XWidthOfScreen( XtScreen(parent)) - width)  / 2;
> -  y = (Position)(XHeightOfScreen(XtScreen(parent)) - height) / 3;
> -
> -  XtVaSetValues(printdialog_shell,
> -      XtNx, x,
> -      XtNy, y,
> -      NULL);
> -        
> -  XtPopup(printdialog_shell, XtGrabNonexclusive);
> -}
> -#endif /* INCLUDE_XPRINT_SUPPORT */
> -
> /*	Function Name: SourceChanged
>  *	Description: A callback routine called when the source has changed.
>  *	Arguments: w - the text source that has changed.
> diff --git a/xedit.c b/xedit.c
> index dcb031a..f7a8b68 100644
> --- a/xedit.c
> +++ b/xedit.c
> @@ -40,9 +40,6 @@ static XtActionsRec actions[] = {
> {"quit", QuitAction},
> {"save-file", SaveFile},
> {"load-file", LoadFile},
> -#ifdef INCLUDE_XPRINT_SUPPORT
> -{"print-file", PrintFile},
> -#endif /* INCLUDE_XPRINT_SUPPORT */
> {"find-file", FindFile},
> {"cancel-find-file", CancelFindFile},
> {"file-completion", FileCompletion},
> @@ -118,13 +115,6 @@ static XtResource resources[] = {
> 
> #undef Offset
> 
> -#ifdef INCLUDE_XPRINT_SUPPORT
> -String fallback_resources[] = {
> -    "*international:     True", /* set this globally for ALL widgets to avoid wiered crashes */
> -    NULL
> -};
> -#endif
> -
> int
> main(int argc, char *argv[])
> {
> @@ -141,15 +131,8 @@ main(int argc, char *argv[])
>     show_dir = FALSE;
>     first_item = NULL;
> 
> -#ifdef INCLUDE_XPRINT_SUPPORT
> -    XtSetLanguageProc(NULL, NULL, NULL);
> -#endif
>     topwindow = XtAppInitialize(&appcon, "Xedit", NULL, 0, &argc, argv,
> -#ifdef INCLUDE_XPRINT_SUPPORT
> -				fallback_resources,
> -#else
> 				NULL,
> -#endif
> 				NULL, 0);
> 
>     XtAppAddActions(appcon, actions, XtNumber(actions));
> @@ -345,9 +328,6 @@ makeButtonsAndBoxes(Widget parent)
> 	MakeCommandButton(b_row, "quit", DoQuit);
> 	MakeCommandButton(b_row, "save", DoSave);
> 	MakeCommandButton(b_row, "load", DoLoad);
> -#ifdef INCLUDE_XPRINT_SUPPORT
> -	MakeCommandButton(b_row, "print", DoPrint);
> -#endif /* INCLUDE_XPRINT_SUPPORT */
> 	filenamewindow = MakeStringBox(b_row, "filename", NULL);
>     }
>     hintswindow = XtCreateManagedWidget("bc_label", labelWidgetClass,
> @@ -393,14 +373,10 @@ makeButtonsAndBoxes(Widget parent)
>     textwindow =  XtCreateManagedWidget(editWindow, asciiTextWidgetClass,
> 					vpanes[0], arglist, num_args);
> 
> -#ifdef INCLUDE_XPRINT_SUPPORT
> -    international = True;
> -#else
>     /* Get international resource value form the textwindow */
>     num_args = 0;
>     XtSetArg(arglist[num_args], XtNinternational, &international);	++num_args;
>     XtGetValues(textwindow, arglist, num_args);
> -#endif
> 
>     num_args = 0;
>     XtSetArg(arglist[num_args], XtNtype, XawAsciiFile);			++num_args;
> diff --git a/xedit.h b/xedit.h
> index 0abda4c..4a9a468 100644
> --- a/xedit.h
> +++ b/xedit.h
> @@ -143,16 +143,10 @@ void QuitAction(Widget, XEvent*, String*, Cardinal*);
> void DoSave(Widget, XtPointer, XtPointer);
> void SaveFile(Widget, XEvent*, String*, Cardinal*);
> void DoLoad(Widget, XtPointer, XtPointer);
> -#ifdef INCLUDE_XPRINT_SUPPORT
> -void DoPrint(Widget, XtPointer, XtPointer);
> -#endif /* INCLUDE_XPRINT_SUPPORT */
> void CancelFindFile(Widget, XEvent*, String*, Cardinal*);
> void FindFile(Widget, XEvent*, String*, Cardinal*);
> void LoadFile(Widget, XEvent*, String*, Cardinal*);
> Bool LoadFileInTextwindow(char *name, char *resolved_name);
> -#ifdef INCLUDE_XPRINT_SUPPORT
> -void PrintFile(Widget, XEvent*, String*, Cardinal*);
> -#endif /* INCLUDE_XPRINT_SUPPORT */
> void FileCompletion(Widget, XEvent*, String*, Cardinal*);
> void KillFile(Widget, XEvent*, String*, Cardinal*);
> void DirWindowCB(Widget, XtPointer, XtPointer);
> -- 
> 1.6.0.4
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5820 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100326/40ee48d9/attachment.bin>


More information about the xorg-devel mailing list