<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_X
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
#endif

#ifdef BUILD_ECORE_X
static int _ecore_evas_init_count = 0;

static int _ecore_evas_fps_debug = 0;

static Ecore_Evas *ecore_evases = NULL;
static Evas_Hash *ecore_evases_hash = NULL;
static Ecore_Event_Handler *ecore_evas_event_handlers[17];
static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;

#ifdef BUILD_ECORE_EVAS_GL
static Ecore_X_Window
_ecore_evas_x_gl_window_new(Ecore_Evas *ee, Ecore_X_Window parent, int x, int y, int w, int h, int override)
{
   Evas_Engine_Info_GL_X11 *einfo;
   Ecore_X_Window win;
   
   einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
   if (einfo)
     {
	XSetWindowAttributes attr;
	int screen;

	/* FIXME: this is inefficient as its a round trip */
	screen = DefaultScreen(ecore_x_display_get());
	if (ScreenCount(ecore_x_display_get()) > 1)
	  {
	     Ecore_X_Window *roots;
	     int num, i;
	     
	     num = 0;
	     roots = ecore_x_window_root_list(&num);
	     if (roots)
	       {
		  XWindowAttributes at;
		  
		  if (XGetWindowAttributes(ecore_x_display_get(),
					   parent, &at))
		    {
		       for (i = 0; i < num; i++)
			 {
			    if (at.root == roots[i])
			      {
				 screen = i;
				 break;
			      }
			 }
		    }
		  free(roots);
	       }
	  }
	attr.backing_store = NotUseful;
	attr.override_redirect = override;
	attr.colormap = einfo->func.best_colormap_get(ecore_x_display_get(), screen);
	attr.border_pixel = 0;
	attr.background_pixmap = None;
	attr.event_mask =
	  KeyPressMask | KeyReleaseMask |
	  ExposureMask | ButtonPressMask | ButtonReleaseMask | 
	  EnterWindowMask | LeaveWindowMask |
	  PointerMotionMask | StructureNotifyMask | VisibilityChangeMask |
	  FocusChangeMask | PropertyChangeMask | ColormapChangeMask;
	attr.bit_gravity = ForgetGravity;
	
	win = 
	  XCreateWindow(ecore_x_display_get(), 
			parent,
			x, y, 
			w, h, 0,
			einfo->func.best_depth_get(ecore_x_display_get(), screen),
			InputOutput,
			einfo->func.best_visual_get(ecore_x_display_get(), screen),
			CWBackingStore | CWColormap |
			CWBackPixmap | CWBorderPixel |
			CWBitGravity | CWEventMask |
			CWOverrideRedirect,
			&attr);
	einfo->info.display  = ecore_x_display_get();
	einfo->info.visual   = einfo->func.best_visual_get(ecore_x_display_get(), screen);
	einfo->info.colormap = einfo->func.best_colormap_get(ecore_x_display_get(), screen);
	einfo->info.drawable = win;
	einfo->info.depth    = einfo->func.best_depth_get(ecore_x_display_get(), screen);
	evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
     }
   return win;
}
#endif

static void
_ecore_evas_x_render(Ecore_Evas *ee)
{
#ifdef BUILD_ECORE_EVAS_BUFFER
   Evas_List *ll;
#endif
   
   if (ee->delete_idle_enterer) return;
#ifdef BUILD_ECORE_EVAS_BUFFER
   for (ll = ee->sub_ecore_evas; ll; ll = ll->next)
     {
	Ecore_Evas *ee2;<commit_msg>Fix warning/potential trouble.<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_X
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
#endif

#ifdef BUILD_ECORE_X
static int _ecore_evas_init_count = 0;

static int _ecore_evas_fps_debug = 0;

static Ecore_Evas *ecore_evases = NULL;
static Evas_Hash *ecore_evases_hash = NULL;
static Ecore_Event_Handler *ecore_evas_event_handlers[17];
static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;

#ifdef BUILD_ECORE_EVAS_GL
static Ecore_X_Window
_ecore_evas_x_gl_window_new(Ecore_Evas *ee, Ecore_X_Window parent, int x, int y, int w, int h, int override)
{
   Evas_Engine_Info_GL_X11 *einfo;
   Ecore_X_Window win;
   
   einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
   if (einfo)
     {
	XSetWindowAttributes attr;
	int screen;

	/* FIXME: this is inefficient as its a round trip */
	screen = DefaultScreen(ecore_x_display_get());
	if (ScreenCount(ecore_x_display_get()) > 1)
	  {
	     Ecore_X_Window *roots;
	     int num, i;
	     
	     num = 0;
	     roots = ecore_x_window_root_list(&num);
	     if (roots)
	       {
		  XWindowAttributes at;
		  
		  if (XGetWindowAttributes(ecore_x_display_get(),
					   parent, &at))
		    {
		       for (i = 0; i < num; i++)
			 {
			    if (at.root == roots[i])
			      {
				 screen = i;
				 break;
			      }
			 }
		    }
		  free(roots);
	       }
	  }
	attr.backing_store = NotUseful;
	attr.override_redirect = override;
	attr.colormap = einfo->func.best_colormap_get(ecore_x_display_get(), screen);
	attr.border_pixel = 0;
	attr.background_pixmap = None;
	attr.event_mask =
	  KeyPressMask | KeyReleaseMask |
	  ExposureMask | ButtonPressMask | ButtonReleaseMask | 
	  EnterWindowMask | LeaveWindowMask |
	  PointerMotionMask | StructureNotifyMask | VisibilityChangeMask |
	  FocusChangeMask | PropertyChangeMask | ColormapChangeMask;
	attr.bit_gravity = ForgetGravity;
	
	win = 
	  XCreateWindow(ecore_x_display_get(), 
			parent,
			x, y, 
			w, h, 0,
			einfo->func.best_depth_get(ecore_x_display_get(), screen),
			InputOutput,
			einfo->func.best_visual_get(ecore_x_display_get(), screen),
			CWBackingStore | CWColormap |
			CWBackPixmap | CWBorderPixel |
			CWBitGravity | CWEventMask |
			CWOverrideRedirect,
			&attr);
	einfo->info.display  = ecore_x_display_get();
	einfo->info.visual   = einfo->func.best_visual_get(ecore_x_display_get(), screen);
	einfo->info.colormap = einfo->func.best_colormap_get(ecore_x_display_get(), screen);
	einfo->info.drawable = win;
	einfo->info.depth    = einfo->func.best_depth_get(ecore_x_display_get(), screen);
	evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
     }
   else
     {
	win = 0;
     }
   return win;
}
#endif

static void
_ecore_evas_x_render(Ecore_Evas *ee)
{
#ifdef BUILD_ECORE_EVAS_BUFFER
   Evas_List *ll;
#endif
   
   if (ee->delete_idle_enterer) return;
#ifdef BUILD_ECORE_EVAS_BUFFER
   for (ll = ee->sub_ecore_evas; ll; ll = ll->next)
     {
	Ecore_Evas *ee2;
{'fraction_non_alphanumeric': 0.11123649846848299, 'fraction_numerical': 0.007254554247944543, 'mean_word_length': 3.999194198227236, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '649201', 'n_tokens_mistral': 2662, 'n_tokens_neox': 2436, 'n_words': 420}