OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
signatur.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1992, 1996 by Borland International, All Rights Reserved
4// Copyright (c) 1998 by Yura Bidus
5//
6/// \file
7/// Message handler signature templates
8//----------------------------------------------------------------------------
9
10#if !defined(OWL_SIGNATUR_H)
11#define OWL_SIGNATUR_H
12
13#include <owl/private/defs.h>
14#if defined(BI_HAS_PRAGMA_ONCE)
15# pragma once
16#endif
17
18#if defined(OWL5_COMPAT)
19
20namespace owl {
21
22class _OWLCLASS TCommandEnabler;
23class _OWLCLASS TDocument;
24class _OWLCLASS TView;
25class _OWLCLASS TDockingSlip;
26class _OWLCLASS TWindow;
27class _OWLCLASS TPoint;
28class _OWLCLASS TDropInfo;
29class _OWLCLASS TSize;
30class _OWLCLASS TRect;
31
32struct _OWLCLASS THelpHitInfo;
33
34
35
36////////////////////////////////////////////////////////////////////////////
37// These macros are used for declaring signature templates for OWL dispatch
38// tables. The signatures are used to ensure that methods provided to the
39// macros are of the proper form (ie, signature). Eg:
40//
41// DECLARE_DISPSIGNATURE1 (void, v_EnterPage_Sig, TEnterPageNotify &)
42//
43// This creates a signature verification template called v_EnterPage_Sig
44// that is used like this:
45//
46// #define EV_TABN_ENTERPAGE(id,method)
47// { nmEnterPage, id, (::owl::TAnyDispatcher)::owl::v_LPARAM_Dispatch,
48// (TMyPMF) v_EnterPage_Sig (&TMyClass::method) }
49//
50// All this will simply guarantee that "method" is of the form:
51//
52// void Method (TEnterPageNotify &);
53//
54// The number on the end of DECLARE_DISPSIGNATUREx is either 0, 1, 2, 3 or
55// 4, depending on the number of arguments the method takes.
56//
57#define DECLARE_SIGNATURE0(R,Name) \
58 template <class T> \
59 inline R (T::*Name(R (T::*pmf)()))() \
60 { return pmf; }
61
62#define DECLARE_SIGNATURE1(R,Name,P1) \
63 template <class T> \
64 inline R (T::*Name(R (T::*pmf)(P1)))(P1) \
65 { return pmf; }
66
67#define DECLARE_SIGNATURE2(R,Name,P1,P2) \
68 template <class T> \
69 inline R (T::*Name(R (T::*pmf)(P1,P2)))(P1,P2) \
70 { return pmf; }
71
72#define DECLARE_SIGNATURE3(R,Name,P1,P2,P3) \
73 template <class T> \
74 inline R (T::*Name(R (T::*pmf)(P1,P2,P3)))(P1,P2,P3) \
75 { return pmf; }
76
77#define DECLARE_SIGNATURE4(R,Name,P1,P2,P3,P4) \
78 template <class T> \
79 inline R (T::*Name(R (T::*pmf)(P1,P2,P3,P4)))(P1,P2,P3,P4) \
80 { return pmf; }
81
82#define DECLARE_SIGNATURE5(R,Name,P1,P2,P3,P4,P5) \
83 template <class T> \
84 inline R (T::*Name(R (T::*pmf)(P1,P2,P3,P4,P5)))\
85 (P1,P2,P3,P4,P5) \
86 { return pmf; }
87
88#define DECLARE_SIGNATURE6(R,Name,P1,P2,P3,P4,P5,P6) \
89 template <class T> \
90 inline R (T::*Name(R (T::*pmf)(P1,P2,P3,P4,P5,P6)))\
91 (P1,P2,P3,P4,P5,P6) \
92 { return pmf; }
93
94#define DECLARE_SIGNATURE7(R,Name,P1,P2,P3,P4,P5,P6,P8) \
95 template <class T> \
96 inline R (T::*Name(R (T::*pmf)(P1,P2,P3,P4,P5,P6,P8)))\
97 (P1,P2,P3,P4,P5,P6,P8) \
98 { return pmf; }
99
100#define DECLARE_SIGNATURE9(R,Name,P1,P2,P3,P4,P5,P6,P8,P9) \
101 template <class T> \
102 inline R (T::*Name(R (T::*pmf)(P1,P2,P3,P4,P5,P6,P8,P9)))\
103 (P1,P2,P3,P4,P5,P6,P8,P9) \
104 { return pmf; }
105
106#define DECLARE_SIGNATURE10(R,Name,P1,P2,P3,P4,P5,P6,P8,P9,P10) \
107 template <class T> \
108 inline R (T::*Name(R (T::*pmf)\
109 (P1,P2,P3,P4,P5,P6,P8,P9,P10)))(P1,P2,P3,P4,P5,P6,P8,P9,P10) \
110 { return pmf; }
111
112#define DECLARE_SIGNATURE11(R,Name,P1,P2,P3,P4,P5,P6,P8,P9,P10,P11) \
113 template <class T> \
114 inline R (T::*Name(R (T::*pmf)\
115 (P1,P2,P3,P4,P5,P6,P8,P9,PP10,P11)))(P1,P2,P3,P4,P5,P6,P8,P9,P10,P11) \
116 { return pmf; }
117
118#define DECLARE_SIGNATURE12(R,Name,P1,P2,P3,P4,P5,P6,P8,P9,P10,P11,P12) \
119 template <class T> \
120 inline R (T::*Name(R (T::*pmf)\
121 (P1,P2,P3,P4,P5,P6,P8,P9,P10,P11,P12)))(P1,P2,P3,P4,P5,P6,P8,P9,P10,P11,P12)\
122 { return pmf; }
123
124//----------------------------------------------------------------------------
125// LEGEND: in order to keep signature names from getting too long, the
126// following abbreviations are used for the data types passed to and
127// returned from the methods. The first code is the return type, the
128// rest are args in left to right order.
129//
130// - v (void return)
131// - i,I (int)
132// - I32 (int32)
133// - U (uint)
134// - B (bool)
135// - H (HANDLE)
136// - W (HWND)
137// - S (char *)
138// - CS (const char *)
139// - other types spelled out
140//
141
142//----------------------------------------------------------------------------
143
151DECLARE_SIGNATURE1(bool,B_RECT_Sig,TRect *)
157DECLARE_SIGNATURE3(bool,B_U_i_POINT_Sig,uint,int,const TPoint&)
158
161
163DECLARE_SIGNATURE3(void,v_B_I_I_Sig,bool,int,int)
166
167//----------------------------------------------------------------------------
177//----------------------------------------------------------------------------
178
184
185//----------------------------------------------------------------------------
186
189
190//----------------------------------------------------------------------------
191
197
198//----------------------------------------------------------------------------
199
202DECLARE_SIGNATURE1(void,v_COMMANDENABLER_Sig,TCommandEnabler&)
204DECLARE_SIGNATURE1(void,v_DROP_Sig,TDropInfo)
207DECLARE_SIGNATURE2(void,v_B_B_Sig,bool,bool)
213
215
217
225DECLARE_SIGNATURE2(void,v_OWLWINDOWDOCKED_Sig,uint,const TDockingSlip&)
226DECLARE_SIGNATURE1(void,v_OWLHELPHIT_Sig,const THelpHitInfo&)
227DECLARE_SIGNATURE1(void,v_POINT_Sig,const TPoint&)
235DECLARE_SIGNATURE2(void,v_U_POINT_Sig,uint,const TPoint&)
237DECLARE_SIGNATURE2(void,v_U_SIZE_Sig,uint,const TSize&)
252
253
254} // OWL namespace
255//
256// Aliases for compatibility
257//
258#define B_LPARAM_Sig B_I32_Sig
259#define I32_U_U_HMENU_Sig LRESULT_U_U_HMENU_Sig
260#define I32_U_COMPAREITEM_Sig LRESULT_U_COMPAREITEM_Sig
261#define I32_MDICREATESTRUCT_Sig LRESULT_MDICREATESTRUCT_Sig
262
263#endif
264
265#endif // OWL_SIGNATUR_H
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
signed long int32
Definition number.h:30
unsigned long uint32
Definition number.h:34
unsigned int uint
Definition number.h:25
#define HTASK
Definition defs.h:127
#define _OWLCLASS
Definition defs.h:338