Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/modules/wizard


Modified Files:
        e_wizard.c e_wizard.h page_000.c 


Log Message:


page 000 now auto-selects an "intl" font that will work and applies it to
most text classes. testing now - but seems to work. title got some japanese
in it for testing.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/wizard/e_wizard.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- e_wizard.c  16 Sep 2007 18:32:32 -0000      1.7
+++ e_wizard.c  17 Sep 2007 05:10:05 -0000      1.8
@@ -266,6 +266,12 @@
    _e_wizard_next_eval();
 }
 
+EAPI void
+e_wizard_title_set(const char *title)
+{
+   edje_object_part_text_set(o_bg, "e.text.title", title);
+}
+
 static void
 _e_wizard_back_eval(void)
 {
@@ -332,18 +338,12 @@
    o_ev = o;
 
    /* set up next/prev buttons */
-   edje_object_part_text_set(o_bg, "e.text.title", _("Welcome to 
Enlightenment"));
+   edje_object_part_text_set(o_bg, "e.text.title", _("Welcome to Enlightenment 
東京"));
    edje_object_part_text_set(o_bg, "e.text.page", "");
    edje_object_part_text_set(o_bg, "e.text.next", _("Next"));
    edje_object_part_text_set(o_bg, "e.text.back", _("Back"));
    edje_object_signal_emit(o_bg, "e,state,next,disable", "e");
    edje_object_signal_emit(o_bg, "e,state,back,disable", "e");
-   
-   /* set up rest here */
-   //evas_object_show(o);
-   //edje_object_part_swallow(o_bg, "e.swallow.content", o);
-   //e_widget_focus_set(o, 1);
-   //o_content = o;
    
    e_popup_edje_bg_object_set(pop, o_bg);
    e_popup_show(pop);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/wizard/e_wizard.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- e_wizard.h  16 Sep 2007 18:32:32 -0000      1.5
+++ e_wizard.h  17 Sep 2007 05:10:05 -0000      1.6
@@ -39,6 +39,7 @@
 EAPI void e_wizard_page_del(E_Wizard_Page *pg);
 EAPI void e_wizard_button_back_enable_set(int enable);
 EAPI void e_wizard_button_next_enable_set(int enable);
+EAPI void e_wizard_title_set(const char *title);
     
 #endif
 #endif
===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/wizard/page_000.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- page_000.c  14 Sep 2007 16:57:01 -0000      1.1
+++ page_000.c  17 Sep 2007 05:10:05 -0000      1.2
@@ -4,6 +4,25 @@
 #include "e.h"
 #include "e_mod_main.h"
 
+const char *intlfont = NULL;
+/* A list of fonts to choose as the default, in order of preference. This list
+ * can and probably will change over time with fine-tuning
+ */
+const char *preferred_fonts[] =
+{
+     "Sans",
+     "DejaVu Sans",
+     "Bitstream Vera Sans",
+     "Arial",
+     "Nice",
+     "Verdana",
+     "Lucida Sans"
+};
+/* negative numbers == keep theme set size but multiple by negative value
+ * multiplied by -100 (so scale, 100 = 1:1 scaling)
+ */
+const int fontsize = -100;
+
 EAPI int
 wizard_page_init(E_Wizard_Page *pg)
 {
@@ -17,7 +36,86 @@
 EAPI int
 wizard_page_show(E_Wizard_Page *pg)
 {
-   printf("t0\n");
+   Evas_List *fonts;
+   Evas_Hash *fonts_hash;
+   int i;
+   
+   fonts = evas_font_available_list(pg->evas);
+   fonts_hash = e_font_available_list_parse(fonts);
+
+   for (i = 0; i < (sizeof(preferred_fonts) / sizeof(char *)); i++)
+     {
+       E_Font_Properties *efp;
+       
+       efp =  evas_hash_find(fonts_hash, preferred_fonts[i]);
+       printf("WIZ: page_000: FONT \"%s\" exists=", preferred_fonts[i]);
+       if (efp) printf("yes\n");
+       else printf("no\n");
+       if ((!intlfont) && (efp))
+         intlfont = preferred_fonts[i];
+     }
+   
+   if (!intlfont) printf("WIZ: page_000: No intl font found\n");
+   else printf("WIZ: page_000: Chose \"%s\"\n", intlfont);
+
+   if (intlfont)
+     {
+       const char *classes[] =
+         {
+              "title_bar",
+              "menu_item",
+              "menu_title",
+              "tb_plain",
+              "tb_light",
+              "tb_big",
+              "move_text",
+              "resize_text",
+              "winlist_title",
+              "configure",
+              "about_title",
+              "about_version",
+              "button_text",
+              "desklock_title",
+              "desklock_passwd",
+              "dialog_error",
+              "exebuf_command",
+              "init_title",
+              "init_text",
+              "init_version",    
+              "entry",
+              "frame",
+              "label",
+              "button",
+              "slider",
+              "radio_button",
+              "check_button",
+              "tlist",
+              "ilist_item",
+              "ilist_header", 
+              "fileman_typebuf",
+              "fileman_icon",
+              "module_small",
+              "module_normal",
+              "module_large",
+              "module_small_s",
+              "module_normal_s",
+              "module_large_s",
+              "wizard_title",
+              "wizard_button"
+              /* FIXME: this list needs to be extended as new text classes
+               * appear - maybe we need to put the list of textclasses into
+               * core E
+               */
+         };
+       
+       for (i = 0; i < (sizeof(classes) / sizeof(char *)); i++)
+         e_font_default_set(classes[i], intlfont, fontsize);
+
+       e_font_apply();
+     }
+   
+   e_font_available_hash_free(fonts_hash);
+   evas_font_available_list_free(pg->evas, fonts);
    return 0; /* 1 == show ui, and wait for user, 0 == just continue */
 }
 EAPI int
@@ -28,6 +126,5 @@
 EAPI int
 wizard_page_apply(E_Wizard_Page *pg)
 {
-   printf("a0\n");
    return 1;
 }



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to