home *** CD-ROM | disk | FTP | other *** search
/ cyber.net 2 / cybernet2.ISO / qtw111 / pviewer / picture.h < prev    next >
Text File  |  1993-11-01  |  11KB  |  292 lines

  1.  
  2. // ---------------------------------------------------------------------
  3. //
  4. // Picture.h  - Picture Viewer - QuickTime for Windows
  5. //
  6. //              Version 1.0
  7. //
  8. //              (c) 1988-1992 Apple Computer, Inc. All Rights Reserved.
  9. //
  10. // ---------------------------------------------------------------------
  11.  
  12.  
  13. // Prevent multiple inclusion
  14. // --------------------------
  15.    #ifndef PICTURE_H
  16.       #define PICTURE_H
  17.  
  18. // Background brush
  19. // --------------------------
  20.    #define PICBACKGRNDBRUSH    GetStockObject( LTGRAY_BRUSH )
  21.  
  22.  
  23. // Typedef of structure used to store picture instance data
  24. // ----------------------------------------------------------------------
  25.  
  26. typedef struct {                            // Hungarian: spms
  27.       HWND              hwnd;               // Handle of control
  28.       WORD              wCurMax;            // Current maximum value
  29.       WORD              wCurPos;            // Current position
  30.       WORD              wCurLine;           // Current line size
  31.       WORD              wCurPage;           // Current page size
  32.       } SCROLLPARMS, * NPSCROLLPARMS;
  33.  
  34. typedef struct {                          // Hungarian: zs
  35.       HWND              hwnd;             // Handle of control
  36.       WORD              wCurZoomIndex;    // Current zoom
  37.       POINT             ptBucklePos;      // Saved buckle position
  38.       HBITMAP           hbmpNotBuckle;    // Handle to no buckle bitmap
  39.       } ZOOMSCROLL, * NPZOOMSCROLL;
  40.  
  41.  
  42. DECLARE_HANDLE(HPICTUREDATA);
  43.  
  44. typedef struct {                            // Hungarian: pd
  45.       char              szPicturePath[MAX_PATH_LEN];   // Path of picture
  46.       char              szPictureName[MAX_NAME_LEN];   // Name of picture
  47.       char              szPictureExt[FILE_EXT_LEN];    // File extension
  48.       WORD              wDuplicationIndex;  // Duplication index
  49.                                             // e.g. 1 if first, 2 if second
  50.       char              szPictType[30];     // Type of picture
  51.       char              szFileSize[18];     // "xxxK"
  52.       char              szFileSizeOnDisk[18];  // "xxxK on disk"
  53.       PicHandle         phPicture;          // Picture handle
  54.       HBITMAP           hbitmapIcon;        // Icon memory bitmap
  55.       LPBITMAPINFO      lpDIBIconMem;       // -> DIB icon bitmap info struct
  56.                                             // This is used only if monitor is 
  57.                                             // palettized
  58.       HPALETTE          hpalPicture;        // Picture palette (or NULL if none)
  59.       ImageDescription  idImageInfo;        // Image info
  60.       BOOL              bDisableSizeMsgProcessing;  // Flag used in WM_SIZE
  61.                                             // message processing
  62.       BOOL              wMinMaxEtc;         // Saved value used in WM_SIZE
  63.                                             // Message processing
  64.       SCROLLPARMS       spmsHScroll;        // Horz scroll parms
  65.       SCROLLPARMS       spmsVScroll;        // Horz scroll parms
  66.       ZOOMSCROLL        zsZoomScroll;       // Zoom scroll parms
  67.       RECT              rcCurPictureRect;   // Current picture rect.
  68.                                             // This rect includes scrolling
  69.       BOOL              bScrollWaitForPaint;// Disables scroll processing
  70.                                             // until after first paint occurs
  71.                                             // during activation processing.
  72.       HWND              hwndBanner;         // HWND of banner window
  73.       HWND              hwndGetInfo;        // HWND of info dialog box
  74.       HFONT             hfInfo;             // Font of info dialog box
  75.       RECT              rcGrowBox;          // RECT of grow box
  76.       BOOL              bGrowBoxSubclassed; // TRUE if grow box is successfully
  77.                                             // subclassed
  78.       QTOLE_OPTIONSPICTURE qtoleOptions;    // Ole picture options struct
  79.  
  80.      } PICTUREDATASTRUCT, * NPPICTUREDATA;
  81.  
  82. // Control ids
  83.    #define PICTURE_ZOOM_SCROLL         10  // child control id
  84.    #define PICTURE_HORZ_SCROLL         11  // child control id
  85.    #define PICTURE_VERT_SCROLL         12  // child control id
  86.    #define PICTURE_BANNER              13  // child control id
  87.  
  88. // Window classes for controls
  89. // ---------
  90.    #define PICTURE_ZOOM_CLASS        "PictureZoomScrollClass"
  91.    #define PICTURE_BANNER_CLASS      "PictureBannerClass"
  92.  
  93.  
  94. // Functions
  95. // -----------------------------------------------------------------------
  96.  
  97. // PictureZoomWndProc is the callback function for the zoom control
  98. //
  99.    LONG __export CALLBACK PictureZoomWndProc (HWND, UINT, WPARAM, LPARAM);
  100. // -----------------------------------------------------------------------
  101.  
  102. //  ProcessHorzScroll processes the horizontal scroll messages:
  103. //
  104. //
  105.    LONG FAR  ProcessHorzScroll   (HWND, WORD, int);
  106. // -----------------------------------------------------------------------
  107.  
  108. //  ProcessVertScroll processes the vertical scroll messages:
  109. //
  110. //
  111.    LONG FAR  ProcessVertScroll   (HWND, WORD, int);
  112. // -----------------------------------------------------------------------
  113.  
  114. //  ScrollToCorner scrolls the picture to upper-left and lower-right corners:
  115. //
  116. //
  117.    LONG FAR  ScrollToCorner      (HWND, WORD);
  118. // -----------------------------------------------------------------------
  119.  
  120. //  Resizes the child windows when the picture window is resized:
  121. //
  122. //
  123.    VOID FAR  ResizeKids          (HWND, WORD, WORD);
  124.  
  125. // -----------------------------------------------------------------------
  126.  
  127.  
  128. //  Creates the child windows for the picture window:
  129. //
  130. //
  131.    LONG FAR CreateViewerKids     (HWND, NPPICTUREDATA);
  132. // -----------------------------------------------------------------------
  133.  
  134.  
  135. //  Registers the picture resize scrollbar window:
  136. //
  137. //
  138.    BOOL FAR RegisterChildControls (HINSTANCE);
  139. // -----------------------------------------------------------------------
  140.  
  141.  
  142. //  Returns the client rect that corresponds to the given picture rect:
  143. //
  144. //
  145.    VOID FAR ClientRectFromPicture  (LPRECT);
  146. // -----------------------------------------------------------------------
  147.  
  148. //  Returns the max picture rect that corresponds to the given client rect:
  149. //
  150. //
  151.    VOID FAR PictureRectFromClient  (LPRECT);
  152. // -----------------------------------------------------------------------
  153.  
  154. //  Converts from client coordinates to picture coordinates:
  155. //
  156. //
  157.    VOID FAR ClientToPicture  (LPPOINT, WORD);
  158. // -----------------------------------------------------------------------
  159.  
  160. //  Converts from picture coordinates to client coordinates:
  161. //
  162. //
  163.    VOID FAR PictureToClient  (LPPOINT, WORD);
  164. // -----------------------------------------------------------------------
  165.  
  166.  
  167. //  Determines if the cursor is in the grow box corner
  168. //
  169. //
  170.    BOOL FAR IsInGrowBox         (HWND, POINT);
  171. // -----------------------------------------------------------------------
  172.  
  173.  
  174. //  Destroy the grow box bitmap
  175. //
  176. //
  177.    VOID FAR DestroyGrowBoxBitmap (VOID);
  178. // -----------------------------------------------------------------------
  179.  
  180.  
  181. //  Paint the grow box bitmap
  182. //
  183. //
  184.    VOID FAR PaintTheGrowBox     (HWND, HDC, NPPICTUREDATA);
  185. // -----------------------------------------------------------------------
  186.  
  187.  
  188. //  Limit the resizing to keep the windows inside the MDI rect when
  189. //  using the grow box
  190. //
  191. //
  192.    VOID FAR LimitTheDragSize    (HWND, BOOL);
  193. // -----------------------------------------------------------------------
  194.  
  195.  
  196. //  Initialize the maximized window grow box resizing:
  197. //
  198. //
  199.    BOOL FAR  InitMaxWndGrowBoxResize  (HWND, POINT);
  200. // -----------------------------------------------------------------------
  201.  
  202. //  Move the resize rect during maximized window grow box resizing:
  203. //
  204. //
  205.    VOID FAR  MoveTheFrameRect         (HWND, POINT);
  206. // -----------------------------------------------------------------------
  207.  
  208. //  Terminate the maximized window grow box resizing:
  209. //
  210. //
  211.    VOID FAR  EndMaxWndGrowBoxResize   (HWND);
  212. // -----------------------------------------------------------------------
  213.  
  214.  
  215. //