home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 August - Disc 3 / chip_20018103_hu.iso / amiga / chiputil / millibar.lha / millibar010 / example1.c next >
Encoding:
C/C++ Source or Header  |  1995-09-19  |  1.4 KB  |  82 lines

  1. /* Example for   millibar.library */
  2. /*                                */
  3. /* By Stefan Popp 06/2001         */
  4.  
  5.  
  6. #include "stdio.h"
  7. #include <exec/types.h>
  8. #include <intuition/intuition.h>
  9. #include <intuition/intuitionbase.h>
  10. #include <graphics/gfxbase.h>
  11. #include <stdlib.h>
  12. #include <clib/exec_protos.h>
  13. #include <clib/graphics_protos.h>
  14. #include <clib/intuition_protos.h>
  15.  
  16. #include <exec/libraries.h>
  17. #include <pragma/exec_lib.h>
  18.  
  19. #include "millibar.h"
  20. #include "millibar_protos.h"
  21. #include "millibar_lib.h"
  22.  
  23. struct Library *MBCBase;
  24.  
  25. main()
  26. {
  27.  
  28.  
  29.  struct NewScreen ns = {
  30.  
  31.  0,0,
  32.  640,256,
  33.  2,
  34.  0,1,
  35.  HIRES,
  36.  CUSTOMSCREEN,
  37.  NULL,
  38.  (UBYTE *) "Millibar T E S T",
  39.  NULL,
  40.  NULL };
  41.  
  42.  struct Library *IntuitionBase, *gfxbase;
  43.  struct Screen *screen;
  44.  struct RastPort *rp;
  45.  
  46.  
  47.  MBC_PAR mbc_par;
  48.  char xx[10];
  49.  
  50.  
  51.  if (!(IntuitionBase=OpenLibrary("intuition.library",39L)))
  52.   exit (100);
  53.  if (!(gfxbase=(struct Library*)OpenLibrary("graphics.library",39L)))
  54.   exit(100);
  55.  if (!(MBCBase=(struct Library*)OpenLibrary("millibar.library",1)))
  56.   exit(100);
  57.  
  58.  screen = (struct Screen*) OpenScreen(&ns);
  59.  
  60.  rp = &screen->RastPort;
  61.  
  62.  mbc_par.rp       = rp;
  63.  mbc_par.code     = "123456";
  64.  mbc_par.xpos     = 50;
  65.  mbc_par.ypos     = 50;
  66.  mbc_par.yscale   = 100;
  67.  mbc_par.xscale   = 3;
  68.  mbc_par.codetype = CODABAR;
  69.  
  70.  mbc_draw_code_e ( &mbc_par );
  71.  
  72.  scanf("%s",xx);
  73.  
  74.  CloseScreen(screen);
  75.  
  76.  CloseLibrary(IntuitionBase);
  77.  
  78.  CloseLibrary(gfxbase);
  79.  CloseLibrary(MBCBase);
  80.  
  81. }
  82.