<commit_before>#include "e.h"

/* TODO: Handle orientation in stored config */
/* TODO: Do we need e_randr_cfg->screen.{width,height} ? */
/* TODO: Check so we can rely on connected only, not connected && exists */
/* TODO: Ignore xrandr events triggered by changes in acpi cb */

/* local function prototypes */
static Eina_Bool _e_randr_config_load(void);
static void      _e_randr_config_new(void);
static void      _e_randr_config_free(void);
static void      _e_randr_free(void);
static Eina_Bool _e_randr_config_cb_timer(void *data);
static void      _e_randr_load(void);
static void      _e_randr_apply(void);
static void                   _e_randr_output_mode_update(E_Randr_Output *cfg);
static E_Config_Randr_Output *_e_randr_config_output_new(Ecore_X_Window root, unsigned int id);
static E_Config_Randr_Output *_e_randr_config_output_find(Ecore_X_Randr_Output output);
static E_Randr_Crtc          *_e_randr_crtc_find(Ecore_X_Randr_Crtc xid);
static E_Randr_Output        *_e_randr_output_find(Ecore_X_Randr_Output xid);
static E_Randr_Crtc          *_e_randr_output_crtc_find(E_Randr_Output *output);

static void _e_randr_config_mode_geometry(Ecore_X_Randr_Orientation orient, Eina_Rectangle *rect);
static void _e_randr_config_primary_update(void);

static Eina_Bool _e_randr_event_cb_screen_change(void *data, int type, void *event);
static Eina_Bool _e_randr_event_cb_crtc_change(void *data, int type, void *event);
static Eina_Bool _e_randr_event_cb_output_change(void *data, int type, void *event);

static void      _e_randr_acpi_handler_add(void *data);
static int       _e_randr_is_lid(E_Randr_Output *cfg);
static void      _e_randr_crtc_from_outputs_set(E_Randr_Crtc *crtc);
static Eina_Bool _e_randr_lid_update(void);
static Eina_Bool _e_randr_output_mode_valid(Ecore_X_Randr_Mode mode, Ecore_X_Randr_Mode *modes, int nmodes);
static void      _e_randr_output_active_set(E_Randr_Output *cfg, Eina_Bool connected);
static int       _e_randr_config_output_cmp(const void *a, const void *b);<commit_msg>randr: same param name in prototype and function<commit_after>#include "e.h"

/* TODO: Handle orientation in stored config */
/* TODO: Do we need e_randr_cfg->screen.{width,height} ? */
/* TODO: Check so we can rely on connected only, not connected && exists */
/* TODO: Ignore xrandr events triggered by changes in acpi cb */

/* local function prototypes */
static Eina_Bool _e_randr_config_load(void);
static void      _e_randr_config_new(void);
static void      _e_randr_config_free(void);
static void      _e_randr_free(void);
static Eina_Bool _e_randr_config_cb_timer(void *data);
static void      _e_randr_load(void);
static void      _e_randr_apply(void);
static void                   _e_randr_output_mode_update(E_Randr_Output *cfg);
static E_Config_Randr_Output *_e_randr_config_output_new(Ecore_X_Window root, unsigned int id);
static E_Config_Randr_Output *_e_randr_config_output_find(Ecore_X_Randr_Output output);
static E_Randr_Crtc          *_e_randr_crtc_find(Ecore_X_Randr_Crtc xid);
static E_Randr_Output        *_e_randr_output_find(Ecore_X_Randr_Output xid);
static E_Randr_Crtc          *_e_randr_output_crtc_find(E_Randr_Output *output);

static void _e_randr_config_mode_geometry(Ecore_X_Randr_Orientation orient, Eina_Rectangle *rect);
static void _e_randr_config_primary_update(void);

static Eina_Bool _e_randr_event_cb_screen_change(void *data, int type, void *event);
static Eina_Bool _e_randr_event_cb_crtc_change(void *data, int type, void *event);
static Eina_Bool _e_randr_event_cb_output_change(void *data, int type, void *event);

static void      _e_randr_acpi_handler_add(void *data);
static int       _e_randr_is_lid(E_Randr_Output *cfg);
static void      _e_randr_crtc_from_outputs_set(E_Randr_Crtc *crtc);
static Eina_Bool _e_randr_lid_update(void);
static Eina_Bool _e_randr_output_mode_valid(Ecore_X_Randr_Mode mode, Ecore_X_Randr_Mode *modes, int nmodes);
static void      _e_randr_output_active_set(E_Randr_Output *output, Eina_Bool connected);
static int       _e_randr_config_output_cmp(const void *a, const void *b);
{'fraction_non_alphanumeric': 0.07363013698630137, 'fraction_numerical': 0.0, 'mean_word_length': 6.173684210526316, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2177821', 'n_tokens_mistral': 1532, 'n_tokens_neox': 1495, 'n_words': 320}