| 1 | /***
 | 
|---|
| 2 |  This file belongs to the Gotcha! distribution.
 | 
|---|
| 3 |  Copyright (C) 1998-2002 Thorsten Thielen <thth@c2226.de>
 | 
|---|
| 4 | 
 | 
|---|
| 5 |  This program is free software; you can redistribute it and/or modify
 | 
|---|
| 6 |  it under the terms of the GNU General Public License as published by
 | 
|---|
| 7 |  the Free Software Foundation; either version 2 of the License, or
 | 
|---|
| 8 |  (at your option) any later version.
 | 
|---|
| 9 | 
 | 
|---|
| 10 |  This program is distributed in the hope that it will be useful,
 | 
|---|
| 11 |  but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|---|
| 12 |  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
|---|
| 13 |  GNU General Public License for more details.
 | 
|---|
| 14 | 
 | 
|---|
| 15 |  You should have received a copy of the GNU General Public License
 | 
|---|
| 16 |  along with this program; if not, write to the Free Software
 | 
|---|
| 17 |  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 | 
|---|
| 18 |  ***/
 | 
|---|
| 19 | 
 | 
|---|
| 20 | #ifndef _GOTCHA_H_
 | 
|---|
| 21 | #define _GOTCHA_H_
 | 
|---|
| 22 | 
 | 
|---|
| 23 | #define INCL_PM
 | 
|---|
| 24 | #define INCL_GPI
 | 
|---|
| 25 | #define INCL_DOS
 | 
|---|
| 26 | #define INCL_DOSERRORS
 | 
|---|
| 27 | #define INCL_DOSMODULEMGR
 | 
|---|
| 28 | #define INCL_DOSRESOURCES
 | 
|---|
| 29 | #define INCL_WINHELP
 | 
|---|
| 30 | #define INCL_MMIOOS2
 | 
|---|
| 31 | 
 | 
|---|
| 32 | #define OS2EMX_PLAIN_CHAR
 | 
|---|
| 33 | 
 | 
|---|
| 34 | #include <os2.h>
 | 
|---|
| 35 | 
 | 
|---|
| 36 | #include <memory.h>
 | 
|---|
| 37 | #include <stdlib.h>
 | 
|---|
| 38 | #include <stdio.h>
 | 
|---|
| 39 | #include <stdarg.h>
 | 
|---|
| 40 | 
 | 
|---|
| 41 | #include "config.h"
 | 
|---|
| 42 | 
 | 
|---|
| 43 | #include "id.h"
 | 
|---|
| 44 | #include "rstring.h"
 | 
|---|
| 45 | #include "version.h"
 | 
|---|
| 46 | #include "helper.h"
 | 
|---|
| 47 | #include "settings.h"
 | 
|---|
| 48 | 
 | 
|---|
| 49 | //#define  _PMPRINTF_
 | 
|---|
| 50 | //#include "PMPRINTF.H"
 | 
|---|
| 51 | 
 | 
|---|
| 52 | #define PSZ_EXTENSION    ".bmp"
 | 
|---|
| 53 | 
 | 
|---|
| 54 | typedef class Settings SETTINGS;
 | 
|---|
| 55 | typedef SETTINGS *PSETTINGS;
 | 
|---|
| 56 | 
 | 
|---|
| 57 | enum
 | 
|---|
| 58 | {
 | 
|---|
| 59 |     STATE_IDLE, STATE_WAITFORHIDE, STATE_SELECTWINDOW, STATE_WINDOWSELECTED,
 | 
|---|
| 60 |     STATE_CAPTURE, STATE_WAITFORHIDE2,
 | 
|---|
| 61 | };
 | 
|---|
| 62 | 
 | 
|---|
| 63 | enum
 | 
|---|
| 64 | {
 | 
|---|
| 65 |     CAP_SCREEN, CAP_SCREENREGION, CAP_WINDOW, CAP_WINDOWINT,
 | 
|---|
| 66 | };
 | 
|---|
| 67 | 
 | 
|---|
| 68 | extern HAB hab;
 | 
|---|
| 69 | #define GETHAB hab
 | 
|---|
| 70 | 
 | 
|---|
| 71 | extern PSETTINGS pset;
 | 
