Ejemplo n.º 1
0
void
edi_mainview_item_next()
{
   Eina_List *item;
   Elm_Object_Item *current;
   Edi_Mainview_Item *it, *last, *next;
   Eina_Bool open_next = EINA_FALSE;

   current = elm_naviframe_top_item_get(nf);
   last = eina_list_nth(_edi_mainview_items, eina_list_count(_edi_mainview_items)-1);

   EINA_LIST_FOREACH(_edi_mainview_items, item, it)
     {
        if (last->view == current)
          {
             next = eina_list_nth(_edi_mainview_items, 0);
             edi_mainview_item_select(next);
          }
        if (it && open_next)
          {
             edi_mainview_item_select(it);
             return;
          }

        if (it && it->view == current)
          open_next = EINA_TRUE;
     }
}
Ejemplo n.º 2
0
END_TEST

START_TEST (elm_atspi_children_and_parent2)
{
   elm_init(0, NULL);

   generate_app();
   Eo* root = eo_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);

   Eo *win = NULL;

   Eina_List *root_children;
   eo_do(root, root_children = elm_interface_atspi_accessible_children_get());
   win = eina_list_nth(root_children, 0);

   Eina_List *win_children;
   eo_do(win, win_children = elm_interface_atspi_accessible_children_get());

   ck_assert(eina_list_count(win_children) == 2);

   Eo *btn = NULL;

   btn = eina_list_nth(win_children, 0);
   ck_assert(btn != NULL);
   ck_assert(btn == g_bg);

   btn = eina_list_nth(win_children, 1);
   ck_assert(btn != NULL);
   ck_assert(btn == g_btn);

   eo_unref(root);
   elm_shutdown();
}
Ejemplo n.º 3
0
void
edi_mainview_item_prev()
{
   Eina_List *item;
   Elm_Object_Item *current;
   Edi_Mainview_Item *it, *first, *prev = NULL;

   current = elm_naviframe_top_item_get(nf);
   first = (Edi_Mainview_Item *)eina_list_nth(_edi_mainview_items, 0);

   EINA_LIST_FOREACH(_edi_mainview_items, item, it)
     {
        if (first->view == current)
          {
             prev = eina_list_nth(_edi_mainview_items, eina_list_count(_edi_mainview_items)-1);
             edi_mainview_item_select(prev);
          }
        if (it && it->view == current)
          {
             if (prev)
               edi_mainview_item_select(prev);
             return;
          }

        prev = it;
     }
}
Ejemplo n.º 4
0
static void
set_api_state(api_data *api)
{
   const Eina_List *items = elm_box_children_get(api->box);
   static Elm_Calendar_Mark *m = NULL;
   if (!eina_list_count(items))
     return;

   switch(api->state)
     { /* Put all api-changes under switch */
      case STATE_MARK_MONTHLY:
           {
              Evas_Object *cal = eina_list_nth(items, 0);
              time_t the_time = (SEC_PER_YEAR * 41) + (SEC_PER_DAY * 9); /* Set date to DEC 31, 2010 */
              m = elm_calendar_mark_add(cal, "checked", gmtime(&the_time), ELM_CALENDAR_MONTHLY);
              elm_calendar_selected_time_set(cal, gmtime(&the_time));
           }
         break;
      case STATE_MARK_WEEKLY:
           {
              Evas_Object *cal = eina_list_nth(items, 0);
              time_t the_time = (SEC_PER_YEAR * 41) + (SEC_PER_DAY * 4); /* Set date to DEC 26, 2010 */
              elm_calendar_mark_del(m);
              m = elm_calendar_mark_add(cal, "checked", gmtime(&the_time), ELM_CALENDAR_WEEKLY);
              elm_calendar_selected_time_set(cal, gmtime(&the_time));
           }
         break;
      case STATE_SUNDAY_HIGHLIGHT:
           {
              Evas_Object *cal = eina_list_nth(items, 0);
              time_t the_time = (SEC_PER_YEAR * 41) + (SEC_PER_DAY * 3); /* Set date to DEC 25, 2010 */
              /* elm_calendar_mark_del(m); */
              m = elm_calendar_mark_add(cal, "holiday", gmtime(&the_time), ELM_CALENDAR_WEEKLY);
              elm_calendar_selected_time_set(cal, gmtime(&the_time));
           }
         break;
      case STATE_SELECT_DATE_DISABLED_WITH_MARKS:
           {
              Evas_Object *cal = eina_list_nth(items, 0);
              time_t the_time = (SEC_PER_YEAR * 41) + (SEC_PER_DAY * 10); /* Set date to JAN 01, 2011 */
              elm_calendar_select_mode_set(cal, ELM_CALENDAR_SELECT_MODE_NONE);
              elm_calendar_selected_time_set(cal, gmtime(&the_time));
           }
         break;
      case STATE_SELECT_DATE_DISABLED_NO_MARKS:
           {
              Evas_Object *cal = eina_list_nth(items, 0);
              time_t the_time = (SEC_PER_YEAR * 41) + (SEC_PER_DAY * 40); /* Set date to FEB 01, 2011 */
              elm_calendar_marks_clear(cal);
              elm_calendar_select_mode_set(cal, ELM_CALENDAR_SELECT_MODE_NONE);
              elm_calendar_selected_time_set(cal, gmtime(&the_time));
           }
         break;
      case API_STATE_LAST:
         break;
      default:
         return;
     }
}
Ejemplo n.º 5
0
static void
set_api_state(api_data *api)
{
   Evas_Object *icon;

   const Eina_List *items = elm_box_children_get(api->box);
   if (!eina_list_count(items))
     return;

   /* use elm_box_children_get() to get list of children */
   switch(api->state)
     { /* Put all api-changes under switch */
      case HOVERSEL_HORIZ:  /* Make first hover horiz (0) */
         elm_hoversel_horizontal_set(eina_list_nth(items, 0), EINA_TRUE);
         elm_hoversel_hover_begin(eina_list_nth(items, 0));
         break;

      case HOVERSEL_END:  /* Make first hover horiz (1) */
         elm_hoversel_hover_begin(eina_list_nth(items, 1));
         elm_hoversel_hover_end(eina_list_nth(items, 1));
         break;

      case HOVERSEL_LABAL_SET: /* set second hover label (2) */
         elm_object_text_set(eina_list_nth(items, 1), "Label from API");
         break;

      case HOVERSEL_ICON_UNSET: /* 3 */
         elm_object_text_set(eina_list_nth(items, 5), "Label only");
         icon = elm_object_part_content_unset(eina_list_nth(items, 5), "icon");
         evas_object_del(icon);
         break;

      case HOVERSEL_CLEAR_OPEN: /* 4 */
         elm_hoversel_hover_begin(eina_list_nth(items, 1));
         elm_hoversel_clear(eina_list_nth(items, 1));
         break;

      case HOVERSEL_CLEAR: /* 5 */
         elm_hoversel_clear(eina_list_nth(items, 0));
         break;

      case API_STATE_LAST:
         break;

      default:
         return;
     }
}
Ejemplo n.º 6
0
/**
 * @brief Implementation AtkObject->ref_child callback
 *
 * ATK doc says:\n
 * Gets a reference to the specified accessible child of the object. The
 * accessible children are 0-based so the first accessible child is at index 0,
 * the second at index 1 and so on.
 *
 * @returns an AtkObject representing the specified accessible child of the
 * accessible.
 */
