42cf5bc1 |
1 | // Created on: 1996-01-26 |
2 | // Created by: PLOTNIKOV Eugeny |
3 | // Copyright (c) 1996-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _WNT_WClass_HeaderFile |
18 | #define _WNT_WClass_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <Standard_CString.hxx> |
24 | #include <Aspect_Handle.hxx> |
25 | #include <Standard_Address.hxx> |
26 | #include <MMgt_TShared.hxx> |
27 | #include <WNT_Uint.hxx> |
28 | #include <Standard_Integer.hxx> |
29 | class WNT_ClassDefinitionError; |
30 | class WNT_Window; |
31 | |
32 | |
33 | class WNT_WClass; |
34 | DEFINE_STANDARD_HANDLE(WNT_WClass, MMgt_TShared) |
35 | |
36 | //! This class defines a Windows NT window class. |
37 | //! A window in Windows NT is always created based on a |
38 | //! window class. The window class identifies the window |
39 | //! procedure that processes messages to the window. Each |
40 | //! window class has unique name ( character string ). More |
41 | //! than one window can be created based on a single window |
42 | //! class. For example, all button windows in Windows NT |
43 | //! are created based on the same window class. The window |
44 | //! class defines the window procedure and some other |
45 | //! characteristics ( background, mouse cursor shape etc. ) |
46 | //! of the windows that are created based on that class. |
47 | //! When we create a window, we define additional |
48 | //! characteristics of the window that are unique to that |
49 | //! window. So, we have to create and register window |
50 | //! class before creation of any window. Of course, it's possible |
51 | //! to create a new window class for each window inside |
52 | //! the Window class and do not use the WClass at all. |
53 | //! We implemented this class for sake of flexibility of |
54 | //! event processing. |
55 | class WNT_WClass : public MMgt_TShared |
56 | { |
57 | |
58 | public: |
59 | |
60 | |
61 | //! Creates a Windows NT window class and registers it. |
62 | Standard_EXPORT WNT_WClass(const Standard_CString aClassName, const Standard_Address aWndProc, const WNT_Uint& aStyle, const Standard_Integer aClassExtra = 0, const Standard_Integer aWindowExtra = 0, const Aspect_Handle aCursor = 0, const Aspect_Handle anIcon = 0, const Standard_CString aMenuName = 0); |
63 | |
64 | //! Destroys all resources attached to the class |
65 | Standard_EXPORT virtual void Destroy(); |
66 | ~WNT_WClass() |
67 | { |
68 | Destroy(); |
69 | } |
70 | |
71 | //! Returns address of window procedure. |
72 | Standard_Address WndProc() const; |
73 | |
74 | //! Returns a class name. |
75 | Standard_CString Name() const; |
76 | |
77 | //! Returns a program instance handle. |
78 | Aspect_Handle Instance() const; |
79 | |
80 | friend class WNT_Window; |
81 | |
82 | |
83 | DEFINE_STANDARD_RTTI(WNT_WClass,MMgt_TShared) |
84 | |
85 | protected: |
86 | |
87 | |
88 | Standard_CString lpszName; |
89 | Aspect_Handle hInstance; |
90 | Standard_Address lpfnWndProc; |
91 | |
92 | |
93 | private: |
94 | |
95 | |
96 | |
97 | |
98 | }; |
99 | |
100 | |
101 | #include <WNT_WClass.lxx> |
102 | |
103 | |
104 | |
105 | |
106 | |
107 | #endif // _WNT_WClass_HeaderFile |