modules/graphics/src/main/native-glass/win/BaseWnd.h

Print this page




  49     // Creates an overlapped window with default x, y, width and height and
  50     // returns its bounds. This method is used to find the default window
  51     // size/location when CW_USEDEFAULT can't be used (e.g. for WS_POPUP windows).
  52     static BOOL GetDefaultWindowBounds(LPRECT r);
  53     
  54     HWND GetHWND() { return m_hWnd; }
  55 
  56     static BaseWnd* FromHandle(HWND hWnd);
  57 
  58     inline virtual bool IsGlassWindow() { return false; }
  59 
  60     virtual BOOL EnterFullScreenMode(GlassView * view, BOOL animate, BOOL keepRatio) { return FALSE; }
  61     virtual void ExitFullScreenMode(BOOL animate) {}
  62 
  63     HWND GetAncestor() const { return m_ancestor; }
  64     void SetAncestor(HWND ancestor) { m_ancestor = ancestor; }
  65 
  66     void SetCommonDialogOwner(bool owner) { m_isCommonDialogOwner = owner; }
  67     
  68     void SetCursor(HCURSOR cursor);

  69 
  70 private:
  71     HWND m_hWnd;
  72     static LRESULT CALLBACK StaticWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  73 
  74     static unsigned int sm_classNameCounter;
  75     
  76     HWND m_ancestor;  // either owner or parent. a window can't have both at once anyway
  77 
  78     ATOM m_wndClassAtom;
  79     bool m_isCommonDialogOwner;
  80     HCURSOR m_hCursor;

  81 protected:
  82     virtual LRESULT WindowProc(UINT msg, WPARAM wParam, LPARAM lParam) = 0;
  83     virtual MessageResult CommonWindowProc(UINT msg, WPARAM wParam, LPARAM lParam);
  84     
  85     virtual LPCTSTR GetWindowClassNameSuffix() = 0;
  86 
  87     bool IsCommonDialogOwner() { return m_isCommonDialogOwner; }
  88 
  89 };
  90    
  91 #endif  // _BASEWND_INCLUDED_


  49     // Creates an overlapped window with default x, y, width and height and
  50     // returns its bounds. This method is used to find the default window
  51     // size/location when CW_USEDEFAULT can't be used (e.g. for WS_POPUP windows).
  52     static BOOL GetDefaultWindowBounds(LPRECT r);
  53     
  54     HWND GetHWND() { return m_hWnd; }
  55 
  56     static BaseWnd* FromHandle(HWND hWnd);
  57 
  58     inline virtual bool IsGlassWindow() { return false; }
  59 
  60     virtual BOOL EnterFullScreenMode(GlassView * view, BOOL animate, BOOL keepRatio) { return FALSE; }
  61     virtual void ExitFullScreenMode(BOOL animate) {}
  62 
  63     HWND GetAncestor() const { return m_ancestor; }
  64     void SetAncestor(HWND ancestor) { m_ancestor = ancestor; }
  65 
  66     void SetCommonDialogOwner(bool owner) { m_isCommonDialogOwner = owner; }
  67     
  68     void SetCursor(HCURSOR cursor);
  69     void SetUpdatesCursor(bool updatesCursor);
  70 
  71 private:
  72     HWND m_hWnd;
  73     static LRESULT CALLBACK StaticWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  74 
  75     static unsigned int sm_classNameCounter;
  76     
  77     HWND m_ancestor;  // either owner or parent. a window can't have both at once anyway
  78 
  79     ATOM m_wndClassAtom;
  80     bool m_isCommonDialogOwner;
  81     HCURSOR m_hCursor;
  82     bool m_updatesCursor;
  83 protected:
  84     virtual LRESULT WindowProc(UINT msg, WPARAM wParam, LPARAM lParam) = 0;
  85     virtual MessageResult CommonWindowProc(UINT msg, WPARAM wParam, LPARAM lParam);
  86     
  87     virtual LPCTSTR GetWindowClassNameSuffix() = 0;
  88 
  89     bool IsCommonDialogOwner() { return m_isCommonDialogOwner; }
  90 
  91 };
  92    
  93 #endif  // _BASEWND_INCLUDED_