static AtkObject *
eail_naviframe_ref_child(AtkObject *obj, gint i)
{
   Eina_List *list;
   EailNaviframe *naviframe;
   EailWidget *widget;
   Evas_Object *e_object;

   g_return_val_if_fail(EAIL_IS_NAVIFRAME(obj), NULL);

   naviframe = EAIL_NAVIFRAME(obj);
   widget = EAIL_WIDGET(naviframe);

   e_object = eail_widget_get_widget(widget);

   list = elm_naviframe_items_get(e_object);
   int list_count = eina_list_count(list);
   if (i >= list_count)
     {
        eina_list_free(list);
        return NULL;
     }

   AtkObject *child = eail_naviframe_page_new(obj, i);
   atk_object_initialize(child, eina_list_nth(list, i));
   g_object_ref(child);
   naviframe->cached_pages = eina_list_append(naviframe->cached_pages, child);

   eina_list_free(list);

   return child;
}
Ejemplo n.º 7
0
static void
em_size_get(void  *video,
            int   *width,
            int   *height)
{
   Emotion_Gstreamer_Video *ev;
   Emotion_Video_Stream      *vstream;

   ev = (Emotion_Gstreamer_Video *)video;

   if (!_emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE))
     goto on_error;

   vstream = eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1);
   if (vstream)
     {
        if (width) *width = vstream->width;
        if (height) *height = vstream->height;

        return;
     }

 on_error:
   if (width) *width = 0;
   if (height) *height = 0;
}
static void
set_api_state(api_data *api)
{
   const Eina_List *items = elm_box_children_get(api->box);
   if (!eina_list_count(items))
     return;

   /* Get first item of list of vbox children */
   Evas_Object *fs_bt = eina_list_nth(items, 0);

   /* use elm_box_children_get() to get list of children */
   switch(api->state)
     { /* Put all api-changes under switch */
      case ICON_UNSET:
         elm_object_part_content_unset(fs_bt, NULL);
         break;

      case WINDOW_TITLE_SET:
         elm_fileselector_button_window_title_set(fs_bt, "Custom title from API");
         break;

      case API_STATE_LAST:

         break;
      default:
         return;
     }
}
Ejemplo n.º 9
0
/**
 * @brief Get index of object in parent object
 *
 * @param obj object instance
 *
 * @returns object index
 */
