/[pcsx2_0.9.7]/branch/r3113_0.9.7_beta/3rdparty/wxWidgets/src/msw/penwin.cpp
ViewVC logotype

Contents of /branch/r3113_0.9.7_beta/3rdparty/wxWidgets/src/msw/penwin.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32 - (show annotations) (download)
Tue Sep 7 03:29:01 2010 UTC (9 years, 11 months ago) by william
File size: 3330 byte(s)
branching from upstream revision (http://pcsx2.googlecode.com/svn/trunk
): r3113 to
https://svn.netsolutions.dnsalias.com/websvn/ps2/pcsx2/pcsx2_0.9.7/branch/r3113_0.9.7_beta
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/penwin.cpp
3 // Purpose: PenWindows code
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 04/01/98
7 // RCS-ID: $Id: penwin.cpp 37162 2006-01-26 16:50:23Z ABX $
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
14
15 #ifdef __BORLANDC__
16 #pragma hdrstop
17 #endif
18
19 #ifndef WX_PRECOMP
20 #include "wx/window.h"
21 #endif
22
23 #include "wx/msw/private.h"
24
25 #if wxUSE_PENWINDOWS
26
27 #ifdef __BORLANDC__
28 #define RPA_DEFAULT 1
29 #else
30 #include <penwin.h>
31 #endif
32
33 HANDLE g_hPenWin = (HANDLE)NULL;
34 typedef void (CALLBACK * PENREGPROC)(WORD,BOOL);
35
36 // The routine below allows Windows applications (binaries) to
37 // support Pen input when running under Microsoft Windows for
38 // Pen Computing 1.0 without need of the PenPalete.
39 //
40 // Should masked edit functions be added to wxWidgets we would
41 // be a new class of functions to support BEDIT controls.
42 //
43 // (The function is a NOOP for native Windows-NT)
44 #ifndef __WIN32__
45 static void (CALLBACK * RegPenApp) (WORD, BOOL) = NULL;
46 #endif
47
48 // Where is this called??
49 void wxEnablePenAppHooks (bool hook)
50 {
51 #ifndef __WIN32__
52 if (hook)
53 {
54 if (g_hPenWin)
55 return;
56
57 ///////////////////////////////////////////////////////////////////////
58 // If running on a Pen Windows system, register this app so all
59 // EDIT controls in dialogs are replaced by HEDIT controls.
60 if ((g_hPenWin = (HANDLE)::GetSystemMetrics (SM_PENWINDOWS)) != (HANDLE) NULL)
61 {
62 // We do this fancy GetProcAddress simply because we don't
63 // know if we're running Pen Windows.
64 if ((RegPenApp = (PENREGPROC)GetProcAddress (g_hPenWin, "RegisterPenApp")) != NULL)
65 (*RegPenApp) (RPA_DEFAULT, TRUE);
66 }
67 }
68 else
69 {
70 ///////////////////////////////////////////////////////////////////////
71 // If running on a Pen Windows system, unregister
72 if (g_hPenWin)
73 {
74 // Unregister this app
75 if (RegPenApp != NULL)
76 (*RegPenApp) (RPA_DEFAULT, FALSE);
77 g_hPenWin = (HANDLE) NULL;
78 }
79 }
80 #endif /* ! Windows-NT */
81 }
82
83 #endif
84 // End wxUSE_PENWINDOWS
85
86 void wxRegisterPenWin(void)
87 {
88 #if wxUSE_PENWINDOWS
89 ///////////////////////////////////////////////////////////////////////
90 // If running on a Pen Windows system, register this app so all
91 // EDIT controls in dialogs are replaced by HEDIT controls.
92 // (Notice the CONTROL statement in the RC file is "EDIT",
93 // RegisterPenApp will automatically change that control to
94 // an HEDIT.
95 if ((g_hPenWin = (HANDLE)::GetSystemMetrics(SM_PENWINDOWS)) != (HANDLE)NULL) {
96 // We do this fancy GetProcAddress simply because we don't
97 // know if we're running Pen Windows.
98 if ( (RegPenApp = (void (CALLBACK *)(WORD, BOOL))GetProcAddress(g_hPenWin, "RegisterPenApp"))!= NULL)
99 (*RegPenApp)(RPA_DEFAULT, TRUE);
100 }
101 ///////////////////////////////////////////////////////////////////////
102 #endif
103 }
104
105 void wxCleanUpPenWin(void)
106 {
107 #if wxUSE_PENWINDOWS
108 if (g_hPenWin) {
109 // Unregister this app
110 if (RegPenApp != NULL)
111 (*RegPenApp)(RPA_DEFAULT, FALSE);
112 }
113 #endif
114 }

  ViewVC Help
Powered by ViewVC 1.1.22