} autoclose;
E_Launch_Screen *launchscrn;
+ E_Comp_Screen *e_comp_screen;
Eina_List *debug_rects;
Eina_List *ignore_wins;
static void
_e_comp_canvas_resize(Ecore_Evas *ee EINA_UNUSED)
{
- e_output_screens_setup(e_comp->w, e_comp->h);
+ e_comp_screen_e_screens_setup(e_comp->e_comp_screen, e_comp->w, e_comp->h);
e_comp_canvas_update();
}
e_comp->ee_win = ecore_evas_window_get(e_comp->ee);
- screens = (Eina_List *)e_output_screens_get();
+ screens = (Eina_List *)e_comp_screen_e_screens_get(e_comp->e_comp_screen);
if (screens)
{
E_Screen *scr;
int i;
Eina_Bool changed = EINA_FALSE;
- screens = (Eina_List *)e_output_screens_get();
+ screens = (Eina_List *)e_comp_screen_e_screens_get(e_comp->e_comp_screen);
if (screens)
{
Ecore_Drm_Device *dev;
Ecore_Drm_Output *drm_output;
E_Output *eout;
+ E_Comp_Screen *e_comp_screen;
const Eina_List *l, *ll;
int x, y, w, h;
+ e_comp_screen = e_comp->e_comp_screen;
+
EINA_LIST_FOREACH(ecore_drm_devices_get(), l, dev)
{
EINA_LIST_FOREACH(e_comp_screen->outputs, ll, eout)
static Eina_Bool dont_set_ecore_drm_keymap = EINA_FALSE;
static Eina_Bool dont_use_xkb_cache = EINA_FALSE;
+E_API int E_EVENT_SCREEN_CHANGE = 0;
+
static Eina_Bool
_e_comp_screen_cb_activate(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
const Eina_List *l;
E_Output *eout;
Ecore_Drm_Event_Output *e;
+ E_Comp_Screen *e_comp_screen = NULL;
if (!(e = event)) goto end;
+ if (!e_comp) goto end;
+ if (!e_comp->e_comp_screen) goto end;
+
+ e_comp_screen = e_comp->e_comp_screen;
DBG("WL_DRM OUTPUT CHANGE");
return strdup(model);
}
-EINTERN E_Comp_Screen *
-e_comp_screen_init_outputs(void)
+static E_Comp_Screen *
+_e_comp_screen_init_outputs(void)
{
Ecore_Drm_Device *dev;
Ecore_Drm_Output *output;
}
EINTERN void
-e_comp_screen_apply(void)
+_e_comp_screen_apply(E_Comp_Screen *e_comp_screen)
{
Ecore_Drm_Device *dev;
Ecore_Drm_Output *out;
E_Output *eout;
+
const Eina_List *l, *ll;
int nw, nh, pw, ph, ww, hh;
int minw, minh, maxw, maxh;
int top_priority = 0;
+ EINA_SAFETY_ON_NULL_RETURN(e_comp);
+ EINA_SAFETY_ON_NULL_RETURN(e_comp->e_comp_screen);
+
/* TODO: what the actual fuck */
nw = e_comp_screen->w;
nh = e_comp_screen->h;
TRACE_INPUT_END();
}
+static void
+_e_comp_screen_config_eval(E_Comp_Screen *e_comp_screen)
+{
+ Eina_List *l;
+ E_Output *eout;
+ int minx, miny, maxx, maxy;
+
+ minx = 65535;
+ miny = 65535;
+ maxx = -65536;
+ maxy = -65536;
+
+ EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
+ {
+ if (!eout->config.enabled) continue;
+ if (eout->config.geom.x < minx) minx = eout->config.geom.x;
+ if (eout->config.geom.y < miny) miny = eout->config.geom.y;
+ if ((eout->config.geom.x + eout->config.geom.w) > maxx)
+ maxx = eout->config.geom.x + eout->config.geom.w;
+ if ((eout->config.geom.y + eout->config.geom.h) > maxy)
+ maxy = eout->config.geom.y + eout->config.geom.h;
+ printf("OUTPUT: s: '%s' @ %i %i - %ix%i\n",
+ eout->info.name,
+ eout->config.geom.x, eout->config.geom.y,
+ eout->config.geom.w, eout->config.geom.h);
+ }
+ printf("OUTPUT:--- %i %i -> %i %i\n", minx, miny, maxx, maxy);
+ EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
+ {
+ eout->config.geom.x -= minx;
+ eout->config.geom.y -= miny;
+ }
+ e_comp_screen->w = maxx - minx;
+ e_comp_screen->h = maxy - miny;
+}
+
+static void
+_e_comp_screen_config_maxsize(E_Comp_Screen *e_comp_screen)
+{
+ Eina_List *l;
+ E_Output *eout;
+ int maxx, maxy;
+
+ maxx = -65536;
+ maxy = -65536;
+ EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
+ {
+ if (!eout->config.enabled) continue;
+ if ((eout->config.geom.x + eout->config.geom.w) > maxx)
+ maxx = eout->config.geom.x + eout->config.geom.w;
+ if ((eout->config.geom.y + eout->config.geom.h) > maxy)
+ maxy = eout->config.geom.y + eout->config.geom.h;
+ printf("OUTPUT: '%s': %i %i %ix%i\n",
+ eout->info.name,
+ eout->config.geom.x, eout->config.geom.y,
+ eout->config.geom.w, eout->config.geom.h);
+ }
+ printf("OUTPUT: result max: %ix%i\n", maxx, maxy);
+ e_comp_screen->w = maxx;
+ e_comp_screen->h = maxy;
+}
+
+static int
+_e_comp_screen_e_screen_sort_cb(const void *data1, const void *data2)
+{
+ const E_Output *s1 = data1, *s2 = data2;
+ int dif;
+
+ dif = -(s1->config.priority - s2->config.priority);
+ if (dif == 0)
+ {
+ dif = s1->config.geom.x - s2->config.geom.x;
+ if (dif == 0)
+ dif = s1->config.geom.y - s2->config.geom.y;
+ }
+ return dif;
+}
+
+static void
+_e_comp_screen_e_screen_free(E_Screen *scr)
+{
+ free(scr->id);
+ free(scr);
+}
+
+static void
+_e_comp_screen_e_screens_set(E_Comp_Screen *e_comp_screen, Eina_List *screens)
+{
+ E_FREE_LIST(e_comp_screen->e_screens, _e_comp_screen_e_screen_free);
+ e_comp_screen->e_screens = screens;
+}
+
+EINTERN void
+e_comp_screen_e_screens_setup(E_Comp_Screen *e_comp_screen, int rw, int rh)
+{
+ int i;
+ E_Screen *screen;
+ Eina_List *outputs = NULL, *outputs_rem;
+ Eina_List *e_screens = NULL;
+ Eina_List *l, *ll;
+ E_Output *eout, *s2, *s_chosen;
+ Eina_Bool removed;
+
+ if ((!e_comp_screen) || (!e_comp_screen->outputs)) goto out;
+ // put screens in tmp list
+ EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
+ {
+ if ((eout->config.enabled) &&
+ (eout->config.geom.w > 0) &&
+ (eout->config.geom.h > 0))
+ {
+ outputs = eina_list_append(outputs, eout);
+ }
+ }
+ // remove overlapping screens - if a set of screens overlap, keep the
+ // smallest/lowest res
+ do
+ {
+ removed = EINA_FALSE;
+
+ EINA_LIST_FOREACH(outputs, l, eout)
+ {
+ outputs_rem = NULL;
+
+ EINA_LIST_FOREACH(l->next, ll, s2)
+ {
+ if (E_INTERSECTS(eout->config.geom.x, eout->config.geom.y,
+ eout->config.geom.w, eout->config.geom.h,
+ s2->config.geom.x, s2->config.geom.y,
+ s2->config.geom.w, s2->config.geom.h))
+ {
+ if (!outputs_rem)
+ outputs_rem = eina_list_append(outputs_rem, eout);
+ outputs_rem = eina_list_append(outputs_rem, s2);
+ }
+ }
+ // we have intersecting screens - choose the lowest res one
+ if (outputs_rem)
+ {
+ removed = EINA_TRUE;
+ // find the smallest screen (chosen one)
+ s_chosen = NULL;
+ EINA_LIST_FOREACH(outputs_rem, ll, s2)
+ {
+ if (!s_chosen) s_chosen = s2;
+ else
+ {
+ if ((s_chosen->config.geom.w *
+ s_chosen->config.geom.h) >
+ (s2->config.geom.w *
+ s2->config.geom.h))
+ s_chosen = s2;
+ }
+ }
+ // remove all from screens but the chosen one
+ EINA_LIST_FREE(outputs_rem, s2)
+ {
+ if (s2 != s_chosen)
+ outputs = eina_list_remove_list(outputs, l);
+ }
+ // break our list walk and try again
+ break;
+ }
+ }
+ }
+ while (removed);
+ // sort screens by priority etc.
+ outputs = eina_list_sort(outputs, 0, _e_comp_screen_e_screen_sort_cb);
+ i = 0;
+ EINA_LIST_FOREACH(outputs, l, eout)
+ {
+ screen = E_NEW(E_Screen, 1);
+ screen->escreen = screen->screen = i;
+ screen->x = eout->config.geom.x;
+ screen->y = eout->config.geom.y;
+ screen->w = eout->config.geom.w;
+ screen->h = eout->config.geom.h;
+ if (eout->id) screen->id = strdup(eout->id);
+
+ e_screens = eina_list_append(e_screens, screen);
+ INF("E INIT: SCREEN: [%i][%i], %ix%i+%i+%i",
+ i, i, screen->w, screen->h, screen->x, screen->y);
+ i++;
+ }
+ eina_list_free(outputs);
+ // if we have NO screens at all (above - i will be 0) AND we have no
+ // existing screens set up in xinerama - then just say root window size
+ // is the entire screen. this should handle the case where you unplug ALL
+ // screens from an existing setup (unplug external monitors and/or close
+ // laptop lid), in which case as long as at least one screen is configured
+ // in xinerama, it will be left-as is until next time we re-eval screen
+ // setup and have at least one screen
+ printf("e_comp_screen_e_screens_setup............... %i %p\n", i, e_comp_screen->e_screens);
+ if ((i == 0) && (!e_comp_screen->e_screens))
+ {
+out:
+ screen = E_NEW(E_Screen, 1);
+ screen->escreen = screen->screen = 0;
+ screen->x = 0;
+ screen->y = 0;
+ if ((rw > 0) && (rh > 0))
+ screen->w = rw, screen->h = rh;
+ else
+ ecore_evas_screen_geometry_get(e_comp->ee, NULL, NULL, &screen->w, &screen->h);
+ e_screens = eina_list_append(e_screens, screen);
+ }
+ _e_comp_screen_e_screens_set(e_comp_screen, e_screens);
+}
+
+EINTERN const Eina_List *
+e_comp_screen_e_screens_get(E_Comp_Screen *e_comp_screen)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen, NULL);
+
+ return e_comp_screen->e_screens;
+}
+
E_API Eina_Bool
e_comp_screen_init()
{
E_Comp *comp;
+ E_Comp_Screen *e_comp_screen = NULL;
+
int w = 0, h = 0, scr_w = 1, scr_h = 1;
struct xkb_context *ctx = NULL;
struct xkb_keymap *map = NULL;
TRACE_DS_END();
return EINA_FALSE;
}
- e_output_screens_setup(-1, -1);
+ if (!E_EVENT_SCREEN_CHANGE) E_EVENT_SCREEN_CHANGE = ecore_event_type_new();
+
+ e_comp_screen = _e_comp_screen_init_outputs();
+ e_comp->e_comp_screen = e_comp_screen;
+
+ // take current e_output config and apply it to the driver
+ _e_comp_screen_config_maxsize(e_comp_screen);
+ printf("OUTPUT: eval config...\n");
+ _e_comp_screen_config_eval(e_comp_screen);
+ printf("OUTPUT: really apply config...\n");
+ _e_comp_screen_apply(e_comp_screen);
+ printf("OUTPUT: done config...\n");
+
+ ecore_event_add(E_EVENT_SCREEN_CHANGE, NULL, NULL, NULL);
+
+ e_comp_screen_e_screens_setup(e_comp_screen, -1, -1);
e_main_ts("\tE_Output Init Done");
e_main_ts("\tE_Comp_Wl Init");
{
/* shutdown ecore_drm */
/* ecore_drm_shutdown(); */
+
e_output_shutdown();
+ // free up screen info
+ free(e_comp->e_comp_screen);
+ e_comp->e_comp_screen = NULL;
+
dont_set_ecore_drm_keymap = EINA_FALSE;
dont_use_xkb_cache = EINA_FALSE;
E_FREE_LIST(event_handlers, ecore_event_handler_del);
#ifndef E_COMP_SCREEN_H
#define E_COMP_SCREEN_H
+typedef struct _E_Comp_Screen E_Comp_Screen;
+typedef struct _E_Screen E_Screen;
-EINTERN void e_comp_screen_apply(void);
-EINTERN E_Comp_Screen * e_comp_screen_init_outputs(void);
+struct _E_Comp_Screen
+{
+ Eina_List *outputs; // available screens
+ int w, h; // virtual resolution (calculated)
+ unsigned char ignore_hotplug_events;
+ unsigned char ignore_acpi_events;
+ Eina_List *e_screens;
+};
+
+
+struct _E_Screen
+{
+ int screen, escreen;
+ int x, y, w, h;
+ char *id; // this is the same id we get from _E_Output so look it up there
+};
+
+extern E_API int E_EVENT_SCREEN_CHANGE;
E_API Eina_Bool e_comp_screen_init(void);
E_API void e_comp_screen_shutdown(void);
+EINTERN void e_comp_screen_e_screens_setup(E_Comp_Screen *e_comp_screen, int rw, int rh);
+EINTERN const Eina_List * e_comp_screen_e_screens_get(E_Comp_Screen *e_comp_screen);
+
#endif /*E_COMP_SCREEN_H*/
#endif
{
Eina_List *l;
E_Output *eout;
+ E_Comp_Screen *e_comp_screen;
unsigned int transform = WL_OUTPUT_TRANSFORM_NORMAL;
- if (!e_comp_screen) return ECORE_CALLBACK_RENEW;
+ if (!e_comp) return ECORE_CALLBACK_RENEW;
+ if (!e_comp->e_comp_screen) return ECORE_CALLBACK_RENEW;
+ e_comp_screen = e_comp->e_comp_screen;
EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
{
#include "e_env.h"
#include "e_log.h"
#include "e_dbusmenu.h"
+#include "e_comp_screen.h"
#include "e_comp.h"
#include "e_comp_cfdata.h"
#include "e_comp_canvas.h"
#include "e_hints.h"
#include "e_plane.h"
#include "e_comp_hwc.h"
-#include "e_comp_screen.h"
#include "e_output.h"
#ifdef HAVE_WAYLAND
#include "e.h"
-
-/////////////////////////////////////////////////////////////////////////
-static void _do_apply(void);
-static void _info_free(E_Comp_Screen *r);
-static void _screen_config_eval(void);
-static void _screen_config_maxsize(void);
-
-/////////////////////////////////////////////////////////////////////////
-
-E_API E_Comp_Screen *e_comp_screen = NULL;
-
-E_API int E_EVENT_SCREEN_CHANGE = 0;
-
-static Eina_List *all_screens = NULL; // e_screen list
-
-/////////////////////////////////////////////////////////////////////////
EINTERN Eina_Bool
e_output_init(void)
{
- if (!E_EVENT_SCREEN_CHANGE) E_EVENT_SCREEN_CHANGE = ecore_event_type_new();
-
- e_comp_screen = e_comp_screen_init_outputs();
-
- _do_apply();
-
- ecore_event_add(E_EVENT_SCREEN_CHANGE, NULL, NULL, NULL);
+ // TODO: initialization e_outputs
return EINA_TRUE;
}
-EINTERN int
+EINTERN void
e_output_shutdown(void)
{
- // free up screen info
- _info_free(e_comp_screen);
- e_comp_screen = NULL;
-
- return 1;
-}
-
-/////////////////////////////////////////////////////////////////////////
-
-static void
-_do_apply(void)
-{
- // take current e_output config and apply it to the driver
- _screen_config_maxsize();
- printf("OUTPUT: eval config...\n");
- _screen_config_eval();
- printf("OUTPUT: really apply config...\n");
- e_comp_screen_apply();
- printf("OUTPUT: done config...\n");
-}
-
-static void
-_info_free(E_Comp_Screen *r)
-{
+ // TODO: deinitialization e_outputs
E_Output *eout;
E_Output_Mode *m;
E_Plane *ep;
+ Eina_List *outputs;
+
+ if (!e_comp) return;
+ if (!e_comp->e_comp_screen) return;
+
+ outputs = e_comp->e_comp_screen->outputs;
- if (!r) return;
// free up our output screen data
- EINA_LIST_FREE(r->outputs, eout)
+ EINA_LIST_FREE(outputs, eout)
{
free(eout->id);
free(eout->info.screen);
EINA_LIST_FREE(eout->planes, ep) e_plane_free(ep);
free(eout);
}
- free(r);
}
-static void
-_screen_config_eval(void)
+EINTERN E_Output *
+e_output_find(const char *id)
{
- Eina_List *l;
E_Output *eout;
- int minx, miny, maxx, maxy;
-
- minx = 65535;
- miny = 65535;
- maxx = -65536;
- maxy = -65536;
-
- EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
- {
- if (!eout->config.enabled) continue;
- if (eout->config.geom.x < minx) minx = eout->config.geom.x;
- if (eout->config.geom.y < miny) miny = eout->config.geom.y;
- if ((eout->config.geom.x + eout->config.geom.w) > maxx)
- maxx = eout->config.geom.x + eout->config.geom.w;
- if ((eout->config.geom.y + eout->config.geom.h) > maxy)
- maxy = eout->config.geom.y + eout->config.geom.h;
- printf("OUTPUT: s: '%s' @ %i %i - %ix%i\n",
- eout->info.name,
- eout->config.geom.x, eout->config.geom.y,
- eout->config.geom.w, eout->config.geom.h);
- }
- printf("OUTPUT:--- %i %i -> %i %i\n", minx, miny, maxx, maxy);
- EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
- {
- eout->config.geom.x -= minx;
- eout->config.geom.y -= miny;
- }
- e_comp_screen->w = maxx - minx;
- e_comp_screen->h = maxy - miny;
-}
-
-static void
-_screen_config_maxsize(void)
-{
+ E_Comp_Screen *e_comp_screen;
Eina_List *l;
- E_Output *eout;
- int maxx, maxy;
- maxx = -65536;
- maxy = -65536;
- EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
- {
- if (!eout->config.enabled) continue;
- if ((eout->config.geom.x + eout->config.geom.w) > maxx)
- maxx = eout->config.geom.x + eout->config.geom.w;
- if ((eout->config.geom.y + eout->config.geom.h) > maxy)
- maxy = eout->config.geom.y + eout->config.geom.h;
- printf("OUTPUT: '%s': %i %i %ix%i\n",
- eout->info.name,
- eout->config.geom.x, eout->config.geom.y,
- eout->config.geom.w, eout->config.geom.h);
- }
- printf("OUTPUT: result max: %ix%i\n", maxx, maxy);
- e_comp_screen->w = maxx;
- e_comp_screen->h = maxy;
-}
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp->e_comp_screen, NULL);
-static int
-_screen_sort_cb(const void *data1, const void *data2)
-{
- const E_Output *s1 = data1, *s2 = data2;
- int dif;
+ e_comp_screen = e_comp->e_comp_screen;
- dif = -(s1->config.priority - s2->config.priority);
- if (dif == 0)
- {
- dif = s1->config.geom.x - s2->config.geom.x;
- if (dif == 0)
- dif = s1->config.geom.y - s2->config.geom.y;
- }
- return dif;
-}
-
-static void
-_escreen_free(E_Screen *scr)
-{
- free(scr->id);
- free(scr);
-}
-
-void
-_escreens_set(Eina_List *screens)
-{
- E_FREE_LIST(all_screens, _escreen_free);
- all_screens = screens;
-}
-
-EINTERN void
-e_output_screens_setup(int rw, int rh)
-{
- int i;
- E_Screen *screen;
- Eina_List *outputs = NULL, *outputs_rem;
- Eina_List *e_screens = NULL;
- Eina_List *l, *ll;
- E_Output *eout, *s2, *s_chosen;
- Eina_Bool removed;
-
- if ((!e_comp_screen) || (!e_comp_screen->outputs)) goto out;
- // put screens in tmp list
- EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
- {
- if ((eout->config.enabled) &&
- (eout->config.geom.w > 0) &&
- (eout->config.geom.h > 0))
- {
- outputs = eina_list_append(outputs, eout);
- }
- }
- // remove overlapping screens - if a set of screens overlap, keep the
- // smallest/lowest res
- do
- {
- removed = EINA_FALSE;
-
- EINA_LIST_FOREACH(outputs, l, eout)
- {
- outputs_rem = NULL;
-
- EINA_LIST_FOREACH(l->next, ll, s2)
- {
- if (E_INTERSECTS(eout->config.geom.x, eout->config.geom.y,
- eout->config.geom.w, eout->config.geom.h,
- s2->config.geom.x, s2->config.geom.y,
- s2->config.geom.w, s2->config.geom.h))
- {
- if (!outputs_rem)
- outputs_rem = eina_list_append(outputs_rem, eout);
- outputs_rem = eina_list_append(outputs_rem, s2);
- }
- }
- // we have intersecting screens - choose the lowest res one
- if (outputs_rem)
- {
- removed = EINA_TRUE;
- // find the smallest screen (chosen one)
- s_chosen = NULL;
- EINA_LIST_FOREACH(outputs_rem, ll, s2)
- {
- if (!s_chosen) s_chosen = s2;
- else
- {
- if ((s_chosen->config.geom.w *
- s_chosen->config.geom.h) >
- (s2->config.geom.w *
- s2->config.geom.h))
- s_chosen = s2;
- }
- }
- // remove all from screens but the chosen one
- EINA_LIST_FREE(outputs_rem, s2)
- {
- if (s2 != s_chosen)
- outputs = eina_list_remove_list(outputs, l);
- }
- // break our list walk and try again
- break;
- }
- }
- }
- while (removed);
- // sort screens by priority etc.
- outputs = eina_list_sort(outputs, 0, _screen_sort_cb);
- i = 0;
- EINA_LIST_FOREACH(outputs, l, eout)
- {
- screen = E_NEW(E_Screen, 1);
- screen->escreen = screen->screen = i;
- screen->x = eout->config.geom.x;
- screen->y = eout->config.geom.y;
- screen->w = eout->config.geom.w;
- screen->h = eout->config.geom.h;
- if (eout->id) screen->id = strdup(eout->id);
-
- e_screens = eina_list_append(e_screens, screen);
- INF("E INIT: SCREEN: [%i][%i], %ix%i+%i+%i",
- i, i, screen->w, screen->h, screen->x, screen->y);
- i++;
- }
- eina_list_free(outputs);
- // if we have NO screens at all (above - i will be 0) AND we have no
- // existing screens set up in xinerama - then just say root window size
- // is the entire screen. this should handle the case where you unplug ALL
- // screens from an existing setup (unplug external monitors and/or close
- // laptop lid), in which case as long as at least one screen is configured
- // in xinerama, it will be left-as is until next time we re-eval screen
- // setup and have at least one screen
- printf("e_output_screens_setup............... %i %p\n", i, all_screens);
- if ((i == 0) && (!all_screens))
- {
-out:
- screen = E_NEW(E_Screen, 1);
- screen->escreen = screen->screen = 0;
- screen->x = 0;
- screen->y = 0;
- if ((rw > 0) && (rh > 0))
- screen->w = rw, screen->h = rh;
- else
- ecore_evas_screen_geometry_get(e_comp->ee, NULL, NULL, &screen->w, &screen->h);
- e_screens = eina_list_append(e_screens, screen);
- }
- _escreens_set(e_screens);
-}
-
-EINTERN const Eina_List *
-e_output_screens_get(void)
-{
- return all_screens;
-}
-
-EINTERN E_Output *
-e_output_find(const char *id)
-{
- E_Output *eout;
- Eina_List *l;
EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
{
if (!strcmp(eout->id, id)) return eout;
{
Eina_List *l, *ll, *p_l;
E_Output * eout = NULL;
+ E_Comp_Screen *e_comp_screen = NULL;
+
+ EINA_SAFETY_ON_NULL_RETURN(e_comp);
+ EINA_SAFETY_ON_NULL_RETURN(e_comp->e_comp_screen);
+
+ e_comp_screen = e_comp->e_comp_screen;
EINA_LIST_FOREACH_SAFE(e_comp_screen->outputs, l, ll, eout)
{
#ifdef E_TYPEDEFS
-typedef struct _E_Comp_Screen E_Comp_Screen;
typedef struct _E_Output E_Output;
typedef struct _E_Output_Mode E_Output_Mode;
-typedef struct _E_Screen E_Screen;
#else
#ifndef E_OUTPUT_H
#define E_OUTPUT_TYPE (int)0xE0b11002
-struct _E_Comp_Screen
-{
- Eina_List *outputs; // available screens
- int w, h; // virtual resolution (calculated)
- unsigned char ignore_hotplug_events;
- unsigned char ignore_acpi_events;
-};
-
struct _E_Output_Mode
{
int w, h; // resolution width and height
E_Zone *zone;
};
-struct _E_Screen
-{
- int screen, escreen;
- int x, y, w, h;
- char *id; // this is the same id we get from _E_Output so look it up there
-};
-
-extern E_API E_Comp_Screen *e_comp_screen;
-extern E_API int E_EVENT_SCREEN_CHANGE;
-
EINTERN Eina_Bool e_output_init(void);
-EINTERN int e_output_shutdown(void);
+EINTERN void e_output_shutdown(void);
EINTERN E_Output * e_output_find(const char *id);
-EINTERN void e_output_screens_setup(int rw, int rh);
-EINTERN const Eina_List * e_output_screens_get(void);
E_API const Eina_List * e_output_planes_get(E_Output *eout);
E_API void e_output_util_planes_print(void);