static gint
eail_naviframe_page_index_in_parent_get(AtkObject *obj)
{
   EailNaviframePage *page = NULL;
   Eina_List *list = NULL;
   gint pos = -1, i = 0;

   if (!EAIL_IS_NAVIFRAME_PAGE(obj))
     {
        ERR("Not a naviframe page");
        return pos;
     }

   page = EAIL_NAVIFRAME_PAGE(obj);
   if (!page->naviframe) return pos;

   list = elm_naviframe_items_get(page->naviframe);
   for (i = 0; i < eina_list_count(list); ++i)
     {
        if (page->page == eina_list_nth(list, i))
          {
             pos = i;
             break;
          }
     }

   eina_list_free(list);
   return pos;
}
Ejemplo n.º 10
0
END_TEST

START_TEST (elm_atspi_children_and_parent)
{
   elm_init(0, NULL);

   generate_app();
   Eo* root = eo_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL);

   Eina_List *child_list = NULL;

   eo_do(root, child_list = elm_interface_atspi_accessible_children_get());

   //eo_do(eina_list_nth(child_list, 0), bg_child_list = elm_interface_atspi_accessible_children_get());

   ck_assert(eina_list_count(child_list) == 1);

   Eo *win = NULL;

   win = eina_list_nth(child_list, 0);

   ck_assert(win != NULL);
   ck_assert(win == g_win);

   eo_unref(root);
   elm_shutdown();
}
Ejemplo n.º 11
0
/* local subsystem functions */
static void
_e_startup(void)
{
   Efreet_Desktop *desktop;
   char buf[8192];

   if (!startup_apps)
     {
        e_init_done();
        return;
     }
   desktop = eina_list_nth(startup_apps->desktops, start_app_pos);
   start_app_pos++;
   if (!desktop)
     {
        e_object_del(E_OBJECT(startup_apps));
        startup_apps = NULL;
        start_app_pos = -1;
        e_init_done();
        return;
     }
   e_exec(NULL, desktop, NULL, NULL, NULL);
   snprintf(buf, sizeof(buf), _("Starting %s"), desktop->name);
   e_init_status_set(buf);
   ecore_job_add(_e_startup_next_cb, NULL);
}
Ejemplo n.º 12
0
void
_ex_tab_delete(void)
{
   if (!e->cur_tab)
     {
	D(("No currently selected TAB!!\n"));
	return;
     }

   D(("Number of tabs: %d\n", eina_list_count(e->tabs)));

   if (eina_list_count(e->tabs) < 1)
     {
	D(("Cannot remove the last tab\n"));
	return;
     }

   D(("Delete tab %d\n", e->cur_tab->num));

   D(("Remove from list\n"));
   e->tabs = eina_list_remove(e->tabs, e->cur_tab);

   D(("Free\n"));
   etk_notebook_page_remove(ETK_NOTEBOOK(e->notebook), e->cur_tab->num);
   /* Set the cur_tab on the new one */
   e->cur_tab = eina_list_nth(e->tabs, etk_notebook_current_page_get(ETK_NOTEBOOK(e->notebook)));
//   E_FREE(e->cur_tab);

   if (eina_list_count(e->tabs) == 1)
     etk_notebook_tabs_visible_set(ETK_NOTEBOOK(e->notebook), ETK_FALSE);
}
Ejemplo n.º 13
0
EAPI Efreet_Desktop *
efreet_desktop_get(const char *file)
{
    Efreet_Desktop *desktop;

    desktop = efreet_desktop_new(file);
    if (!desktop) return NULL;

    /* If we didn't find this file in the eet cache, add path to search path */
    if (!desktop->eet)
    {
        /* Check whether the desktop type is a system type,
         * and therefor known by the cache builder */
        Efreet_Desktop_Type_Info *info;

        info = eina_list_nth(efreet_desktop_types, desktop->type);
        if (info && (
                info->id == EFREET_DESKTOP_TYPE_APPLICATION ||
                info->id == EFREET_DESKTOP_TYPE_LINK ||
                info->id == EFREET_DESKTOP_TYPE_DIRECTORY
                ))
            efreet_cache_desktop_add(desktop);
    }

    return desktop;
}
Ejemplo n.º 14
0
void enna_photo_slideshow_goto(Evas_Object *obj, int nth)
{
    Elm_Object_Item *it;
    Smart_Data *sd = evas_object_data_get(obj, "sd");

    it = eina_list_nth(sd->items, nth);
    elm_slideshow_item_show(it);
}
Ejemplo n.º 15
0
EAPI int
efreet_desktop_type_alias(int from_type, const char *alias)
{
    Efreet_Desktop_Type_Info *info;
    info = eina_list_nth(efreet_desktop_types, from_type);
    if (!info) return -1;

    return efreet_desktop_type_add(alias, info->parse_func, info->save_func, info->free_func);
}
Ejemplo n.º 16
0
menu_screen_error_e list_get_item(app_list *list, app_list_item **item)
{
	retv_if(NULL == list, MENU_SCREEN_ERROR_INVALID_PARAMETER);
	retv_if(NULL == list->list, MENU_SCREEN_ERROR_INVALID_PARAMETER);

	*item = eina_list_nth(list->list, list->cur_idx);

	return MENU_SCREEN_ERROR_OK;
}
Ejemplo n.º 17
0
EAPI int
efreet_desktop_save(Efreet_Desktop *desktop)
{
    Efreet_Desktop_Type_Info *info;
    Efreet_Ini *ini;
    int ok = 1;

    EINA_SAFETY_ON_NULL_RETURN_VAL(desktop, 0);

    ini = efreet_ini_new(NULL);
    if (!ini) return 0;
    efreet_ini_section_add(ini, "Desktop Entry");
    efreet_ini_section_set(ini, "Desktop Entry");

    info = eina_list_nth(efreet_desktop_types, desktop->type);
    if (info)
    {
        efreet_ini_string_set(ini, "Type", info->type);
        if (info->save_func) info->save_func(desktop, ini);
    }
    else
        ok = 0;

    if (ok)
    {
        char *val;

        if (desktop->only_show_in)
        {
            val = efreet_desktop_string_list_join(desktop->only_show_in);
            if (val)
            {
                efreet_ini_string_set(ini, "OnlyShowIn", val);
                FREE(val);
            }
        }
        if (desktop->not_show_in)
        {
            val = efreet_desktop_string_list_join(desktop->not_show_in);
            if (val)
            {
                efreet_ini_string_set(ini, "NotShowIn", val);
                FREE(val);
            }
        }
        efreet_desktop_generic_fields_save(desktop, ini);
        /* When we save the file, it should be updated to the
         * latest version that we support! */
        efreet_ini_string_set(ini, "Version", DESKTOP_VERSION);

        if (!efreet_ini_save(ini, desktop->orig_path)) ok = 0;
    }
    efreet_ini_free(ini);
    return ok;
}
Ejemplo n.º 18
0
static menu_screen_error_e _insert_page_at(Evas_Object *scroller, Evas_Object *page, int index)
{
	unsigned int nr_of_pages;
	Evas_Object *mapbuf;
	Evas_Object *box;

	retv_if(NULL == page, MENU_SCREEN_ERROR_FAIL);

	if (index < 0) {
		_D("Out of range");
		index = 0;
	}

	box = evas_object_data_get(scroller, "box");
	retv_if(NULL == box, MENU_SCREEN_ERROR_FAIL);

	nr_of_pages = page_scroller_count_page(scroller);
	if (index >= nr_of_pages) {
		_D("Out of range. index : %d, total : %d", index, nr_of_pages);
		mapbuf = evas_object_data_get(page, "mapbuf");
		if (mapbuf) {
			elm_box_pack_end(box, mapbuf);
		} else {
			elm_box_pack_end(box, page);
		}
	} else {
		Evas_Object *current;
		Evas_Object *current_mapbuf;
		const Eina_List *page_list;

		page_list = elm_box_children_get(box);
		retv_if(NULL == page_list, MENU_SCREEN_ERROR_FAIL);

		current = eina_list_nth(page_list, index);
		retv_if(NULL == current, MENU_SCREEN_ERROR_FAIL);

		current_mapbuf = mapbuf_get_mapbuf(current);
		mapbuf = mapbuf_get_mapbuf(page);

		if (current_mapbuf && mapbuf) {
			elm_box_pack_before(box, mapbuf, current_mapbuf);
		} else if (!current_mapbuf && !mapbuf) {
			elm_box_pack_before(box, page, current);
		} else {
			_D("Page has mapbuf, invalid");
		}
	}

	page_mark_dirty(page);

	return MENU_SCREEN_ERROR_OK;
}
Ejemplo n.º 19
0
static void
enna_mediaplayer_change(Enna_Playlist *enna_playlist, int type)
{
    Enna_File *item;

    item = eina_list_nth(enna_playlist->playlist, enna_playlist->selected);
    enna_log(ENNA_MSG_EVENT, NULL, "select %d", enna_playlist->selected);
    if (!item)
        return;

    enna_mediaplayer_stop();
    enna_mediaplayer_play(enna_playlist);
    ecore_event_add(type, NULL, NULL, NULL);
}
Ejemplo n.º 20
0
Enna_File *
enna_mediaplayer_current_file_get(void)
{
    Enna_File *item;

    if (!mp->cur_playlist || mp->play_state != PLAYING)
        return NULL;

    item = eina_list_nth(mp->cur_playlist->playlist, mp->cur_playlist->selected);
    if (!item)
        return NULL;

    return item;
}
Ejemplo n.º 21
0
const char *
enna_mediaplayer_get_current_uri(void)
{
  Enna_File *item;

  if (!mp->cur_playlist || mp->play_state != PLAYING)
      return NULL;

  item = eina_list_nth(mp->cur_playlist->playlist, mp->cur_playlist->selected);
  if (!item->uri)
    return NULL;

  return strdup(item->uri);
}
Ejemplo n.º 22
0
/**
 * @brief Implementation AtkObject->ref_child callback
 *
 * ATK doc says:\n
 * Gets a reference to the specified accessible child of the object. The
 * accessible children are 0-based so the first accessible child is at index 0,
 * the second at index 1 and so on.
 *
 * @param obj an AtkObject (EailApp)
 * @param i index number
 *
 * @returns an AtkObject representing the specified accessible child of the
 * accessible.
 */
