-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsdkdiff.h
208 lines (154 loc) · 6.33 KB
/
sdkdiff.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
* PARTICULAR PURPOSE.
*
* Copyright (c) Microsoft Corporation. All Rights Reserved.
*/
#ifndef __SDKDIFF_H__
#define __SDKDIFF_H__
/*
* sdkdiff - file and directory comparisons
* FOR INTRODUCTORY NOTES ON IMPLEMENTATION SEE SDKDIFF.C
*
* sdkdiff.h - user-interface definitions, and application-wide global
* declarations.
*/
/* application-wide variables -------------------------------------*/
/* this is the section name in the win.ini file to which we
* write profile info
*/
#define APPNAME szSdkDiff
extern const CHAR szSdkDiff[];
/* Map profile calls to the registry
*/
#include "profile.h"
/* a gmem_init() heap shared by the app. call gmem_get to alloc. */
extern HANDLE hHeap;
/* the instance handle for this app. needed by anyone who uses resources
* such as dialogs
*/
extern HINSTANCE hInst;
extern HWND hwndClient;
extern HWND hwndRCD;
/* global option flags------------------------------------------- */
/* which files do we show in outline mode ? all, changed... */
extern int outline_include;
/* which files do we show in expand mode ? all, different, moved... */
extern int expand_include;
/* outline_include is an OR of the following */
#define INCLUDE_SAME 0x01
#define INCLUDE_DIFFER 0x02
#define INCLUDE_LEFTONLY 0x04
#define INCLUDE_RIGHTONLY 0x08
/* expand_include is an OR of the previous (except for INCLUDE_DIFFER)
AND the following */
#define INCLUDE_MOVEDLEFT 0x10
#define INCLUDE_MOVEDRIGHT 0x20
#define INCLUDE_SIMILARLEFT 0x40
#define INCLUDE_SIMILARRIGHT 0x80
/* bitwise OR of all flags */
#define INCLUDE_ALL 0xFF
/* do we ignore blanks during the line-by-line diff ? */
extern BOOL ignore_blanks;
/* do we show whitespace characters ? */
extern BOOL show_whitespace;
/* which line numbers do we show - left original, right original or none ?*/
extern int line_numbers;
/* what lines do we show in expand mode - all, left only, right only ? */
extern int expand_mode;
/* TRUE if marked compitems are to be excluded from the view */
extern BOOL hide_markedfiles;
// tab expansion width in characters
extern int g_tabwidth;
extern BOOL TrackLeftOnly;
extern BOOL TrackRightOnly;
extern BOOL TrackDifferent;
extern BOOL TrackSame;
extern BOOL TrackReadonly;
/*--- colour scheme ---------------------------------------------- */
/* outline */
extern DWORD rgb_outlinehi;
/* expand view */
extern DWORD rgb_leftfore;
extern DWORD rgb_leftback;
extern DWORD rgb_rightfore;
extern DWORD rgb_rightback;
extern DWORD rgb_mleftfore;
extern DWORD rgb_mleftback;
extern DWORD rgb_mrightfore;
extern DWORD rgb_mrightback;
/* bar window */
extern DWORD rgb_barleft;
extern DWORD rgb_barright;
extern DWORD rgb_barcurrent;
extern BOOL bJapan; /* TRUE if primary language is Japanese */
extern BOOL bDBCS; /* TRUE if primary language is Japanese/Korean/Chinese */
/* -- display layout constants---------------------------------------*/
/* percentage of width of window taken by bar display (when visible) */
#define BAR_WIN_WIDTH 10
/* following are horizontal positions within the bar window, expressed
* in percent of the width of the bar window
*/
#define L_POS_START 10 /* start of left position marker */
#define L_POS_WIDTH 5 /* width of left position marker */
#define R_POS_START 80 /* start of right position marker */
#define R_POS_WIDTH 5 /* width of right position marker */
#define L_UNMATCH_START 30 /* start of left bar for unmatched section */
#define L_UNMATCH_WIDTH 10 /* width of above */
#define R_UNMATCH_START 60 /* start of right bar for unmatch section */
#define R_UNMATCH_WIDTH 10 /* width of right unmatched section marker */
#define L_MATCH_START 30 /* start of left bar for matched section */
#define L_MATCH_WIDTH 10 /* width of left bar for matched section */
#define R_MATCH_START 60 /* start of right bar for matched section */
#define R_MATCH_WIDTH 10 /* width of right bar for matched section */
/* sdkdiff.c functions */
#ifdef trace
void APIENTRY Trace_File(LPSTR msg); /* dump msg into Sdkdiff.trc */
#endif
/* if you are about to put up a dialog box or in fact process input in any way
on any thread other than the main thread - or if you MIGHT be on a thread other
than the main thread, then you must call this function with TRUE before doing
it and with FALSE immediately afterwards. Otherwise you will get one of a
number of flavours of not-very-responsiveness
*/
void sdkdiff_UI(BOOL bAttach);
/* peek the message queue. return TRUE if an abort request is pending */
BOOL Poll(void); /* true if abort pending */
/* set the text for the 'names' field (central box) on the status bar */
void SetNames(LPSTR names);
/* set the status field (left field) on the status bar */
void SetStatus(LPSTR state);
/* dlg procs */
int FAR PASCAL FindDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
int FAR PASCAL GoToLineDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
/* in bar.c */
BOOL InitBarClass(HINSTANCE hInstance);
void BarDrawPosition(HWND hwndBar, HDC hdcIn, BOOL bErase);
/*-- private messages -- */
/* send this to the main window. return value is the VIEW handle */
#define TM_CURRENTVIEW WM_USER
/* --- synchronisation ----------------------------------------- */
/*
* the WIN32 version spawns worker threads to do time-consuming actions.
* this causes a possible conflict with the UI thread when accessing the
* BUSY flag.
*
* to protect against this we have a critical section. The UI thread
* will get this before checking/changing the Busy flag,
* The worker thread will get this before Busy flag* changes.
*
*/
//CRITICAL_SECTION CSSdkdiff;
extern BOOL __BERR;
#ifdef _DEBUG
#define TRACE_ERROR(msg,flag) ( sdkdiff_UI(TRUE), \
__BERR = Trace_Error(hwndClient, msg, flag), \
sdkdiff_UI(FALSE), \
__BERR \
)
#else
#define TRACE_ERROR(msg,flag) FALSE
#endif
#endif