Version:
~ [ 10.0 ] ~
** Warning: Cannot open xref database.
1
2 /* $Id: frontierwindows.c,v 1.4 2005/01/11 22:48:05 andreradke Exp $ */
3
4 /******************************************************************************
5
6 UserLand Frontier(tm) -- High performance Web content management,
7 object database, system-level and Internet scripting environment,
8 including source code editing and debugging.
9
10 Copyright (C) 1992-2004 UserLand Software, Inc.
11
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
26 ******************************************************************************/
27
28 #include "frontier.h"
29 #include "standard.h"
30
31 #include "quickdraw.h"
32 #include "strings.h"
33 #include "threads.h"
34 #include "frontierwindows.h"
35 #include "shell.h"
36
37
38
39 #ifdef WIN95VERSION
40
41 #define titlebarheight 20
42
43 static boolean setwindowpos (HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags) {
44
45 /*
46 5.0.2b18 dmb: restore minimized windows before changing their position
47 */
48
49 POINT winpt;
50 boolean fl;
51 WINDOWPLACEMENT wp;
52
53 /*
54 if (cy)
55 cy += titlebarheight;
56
57 if (Y)
58 Y -= titlebarheight;
59 */
60
61 winpt.x = X;
62 winpt.y = Y;
63
64 // ScreenToClient (shellframewindow, &winpt);
65
66 releasethreadglobals ();
67
68 wp.length = sizeof(WINDOWPLACEMENT);
69
70 if (GetWindowPlacement (hWnd, &wp) && (wp.showCmd == SW_SHOWMINIMIZED)) {
71
72 wp.showCmd = SW_RESTORE;
73
74 SetWindowPlacement (hWnd, &wp);
75 }
76
77 fl = SetWindowPos (hWnd, hWndInsertAfter, winpt.x, winpt.y, cx, cy, uFlags);
78
79 grabthreadglobals ();
80
81 return (fl);
82 } /*setwindowpos*/
83
84 #endif
85
86
87
88 WindowPtr getnewwindow (short id, boolean fldialog, Rect *r) {
89
90 WindowPtr w = nil;
91
92 #ifdef MACVERSION
93 //code change by Timothy Paustian 9/17/00 dialogPtrs and WindowPtrs
94 //are not the save thing. Do a cast
95 //This may cause trouble in other things that assume DialogPtrs
96 //and WindowPtrs are the same, but I have to return a windowPtr
97 //If needed this can be cast down to a DialogPtr
98 if (fldialog)
99 {
100 DialogPtr theDial = GetNewDialog (id, nil, (WindowRef) -1L);
101 w = GetDialogWindow(theDial);
102 }
103 else {
104 if (config.flcolorwindow && havecolorquickdraw ())
105 w = GetNewCWindow (id, nil, (WindowPtr) -1L);
106 else
107 w = GetNewWindow (id, nil, (WindowPtr) -1L);
108 }
109
110 if (w != nil && r != nil) {
111
112 constraintodesktop (w, r);
113
114 /*make sure top-right corner (zoom box) is accessable*/ {
115
116 Rect rmin;
117
118 setrect (&rmin, (*r).top, (*r).right - 50, (*r).top + 5, (*r).right);
119
120 if (constraintoscreenbounds (w, false, &rmin))
121 constraintoscreenbounds (w, false, r);
122 }
123
124 sizewindow (w, (*r).right - (*r).left, (*r).bottom - (*r).top);
125
126 movewindow (w, (*r).left, (*r).top);
127 }
128
129 #endif
130
131 #ifdef WIN95VERSION
132 HWND hwnd;
133 CHAR sz[160];
134 MDICREATESTRUCT mcs;
135 #ifdef USINGSTATUSBAR
136 HWND hwndStatusBar;
137 #endif
138
139 // LoadString (hInst, IDS_UNTITLED, sz, sizeof(sz));
140 strcpy (sz, "Untitled");
141 mcs.szTitle = (LPSTR)sz;
142 mcs.szClass = szChild1;
143
144 if (config.filetype == 'root')
145 mcs.szClass = szChildRoot;
146
147 else if (config.filetype == 'ftop')
148 mcs.szClass = szChildFTop;
149
150 else if (config.filetype == 'ftwp')
151 mcs.szClass = szChildFTwp;
152
153 else if (config.filetype == 'fttb')
154 mcs.szClass = szChildFTtb;
155
156 else if (config.filetype == 'ftmb')
157 mcs.szClass = szChildFTmb;
158
159 else if (config.filetype == 'ftsc')
160 mcs.szClass = szChildFTsc;
161
162
163 mcs.hOwner = hInst;
164
165 /* Use the default size for the window */
166 if (r == NULL) {
167
168 mcs.x = mcs.cx = CW_USEDEFAULT;
169 mcs.y = mcs.cy = CW_USEDEFAULT;
170 }
171 else {
172 mcs.x = (*r).left - 4;
173 mcs.y = (*r).top - 23;
174
175 mcs.cx = (*r).right - (*r).left + 5;
176 mcs.cy = (*r).bottom - (*r).top + 24;
177 }
178
179 /* Set the style DWORD of the window to default */
180 mcs.style = styleDefault;
181
182 releasethreadglobals ();
183
184 /* tell the MDI Client to create the child */
185 hwnd = (HWND)SendMessage (hwndMDIClient,
186 WM_MDICREATE,
187 0,
188 (LONG)(LPMDICREATESTRUCT)&mcs);
189
190
191 #ifdef USINGSTATUSBAR
192 //RAB: 1/20/98 added call to create the status bar
193 hwndStatusBar = CreateStatusWindow (WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | CCS_BOTTOM | SBARS_SIZEGRIP, "Ready", hwnd, 2);
194
195 SetWindowLong (hwnd, 8, (long) hwndStatusBar);
196 #endif
197
198 grabthreadglobals ();
199
200 w = hwnd;
201
202 #endif
203
204 return (w);
205 } /*getnewwindow*/
206
207
208 void disposewindow (WindowPtr w) {
209
210 #ifdef MACVERSION
211 DisposeWindow (w);
212 #endif
213
214 #ifdef WIN95VERSION
215 releasethreadglobals ();
216
217 SendMessage (hwndMDIClient, WM_MDIDESTROY, (WPARAM) w, 0L);
218
219 grabthreadglobals ();
220 #endif
221 } /*disposewindow*/
222
223
224 void windowgettitle (WindowPtr w, bigstring bs) {
225
226 #ifdef MACVERSION
227 GetWTitle (w, bs);
228 #endif
229
230 #ifdef WIN95VERSION
231 releasethreadglobals ();
232
233 GetWindowText(w, bs, lenbigstring);
234
235 grabthreadglobals ();
236
237 convertcstring (bs);
238 #endif
239 } /*windowgettitle*/
240
241
242 #if !flruntime
243
244 void windowsettitle (WindowPtr w, bigstring bs) {
245
246 #ifdef MACVERSION
247 bigstring bsorig;
248
249 GetWTitle (w, bsorig);
250
251 if (!equalstrings (bs, bsorig)) /*save a little flickering*/
252 SetWTitle (w, bs);
253 #endif
254
255 #ifdef WIN95VERSION
256 #ifdef PASCALSTRINGVERSION
257 bs[stringlength(bs)+1] = 0;
258 #endif
259
260 releasethreadglobals ();
261
262 SetWindowText(w, stringbaseaddress(bs));
263
264 grabthreadglobals ();
265 #endif
266 } /*windowsettitle*/
267
268
269 void windowinval (WindowPtr w) {
270
271 Rect r;
272
273 getlocalwindowrect (w, &r);
274
275 invalwindowrect (w, r);
276
277 /*
278 #ifdef MACVERSION
279 invalwindowrect (w, (*w).portRect);
280 #endif
281
282 #ifdef WIN95VERSION
283 releasethreadglobals ();
284
285 ShowWindow (w, SW_SHOWNA);
286
287 grabthreadglobals ();
288
289 #endif
290 */
291 } /*windowinval*/
292
293
294 boolean graywindow (WindowPtr w) {
295
296 Rect r;
297 //Code change by Timothy Paustian Monday, August 21, 2000 4:21:47 PM
298 //Cannot do an implicit cast, pushport requires a CGrafPtr
299 CGrafPtr thePort;
300 #if TARGET_API_MAC_CARBON == 1
301 thePort = GetWindowPort(w);
302 #else
303 thePort = (CGrafPtr)w;
304 #endif
305
306 pushport (thePort);
307
308 getlocalwindowrect (w, &r);
309
310 grayrect (r);
311
312 invalrect (r);
313
314 popport ();
315
316 return (true);
317 } /*graywindow*/
318
319 #endif
320
321 void movewindow (WindowPtr w, short h, short v) {
322
323 #ifdef MACVERSION
324 MoveWindow (w, h, v, false); /*don't bring it to the front*/
325 #endif
326
327 #ifdef WIN95VERSION
328 setwindowpos (w, NULL, h - 4, v - 23, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
329 #endif
330
331 } /*movewindow*/
332
333
334 void movewindowhidden (WindowPtr w, short h, short v) {
335
336 #ifdef MACVERSION
337 MoveWindow (w, h, v, false); /*don't bring it to the front*/
338 #endif
339
340 #ifdef WIN95VERSION
341 setwindowpos (w, NULL, h - 4, v - 23, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_HIDEWINDOW | SWP_NOACTIVATE);
342 #endif
343
344 } /*movewindowhidden*/
345
346
347 void sizewindow (WindowPtr w, short h, short v) {
348
349 #ifdef MACVERSION
350 SizeWindow (w, h, v, true); /*add to the update region*/
351 #endif
352
353 #ifdef WIN95VERSION
354 // dmb: must account for NC area
355 /*long style = GetWindowLong (w, GWL_STYLE);
356
357 if (style & WS_VSCROLL)
358 h += 16;
359
360 if (style & WS_HSCROLL)
361 v += 16;
362 */
363
364 setwindowpos (w, NULL, 0, 0, h + 5, v + 24, SWP_NOMOVE | SWP_NOZORDER);
365 #endif
366
367 } /*sizewindow*/
368
369
370 void sizewindowhidden (WindowPtr w, short h, short v) {
371
372 #ifdef MACVERSION
373 SizeWindow (w, h, v, true); /*add to the update region*/
374 #endif
375
376 #ifdef WIN95VERSION
377 // dmb: must account for NC area
378 /*long style = GetWindowLong (w, GWL_STYLE);
379
380 if (style & WS_VSCROLL)
381 h += 16;
382
383 if (style & WS_HSCROLL)
384 v += 16;
385 */
386
387 setwindowpos (w, NULL, 0, 0, h + 5, v + 24, SWP_NOMOVE | SWP_NOZORDER | SWP_HIDEWINDOW | SWP_NOACTIVATE);
388 #endif
389
390 } /*sizewindowhidden*/
391
392
393 void moveandsizewindow (WindowPtr w, Rect r) {
394
395 sizewindow (w, r.right - r.left, r.bottom - r.top);
396
397 movewindow (w, r.left, r.top);
398 } /*moveandsizewindow*/
399
400
401 WindowPtr getfrontwindow (void) {
402
403 /*
404 5.1.5b15 dmb: return invisible window if in front, not NULL [Win]
405 */
406
407 #ifdef MACVERSION
408 return (FrontWindow ());
409 #endif
410
411 #ifdef WIN95VERSION
412 HWND w;
413
414 w = GetTopWindow (hwndMDIClient);
415
416 while (w && !IsWindowVisible (w))
417 w = GetNextWindow (w, GW_HWNDNEXT);
418
419 return (w);
420 #endif
421
422 } /*getfrontwindow*/
423
424
425 WindowPtr getnextwindow (WindowPtr w) {
426
427 #ifdef MACVERSION
428 WindowPtr nextWindow;
429 //Code change by Timothy Paustian Monday, May 1, 2000 9:18:45 PM
430 //Changed to Opaque call for Carbon
431 #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1
432 nextWindow = GetNextWindow(w);
433 #else
434 //old code
435 nextWindow = ((WindowPtr) (*(WindowPeek) w).nextWindow);
436 #endif
437 return nextWindow;
438 #endif
439
440 #ifdef WIN95VERSION
441 w = GetNextWindow (w, GW_HWNDNEXT);
442
443 while (w && !IsWindowVisible (w))
444 w = GetNextWindow (w, GW_HWNDNEXT);
445
446 return (w);
447 #endif
448
449 } /*getfrontwindow*/
450
451
452 boolean windowbringtofront (WindowPtr w) {
453
454 if (w == nil)
455 return (false);
456
457 #ifdef MACVERSION
458 SelectWindow (w);
459 #endif
460
461 #ifdef WIN95VERSION
462 setwindowpos (w, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
463 #endif
464
465 shellwindowmenudirty (); /*the checked item changes*/
466
467 return (true);
468 } /*windowbringtofront*/
469
470
471 boolean windowsendtoback (WindowPtr w) {
472
473 if (w == nil)
474 return (false);
475
476 #ifdef MACVERSION
477 SendBehind (w, nil);
478 #endif
479
480 #ifdef WIN95VERSION
481 {
482 WindowPtr wnext = getnextwindow (w);
483
484 setwindowpos (w, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
485
486 if (wnext != nil)
487 windowbringtofront (wnext);
488 }
489 #endif
490
491 shellwindowmenudirty (); /*the checked item changes*/
492
493 return (true);
494 } /*windowsendtoback*/
495
496
497 boolean getlocalwindowrect (WindowPtr w, Rect *r) {
498
499 if (w == nil) { /*defensive driving*/
500
501 zerorect (r);
502
503 return (false);
504 }
505
506 #ifdef MACVERSION
507 //Code change by Timothy Paustian Monday, May 1, 2000 9:19:35 PM
508 //Changed to Opaque call for Carbon
509 //we are assuming we want the entire window rectangle here, this may be wrong.
510 //All defined in MacWindows.h
511 //I had to do it this way to get the quick script window to work.
512 //this may be moot because I am going to need to use a different WDEF
513 //for the quick script window anyway.
514 #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1
515 {
516 CGrafPtr thePort;
517
518 thePort = GetWindowPort(w);
519 GetPortBounds(thePort, r);
520 }
521 #else
522 //old code
523 *r = (*w).portRect;
524 #endif
525 #endif
526
527 #ifdef WIN95VERSION
528 {
529 RECT winrect;
530
531 GetClientRect (w, &winrect);
532
533 setrect (r, winrect.top, winrect.left, winrect.bottom, winrect.right);
534 }
535 #endif
536
537 return (true);
538 } /*getlocalwindowrect*/
539
540
541 boolean getglobalwindowrect (WindowPtr w, Rect *r) {
542
543 if (!getlocalwindowrect (w, r))
544 return (false);
545
546 localtoglobalrect (w, r);
547
548 #ifdef WIN95VERSION
549 {
550 long style = GetWindowLong (w, GWL_STYLE);
551
552 if (style & WS_VSCROLL)
553 (*r).right += 16;
554 else
555 (*r).right += 3;
556
557 if (style & WS_HSCROLL)
558 (*r).bottom += 16;
559 else
560 (*r).bottom += 3;
561 }
562 #endif
563
564 return (true);
565 } /*getglobalwindowrect*/
566
567
568 #if !flruntime
569
570 boolean windowsendbehind (WindowPtr w, WindowPtr wbehind) {
571
572 /*
573 5.0a10 dmb: call dirty windowmenu for all platforms
574 */
575
576 #ifdef MACVERSION
577 boolean flmovingup;
578
579 if (w == nil)
580 return (false);
581
582 flmovingup = w != getfrontwindow (); /*maybe moving up*/
583
584 SendBehind (w, wbehind);
585
586 if (flmovingup) { /*IM I-286*/
587 //Code change by Timothy Paustian Monday, May 1, 2000 9:28:35 PM
588 //Changed to Opaque call for Carbon
589 //note this routine is never called. The compiler strips it out.
590 #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1
591 #else
592 //old code
593 register WindowPeek wpeek = (WindowPeek) w;
594
595 PaintOne ((WindowPtr) wpeek, (*wpeek).strucRgn);
596
597 CalcVis ((WindowPtr) wpeek);
598 #endif
599 }
600 #endif
601
602 #ifdef WIN95VERSION
603 setwindowpos (w, wbehind, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
604 #endif
605
606 shellwindowmenudirty (); /*the checked item changes*/
607
608 return (true);
609 } /*windowsendbehind*/
610
611
612 boolean findmousewindow (Point globalpt, WindowPtr *w, short *part) {
613
614 #ifdef MACVERSION
615 *part = FindWindow (globalpt, w);
616 #endif
617
618 #ifdef WIN95VERSION
619 POINT winPt;
620 winPt.x = globalpt.h;
621 winPt.y = globalpt.v;
622 *w = ChildWindowFromPoint (hwndMDIClient, winPt); // *** can't pass NULL?
623 #endif
624
625 return (*w != nil);
626 } /*findmousewindow*/
627
628
629 boolean windowsetcolor (WindowPtr w, long color, boolean flforeground) {
630
631 if (w == nil)
632 return (false);
633
634 #ifdef MACVERSION
635 //Code change by Timothy Paustian Monday, August 21, 2000 4:23:48 PM
636 //pushport needs a CGrafPtr, passing windowPtr causes a crash on OS X
637 {
638 CGrafPtr thePort;
639 #if TARGET_API_MAC_CARBON == 1
640 thePort = GetWindowPort(w);
641 #else
642 thePort = (CGrafPtr)w;
643 #endif
644
645 pushport (thePort);
646 }
647 if (flforeground)
648 ForeColor (color);
649 else
650 BackColor (color);
651
652 popport ();
653 #endif
654
655 #ifdef WIN95VERSION
656 #endif
657
658 return (true);
659 } /*windowsetcolor**/
660
661
662 boolean isdeskaccessorywindow (WindowPtr w) {
663
664 #ifdef MACVERSION
665 //Code change by Timothy Paustian Monday, May 1, 2000 9:31:55 PM
666 //Changed to Opaque call for Carbon
667 //I doubt we need this but what the hey.
668 return (GetWindowKind(w) < 0);
669 //old code
670 //return ((*(WindowPeek) w).windowKind < 0);
671 #endif
672
673 #ifdef WIN95VERSION
674 return (false);
675 #endif
676 } /*isdeskaccessorywindow*/
677
678 #endif
679
680
681 void showwindow (WindowPtr w) {
682
683 #ifdef MACVERSION
684 ShowWindow (w);
685 #endif
686
687 #ifdef WIN95VERSION
688 releasethreadglobals ();
689
690 ShowWindow (w, SW_SHOWNA);
691
692 grabthreadglobals ();
693 #endif
694 } /*showwindow*/
695
696
697 void hidewindow (WindowPtr w) {
698
699 /*
700 5.0a5 dmb: apparantly, we need to do more to fully activate the next
701 window if w is in front now. Using SetWindowPos didn't work, so we
702 make two calls
703
704 5.0a10 dmb: fixed above code. also, added SendBehind code for Mac here,
705 so it doesn't need to be done at the shell level
706
707 5.1.5b15 dmb: still wasn't right. hiding the window leaves it in front.
708 we need to activate the frontmost visible window.
709 */
710
711 #ifdef MACVERSION
712 HideWindow (w);
713
714 if (w == getfrontwindow ()) /*don't allow hidden window to remain active*/
715 SendBehind (w, getfrontwindow ());
716 #endif
717
718 #ifdef WIN95VERSION
719 WindowPtr wfront = getfrontwindow ();
720
721 if (!IsWindowVisible (w))
722 return;
723
724 releasethreadglobals ();
725
726 SetWindowPos (w, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_HIDEWINDOW);
727
728 // ShowWindow (w, SW_HIDE);
729
730 if (w == wfront) { // we were in front; activate first visible
731
732 w = GetTopWindow (hwndMDIClient);
733
734 while (w && !IsWindowVisible (w))
735 w = GetNextWindow (w, GW_HWNDNEXT);
736
737 if (w)
738 SetWindowPos (w, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
739 //SetActiveWindow (w);
740 }
741
742 grabthreadglobals ();
743 #endif
744 } /*hidewindow*/
745
746 boolean windowvisible (WindowPtr w) {
747
748 #ifdef MACVERSION
749 //Code change by Timothy Paustian Monday, May 1, 2000 9:33:54 PM
750 //Changed to Opaque call for Carbon
751 return IsWindowVisible(w);
752 //old code
753 //return ((*(WindowPeek) w).visible);
754 #endif
755
756 #ifdef WIN95VERSION
757 return (IsWindowVisible (w));
758 #endif
759 } /*windowvisible*/
760
761
762 hdlregion getupdateregion (WindowPtr w) {
763 #ifdef MACVERSION
764 //Code change by Timothy Paustian Monday, May 1, 2000 9:35:02 PM
765 //Changed to Opaque call for Carbon
766 //watch out here. Make sure we are not making a memory leak.
767 //I wonder if the windows version leaks memory or if all these calls
768 //are mapped out and disposed of in the windows version.
769 //ask Andre
770 #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1
771 hdlregion rgn;
772 //I think I found a bug in carbon. Calling get window region looking for
773 //the update region is always returning 0,0,0,0. For now use the
774 //content region. I will ask about this on the carbon mailing list.
775 rgn = NewRgn();
776 GetWindowRegion(w, kWindowContentRgn, rgn);
777 return (rgn);
778 #else
779 //old code
780 hdlregion retRegion = (*(WindowPeek) w).updateRgn;
781 return (retRegion);
782 #endif
783 #endif
784
785 #ifdef WIN95VERSION
786 hdlregion rgn;
787 rgn = (hdlregion) NewRgn();
788 GetUpdateRgn (w, (HRGN) rgn, false);
789 return (rgn);
790 #endif
791 } /*getupdateregion*/
792
793
794 hdlregion getvisregion (WindowPtr w) {
795 #ifdef MACVERSION
796 //Code change by Timothy Paustian Monday, May 1, 2000 9:35:02 PM
797 //Changed to Opaque call for Carbon
798 //watch out here. Make sure we are not making a memory leak.
799 //I wonder if the windows version leaks memory or if all these calls
800 //are mapped out and disposed of in the windows version.
801 //ask Andre
802 //This is also not called in the PPC version, dead code.
803 #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1
804 hdlregion rgn;
805 CGrafPtr thePort;
806 //we have to change to a port to get the visible region
807 thePort = GetWindowPort(w);
808 rgn = NewRgn();
809 rgn = GetPortVisibleRegion(thePort, rgn);
810 return (rgn);
811 #else
812 //old code
813 return ((*w).visRgn);
814 #endif
815 #endif
816
817 #ifdef WIN95VERSION
818 hdlregion rgn;
819 HDC hdc;
820
821 // hdc = GetDC (w);
822 assert (w == getport ());
823 hdc = getcurrentDC ();
824
825 rgn = (hdlregion) NewRgn();
826 GetClipRgn (hdc, (HRGN) rgn);
827 // ReleaseDC(w, hdc);
828 return (rgn);
829 #endif
830 } /*getupdateregion*/
831
832
833 void setwindowrefcon (WindowPtr w, long refcon) {
834
835 #ifdef MACVERSION
836 //Code change by Timothy Paustian Monday, May 1, 2000 9:42:05 PM
837 //Changed to Opaque call for Carbon
838 SetWRefCon(w, refcon);
839 //old code
840 //(*(WindowPeek) w).refCon = refcon;
841 #endif
842
843 #ifdef WIN95VERSION
844 SetWindowLong (w, 0, (LONG) refcon);
845 #endif
846 } /*setwindowrefcon*/
847
848
849 long getwindowrefcon (WindowPtr w) {
850
851 #ifdef MACVERSION
852 //Code change by Timothy Paustian Monday, May 1, 2000 9:42:44 PM
853 //Changed to Opaque call for Carbon
854 return GetWRefCon(w);
855 /*old code
856 return ((*(WindowPeek) w).refCon);*/
857 #endif
858
859 #ifdef WIN95VERSION
860 return (GetWindowLong (w, 0));
861 #endif
862 } /*getwindowrefcon*/
863
864
865
866
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.