-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmplparser.h
65 lines (55 loc) · 1.64 KB
/
tmplparser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* Dialog template parsing and generation code
Also contains code for the dialog editor data model. */
#ifndef TMPLPARSER_H
#define TMPLPARSER_H
#include "xmalloc.h"
#define ea_malloc xmalloc
#define ea_realloc xrealloc
#define ea_free xfree
#include "exparray.h"
/* Include Windows data types (BOOL and POINT) */
#include "subwindef.h"
/* We define our own structures for the purpose of saving preprocessor
symbols in the dialog template. */
struct DlgItem_t
{
/*char* itemType;*/
char text[256];
char* id;
int x;
int y;
int cx;
int cy;
char* style;
char* exStyle;
char wndClass[256];
int rendClass; /* Special rendering for recognized types */
int rendType;
};
typedef struct DlgItem_t DlgItem;
EA_TYPE(DlgItem);
typedef char* heap_char; /* Designates data that must passed to free() */
unsigned SetUnixNlChars(char* buffer, unsigned dataSize);
heap_char GenWinNlChars(char* buffer, unsigned dataSize);
unsigned TransEscapeChars(char* buffer, unsigned dataSize);
char* UntransEscChars(char* buffer, unsigned dataSize);
BOOL ParseDlgHead(char* buffer, unsigned dataSize);
BOOL ParseControl(char* buffer, unsigned dataSize, unsigned ctrlNum);
void FmtDlgHeader();
heap_char FmtControlText(unsigned ctrlNum);
void FreeDlgData();
/* Dialog variables */
extern char* dlgHead;
extern POINT dlgPos;
extern long dlgWidth;
extern long dlgHeight;
extern BOOL dlgHasCaption;
extern char dlgCaption[256];
extern unsigned dlgPointSize;
extern char* dlgFontFam;
extern DlgItem_array dlgControls;
/* Parser variables */
extern unsigned curPos;
extern unsigned curLine;
extern char* errorDesc;
#endif