| 1 |
/* Copyright (C) 2002 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
_CONFIGINCLUDE(atkmmconfig.h) |
| 18 |
|
| 19 |
_DEFS(atkmm,atk) |
| 20 |
_PINCLUDE(atk/atkcomponent.h) |
| 21 |
|
| 22 |
#include <glibmm/interface.h> |
| 23 |
#include <glibmm/value.h> |
| 24 |
|
| 25 |
#ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 26 |
extern "C" |
| 27 |
{ |
| 28 |
typedef struct _AtkComponentIface AtkComponentIface; |
| 29 |
typedef struct _AtkObject AtkObject; |
| 30 |
typedef void (* AtkFocusHandler) (AtkObject*, gboolean); |
| 31 |
} |
| 32 |
#endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 33 |
|
| 34 |
|
| 35 |
namespace Atk |
| 36 |
{ |
| 37 |
|
| 38 |
_CC_INCLUDE(atk/atk-enum-types.h) |
| 39 |
_WRAP_ENUM(CoordType, AtkCoordType, decl_prefix ATKMM_API) |
| 40 |
_WRAP_ENUM(Layer, AtkLayer, decl_prefix ATKMM_API) |
| 41 |
|
| 42 |
class ATKMM_API Object; |
| 43 |
|
| 44 |
|
| 45 |
/** The ATK interface provided by UI components which occupy a physical area on the screen. |
| 46 |
* This should be implemented by most if not all UI elements with an actual on-screen presence, i.e. components which |
| 47 |
* can be said to have a screen-coordinate bounding box. Virtually all widgets will need to have Atk::Component |
| 48 |
* implementations provided for their corresponding Atk::Object class. In short, only UI elements which are *not* GUI |
| 49 |
* elements will omit this ATK interface. |
| 50 |
* |
| 51 |
* A possible exception might be textual information with a transparent background, in which case text glyph bounding |
| 52 |
* box information is provided by Atk::Text. |
| 53 |
*/ |
| 54 |
class ATKMM_API Component : public Glib::Interface |
| 55 |
{ |
| 56 |
_CLASS_INTERFACE(Component, AtkComponent, ATK_COMPONENT, AtkComponentIface, , , ATKMM_API) |
| 57 |
|
| 58 |
public: |
| 59 |
_WRAP_METHOD(guint add_focus_handler(AtkFocusHandler handler), atk_component_add_focus_handler, deprecated "If you need to track when an object gains or lose the focus, use Atk::Object::signal_state_change() and check for focused notification instead.") |
| 60 |
_WRAP_METHOD(bool contains(int x, int y, CoordType coord_type) const, atk_component_contains) |
| 61 |
_WRAP_METHOD(Glib::RefPtr<Atk::Object> get_accessible_at_point(int x, int y, CoordType coord_type), atk_component_ref_accessible_at_point) |
| 62 |
_WRAP_METHOD(void get_extents(int& x, int& y, int& width, int& height, CoordType coord_type) const, atk_component_get_extents) |
| 63 |
_WRAP_METHOD(void get_position(int& x, int& y, CoordType coord_type) const, atk_component_get_position, deprecated "Use get_extents() instead.") |
| 64 |
_WRAP_METHOD(void get_size(int& width, int& height) const, atk_component_get_size, deprecated "Use get_extents() instead.") |
| 65 |
_WRAP_METHOD(Layer get_layer() const, atk_component_get_layer) |
| 66 |
_WRAP_METHOD(int get_mdi_zorder() const, atk_component_get_mdi_zorder) |
| 67 |
_WRAP_METHOD(bool grab_focus(), atk_component_grab_focus) |
| 68 |
_WRAP_METHOD(void remove_focus_handler(guint handler_id), atk_component_remove_focus_handler, deprecated "If you need to track when an object gains or lose the focus, use Atk::Object::signal_state_change() and check for focused notification instead.") |
| 69 |
_WRAP_METHOD(bool set_extents(int x, int y, int width, int height, CoordType coord_type), atk_component_set_extents) |
| 70 |
_WRAP_METHOD(bool set_position(int x, int y, CoordType coord_type), atk_component_set_position) |
| 71 |
_WRAP_METHOD(bool set_size(int width, int height), atk_component_set_size) |
| 72 |
|
| 73 |
protected: |
| 74 |
_WRAP_VFUNC(guint add_focus_handler(AtkFocusHandler handler), add_focus_handler) |
| 75 |
_WRAP_VFUNC(bool contains(int x, int y, CoordType coord_type) const, contains) |
| 76 |
|
| 77 |
_WRAP_VFUNC(Glib::RefPtr<Atk::Object> get_accessible_at_point(int x, int y, CoordType coord_type), ref_accessible_at_point, refreturn_ctype) |
| 78 |
|
| 79 |
_WRAP_VFUNC(void get_extents(int& x, int& y, int& width, int& height, CoordType coord_type) const, get_extents) |
| 80 |
|
| 81 |
//deprecated: |
| 82 |
_WRAP_VFUNC(void get_position(int& x, int& y, CoordType coord_type) const, get_position) |
| 83 |
|
| 84 |
//deprecated: |
| 85 |
_WRAP_VFUNC(void get_size(int& width, int& height) const, get_size) |
| 86 |
|
| 87 |
_WRAP_VFUNC(Layer get_layer() const, get_layer) |
| 88 |
_WRAP_VFUNC(int get_mdi_zorder() const, get_mdi_zorder) |
| 89 |
_WRAP_VFUNC(bool grab_focus(), grab_focus) |
| 90 |
|
| 91 |
//deprecated: |
| 92 |
_WRAP_VFUNC(void remove_focus_handler(guint handler_id), remove_focus_handler) |
| 93 |
|
| 94 |
_WRAP_VFUNC(bool set_extents(int x, int y, int width, int height, CoordType coord_type), set_extents) |
| 95 |
_WRAP_VFUNC(bool set_position(int x, int y, CoordType coord_type), set_position) |
| 96 |
_WRAP_VFUNC(bool set_size(int width, int height), set_size) |
| 97 |
}; |
| 98 |
|
| 99 |
} // namespace Atk |