private.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/x11/private.h
  3. // Purpose: Private declarations for X11 port
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 17/09/98
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_PRIVATE_H_
  11. #define _WX_PRIVATE_H_
  12. #include "wx/defs.h"
  13. #include "wx/hashmap.h"
  14. #include "wx/utils.h"
  15. #if defined( __cplusplus ) && defined( __VMS )
  16. #pragma message disable nosimpint
  17. #endif
  18. #include "X11/Xlib.h"
  19. #include "X11/Xatom.h"
  20. #include "X11/Xutil.h"
  21. #if defined( __cplusplus ) && defined( __VMS )
  22. #pragma message enable nosimpint
  23. #endif
  24. // Include common declarations
  25. #include "wx/x11/privx.h"
  26. #if wxUSE_PANGO
  27. #include <pango/pango.h>
  28. #endif
  29. class WXDLLIMPEXP_FWD_CORE wxMouseEvent;
  30. class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
  31. class WXDLLIMPEXP_FWD_CORE wxWindow;
  32. // ----------------------------------------------------------------------------
  33. // Some Unicode <-> UTF8 macros stolen from GTK
  34. // ----------------------------------------------------------------------------
  35. #if wxUSE_UNICODE
  36. #define wxGTK_CONV(s) wxConvUTF8.cWX2MB(s)
  37. #define wxGTK_CONV_BACK(s) wxConvUTF8.cMB2WX(s)
  38. #else
  39. #define wxGTK_CONV(s) s.c_str()
  40. #define wxGTK_CONV_BACK(s) s
  41. #endif
  42. // ----------------------------------------------------------------------------
  43. // we maintain a hash table which contains the mapping from Widget to wxWindow
  44. // corresponding to the window for this widget
  45. // ----------------------------------------------------------------------------
  46. WX_DECLARE_HASH_MAP(Window, wxWindow *, wxIntegerHash, wxIntegerEqual, wxWindowHash);
  47. // these hashes are defined in app.cpp
  48. extern wxWindowHash *wxWidgetHashTable;
  49. extern wxWindowHash *wxClientWidgetHashTable;
  50. extern void wxDeleteWindowFromTable(Window w);
  51. extern wxWindow *wxGetWindowFromTable(Window w);
  52. extern bool wxAddWindowToTable(Window w, wxWindow *win);
  53. extern void wxDeleteClientWindowFromTable(Window w);
  54. extern wxWindow *wxGetClientWindowFromTable(Window w);
  55. extern bool wxAddClientWindowToTable(Window w, wxWindow *win);
  56. // ----------------------------------------------------------------------------
  57. // TranslateXXXEvent() functions - translate X event to wxWindow one
  58. // ----------------------------------------------------------------------------
  59. extern bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Window window, XEvent *xevent);
  60. extern bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window window, XEvent *xevent, bool isAscii = FALSE);
  61. extern Window wxGetWindowParent(Window window);
  62. // Set the window manager decorations according to the
  63. // given wxWidgets style
  64. bool wxSetWMDecorations(Window w, long style);
  65. bool wxMWMIsRunning(Window w);
  66. #endif
  67. // _WX_PRIVATE_H_