예제 #1
0
파일: e_dpms.c 프로젝트: rzr/enlightenment
E_API void
e_dpms_force_update(void)
{
   unsigned int standby = 0, suspend = 0, off = 0;
   int enabled;

   enabled = ((e_config->screensaver_enable) &&
              (!e_config->mode.presentation));
#ifndef HAVE_WAYLAND_ONLY
   if (e_comp_util_has_x())
     ecore_x_dpms_enabled_set(enabled);
#endif
   if (!enabled) return;

   if (e_config->screensaver_enable)
     {
        off = suspend = standby = e_screensaver_timeout_get(EINA_FALSE);
        standby += 5;
        suspend += 6;
        off += 7;
     }
#ifndef HAVE_WAYLAND_ONLY
   if (!e_comp_util_has_x()) return;
   ecore_x_dpms_timeouts_set(standby + 10, suspend + 10, off + 10);
   ecore_x_dpms_timeouts_set(standby, suspend, off);
#endif
}
예제 #2
0
파일: e_dpms.c 프로젝트: rzr/enlightenment
E_API void
e_dpms_update(void)
{
   unsigned int standby = 0, suspend = 0, off = 0;
   int enabled;
   Eina_Bool changed = EINA_FALSE;

   enabled = ((e_config->screensaver_enable) &&
              (!e_config->mode.presentation) &&
              ((!e_util_fullscreen_current_any()) && (!e_config->no_dpms_on_fullscreen))
             );
   if (_e_dpms_enabled != enabled)
     {
        _e_dpms_enabled = enabled;
#ifndef HAVE_WAYLAND_ONLY
        if (e_comp_util_has_x())
          ecore_x_dpms_enabled_set(enabled);
#endif
     }
   if (!enabled) return;

   if (e_config->screensaver_enable)
     {
        off = suspend = standby = e_screensaver_timeout_get(EINA_FALSE);
        standby += 5;
        suspend += 6;
        off += 7;
     }
   if (_e_dpms_timeout_standby != standby)
     {
        _e_dpms_timeout_standby = standby;
        changed = EINA_TRUE;
     }
   if (_e_dpms_timeout_suspend != suspend)
     {
        _e_dpms_timeout_suspend = suspend;
        changed = EINA_TRUE;
     }
   if (_e_dpms_timeout_off != off)
     {
        _e_dpms_timeout_off = off;
        changed = EINA_TRUE;
     }
#ifndef HAVE_WAYLAND_ONLY
   if (e_comp_util_has_x())
     {
        if (changed) ecore_x_dpms_timeouts_set(standby, suspend, off);
     }
#endif
}
예제 #3
0
EINTERN int
e_dnd_init(void)
{
   _type_text_uri_list = eina_stringshare_add("text/uri-list");
   _type_xds = eina_stringshare_add("XdndDirectSave0");
   _type_text_x_moz_url = eina_stringshare_add("text/x-moz-url");
   _type_enlightenment_x_file = eina_stringshare_add("enlightenment/x-file");
#ifndef HAVE_WAYLAND_ONLY
   if (e_comp_util_has_x())
     _text_atom = ecore_x_atom_get("text/plain");
#endif

   _drop_win_hash = eina_hash_int32_new(NULL);
   _drop_handlers_responsives = eina_hash_int32_new(NULL);

   E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_BUTTON_UP, _e_dnd_cb_mouse_up, NULL);
   E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_MOVE, _e_dnd_cb_mouse_move, NULL);
   E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_KEY_DOWN, _e_dnd_cb_key_down, NULL);
   E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_KEY_UP, _e_dnd_cb_key_up, NULL);
   if (e_comp->comp_type != E_PIXMAP_TYPE_X) return 1;
#ifndef HAVE_WAYLAND_ONLY
   E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_ENTER, _e_dnd_cb_event_dnd_enter, NULL);
   E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_LEAVE, _e_dnd_cb_event_dnd_leave, NULL);
   E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_POSITION, _e_dnd_cb_event_dnd_position, NULL);
   E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_FINISHED, _e_dnd_cb_event_dnd_finished, NULL);
   E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_DROP, _e_dnd_cb_event_dnd_drop, NULL);
   E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_SELECTION_NOTIFY, _e_dnd_cb_event_dnd_selection, NULL);
   E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_WINDOW_HIDE, _e_dnd_cb_event_hide, NULL);

   e_drop_xdnd_register_set(e_comp->ee_win, 1);

   _action = ECORE_X_ATOM_XDND_ACTION_PRIVATE;
#endif
   return 1;
}
예제 #4
0
E_API E_Drag *
e_drag_new(int x, int y,
           const char **types, unsigned int num_types,
           void *data, int size,
           void *(*convert_cb)(E_Drag * drag, const char *type),
           void (*finished_cb)(E_Drag *drag, int dropped))
{
   E_Drag *drag;
   unsigned int i;

   /* No need to create a drag object without type */
   if ((!types) || (!num_types)) return NULL;
   drag = e_object_alloc(sizeof(E_Drag) + num_types * sizeof(char *),
                         E_DRAG_TYPE, E_OBJECT_CLEANUP_FUNC(_e_drag_free));
   if (!drag) return NULL;

   drag->x = x;
   drag->y = y;
   drag->w = 24;
   drag->h = 24;
   drag->layer = E_LAYER_CLIENT_DRAG;

   drag->evas = e_comp->evas;

   drag->type = E_DRAG_NONE;

   for (i = 0; i < num_types; i++)
     drag->types[i] = eina_stringshare_add(types[i]);
   drag->num_types = num_types;
   drag->data = data;
   drag->data_size = size;
   drag->cb.convert = convert_cb;
   drag->cb.finished = finished_cb;

   _drag_list = eina_list_append(_drag_list, drag);

#ifndef HAVE_WAYLAND_ONLY
   if (e_comp_util_has_x())
     ecore_x_window_shadow_tree_flush();
#endif

   _drag_win_root = e_comp->root;

   drag->cb.key_down = NULL;
   drag->cb.key_up = NULL;

   return drag;
}
예제 #5
0
/* Module initializer
 * Initializes the configuration file, checks its versions, populates
 * menus, finds the rules file, initializes gadget icon.
 */
E_API void *
e_modapi_init(E_Module *m)
{
   /* Menus and dialogs */
   e_configure_registry_category_add("keyboard_and_mouse", 80, _("Input"),
                                     NULL, "preferences-behavior");
   e_configure_registry_item_add("keyboard_and_mouse/xkbswitch", 110,
                                 _("Keyboard"), NULL,
                                 "preferences-desktop-keyboard",
                                 _xkb_cfg_dialog);


   _xkb.module = m;
#ifndef HAVE_WAYLAND_ONLY
   if (e_comp_util_has_x())
     ecore_event_handler_add(ECORE_X_EVENT_XKB_STATE_NOTIFY, _xkb_changed_state, NULL);
#endif
   /* Gadcon */
   e_gadcon_provider_register(&_gc_class);
   return m;
}