/*[]=====================================================================[]*/ /*[] LeadTools Run Time Library - Version 12 []*/ /*[] []*/ /*[] []*/ /*[] Copyright (c) 1991-2001 by LEAD Technologies, Inc. []*/ /*[] All Rights Reserved. []*/ /*[]=====================================================================[]*/ #include "..\..\..\include\l_bitmap.h" #include "..\..\..\include\ltdlg.h" #include "..\..\..\include\ltsgm.h" #include "TCHAR.h" #include "resource.h" extern L_TCHAR szFrameClass[]; extern L_TCHAR szChildClass[]; extern HMENU hMenuInitWindow, hMenuChildWindow; extern HMENU hMenuInit, hMenuChild, hContextMenu, hContextCombineMenu; extern HINSTANCE hInstMain; extern HWND hwndFrame, hwndClient; #define INIT_MENU_POS 0 #define CHILD_MENU_POS 6 #define SCROLL_RATIO 50 #define IDM_FIRSTCHILD 50000 #define MRC_SAVEMRC 0 #define MRC_SAVEPDF 1 #define CHILDCREATELPARAM(lpCreateStruct) \ (((LPMDICREATESTRUCT) ((lpCreateStruct)->lpCreateParams))->lParam) HINSTANCE hInstMain; LRESULT CALLBACK FrameWndProc (HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK ChildWndProc (HWND, UINT, WPARAM, LPARAM); L_BOOL CALLBACK CloseEnumProc (HWND, LPARAM); L_BOOL CALLBACK AboutDlgProc (HWND, UINT, WPARAM, LPARAM); L_BOOL CALLBACK OptionsDlgProc (HWND, UINT, WPARAM, LPARAM); L_BOOL CALLBACK CodersDlgProc (HWND, UINT, WPARAM, LPARAM); L_BOOL CALLBACK SegmentTypeProc (HWND, UINT, WPARAM, LPARAM); L_BOOL CALLBACK SegmentInfoProc (HWND, UINT, WPARAM, LPARAM); L_BOOL CALLBACK L_EXPORT PaletteChangedAll (HWND hWnd, LPARAM lParam); L_BOOL CALLBACK L_EXPORT PaletteQueryAll(HWND hWnd, LPARAM lParam); HWND CreateChildWindow (L_TCHAR L_FAR * pszTitle, pBITMAPHANDLE pBitmap, L_BOOL bIsFile); L_INT DoDialogBoxParam (L_INT, HWND, DLGPROC, LPARAM); #define Trackbar_SetPos(hwnd, moveit, pos) \ (void)SendMessage((hwnd), TBM_SETPOS, (WPARAM)(BOOL)(moveit), \ (LPARAM)(pos)) #define Trackbar_GetPos(hwnd) \ (int)SendMessage((hwnd), TBM_GETPOS, 0, 0) #define Trackbar_SetRange(hwnd, redraw, lo, hi) \ (void)SendMessage((hwnd), TBM_SETRANGE, \ (WPARAM)(BOOL)(redraw), \ MAKELONG((WORD)(lo), (WORD)(hi))) #define Trackbar_SetPageSize(hwnd, size) \ (int)SendMessage((hwnd), TBM_SETPAGESIZE, 0, (LPARAM)(LONG)(size)) typedef struct _MANUALSEGMENT { RECT rcBitmapSeg; L_UINT uType; L_INT nSegId; } MANUALSEGMENT, L_FAR * pMANUALSEGMENT; typedef struct _tagBITMAPSEGMENTS { pMANUALSEGMENT pSegment; L_INT nSegmentCount; } BITMAPSEGMENTS, L_FAR* pBITMAPSEGMENTS; typedef struct _tagSEGMENTS { SEGMENTDATA SegData; L_INT nSegId; } SEGMENTS, L_FAR* pSEGMENTS; typedef struct tagCHILDDATA { HSEGMENTATION hSegment; HSEGMENTATION hPrevSegment; // This is for the undo process L_INT nVscrollPos; L_INT nVscrollMax; L_INT nVscrollStep; L_INT nHscrollPos; L_INT nHscrollMax; L_INT nHscrollStep; L_INT cxClient; L_INT cyClient; L_FLOAT fZoomVal; L_BOOL bFitToWindow; L_BOOL bMouseMove; L_BOOL bUpdateSegment; L_BOOL bLBDown; L_BOOL bShowSegmentType; RECT rcView; LPTSTR pszTitle; BITMAPHANDLE Bitmap; pSEGMENTS pSegments; // manual and/or auto Segments L_INT nSegments; // number of segments L_INT *pSelSegmentId; // Contains the selected segments ID's L_BOOL bManual; POINT ptManualStart; POINT ptManualEnd; POINT ptClickMove; L_BOOL bDrawSegment; L_INT nLineSel; HPALETTE hPalette; } CHILDDATA, L_FAR * LPCHILDDATA; typedef struct tagCREATEDATA { LPTSTR pszTitle; pBITMAPHANDLE pBitmap; L_BOOL bIsFile; L_INT nBitmapType; } CREATEDATA, L_FAR * LPCREATEDATA; typedef struct tagPDFDPIOPTIONS { L_INT nXResolution; L_INT nYResolution; } PDFDPIOPTIONS, L_FAR * LPPDFDPIOPTIONS; /*////////////////////////////////////////////////////////////////////////// / MACROS definition / ///////////////////////////////// ////////////////////////////////////////*/ #define FREEPOINTER(p) \ if (p) \ { \ GlobalFreePtr(p); \ p = NULL; \ } \ #define DELETEDCOBJECT() \ if (hPen) \ DeleteObject(hPen); \ if (hBrush) \ DeleteObject(hBrush); \ #define RESTOREDCOBJECT(h) \ SelectObject(h, hOldPen); \ SelectObject(h, hOldBrush); \ SetROP2(h, nOldMode); \ L_INT FindSelectionCount (LPCHILDDATA pData);