static void
_eco_match_add(void *data, void *data2)
{
  Eco_Option *opt;

  e_widget_ilist_append(o_matches, NULL, default_match,
			_eco_match_click_cb, NULL, NULL);

  opt = eco_config_option_list_add(cfg_screen, str_matches);
  opt->stringValue = strdup(default_match);  
  
  opt = eco_config_option_list_add(cfg_screen, str_effects);
  opt->intValue = 11;
  
  opt = eco_config_option_list_add(cfg_screen, str_durations);
  opt->intValue = 300;
  e_widget_slider_value_int_set(o_duration, opt->intValue);
  
  opt = eco_config_option_list_add(cfg_screen, str_randoms);

  /* opt = eco_config_option_list_add(cfg_screen, str_options); */
  
  e_widget_disabled_set(o_duration, 0);
  e_widget_ilist_selected_set(o_matches, e_widget_ilist_count(o_matches));
}
/*
 * Utility function for adding an individual entry to a list
 */
static void _add_ilist_entry(Evas_Object *ilist, const char *label,
      const char *list_value, const char *check_value, void(*callback)(
            void *data), E_Config_Dialog_Data *cfdata, int count, int *store_item)
{
   e_widget_ilist_append(ilist, NULL, label, callback, cfdata, list_value);
   if (check_value && !strcmp(list_value, check_value))
      *store_item = count;
}
void
news_config_dialog_item_content_refresh_selected_feeds(News_Item *ni)
{
   E_Config_Dialog_Data *cfdata;
   Evas_Object *ilist;
   int pos, iw, ih;
  
   if (!ni->config_dialog_content) return;
   cfdata = ni->config_dialog_content->cfdata;

   ilist = cfdata->ilist_selected_feeds;
   e_widget_ilist_freeze(ilist);
   /* disable the callback until we finish to refresh the list */
   e_widget_on_change_hook_set(ilist, NULL, NULL);

   e_widget_ilist_clear(ilist);
   if (cfdata->button_rem)
     {
        e_widget_disabled_set(cfdata->button_rem, 1);
        e_widget_disabled_set(cfdata->button_up, 1);
        e_widget_disabled_set(cfdata->button_down, 1);
     }

   cfdata->ilist_selected_feeds_inrefresh = 1;
   pos = -1;
   NEWS_ITEM_FEEDS_FOREACH_BEG(ni);
   {
      Evas_Object *ic = NULL;
      char buf[1024];
        
        if (_feed->icon && _feed->icon[0])
          {
             ic = e_icon_add(evas_object_evas_get(ilist));
             e_icon_file_set(ic, _feed->icon);
          }

        snprintf(buf, sizeof(buf), "%s%s", (_feed->important) ? "[i] " : "", _feed->name);

        e_widget_ilist_append(ilist, ic, buf, NULL, _feed, NULL);
	pos++;

	if (eina_list_data_find(cfdata->ilist_selected_feeds_sel, _feed))
          e_widget_ilist_multi_select(ilist, pos);
   }
   NEWS_ITEM_FEEDS_FOREACH_END();
   cfdata->ilist_selected_feeds_inrefresh = 0;

   e_widget_size_min_get(ilist, &iw, &ih);
   if (iw < 200) iw = 200;
   e_widget_size_min_set(ilist, iw, 250);
   
   e_widget_ilist_go(ilist);
   e_widget_ilist_thaw(ilist);
   _cb_selected_feed_change(cfdata, NULL);
   /* restore the callback */
   e_widget_on_change_hook_set(ilist, _cb_selected_feed_change, cfdata);
}
EAPI void
e_widget_config_list_append(Evas_Object *obj, const char *entry)
{
   E_Widget_Data *wd;
   int count;

   wd = e_widget_data_get(obj);
   e_widget_ilist_append(wd->gui.list, NULL, entry, NULL, NULL, NULL);
   e_widget_ilist_go(wd->gui.list);
   count = e_widget_ilist_count(wd->gui.list);
   e_widget_ilist_selected_set(wd->gui.list, count - 1);
}
Exemple #5
0
static void
_eco_match_add(void *data, void *data2)
{
  Eco_Option *match, *value;
  e_widget_ilist_append(o_matches, NULL, "class=XTerm",
			_eco_match_click_cb, NULL, NULL);

  match = eco_config_option_list_add(cfg_screen, "opacity_matches");
  match->stringValue = eina_stringshare_add("class=XTerm");  
  value = eco_config_option_list_add(cfg_screen, "opacity_values");
  value->intValue = 100;
  e_widget_slider_value_int_set(o_opacity, value->intValue);
  
  e_widget_disabled_set(o_opacity, 0);
  e_widget_ilist_selected_set(o_matches,
			      e_widget_ilist_count(o_matches));
}
static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
   Evas_Object *o, *ob, *ol;
   Population *pop;

   pop = cfd->data;
   o = e_widget_list_add(evas, 0, 0);

   ob = e_widget_label_add(evas, D_("Number of penguins:"));
   e_widget_list_object_append(o, ob, 1, 1, 0.5);
   ob = e_widget_slider_add(evas, 1, 0, D_("%1.0f"), 1, 200, 1, 0, NULL, &(cfdata->penguins_count), 200);
   e_widget_list_object_append(o, ob, 1, 1, 0.5);

   ob = e_widget_label_add(evas, D_("Zoom factor:"));
   e_widget_list_object_append(o, ob, 1, 1, 0.5);
   ob = e_widget_slider_add(evas, 1, 0, D_("%1.1f X"), 0.2, 3, 0.2, 0, &(cfdata->zoom), NULL, 200);
   e_widget_list_object_append(o, ob, 1, 1, 0.5);

   ob = e_widget_label_add(evas, D_("Transparency:"));
   e_widget_list_object_append(o, ob, 1, 1, 0.5);
   ob = e_widget_slider_add(evas, 1, 0, D_("%1.0f"), 50, 255, 1, 0, NULL, &(cfdata->alpha), 200);
   e_widget_list_object_append(o, ob, 1, 1, 0.5);

   //Lista
   ob = e_widget_label_add(evas, D_("Select population:"));
   e_widget_list_object_append(o, ob, 1, 1, 0.5);
   ol = e_widget_ilist_add(evas, 24, 24, &(cfdata->theme));

   e_widget_ilist_clear(ol);

   Eina_List *l;
   int count;
   l = pop->themes;
   count = 0;
   while (l)
   {
      char *theme;
      char *name;
      Evas_Object *oi;
      theme = l->data;
      name = edje_file_data_get(theme, "PopulationName");
      if (name)
      {
         oi = edje_object_add(evas);
         edje_object_file_set(oi, theme, "icon");
         //printf("TEMA: %s (%s)\n", name, cfdata->theme);
         e_widget_ilist_append(ol, oi, name, NULL, theme, theme);
         if (strcmp(theme, cfdata->theme) == 0)
         {
            e_widget_ilist_selected_set(ol, count);
         }
         count++;
      }
      l = eina_list_next(l);
   }
   e_widget_ilist_go(ol);
   e_widget_size_min_set(ol, 155, 250);
   e_widget_list_object_append(o, ol, 1, 1, 0.5);

   return o;
}
void
news_config_dialog_item_content_refresh_feeds(News_Item *ni)
{
   E_Config_Dialog_Data *cfdata;
   Eina_List *l, *l2;
   Evas_Object *ilist;
   int pos;
   int iw, ih;
  
   if (!ni->config_dialog_content) return;
   cfdata = ni->config_dialog_content->cfdata;

   ilist = cfdata->ilist_feeds;
   e_widget_ilist_freeze(ilist);
   /* disable the callback until we finish to refresh the list */
   e_widget_on_change_hook_set(ilist, NULL, NULL);

   e_widget_ilist_clear(ilist);
   if (cfdata->button_add)
     e_widget_disabled_set(cfdata->button_add, 1);

   pos = -1;
   for(l=news->config->feed.categories; l; l=eina_list_next(l))
     {
        News_Feed_Category *cat;
        Evas_Object *iccat = NULL;

        cat = eina_list_data_get(l);

        if (!cat->feeds_visible)
          continue;

        if (cat->icon)
          {
             iccat = e_icon_add(evas_object_evas_get(ilist));
             e_icon_file_set(iccat, cat->icon);
          }

        e_widget_ilist_header_append(ilist, iccat, cat->name);
	pos++;

        for(l2=cat->feeds_visible; l2; l2=eina_list_next(l2))
          {
             Evas_Object *ic = NULL;
             News_Feed *f;
             char buf[1024];
             
             f = eina_list_data_get(l2);
             
             if (f->icon && f->icon[0])
               {
                  ic = e_icon_add(evas_object_evas_get(ilist));
                  e_icon_file_set(ic, f->icon);
               }
             
             snprintf(buf, sizeof(buf), "%s%s", (f->important) ? "[i] " : "", f->name);
             
             e_widget_ilist_append(ilist, ic, buf, NULL, f, NULL);
	     pos++;

	     if (eina_list_data_find(cfdata->ilist_feeds_sel, f))
               e_widget_ilist_multi_select(ilist, pos);
          }
     }
   e_widget_ilist_thaw(ilist);

   e_widget_size_min_get(ilist, &iw, &ih);
   if (iw < 200) iw = 200;
   e_widget_size_min_set(ilist, iw, 250);
   
   e_widget_ilist_go(ilist);
   _cb_feed_change(cfdata, NULL);
   /* restore the callback */
   e_widget_on_change_hook_set(ilist, _cb_feed_change, cfdata);
}
static Evas_Object *
_basic_create_widgets(E_Config_Dialog      *cfd,
                      Evas                 *evas,
                      E_Config_Dialog_Data *cfdata)
{
   Evas_Object *o, *ob, *of, *osf, *ossf, *ot;
   E_Radio_Group *rg;
   E_Container *con = e_container_current_get(e_manager_current_get());
   E_Zone *zone;
   Eina_List *l;

   o = e_widget_list_add(evas, 0, 0);
   ot = e_widget_table_add(evas, 0);

   {  /* General settings */
      of = e_widget_framelist_add(evas, D_("General"), 0);
      FRAME_ADD(of, CHECK("Enable tiling", cfdata->tiling_enabled));
      FRAME_ADD(of, CHECK("Don't change window borders", cfdata->dont_touch_borders));
      FRAME_ADD(of, CHECK("Tile dialog windows aswell", cfdata->tile_dialogs));
      FRAME_ADD(of, CHECK("Set too big windows floating automatically", cfdata->float_too_big_windows));
      osf = e_widget_list_add(evas, 0, 0);
      ob = CHECK("Leave space between windows:", cfdata->space_between);
      e_widget_on_change_hook_set(ob, _cb_leave_space_change, cfdata);
      FRAME_ADD(of, ob);
      ossf = e_widget_list_add(evas, 0, 1);
      LIST_ADD(ossf, e_widget_label_add(evas, D_("Horizontal:")));
      LIST_ADD(ossf, e_widget_slider_add(evas, 1, 0, D_("%1.0f px"), 0.0, 50.0, 1.0, 0, NULL, &(cfdata->between_x), 200));
      LIST_ADD(osf, ossf);
      ossf = e_widget_list_add(evas, 0, 1);
      LIST_ADD(ossf, e_widget_label_add(evas, D_("Vertical:")));
      LIST_ADD(ossf, e_widget_slider_add(evas, 1, 0, D_("%1.0f px"), 0.0, 50.0, 1.0, 0, NULL, &(cfdata->between_y), 200));
      LIST_ADD(osf, ossf);
      cfdata->o_space_between = osf;
      recursively_set_disabled(osf, !cfdata->space_between);
      FRAME_ADD(of, osf);
      e_widget_table_object_append(ot, of, 0, 0, 1, 2, 1, 1, 1, 1);
   }

   {  /* Virtual desktop settings */
      of = e_widget_framelist_add(evas, D_("Virtual Desktops"), 0);
      rg = e_widget_radio_group_new(&(cfdata->tiling_mode));
      FRAME_ADD(of, RADIO("Don't tile by default", TILE_NONE, rg));
      FRAME_ADD(of, RADIO("Bigmain: Main window left, small windows right", TILE_BIGMAIN, rg));
      FRAME_ADD(of, RADIO("Grid: Distribute windows equally", TILE_GRID, rg));
      FRAME_ADD(of, RADIO("Individual modes:", TILE_INDIVIDUAL, rg));

      osf = e_widget_list_add(evas, 0, 1);

      {   /* Zone list */
         ILIST(100, 100);
         cfdata->o_zonelist = ob;
         e_widget_on_change_hook_set(ob, _cb_zone_change, cfdata);
         for (l = con->zones; l; l = l->next)
           {
              if (!(zone = l->data)) continue;
              e_widget_ilist_append(ob, NULL, zone->name, NULL, zone, NULL);
           }
         ILIST_GO(0);
         LIST_ADD(osf, ob);
      }

      {   /* List of individual tiling modes */
          /* Order is important here: Firstly create the list, then add it to the
           * scrollframe before any objects get added to the list */
           cfdata->o_desklist = e_widget_list_add(evas, 1, 0);
           cfdata->o_deskscroll = e_widget_scrollframe_simple_add(evas, cfdata->o_desklist);
           cfdata->evas = evas;

           _fill_zone_config(con->zones->data, cfdata);

           LIST_ADD(osf, cfdata->o_deskscroll);
      }
      FRAME_ADD(of, osf);
      e_widget_table_object_append(ot, of, 0, 2, 1, 1, 1, 1, 1, 1);
   }

   {  /* Grid mode settings */
      of = e_widget_framelist_add(evas, D_("Grid mode settings"), 0);
      rg = e_widget_radio_group_new(&(cfdata->grid_distribute_equally));
      FRAME_ADD(of, RADIO("Distribute space equally", 1, rg));
      FRAME_ADD(of, RADIO("Use this number of rows:", 0, rg));
      FRAME_ADD(of, e_widget_slider_add(evas, 1, 0, D_("%1.0f"), 1.0, 12.0, 1.0, 0, NULL, &(cfdata->grid_rows), 100));
      e_widget_table_object_append(ot, of, 1, 0, 1, 1, 1, 1, 1, 1);
   }

   {  /* Bigmain settings */
      of = e_widget_framelist_add(evas, D_("Bigmain settings"), 0);
      FRAME_ADD(of, e_widget_label_add(evas, D_("Big win takes percent of screen:")));
      FRAME_ADD(of, e_widget_slider_add(evas, 1, 0, D_("%.2f"), 0.1, 1.0, 0.01, 0, &(cfdata->big_perc), NULL, 100));
      e_widget_table_object_append(ot, of, 1, 1, 1, 1, 1, 1, 1, 1);
   }

   {  /* Tiling mode border style */
      osf = e_widget_list_add(evas, 0, 0);
      of = e_widget_framelist_add(evas, D_("Tiling border"), 0);
      ILIST(100, 75);
      e_widget_on_change_hook_set(ob, _cb_tiling_border_change, cfdata);
      int sel = -1, c = 0;
      for (l = e_theme_border_list(); l; l = l->next, c++)
        {
           e_widget_ilist_append(ob, NULL, l->data, NULL, NULL, NULL);
           if (cfdata->tiling_border && !strcmp(l->data, cfdata->tiling_border))
             sel = c;
        }
      ILIST_GO(sel);
      FRAME_ADD(of, ob);
      LIST_ADD(osf, of);

      of = e_widget_framelist_add(evas, D_("Floating border"), 0);
      ILIST(100, 75);
      e_widget_on_change_hook_set(ob, _cb_floating_border_change, cfdata);
      for (sel = -1, c = 0, l = e_theme_border_list(); l; l = l->next, c++)
        {
           e_widget_ilist_append(ob, NULL, l->data, NULL, NULL, NULL);
           if (cfdata->floating_border && !strcmp(l->data, cfdata->floating_border))
             sel = c;
        }
      ILIST_GO(sel);
      FRAME_ADD(of, ob);
      LIST_ADD(osf, of);
   }
   e_widget_table_object_append(ot, osf, 1, 2, 1, 1, 1, 1, 1, 1);
   LIST_ADD(o, ot);

   return o;
}