#include "xthread.h" #include "fallbacks.h" #include "picinfo.h" #ifdef COMMENT void exit_self(Widget w, XtPointer client, XtPointer call) { /* Do all clean up */ finish_display(); // XtAppSetExitFlag(app); } void sprint(Widget w, Widget dialog, XtPointer call) { char *s; s = XawDialogGetValueString(dialog); printf("%s\n",s); } void reset(Widget w, Widget dialog, XtPointer call) { char *s; Arg wargs[5]; s = (char *)malloc(1); s[0] = 0; XtSetArg(wargs[0],XtNvalue,s); XtSetValues(dialog,wargs,1); } void quit(Widget w, Widget dialog, XtPointer call) { exit(0); } #endif XPicThread::XPicThread() : Thread() { return; } void XPicThread::init_Xdpy(int *argc, char **argv) { #ifdef COMMENT Widget exitW; Widget dialog; Arg wargs[10]; int n; #endif toplevel = XtVaAppInitialize(&app, "UberPlayer Window", NULL, 0, argc, argv, fallbacks, NULL); formW = XtCreateManagedWidget("box", boxWidgetClass, toplevel, NULL, 0); XtVaSetValues(formW, XtNheight, CIF_FORMAT.rows + 50, NULL); XtVaSetValues(formW, XtNwidth, CIF_FORMAT.cols + 50, NULL); #ifdef COMMENT exitW = XtCreateManagedWidget("Exit", commandWidgetClass, formW, NULL, 0); dialog = XtCreateManagedWidget("dialog",dialogWidgetClass, formW, NULL, 0); n=0; XtSetArg(wargs[n], XtNlabel, "IP address"); n++; XtSetArg(wargs[n], XtNvalue, "dadf"); n++; XtSetValues(dialog,wargs,n); XawDialogAddButton(dialog,"connect",sprint,dialog); XawDialogAddButton(dialog,"quit",quit,dialog); XtAddCallback(exitW, XtNcallback, exit_self, NULL); #endif picW = XtCreateManagedWidget("picw", coreWidgetClass, formW, NULL, 0); XtVaSetValues(picW, XtNheight, CIF_FORMAT.rows, NULL); XtVaSetValues(picW, XtNwidth, CIF_FORMAT.cols, NULL); XtRealizeWidget(toplevel); } Widget XPicThread::Gettop(void) { return toplevel; } Widget XPicThread::GetpicW(void) { return picW; } void XPicThread::Run(void) { XtAppMainLoop(app); }