Create Xref-Html Frames                    Remove All Frames
file:d:/code/LRC/Splicer/splicer_code_ver2.2/splicer-main-c.c        (Tue Mar 14 16:47:18 2000 )


   1: /*
   2:  * README: Portions of this file are merged at file generation
   3:  * time. Edits can be made *only* in between specified code blocks, look
   4:  * for keywords <Begin user code> and <End user code>.
   5:  */
   6: /*
   7:  * Generated by the ICS Builder Xcessory (BX).
   8:  *
   9:  * Builder Xcessory 4.0
  10:  * Code Generator Xcessory 2.0 (09/09/96)
  11:  *
  12:  */
  13: /*
  14:  * Motif required Headers
  15:  */
  16: #include <X11/StringDefs.h>
  17: #include <Xm/Xm.h>
  18: #include <Xm/DialogS.h>
  19: #if (XmVersion >= 1002)
  20: #include <Xm/RepType.h>
  21: #endif
  22: #include <Xm/MwmUtil.h>
  23: 
  24: /*
  25:  * Globally included information.
  26:  */
  27: 
  28: 
  29: /*
  30:  * Headers for classes used in this program
  31:  */
  32: #include "EquationMenu.h"
  33: 
  34: /*
  35:  * Common constant and pixmap declarations.
  36:  */
  37: #include "splicer-creation-c.h"
  38: 
  39: /*
  40:  * Convenience functions from utilities file.
  41:  */
  42: extern void RegisterBxConverters();
  43: extern XtPointer CONVERT();
  44: extern XtPointer DOUBLE();
  45: extern XtPointer SINGLE();
  46: extern void MENU_POST();
  47: extern Pixmap XPM_PIXMAP();
  48: extern void SET_BACKGROUND_COLOR();
  49: 
  50: /*
  51:  * Declarations for shell callbacks.
  52:  */
  53: void TextReportCreate();
  54: void TextReportDestroy();
  55: void TextReportUp();
  56: void TextReportDown();
  57: void DrawDepthOffsetCreate();
  58: void DrawDepthOffsetDestroy();
  59: void DrawDepthOffsetUp();
  60: void DrawDepthOffsetDown();
  61: void TopLevelDestroy();
  62: 
  63: /* Begin user code block <globals> */
  64: #include <stdio.h>
  65: #include <malloc.h>
  66: #include "splicer_globals.h"
  67: 
  68: XtAppContext app;
  69: XmStringCharSet charset = XmSTRING_DEFAULT_CHARSET;
  70: 
  71: /* test creating a font list
  72: */
  73: XFontStruct *splicer_font;
  74: XmFontList fontlist;
  75: 
  76: /* End user code block <globals> */
  77: 
  78: /*
  79:  * Change this line via the Output Application Names Dialog.
  80:  */
  81: #define BX_APP_CLASS "BuilderProduct"
  82: 
  83: int main(argc, argv)
  84:  int argc;
  85:  char **argv;
  86: {
  87:     Widget       parent;
  88:     Arg          args[256];
  89:     Cardinal     ac;
  90:     Boolean      argok=False;
  91:     Widget   topLevelShell;
  92:     
  93:     /* Begin user code block <declarations> */
  94: 
  95:     int      splicer_procid, procid;
  96:     char     *string, *logo_path, *getenv();
  97:     FILE     *fd;
  98: 
  99:     /* launch splicer's logo
 100:     */
 101:     if((logo_path=(char*)calloc(1000, CHAR_SIZE))==NULL)
 102:                  SpBadMemAlloc("SplicerMain");
 103:     (void)strcpy(logo_path,(char*)getenv("SPLICER_LOGO_PATH"));
 104:     if((string=(char*)calloc((int)strlen(logo_path) + 500, CHAR_SIZE))==NULL)
 105:                  SpBadMemAlloc("SplicerMain");
 106:     
 107:     (void)sprintf(string, "%s/splicerLogo-main-c -bg %s -fg %s &", logo_path, LOGO_BG, LOGO_FG);
 108:     system(string);
 109:     free(string);
 110:     free(logo_path);
 111: 
 112:     splicer_procid = getpid();
 113:     (void)printf("Splicer: Process ID: %d\n", splicer_procid);
 114: 
 115:         SpInitialize(argc,argv);
 116: 
 117:     /* End user code block <declarations> */
 118:     
 119:     /*
 120:      * The applicationShell is created as an unrealized
 121:      * parent for multiple topLevelShells.  The topLevelShells
 122:      * are created as popup children of the applicationShell.
 123:      * This is a recommendation of Paul Asente & Ralph Swick in
 124:      * _X_Window_System_Toolkit_ p. 677.
 125:      */
 126:     
 127:     parent = XtVaAppInitialize ( &app, BX_APP_CLASS, NULL, 0, 
 128: #ifndef XlibSpecificationRelease
 129:     (Cardinal *) &argc, 
 130: #else
 131: #if (XlibSpecificationRelease>=5)
 132:     &argc, 
 133: #else
 134:     (Cardinal *) &argc, 
 135: #endif
 136: #endif
 137:     argv, NULL, 
 138:     NULL );
 139:     
 140:     RegisterBxConverters(app);
 141: #if (XmVersion >= 1002) 
 142:     XmRepTypeInstallTearOffModelConverter();
 143: #endif
 144:     
 145:     /* Begin user code block <create_shells> */
 146: 
 147:          splicer_font = XLoadQueryFont(XtDisplay(parent),
 148:                                        "-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1=default_font");
 149:          fontlist = XmFontListCreate(splicer_font, "splicer_charset");
 150: 
 151:     /* End user code block <create_shells> */
 152:     
 153:     /*
 154:      * Create classes and widgets used in this program. 
 155:      */
 156:     
 157:     /* Begin user code block <create_topLevelShell> */
 158:     /* End user code block <create_topLevelShell> */
 159:     
 160:     ac = 0;
 161:     XtSetArg(args[ac], XmNtitle, "Splicer  version 2.0"); ac++;
 162:     XtSetArg(args[ac], XmNiconName, "Splicer"); ac++;
 163:     XtSetArg(args[ac], XmNdefaultFontList, 
 164:         CONVERT(parent, "-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1=default_font", 
 165:         XmRFontList, 0, &argok)); if (argok) ac++;
 166:     XtSetArg(args[ac], XmNx, 3289); ac++;
 167:     XtSetArg(args[ac], XmNy, 1369); ac++;
 168:     XtSetArg(args[ac], XmNwidth, 1112); ac++;
 169:     XtSetArg(args[ac], XmNheight, 840); ac++;
 170:     topLevelShell = XtCreatePopupShell("topLevelShell",
 171:         topLevelShellWidgetClass,
 172:         parent,
 173:         args, 
 174:         ac);
 175:     XtAddCallback(topLevelShell, XmNdestroyCallback, TopLevelDestroy, (XtPointer)0);
 176:     formSplicer = (Widget)CreateformSplicer(topLevelShell);
 177:     XtManageChild(formSplicer);
 178:     XtPopup(XtParent(formSplicer), XtGrabNone);
 179: 
 180:     /* Begin user code block <create_xmDialogShellTextReport> */
 181:     /* End user code block <create_xmDialogShellTextReport> */
 182: 
 183:     formTextReport = (Widget)CreateformTextReport(parent);
 184:    /* XtManageChild(formTextReport);
 185:    */
 186: 
 187:     /* Begin user code block <create_xmDialogShellDrawDEpthOffset> */
 188:     /* End user code block <create_xmDialogShellDrawDEpthOffset> */
 189: 
 190:     formDepthOffset = (Widget)CreateformDepthOffset(parent);
 191:    /* XtManageChild(formDepthOffset);
 192:    */
 193:     
 194:     /* Begin user code block <app_procedures> */
 195: 
 196:          SpCreateReportCB(textReport, (XtPointer)NULL, (XtPointer)NULL);
 197:          SplicerInitialSettings(XtDisplay(topLevelShell));
 198: 
 199:     /* End user code block <app_procedures> */
 200:     
 201:     /* Begin user code block <main_loop> */
 202: 
 203:        /* kill splicer's logo by reading the pid from the file logo.pid
 204:        */  
 205:          if((fd=fopen("logo.pid", "r")) != NULL) {
 206:            fscanf(fd, "%d", &procid);
 207:            fclose(fd);
 208:            if(procid == -1) {
 209:          
 210:            }
 211:            else {
 212:              if((string=(char*)calloc(50, CHAR_SIZE))==NULL)
 213:                  SpBadMemAlloc("SplicerMain");
 214:              (void)sprintf(string, "kill -9 %d", procid);
 215:              (void)system(string);
 216:              free(string);
 217:            }
 218:          
 219:       
 220:            if((string=(char*)calloc(50, CHAR_SIZE))==NULL)
 221:                  SpBadMemAlloc("SplicerMain");
 222:            (void)sprintf(string, "rm logo.pid");
 223:            (void)system(string);
 224:            free(string);
 225:          }
 226: 
 227:     /* End user code block <main_loop> */
 228:     
 229:     XtAppMainLoop(app);
 230:     
 231:     /*
 232:      * A return value regardless of whether or not the main loop ends. 
 233:      */
 234:      return(0); 
 235: }
 236: 








































Html form generated by Xrefactory version 1.6.7 on Fri Sep 03 17:18:59 2004