00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef WINDOWHANDLE_H
00016 #define WINDOWHANDLE_H
00017
00018 #include "pandabase.h"
00019
00020 #include "typedReferenceCount.h"
00021 #include "pointerTo.h"
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 class EXPCL_PANDA_DISPLAY WindowHandle : public TypedReferenceCount {
00041 PUBLISHED:
00042 class OSHandle;
00043
00044 INLINE WindowHandle(OSHandle *os_handle);
00045 INLINE WindowHandle(const WindowHandle ©);
00046 virtual ~WindowHandle();
00047
00048 INLINE OSHandle *get_os_handle() const;
00049 INLINE void set_os_handle(OSHandle *os_handle);
00050
00051 void send_windows_message(unsigned int msg, int wparam, int lparam);
00052
00053 size_t get_int_handle() const;
00054
00055 void output(ostream &out) const;
00056
00057 public:
00058
00059 virtual void attach_child(WindowHandle *child);
00060 virtual void detach_child(WindowHandle *child);
00061
00062 virtual void request_keyboard_focus(WindowHandle *child);
00063 virtual void receive_windows_message(unsigned int msg, int wparam, int lparam);
00064
00065 PUBLISHED:
00066
00067
00068
00069 class EXPCL_PANDA_DISPLAY OSHandle : public TypedReferenceCount {
00070 protected:
00071 INLINE OSHandle();
00072
00073 PUBLISHED:
00074 virtual ~OSHandle();
00075 virtual size_t get_int_handle() const;
00076 virtual void output(ostream &out) const;
00077
00078 public:
00079 static TypeHandle get_class_type() {
00080 return _type_handle;
00081 }
00082 static void init_type() {
00083 TypedReferenceCount::init_type();
00084 register_type(_type_handle, "WindowHandle::OSHandle",
00085 TypedReferenceCount::get_class_type());
00086 }
00087 virtual TypeHandle get_type() const {
00088 return get_class_type();
00089 }
00090 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00091
00092 private:
00093 static TypeHandle _type_handle;
00094 };
00095
00096 protected:
00097 PT(OSHandle) _os_handle;
00098
00099 PT(WindowHandle) _keyboard_window;
00100
00101 public:
00102 static TypeHandle get_class_type() {
00103 return _type_handle;
00104 }
00105 static void init_type() {
00106 TypedReferenceCount::init_type();
00107 register_type(_type_handle, "WindowHandle",
00108 TypedReferenceCount::get_class_type());
00109 }
00110 virtual TypeHandle get_type() const {
00111 return get_class_type();
00112 }
00113 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00114
00115 private:
00116 static TypeHandle _type_handle;
00117 };
00118
00119 #include "windowHandle.I"
00120
00121 INLINE ostream &operator << (ostream &out, const WindowHandle &handle) {
00122 handle.output(out);
00123 return out;
00124 }
00125
00126 INLINE ostream &operator << (ostream &out, const WindowHandle::OSHandle &handle) {
00127 handle.output(out);
00128 return out;
00129 }
00130
00131 #endif