diff --git a/TODO b/TODO index d979b6298..d3c35175f 100644 --- a/TODO +++ b/TODO @@ -37,7 +37,6 @@ Some of the things (in very short form) that need to be done to E17... * fm2 needs way to replace or extend the right click menu (disable/enable rename/delete/refresh etc.) * fm2 needs a mime filter -* fm2 needs to have a mime & filetype -> icon mapping * middle mouse on gadgets as a quick move/resize thing? * language packs: need to have a tool to load/setup a language pack (which means .mo compiled files from a .po, an optional font and a config file that diff --git a/data/themes/default_fileman.edc b/data/themes/default_fileman.edc index 245711de3..3bf5b675f 100644 --- a/data/themes/default_fileman.edc +++ b/data/themes/default_fileman.edc @@ -10,6 +10,8 @@ images { image: "e17_busy-7.png" COMP; image: "e17_busy-8.png" COMP; image: "e17_busy-9.png" COMP; + image: "e17_fileman_thumb_bg.png" COMP; + image: "e17_button.png" COMP; } group { @@ -3262,16 +3264,58 @@ group { \ } \ } \ +#define FILEMAN_MIME(TYPE, FILE) \ +group { \ + name: "e/icons/fileman/mime/"TYPE; \ + parts { \ + part { \ + name: "icon"; \ + mouse_events: 0; \ + description { \ + state: "default" 0.0; \ + aspect: 1.0 1.0; \ + aspect_preference: BOTH; \ + align: 0.5 0.0; \ + image { \ + normal: "e17_icon_fileman_"FILE".png"; \ + } \ + } \ + description { \ + state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: 128 128 128 255; \ + } \ + } \ + } \ + programs { \ + program { \ + name: "disable"; \ + signal: "disable"; \ + source: ""; \ + action: STATE_SET "disabled" 0.0; \ + transition: LINEAR 0.1; \ + target: "icon"; \ + } \ + program { \ + name: "default"; \ + signal: "default"; \ + source: ""; \ + action: STATE_SET "default" 0.0; \ + transition: LINEAR 0.1; \ + target: "icon"; \ + } \ + } \ +} \ + images { - image: "e17_fileman_bg.png" COMP; - image: "e17_fileman_bg_shadow.png" COMP; image: "e17_icon_fileman_folder.png" COMP; image: "e17_icon_fileman_folder_clicked.png" COMP; image: "e17_icon_fileman_file.png" COMP; image: "e17_icon_fileman_file_clicked.png" COMP; image: "e17_icon_fileman_home.png" COMP; image: "e17_icon_fileman_desktop.png" COMP; + image: "e17_icon_fileman_pdf.png" COMP; image: "e17_icon_fileman_c.png" COMP; image: "e17_icon_fileman_h.png" COMP; @@ -3285,7 +3329,6 @@ images image: "e17_icon_fileman_cpp.png" COMP; image: "e17_icon_fileman_cs.png" COMP; image: "e17_icon_fileman_patch.png" COMP; - image: "e17_icon_fileman_diff.png" COMP; image: "e17_icon_fileman_doc.png" COMP; image: "e17_icon_fileman_ogg.png" COMP; image: "e17_icon_fileman_txt.png" COMP; @@ -3301,7 +3344,6 @@ images image: "e17_icon_fileman_gz.png" COMP; image: "e17_icon_fileman_tar.png" COMP; image: "e17_icon_fileman_mpg.png" COMP; - image: "e17_icon_fileman_mpeg.png" COMP; image: "e17_button_detail_open.png" COMP; image: "e17_button_detail_paste.png" COMP; @@ -3320,1408 +3362,49 @@ images image: "e17_button_detail_view_details.png" COMP; image: "e17_button_detail_view_name.png" COMP; image: "e17_button_detail_view.png" COMP; - image: "e17_fileman_rubberband.png" COMP; - image: "e17_menu_bg_border.png" COMP; - image: "e17_logo.png" COMP; - - image: "e17_button.png" COMP; - image: "e17_fileman_thumb_bg.png" COMP; - image: "e17_mini_button_shadow2.png" COMP; - image: "e17_fileman_typebuf.png" COMP; } -styles -{ - style { - name: "e/fileman_icon_style"; - base: "font=Edje-Vera color=#000 style=shadow shadow_color=#cccccc font_size=10 align=center wrap=char"; - tag: "br" "\n"; - tag: "hilight" "+ font=Edje-Vera-Bold"; - tag: "invisible" "+ font=Edje-Vera font_size=7 style=none color=#0002"; - } -} - -group { - name: "e/fileman/smart"; - parts { - part { - name: "background"; - type: SWALLOW; - description { - state: "default" 0.0; - } - } - part { - name: "background_overlay"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - visible: 0; - } - description { - state: "selecting" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 0 0 0 128; - } - } - part { - name: "e/icons"; - type: SWALLOW; - description { - state: "default" 0.0; - } - } - part { - name: "typebuffer"; - mouse_events: 0; - description { - state: "default" 0.0; - min: 96 64; - max: 384 64; - /* if we enable this, then we will zoom in / out */ - //min: 24 16; - //max: 24 16; - visible: 1; - align: 0.5 0.5; - color: 255 255 255 0; - image { - normal: "e17_fileman_typebuf.png"; - border: 17 17 17 17; - } - } - description { - state: "shown" 0.0; - inherit: "default" 0.0; - min: 96 64; - max: 384 64; - visible: 1; - color: 255 255 255 255; - } - } - part { - name: "text"; - type: TEXT; - effect: SHADOW; - description { - state: "default" 0.0; - fixed: 1 1; - align: 0.5 0.5; - color: 0 0 0 0; - color3: 255 255 255 0; - text { - text: "No Title"; - size: 12; - font: "Edje-Vera"; - align: 0.5 0.5; - elipsis: 0.0; - min: 1 1; - text_class: "fileman_typebuf"; - } - } - description { - state: "shown" 0.0; - inherit: "default" 0.0; - color: 0 0 0 255; - color3: 255 255 255 128; - } - } - programs { - program { - name: "typebuf_show"; - signal: "typebuf_show"; - source: ""; - action: STATE_SET "shown" 0.0; - transition: LINEAR 0.2; - target: "typebuffer"; - target: "text"; - } - program { - name: "typebuf_hide"; - signal: "typebuf_hide"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.2; - target: "typebuffer"; - target: "text"; - } - program { - name: "default"; - signal: "default"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.1; - target: "background_overlay"; - } - program { - name: "selecting"; - signal: "selecting"; - source: ""; - action: STATE_SET "selecting" 0.0; - transition: LINEAR 0.1; - target: "background_overlay"; - } - } - } -} - -group { - name: "e/fileman/main"; - parts { - part { - name: "background_clip"; - mouse_events: 1; - type: RECT; - description { - state: "default" 0.0; - rel1 { - relative: 0 0; - offset: 0 0; - } - rel2 { - relative: 1.0 1.0; - offset: -16 -16; - } - } - } - part { - name: "background"; - mouse_events: 1; - description { - state: "default" 0.0; - rel1 { - relative: 0 0; - offset: 0 0; - } - rel2 { - relative: 1.0 1.0; - offset: 0 0; - } - image { - //normal: "e17_fileman_bg.png"; - normal: "e17_brushed.png"; - } - fill { - smooth: 0; - size { - relative: 0 0; - offset: 400 300; - } - } - } - } - part { - name: "logo_bg"; - clip_to: "background_clip"; - mouse_events: 1; - description - { - state: "default" 0.0; - aspect: 1.0 1.0; - aspect_preference: BOTH; - color: 255 255 255 64; - rel1 { - relative: 0 0; - offset: -30 -80; - } - rel2 { - relative: 0 0; - offset: 90 80; - } - image { - normal: "e17_logo.png"; - } - } - } - part { - name: "background_border"; - mouse_events: 1; - description { - state: "default" 0.0; - rel1 { - relative: 0 0; - offset: 0 0; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - } - image { - normal: "e17_fileman_bg_shadow.png"; - } - color: 255 255 255 138; - } - } - part { - name: "item"; - type: SWALLOW; - mouse_events: 1; - description { - state: "default" 0.0; - rel1 { - relative: 0 0; - offset: 0 0; - } - rel2 { - relative: 1.0 1.0; - offset: -16 -1; - } - } - description { - state: "hidden" 0.0; - rel1 { - relative: 0 0; - offset: 0 0; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - } - } - } - part { - name: "sb_vbar"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - min: 16 16; - align: 1.0 0.0; - rel1 { - to: "background"; - relative: 1.0 0.0; - offset: -5 4; - } - rel2 { - to: "background"; - relative: 1.0 0.0; - offset: -5 -1; - to_y: "sb_hbar"; - } - } - description { - state: "hidden" 0.0; - visible: 0; - max: 0 99999; - rel1 { - to: "background"; - relative: 1.0 0.0; - offset: -4 4; - } - rel2 { - to: "background"; - relative: 1.0 0.0; - offset: -4 -1; - to_y: "sb_hbar"; - } - } - } - part { - name: "sb_vbar_base"; - type: RECT; - clip_to: "sb_vbar"; - mouse_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - rel1 { - relative: 0.0 1.0; - offset: 0 0; - to: "sb_vbar_a1"; - } - rel2 { - relative: 1.0 0.0; - offset: -1 -1; - to: "sb_vbar_a2"; - } - } - } - part { - name: "sb_vbar_runner"; - clip_to: "sb_vbar"; - mouse_events: 0; - description { - state: "default" 0.0; - max: 2 99999; - rel1 { - to: "sb_vbar_base"; - } - rel2 { - to: "sb_vbar_base"; - } - image { - normal: "e17_sb_runnerv.png"; - border: 0 0 4 4; - } - fill { - smooth: 0; - } - } - } - part { - name: "sb_vbar_p1"; - type: RECT; - clip_to: "sb_vbar"; - mouse_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - rel1 { - relative: 0.0 1.0; - offset: 0 0; - to: "sb_vbar_a1"; - } - rel2 { - relative: 1.0 0.0; - offset: -1 -1; - to: "vbar_bar"; - } - } - } - part { - name: "sb_vbar_p2"; - type: RECT; - clip_to: "sb_vbar"; - mouse_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - rel1 { - relative: 0.0 1.0; - offset: 0 0; - to: "vbar_bar"; - } - rel2 { - relative: 1.0 0.0; - offset: -1 -1; - to: "sb_vbar_a2"; - } - } - } - part { - name: "vbar_bar"; - clip_to: "sb_vbar"; - mouse_events: 1; - dragable { - x: 0 0 0; - y: 1 1 0; - confine: "sb_vbar_base"; - } - description { - state: "default" 0.0; - min: 16 16; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar_base"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar_base"; - } - image { - normal: "e17_sb_barv1.png"; - border: 5 5 5 5; - } - } - description { - state: "clicked" 0.0; - inherit: "default" 0.0; - image { - normal: "e17_sb_barv2.png"; - } - } - } - part { - name: "vbar_bar_thumb"; - clip_to: "sb_vbar"; - mouse_events: 0; - description { - state: "default" 0.0; - max: 8 8; - min: 8 8; - rel1 { - to: "vbar_bar"; - } - rel2 { - to: "vbar_bar"; - } - image { - normal: "e17_scrollbar_vdrag_thumb.png"; - } - } - } - part { - name: "sb_vbar_a1"; - type: IMAGE; - mouse_events: 1; - clip_to: "sb_vbar"; - description { - state: "default" 0.0; - align: 0.5 0.0; - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - rel1 { - to: "sb_vbar"; - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - to: "sb_vbar"; - relative: 1.0 0.0; - offset: -1 0; - } - image { - normal: "e17_sb_btu1.png"; - } - } - description { - state: "clicked" 0.0; - inherit: "default" 0.0; - image { - normal: "e17_sb_btu2.png"; - } - } - } - part { - name: "sb_vbar_a2"; - type: IMAGE; - mouse_events: 1; - clip_to: "sb_vbar"; - description { - state: "default" 0.0; - align: 0.5 1.0; - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - rel1 { - to: "sb_vbar"; - relative: 0.0 1.0; - offset: 0 -1; - } - rel2 { - to: "sb_vbar"; - relative: 1.0 1.0; - offset: -1 -1; - } - image { - normal: "e17_sb_btd1.png"; - } - } - description { - state: "clicked" 0.0; - inherit: "default" 0.0; - image { - normal: "e17_sb_btd2.png"; - } - } - } - part { - name: "sb_hbar"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - min: 16 16; - align: 0.0 1.0; - rel1 { - to: "background"; - relative: 0.0 1.0; - offset: 4 -5; - } - rel2 { - to: "background"; - relative: 0.0 1.0; - offset: -1 -5; - to_x: "sb_vbar"; - } - } - description { - state: "hidden" 0.0; - visible: 0; - rel1 { - to: "background"; - relative: 0.0 1.0; - offset: 0 -4; - } - rel2 { - to: "background"; - relative: 0.0 1.0; - offset: -1 -4; - to_x: "sb_vbar"; - } - } - } - part { - name: "sb_hbar_base"; - type: RECT; - clip_to: "sb_hbar"; - mouse_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - rel1 { - relative: 1.0 0.0; - offset: 0 0; - to: "sb_hbar_a1"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to: "sb_hbar_a2"; - } - } - } - part { - name: "sb_hbar_runner"; - clip_to: "sb_hbar"; - mouse_events: 0; - description { - state: "default" 0.0; - max: 99999 2; - rel1 { - to: "sb_hbar_base"; - } - rel2 { - to: "sb_hbar_base"; - } - image { - normal: "e17_sb_runnerh.png"; - border: 4 4 0 0; - } - fill { - smooth: 0; - } - } - } - part { - name: "sb_hbar_p1"; - type: RECT; - clip_to: "sb_hbar"; - mouse_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - rel1 { - relative: 1.0 0.0; - offset: 0 0; - to: "sb_hbar_a1"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to: "hbar_bar"; - } - } - } - part { - name: "sb_hbar_p2"; - type: RECT; - clip_to: "sb_hbar"; - mouse_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - rel1 { - relative: 1.0 0.0; - offset: 0 0; - to: "hbar_bar"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to: "sb_hbar_a2"; - } - } - } - part { - name: "hbar_bar"; - clip_to: "sb_hbar"; - mouse_events: 1; - dragable { - x: 1 1 0; - y: 0 0 0; - confine: "sb_hbar_base"; - } - description { - state: "default" 0.0; - min: 16 16; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar_base"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar_base"; - } - image { - normal: "e17_sb_barh1.png"; - border: 5 5 5 5; - } - } - description { - state: "clicked" 0.0; - inherit: "default" 0.0; - image { - normal: "e17_sb_barh2.png"; - } - } - } - part { - name: "hbar_bar_thumb"; - clip_to: "sb_hbar"; - mouse_events: 0; - description { - state: "default" 0.0; - max: 8 8; - min: 8 8; - rel1 { - to: "hbar_bar"; - } - rel2 { - to: "hbar_bar"; - } - image { - normal: "e17_scrollbar_hdrag_thumb.png"; - } - } - } - part { - name: "sb_hbar_a1"; - type: IMAGE; - mouse_events: 1; - clip_to: "sb_hbar"; - description { - state: "default" 0.0; - align: 0.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - to: "sb_hbar"; - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - to: "sb_hbar"; - relative: 0.0 1.0; - offset: 0 -1; - } - image { - normal: "e17_sb_btl1.png"; - } - } - description { - state: "clicked" 0.0; - inherit: "default" 0.0; - image { - normal: "e17_sb_btl2.png"; - } - } - } - part { - name: "sb_hbar_a2"; - type: IMAGE; - mouse_events: 1; - clip_to: "sb_hbar"; - description { - state: "default" 0.0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - to: "sb_hbar"; - relative: 1.0 0.0; - offset: -1 0; - } - rel2 { - to: "sb_hbar"; - relative: 1.0 1.0; - offset: -1 -1; - } - image { - normal: "e17_sb_btr1.png"; - } - } - description { - state: "clicked" 0.0; - inherit: "default" 0.0; - image { - normal: "e17_sb_btr2.png"; - } - } - } - } - programs { - program { - name: "sb_vbar_show"; - signal: "vbar"; - source: "show"; - action: STATE_SET "default" 0.0; - target: "sb_vbar"; - target: "item"; - } - program { - name: "sb_vbar_hide"; - signal: "vbar"; - source: "hide"; - action: STATE_SET "hidden" 0.0; - target: "sb_vbar"; - target: "item"; - } - program { - name: "sb_hbar_show"; - signal: "hbar"; - source: "show"; - action: STATE_SET "default" 0.0; - target: "sb_hbar"; - target: "item"; - } - program { - name: "sb_hbar_hide"; - signal: "hbar"; - source: "hide"; - action: STATE_SET "hidden" 0.0; - target: "sb_hbar"; - target: "item"; - } - - program { - name: "sb_vbar_a1_down"; - signal: "mouse,down,1"; - source: "sb_vbar_a1"; - action: STATE_SET "clicked" 0.0; - target: "sb_vbar_a1"; - } - program { - name: "sb_vbar_a1_down2"; - signal: "mouse,down,1"; - source: "sb_vbar_a1"; - action: DRAG_VAL_STEP 0.0 -1.0; - target: "vbar_bar"; - } - program { - name: "sb_vbar_a1_up"; - signal: "mouse,up,1"; - source: "sb_vbar_a1"; - action: STATE_SET "default" 0.0; - target: "sb_vbar_a1"; - } - program { - name: "sb_vbar_a2_down"; - signal: "mouse,down,1"; - source: "sb_vbar_a2"; - action: STATE_SET "clicked" 0.0; - target: "sb_vbar_a2"; - } - program { - name: "sb_vbar_a2_down2"; - signal: "mouse,down,1"; - source: "sb_vbar_a2"; - action: DRAG_VAL_STEP 0.0 1.0; - target: "vbar_bar"; - } - program { - name: "sb_vbar_a2_up"; - signal: "mouse,up,1"; - source: "sb_vbar_a2"; - action: STATE_SET "default" 0.0; - target: "sb_vbar_a2"; - } - program { - name: "sb_vbar_p1_down"; - signal: "mouse,down,1"; - source: "sb_vbar_p1"; - action: DRAG_VAL_PAGE 0.0 -1.0; - target: "vbar_bar"; - } - program { - name: "sb_vbar_p2_down"; - signal: "mouse,down,1"; - source: "sb_vbar_p2"; - action: DRAG_VAL_PAGE 0.0 1.0; - target: "vbar_bar"; - } - program { - name: "sb_vbar_down"; - signal: "mouse,down,1"; - source: "vbar_bar"; - action: STATE_SET "clicked" 0.0; - target: "vbar_bar"; - } - program { - name: "sb_vbar_up"; - signal: "mouse,up,1"; - source: "vbar_bar"; - action: STATE_SET "default" 0.0; - target: "vbar_bar"; - } - program { - name: "sb_hbar_a1_down"; - signal: "mouse,down,1"; - source: "sb_hbar_a1"; - action: STATE_SET "clicked" 0.0; - target: "sb_hbar_a1"; - } - program { - name: "sb_hbar_a1_down2"; - signal: "mouse,down,1"; - source: "sb_hbar_a1"; - action: DRAG_VAL_STEP -1.0 0.0; - target: "hbar_bar"; - } - program { - name: "sb_hbar_a1_up"; - signal: "mouse,up,1"; - source: "sb_hbar_a1"; - action: STATE_SET "default" 0.0; - target: "sb_hbar_a1"; - } - program { - name: "sb_hbar_a2_down"; - signal: "mouse,down,1"; - source: "sb_hbar_a2"; - action: STATE_SET "clicked" 0.0; - target: "sb_hbar_a2"; - } - program { - name: "sb_hbar_a2_down2"; - signal: "mouse,down,1"; - source: "sb_hbar_a2"; - action: DRAG_VAL_STEP 1.0 0.0; - target: "hbar_bar"; - } - program { - name: "sb_hbar_a2_up"; - signal: "mouse,up,1"; - source: "sb_hbar_a2"; - action: STATE_SET "default" 0.0; - target: "sb_hbar_a2"; - } - program { - name: "sb_hbar_p1_down"; - signal: "mouse,down,1"; - source: "sb_hbar_p1"; - action: DRAG_VAL_PAGE -1.0 0.0; - target: "hbar_bar"; - } - program { - name: "sb_hbar_p2_down"; - signal: "mouse,down,1"; - source: "sb_hbar_p2"; - action: DRAG_VAL_PAGE 1.0 0.0; - target: "hbar_bar"; - } - program { - name: "sb_hbar_down"; - signal: "mouse,down,1"; - source: "hbar_bar"; - action: STATE_SET "clicked" 0.0; - target: "hbar_bar"; - } - program { - name: "sb_hbar_up"; - signal: "mouse,up,1"; - source: "hbar_bar"; - action: STATE_SET "default" 0.0; - target: "hbar_bar"; - } - } -} - -group { - name: "e/fileman/icon_normal"; - parts { - part { - name: "icon_overlay"; - mouse_events: 1; - description { - state: "default" 0.0; - rel1 { - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - } - image { - normal: "e17_button.png"; - border: 8 8 8 8; - } - color: 255 255 255 0; - } - description { - state: "clicked" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - description { - state: "dragged" 0.0; - inherit: "default" 0.0; - color: 10 10 10 30; - } - description { - state: "hover" 0.0; - inherit: "default" 0.0; - color: 10 10 10 30; - } - } - part { - name: "icon_box"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - visible: 1; - aspect: 1.0 1.0; - aspect_preference: BOTH; - color: 0 0 0 0; - rel1 { - relative: 0.0 0.0; - offset: 6 6; - } - rel2 { - to_y: "icon_title"; - relative: 1.0 0.0; - offset: -7 -3; - } - } - } - part { - name: "e.swallow.icon"; - type: SWALLOW; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - to: "icon_box"; - offset: 2 2; - } - rel2 { - to: "icon_box"; - offset: -3 -3; - } - } - } - part { - name: "icon_title"; - type: TEXT; - effect: SHADOW; - description { - state: "default" 0.0; - align: 0.5 1.0; - fixed: 0 1; - rel1 { - relative: 0.0 1.0; - offset: 6 -7; - } - rel2 { - relative: 1.0 1.0; - offset: -7 -7; - } - color: 0 0 0 255; - color3: 255 255 255 128; - text { - text: "No Title"; - size: 10; - font: "Edje-Vera"; - min: 0 1; - align: 0.5 1.0; - elipsis: 0.0; - text_class: "fileman_icon"; - } - } - } - part { - name: "icon_event"; - type: RECT; - mouse_events: 1; - description { - state: "default" 0.0; - rel1 { - relative: 0.0 0.0; - offset: 6 6; - } - rel2 { - relative: 1.0 1.0; - offset: -7 -7; - } - color: 0 0 0 0; - } - } - part { - name: "icon_title_edit_swallow"; - type: SWALLOW; - effect: NONE; - description { - rel1 { - relative: 0.0 1.0; - offset: 5 -20; - } - rel2 { - relative: 1.0 1.0; - offset: -6 -6; - } - } - } - } - programs { - program { - name: "clicked"; - signal: "clicked"; - source: ""; - action: STATE_SET "clicked" 0.0; - transition: LINEAR 0.2; - target: "icon_title"; - target: "icon_overlay"; - } - program { - name: "unclicked"; - signal: "unclicked"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.2; - target: "icon_title"; - target: "icon_overlay"; - } - program { - name: "dragged"; - signal: "dragged"; - source: ""; - action: STATE_SET "dragged" 0.0; - transition: LINEAR 0.2; - target: "icon_title"; - target: "icon_overlay"; - } - program { - name: "dropped"; - signal: "dropped"; - source: ""; - action: STATE_SET "clicked" 0.0; - transition: LINEAR 0.2; - target: "icon_title"; - target: "icon_overlay"; - } - program { - name: "hover"; - signal: "hover"; - source: ""; - action: STATE_SET "hover" 0.0; - transition: LINEAR 0.2; - target: "icon_title"; - target: "icon_overlay"; - } - program { - name: "unhover"; - signal: "unhover"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.2; - target: "icon_title"; - target: "icon_overlay"; - } - } -} - - -group { - name: "e/fileman/icon_thumb"; - parts { - part { - name: "icon_box_shadow"; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - to: "icon_box"; - relative: 0.0 0.0; - offset: 3 3; - } - rel2 { - to: "icon_box"; - relative: 1.0 1.0; - offset: 3 3; - } - image { - normal: "e17_mini_button_shadow2.png"; - border: 6 6 6 6; - } - } - } - part { - name: "icon_box"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.5 0.5; - rel1 { - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - relative: 1.0 1.0; - offset: -6 -6; - } - color: 0 0 0 128; - } - } - part { - name: "icon_box_bg"; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - to: "icon_box"; - relative: 0.0 0.0; - offset: 1 1; - } - rel2 { - to: "icon_box"; - relative: 1.0 1.0; - offset: -2 -2; - } - image { - normal: "e17_fileman_thumb_bg.png"; - } - fill { - smooth: 0; - size { - relative: 0 0; - offset: 32 32; - } - } - } - } - part { - name: "e.swallow.icon"; - type: SWALLOW; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - to: "icon_box_bg"; - } - rel2 { - to: "icon_box_bg"; - } - } - } - part { - name: "icon_overlay"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - visible: 0; - rel1 { - to: "icon_box_bg"; - } - rel2 { - to: "icon_box_bg"; - } - } - description { - state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 0 0 0 128; - } - } - } - programs { - program { - name: "disable"; - signal: "disable"; - source: ""; - action: STATE_SET "disabled" 0.0; - transition: LINEAR 0.1; - target: "icon_overlay"; - } - program { - name: "default"; - signal: "default"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.1; - target: "icon_overlay"; - } - } -} - - -group { - name: "e/fileman/icon_list"; - parts { - part { - name: "e.swallow.icon"; - type: SWALLOW; - mouse_events: 0; - description { - state: "default" 0.0; - align: 1.0 1.0; - fixed: 1 1; - rel1 { - relative: 0.0 0.0; - offset: 2 2; - } - rel2 { - relative: 0.0 1.0; - offset: 2 -3; - } - } - } - part { - name: "icon_title"; - type: TEXT; - effect: SHADOW; - description { - state: "default" 0.0; - rel1 { - to_x: "e.swallow.icon"; - relative: 1.0 0.0; - offset: 2 2; - } - rel2 { - relative: 1.0 1.0; - offset: -2 -2; - } - color: 0 0 0 255; - color3: 255 255 255 128; - text { - text: "No Title"; - font: "Edje-Vera"; - size: 10; - //min: 1 1; - align: 0.5 1.0; - elipsis: 0.0; - text_class: "fileman_icon"; - } - } - } - part { - name: "icon_event"; - type: RECT; - mouse_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "icon_title_edit_swallow"; - type: SWALLOW; - effect: NONE; - description { - rel1 { - to_x: "e.swallow.icon"; - relative: 1.0 0.0; - offset: 2 2; - } - rel2 { - relative: 1.0 1.0; - offset: -2 -2; - } - } - } - } - programs { - program { - name: "button_click"; - signal: "mouse,down,1"; - source: ""; - action: SIGNAL_EMIT "clicked" ""; - } - } -} - -group { - name: "e/fileman/background"; - parts { - part { - name: "base"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - relative: 0.0 0.0; - offset: 1 1; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - } - color: 255 255 255 0; - } - } - } -} - -group { - name: "e/fileman/rubberband"; - parts { - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - relative: 0.0 0.0; - offset: 1 1; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - } - image { - normal: "e17_fileman_rubberband.png"; - border: 2 2 2 2; - } - color: 255 255 255 128; - } - } - } -} - - FILEMAN_ICON_CLICKABLE("folder"); FILEMAN_ICON_CLICKABLE("file"); FILEMAN_ICON("home"); FILEMAN_ICON("desktop"); -FILEMAN_ICON("pdf"); -FILEMAN_ICON("c"); -FILEMAN_ICON("h"); -FILEMAN_ICON("o"); -FILEMAN_ICON("sh"); -FILEMAN_ICON("png"); -FILEMAN_ICON("jpg"); -FILEMAN_ICON("avi"); -FILEMAN_ICON("mp3"); -FILEMAN_ICON("xcf"); -FILEMAN_ICON("cpp"); -FILEMAN_ICON("cs"); -FILEMAN_ICON("patch"); -FILEMAN_ICON("diff"); -FILEMAN_ICON("doc"); -FILEMAN_ICON("ogg"); -FILEMAN_ICON("txt"); -FILEMAN_ICON("bz2"); -FILEMAN_ICON("deb"); -FILEMAN_ICON("ttf"); -FILEMAN_ICON("pcf"); -FILEMAN_ICON("bdf"); -FILEMAN_ICON("css"); -FILEMAN_ICON("html"); -FILEMAN_ICON("htm"); -FILEMAN_ICON("zip"); -FILEMAN_ICON("gz"); -FILEMAN_ICON("tar"); -FILEMAN_ICON("mpg"); -FILEMAN_ICON("mpeg"); + +FILEMAN_MIME("application/pdf", "pdf"); +FILEMAN_MIME("text/x-csrc", "c"); +FILEMAN_MIME("text/x-chdr", "h"); +FILEMAN_MIME("application/x-object", "o"); +FILEMAN_MIME("application/x-shellscript", "sh"); +FILEMAN_MIME("image/png", "png"); +FILEMAN_MIME("image/jpeg", "jpg"); +FILEMAN_MIME("video/x-msvideo", "avi"); +FILEMAN_MIME("audio/mpeg", "mp3"); +FILEMAN_MIME("application/x-xcf", "xcf"); +FILEMAN_MIME("text/x-c++src", "cpp"); +FILEMAN_MIME("text/x-csharp", "cs"); +FILEMAN_MIME("text/x-patch", "patch"); +FILEMAN_MIME("application/msword", "doc"); +FILEMAN_MIME("application/ogg", "ogg"); +FILEMAN_MIME("text/plain", "txt"); +FILEMAN_MIME("application/x-bzip", "bz2"); +FILEMAN_MIME("application/x-deb", "deb"); +FILEMAN_MIME("application/x-font-ttf", "ttf"); +FILEMAN_MIME("application/x-font-pcf", "pcf"); +FILEMAN_MIME("application/x-font-bdf", "bdf"); +FILEMAN_MIME("text/css", "css"); +FILEMAN_MIME("text/html", "html"); +FILEMAN_MIME("text/html", "htm"); +FILEMAN_MIME("application/zip", "zip"); +FILEMAN_MIME("application/x-gzip", "gz"); +FILEMAN_MIME("application/x-bzip-compressed-tar", "tar"); +FILEMAN_MIME("application/x-bzip2-compressed-tar", "tar"); +FILEMAN_MIME("application/x-compressed-tar", "tar"); +FILEMAN_MIME("application/x-tar", "tar"); +FILEMAN_MIME("video/mpeg", "mpg"); + +FILEMAN_MIME("video", "mpg"); +FILEMAN_MIME("text", "txt"); +FILEMAN_MIME("image", "png"); +FILEMAN_MIME("audio", "mp3"); FULL_SIZE_FILEMAN_BUTTON("open"); FULL_SIZE_FILEMAN_BUTTON("copy"); diff --git a/src/bin/e_config.c b/src/bin/e_config.c index 9ae87d967..fd5b5ad6d 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -39,6 +39,7 @@ static E_Config_DD *_e_config_color_class_edd = NULL; static E_Config_DD *_e_config_gadcon_edd = NULL; static E_Config_DD *_e_config_gadcon_client_edd = NULL; static E_Config_DD *_e_config_shelf_edd = NULL; +static E_Config_DD *_e_config_mime_icon_edd = NULL; /* externally accessible functions */ @@ -309,6 +310,14 @@ e_config_init(void) E_CONFIG_VAL(D, T, b3, INT); E_CONFIG_VAL(D, T, a3, INT); + _e_config_mime_icon_edd = E_CONFIG_DD_NEW("E_Config_Mime_Icon", E_Config_Mime_Icon); +#undef T +#undef D +#define T E_Config_Mime_Icon +#define D _e_config_mime_icon_edd + E_CONFIG_VAL(D, T, mime, STR); + E_CONFIG_VAL(D, T, icon, STR); + _e_config_edd = E_CONFIG_DD_NEW("E_Config", E_Config); #undef T #undef D @@ -489,6 +498,8 @@ e_config_init(void) E_CONFIG_VAL(D, T, wallpaper_grad_c2_g, INT); E_CONFIG_VAL(D, T, wallpaper_grad_c2_b, INT); + E_CONFIG_LIST(D, T, mime_icons, _e_config_mime_icon_edd); /**/ + e_config = e_config_domain_load("e", _e_config_edd); if (e_config) { @@ -1228,6 +1239,29 @@ e_config_init(void) e_config->desk_flip_animate_time = 0.2; IFCFGEND; + IFCFG(0x0102); + { + E_Config_Mime_Icon *mi; + +#define CFG_MIME_ICON(_mime, _icon) \ + mi = E_NEW(E_Config_Mime_Icon, 1); \ + mi->mime = evas_stringshare_add(_mime); \ + mi->icon = evas_stringshare_add(_icon); \ + e_config->mime_icons = evas_list_append(e_config->mime_icons, mi) + + CFG_MIME_ICON("image/jpeg", "THUMB"); + CFG_MIME_ICON("image/png", "THUMB"); + CFG_MIME_ICON("image/x-pixmap", "THUMB"); + CFG_MIME_ICON("image/svg+xml", "THUMB"); + CFG_MIME_ICON("image/gif", "THUMB"); + CFG_MIME_ICON("image/tiff", "THUMB"); + + CFG_MIME_ICON("application/x-desktop", "DESKTOP"); + +// CFG_MIME_ICON("image/*", "e/icons/fileman/mime/image"); + } + IFCFGEND; + #if 0 /* example of new config */ IFCFG(0x0090); /* the version # where this value(s) was introduced */ e_config->new_value = 10; /* set the value(s) */ diff --git a/src/bin/e_config.h b/src/bin/e_config.h index 7c49fd00d..2b8fe8df5 100644 --- a/src/bin/e_config.h +++ b/src/bin/e_config.h @@ -36,6 +36,7 @@ typedef struct _E_Config_Desktop_Name E_Config_Desktop_Name; typedef struct _E_Config_Gadcon E_Config_Gadcon; typedef struct _E_Config_Gadcon_Client E_Config_Gadcon_Client; typedef struct _E_Config_Shelf E_Config_Shelf; +typedef struct _E_Config_Mime_Icon E_Config_Mime_Icon; typedef Eet_Data_Descriptor E_Config_DD; @@ -50,7 +51,7 @@ typedef Eet_Data_Descriptor E_Config_DD; /* increment this whenever a new set of config values are added but the users * config doesn't need top be wiped - simply new values need to be put in */ -#define E_CONFIG_FILE_GENERATION 0x0101 +#define E_CONFIG_FILE_GENERATION 0x0102 #define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION) #define E_EVAS_ENGINE_DEFAULT 0 @@ -249,6 +250,8 @@ struct _E_Config int wallpaper_grad_c2_r; // INTERNAL int wallpaper_grad_c2_g; // INTERNAL int wallpaper_grad_c2_b; // INTERNAL + + Evas_List *mime_icons; }; struct _E_Config_Module @@ -358,6 +361,12 @@ struct _E_Config_Shelf int size; }; +struct _E_Config_Mime_Icon +{ + char *mime; + char *icon; +}; + EAPI int e_config_init(void); EAPI int e_config_shutdown(void); diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c index e3b01e0a0..fc7eeeeb1 100644 --- a/src/bin/e_fm.c +++ b/src/bin/e_fm.c @@ -1575,15 +1575,18 @@ _e_fm2_icon_icon_set(E_Fm2_Icon *ic) { if (ic->info.mime) { + const char *icon; + + icon = e_fm_mime_icon_get(ic->info.mime); + printf("%s -> %s | %s\n", ic->info.file, ic->info.mime, icon); /* use mime type to select icon */ - if ( - (!strcmp(ic->info.mime, "image/jpeg")) || - (!strcmp(ic->info.mime, "image/png")) || - (!strcmp(ic->info.mime, "image/gif")) || - (!strcmp(ic->info.mime, "image/tiff")) || - (!strcmp(ic->info.mime, "image/x-xpixmap")) || - (!strcmp(ic->info.mime, "image/svg+xml")) - ) + if (!icon) + { + ic->obj_icon = edje_object_add(evas_object_evas_get(ic->sd->obj)); + e_theme_edje_object_set(ic->obj_icon, "base/theme/fileman", + "e/icons/fileman/file"); + } + else if (!strcmp(icon, "THUMB")) { if (ic->info.pseudo_link) snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file); @@ -1594,26 +1597,55 @@ _e_fm2_icon_icon_set(E_Fm2_Icon *ic) e_thumb_icon_size_set(ic->obj_icon, 128, 128); evas_object_smart_callback_add(ic->obj_icon, "e_thumb_gen", _e_fm2_cb_icon_thumb_gen, ic); _e_fm2_icon_thumb(ic); - edje_object_part_swallow(ic->obj, "e.swallow.icon", ic->obj_icon); - evas_object_show(ic->obj_icon); + } + else if (!strcmp(icon, "DESKTOP")) + { + E_App *app; + + if (ic->info.pseudo_link) + snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file); + else + snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file); +/* FIXME FIXME FIXME: e_app_new() is SLOOOOOOOOOOOOOOOOOOOOOOOOOOOOOW. it can + * be a complete hog. this destroys performance in fm2. :(:(:( + */ + app = e_app_new(buf, 0); + if (app) + { + ic->obj_icon = e_app_icon_add(evas_object_evas_get(ic->sd->obj), app); + e_object_unref(E_OBJECT(app)); + } + } + else if (!strncmp(icon, "e/icons/fileman/mime/", 21)) + { + ic->obj_icon = edje_object_add(evas_object_evas_get(ic->sd->obj)); + if (!e_theme_edje_object_set(ic->obj_icon, + "base/theme/fileman", + icon)) + e_theme_edje_object_set(ic->obj_icon, "base/theme/fileman", + "e/icons/fileman/file"); } else { - /* fixme: quick hack to get some icons - need to have a proper - * mime -> icon mapping users can edit - */ - p = strchr(ic->info.mime, '/'); - if (p) p++; - else p = (char *)ic->info.mime; - snprintf(buf, sizeof(buf), "e/icons/fileman/%s", p); - ic->obj_icon = edje_object_add(evas_object_evas_get(ic->sd->obj)); - if (!e_theme_edje_object_set(ic->obj_icon, "base/theme/fileman", - buf)) - e_theme_edje_object_set(ic->obj_icon, "base/theme/fileman", - "e/icons/fileman/file"); - edje_object_part_swallow(ic->obj, "e.swallow.icon", ic->obj_icon); - evas_object_show(ic->obj_icon); + p = strrchr(icon, '.'); + if ((p) && (!strcmp(p, ".edj"))) + { + ic->obj_icon = edje_object_add(evas_object_evas_get(ic->sd->obj)); + if (!e_theme_edje_object_set(ic->obj_icon, + "base/theme/fileman", + icon)) + e_theme_edje_object_set(ic->obj_icon, "base/theme/fileman", + "e/icons/fileman/file"); + } + else + { + ic->obj_icon = e_icon_add(evas_object_evas_get(ic->sd->obj)); + e_icon_file_set(ic->obj_icon, icon); + } } + edje_object_part_swallow(ic->obj, "e.swallow.icon", + ic->obj_icon); + evas_object_show(ic->obj_icon); return; } else diff --git a/src/bin/e_fm_mime.c b/src/bin/e_fm_mime.c index 12a7162a1..38e3574ec 100644 --- a/src/bin/e_fm_mime.c +++ b/src/bin/e_fm_mime.c @@ -12,6 +12,7 @@ struct _E_Mime }; /* local subsystem functions */ +static Evas_Bool _e_fm_mime_icon_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata); static void _e_fm_mime_all_free(void); static void _e_fm_mime_update(void); static int _e_fm_mime_glob_remove(const char *glob); @@ -19,6 +20,7 @@ static void _e_fm_mime_mime_types_load(char *file); static void _e_fm_mime_shared_mimeinfo_globs_load(char *file); static Evas_List *mimes = NULL; +static Evas_Hash *icon_map = NULL; /* externally accessible functions */ EAPI const char * @@ -53,7 +55,116 @@ e_fm_mime_filename_get(const char *fname) return NULL; } +/* returns: + * NULL == don't know + * "THUMB" == generate a thumb + * "e/icons/fileman/mime/..." == theme icon + * "/path/to/file....edj" = explicit icon edje file + * "/path/to/file..." = explicit image file to use + */ +EAPI const char * +e_fm_mime_icon_get(const char *mime) +{ + char buf[4096], buf2[4096], *homedir = NULL, *val; + Evas_List *l; + E_Config_Mime_Icon *mi; + Evas_List *freelist = NULL; + + /* 0.0 clean out hash cache once it has mroe than 256 entried in it */ + if (evas_hash_size(icon_map) > 256) + { + evas_hash_foreach(icon_map, _e_fm_mime_icon_foreach, &freelist); + while (freelist) + { + evas_stringshare_del(freelist->data); + freelist = evas_list_remove_list(freelist, freelist); + } + evas_hash_free(icon_map); + icon_map = NULL; + } + /* 0. look in mapping cache */ + val = evas_hash_find(icon_map, mime); + if (val) return val; + + strncpy(buf2, mime, sizeof(buf2) - 1); + buf2[sizeof(buf2) - 1] = 0; + val = strchr(buf2, '/'); + if (val) *val = 0; + + /* 1. look up in mapping to file or thumb (thumb has flag)*/ + for (l = e_config->mime_icons; l; l = l->next) + { + mi = l->data; + if (e_util_glob_match(mi->mime, mime)) + { + strncpy(buf, mi->icon, sizeof(buf) - 1); + buf[sizeof(buf) - 1] = 0; + goto ok; + } + } + + /* 2. look up in ~/.e/e/icons */ + homedir = e_user_homedir_get(); + if (!homedir) return NULL; + + snprintf(buf, sizeof(buf), "%s/.e/e/icons/%s.edj", homedir, mime); + if (ecore_file_exists(buf)) goto ok; + snprintf(buf, sizeof(buf), "%s/.e/e/icons/%s.svg", homedir, mime); + if (ecore_file_exists(buf)) goto ok; + snprintf(buf, sizeof(buf), "%s/.e/e/icons/%s.png", homedir, mime); + if (ecore_file_exists(buf)) goto ok; + snprintf(buf, sizeof(buf), "%s/.e/e/icons/%s.edj", homedir, buf2); + if (ecore_file_exists(buf)) goto ok; + snprintf(buf, sizeof(buf), "%s/.e/e/icons/%s.svg", homedir, buf2); + if (ecore_file_exists(buf)) goto ok; + snprintf(buf, sizeof(buf), "%s/.e/e/icons/%s.png", homedir, buf2); + if (ecore_file_exists(buf)) goto ok; + + /* 3. look up icon in theme */ + snprintf(buf, sizeof(buf), "e/icons/fileman/mime/%s", mime); + val = (char *)e_theme_edje_file_get("base/theme/fileman", buf); + if ((val) && (e_util_edje_collection_exists(val, buf))) goto ok; + snprintf(buf, sizeof(buf), "e/icons/fileman/mime/%s", buf2); + val = (char *)e_theme_edje_file_get("base/theme/fileman", buf); + if ((val) && (e_util_edje_collection_exists(val, buf))) goto ok; + + /* 4. look up icon in PREFIX/share/enlightent/data/icons */ + snprintf(buf, sizeof(buf), "%s/data/icons/%s.edj", e_prefix_data_get(), mime); + if (ecore_file_exists(buf)) goto ok; + snprintf(buf, sizeof(buf), "%s/data/icons/%s.svg", e_prefix_data_get(), mime); + if (ecore_file_exists(buf)) goto ok; + snprintf(buf, sizeof(buf), "%s/data/icons/%s.png", e_prefix_data_get(), mime); + if (ecore_file_exists(buf)) goto ok; + snprintf(buf, sizeof(buf), "%s/data/icons/%s.edj", e_prefix_data_get(), buf2); + if (ecore_file_exists(buf)) goto ok; + snprintf(buf, sizeof(buf), "%s/data/icons/%s.svg", e_prefix_data_get(), buf2); + if (ecore_file_exists(buf)) goto ok; + snprintf(buf, sizeof(buf), "%s/data/icons/%s.png", e_prefix_data_get(), buf2); + if (ecore_file_exists(buf)) goto ok; + + error: + if (homedir) free(homedir); + return NULL; + + ok: + val = (char *)evas_stringshare_add(buf); + icon_map = evas_hash_add(icon_map, mime, val); + if (homedir) free(homedir); + return val; + +} + /* local subsystem functions */ +static Evas_Bool +_e_fm_mime_icon_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata) +{ + Evas_List **freelist; + + freelist = fdata; + *freelist = evas_list_append(*freelist, data); + return 1; +} + static void _e_fm_mime_all_free(void) { @@ -93,7 +204,7 @@ _e_fm_mime_update(void) static time_t last_changed = 0; time_t ch; - snprintf(buf, sizeof(buf), "/usr/local/etc/mime.types"); + snprintf(buf, sizeof(buf), "/etc/mime.types"); ch = ecore_file_mod_time(buf); if ((ch != last_changed) || (reload)) { @@ -108,7 +219,7 @@ _e_fm_mime_update(void) static time_t last_changed = 0; time_t ch; - snprintf(buf, sizeof(buf), "/etc/mime.types"); + snprintf(buf, sizeof(buf), "/usr/local/etc/mime.types"); ch = ecore_file_mod_time(buf); if ((ch != last_changed) || (reload)) { @@ -272,7 +383,7 @@ _e_fm_mime_shared_mimeinfo_globs_load(char *file) */ FILE *f; - char buf[4096], buf2[4096], mimetype[4096], ext[4096], *p, *pp; + char buf[4096], mimetype[4096], ext[4096], *p, *pp; E_Mime *mime; f = fopen(file, "rb"); @@ -302,8 +413,7 @@ _e_fm_mime_shared_mimeinfo_globs_load(char *file) if (mime) { mime->mime = evas_stringshare_add(mimetype); - snprintf(buf2, sizeof(buf2), "*.%s", ext); - mime->glob = evas_stringshare_add(buf2); + mime->glob = evas_stringshare_add(ext); if ((!mime->mime) || (!mime->glob)) { if (mime->mime) evas_stringshare_del(mime->mime); @@ -312,7 +422,7 @@ _e_fm_mime_shared_mimeinfo_globs_load(char *file) } else { - _e_fm_mime_glob_remove(buf2); + _e_fm_mime_glob_remove(ext); mimes = evas_list_append(mimes, mime); } } diff --git a/src/bin/e_fm_mime.h b/src/bin/e_fm_mime.h index b9d547619..a28f3cd45 100644 --- a/src/bin/e_fm_mime.h +++ b/src/bin/e_fm_mime.h @@ -8,6 +8,7 @@ #define E_FM_MIME_H EAPI const char *e_fm_mime_filename_get(const char *fname); +EAPI const char *e_fm_mime_icon_get(const char *mime); #endif #endif