|---|
| 72 | extern HWND hwndFrame, hwndSnapshot, g_hwndMenuSSW, g_hwndSettingsDialog, g_hwndPage0;
 | 
|---|
| 73 | 
 | 
|---|
| 74 | extern HMODULE g_hmod;
 | 
|---|
| 75 | #define GETMODULE g_hmod
 | 
|---|
| 76 | 
 | 
|---|
| 77 | extern class Helper *g_help;
 | 
|---|
| 78 | 
 | 
|---|
| 79 | BOOL CheckCmdlineArgs (int argc, char *argv[]);
 | 
|---|
| 80 | 
 | 
|---|
| 81 | HWND     CreateMainWindow (VOID);
 | 
|---|
| 82 | HWND     CreateSnapshotWindow (VOID);
 | 
|---|
| 83 | 
 | 
|---|
| 84 | VOID     Drag (HWND hwnd);
 | 
|---|
| 85 | 
 | 
|---|
| 86 | HBITMAP  CaptureWindow (HWND hwnd, HWND hwndParent, PRECTL prcl, BOOL f);
 | 
|---|
| 87 | VOID     SaveBitmap (HBITMAP hbm, HPS hps, int width, int height,
 | 
|---|
| 88 |                      int bitCount, char *title);
 | 
|---|
| 89 | VOID     SaveBitmapToClipboard (HBITMAP hbm);
 | 
|---|
| 90 | //VOID     SaveBitmapToFile (HBITMAP hbm, PSZ psz, HPS hps);
 | 
|---|
| 91 | VOID     StartSelection (HWND hwnd);
 | 
|---|
| 92 | BOOL     SelectSaveFile (char *title);
 | 
|---|
| 93 | BOOL     DoTracking (RECTL *prclTrack);
 | 
|---|
| 94 | VOID     AddSysMenuItem (HWND hwndFrame, MENUITEM *Item, PSZ Text);
 | 
|---|
| 95 | 
 | 
|---|
| 96 | VOID     AboutBox (HWND hwnd);
 | 
|---|
| 97 | 
 | 
|---|
| 98 | MRESULT EXPENTRY
 | 
|---|
| 99 |     WindowProcedure (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
 | 
|---|
| 100 | MRESULT EXPENTRY
 | 
|---|
| 101 |     FrameProcedure (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
 | 
|---|
| 102 | MRESULT EXPENTRY
 | 
|---|
| 103 |     wpSnapshot (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
 | 
|---|
| 104 | MRESULT EXPENTRY
 | 
|---|
| 105 |     wpNewButton (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
 | 
|---|
| 106 | 
 | 
|---|
| 107 | MRESULT EXPENTRY
 | 
|---|
| 108 |     FileDLGProcedure (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
 | 
|---|
| 109 | 
 | 
|---|
| 110 | PSZ AddExtensionToFilename( PSZ psz );
 | 
|---|
| 111 | 
 | 
|---|
| 112 | VOID     DisplayError (PSZ pszTitle, PSZ psz, ...);
 | 
|---|
| 113 | APIRET   saymsg2(int DefaultButton, HWND hwnd,
 | 
|---|
| 114 |                  PCSZ pszTitle, PCSZ pszFmt, ...);
 | 
|---|
| 115 | VOID     DoCountdown (ULONG ul);
 | 
|---|
| 116 | VOID     AdjustSaveTypeButtons (BOOL f);
 | 
|---|
| 117 | 
 | 
|---|
| 118 | //BOOL SetEAs (PSZ psz);
 | 
|---|
| 119 | VOID SetIdlePriority (BOOL f);
 | 
|---|
| 120 | 
 | 
|---|
| 121 | #ifdef _DOLOGMEM_
 | 
|---|
| 122 | VOID LogMem (PSZ psz, BOOL f);
 | 
|---|
| 123 | #endif
 | 
|---|
| 124 | 
 | 
|---|
| 125 | #ifdef _DOLOGDEBUG_
 | 
|---|
| 126 | VOID LogDebug( PSZ psz, ... );
 | 
|---|
| 127 | #endif
 | 
|---|
| 128 | 
 | 
|---|
| 129 | #endif
 | 
|---|