static AtkObject *
eail_app_ref_child(AtkObject *obj, gint i)
{
   AtkObject *child = NULL;

   if (eina_list_count(_elm_win_list) > i)
     {
        Evas_Object *tmp = eina_list_nth(_elm_win_list, i);
        child = eail_factory_get_accessible(tmp);
        g_object_ref(child);
     }

   return child;
}
Ejemplo n.º 23
0
/*
 * Store changes to the configuration made in the dialog.
 * These go back to the main config object.
 */
static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
   Xplanet_Config *xplanet_config;
   int config_ok;

   // Pull out the value from the source ilist
   config_ok = parse_config_gui(cfdata);

   if (config_ok)
   {
	  printf("Applying config\n");

	  printf("Delay %d\n",cfdata->delay);
	  printf("Label text: %s\n", cfdata->local_xplanet.label_text);

      eplanet_conf->delay = cfdata->delay;
      eplanet_conf->startDelay = cfdata->startDelay;
      eplanet_conf->taskPriority = cfdata->taskPriority;
      eplanet_conf->loadLimit = cfdata->loadLimit;
      eplanet_conf->minRamLimit = cfdata->minRamLimit;
      eplanet_conf->disableOnBattery = cfdata->disableOnBattery;

      xplanet_config = eina_list_nth(eplanet_conf->xplanet_configs,
            cfdata->current_config);
      xplanet_config->body = cfdata->local_xplanet.body;
      xplanet_config->source_type = cfdata->local_xplanet.source_type;
      xplanet_config->origin = cfdata->local_xplanet.origin;
      xplanet_config->projection = cfdata->local_xplanet.projection;
      xplanet_config->viewpos_type = cfdata->local_xplanet.viewpos_type;
      xplanet_config->viewpos_lat = cfdata->local_xplanet.viewpos_lat;
      xplanet_config->viewpos_lon = cfdata->local_xplanet.viewpos_lon;
      xplanet_config->use_localtime = cfdata->local_xplanet.use_localtime;
      e_widget_slider_value_int_get(cfdata->gui.o_localtime, &(xplanet_config->localtime));
      xplanet_config->viewpos_file = cfdata->local_xplanet.viewpos_file;
      xplanet_config->show_label = cfdata->local_xplanet.show_label;
      xplanet_config->label_text = strdup(cfdata->local_xplanet.label_text);
      xplanet_config->label_time = cfdata->local_xplanet.label_time;
      xplanet_config->label_pos = cfdata->local_xplanet.label_pos;
      xplanet_config->label_pos_other = strdup(cfdata->local_xplanet.label_pos_other);
      xplanet_config->use_config = cfdata->local_xplanet.use_config;
      xplanet_config->config_name = strdup(cfdata->local_xplanet.config_name);
      xplanet_config->extra_options = strdup(cfdata->local_xplanet.extra_options);

      e_config_save_queue();

      cfdata->config_updated = 1;
   }
   return config_ok;
}
Ejemplo n.º 24
0
/**
 * @brief Implementation AtkObject->ref_child callback
 *
 * ATK doc says:\n
 * Gets a reference to the specified accessible child of the object. The
 * accessible children are 0-based so the first accessible child is at index 0,
 * the second at index 1 and so on.
 *
 * @param obj an AtkObject
 * @param i index of a child
 *
 * @returns an AtkObject representing the specified accessible child of the
 * accessible.
 */
