Пример #1
0
EAPI void
e_obj_dialog_show(E_Obj_Dialog *od)
{
   Evas_Coord w, h, mw, mh;
   const char *s;
   
   E_OBJECT_CHECK(od);
   E_OBJECT_TYPE_CHECK(od, E_OBJ_DIALOG_TYPE);

   edje_object_size_min_get(od->bg_object, &mw, &mh);
   edje_object_size_min_restricted_calc(od->bg_object, &mw, &mh, mw, mh);
   evas_object_resize(od->bg_object, mw, mh);
   e_win_resize(od->win, mw, mh);
   e_win_size_min_set(od->win, mw, mh);
   edje_object_size_max_get(od->bg_object, &w, &h);
   if ((w > 0) && (h > 0))
     {
	if (w < mw) w = mw;
	if (h < mh) h = mh;
	e_win_size_max_set(od->win, w, h);
     }
   s = edje_object_data_get(od->bg_object, "borderless");
   if (s && (!strcmp(s, "1")))
     e_win_borderless_set(od->win, 1);
   s = edje_object_data_get(od->bg_object, "shaped");
   if (s && (!strcmp(s, "1")))
     e_win_shaped_set(od->win, 1);
   e_win_show(od->win);
}
Пример #2
0
/* Function for calling our personal dialog menu */
E_Config_Dialog *
e_int_config_productivity_module(E_Container *con, const char *params) 
{
   E_Config_Dialog *cfd = NULL;
   E_Config_Dialog_View *v = NULL;
   char buf[PATH_MAX];

   /* is this config dialog already visible ? */
   if (e_config_dialog_find("Productivity", "extensions/productivity")) return NULL;

   v = E_NEW(E_Config_Dialog_View, 1);
   if (!v) return NULL;

   v->create_cfdata = _create_data;
   v->free_cfdata = _free_data;
   v->basic.create_widgets = _basic_create;
   v->basic.check_changed = _check_changed;

   /* Icon in the theme */
   snprintf(buf, sizeof(buf), "%s/e-module-productivity.edj", productivity_conf->module->dir);

   /* create our config dialog */
   cfd = e_config_dialog_new(con, D_("Productivity Settings"), "Productivity",
                             "extensions/productivity", buf, 0, v, NULL);

   e_dialog_resizable_set(cfd->dia, 1);
   e_win_size_min_set(cfd->dia->win, 400, 400);
   e_win_resize(cfd->dia->win, 400, 400);
   productivity_conf->cfd = cfd;
   return cfd;
}
Пример #3
0
static Eina_Bool
_e_mod_ind_win_cb_win_prop(void *data, int type __UNUSED__, void *event) 
{
   Ind_Win *iwin;
   Ecore_X_Event_Window_Property *ev;
   Evas_Coord h = 0;

   ev = event;

   if (!(iwin = data)) return ECORE_CALLBACK_PASS_ON;
   if (ev->win != iwin->win->container->manager->root) 
     return ECORE_CALLBACK_PASS_ON;
   if (ev->atom != ATM_ENLIGHTENMENT_SCALE) return ECORE_CALLBACK_PASS_ON;

   h = (il_ind_cfg->height * e_scale);

   /* set minimum size of this window */
   e_win_size_min_set(iwin->win, iwin->zone->w, h);
   ecore_evas_size_min_set(iwin->popup->ecore_evas, iwin->zone->w, h);

   /* NB: Not sure why, but we need to tell this border to fetch icccm 
    * size position hints now :( (NOTE: This was not needed a few days ago) 
    * If we do not do this, than indicator does not change w/ scale anymore */
   iwin->win->border->client.icccm.fetch.size_pos_hints = 1;

   /* resize this window */
   e_win_resize(iwin->win, iwin->zone->w, h);
   e_popup_resize(iwin->popup, iwin->zone->w, h);

   /* tell conformant apps our position and size */
   ecore_x_e_illume_indicator_geometry_set(iwin->zone->black_win, 
                                           iwin->win->x, iwin->win->y, 
                                           iwin->win->w, h);

   return ECORE_CALLBACK_PASS_ON;
}
Пример #4
0
E_Win *
e_int_config_theme_import(E_Config_Dialog *parent)
{
   Evas *evas;
   E_Win *win;
   Evas_Object *o, *ofm;
   Import *import;
   E_Config_Dialog_Data *cfdata;
   Evas_Modifier_Mask mask;
   Evas_Coord w, h;
   Eina_Bool kg;

   import = E_NEW(Import, 1);
   if (!import) return NULL;

   win = e_win_new(parent->con);
   if (!win)
     {
        E_FREE(import);
        return NULL;
     }

   evas = e_win_evas_get(win);

   cfdata = E_NEW(E_Config_Dialog_Data, 1);
   import->cfdata = cfdata;
   import->win = win;
   import->parent = parent;

   e_win_title_set(win, _("Select a Theme..."));
   e_win_delete_callback_set(win, _theme_import_cb_delete);
   e_win_resize_callback_set(win, _theme_import_cb_resize);
   e_win_dialog_set(win, 1);
   e_win_name_class_set(win, "E", "_theme_import_dialog");

   o = edje_object_add(evas);
   import->bg_obj = o;
   e_theme_edje_object_set(o, "base/theme/dialog", "e/widgets/dialog/main");
   evas_object_move(o, 0, 0);
   evas_object_show(o);

   o = e_widget_list_add(evas, 1, 1);
   e_widget_on_focus_hook_set(o, _theme_import_cb_wid_focus, import);
   import->box_obj = o;
   edje_object_part_swallow(import->bg_obj, "e.swallow.buttons", o);

   o = evas_object_rectangle_add(evas);
   import->event_obj = o;
   mask = 0;
   kg = evas_object_key_grab(o, "Tab", mask, ~mask, 0);
   if (!kg)
     fprintf(stderr, "ERROR: Unable to redirect \"Tab\" key events to object %p.\n", o);
   mask = evas_key_modifier_mask_get(evas, "Shift");
   kg = evas_object_key_grab(o, "Tab", mask, ~mask, 0);
   if (!kg)
     fprintf(stderr, "ERROR: unable to redirect \"Tab\" key events to object %p.\n", o);
   mask = 0;
   kg = evas_object_key_grab(o, "Return", mask, ~mask, 0);
   if (!kg)
     fprintf(stderr, "ERROR: unable to redirect \"Return\" key events to object %p.\n", o);
   mask = 0;
   kg = evas_object_key_grab(o, "KP_Enter", mask, ~mask, 0);
   if (!kg)
     fprintf(stderr, "ERROR: unable to redirect \"KP_Enter\" key events to object %p.\n", o);
   evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN,
                                  _theme_import_cb_key_down, import);

   o = e_widget_list_add(evas, 0, 0);
   import->content_obj = o;

   ofm = e_widget_fsel_add(evas, e_user_homedir_get(), "/",
                           NULL, NULL,
                           _theme_import_cb_selected, import,
                           _theme_import_cb_changed, import, 1);
   import->fsel_obj = ofm;
   e_widget_list_object_append(o, ofm, 1, 1, 0.5);

   e_widget_size_min_get(o, &w, &h);
   evas_object_size_hint_min_set(o, w, h);
   edje_object_part_swallow(import->bg_obj, "e.swallow.content", o);
   evas_object_show(o);

   import->ok_obj = e_widget_button_add(evas, _("OK"), NULL,
                                        _theme_import_cb_ok, win, cfdata);
   e_widget_list_object_append(import->box_obj, import->ok_obj, 1, 0, 0.5);

   import->cancel_obj = e_widget_button_add(evas, _("Cancel"), NULL,
                                            _theme_import_cb_close,
                                            win, cfdata);
   e_widget_list_object_append(import->box_obj, import->cancel_obj, 1, 0, 0.5);

   e_widget_disabled_set(import->ok_obj, 1);

   e_win_centered_set(win, 1);

   o = import->box_obj;
   e_widget_size_min_get(o, &w, &h);
   evas_object_size_hint_min_set(o, w, h);
   edje_object_part_swallow(import->bg_obj, "e.swallow.buttons", o);

   edje_object_size_min_calc(import->bg_obj, &w, &h);
   evas_object_resize(import->bg_obj, w, h);
   e_win_resize(win, w, h);
   e_win_size_min_set(win, w, h);
   e_win_size_max_set(win, 99999, 99999);
   e_win_show(win);
   e_win_border_icon_set(win, "preferences-desktop-theme");

   win->data = import;

   return win;
}