<commit_before>#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif

#include <Elementary.h>

#include "elm_priv.h"
#include "elm_interface_atspi_component.eo.h"

#include "atspi/atspi-constants.h"

EOLIAN static void
_elm_interface_atspi_component_position_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,int *x, int *y, AtspiCoordType type)
{
   eo_do(obj, elm_interface_atspi_component_extents_get(x, y, NULL, NULL, type));
}

EOLIAN static Eina_Bool
_elm_interface_atspi_component_position_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int x, int y, AtspiCoordType type)
{
   Eina_Bool ret = EINA_FALSE;
   int c_w, c_h;

   eo_do(obj, elm_interface_atspi_component_extents_get(NULL, NULL, &c_w, &c_h, type));
   eo_do(obj, elm_interface_atspi_component_extents_set(x, y, c_w, c_h, type, &ret));
   return ret;
}

EOLIAN static Eina_Bool
_elm_interface_atspi_component_size_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int w, int h)
{
   Eina_Bool ret = EINA_FALSE;
   int c_x, c_y;

   eo_do(obj, elm_interface_atspi_component_extents_get(&c_x, &c_y, NULL, NULL, ATSPI_COORD_TYPE_WINDOW));
   eo_do(obj, elm_interface_atspi_component_extents_set(c_x, c_y, w, h, ATSPI_COORD_TYPE_WINDOW, &ret));
   return ret;
}

EOLIAN static void
_elm_interface_atspi_component_size_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int *w, int *h)
{
   eo_do(obj, elm_interface_atspi_component_extents_get(NULL,  NULL, w, h, ATSPI_COORD_TYPE_WINDOW));
}

EOLIAN static Eina_Bool
_elm_interface_atspi_component_contains(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,
      int x, int y, AtspiCoordType type)
{
   int w_x, w_y, w_w, w_h;

   if (!eo_do(obj, elm_interface_atspi_component_extents_get(&w_x, &w_y, &w_w, &w_h, type)))
      return EINA_FALSE;

   if ((x >= w_x) && (x <= w_x + w_w) && (y >= w_y) && (y <= w_y + w_h))
     return EINA_TRUE;
   return EINA_FALSE;
}

#include "elm_interface_atspi_component.eo.c"<commit_msg>interface atspi component: Adjusted to Eo2.<commit_after>#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif

#define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED
#include "atspi/atspi-constants.h"

#include <Elementary.h>

#include "elm_priv.h"
#include "elm_interface_atspi_component.eo.h"

EOLIAN static void
_elm_interface_atspi_component_position_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,int *x, int *y, AtspiCoordType type)
{
   eo_do(obj, elm_interface_atspi_component_extents_get(x, y, NULL, NULL, type));
}

EOLIAN static Eina_Bool
_elm_interface_atspi_component_position_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int x, int y, AtspiCoordType type)
{
   Eina_Bool ret = EINA_FALSE;
   int c_w, c_h;

   eo_do(obj, elm_interface_atspi_component_extents_get(NULL, NULL, &c_w, &c_h, type));
   eo_do(obj, ret = elm_interface_atspi_component_extents_set(x, y, c_w, c_h, type));
   return ret;
}

EOLIAN static Eina_Bool
_elm_interface_atspi_component_size_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int w, int h)
{
   Eina_Bool ret = EINA_FALSE;
   int c_x = 0, c_y = 0;

   eo_do(obj, elm_interface_atspi_component_extents_get(&c_x, &c_y, NULL, NULL, ATSPI_COORD_TYPE_WINDOW));
   eo_do(obj, ret = elm_interface_atspi_component_extents_set(c_x, c_y, w, h, ATSPI_COORD_TYPE_WINDOW));
   return ret;
}

EOLIAN static void
_elm_interface_atspi_component_size_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, int *w, int *h)
{
   eo_do(obj, elm_interface_atspi_component_extents_get(NULL,  NULL, w, h, ATSPI_COORD_TYPE_WINDOW));
}

EOLIAN static Eina_Bool
_elm_interface_atspi_component_contains(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED,
      int x, int y, AtspiCoordType type)
{
   int w_x = 0, w_y = 0, w_w = 0, w_h = 0;

   eo_do(obj, elm_interface_atspi_component_extents_get(&w_x, &w_y, &w_w, &w_h, type));

   if ((x >= w_x) && (x <= w_x + w_w) && (y >= w_y) && (y <= w_y + w_h))
     return EINA_TRUE;
   return EINA_FALSE;
}

#include "elm_interface_atspi_component.eo.c"
{'fraction_non_alphanumeric': 0.10879511947127606, 'fraction_numerical': 0.0017793594306049821, 'mean_word_length': 5.9035087719298245, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4900850', 'n_tokens_mistral': 1751, 'n_tokens_neox': 1701, 'n_words': 345}