static AtkObject *
eail_popup_ref_child(AtkObject *obj, gint i)
{
    Eina_List *items = NULL;
    AtkObject *atk_obj = NULL;

    items = _eail_popup_get_items(obj);
    if (eina_list_count(items) > i)
        atk_obj = eail_factory_get_accessible(eina_list_nth(items, i));

    if (atk_obj)
        g_object_ref(atk_obj);

    return atk_obj;
}
Ejemplo n.º 25
0
/**
 * @brief Refreshes history of realized pages
 *
 * @param self an EailNaviframe object
 * @param list list of realized pages
 */
static void
_refresh_cached_pages(EailNaviframe *self, const Eina_List *list)
{
   int list_count = eina_list_count(list);

   eina_list_free(self->cached_pages);

   for (int i = 0; i < list_count; i++)
     {
        AtkObject *child = eail_naviframe_page_new(ATK_OBJECT(self), i);
        atk_object_initialize(child, eina_list_nth(list, i));
        g_object_ref(child);
        self->cached_pages = eina_list_append(self->cached_pages, child);
     }
}
Ejemplo n.º 26
0
static void
set_api_state(api_data *api)
{
   const Eina_List *items = elm_box_children_get(api->box);
   Evas_Object *ck = eina_list_nth(items, 0);
   if (!eina_list_count(items))
     return;

   /* use elm_box_children_get() to get list of children */
   switch(api->state)
     { /* Put all api-changes under switch */
        case CLOCK_HIDE_SEC:
           elm_clock_show_seconds_set(ck, EINA_FALSE);
           break;

          case CLOCK_SHOW_AM_PM:
           elm_clock_show_am_pm_set(ck,  EINA_TRUE);
           break;

          case CLOCK_SHOW_SEC:
           elm_clock_show_seconds_set(ck, EINA_TRUE);
           break;

          case CLOCK_EDIT_MIN:
           elm_clock_edit_set(ck, ELM_CLOCK_EDIT_MIN_DECIMAL | ELM_CLOCK_EDIT_MIN_UNIT);
           break;

          case CLOCK_EDIT_HOUR:
           elm_clock_edit_set(ck, ELM_CLOCK_EDIT_DEFAULT);
           elm_clock_edit_set(ck, ELM_CLOCK_EDIT_HOUR_DECIMAL | ELM_CLOCK_EDIT_HOUR_UNIT);
           break;

          case CLOCK_EDIT_ALL:
           elm_clock_edit_set(ck, ELM_CLOCK_EDIT_ALL);
           break;

          case CLOCK_EDIT_ALL_ARMY:
           elm_clock_show_am_pm_set(ck,  EINA_FALSE);
           break;

      case API_STATE_LAST:

         break;
      default:
         return;
     }
}
Ejemplo n.º 27
0
static double
em_fps_get(void *video)
{
   Emotion_Gstreamer_Video *ev;
   Emotion_Video_Stream      *vstream;

   ev = (Emotion_Gstreamer_Video *)video;

   if (!_emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE))
     return 0.0;

   vstream = eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1);
   if (vstream)
     return (double)vstream->fps_num / (double)vstream->fps_den;

   return 0.0;
}
Ejemplo n.º 28
0
/**
 * @brief Implementation AtkObject->ref_child callback
 *
 * ATK doc says:\n
 * Gets a reference to the specified accessible child of the object. The
 * accessible children are 0-based so the first accessible child is at index 0,
 * the second at index 1 and so on.
 *
 * @param obj an AtkObject
 * @param i index of a child
 *
 * @returns an AtkObject representing the specified accessible child of the
 * accessible.
 */
