46 * AwtWindow class 47 */ 48 49 class AwtWindow : public AwtCanvas { 50 public: 51 52 /* java.awt.Window field ids */ 53 static jfieldID warningStringID; 54 static jfieldID locationByPlatformID; 55 static jfieldID screenID; /* screen number passed over from WindowPeer */ 56 static jfieldID autoRequestFocusID; 57 static jfieldID securityWarningWidthID; 58 static jfieldID securityWarningHeightID; 59 60 // The coordinates at the peer. 61 static jfieldID sysXID; 62 static jfieldID sysYID; 63 static jfieldID sysWID; 64 static jfieldID sysHID; 65 66 static jmethodID getWarningStringMID; 67 static jmethodID calculateSecurityWarningPositionMID; 68 69 AwtWindow(); 70 virtual ~AwtWindow(); 71 72 virtual void Dispose(); 73 74 virtual LPCTSTR GetClassName(); 75 virtual void FillClassInfo(WNDCLASSEX *lpwc); 76 77 static AwtWindow* Create(jobject self, jobject parent); 78 79 // Returns TRUE if this Window is equal to or one of owners of wnd 80 BOOL IsOneOfOwnersOf(AwtWindow * wnd); 81 82 /* Update the insets for this Window (container), its peer & 83 * optional other 84 */ 85 BOOL UpdateInsets(jobject insets = 0); 86 BOOL HasValidRect(); 87 334 public: 335 void UpdateSecurityWarningVisibility(); 336 static bool IsWarningWindow(HWND hWnd); 337 338 protected: 339 BOOL m_isResizable; 340 static AwtWindow* m_grabbedWindow; // Current grabbing window 341 HICON m_hIcon; /* Icon for this window. It can be set explicitely or inherited from the owner */ 342 HICON m_hIconSm; /* Small icon for this window. It can be set explicitely or inherited from the owner */ 343 BOOL m_iconInherited; /* TRUE if icon is inherited from the owner */ 344 BOOL m_filterFocusAndActivation; /* Used in the WH_CBT hook */ 345 346 inline BOOL IsUntrusted() { 347 return warningString != NULL; 348 } 349 350 UINT currentWmSizeState; 351 352 void EnableTranslucency(BOOL enable); 353 354 private: 355 int m_screenNum; 356 357 void InitOwner(AwtWindow *owner); 358 }; 359 360 #endif /* AWT_WINDOW_H */ | 46 * AwtWindow class 47 */ 48 49 class AwtWindow : public AwtCanvas { 50 public: 51 52 /* java.awt.Window field ids */ 53 static jfieldID warningStringID; 54 static jfieldID locationByPlatformID; 55 static jfieldID screenID; /* screen number passed over from WindowPeer */ 56 static jfieldID autoRequestFocusID; 57 static jfieldID securityWarningWidthID; 58 static jfieldID securityWarningHeightID; 59 60 // The coordinates at the peer. 61 static jfieldID sysXID; 62 static jfieldID sysYID; 63 static jfieldID sysWID; 64 static jfieldID sysHID; 65 66 static jfieldID windowTypeID; 67 68 static jmethodID getWarningStringMID; 69 static jmethodID calculateSecurityWarningPositionMID; 70 static jmethodID windowTypeNameMID; 71 72 AwtWindow(); 73 virtual ~AwtWindow(); 74 75 virtual void Dispose(); 76 77 virtual LPCTSTR GetClassName(); 78 virtual void FillClassInfo(WNDCLASSEX *lpwc); 79 80 static AwtWindow* Create(jobject self, jobject parent); 81 82 // Returns TRUE if this Window is equal to or one of owners of wnd 83 BOOL IsOneOfOwnersOf(AwtWindow * wnd); 84 85 /* Update the insets for this Window (container), its peer & 86 * optional other 87 */ 88 BOOL UpdateInsets(jobject insets = 0); 89 BOOL HasValidRect(); 90 337 public: 338 void UpdateSecurityWarningVisibility(); 339 static bool IsWarningWindow(HWND hWnd); 340 341 protected: 342 BOOL m_isResizable; 343 static AwtWindow* m_grabbedWindow; // Current grabbing window 344 HICON m_hIcon; /* Icon for this window. It can be set explicitely or inherited from the owner */ 345 HICON m_hIconSm; /* Small icon for this window. It can be set explicitely or inherited from the owner */ 346 BOOL m_iconInherited; /* TRUE if icon is inherited from the owner */ 347 BOOL m_filterFocusAndActivation; /* Used in the WH_CBT hook */ 348 349 inline BOOL IsUntrusted() { 350 return warningString != NULL; 351 } 352 353 UINT currentWmSizeState; 354 355 void EnableTranslucency(BOOL enable); 356 357 // Native representation of the java.awt.Window.Type enum 358 enum Type { 359 NORMAL, UTILITY, POPUP 360 }; 361 362 inline Type GetType() { return m_windowType; } 363 364 private: 365 int m_screenNum; 366 367 void InitOwner(AwtWindow *owner); 368 369 Type m_windowType; 370 void InitType(JNIEnv *env, jobject peer); 371 372 // Tweak the style according to the type of the window 373 void TweakStyle(DWORD & style, DWORD & exStyle); 374 375 }; 376 377 #endif /* AWT_WINDOW_H */ |