|
|
1.1 root 1:
2: /******************************************************************************\
3: * This is a part of the Microsoft Source Code Samples.
4: * Copyright (C) 1993 Microsoft Corporation.
5: * All rights reserved.
6: * This source code is only intended as a supplement to
7: * Microsoft Development Tools and/or WinHelp documentation.
8: * See these sources for detailed information regarding the
9: * Microsoft samples programs.
10: \******************************************************************************/
11:
12: /*
13: * WINDIFF.H
14: */
15:
16: /* application-wide variables -------------------------------------*/
17:
18: /* This is the section name in the win.ini file to which we
19: * write profile info
20: */
21: #define APPNAME "WinDiff"
22:
23: /* A gmem_init() heap shared by the app. call gmem_get to alloc. */
24: extern HANDLE hHeap;
25:
26: /* The instance handle for this app. Needed by anyone who uses resources
27: * such as dialogs
28: */
29: extern HINSTANCE hInst;
30:
31: extern HWND hwndClient;
32: extern HWND hwndRCD;
33:
34: /* global option flags------------------------------------------- */
35:
36: /* Which files do we show in outline mode ? all, changed... */
37: extern int outline_include;
38:
39: /* Outline_include is an OR of the following */
40: #define INCLUDE_SAME 1
41: #define INCLUDE_DIFFER 2
42: #define INCLUDE_LEFTONLY 4
43: #define INCLUDE_RIGHTONLY 8
44:
45:
46: /* Do we ignore blanks during the line-by-line diff ? */
47: extern BOOL ignore_blanks;
48:
49: /* Which line numbers do we show - left original, right original or none ?*/
50: extern int line_numbers;
51:
52: /* What lines do we show in expand mode - all, left only, right only ? */
53: extern int expand_mode;
54:
55: /*--- colour scheme ---------------------------------------------- */
56:
57: /* Outline */
58: extern DWORD rgb_outlinehi;
59:
60: /* Expand view */
61: extern DWORD rgb_leftfore;
62: extern DWORD rgb_leftback;
63: extern DWORD rgb_rightfore;
64: extern DWORD rgb_rightback;
65: extern DWORD rgb_mleftfore;
66: extern DWORD rgb_mleftback;
67: extern DWORD rgb_mrightfore;
68: extern DWORD rgb_mrightback;
69:
70: /* Bar window */
71: extern DWORD rgb_barleft;
72: extern DWORD rgb_barright;
73: extern DWORD rgb_barcurrent;
74:
75:
76:
77: /* -- display layout constants---------------------------------------*/
78:
79: /* Percentage of width of window taken by bar display (when visible) */
80: #define BAR_WIN_WIDTH 10
81:
82: /* Following are horizontal positions within the bar window, expressed
83: * in percent of the width of the bar window
84: */
85: #define L_POS_START 10 /* start of left position marker */
86: #define L_POS_WIDTH 5 /* width of left position marker */
87: #define R_POS_START 80 /* start of right position marker */
88: #define R_POS_WIDTH 5 /* width of right position marker */
89:
90: #define L_UNMATCH_START 30 /* start of left bar for unmatched section */
91: #define L_UNMATCH_WIDTH 10 /* width of above */
92: #define R_UNMATCH_START 60 /* start of right bar for unmatch section */
93: #define R_UNMATCH_WIDTH 10 /* width of right unmatched section marker */
94: #define L_MATCH_START 30 /* start of left bar for matched section */
95: #define L_MATCH_WIDTH 10 /* width of left bar for matched section */
96: #define R_MATCH_START 60 /* start of right bar for matched section */
97: #define R_MATCH_WIDTH 10 /* width of right bar for matched section */
98:
99:
100:
101:
102: /* windiff.c functions */
103: void windiff_UI(BOOL bAttach);
104: BOOL Poll(void); /* true if abort pending */
105: void SetNames(LPSTR names);
106: void SetStatus(LPSTR state);
107:
108: /* in bar.c */
109: BOOL InitBarClass(HINSTANCE hInstance);
110: void BarDrawPosition(HWND hwndBar, HDC hdcIn, BOOL bErase);
111:
112: /*-- private messages -- */
113: /* Send this to the main window. Return value is the VIEW handle */
114: #define TM_CURRENTVIEW WM_USER
115:
116:
117: /* --- synchronisation ----------------------------------------- */
118: /*
119: * In WIN32 we spawn worker threads to do time-consuming actions.
120: * This causes a possible conflict with the UI thread when accessing the
121: * BUSY flag.
122: *
123: * To protect against this we have a critical section. The UI thread
124: * will get this before checking/changing the Busy flag,
125: * The worker thread will get this before Busy flag* changes.
126: *
127: */
128:
129: CRITICAL_SECTION CSWindiff;
130:
131: #define WDEnter() EnterCriticalSection(&CSWindiff);
132: #define WDLeave() LeaveCriticalSection(&CSWindiff);
133:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.