home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / dev / gui / guicreator / demos / videothek / videothek_main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-04  |  4.0 KB  |  104 lines

  1. /*************************************************************************/
  2. /*                                                                       */
  3. /*   GUI designed with GUICreator V1.0 - © 1995 by Markus Hillenbrand    */
  4. /*                                                                       */
  5. /*************************************************************************/
  6.  
  7. char *V="$VER: Videothek 2.005 (20 Jun 1995)";
  8.  
  9. /*************************************************************************/
  10. /*                                                                       */
  11. /*   Includes                                                            */
  12. /*                                                                       */
  13. /*************************************************************************/
  14.  
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17. #include <string.h>
  18. #include <wbstartup.h>
  19.  
  20. #include <exec/types.h>
  21. #include <exec/memory.h>
  22. #include <graphics/gfxbase.h>
  23. #include <intuition/gadgetclass.h>
  24.  
  25. #include <clib/alib_protos.h>
  26. #include <clib/exec_protos.h>
  27. #include <clib/intuition_protos.h>
  28. #include <clib/gadtools_protos.h>
  29. #include <clib/graphics_protos.h>
  30. #include <clib/dos_protos.h>
  31.  
  32. #include "Videothek.h"
  33. #include "Videothek_AppStruct.h"
  34. #include "Videothek_MyFunctions.h"
  35.  
  36. /*************************************************************************/
  37. /*                                                                       */
  38. /*   Variables and Structures                                            */
  39. /*                                                                       */
  40. /*************************************************************************/
  41.  
  42. struct IntuitionBase *IntuitionBase   = NULL;
  43. struct GfxBase       *GfxBase         = NULL;
  44.  
  45. struct Library *GadToolsBase          = NULL;
  46. struct Library *AslBase               = NULL;
  47. struct Library *UtilityBase           = NULL;
  48. struct Library *DataTypesBase         = NULL;
  49.  
  50.  
  51. /*************************************************************************/
  52. /*                                                                       */
  53. /*   main()                                                              */
  54. /*                                                                       */
  55. /*************************************************************************/
  56.  
  57. void main (int argc, char *argv[])
  58. {
  59.  
  60.    struct App userdata = { NULL,{},{},0,0,0,0,Neu};
  61.  
  62.    IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",39);
  63.    GfxBase      =(struct GfxBase *)      OpenLibrary("graphics.library" ,39);
  64.    GadToolsBase =OpenLibrary("gadtools.library" ,39);
  65.    AslBase      =OpenLibrary("asl.library"      ,39);
  66.    DataTypesBase=OpenLibrary("datatypes.library",39);
  67.    UtilityBase  =OpenLibrary("utility.library"  ,39);
  68.  
  69.    if (argc>0) userdata.SeitenLAENGE=atoi(argv[1]);
  70.  
  71.    if (IntuitionBase && GadToolsBase && GfxBase && AslBase && DataTypesBase && UtilityBase)
  72.       {
  73.       struct Screen *screen=LockPubScreen(NULL);
  74.       if (screen)
  75.          {
  76.          userdata.Eintraege=(struct List *)AllocMem(sizeof(struct List),MEMF_PUBLIC|MEMF_CLEAR);
  77.          if (userdata.Eintraege)
  78.             {
  79.             Init(userdata.ListeEintraege);
  80.             NewList(userdata.Eintraege);
  81.  
  82.             LoadData(&userdata);
  83.             HandleHauptfenster(screen,-1,-1,&userdata);
  84.             FreeNameNodes(userdata.Eintraege);
  85.             FreeMem(userdata.Eintraege,sizeof(struct List));
  86.  
  87.             UnlockPubScreen(NULL,screen);
  88.             }
  89.          else GUICreatorErrorReport(NULL,ERROR_NO_FREE_STORE);
  90.          AllesLoeschen(userdata.ListeEintraege);
  91.          }
  92.       else Printf("Cannot lock screen\n");
  93.       }
  94.    else Printf("Cannot open libraries v39!\n");
  95.  
  96.    if (AslBase)       CloseLibrary(AslBase);
  97.    if (UtilityBase)   CloseLibrary(UtilityBase);
  98.    if (GadToolsBase)  CloseLibrary(GadToolsBase);
  99.    if (DataTypesBase) CloseLibrary(DataTypesBase);
  100.    if (GfxBase)       CloseLibrary((struct Library *)GfxBase);
  101.    if (IntuitionBase) CloseLibrary((struct Library *)IntuitionBase);
  102. }
  103.  
  104.