wndapi.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #ifndef _WNDAPI_H
  2. #define _WNDAPI_H
  3. #include <api/wnd/api_wnd.h>
  4. #include <bfc/ptrlist.h>
  5. #include <tataki/bitmap/autobitmap.h>
  6. #include <api/wnd/popexitchecker.h>
  7. // ---
  8. class BaseTexture
  9. {
  10. public:
  11. BaseTexture(ifc_window *_wnd, const wchar_t *_bmp) : wnd(_wnd), texture(_bmp) {}
  12. virtual ~BaseTexture() {}
  13. SkinBitmap *getTexture() { return texture.getBitmap(); }
  14. ifc_window *getWnd() { return wnd; }
  15. virtual void renderBaseTexture(ifc_window *wndbase, ifc_canvas *c, const RECT &r, ifc_window *dest, int alpha);
  16. private:
  17. ifc_window *wnd;
  18. AutoSkinBitmap texture;
  19. };
  20. // ---
  21. class WndApi : public wnd_apiI
  22. {
  23. public:
  24. WndApi();
  25. virtual ~WndApi();
  26. virtual ifc_window *main_getRootWnd();
  27. virtual void main_setRootWnd(ifc_window *w);
  28. virtual ifc_window *getModalWnd();
  29. virtual void pushModalWnd(ifc_window *w=MODALWND_NOWND);
  30. virtual void popModalWnd(ifc_window *w=MODALWND_NOWND);
  31. virtual ifc_window *rootWndFromPoint(POINT *pt);
  32. virtual ifc_window *rootWndFromOSHandle(OSWINDOWHANDLE wnd);
  33. virtual void registerRootWnd(ifc_window *wnd);
  34. virtual void unregisterRootWnd(ifc_window *wnd);
  35. virtual int rootwndIsValid(ifc_window *wnd);
  36. virtual void hookKeyboard(ifc_window *hooker);
  37. virtual void unhookKeyboard(ifc_window *hooker);
  38. virtual void kbdReset();
  39. virtual int interceptOnChar(unsigned int c);
  40. virtual int interceptOnKeyDown(int k);
  41. virtual int interceptOnKeyUp(int k);
  42. virtual int interceptOnSysKeyDown(int k, int kd);
  43. virtual int interceptOnSysKeyUp(int k, int kd);
  44. virtual int forwardOnChar(ifc_window *from, unsigned int c, int kd);
  45. virtual int forwardOnKeyDown(ifc_window *from, int k, int kd);
  46. virtual int forwardOnKeyUp(ifc_window *from, int k, int kd);
  47. virtual int forwardOnSysKeyDown(ifc_window *from, int k, int kd);
  48. virtual int forwardOnSysKeyUp(ifc_window *from, int k, int kd);
  49. virtual int forwardOnKillFocus();
  50. virtual void popupexit_deregister(PopupExitCallback *cb);
  51. virtual void popupexit_register(PopupExitCallback *cb, ifc_window *watched);
  52. virtual int popupexit_check(ifc_window *w);
  53. virtual void popupexit_signal();
  54. virtual void skin_renderBaseTexture(ifc_window *base, ifc_canvas *c, const RECT *r, ifc_window *destWnd, int alpha=255);
  55. virtual void skin_registerBaseTextureWindow(ifc_window *window, const wchar_t *bmp=NULL);
  56. virtual void skin_unregisterBaseTextureWindow(ifc_window *window);
  57. virtual void appdeactivation_push_disallow(ifc_window *w);
  58. virtual void appdeactivation_pop_disallow(ifc_window *w);
  59. virtual int appdeactivation_isallowed(ifc_window *w);
  60. virtual void appdeactivation_setbypass(int i);
  61. #ifdef WASABI_COMPILE_PAINTSETS
  62. virtual int paintset_present(int set);
  63. #ifdef WASABI_COMPILE_IMGLDR
  64. virtual void paintset_render(int set, ifc_canvas *c, const RECT *r, int alpha=255);
  65. #ifdef WASABI_COMPILE_FONTS
  66. virtual void paintset_renderTitle(const wchar_t *t, ifc_canvas *c, const RECT *r, int alpha=255);
  67. #endif // fonts
  68. #endif // imgldr
  69. #endif // paintsets
  70. virtual int forwardOnMouseWheel(int l, int a);
  71. virtual void setDefaultDropTarget(void *dt);
  72. virtual void *getDefaultDropTarget();
  73. static int getNumBaseTextures() { return baseTextureList.getNumItems(); }
  74. virtual int pushKeyboardLock();
  75. virtual int popKeyboardLock();
  76. virtual int isKeyboardLocked();
  77. PopupExitChecker popupExitChecker;
  78. private:
  79. static BaseTexture *getBaseTexture(ifc_window *b);
  80. static void renderBaseTexture(ifc_window *base, ifc_canvas *c, const RECT &r, ifc_window *dest, int alpha);
  81. static void renderBaseTexture(ifc_window *base, BaseTexture *s, ifc_canvas *c, const RECT &r, ifc_window *dest, int alpha);
  82. static PtrList<BaseTexture> baseTextureList;
  83. static ifc_window *genericwnd;
  84. static void *default_drop_target;
  85. static int kbdlock;
  86. };
  87. extern WndApi _wndApi;
  88. #endif