os_window_android.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. Copyright (c) 2013 Daniele Bartolini, Michele Rossi
  3. Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
  4. Permission is hereby granted, free of charge, to any person
  5. obtaining a copy of this software and associated documentation
  6. files (the "Software"), to deal in the Software without
  7. restriction, including without limitation the rights to use,
  8. copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the
  10. Software is furnished to do so, subject to the following
  11. conditions:
  12. The above copyright notice and this permission notice shall be
  13. included in all copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  16. OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  17. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  18. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  19. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  21. OTHER DEALINGS IN THE SOFTWARE.
  22. */
  23. #pragma once
  24. #include <sys/types.h>
  25. #include <android/native_window.h>
  26. #include <android/native_window_jni.h>
  27. namespace crown
  28. {
  29. class OsWindow
  30. {
  31. public:
  32. /// Stub method, does nothing under Android.
  33. OsWindow();
  34. ~OsWindow();
  35. /// Stub method, does nothing under Android.
  36. void show();
  37. /// Stub method, does nothing under Android.
  38. void hide();
  39. /// Returns the size in pixel of the window.
  40. void get_size(uint32_t& width, uint32_t& height);
  41. /// Returns always (0, 0) under Android.
  42. void get_position(uint32_t& x, uint32_t& y);
  43. /// Stub method, does nothing under Android.
  44. void resize(uint32_t width, uint32_t height);
  45. /// Stub method, does nothing under Android.
  46. void move(uint32_t x, uint32_t y);
  47. /// Stub method, does nothing under Android.
  48. void minimize();
  49. /// Stub method, does nothing under Android.
  50. void restore();
  51. /// Returns always false.
  52. bool is_resizable() const;
  53. /// Stub method, does nothing under Android.
  54. void set_resizable(bool resizeable);
  55. /// Stub method, does nothing under Android.
  56. void show_cursor(bool show);
  57. /// Stub method, does nothing under Android.
  58. void get_cursor_xy(int32_t& x, int32_t& y);
  59. /// Stub method, does nothing under Android.
  60. void set_cursor_xy(int32_t x, int32_t y);
  61. /// Returns always NULL under Android.
  62. char* title();
  63. /// Stub method, does nothing under Android.
  64. void set_title(const char* title);
  65. /// Stub method, does nothing under Android.
  66. void frame();
  67. public:
  68. uint32_t m_x;
  69. uint32_t m_y;
  70. uint32_t m_width;
  71. uint32_t m_height;
  72. };
  73. } // namespace crown