<commit_before>/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#include "config.h"
#include "Ecore.h"
#include "ecore_private.h"
#include "ecore_evas_private.h"
#include "Ecore_Evas.h"
#ifdef BUILD_ECORE_EVAS_FB
#include "Ecore_Fb.h"
#endif

#ifdef BUILD_ECORE_EVAS_FB
static int _ecore_evas_init_count = 0;

static int _ecore_evas_fps_debug = 0;
static char *ecore_evas_default_display = "0";
static Ecore_List *ecore_evas_input_devices = NULL;
static Ecore_Evas *ecore_evases = NULL;
static Ecore_Event_Handler *ecore_evas_event_handlers[6] = {NULL, NULL, NULL, NULL, NULL, NULL};
static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;

static void
_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
{
   int fbw, fbh;
   
   ee->mouse.x = x;
   ee->mouse.y = y;
   ecore_fb_size_get(&fbw, &fbh);
   if (ee->prop.cursor.object)
     {
	evas_object_show(ee->prop.cursor.object);
        if (ee->rotation == 0)
	  evas_object_move(ee->prop.cursor.object,
			   x - ee->prop.cursor.hot.x,
			   y - ee->prop.cursor.hot.y);
	else if (ee->rotation == 90)
	  evas_object_move(ee->prop.cursor.object,
			   (fbh - ee->h) + ee->h - y - 1 - ee->prop.cursor.hot.x,
			   x - ee->prop.cursor.hot.y);
	else if (ee->rotation == 180)
	  evas_object_move(ee->prop.cursor.object,
			   (fbw - ee->w) + ee->w - x - 1 - ee->prop.cursor.hot.x,
			   (fbh - ee->h) + ee->h - y - 1 - ee->prop.cursor.hot.y);
	else if (ee->rotation == 270)
	  evas_object_move(ee->prop.cursor.object,
			   y - ee->prop.cursor.hot.x,
			   (fbw - ee->w) + ee->w - x - 1 - ee->prop.cursor.hot.y);
     }
   if (ee->rotation == 0)
     evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
   else if (ee->rotation == 90)
     evas_event_feed_mouse_move(ee->evas, (fbh - ee->h) + ee->h - y - 1, x, timestamp, NULL);
   else if (ee->rotation == 180)
     evas_event_feed_mouse_move(ee->evas, (fbw - ee->w) + ee->w - x - 1, (fbh - ee->h) + ee->h - y - 1, timestamp, NULL);
   else if (ee->rotation == 270)
     evas_event_feed_mouse_move(ee->evas, y, (fbw - ee->w) + ee->w - x - 1, timestamp, NULL);   
}

static Ecore_Evas *
_ecore_evas_fb_match(void)
{
   return ecore_evases;
}

static void
_ecore_evas_fb_lose(void *data __UNUSED__)
{
   Ecore_List2 *l;
   Ecore_Fb_Input_Device *dev;

   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
     {
	Ecore_Evas *ee;
	
	ee = (Ecore_Evas *)l;
	ee->visible = 0;
     }
   if (ecore_evas_input_devices)
     {
	ecore_list_first_goto(ecore_evas_input_devices);
	while ((dev = ecore_list_next(ecore_evas_input_devices)))
	  ecore_fb_input_device_listen(dev, 0);
     }
}

static void
_ecore_evas_fb_gain(void *data __UNUSED__)
{
   Ecore_List2 *l;
   Ecore_Fb_Input_Device *dev;

   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
     {
	Ecore_Evas *ee;
	
	ee = (Ecore_Evas *)l;
	ee->visible = 1;
	if ((ee->rotation == 90) || (ee->rotation == 270))
	  evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
	else
	  evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
     }
   if (ecore_evas_input_devices)
     {
	ecore_list_first_goto(ecore_evas_input_devices);
	while ((dev = ecore_list_next(ecore_evas_input_devices)))
	  ecore_fb_input_device_listen(dev, 0);
     }
}

static int
_ecore_evas_event_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)<commit_msg>fix copy/paste error<commit_after>/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#include "config.h"
#include "Ecore.h"
#include "ecore_private.h"
#include "ecore_evas_private.h"
#include "Ecore_Evas.h"
#ifdef BUILD_ECORE_EVAS_FB
#include "Ecore_Fb.h"
#endif

