0031067: Visualization - Aspect_Window::DoResize() should be a non-const method
[occt.git] / src / WNT / WNT_WClass.hxx
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
22 #if defined(_WIN32) && !defined(OCCT_UWP)
23
24 #include <Aspect_Handle.hxx>
25 #include <Standard_Address.hxx>
26 #include <Standard_CString.hxx>
27 #include <Standard_Integer.hxx>
28 #include <Standard_Transient.hxx>
29 #include <Standard_Type.hxx>
30 #include <TCollection_AsciiString.hxx>
31
32 //! This class defines a Windows NT window class.
33 //! A window in Windows NT is always created based on a
34 //! window class. The window class identifies the window
35 //! procedure that processes messages to the window. Each
36 //! window class has unique name ( character string ). More
37 //! than one window can be created based on a single window
38 //! class. For example, all button windows in Windows NT
39 //! are created based on the same window class. The window
40 //! class defines the window procedure and some other
41 //! characteristics ( background, mouse cursor shape etc. )
42 //! of the windows that are created based on that class.
43 //! When we create a window, we define additional
44 //! characteristics of the window that are unique to that
45 //! window. So, we have to create and register window
46 //! class before creation of any window. Of course, it's possible
47 //! to create a new window class for each window inside
48 //! the Window class and do not use the WClass at all.
49 //! We implemented this class for sake of flexibility of
50 //! event processing.
51 class WNT_WClass : public Standard_Transient
52 {
53   friend class WNT_Window;
54   DEFINE_STANDARD_RTTIEXT(WNT_WClass, Standard_Transient)
55 public:
56   
57   //! Creates a Windows NT window class and registers it.
58   Standard_EXPORT WNT_WClass (const TCollection_AsciiString& theClassName,
59                               const Standard_Address theWndProc,
60                               const unsigned int theStyle,
61                               const Standard_Integer theClassExtra  = 0,
62                               const Standard_Integer theWindowExtra = 0,
63                               const Aspect_Handle theCursor = NULL,
64                               const Aspect_Handle theIcon   = NULL,
65                               const TCollection_AsciiString& theMenuName = TCollection_AsciiString());
66
67   //! Destroys all resources attached to the class
68   Standard_EXPORT ~WNT_WClass();
69
70   //! Returns address of window procedure.
71   Standard_Address WndProc() const { return myWndProc; }
72
73   //! Returns a class name.
74   const TCollection_AsciiString& Name() const { return myClassName; }
75
76   //! Returns a program instance handle.
77   Aspect_Handle Instance() const { return myAppInstance; }
78
79 protected:
80
81   TCollection_AsciiString myClassName;
82   Aspect_Handle           myAppInstance;
83   Standard_Address        myWndProc;
84
85 };
86
87 DEFINE_STANDARD_HANDLE(WNT_WClass, Standard_Transient)
88
89 #endif // _WIN32
90 #endif // _WNT_WClass_HeaderFile