Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:33

0001 // Created on: 1996-01-26
0002 // Created by: PLOTNIKOV Eugeny
0003 // Copyright (c) 1996-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _WNT_WClass_HeaderFile
0018 #define _WNT_WClass_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #if defined(_WIN32) && !defined(OCCT_UWP)
0023 
0024 #include <Aspect_Handle.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <Standard_Transient.hxx>
0027 #include <NCollection_DefineAlloc.hxx>
0028 #include <TCollection_AsciiString.hxx>
0029 
0030 //! This class defines a Windows NT window class.
0031 //! A window in Windows NT is always created based on a
0032 //! window class. The window class identifies the window
0033 //! procedure that processes messages to the window. Each
0034 //! window class has unique name ( character string ). More
0035 //! than one window can be created based on a single window
0036 //! class. For example, all button windows in Windows NT
0037 //! are created based on the same window class. The window
0038 //! class defines the window procedure and some other
0039 //! characteristics ( background, mouse cursor shape etc. )
0040 //! of the windows that are created based on that class.
0041 //! When we create a window, we define additional
0042 //! characteristics of the window that are unique to that
0043 //! window. So, we have to create and register window
0044 //! class before creation of any window. Of course, it's possible
0045 //! to create a new window class for each window inside
0046 //! the Window class and do not use the WClass at all.
0047 //! We implemented this class for sake of flexibility of
0048 //! event processing.
0049 class WNT_WClass : public Standard_Transient
0050 {
0051   friend class WNT_Window;
0052   DEFINE_STANDARD_RTTIEXT(WNT_WClass, Standard_Transient)
0053 public:
0054   
0055   //! Creates a Windows NT window class and registers it.
0056   Standard_EXPORT WNT_WClass (const TCollection_AsciiString& theClassName,
0057                               const Standard_Address theWndProc,
0058                               const unsigned int theStyle,
0059                               const Standard_Integer theClassExtra  = 0,
0060                               const Standard_Integer theWindowExtra = 0,
0061                               const Aspect_Handle theCursor = NULL,
0062                               const Aspect_Handle theIcon   = NULL,
0063                               const TCollection_AsciiString& theMenuName = TCollection_AsciiString());
0064 
0065   //! Destroys all resources attached to the class
0066   Standard_EXPORT ~WNT_WClass();
0067 
0068   //! Returns address of window procedure.
0069   Standard_Address WndProc() const { return myWndProc; }
0070 
0071   //! Returns a class name.
0072   const TCollection_AsciiString& Name() const { return myClassName; }
0073 
0074   //! Returns a program instance handle.
0075   Aspect_Handle Instance() const { return myAppInstance; }
0076 
0077 protected:
0078 
0079   TCollection_AsciiString myClassName;
0080   Aspect_Handle           myAppInstance;
0081   Standard_Address        myWndProc;
0082 
0083 };
0084 
0085 DEFINE_STANDARD_HANDLE(WNT_WClass, Standard_Transient)
0086 
0087 #endif // _WIN32
0088 #endif // _WNT_WClass_HeaderFile