www.pudn.com > helpview.zip > Display.h, change:1997-10-15,size:7933b


/* 
  
Copyright 1997 Willows Software, Inc.  
 
This library is free software; you can redistribute it and/or 
modify it under the terms of the GNU Library General Public License as 
published by the Free Software Foundation; either version 2 of the 
License, or (at your option) any later version. 
 
This library is distributed in the hope that it will be useful, 
but WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
Library General Public License for more details. 
 
You should have received a copy of the GNU Library General Public 
License along with this library; see the file COPYING.LIB.  If 
not, write to the Free Software Foundation, Inc., 675 Mass Ave, 
Cambridge, MA 02139, USA. 
 
*/ 
 
/************************************************************************* 
* 
* DISPLAY.H 
* Display related routines      
* 
* Author: Paul E. Kissel 
* 
**************************************************************************/ 
 
#ifndef DISPLAY_H 
#define DISPLAY_H 
 
/*********************************** 
** 
**  System Includes 
** 
***********************************/ 
#include <windows.h> 
 
 
/*********************************** 
** 
**  App. Includes 
** 
***********************************/ 
#include "fontbuff.h" 
#include "hotspots.h" 
 
 
/*********************************** 
** 
**  Shared Defines 
** 
***********************************/ 
 
typedef char * CHARPTR; 
typedef CHARPTR * CHARDBLPTR; 
 
 
/* Defines for INCHES. */ 
#define ONE_INCH         1440 
#define HALF_INCH         720 
#define EIGTH_INCH        180 
#define SIXTEENTH_INCH     90 
#define THIRTYSEC_INCH     45 
#define FORTIETH_INCH      29 
#define FORTYEIGTH_INCH    30 
#define SEVENSECONDTH_INCH 20 
#define NINTYSIXTH_INCH    15 
 
 
/*  
** Scroll bar data. 
*/ 
typedef struct tagSCROLLDATA 
{ 
  BOOL bVertScroll; /* Is there a vertical scroll bar? */ 
  BOOL bHorzScroll; /* Is there a horizontal scroll bar? */ 
 
  WORD wVertPos;    /* Current vertical offset from 0 position. */ 
  WORD wMaxVertPos; /* The maximum vertical offset from 0 position. */ 
 
  WORD wHorzPos;    /* Current horzontal offset from 0 position. */ 
  WORD wMaxHorzPos; /* The maximum horzontal offset from 0 position. */ 
 
  WORD wVertLine;  /* How many pixels we move vertically on a single up/down. */ 
  WORD wVertPage;  /* How many pixels we move vertically on a single pg up/pg down. */ 
 
  WORD wHorzLine;  /* How many pixels we move horizontally on a single left/right. */ 
  WORD wHorzPage;  /* How many pixels we move horizontally on a single pg left/pg right. */ 
} 
SCROLLDATA; 
typedef SCROLLDATA * FPSCROLLDATA; 
 
 
/* Text/Picture/Border display list and list info. */ 
typedef struct tagDISPLAYLIST 
{ 
  WORD    wNumRecords;      /* Number of used records in the list. */ 
  WORD    wMaxRecords;      /* Number of total (used/unused) records in the list. */ 
  HGLOBAL hRecordList;      /* List of display records ( different record types ). */ 
} 
DISPLAYLIST; 
typedef DISPLAYLIST * FPDISPLAYLIST; 
 
 
/*  
** A window's display information. 
*/ 
typedef struct tagDISPLAYINFO 
{ 
  /* Topic data. */ 
  HGLOBAL hTopicData;            /* Topic's element list and file info. */ 
 
  /* Page layout lists. */ 
  HGLOBAL hTxtDisplayList;       /* List of TXTDISPLAYREC structures. */ 
  HGLOBAL hBorderDisplayList;    /* List of BORDERDISPLAYREC structures. */ 
  HGLOBAL hPictDisplayList;      /* List of PICTDISPLAYREC structures for justified picts. */ 
  FPDISPLAYLIST fpTxtDisplayList; 
  FPDISPLAYLIST fpBorderDisplayList; 
  FPDISPLAYLIST fpPictDisplayList; 
 
  HHOTSPOTBUFFER hHotSpotBuffer; /* Hotspots in the display. */ 
  HFONTBUFFER hFontBuffer;       /* Window's font buffer. */ 
  SCROLLDATA ScrollData;         /* Scroll bar data. */ 
  POINT DisplaySize;             /* Size of window's display area (client area). */ 
                                 
  WORD  wTopDisplayRec;          /* Number of display record displayed at the top of window. */ 
  WORD  wTopDisplayList;         /* The type of display list that the top record is in. */ 
  DWORD dwTopDisplayRecVertPos;  /* Vertical Page position of the top display record. */ 
 
  BOOL bHaveInitVertPos;         /* Use an initial vertical scroll bar position value. */ 
 
  BOOL bIgnoreVertPosCode;       /* Should we initially scroll the topic to a position indicated 
                                    by a scroll display element found in the element list. 
                                    We should not if the topic is being displayed is from the 
                                    Back or History list.  The back or history list's store 
                                    their own vertical position value which overrides and other 
                                    vertical scroll info. */ 
  BOOL bFoundVertPosCode;        /* Was there a vertical scrolling code in the element list. */ 
  long int VertPosCodeYPos;      /* Page position when a vertical position code was encountered. */ 
   
  /*  
  ** Page offsets from top left corner of page  
  ** to part of page shown in window.  
  */ 
  long int PageXPosOffset;    /* Horzontal offset to visible part of page. */ 
  long int PageYPosOffset;    /* Vertical offset to visible part of page. */ 
 
  DWORD dwPageWidth;          /* Width of topic's page (including non-visible objects). */ 
  DWORD dwPageHeight;         /* Height of topic's page (including non-visible objects). */ 
  DWORD dwPageWidthVisible;   /* Width of topic's page (only visible objects). */ 
  DWORD dwPageHeightVisible;  /* Height of topic's page (only visible objects). */ 
 
  COLORREF BGColor;          /* Color of window's background. */ 
}  
DISPLAYINFO; 
typedef DISPLAYINFO * FPDISPLAYINFO; 
 
 
/*  
** Different places in which to format and 
** draw a topic data. 
*/ 
typedef enum  
{ 
  NONSCROLLTOPICWND,     
  SCROLLTOPICWND,     
  POPUPTOPICWND, 
  PRINTER 
} 
DESTINATIONTYPE; 
 
 
/*********************************** 
** 
**  Shared Function Prototypes 
** 
***********************************/ 
 
