Added winebuild support for generating a .dbg.c file containing the
[wine] / programs / wineconsole / winecon_private.h
1 /*
2  * an application for displaying Win32 console
3  *
4  * Copyright 2001 Eric Pouech
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include <winbase.h>
22 #include <wincon.h>
23
24 #include "wineconsole_res.h"
25
26 /* this is the configuration stored & loaded into the registry */
27 struct config_data {
28     unsigned    cell_width;     /* width in pixels of a character */    
29     unsigned    cell_height;    /* height in pixels of a character */
30     int         cursor_size;    /* in % of cell height */
31     int         cursor_visible;
32     DWORD       def_attr;
33     WCHAR       face_name[32];  /* name of font (size is LF_FACESIZE) */
34     DWORD       font_weight;
35     DWORD       history_size;
36     DWORD       menu_mask;      /* MK_CONTROL MK_SHIFT mask to drive submenu opening */
37     DWORD       quick_edit;     /* whether mouse ops are sent to app (false) or used for content selection (true) */
38     unsigned    sb_width;       /* active screen buffer width */
39     unsigned    sb_height;      /* active screen buffer height */
40     unsigned    win_width;      /* size (in cells) of visible part of window (width & height) */
41     unsigned    win_height;
42     COORD       win_pos;        /* position (in cells) of visible part of screen buffer in window */
43 };
44
45 struct inner_data {
46     struct config_data  curcfg;
47     struct config_data  defcfg;
48
49     CHAR_INFO*          cells;          /* local copy of cells (sb_width * sb_height) */
50
51     COORD               cursor;         /* position in cells of cursor */
52
53     HANDLE              hConIn;         /* console input handle */
54     HANDLE              hConOut;        /* screen buffer handle: has to be changed when active sb changes */
55     HANDLE              hSynchro;       /* waitable handle signalled by server when something in server has been modified */
56
57     int                 (*fnMainLoop)(struct inner_data* data);
58     void                (*fnPosCursor)(const struct inner_data* data);
59     void                (*fnShapeCursor)(struct inner_data* data, int size, int vis, BOOL force);
60     void                (*fnComputePositions)(struct inner_data* data);
61     void                (*fnRefresh)(const struct inner_data* data, int tp, int bm);
62     void                (*fnResizeScreenBuffer)(struct inner_data* data);
63     void                (*fnSetTitle)(const struct inner_data* data);
64     void                (*fnScroll)(struct inner_data* data, int pos, BOOL horz);
65     void                (*fnDeleteBackend)(struct inner_data* data);
66
67     void*               private;        /* data part belonging to the choosen backed */
68 };
69
70 #  ifdef __GNUC__
71 extern void  XTracer(int level, const char* format, ...) __attribute__((format (printf,2,3)));
72 #  else
73 extern void  XTracer(int level, const char* format, ...);
74 #  endif
75 #if 0
76 /* Trace mode */
77 #  define Trace XTracer
78 #else
79 /* non trace mode */
80 #  define Trace (1) ? (void)0 : XTracer
81 #endif
82
83 /* from wineconsole.c */
84 extern void WINECON_NotifyWindowChange(struct inner_data* data);
85 extern int  WINECON_GetHistorySize(HANDLE hConIn);
86 extern BOOL WINECON_SetHistorySize(HANDLE hConIn, int size);
87 extern int  WINECON_GetHistoryMode(HANDLE hConIn);
88 extern BOOL WINECON_SetHistoryMode(HANDLE hConIn, int mode);
89 extern BOOL WINECON_GetConsoleTitle(HANDLE hConIn, WCHAR* buffer, size_t len);
90 extern void WINECON_FetchCells(struct inner_data* data, int upd_tp, int upd_bm);
91 extern int  WINECON_GrabChanges(struct inner_data* data);
92
93 /* from registry.c */
94 extern BOOL WINECON_RegLoad(struct config_data* cfg);
95 extern BOOL WINECON_RegSave(const struct config_data* cfg);
96
97 /* backends... */
98 extern BOOL WCUSER_InitBackend(struct inner_data* data);