home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / toollib_2 / Examples / GFXView / Builds / c / main < prev    next >
Encoding:
Text File  |  1996-06-13  |  1.4 KB  |  71 lines

  1. /*** Graphics View ***/
  2. /* A demonstration of Toolbox programming using OSLib
  3.  * (c) Paul Field 1995
  4.  * v1.00 - 18/9/1995
  5.  * v1.10 - 23/11/1995 : Now uses the ToolLib application framework
  6.  */
  7.  
  8. /* Notes:
  9.  *
  10.  * OSLib refers to toolbox events as 'actions' and, for consistancy, we follow
  11.  * this convention.
  12.  *
  13.  * The NOT_USED(var) macro is used to supress a compiler warnings about 'var'
  14.  * being declared but not being used. This warning occurs when the compiler
  15.  * features "ah" are enabled. You should activate these features because they
  16.  * enable useful warnings which can indicate bugs in your program.
  17.  */
  18.  
  19. #include <stdio.h>
  20.  
  21. #include "application.h"
  22. #include "nev_wimp.h"
  23. #include "shifting.h"
  24. #include "viewer.h"
  25.  
  26.  
  27. static void graphics_view_initialise(int argc, char *argv[])
  28.  { NOT_USED(argc);
  29.    NOT_USED(argv);
  30.  
  31. #ifndef NDEBUG
  32.    /* Redirect error stream */
  33.    freopen("pipe:$.debug", "w", stderr);
  34. #endif
  35.  
  36.    nevent_wimp_initialise();
  37.    shifting_initialise_for_toolbox();
  38.    viewer_initialise();
  39.  }
  40.  
  41.  
  42.  
  43. /* Respond to all actions and messages */
  44. /* Lists generated automatically by ToolLib */
  45. static const int toolbox_actions[] =
  46.  { 0x100,
  47.    0x44ec0,
  48.    0x82a91,
  49.    0x82c00,
  50.    0x82c02,
  51.    0
  52.  };
  53.  
  54. static const int wimp_messages[] =
  55.  { 0x3,
  56.    0x5,
  57.    0
  58.  };
  59.  
  60.  
  61. /* The variable which the application system required */
  62. application this_application =
  63.  { "<GFXView$Dir>",
  64.    310,
  65.    toolbox_actions,
  66.    wimp_messages,
  67.    5,
  68.    graphics_view_initialise,
  69.    NULL
  70.  };
  71.