BOOL StartDisplaySystem( HWND hWnd, DESTINATIONTYPE DestType ); 
void StopDisplaySystem( HWND hWnd, DESTINATIONTYPE DestType ); 
 
BOOL UnlockSameTopic( HWND hWnd, FPNEWTOPICSTRUCT NewTopicStructPtr ); 
HTOPICDATA GetWndTopicData( HWND hWnd ); 
BOOL SameHelpFile( HWND hWnd, FPNEWTOPICSTRUCT NewTopicStructPtr ); 
void SetNewDisplayTopic( HWND hWnd, FPNEWTOPICSTRUCT NewTopicStructPtr ); 
void ResetDisplayInfo( HWND hWnd, FPNEWTOPICSTRUCT NewTopicStructPtr ); 
void SetNewDisplayTopic2( HWND hWnd, FPNEWTOPICSTRUCT NewTopicStructPtr ); 
 
void SetDisplayBGColor( HWND hWnd, COLORREF ColorRef ); 
COLORREF GetDisplayBGColor( HWND hWnd ); 
 
BOOL SizeNonScrollWindow( HWND hWnd, RECT * fpMaxSizeRect ); 
BOOL DisplayNonScrollTopic( HWND hWnd ); 
BOOL HasNonScrollData( HWND hWnd ); 
 
BOOL SizePopupWindow( HWND hWnd, RECT * HotSpotPosRect, BOOL bCenterVertOver ); 
BOOL DisplayPopupTopic( HWND hWnd ); 
 
BOOL DisplayTopic( HWND hWnd ); 
 
void UpdateScrollBar( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ); 
WORD GetVertScrollPos( HWND hWnd ); 
 
void SetCorrectCursor( HWND hWnd, POINT WndPoint ); 
 
BOOL GetHotSpotTopicInfo 
(  
  HWND hWnd,                           /* Topic window. */ 
  POINT WndPoint,                      /* Mouse click window position point. */ 
  HTOPICDATA * hNewTopicsData,   /* Hot spots data. */ 
  HOTSPOTTYPE * HotSpotType,     /* Type of hotspot. */ 
  RECT * WndPosRect,             /* Position of hotspot - used for popups. */ 
  char * SecWndNamePtr,          /* Secondary window's name. */ 
  CHARDBLPTR MacroDblPtr               /* Macro string - If hotspot is linked to a macro. */ 
); 
 
void CopyTopicToClipboard( HWND hTopicWnd ); 
HGLOBAL GetTopicsText( HWND hWnd ); 
 
BOOL PrintPage( HDC hPrinterDC, HWND hMainWnd, HWND hTopicWnd ); 
 
#endif