1 | /* $Id: CALLBACK.CPP,v 1.6 2000-11-04 16:29:23 sandervl Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * GDI32 support code for Line DDA callbacks
|
---|
5 | *
|
---|
6 | * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
7 | *
|
---|
8 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
9 | *
|
---|
10 | */
|
---|
11 | #include <os2win.h>
|
---|
12 | #include <stdarg.h>
|
---|
13 | #include "misc.h"
|
---|
14 | #include "callback.h"
|
---|
15 | #include <wprocess.h>
|
---|
16 |
|
---|
17 | #define DBG_LOCALLOG DBG_callback
|
---|
18 | #include "dbglocal.h"
|
---|
19 |
|
---|
20 | #ifndef STDCALL_ENUMPROCS
|
---|
21 |
|
---|
22 | static VOID OPEN32API Callback(int X, int Y, LPARAM lpData);
|
---|
23 |
|
---|
24 | //******************************************************************************
|
---|
25 | //******************************************************************************
|
---|
26 | LineDDAProcCallback::LineDDAProcCallback(LINEDDAPROC pUserCallback, LPARAM lpData)
|
---|
27 | {
|
---|
28 | lpUserData = lpData;
|
---|
29 | pCallback = (LINEDDAPROC)pUserCallback;
|
---|
30 | }
|
---|
31 | //******************************************************************************
|
---|
32 | //******************************************************************************
|
---|
33 | LineDDAProcCallback::~LineDDAProcCallback()
|
---|
34 | {
|
---|
35 |
|
---|
36 | }
|
---|
37 | //******************************************************************************
|
---|
38 | //******************************************************************************
|
---|
39 | LINEDDAPROC_O32 LineDDAProcCallback::GetOS2Callback()
|
---|
40 | {
|
---|
41 | return Callback;
|
---|
42 | }
|
---|
43 | //******************************************************************************
|
---|
44 | //******************************************************************************
|
---|
45 | static VOID OPEN32API Callback(int X, int Y, LPARAM lpData)
|
---|
46 | {
|
---|
47 | LineDDAProcCallback *me = (LineDDAProcCallback *)lpData;
|
---|
48 | USHORT selTIB = SetWin32TIB(); // save current FS selector and set win32 sel
|
---|
49 |
|
---|
50 | me->pCallback(X, Y, me->lpUserData);
|
---|
51 | SetFS(selTIB); // switch back to the saved FS selector
|
---|
52 | return;
|
---|
53 | }
|
---|
54 | //******************************************************************************
|
---|
55 | //******************************************************************************
|
---|
56 |
|
---|
57 | #endif //#ifndef STDCALL_ENUMPROCS
|
---|