static AtkObject *
eail_index_ref_child(AtkObject *obj, gint i)
{
   const Eina_List *items;
   AtkObject *child = NULL;

   items = eail_index_get_index_items(obj);
   if (eina_list_count(items) > i)
     {
        child = eail_item_new(obj, ATK_ROLE_LIST_ITEM);
        atk_object_initialize(child, eina_list_nth(items, i));

        g_object_ref(child);
     }

   return child;
}
Ejemplo n.º 29
0
EAPI void
efreet_desktop_free(Efreet_Desktop *desktop)
{
    if (!desktop) return;

    desktop->ref--;
    if (desktop->ref > 0) return;

    if (desktop->eet)
    {
        efreet_cache_desktop_free(desktop);
    }
    else
    {
        IF_FREE(desktop->orig_path);

        IF_FREE(desktop->version);
        IF_FREE(desktop->name);
        IF_FREE(desktop->generic_name);
        IF_FREE(desktop->comment);
        IF_FREE(desktop->icon);
        IF_FREE(desktop->url);

        IF_FREE(desktop->try_exec);
        IF_FREE(desktop->exec);
        IF_FREE(desktop->path);
        IF_FREE(desktop->startup_wm_class);

        IF_FREE_LIST(desktop->only_show_in, eina_stringshare_del);
        IF_FREE_LIST(desktop->not_show_in, eina_stringshare_del);

        IF_FREE_LIST(desktop->categories, eina_stringshare_del);
        IF_FREE_LIST(desktop->mime_types, eina_stringshare_del);

        IF_FREE_HASH(desktop->x);

        if (desktop->type_data)
        {
            Efreet_Desktop_Type_Info *info;
            info = eina_list_nth(efreet_desktop_types, desktop->type);
            if (info->free_func)
                info->free_func(desktop->type_data);
        }
        free(desktop);
    }
}
Ejemplo n.º 30
0
/**
 * @brief Get reference to elm_gengrid child as AtkObject
 *
 * @param obj EailGengrid instance
 * @param i child index
 *
 * @returns reference to AtkObject
 */
static AtkObject *
eail_gengrid_ref_child(AtkObject *obj, gint i)
{
   g_return_val_if_fail(EAIL_IS_GENGRID(obj), NULL);

   AtkObject *child = NULL;

   Eina_List *list = eail_gengrid_items_get(EAIL_GENGRID(obj));
   if (eina_list_count(list) > i)
     {
        child = eail_factory_get_item_atk_obj
                             (eina_list_nth(list, i), ATK_ROLE_LIST_ITEM, obj);

        g_object_ref(child);
     }

   return child;
}