home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / gpiimage.zip / IMG_XTRN.H < prev    next >
C/C++ Source or Header  |  1998-04-20  |  7KB  |  173 lines

  1. /*static char *SCCSID = "@(#)img_xtrn.h    6.8 92/02/10";*/
  2. /**************************************************************************
  3.  *  File name  :  img_xtrn.h
  4.  *
  5.  *  Description:   This header file contains the application wide function
  6.  *                 declarations and global external variables.
  7.  *
  8.  *  Concepts   :  function prototypes
  9.  *
  10.  *  API's      :  [none]
  11.  *
  12.  *  Required
  13.  *    Files    :  [none]
  14.  *
  15.  *  Copyright (C) 1991 IBM Corporation
  16.  *
  17.  *      DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
  18.  *      sample code created by IBM Corporation. This sample code is not
  19.  *      part of any standard or IBM product and is provided to you solely
  20.  *      for  the purpose of assisting you in the development of your
  21.  *      applications.  The code is provided "AS IS", without
  22.  *      warranty of any kind.  IBM shall not be liable for any damages
  23.  *      arising out of your use of the sample code, even if they have been
  24.  *      advised of the possibility of such damages.                                                    *
  25.  *************************************************************************/
  26. /*
  27.  *  Global variables
  28.  */
  29. extern HAB      vhab;                    /* anchor block handle */
  30. extern HDC      vhdcMem;        /* memory device context handle */
  31. extern HDC      vhdc;           /* window device context handle */
  32. extern HPS      vhps;                        /* image PS handle */
  33. extern HPS      vhpsMem;                    /* memory PS handle */
  34. extern BOOL     vfImgLoaded;      /* initially image not loaded */
  35. extern BOOL     vfDetail;        /* view non-detailed initially */
  36. extern BOOL     vfMaximized;  /* initially window not maximized */
  37. extern BOOL     vfHelpEnabled;    /* set when help installed ok */
  38. extern HWND     vhwndFrame;        /* image window frame handle */
  39. extern HWND     vhwndClient;       /* main window client handle */
  40. extern HWND     vhwndVScroll;      /* vertical scrollbar handle */
  41. extern HWND     vhwndHScroll;    /* horizontal scrollbar handle */
  42. extern HWND     vhwndMenu;                   /* menu bar handle */
  43. extern LONG     vlXScreen;                      /* screen width */
  44. extern LONG     vlYScreen;                     /* screen height */
  45. extern LONG     vlcxVScroll;         /* vertical scrollbar size */
  46. extern LONG     vlcyHScroll;       /* horizontal scrollbar size */
  47. extern HWND     vhwndViewForeClr;      /* foregrnd color handle */
  48. extern HWND     vhwndViewBackClr;      /* backgrnd color handle */
  49. extern LONG     vlcyTitle;                   /* titlebar height */
  50. extern LONG     vlcyMenu;                     /* menubar height */
  51. extern LONG     vlcxBorder;                /* size border width */
  52. extern LONG     vlcyBorder;               /* size border height */
  53. extern LONG     vlForeClr;          /* initial foreground color */
  54. extern LONG     vlBackClr;          /* initial background color */
  55.  
  56. #if (defined(PORT_16) || defined(PORT_32))
  57.    extern PBYTE vpbImgBuf;                 /* image storage buffer */
  58. #elif PORT_S132
  59.    extern BYTE _far16 *vpbImgBuf;          /* image storage buffer */
  60. #else
  61.                                  /* not defined for 16-bit port */
  62. #endif
  63.  
  64. extern PFNWP    vpfnwpFrame;     /* main frame-window procedure */
  65. extern SIZEL    vsizlImg;      /* width and height of the image */
  66. extern ULONG    vulScrollYMax;        /* maximum Y scroll range */
  67. extern ULONG    vulScrollXMax;        /* maximum X scroll range */
  68. extern POINTL   vptlSave;              /* save/restore position */
  69. extern HBITMAP  vhbm;                         /* bit-map handle */
  70. extern HPOINTER vhptrWait;          /* system hourglass pointer */
  71. extern HPOINTER vhptrArrow;             /* system arrow pointer */
  72. #ifndef PORT_16
  73. extern FILEDLG  vfdg;                  /* file dialog structure */
  74. #endif
  75. /*
  76.  *  Entry point declarations
  77.  */
  78. /* from img_pnt.c */
  79. VOID PaintUnSizedImage(VOID);
  80. VOID PaintSizedImage(VOID);
  81. VOID PaintDrawImage(VOID);
  82.  
  83. /* from img_init.c */
  84. #ifdef PORT_16
  85. USHORT Init(VOID);
  86. #endif
  87. #ifdef PORT_32
  88. ULONG Init(VOID);
  89. #endif
  90. VOID  ExitProc(USHORT usTermCode);
  91.  
  92. /* from img_size.c */
  93. VOID SizeMainWindow(VOID);
  94. BOOL SizeCalculateMaxWindow(PRECTL prclBound);
  95. VOID SizePositionImage(MPARAM mp2);
  96. VOID SizeVScroll(MPARAM mp2, RECTL rcl, POINTL ptl);
  97. VOID SizeHScroll(MPARAM mp2, RECTL rcl, POINTL ptl);
  98.  
  99. /* from img_main.c */
  100. int main(void);
  101. #ifdef PORT_16
  102. ULONG MessageBox(HWND hwndOwner, USHORT idMsg, USHORT idCaption,
  103.                  USHORT fsStyle, BOOL fBeep);
  104. MRESULT EXPENTRY MainWndProc(HWND hwnd,  USHORT msg, MPARAM mp1, MPARAM mp2);
  105. MRESULT EXPENTRY FrameWndProc(HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2);
  106. #endif
  107. #ifdef PORT_32
  108. ULONG MessageBox(HWND hwndOwner, ULONG idMsg, ULONG idCaption,
  109.                  ULONG fsStyle, BOOL fBeep);
  110. MRESULT EXPENTRY MainWndProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  111. MRESULT EXPENTRY FrameWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  112. #endif
  113.  
  114. /* from img_dlg.c */
  115. #ifdef PORT_16
  116. MRESULT EXPENTRY ColorDlgProc(HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2);
  117. MRESULT EXPENTRY ProductInfoDlgProc(HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2);
  118. #endif
  119. #ifdef PORT_32
  120. MRESULT EXPENTRY ColorDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  121. MRESULT EXPENTRY ProductInfoDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  122. #endif
  123. VOID             SetSysMenu(HWND hDlg);
  124.  
  125. /* from img_menu.c */
  126. VOID MenuEnableItem(HWND hwndMenu, SHORT idItem, BOOL fEnable);
  127. VOID  MenuInit(MPARAM mp1, MPARAM mp2);
  128. SHORT MenuGetColorItemId(SHORT idBase);
  129. VOID  MenuCheckItem(HWND hwndMenu, SHORT idItem, BOOL fCheck);
  130.  
  131. /* from img_view.c */
  132. VOID ViewSwitchMode(VOID);
  133. VOID ViewChangeColor(USHORT idColor);
  134. VOID ViewSavePosition(VOID);
  135. VOID ViewRestorePosition(VOID);
  136.  
  137. /* from img_file.c */
  138. BOOL FileOpen(MPARAM mp2);
  139.  
  140. /* from img_help.c */
  141. VOID HelpInit(VOID);
  142. VOID HelpUsingHelp(VOID);
  143. VOID HelpGeneral(VOID);
  144. VOID HelpIndex(VOID);
  145. VOID HelpProductInfo(VOID);
  146. VOID HelpDestroyInstance(VOID);
  147. VOID DisplayHelpPanel(ULONG);
  148.  
  149. /* from img_util.c */
  150. #if (defined(PORT_16) || defined(PORT_32))
  151.    LONG UtilFindFileSize(PSZ pszFilename);
  152.    BOOL UtilMemoryAllocate(USHORT cbSize, PBYTE FAR *ppByte);
  153.    BOOL UtilGetFileHandle(PSZ pszFilename, PHFILE phfile);
  154.    VOID UtilUpdateTitleText(HAB hab, HWND hwnd, PSZ pszFullFile);
  155. #endif
  156.  
  157. #ifdef PORT_S132
  158. LONG _far16 pascal UtilFindFileSize(CHAR _far16 *pszFilename);
  159. BOOL _far16 pascal UtilMemoryAllocate(USHORT cbSize, BYTE _far16 * _far16 *ppByte);
  160. BOOL _far16 pascal UtilGetFileHandle(CHAR _far16 *pszFilename, HFILE _far16 *phfile);
  161. VOID _far16 pascal UtilUpdateTitleText(HAB hab, HWND hwnd, CHAR _far16 *pszFullFile);
  162. #endif
  163.  
  164. #ifdef PORT_16
  165.    VOID UtilMemoryFree(SEL sel);
  166. #elif PORT_S132
  167.    VOID _far16 pascal UtilMemoryFree(SEL sel);
  168. #elif PORT_32
  169.    VOID UtilMemoryFree(PBYTE pByte);
  170. #else
  171. #endif
  172. /***************************  End of img_xtrn.h  *************************/
  173.