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;
}
Exemple #2
0
/**
 * @param file The path to the theme file
 * @return Returns the version of the local theme, NULL otherwise
 * @brief Get version from the local theme file. 
 */
EAPI char *
exchange_local_theme_version_get(const char *file)
{
   return (char *)edje_file_data_get(file, "theme/version");
}
Exemple #3
0
/**
 * @param file The path to the theme file
 * @return Returns the author of the local theme, NULL otherwise
 * @brief Get author from the local theme file. 
 */
EAPI char *
exchange_local_theme_author_get(const char *file)
{
   return (char *)edje_file_data_get(file, "theme/author");
}
Exemple #4
0
/**
 * @param file The path to the theme file
 * @return Returns the license of the local theme, NULL otherwise
 * @brief Get license from the local theme file. 
 */
EAPI char *
exchange_local_theme_license_get(const char *file)
{
   return (char *)edje_file_data_get(file, "theme/license");
}
Exemple #5
0
//Create a new menu item of type "item_type"
//This item will be automatically freed by calling eclair_menu_free on the parent menu
//Return NULL if failed
Eclair_Menu_Item *eclair_menu_item_new(const char *label, Eclair_Menu *parent, Eclair_Menu_Item_Type item_type, const char *icon_path)
{
   Eclair_Menu_Item *item;
   int result;

   if (!parent)
      return NULL;

   item = calloc(1, sizeof(Eclair_Menu_Item));
   item->type = item_type;

   //We load the edje object of the item
   item->edje_object = edje_object_add(parent->evas);
   if (item->type == ECLAIR_MENU_ITEM_SEPARATOR_ITEM)
      result = edje_object_file_set(item->edje_object, ECLAIR_WIDGETS_THEME, "eclair_menu_separator");
   else
      result = edje_object_file_set(item->edje_object, ECLAIR_WIDGETS_THEME, "eclair_menu_item");
   if (!result)
   {
      evas_object_del(item->edje_object);
      item->edje_object = NULL;
      return 0;
   }
   evas_object_event_callback_add(item->edje_object, EVAS_CALLBACK_MOUSE_IN, _eclair_menu_item_in_cb, item);
   evas_object_event_callback_add(item->edje_object, EVAS_CALLBACK_MOUSE_OUT, _eclair_menu_item_out_cb, item);
   evas_object_event_callback_add(item->edje_object, EVAS_CALLBACK_MOUSE_UP, _eclair_menu_item_up_cb, item);
   evas_object_show(item->edje_object);

   //We load the icon
   if (item->type == ECLAIR_MENU_ITEM_ICON_ITEM)
   {
      char *icon_size_str;
      int icon_size;

      item->icon_object = evas_object_image_add(parent->evas);
      evas_object_image_file_set(item->icon_object, icon_path, NULL);
      if (evas_object_image_load_error_get(item->icon_object))
      {
         evas_object_del(item->icon_object);
         item->icon_object = NULL;
         item->type = ECLAIR_MENU_ITEM_NORMAL_ITEM;
      }
      else
      {
         if ((icon_size_str = edje_file_data_get(ECLAIR_WIDGETS_THEME, "icon_size")))
         {
            icon_size = atoi(icon_size_str);
            evas_object_image_fill_set(item->icon_object, 0, 0, icon_size, icon_size);
            free(icon_size_str);
         }
         else
            evas_object_image_fill_set(item->icon_object, 0, 0, 16, 16);
         edje_object_part_swallow(item->edje_object, "icon", item->icon_object);
         evas_object_pass_events_set(item->icon_object, 1);
         evas_object_show(item->edje_object);
      }
   }

   eclair_menu_append_item(parent, item);

   if (item->type != ECLAIR_MENU_ITEM_SEPARATOR_ITEM)
      eclair_menu_item_label_set(item, label);

   return item;
}