Debian Codegraph @

pTk/mTk/tixWin/tixWCmpt.c

raw
1
2 /* $Id: tixWCmpt.c,v 1.1.1.1 2000/05/17 11:08:55 idiscovery Exp $ */
3
4 /*
5 * tixWCmpt.c --
6 *
7 * Windows compatibility module: implements missing functions in Windows.
8 */
9
10 #include <tkWinInt.h>
11 #include "tixPort.h"
12 #include "tixInt.h"
13
14 #ifndef strcasecmp
15 int strcasecmp(char * a, char *b)
16 {
17 while (1) {
18 if (*a== 0 && *b==0) {
19 return 0;
20 }
21 if (*a==0) {
22 return (1);
23 }
24 if (*b==0) {
25 return (-1);
26 }
27 if (tolower(*a)>tolower(*b)) {
28 return (-1);
29 }
30 if (tolower(*b)>tolower(*a)) {
31 return (1);
32 }
33 a++; b++;
34 }
35 }
36 #endif
37
38 /*
39 *----------------------------------------------------------------------
40 *
41 * XLowerWindow --
42 *
43 * Change the stacking order of a window.
44 *
45 * Results:
46 * None.
47 *
48 * Side effects:
49 * Changes the stacking order of the specified window.
50 *
51 *----------------------------------------------------------------------
52 */
53 void
54 XLowerWindow(display, w)
55 Display* display;
56 Window w;
57 {
58 HWND window = TkWinGetHWND(w);
59
60 display->request++;
61 SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0,
62 SWP_NOMOVE | SWP_NOSIZE);
63 }
64
65
66
67 #if 1
68 void XDrawPoints(display, d, gc, points, npoints, mode)
69 Display* display;
70 Drawable d;
71 GC gc;
72 XPoint* points;
73 int npoints;
74 int mode;
75 {
76 int i;
77
78 for (i=0; i<npoints; i++) {
79 XDrawLine(display, d, gc, points[i].x, points[i].y,
80 points[i].x, points[i].y);
81 }
82 }
83
84 #endif
85
86 #if 1
87
88 /*
89 * The following declaration is for the VC++ DLL entry point.
90 */
91
92 BOOL APIENTRY DllMain _ANSI_ARGS_((HINSTANCE hInst,
93 DWORD reason, LPVOID reserved));
94
95 /*
96 *----------------------------------------------------------------------
97 *
98 * DllEntryPoint --
99 *
100 * This wrapper function is used by Borland to invoke the
101 * initialization code for Tk. It simply calls the DllMain
102 * routine.
103 *
104 * Results:
105 * See DllMain.
106 *
107 * Side effects:
108 * See DllMain.
109 *
110 *----------------------------------------------------------------------
111 */
112
113 BOOL APIENTRY
114 DllEntryPoint(hInst, reason, reserved)
115 HINSTANCE hInst; /* Library instance handle. */
116 DWORD reason; /* Reason this function is being called. */
117 LPVOID reserved; /* Not used. */
118 {
119 return DllMain(hInst, reason, reserved);
120 }
121
122 /*
123 *----------------------------------------------------------------------
124 *
125 * DllMain --
126 *
127 * DLL entry point.
128 *
129 * Results:
130 * TRUE on sucess, FALSE on failure.
131 *
132 * Side effects:
133 * None.
134 *
135 *----------------------------------------------------------------------
136 */
137
138 BOOL APIENTRY
139 DllMain(hInstance, reason, reserved)
140 HINSTANCE hInstance;
141 DWORD reason;
142 LPVOID reserved;
143 {
144 /*
145 * If we are attaching to the DLL from a new process, tell Tk about
146 * the hInstance to use. If we are detaching then clean up any
147 * data structures related to this DLL.
148 */
149
150 return(TRUE);
151 }
152 #else
153
154 #define DllExport __declspec( dllexport )
155
156 DllExport
157 DllEntryPoint(hInst, reason, reserved)
158 HINSTANCE hInst; /* Library instance handle. */
159 DWORD reason; /* Reason this function is being called. */
160 LPVOID reserved; /* Not used. */
161 {
162 return TRUE;
163 }
164
165 #endif
166
167 int TixPlatformInit(Tcl_Interp * interp)
168 {
169 return Tcl_GlobalEval(interp, "set tix(isWindows) 1");
170 }