home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / d / desklib / !DeskLib / h_doc / Screen < prev    next >
Encoding:
Text File  |  1997-01-20  |  3.3 KB  |  101 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Screen.h
  12.     Author:  Copyright © 1992 Jasn Williams
  13.     Version: 1.00 (23 Mar 1992)
  14.     Purpose: Screen functions (read size, eig factors, etc.)
  15.     History: JS 20 Jan 1997 No longer returns immediately if
  16.              mode hasn't changed.
  17. */
  18.  
  19. #ifndef __Desk_Screen_h
  20. #define __Desk_Screen_h
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26.  
  27. #ifndef __Desk_Wimp_h
  28.     #include "Desk.Wimp.h"
  29. #endif
  30.  
  31. /* EXTRA NOTES:
  32.  * See Handler.c and '!TestApp.c' for examples of Desk_mode_change handlers to
  33.  * automatically keep all these mode variables up-to-date, etc.
  34.  */
  35.  
  36. /* These variables can be accessed globally for maximum efficiency.
  37.  * Note that they are not valid unless Desk_screen_mode == the current screen mode
  38.  * This can be guaranteed if you call Desk_Screen_CacheModeInfo() every time
  39.  * you get a mode change message, or before you attempt to use these variables
  40.  *
  41.  * Usage should be:
  42.  *   Desk_Screen_CacheModeInfo();
  43.  *   ...
  44.  *   screenwidth = Desk_screen_size.x;   (or whatever)
  45.  *   ...
  46.  */
  47.  
  48.  
  49.  
  50.  
  51. #ifdef Desk__using_SDLS
  52.   extern int        *Desk_Screen__Ref_mode( void);
  53.   extern Desk_wimp_point *Desk_Screen__Ref_size( void);
  54.   extern Desk_wimp_point *Desk_Screen__Ref_eig( void);
  55.   extern Desk_wimp_point *Desk_Screen__Ref_delta( void);
  56.   extern int        *Desk_Screen__Ref_bpp( void);
  57. #endif
  58.  
  59. #if defined( Desk__using_SDLS) && !defined( Desk__making_Misc)
  60.   #define Desk_screen_mode  (*Desk_Screen__Ref_mode())
  61.   #define Desk_screen_size  (*Desk_Screen__Ref_size())
  62.   #define Desk_screen_eig   (*Desk_Screen__Ref_eig())
  63.   #define Desk_screen_delta (*Desk_Screen__Ref_delta())
  64.   #define Desk_screen_bpp   (*Desk_Screen__Ref_bpp())
  65. #else
  66.   extern int        Desk_screen_mode;
  67.   extern Desk_wimp_point Desk_screen_size;
  68.   extern Desk_wimp_point Desk_screen_eig;        /* Log2( Desk_screen_delta)        */
  69.   extern Desk_wimp_point Desk_screen_delta;    /* pixel size in os coors    */
  70.   extern int        Desk_screen_bpp;        /* Bits per pixel        */
  71. #endif
  72.  
  73.  
  74.  
  75. extern Desk_bool Desk_Screen_CacheModeInfo(void);
  76.  /*
  77.   * This should be called before you try to use any of the above screen 
  78.   * variables. It only needs to be called whenever the screen mode changes
  79.   * so call it:
  80.   *   a) When you initialise your program, and whenever a mode change
  81.   *      message is received (see ModeChangeHandler, below)
  82.   *   b) Immediately before you use the variables (i.e. in your redraw
  83.   *      handler, etc.)
  84.   * 
  85.   * Note that the old behaviour of 'checking the screenmode, and if it
  86.   * has not changed, then the variables
  87.   * are not updated, so it is not too bad if you call it more often than
  88.   * you really need to (i.e. every time you redraw, for example).'
  89.   * - is no longer done, because under RO3.5, mode can be pointer which might
  90.   * not change over mode change.
  91.   
  92.   */
  93.  
  94.  
  95. #ifdef __cplusplus
  96. }
  97. #endif
  98.  
  99.  
  100. #endif
  101.