*/
EAPI Eina_Bool elm_win_focus_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
+ * Constrain the maximum width and height of a window to the width and height of its screen
+ *
+ * When @p constrain is true, @p obj will never resize larger than the screen.
+ * @param obj The window object
+ * @param constrain EINA_TRUE to restrict the window's maximum size, EINA_FALSE to disable restriction
+ */
+ EAPI void elm_win_screen_constrain_set(Evas_Object *obj, Eina_Bool constrain) EINA_ARG_NONNULL(1);
+ /**
+ * Retrieve the constraints on the maximum width and height of a window relative to the width and height of its screen
+ *
+ * When this function returns true, @p obj will never resize larger than the screen.
+ * @param obj The window object
+ * @return EINA_TRUE to restrict the window's maximum size, EINA_FALSE to disable restriction
+ */
+ EAPI Eina_Bool elm_win_screen_constrain_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
+ /**
* Get screen geometry details for the screen that a window is on
* @param obj The window to query
* @param x where to return the horizontal offset value. May be NULL.
int shot_counter;
} shot;
Eina_Bool autodel : 1;
+ Eina_Bool constrain : 1;
int *autodel_clear, rot;
int show_count;
struct {
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
if (w < 1) w = 1;
if (h < 1) h = 1;
+ if (win->constrain)
+ {
+ int sw, sh;
+ ecore_evas_screen_geometry_get(win->ee, NULL, NULL, &sw, &sh);
+ w = MIN(w, sw);
+ h = MIN(h, sh);
+ }
evas_object_image_size_set(win->img_obj, w, h);
}
}
win->deferred_resize_job = NULL;
ecore_evas_request_geometry_get(win->ee, NULL, NULL, &w, &h);
+ if (win->constrain)
+ {
+ int sw, sh;
+ ecore_evas_screen_geometry_get(win->ee, NULL, NULL, &sw, &sh);
+ w = MIN(w, sw);
+ h = MIN(h, sh);
+ }
evas_object_resize(win->win_obj, w, h);
if (win->frame_obj)
{
}
EAPI void
+elm_win_center(Evas_Object *obj, Eina_Bool h, Eina_Bool v)
+{
+ Elm_Win *win;
+ int win_w, win_h, screen_w, screen_h, nx, ny;
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ win = elm_widget_data_get(obj);
+ if (!win) return;
+ ecore_evas_screen_geometry_get(win->ee, NULL, NULL, &screen_w, &screen_h);
+ evas_object_geometry_get(obj, NULL, NULL, &win_w, &win_h);
+ if (h) nx = win_w >= screen_w ? 0 : (screen_w / 2) - (win_w / 2);
+ else nx = win->screen.x;
+ if (v) ny = win_h >= screen_h ? 0 : (screen_h / 2) - (win_h / 2);
+ else ny = win->screen.y;
+ evas_object_move(obj, nx, ny);
+}
+
+EAPI void
elm_win_borderless_set(Evas_Object *obj, Eina_Bool borderless)
{
Elm_Win *win;
}
EAPI void
+elm_win_screen_constrain_set(Evas_Object *obj, Eina_Bool constrain)
+{
+ Elm_Win *win;
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ win = elm_widget_data_get(obj);
+ if (!win) return;
+ win->constrain = !!constrain;
+}
+
+EAPI Eina_Bool
+elm_win_screen_constrain_get(Evas_Object *obj)
+{
+ Elm_Win *win;
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+ win = elm_widget_data_get(obj);
+ if (!win) return EINA_FALSE;
+ return win->constrain;
+}
+
+EAPI void
elm_win_screen_size_get(const Evas_Object *obj, int *x, int *y, int *w, int *h)
{
Elm_Win *win;