#ifdef BUILD_ECORE_EVAS_FB
static int _ecore_evas_init_count = 0;

static int _ecore_evas_fps_debug = 0;
static char *ecore_evas_default_display = "0";
static Ecore_List *ecore_evas_input_devices = NULL;
static Ecore_Evas *ecore_evases = NULL;
static Ecore_Event_Handler *ecore_evas_event_handlers[6] = {NULL, NULL, NULL, NULL, NULL, NULL};
static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;

static void
_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
{
   int fbw, fbh;
   
   ee->mouse.x = x;
   ee->mouse.y = y;
   ecore_fb_size_get(&fbw, &fbh);
   if (ee->prop.cursor.object)
     {
	evas_object_show(ee->prop.cursor.object);
        if (ee->rotation == 0)
	  evas_object_move(ee->prop.cursor.object,
			   x - ee->prop.cursor.hot.x,
			   y - ee->prop.cursor.hot.y);
	else if (ee->rotation == 90)
	  evas_object_move(ee->prop.cursor.object,
			   (fbh - ee->h) + ee->h - y - 1 - ee->prop.cursor.hot.x,
			   x - ee->prop.cursor.hot.y);
	else if (ee->rotation == 180)
	  evas_object_move(ee->prop.cursor.object,
			   (fbw - ee->w) + ee->w - x - 1 - ee->prop.cursor.hot.x,
			   (fbh - ee->h) + ee->h - y - 1 - ee->prop.cursor.hot.y);
	else if (ee->rotation == 270)
	  evas_object_move(ee->prop.cursor.object,
			   y - ee->prop.cursor.hot.x,
			   (fbw - ee->w) + ee->w - x - 1 - ee->prop.cursor.hot.y);
     }
   if (ee->rotation == 0)
     evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
   else if (ee->rotation == 90)
     evas_event_feed_mouse_move(ee->evas, (fbh - ee->h) + ee->h - y - 1, x, timestamp, NULL);
   else if (ee->rotation == 180)
     evas_event_feed_mouse_move(ee->evas, (fbw - ee->w) + ee->w - x - 1, (fbh - ee->h) + ee->h - y - 1, timestamp, NULL);
   else if (ee->rotation == 270)
     evas_event_feed_mouse_move(ee->evas, y, (fbw - ee->w) + ee->w - x - 1, timestamp, NULL);   
}

static Ecore_Evas *
_ecore_evas_fb_match(void)
{
   return ecore_evases;
}

static void
_ecore_evas_fb_lose(void *data __UNUSED__)
{
   Ecore_List2 *l;
   Ecore_Fb_Input_Device *dev;

   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
     {
	Ecore_Evas *ee;
	
	ee = (Ecore_Evas *)l;
	ee->visible = 0;
     }
   if (ecore_evas_input_devices)
     {
	ecore_list_first_goto(ecore_evas_input_devices);
	while ((dev = ecore_list_next(ecore_evas_input_devices)))
	  ecore_fb_input_device_listen(dev, 0);
     }
}

static void
_ecore_evas_fb_gain(void *data __UNUSED__)
{
   Ecore_List2 *l;
   Ecore_Fb_Input_Device *dev;

   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
     {
	Ecore_Evas *ee;
	
	ee = (Ecore_Evas *)l;
	ee->visible = 1;
	if ((ee->rotation == 90) || (ee->rotation == 270))
	  evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
	else
	  evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
     }
   if (ecore_evas_input_devices)
     {
	ecore_list_first_goto(ecore_evas_input_devices);
	while ((dev = ecore_list_next(ecore_evas_input_devices)))
	  ecore_fb_input_device_listen(dev, 1);
     }
}

static int
_ecore_evas_event_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
{'fraction_non_alphanumeric': 0.15593875427382192, 'fraction_numerical': 0.016352014270848817, 'mean_word_length': 3.545945945945946, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 117, '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': '3933463', 'n_tokens_mistral': 3110, 'n_tokens_neox': 2957, 'n_words': 541}