home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / i / iv26_w_3.zip / EXAMPLES / ICLASS / ICLASS.DSK (.txt) < prev    next >
Turbo C Context File  |  1992-03-27  |  9KB  |  251 lines

  1. Turbo C Context File 
  2. ICLASS.DEF
  3. MAIN.C
  4. ICLASS.C
  5. GLOBALS.C
  6. DIRECTOR.C
  7. DIALOGS.C
  8. CLASSINF.C
  9. CLASSEDI.C
  10. CLASSBUF.C
  11. WINIVWIN.LIB
  12. WINIV.LIB
  13. ICLASS\*.*
  14. REG*.H
  15. INTERVIE\*.H
  16. ..\INCLUDE\DOS.H
  17. D:\BORLANDC\IV\ICLASS\*.*
  18. ..\BAK\WPAINT.C
  19. INTERVIE\X11\*.H
  20. GetLogFont
  21. Width
  22. width
  23. Width(
  24. stencil
  25. source
  26. searchpath
  27. overwrite
  28. REPEXP.C
  29. DIALOG.C
  30. STRINGEDI.C
  31. STRINGBRO.C
  32. FILEBROW.C
  33. REGEXP.C
  34. ICLASS\*.C
  35. REGEXPR.C
  36. ICLASS.DEF
  37. WINIV.LIB
  38. WINIVWIN.LIB
  39. D:\BORLANDC\IV\ICLASS\CLASSBUF.C
  40. D:\BORLANDC\IV\WORLDREP.C
  41. D:\BORLANDC\IV\WPALETTE.C
  42. D:\BORLANDC\IV\WINTER.C
  43. D:\BORLANDC\IV\XPAINT.C
  44. D:\BORLANDC\IV\PAINTER.C
  45. D:\BORLANDC\IV\WPAINTER.C
  46. D:\BORLANDC\IV\INTERVIE\X11\PAINTERR.H
  47. D:\BORLANDC\IV\WWORLD.C
  48. D:\BORLANDC\IV\PAINTERR.C
  49. D:\BORLANDC\IV\WPAINT.C
  50. D:\BORLANDC\IV\WINTER.C
  51. D:\BORLANDC\IV\WPAINTER.C
  52. D:\BORLANDC\IV\WINTER.C
  53. D:\BORLANDC\IV\EXAMPLES\ICLASS\MAIN.C
  54.     struct stat st;
  55.     return (
  56.     stat((char*)path, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR
  57.     );
  58.     boolean successful = IsADirectory(path);
  59.     if (successful) {
  60.     Clear();
  61.     char* p = new char[128];
  62.     ffblk fbl;
  63.     strcpy(p, path);
  64.     if (p[strlen(p)] == '\\') {
  65.         strcat(p, "*.*");
  66.     } else {
  67.        strcat(p, "\\*.*");
  68.     int done = findfirst(p, &fbl, FA_DIREC);
  69.     while (!done) {
  70.         Insert(fbl.ff_name, Position(fbl.ff_name));
  71.         done = findnext(&fbl);
  72.     delete p;
  73.     }
  74.     static char dir[MAXNAMLEN+1];
  75.     return getcwd(dir, MAXNAMLEN+1);
  76.     Frame* framedDialog = new ShadowFrame(dialog,3,3);
  77.     World* world = GetWorld();
  78.     Coord x, y;
  79.     Align(Center, 0, 0, x, y);
  80.     GetRelative(x, y, world);
  81.     world->InsertTransient(framedDialog, this, x, y, Center);
  82. void IClass::RemoveDialog (Interactor* dialog) {
  83.     Frame* framedDialog = (Frame*) dialog->Parent();
  84.     GetWorld()->Remove(framedDialog);
  85.     framedDialog->Remove(dialog);
  86.     delete framedDialog;
  87. void IClass::Complain (const char* msg) {
  88.     if (msg == nil) {
  89.         fprintf(stderr, "%c", '\007');
  90.     } else {
  91.         AcknowledgeDialog complaint(msg);
  92.         InsertDialog(&complaint);
  93.         complaint.Acknowledge();
  94.         RemoveDialog(&complaint);
  95.     }
  96. int re_search(regexp_t bufp, char* string, int size, int startpos,
  97.               int range, regexp_registers_t regs
  98. regexp_t bufp, char* string1, int size1, char* string2,
  99.                 int size2, int pos, int range, regexp_registers_t regs,
  100.                 int mstop
  101. regexp_t bufp, char* string1, int size1, char* string2, int size2,
  102.     int pos, regexp_registers_t regs, int mstop
  103. regexp_t bufp, char* string, int size, int pos, regexp_registers_t regs
  104. #include <windows.h>
  105. #include <string.h>
  106. const int MAXSIZE = 100;
  107. const int MAXARGUMENT = 25;
  108. HANDLE hInstance_;
  109. HANDLE hPrevInstance_;
  110. LPSTR  lpCmdLine_;
  111. int    nCmdShow_;
  112. int    argc_ = 0;
  113. char*  argv_[MAXARGUMENT];
  114. int    argc;
  115. char** argv;
  116.  *  IVMain ist die Main-Funktion der InterViews Anwendung. Sie wird von
  117.  *  WinMain, das selbst in diesem Header vor dem Anwender versteckt ist,
  118.  *  aufgerufen.
  119. int IVMain(int, char**);
  120.  *  Die Message Queue der Applikation wird vergr
  121. void SetMessageQueueLength () {
  122.     int size = MAXSIZE;
  123.     while (SetMessageQueue(size) == 0) {
  124.         size -= 5;
  125.     }
  126.  *  Die beiden Parameter argc und argv werden, wie unter C bekannt und
  127.  *  auch unter Interviews erwartet, erzeugt. IV ver
  128. ndert argc und argv
  129.  *  w
  130. hrend des Programmablaufes. Daher ist es notwendig, die Kommando-
  131.  *  zeilenparameter in einem eigenen Puffer abzustellen (argc_, argv_).
  132. void SetCommandLineArguments () {
  133.     char* arg;
  134.     char module[128];
  135.                      /* argv_[0] - Programmname */
  136.     GetModuleFileName(hInstance_, module, 128);
  137.     int len = strlen(module)+1;
  138.     argv_[argc_] = new char(len);
  139.     strcpy(argv_[argc_], module);
  140.     argc_++;
  141.                      /* argv_[i] - Kommandozeilenparameter */
  142.     arg = strtok(lpCmdLine_, " ");
  143.     if (arg) {
  144.          argv_[argc_] = arg;
  145. //         new char(strlen(arg)+1);
  146. //         strcpy(argv_[argc_], arg);
  147.          argc_++;
  148.          while ((arg = strtok(NULL, " ")) != NULL) {
  149.              argv_[argc_] = arg;
  150. //             new char(strlen(arg)+1);
  151. //             strcpy(argv_[argc_], arg);
  152.              argc_++;
  153.          }
  154.     }
  155.                      /* argc, argv */
  156.     argc = argc_;
  157.     argv = new char*[argc];
  158.     for (int i = 0; i < argc; i++) {
  159.         argv[i] = argv_[i];
  160.     }
  161. void DeleteCommandLineArguments () {
  162.     delete  argv_[0];
  163.  *  Diese Funktion ist der Eintrittspunkt von Windows. Sie soll vor dem
  164.  *  InterViews Anwender versteckt bleiben. Der Anwender hat damit das von
  165.  *  X gewohnte Bild seines Hauptprogrammes (einzige Konvention:
  166.  *  IVMain(int, char**) statt main(int, char**).
  167. int PASCAL WinMain(
  168.     HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpCmdLine, int nCmdShow
  169.     hInstance_     = hInstance;
  170.     hPrevInstance_ = hPrevInstance;
  171.     lpCmdLine_     = lpCmdLine;
  172.     nCmdShow_      = nCmdShow;
  173.     SetMessageQueueLength();
  174.     SetCommandLineArguments();
  175.     IVMain(argc, argv);
  176.     DeleteCommandLineArguments();
  177.     return(NULL);
  178.     if (strcmpi(ptr, "times") == 0) {
  179.         strcpy(typeface, "tms rmn");
  180.     } else if (strcmpi(ptr, "helvetica") == 0) {
  181.         strcpy(typeface, "helv");
  182.     } else if (strcmpi(ptr, "itc avant garde gothic") == 0) {
  183.         strcpy(typeface, "avant garde");
  184.     } else if (strcmpi(ptr, "new century schoolbook") == 0) {
  185.     }
  186.     if (strcmpi(typeface, "roman") == 0) {
  187.         strcpy(*font_resource, "romane.fon");
  188.         return true;
  189.     }
  190.     if (strcmpi(typeface, "tms rmn") == 0) {
  191.         strcpy(*font_resource, "tmsre.fon");
  192.         return true;
  193.     }
  194.     if (strcmpi(typeface, "courier") == 0) {
  195.         strcpy(*font_resource, "coure.fon");
  196.         return true;
  197.     }
  198.     if (strcmpi(typeface, "system") == 0) {
  199.         strcpy(*font_resource, "vgasys.fon");
  200.         return true;
  201.     }
  202.     if (strcmpi(typeface, "helv") == 0) {
  203.         strcpy(*font_resource, "helve.fon");
  204.         return true;
  205.     }
  206.     if (strcmpi(typeface, "modern") == 0) {
  207.         strcpy(*font_resource, "modern.fon");
  208.         return true;
  209.     }
  210.     if (strcmpi(typeface, "terminal") == 0) {
  211.         strcpy(*font_resource, "vgaoem.fon");
  212.         return true;
  213.     }
  214.     if (strcmpi(typeface, "symbol") == 0) {
  215.         strcpy(*font_resource, "symbole.fon");
  216.         return true;
  217.     }
  218.     if (strcmpi(typeface, "script") == 0) {
  219.         strcpy(*font_resource, "script.fon");
  220.     ifstream source;
  221.     char buf[FONTSTRINGSIZE];
  222.     char *ptr, *file;
  223.     file = searchpath("fonts.ali");
  224.     source.open(file, ios::nocreate);
  225.     while (!source.eof()) {
  226.     source.getline(buf, FONTSTRINGSIZE);
  227.     if (strstr(buf, f)) {
  228.         ptr = &buf[strlen(f)];
  229.         while (*ptr == ' ') {
  230.         ptr++;
  231.         }
  232.         strcpy(name, ptr);
  233.         return;
  234.     }
  235.     source.close();
  236.     ifstream source;
  237.     char buf[128];
  238.     char *ptr, *file;
  239.     file = searchpath("fonts.rsc");
  240.     source.open(file, ios::nocreate);
  241.     while (!source.eof()) {
  242.     source.getline(buf, 128);
  243.     if (strstr(buf, typeface)) {
  244.         ptr = strchr(buf, '@') + 1;
  245.         strcpy(*font_resource, ptr);
  246.             source.close();
  247.         return true;
  248.     }
  249.     source.close();
  250.     return false;
  251.