-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdxw.h
109 lines (89 loc) · 2.42 KB
/
dxw.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#ifndef DXW_H
#define DXW_H
#include "dxw_rc.h"
#include <commdlg.h>
#include <cstdio>
#include <memory.h>
#include <vector>
#include <string>
#define WIN_PROC(name) LRESULT CALLBACK name( \
HWND hWnd, \
UINT msg, \
WPARAM wParam, \
LPARAM lParam)
#define DLG_PROC(name) INT_PTR CALLBACK name( \
HWND hDlg, \
UINT msg, \
WPARAM wParam, \
LPARAM lParam)
extern char buf[MAX_PATH];
extern char fname[MAX_PATH + 4];
struct Recent {
std::vector<std::string> files;
bool changed = true;
void AddFile(std::string const&);
[[nodiscard]] std::string const& operator[](size_t i) const { return files[i]; }
[[nodiscard]] size_t size() const { return files.size(); }
};
extern Recent recent;
extern HINSTANCE hInst;
extern HWND hFrame, hMDI;
extern HGLOBAL hDevMode, hDevNames;
extern char ExpName[20];
extern int Changed;
//Cut data
extern HWND hCapWin;
extern int hResize;
extern int vResize;
//Digitize window;
extern HWND hDig;
extern HWND hInfo;
//GDI objects
extern HBRUSH hbrNull, hbrGray;
extern HPEN hpPnt, hpPts, hpCut, hpImp, hpDef;
WIN_PROC(MainWin);
WIN_PROC(ChildWinProc);
DLG_PROC(DigDlg);
DLG_PROC(AboutDlg);
DLG_PROC(StepDlg);
DLG_PROC(RTdlg);
DLG_PROC(UnitProc);
int DLG(int ID, DLG_PROC(Proc), LPARAM lp = 0);
void GetDlgItemDouble(HWND hDlg, int ctrl, double& val);
void SetDlgItemDouble(HWND hDlg, int ctrl, double val);
void BeginWait();
void EndWait();
char* Uscale(int, const char*, const char*);
#define FIRST_WND 300
extern char Directory[81];
struct OFN : OPENFILENAME {
OFN();
};
struct FileData : OFN {
FileData();
};
//extern FileData ofn;
void GetDirs();
void SaveDirs();
int OpenExp();
int OpenExp(std::string_view);
void SetTitle();
void Digitize();
void WriteTable();
void Info();
void ReadInfo();
void WriteInfo();
void AlignWindow(HWND hwnd, int t, int l, int b, int r, int howy, int howx);
inline void
AlignWindow(HWND hwnd, RECT& rc, int howy, int howx) { AlignWindow(hwnd, rc.top, rc.left, rc.bottom, rc.right, howy, howx); }
void Text(HDC hdc, int x, int y, char const* s, UINT flags);
#ifdef NDEBUG
constexpr bool Dbg = false;
#else
constexpr bool Dbg = true;
#endif
#define DbgOut \
if (!Dbg) { \
} else \
std::cerr << __PRETTY_FUNCTION__ << ' ' << __FILE__ << ':' << __LINE__ << "\n ----> "
#endif