API Guide Home
(Online version only)

PalmDisplayExtent.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * Copyright (c) 2005 palmOne, Inc. or its subsidiaries.
00003  * All rights reserved.
00004  *****************************************************************************/
00005 /** 
00006  * @defgroup DispExt Display Extent Library
00007  *
00008  * @{
00009  * @}
00010  */
00011 /** 
00012  * @ingroup DispExt
00013  *
00014  */
00015  
00016 /**
00017  * @file    PalmDisplayExtent.h
00018  * @version 1.0
00019  *
00020  * @brief Public API for the Display Extent Library.
00021  * 
00022  *
00023  * <hr>
00024  */
00025 
00026  
00027 #ifndef __PALMDISPLAYEXTENT_H__
00028 #define __PALMDISPLAYEXTENT_H__
00029 
00030 #include <PalmTypes.h>
00031 #include <LibTraps.h>
00032 
00033 /**
00034  * @name Library type and creator
00035  *
00036  */
00037 /*@{*/
00038 #define dexLibName          "rotmgr"        /**< PalmDisplayExtent library name. */
00039 #define dexLibCreator       'rotM'              /**< PalmDisplayExtent Creator ID. */
00040 #define dexLibType          sysFileTLibrary     /**< PalmDisplayExtent type. */
00041 #define dexFtrNumVersion    (0)             /**< PalmDisplayExtent feature number. */
00042 /*@}*/
00043 
00044 
00045 /**
00046  * @name Library Traps
00047  *
00048  */
00049 /*@{*/
00050 #define kDexLibTrapOpen             sysLibTrapOpen      /**<        */
00051 #define kDexLibTrapClose            sysLibTrapClose     /**<        */
00052 
00053 
00054 #define kDexLibTrapDexGetDisplayAddress     (sysLibTrapCustom + 4)  /**<        */
00055 #define kDexLibTrapDexGetDisplayDimensions  (sysLibTrapCustom + 5)  /**<        */
00056 /*@}*/
00057 
00058 /********************************************************************
00059  * Prototypes
00060  ********************************************************************/
00061 #ifdef __cplusplus
00062 extern "C" {
00063 #endif
00064 
00065 /**
00066  * @brief Get the physical screen buffer (Display Address).
00067  *
00068  * 
00069  * @param refnum:   IN:  Reference number of the Display Extent Manager library.
00070  *
00071  * @retval Returns a pointer to the physical screen buffer.
00072  *
00073  * @remarks You should only use this function if direct screen access is required.
00074  *      This function returns a pointer to the physical display.
00075  *      If you need to do direct screen access in 90, 180, and 270 rotation, use this function.
00076  *      If you use the regular APIs (eg something like BmpGetBits(WinGetBimatp(WinDisplay())))
00077  *      you would get a back buffer pointer instead and would not see anything until you force
00078  *      a screen copy of this back buffer. Note that the address points to the top-left corner
00079  *          of the device in potrait mode always.
00080  * @code
00081  *      // this code draws 6400 red pixels in the screen.
00082  *
00083  *      RGBColorType color = { 0, 255, 0, 0 }; 
00084  *      IndexedColorType index = WinRGBToIndex(&color); 
00085  *      UInt8 *bufferP = (UInt8*)DexGetDisplayAddress(gDexLibRefNum);
00086  *      UInt32 x = 0; 
00087  *      
00088  *      for( x = 0; x < 6400; x++) 
00089  *           bufferP[x] = index; 
00090  *@endcode
00091  *
00092  */
00093 void *DexGetDisplayAddress(UInt16 refnum)                                       
00094                 SYS_TRAP(kDexLibTrapDexGetDisplayAddress);
00095 
00096 /**
00097  * @brief Get the physical screen width, height, and rowbytes.
00098  *
00099  * 
00100  * @param refnum:   IN:  Reference number of the Display Extent Manager library.
00101  * @param width     IN:  Pointer to the width of the screen.
00102  * @param height    IN:  Pointer to the height of the screen.
00103  * @param rowBytes  IN:  Pointer to the rowbytes of the screen.
00104  *
00105  * @retval Nothing
00106  *
00107  */
00108 void DexGetDisplayDimensions(UInt16 refnum, Coord *width, Coord *height, UInt16 *rowBytes)     
00109                 SYS_TRAP(kDexLibTrapDexGetDisplayDimensions);
00110 
00111 #ifdef __cplusplus
00112 }
00113 #endif
00114 
00115 #endif

Top Palm Developer Network
© 2004-2008, Palm, Inc. All rights reserved.
Generated on Fri Jun 13 10:06:54 2008 for Palm API Guide