diff --git a/src/bin/tools/fprint/AUTHORS b/src/bin/tools/fprint/AUTHORS new file mode 100644 index 000000000..905be8dc8 --- /dev/null +++ b/src/bin/tools/fprint/AUTHORS @@ -0,0 +1,2 @@ +Simon "jf_simon" Tischer simon@t-tischer.de +Marcel "bu5hm4n" Hollerbach diff --git a/src/bin/tools/fprint/data/desktop/enlightenment_fprint.desktop b/src/bin/tools/fprint/data/desktop/enlightenment_fprint.desktop new file mode 100644 index 000000000..d992310ab --- /dev/null +++ b/src/bin/tools/fprint/data/desktop/enlightenment_fprint.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Name=Fingerprint Password Settings +Name[de]=Fingerprint Passwort Einstellungen +Icon=enlightenment_fprint +Exec=enlightenment_fprint +Comment=Tool to set up or modify fingerprint authentication +GenericName=GUI for Fingerprint Authentication +Categories=Settings;DesktopSettings; +StartupWMClass=enlightenment_fprint diff --git a/src/bin/tools/fprint/data/desktop/enlightenment_fprint.png b/src/bin/tools/fprint/data/desktop/enlightenment_fprint.png new file mode 100644 index 000000000..dbe7377e5 Binary files /dev/null and b/src/bin/tools/fprint/data/desktop/enlightenment_fprint.png differ diff --git a/src/bin/tools/fprint/data/desktop/meson.build b/src/bin/tools/fprint/data/desktop/meson.build new file mode 100644 index 000000000..6078f8314 --- /dev/null +++ b/src/bin/tools/fprint/data/desktop/meson.build @@ -0,0 +1,6 @@ +install_data('enlightenment_fprint.desktop', + install_dir: join_paths(dir_data, 'applications') + ) +install_data('enlightenment_fprint.png', + install_dir: join_paths(dir_data, 'icons/hicolor/128x128/apps') + ) diff --git a/src/bin/tools/fprint/data/desktop/orig/enlightenment_fprint.svg b/src/bin/tools/fprint/data/desktop/orig/enlightenment_fprint.svg new file mode 100644 index 000000000..e85537d21 --- /dev/null +++ b/src/bin/tools/fprint/data/desktop/orig/enlightenment_fprint.svg @@ -0,0 +1,204 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/meson.build b/src/bin/tools/fprint/data/meson.build new file mode 100644 index 000000000..4155fc3ef --- /dev/null +++ b/src/bin/tools/fprint/data/meson.build @@ -0,0 +1,2 @@ +subdir('desktop') +subdir('themes') diff --git a/src/bin/tools/fprint/data/themes/enlightenment_fprint.edc b/src/bin/tools/fprint/data/themes/enlightenment_fprint.edc new file mode 100644 index 000000000..ea7f9fb46 --- /dev/null +++ b/src/bin/tools/fprint/data/themes/enlightenment_fprint.edc @@ -0,0 +1,855 @@ +images { + image: "hands.png" COMP; + image: "left_hand.png" COMP; + image: "right_hand.png" COMP; +image: "fingerprint_icon-160.png" COMP; + set { name: "fingerprint_icon"; + image { image: "fingerprint_icon-160.png" COMP; size: 81 81 16000 16000; } + image { image: "fingerprint_icon-080.png" COMP; size: 41 41 80 80; } + image { image: "fingerprint_icon-040.png" COMP; size: 0 0 40 40; } + } +#define IM140(_name) \ + set { name: _name; \ + image { image: _name"-560.png" COMP; size: 281 281 16000 16000; } \ + image { image: _name"-280.png" COMP; size: 141 141 280 280; } \ + image { image: _name"-140.png" COMP; size: 0 0 140 140; } \ + } + IM140("1_0") + IM140("1_1") + IM140("1_1_failed") + IM140("1_2") + IM140("1_2_failed") + IM140("1_3") + IM140("1_3_failed") + IM140("1_4") + IM140("1_4_failed") + IM140("1_5") + IM140("1_5_failed") +} + +collections { + base_scale: 1.0; + group { "hands"; + parts { + // LEFT HAND + image { "hands"; + scale: 1; + desc { "default"; + min: 650 400; + max: 650 400; + image.normal: "hands.png"; + color_class: ":fg"; + } + } + image { "left-little-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "hands"; + rel1.relative: (35/609) (125/375); + rel2.relative: (35/609) (125/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_left-little-finger"; + desc { "default"; + rel.to: "left-little-finger"; + } + } + image { "left-ring-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "hands"; + rel1.relative: (92/609) (82/375); + rel2.relative: (92/609) (82/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_left-ring-finger"; + desc { "default"; + rel.to: "left-ring-finger"; + } + } + + image { "left-middle-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "hands"; + rel1.relative: (150/609) (51/375); + rel2.relative: (150/609) (51/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_left-middle-finger"; + desc { "default"; + rel.to: "left-middle-finger"; + } + } + + image { "left-index-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "hands"; + rel1.relative: (208/609) (75/375); + rel2.relative: (208/609) (75/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_left-index-finger"; + desc { "default"; + rel.to: "left-index-finger"; + } + } + + image { "left-thumb"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "hands"; + rel1.relative: (265/609) (209/375); + rel2.relative: (265/609) (209/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_left-thumb"; + desc { "default"; + rel.to: "left-thumb"; + } + } + + // RIGHT HAND + image { "right-little-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "hands"; + rel1.relative: (341/609) (209/375); + rel2.relative: (341/609) (209/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_right-little-finger"; + desc { "default"; + rel.to: "right-little-finger"; + } + } + image { "right-ring-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "hands"; + rel1.relative: (399/609) (75/375); + rel2.relative: (399/609) (75/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_right-ring-finger"; + desc { "default"; + rel.to: "right-ring-finger"; + } + } + + image { "right-middle-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "hands"; + rel1.relative: (458/609) (51/375); + rel2.relative: (458/609) (51/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_right-middle-finger"; + desc { "default"; + rel.to: "right-middle-finger"; + } + } + + image { "right-index-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "hands"; + rel1.relative: (515/609) (82/375); + rel2.relative: (515/609) (82/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_right-index-finger"; + desc { "default"; + rel.to: "right-index-finger"; + } + } + + image { "right-thumb"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "hands"; + rel1.relative: (572/609) (125/375); + rel2.relative: (572/609) (125/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_right-thumb"; + desc { "default"; + rel.to: "right-thumb"; + } + } + } + programs { + program { signal: "enrolled_finger"; source: "*"; + script { + set_state(get_part_id(src), "enrolled", 0.0); + } + } + program { signal: "reset_finger"; source: "reset_finger"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.2; + target: "left-little-finger"; + target: "left-ring-finger"; + target: "left-middle-finger"; + target: "left-index-finger"; + target: "left-thumb"; + target: "right-little-finger"; + target: "right-ring-finger"; + target: "right-middle-finger"; + target: "right-index-finger"; + target: "right-thumb"; + } + } + } + + group { "right_hand"; + parts { + image { "right_hand"; + scale: 1; + desc { "default"; + min: 650 400; + max: 650 400; + image.normal: "right_hand.png"; + color_class: ":fg"; + } + } + image { "right-little-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "right_hand"; + rel1.relative: (422/609) (125/375); + rel2.relative: (422/609) (125/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_right-little-finger"; + desc { "default"; + rel.to: "right-little-finger"; + } + } + + image { "right-ring-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "right_hand"; + rel1.relative: (365/609) (82/375); + rel2.relative: (365/609) (82/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_right-ring-finger"; + desc { "default"; + rel.to: "right-ring-finger"; + } + } + + image { "right-middle-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "right_hand"; + rel1.relative: (307/609) (51/375); + rel2.relative: (307/609) (51/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_right-middle-finger"; + desc { "default"; + rel.to: "right-middle-finger"; + } + } + + image { "right-index-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "right_hand"; + rel1.relative: (250/609) (75/375); + rel2.relative: (250/609) (75/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_right-index-finger"; + desc { "default"; + rel.to: "right-index-finger"; + } + } + + image { "right-thumb"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "right_hand"; + rel1.relative: (192/609) (209/375); + rel2.relative: (192/609) (209/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_right-thumb"; + desc { "default"; + rel.to: "right-thumb"; + } + } + + // LIST SWALLOW + swallow {"swallow_hand_switch"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + rel1.to_y: "right_hand"; + rel1.relative: 0.6 0.0; + } + } + } + programs { + program { signal: "enrolled_finger"; source: "*"; + script { + set_state(get_part_id(src), "enrolled", 0.0); + } + } + program { signal: "reset_finger"; source: "reset_finger"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.2; + target: "right-little-finger"; + target: "right-ring-finger"; + target: "right-middle-finger"; + target: "right-index-finger"; + target: "right-thumb"; + } + } + } + + group { "left_hand"; + parts { + image { "left_hand"; + scale: 1; + desc { "default"; + min: 650 400; + max: 650 400; + image.normal: "left_hand.png"; + color_class: ":fg"; + } + } + image { "left-little-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "left_hand"; + rel1.relative: (186/609) (125/375); + rel2.relative: (186/609) (125/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_left-little-finger"; + desc { "default"; + rel.to: "left-little-finger"; + } + } + + image { "left-ring-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "left_hand"; + rel1.relative: (243/609) (82/375); + rel2.relative: (243/609) (82/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_left-ring-finger"; + desc { "default"; + rel.to: "left-ring-finger"; + } + } + + image { "left-middle-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "left_hand"; + rel1.relative: (300/609) (51/375); + rel2.relative: (300/609) (51/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_left-middle-finger"; + desc { "default"; + rel.to: "left-middle-finger"; + } + } + + image { "left-index-finger"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "left_hand"; + rel1.relative: (358/609) (75/375); + rel2.relative: (358/609) (75/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_left-index-finger"; + desc { "default"; + rel.to: "left-index-finger"; + } + } + + image { "left-thumb"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + image.normal: "fingerprint_icon"; + rel.to: "left_hand"; + rel1.relative: (416/609) (209/375); + rel2.relative: (416/609) (209/375); + color_class: ":bg-light"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_left-thumb"; + desc { "default"; + rel.to: "left-thumb"; + } + } + + // LIST SWALLOW + swallow {"swallow_hand_switch"; + scale: 1; + desc { "default"; + min: 40 40; + max: 40 40; + rel1.to_y: "left_hand"; + rel1.relative: 0.6 0.0; + } + } + } + programs { + program { signal: "enrolled_finger"; source: "*"; + script { + set_state(get_part_id(src), "enrolled", 0.0); + } + } + program { signal: "reset_finger"; source: "reset_finger"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.2; + target: "left-little-finger"; + target: "left-ring-finger"; + target: "left-middle-finger"; + target: "left-index-finger"; + target: "left-thumb"; + } + } + } + + group { "finger"; + parts { + swallow {"swallow_select-finger-left"; + scale: 1; + desc { "default"; + align: 0 0.5; + min: 140 140; + max: 140 140; + } + } + image { "fingerprint_icon"; + scale: 1; + desc { "default"; + align: 0.0 0.0; + min: 200 200; + max: 200 200; + image.normal: "1_0"; + rel1.to_x: "swallow_select-finger-left"; + rel1.relative: 1.0 0.0; + color_class: ":fg"; + } + desc { "enrolled"; + inherit: "default"; + color_class: ":success"; + } + } + swallow {"swallow_select-finger"; + scale: 1; + desc { "default"; + align: 0.0 0.0; + min: 200 200; + max: 200 200; + rel1.to_x: "swallow_select-finger-left"; + rel1.relative: 1.0 0.0; + } + } + + swallow {"swallow_select-finger-right"; + scale: 1; + desc { "default"; + align: 1.0 0.5; + min: 140 140; + max: 140 140; + rel1.to_x: "fingerprint_icon"; + rel1.relative: 1.0 0.0; + } + } + } + programs { + program { signal: "enrolled_finger"; source: "enrolled_finger"; + script { + set_state(get_part_id("fingerprint_icon"), "enrolled", 0.0); + } + } + program { signal: "not_enrolled_finger"; source: "not_enrolled_finger"; + script { + set_state(get_part_id("fingerprint_icon"), "default", 0.0); + } + } + } + } + + group { "enroll"; + parts { + image { "0"; + scale: 1; + desc { "default"; + min: 140 140; + max: 140 140; + image.normal: "1_0"; + color_class: ":fg"; + } + desc { "failed"; + inherit: "default"; + color_class: ":success"; + } + } + image { "1"; + scale: 1; + desc { "default"; + min: 140 140; + max: 140 140; + visible: 0; + image.normal: "1_1"; + color_class: ":fg"; + } + desc { "success"; + inherit: "default"; + visible: 1; + color_class: ":success"; + } + desc { "failed"; + inherit: "default"; + visible: 1; + image.normal: "1_1_failed"; + color_class: ":selected-alt"; + } + } + image { "2"; + scale: 1; + desc { "default"; + min: 140 140; + max: 140 140; + visible: 0; + image.normal: "1_2"; + color_class: ":fg"; + } + desc { "success"; + inherit: "default"; + visible: 1; + color_class: ":success"; + } + desc { "failed"; + inherit: "default"; + visible: 1; + image.normal: "1_2_failed"; + color_class: ":selected-alt"; + } + } + image { "3"; + scale: 1; + desc { "default"; + min: 140 140; + max: 140 140; + visible: 0; + image.normal: "1_3"; + color_class: ":fg"; + } + desc { "success"; + inherit: "default"; + visible: 1; + color_class: ":success"; + } + desc { "failed"; + inherit: "default"; + visible: 1; + image.normal: "1_3_failed"; + color_class: ":selected-alt"; + } + } + image { "4"; + scale: 1; + desc { "default"; + min: 140 140; + max: 140 140; + visible: 0; + image.normal: "1_4"; + color_class: ":fg"; + } + desc { "success"; + inherit: "default"; + visible: 1; + color_class: ":success"; + } + desc { "failed"; + inherit: "default"; + visible: 1; + image.normal: "1_4_failed"; + color_class: ":selected-alt"; + } + } + image { "5"; + scale: 1; + desc { "default"; + min: 140 140; + max: 140 140; + visible: 0; + image.normal: "1_5"; + color_class: ":fg"; + } + desc { "success"; + inherit: "default"; + visible: 1; + color_class: ":success"; + } + desc { "failed"; + inherit: "default"; + visible: 1; + image.normal: "1_5_failed"; + color_class: ":selected-alt"; + } + } + } + programs { + program { signal: "success"; source: "*"; + script { + set_state(get_part_id(src), "success", 0.0); + } + } + program { signal: "failed"; source: "*"; + script { + set_state(get_part_id(src), "failed", 0.0); + } + } + program { signal: "enrolled__failed"; source: "enrolled__failed"; + action: STATE_SET "failed" 0.0; + transition: LINEAR 0.2; + target: "0"; + } + program { signal: "enrolled__failed"; source: "enrolled__failed"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.2; + target: "1"; + target: "2"; + target: "3"; + target: "4"; + target: "5"; + } + } + } + + group { "verify"; + parts { + image { "0"; + scale: 1; + desc { "default"; + min: 140 140; + max: 140 140; + image.normal: "1_0"; + color_class: ":fg"; + } + desc { "success"; + inherit: "default"; + color_class: ":success"; + } + desc { "failed"; + inherit: "default"; + color_class: ":selected-alt"; + } + } + } + programs { + program { signal: "success"; source: "success"; + action: STATE_SET "success" 0.0; + transition: LINEAR 0.2; + target: "0"; + after: "reset1"; + } + program { name: "reset1"; + action: STATE_SET "default" 0.0; + transition: ACCEL 4.0; + target: "0"; + } + program { signal: "failed"; source: "failed"; + transition: LINEAR 0.2; + action: STATE_SET "failed" 0.0; + target: "0"; + after: "reset"; + } + program { name: "reset"; + action: STATE_SET "default" 0.0; + transition: ACCEL 2.0; + target: "0"; + } + } + } + + group { "icon"; + parts { + image { "0"; + scale: 1; + desc { "default"; + image.normal: "1_0"; + color_class: ":success"; + } + } + } + } + +} diff --git a/src/bin/tools/fprint/data/themes/images/1_0-140.png b/src/bin/tools/fprint/data/themes/images/1_0-140.png new file mode 100644 index 000000000..1197f2db5 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_0-140.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_0-280.png b/src/bin/tools/fprint/data/themes/images/1_0-280.png new file mode 100644 index 000000000..7b0b7c98f Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_0-280.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_0-560.png b/src/bin/tools/fprint/data/themes/images/1_0-560.png new file mode 100644 index 000000000..9f79a4e18 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_0-560.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_1-140.png b/src/bin/tools/fprint/data/themes/images/1_1-140.png new file mode 100644 index 000000000..71a0e1de9 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_1-140.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_1-280.png b/src/bin/tools/fprint/data/themes/images/1_1-280.png new file mode 100644 index 000000000..9d6d832ad Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_1-280.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_1-560.png b/src/bin/tools/fprint/data/themes/images/1_1-560.png new file mode 100644 index 000000000..e149196f6 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_1-560.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_1_failed-140.png b/src/bin/tools/fprint/data/themes/images/1_1_failed-140.png new file mode 100644 index 000000000..6a0b86f0d Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_1_failed-140.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_1_failed-280.png b/src/bin/tools/fprint/data/themes/images/1_1_failed-280.png new file mode 100644 index 000000000..175c6a9ca Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_1_failed-280.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_1_failed-560.png b/src/bin/tools/fprint/data/themes/images/1_1_failed-560.png new file mode 100644 index 000000000..d12cfbf66 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_1_failed-560.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_2-140.png b/src/bin/tools/fprint/data/themes/images/1_2-140.png new file mode 100644 index 000000000..91fd1c998 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_2-140.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_2-280.png b/src/bin/tools/fprint/data/themes/images/1_2-280.png new file mode 100644 index 000000000..fd6ec1ff8 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_2-280.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_2-560.png b/src/bin/tools/fprint/data/themes/images/1_2-560.png new file mode 100644 index 000000000..78fbe414d Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_2-560.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_2_failed-140.png b/src/bin/tools/fprint/data/themes/images/1_2_failed-140.png new file mode 100644 index 000000000..e0deefc5a Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_2_failed-140.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_2_failed-280.png b/src/bin/tools/fprint/data/themes/images/1_2_failed-280.png new file mode 100644 index 000000000..185bb655c Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_2_failed-280.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_2_failed-560.png b/src/bin/tools/fprint/data/themes/images/1_2_failed-560.png new file mode 100644 index 000000000..882bb035e Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_2_failed-560.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_3-140.png b/src/bin/tools/fprint/data/themes/images/1_3-140.png new file mode 100644 index 000000000..2d6909eb3 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_3-140.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_3-280.png b/src/bin/tools/fprint/data/themes/images/1_3-280.png new file mode 100644 index 000000000..e0c33f6d7 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_3-280.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_3-560.png b/src/bin/tools/fprint/data/themes/images/1_3-560.png new file mode 100644 index 000000000..2c0da69f7 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_3-560.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_3_failed-140.png b/src/bin/tools/fprint/data/themes/images/1_3_failed-140.png new file mode 100644 index 000000000..c4395e0df Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_3_failed-140.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_3_failed-280.png b/src/bin/tools/fprint/data/themes/images/1_3_failed-280.png new file mode 100644 index 000000000..9fd0c59d9 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_3_failed-280.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_3_failed-560.png b/src/bin/tools/fprint/data/themes/images/1_3_failed-560.png new file mode 100644 index 000000000..837ae95b5 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_3_failed-560.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_4-140.png b/src/bin/tools/fprint/data/themes/images/1_4-140.png new file mode 100644 index 000000000..3206e2e3b Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_4-140.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_4-280.png b/src/bin/tools/fprint/data/themes/images/1_4-280.png new file mode 100644 index 000000000..32deb92f3 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_4-280.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_4-560.png b/src/bin/tools/fprint/data/themes/images/1_4-560.png new file mode 100644 index 000000000..f61e69e58 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_4-560.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_4_failed-140.png b/src/bin/tools/fprint/data/themes/images/1_4_failed-140.png new file mode 100644 index 000000000..efa20ef85 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_4_failed-140.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_4_failed-280.png b/src/bin/tools/fprint/data/themes/images/1_4_failed-280.png new file mode 100644 index 000000000..279f99628 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_4_failed-280.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_4_failed-560.png b/src/bin/tools/fprint/data/themes/images/1_4_failed-560.png new file mode 100644 index 000000000..e797223db Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_4_failed-560.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_5-140.png b/src/bin/tools/fprint/data/themes/images/1_5-140.png new file mode 100644 index 000000000..5052de5c0 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_5-140.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_5-280.png b/src/bin/tools/fprint/data/themes/images/1_5-280.png new file mode 100644 index 000000000..22f02ad47 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_5-280.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_5-560.png b/src/bin/tools/fprint/data/themes/images/1_5-560.png new file mode 100644 index 000000000..1256f776b Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_5-560.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_5_failed-140.png b/src/bin/tools/fprint/data/themes/images/1_5_failed-140.png new file mode 100644 index 000000000..61f912a53 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_5_failed-140.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_5_failed-280.png b/src/bin/tools/fprint/data/themes/images/1_5_failed-280.png new file mode 100644 index 000000000..e28bfd528 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_5_failed-280.png differ diff --git a/src/bin/tools/fprint/data/themes/images/1_5_failed-560.png b/src/bin/tools/fprint/data/themes/images/1_5_failed-560.png new file mode 100644 index 000000000..6fcce5ee5 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/1_5_failed-560.png differ diff --git a/src/bin/tools/fprint/data/themes/images/fingerprint_icon-040.png b/src/bin/tools/fprint/data/themes/images/fingerprint_icon-040.png new file mode 100644 index 000000000..0a297585c Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/fingerprint_icon-040.png differ diff --git a/src/bin/tools/fprint/data/themes/images/fingerprint_icon-080.png b/src/bin/tools/fprint/data/themes/images/fingerprint_icon-080.png new file mode 100644 index 000000000..919889995 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/fingerprint_icon-080.png differ diff --git a/src/bin/tools/fprint/data/themes/images/fingerprint_icon-160.png b/src/bin/tools/fprint/data/themes/images/fingerprint_icon-160.png new file mode 100644 index 000000000..8ec961295 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/fingerprint_icon-160.png differ diff --git a/src/bin/tools/fprint/data/themes/images/hands.png b/src/bin/tools/fprint/data/themes/images/hands.png new file mode 100644 index 000000000..682a46b99 Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/hands.png differ diff --git a/src/bin/tools/fprint/data/themes/images/left_hand.png b/src/bin/tools/fprint/data/themes/images/left_hand.png new file mode 100644 index 000000000..3e319c69e Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/left_hand.png differ diff --git a/src/bin/tools/fprint/data/themes/images/orig/1_0.svg b/src/bin/tools/fprint/data/themes/images/orig/1_0.svg new file mode 100644 index 000000000..fa35c2471 --- /dev/null +++ b/src/bin/tools/fprint/data/themes/images/orig/1_0.svg @@ -0,0 +1,204 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/themes/images/orig/1_1.svg b/src/bin/tools/fprint/data/themes/images/orig/1_1.svg new file mode 100644 index 000000000..797a7e754 --- /dev/null +++ b/src/bin/tools/fprint/data/themes/images/orig/1_1.svg @@ -0,0 +1,120 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/themes/images/orig/1_1_failed.svg b/src/bin/tools/fprint/data/themes/images/orig/1_1_failed.svg new file mode 100644 index 000000000..c2a262f5f --- /dev/null +++ b/src/bin/tools/fprint/data/themes/images/orig/1_1_failed.svg @@ -0,0 +1,107 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/themes/images/orig/1_2.svg b/src/bin/tools/fprint/data/themes/images/orig/1_2.svg new file mode 100644 index 000000000..937e65bff --- /dev/null +++ b/src/bin/tools/fprint/data/themes/images/orig/1_2.svg @@ -0,0 +1,146 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/themes/images/orig/1_2_failed.svg b/src/bin/tools/fprint/data/themes/images/orig/1_2_failed.svg new file mode 100644 index 000000000..4340f9945 --- /dev/null +++ b/src/bin/tools/fprint/data/themes/images/orig/1_2_failed.svg @@ -0,0 +1,107 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/themes/images/orig/1_3.svg b/src/bin/tools/fprint/data/themes/images/orig/1_3.svg new file mode 100644 index 000000000..e229d7b54 --- /dev/null +++ b/src/bin/tools/fprint/data/themes/images/orig/1_3.svg @@ -0,0 +1,172 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/themes/images/orig/1_3_failed.svg b/src/bin/tools/fprint/data/themes/images/orig/1_3_failed.svg new file mode 100644 index 000000000..fde1e5958 --- /dev/null +++ b/src/bin/tools/fprint/data/themes/images/orig/1_3_failed.svg @@ -0,0 +1,107 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/themes/images/orig/1_4.svg b/src/bin/tools/fprint/data/themes/images/orig/1_4.svg new file mode 100644 index 000000000..e3d764c59 --- /dev/null +++ b/src/bin/tools/fprint/data/themes/images/orig/1_4.svg @@ -0,0 +1,198 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/themes/images/orig/1_4_failed.svg b/src/bin/tools/fprint/data/themes/images/orig/1_4_failed.svg new file mode 100644 index 000000000..bb8acbe49 --- /dev/null +++ b/src/bin/tools/fprint/data/themes/images/orig/1_4_failed.svg @@ -0,0 +1,107 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/themes/images/orig/1_5.svg b/src/bin/tools/fprint/data/themes/images/orig/1_5.svg new file mode 100644 index 000000000..0b8e3dc21 --- /dev/null +++ b/src/bin/tools/fprint/data/themes/images/orig/1_5.svg @@ -0,0 +1,204 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/themes/images/orig/1_5_failed.svg b/src/bin/tools/fprint/data/themes/images/orig/1_5_failed.svg new file mode 100644 index 000000000..d040cc94f --- /dev/null +++ b/src/bin/tools/fprint/data/themes/images/orig/1_5_failed.svg @@ -0,0 +1,87 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/themes/images/orig/fingerprint_icon.svg b/src/bin/tools/fprint/data/themes/images/orig/fingerprint_icon.svg new file mode 100644 index 000000000..c23d743df --- /dev/null +++ b/src/bin/tools/fprint/data/themes/images/orig/fingerprint_icon.svg @@ -0,0 +1,204 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/bin/tools/fprint/data/themes/images/right_hand.png b/src/bin/tools/fprint/data/themes/images/right_hand.png new file mode 100644 index 000000000..d2353958e Binary files /dev/null and b/src/bin/tools/fprint/data/themes/images/right_hand.png differ diff --git a/src/bin/tools/fprint/data/themes/meson.build b/src/bin/tools/fprint/data/themes/meson.build new file mode 100644 index 000000000..334d52bcc --- /dev/null +++ b/src/bin/tools/fprint/data/themes/meson.build @@ -0,0 +1,12 @@ +cmd = [ edje_cmd, + '-id', join_paths(meson.current_source_dir(), 'images'), + '@INPUT@', '@OUTPUT@' + ] +src = 'enlightenment_fprint' +custom_target(src + '.edj', + input : src + '.edc', + output : src + '.edj', + command : cmd, + install_dir: join_paths(dir_data, proj, 'themes'), + install : true + ) diff --git a/src/bin/tools/fprint/meson.build b/src/bin/tools/fprint/meson.build new file mode 100644 index 000000000..27a3b2840 --- /dev/null +++ b/src/bin/tools/fprint/meson.build @@ -0,0 +1,112 @@ +##### project +#project('e-fprint-gui', 'c', +# version : '0.1', + # license : 'BSD 2 clause', +# default_options: [ 'c_std=gnu99' ], +# meson_version : '>= 0.40.0') +#base_url = 'https://github.com/jf-simon/e-fprint-gui' + +##### convenience variables for later +proj = meson.project_name() +ver = meson.project_version() +cfg = configuration_data() + +##### dependencies +efl_version = '>= 1.19.0' +elm = dependency('elementary', required: true, version: efl_version) +edje = dependency('edje', required: true, version: efl_version) +ecore = dependency('ecore', required: true, version: efl_version) +ecorex = dependency('ecore-x', required: true, version: efl_version) +depe = dependency('enlightenment', required: false) +#curl_dep = dependency('libcurl', version : '>= 7.35.0', required: true) + +##### check for windows dependency +#if build_machine.system() == 'windows' +# win = dependency('evil', version: efl_version) +#endif + +##### dir locations +#dir_prefix = get_option('prefix') +#dir_bin = join_paths(dir_prefix, get_option('bindir')) +#dir_lib = join_paths(dir_prefix, get_option('libdir')) +#dir_data = join_paths(dir_prefix, get_option('datadir')) +#dir_locale = join_paths(dir_prefix, get_option('localedir')) + +##### config.h +#cfg.set_quoted('PACKAGE' , proj) +#cfg.set_quoted('PACKAGE_NAME' , proj) +#cfg.set_quoted('PACKAGE_VERSION' , ver) +#cfg.set_quoted('PACKAGE_STRING' , proj + ' ' + ver) +#cfg.set_quoted('PACKAGE_URL' , base_url + proj) +#cfg.set_quoted('PACKAGE_BIN_DIR' , dir_bin) +#cfg.set_quoted('PACKAGE_LIB_DIR' , dir_lib) +#cfg.set_quoted('BINDIR' , dir_bin) +#cfg.set_quoted('DATADIR' , dir_data) +#cfg.set_quoted('PACKAGE_DATA_DIR' , join_paths(dir_data, proj)) +#cfg.set_quoted('LOCALEDIR' , dir_locale) + +#add_global_arguments('-DPACKAGE_BIN_DIR="@0@"'.format(dir_bin), language: 'c') +#add_global_arguments('-DPACKAGE_LIB_DIR="@0@"'.format(dir_lib), language: 'c') +#add_global_arguments('-DPACKAGE_DATA_DIR="@0@"'.format(join_paths(dir_data, proj)), language: 'c') + +##### get C compiler +#cc = meson.get_compiler('c') + +##### get edje command +#edje_cmd = join_paths(edje.get_pkgconfig_variable('prefix'), +# 'bin', 'edje_cc') + +##### Check for windows +#if build_machine.system() == 'windows' +# cfg.set ('_WIN32' , 1) +#endif +##### Check for arpa/inet and netinet/in.h +#if cc.has_header('arpa/inet.h') == true +# cfg.set ('HAVE_ARPA_INET_H' , 1) +#endif +#if cc.has_header('netinet/in.h') == true +# cfg.set ('HAVE_NETINET_IN_H' , 1) +#endif +#if exif.found() == true +# cfg.set ('HAVE_LIBEXIF' , 1) +#endif +#if depe.found() == true +# build_gadget = true +# cfg.set ('HAVE_E' , 1) +#endif +###### translations +#use_translations = false +#depnls = [] +#intl_lib = cc.find_library('intl', required: false) +#if intl_lib.found() +# cfg.set('HAVE_GETTEXT', 1) +# cfg.set('ENABLE_NLS', 1) +# depnls = [intl_lib] +# use_translations = true +#else +# gettext_code = ''' +# #include +# int main(int argc, char *argv[]) { +# (void)ngettext("", "", 0); +# return 0; +# } +# ''' +# if cc.links(gettext_code) +# cfg.set('HAVE_GETTEXT', 1) +# cfg.set('ENABLE_NLS', 1) +# use_translations = true +# endif +#endif +#configure_file(output: 'config.h', configuration: cfg) + +#install_data('AUTHORS', +# install_dir: join_paths(dir_data, 'e-fprint-gui')) + +#if use_translations +# subdir('po') +#endif + +eldbus_codegen = find_program('eldbus-codegen') + +subdir('src') +subdir('data') diff --git a/src/bin/tools/fprint/src/device.xml b/src/bin/tools/fprint/src/device.xml new file mode 100644 index 000000000..ebb4647a5 --- /dev/null +++ b/src/bin/tools/fprint/src/device.xml @@ -0,0 +1,644 @@ + + + + + + + + + +]> + + + + + + PolicyKit integration + + + fprintd uses PolicyKit to check whether users are allowed to access fingerprint data, or the + fingerprint readers itself. + + + net.reactivated.fprint.device.verify + + Whether the user is allowed to verify fingers against saved fingerprints. + + + + net.reactivated.fprint.device.enroll + + Whether the user is allowed to enroll new fingerprints. + + + + net.reactivated.fprint.device.setusername + + Whether the user is allowed to query, verify, or enroll fingerprints for users other than itself. + + + + + + + Usernames + + + When a username argument is used for a method, a PolicyKit check is done on the + net.reactivated.fprint.device.setusername PolicyKit + action to see whether the user the client is running as is allowed to access data from other users. + + + By default, only root is allowed to access fingerprint data for users other than itself. For a normal user, + it is recommended that you use an empty string for the username, which will mean "the client the user is + running as". + + + See PolicyKit integration. + + + + Fingerprint names + + + When a finger name argument is used for a method, it refers to either a single finger, or + "any" finger. See the list of possible values below: + + + left-thumb + + Left thumb + + + + left-index-finger + + Left index finger + + + + left-middle-finger + + Left middle finger + + + + left-ring-finger + + Left ring finger + + + + left-little-finger + + Left little finger + + + + right-thumb + + Right thumb + + + + right-index-finger + + Right index finger + + + + right-middle-finger + + Right middle finger + + + + right-ring-finger + + Right ring finger + + + + right-little-finger + + Right little finger + + + + any + + Any finger. This is only used for Device.VerifyStart + (select the first finger with a fingerprint associated, or all the fingerprints available for the user when + the device supports it) and Device::VerifyFingerSelected + (any finger with an associated fingerprint can be used). + + + + + + + Verify Statuses + + + + Possible values for the result passed through Device::VerifyResult are: + + verify-no-match + + The verification did not match, Device.VerifyStop should now be called. + + + + verify-match + + The verification succeeded, Device.VerifyStop should now be called. + + + + verify-retry-scan + + The user should retry scanning their finger, the verification is still ongoing. + + + + verify-swipe-too-short + + The user's swipe was too short. The user should retry scanning their finger, the verification is still ongoing. + + + + verify-finger-not-centered + + The user's finger was not centered on the reader. The user should retry scanning their finger, the verification is still ongoing. + + + + verify-remove-and-retry + + The user should remove their finger from the reader and retry scanning their finger, the verification is still ongoing. + + + + verify-disconnected + + The device was disconnected during the verification, no other actions should be taken, and you shouldn't use the device any more. + + + + verify-unknown-error + + An unknown error occurred (usually a driver problem), Device.VerifyStop should now be called. + + + + + + + Enroll Statuses + + + + Possible values for the result passed through Device::EnrollResult are: + + enroll-completed + + The enrollment successfully completed, Device.EnrollStop should now be called. + + + + enroll-failed + + The enrollment failed, Device.EnrollStop should now be called. + + + + enroll-stage-passed + + One stage of the enrollment passed, the enrollment is still ongoing. + + + + enroll-retry-scan + + The user should retry scanning their finger, the enrollment is still ongoing. + + + + enroll-swipe-too-short + + The user's swipe was too short. The user should retry scanning their finger, the enrollment is still ongoing. + + + + enroll-finger-not-centered + + The user's finger was not centered on the reader. The user should retry scanning their finger, the enrollment is still ongoing. + + + + enroll-remove-and-retry + + The user should remove their finger from the reader and retry scanning their finger, the enrollment is still ongoing. + + + + enroll-data-full + + No further prints can be enrolled on this device, Device.EnrollStop should now be called. + + Delete other prints from the device first to continue + (e.g. from other users). Note that old prints or prints from other operating systems may be deleted automatically + to resolve this error without any notification. + + + + enroll-duplicate + + The print has already been enrolled, Device.EnrollStop should now be called. + + The user should enroll a different finger, or delete the print that has been enrolled already. + This print may be enrolled for a different user. + Note that an old duplicate (e.g. from a previous install) will be automatically garbage collected and should not cause any issues. + + + + enroll-disconnected + + The device was disconnected during the enrollment, no other actions should be taken, and you shouldn't use the device any more. + + + + + enroll-unknown-error + + An unknown error occurred (usually a driver problem), Device.EnrollStop should now be called. + + + + + + + + + + + + The username for whom to list the enrolled fingerprints. See Usernames. + + + An array of strings representing the enrolled fingerprints. See Fingerprint names. + + + + + List all the enrolled fingerprints for the chosen user. + + + + + if the caller lacks the appropriate PolicyKit authorization + if the chosen user doesn't have any fingerprints enrolled + + + + + + + + + The username for whom to delete the enrolled fingerprints. See Usernames. + + + + + Delete all the enrolled fingerprints for the chosen user. + + + This call only exists for compatibility reasons, you should instead claim the device using + Device.Claim and then call + DeleteEnrolledFingers2 or + DeleteEnrolledFinger. + + + + + if the caller lacks the appropriate PolicyKit authorization + if the fingerprint is not deleted from fprintd storage + + + + + + + + + + + Delete all the enrolled fingerprints for the user currently claiming the device with Device.Claim. + + + + + if the caller lacks the appropriate PolicyKit authorization + if the fingerprint is not deleted from fprintd storage + + + + + + + + + + A string representing the finger to delete. See + Fingerprint names. + Note that "any" is not a valid finger name for this method. + + + + + + Delete the enrolled fingerprint for the user currently claiming the device with Device.Claim. + + + + + if the caller lacks the appropriate PolicyKit authorization + if the device was not claimed + if the finger name passed is invalid + if the chosen user doesn't have the requsted fingerprint enrolled + if the fingerprint is not deleted from fprintd storage + + + + + + + + + The username for whom to claim the device. See Usernames. + + + + + Claim the device for the chosen user. + + + + + if the caller lacks the appropriate PolicyKit authorization + if the device is already claimed + if the device couldn't be claimed + + + + + + + + + + + Release a device claimed with Device.Claim. + + + + + if the caller lacks the appropriate PolicyKit authorization + if the device was not claimed + + + + + + + + + A string representing the finger to verify. See Fingerprint names. + + + + + Check the chosen finger against a saved fingerprint. You need to have claimed the device using + Device.Claim. The finger selected is sent to the front-end + using Device::VerifyFingerSelected and + verification status through Device::VerifyStatus. + + + + + if the caller lacks the appropriate PolicyKit authorization + if the device was not claimed + if the device was already being used + if there are no enrolled prints for the chosen user + if there was an internal error + + + + + + + + + + + Stop an on-going fingerprint verification started with Device.VerifyStart. + + + + + if the caller lacks the appropriate PolicyKit authorization + if the device was not claimed + if there was no ongoing verification + if there was an internal error + + + + + + + + + + + + A string representing the finger select to be verified. + + + + + + + Fingerprint names. + + + + + + + + + + + A string representing the status of the verification. + + + + + + + + Whether the verification finished and can be stopped. + + + + + + + Verify Statuses and Device.VerifyStop. + + + + + + + + + A string representing the finger to enroll. See + Fingerprint names. + Note that "any" is not a valid finger name for this method. + + + + + Start enrollment for the selected finger. You need to have claimed the device using + Device.Claim before calling + this method. Enrollment status is sent through Device::EnrollStatus. + + + + + if the caller lacks the appropriate PolicyKit authorization + if the device was not claimed + if the device was already being used + if the finger name passed is invalid + if the finger has been already enrolled by the user + if there was an internal error + + + + + + + + + + + + Stop an on-going fingerprint enrollment started with Device.EnrollStart. + + + + + if the caller lacks the appropriate PolicyKit authorization + if the device was not claimed + if there was no ongoing verification + if there was an internal error + + + + + + + + + + + A string representing the status of the enrollment. + + + + + + + + Whether the enrollment finished and can be stopped. + + + + + + + Enrollment Statuses and Device.EnrollStop. + + + + + + + + + + + The product name of the device. + + + + + + + + + + + + The number of enrollment stages for the device. This is only available when the device has been claimed, otherwise it will be undefined (-1). + + + Device.Claim and Device.EnrollStart. + + + + + + + + + + + + The scan type of the device, either "press" if you place your finger on the device, or "swipe" if you have to swipe your finger. + + + + + + + + + + + + Whether the finger is on sensor. + + + + + + + + + + + + Whether the sensor is waiting for the finger. + + + + + + + diff --git a/src/bin/tools/fprint/src/enlightenment_fprint.c b/src/bin/tools/fprint/src/enlightenment_fprint.c new file mode 100644 index 000000000..806c8fccf --- /dev/null +++ b/src/bin/tools/fprint/src/enlightenment_fprint.c @@ -0,0 +1,1312 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" + +#endif + +/* NOTE: Respecting header order is important for portability. + * Always put system first, then EFL, then your public header, + * and finally your private one. */ + +#include +#include +#include +#include "eldbus_fprint_device.h" +#include "eldbus_fprint_manager.h" + +Eldbus_Connection *conn; +Eldbus_Proxy *new_proxy; +Eldbus_Proxy *new_proxy1; +Eldbus_Pending *p; +Eldbus_Pending *p1; + +Evas_Object *ly; +Evas_Object *ly_popup; +Evas_Object *win; +Evas_Object *lb_status; + +const char *default_device = NULL; +const char *device_type = NULL; +const char *currentuser; +const char *currentfinger; +double enroll_count = 0.0; +int enroll_num; +int step = 1; +double enroll_count_value; + +Eina_Value array; + +static void enrolled_fingers_cb(Eldbus_Proxy *proxy, void *data, Eldbus_Pending *pending, Eldbus_Error_Info *error, Eina_Value *args); +static void _update_theme(void); +static void claim_device(Eldbus_Proxy *proxy, void *data, Eldbus_Pending *pending, Eldbus_Error_Info *error); +static void _enroll_stopp_cb(Eldbus_Proxy *proxy, void *data, Eldbus_Pending *pending, Eldbus_Error_Info *error); +static void _verify_stopp_cb(Eldbus_Proxy *proxy, void *data, Eldbus_Pending *pending, Eldbus_Error_Info *error); + +const char* +_to_readable_fingername(void *data) +{ + const char *name; + Eina_Strbuf *buffer = eina_strbuf_new(); + + eina_strbuf_append(buffer, data); + eina_strbuf_replace_all(buffer, "-", " "); + eina_strbuf_replace(buffer, "right", "Right", 1); + eina_strbuf_replace(buffer, "left", "Left", 1); + name = eina_strbuf_string_get(buffer); + + return name; +} + +const char* +_to_fprint_fingername(const char *data) +{ + const char *name; + Eina_Strbuf *buffer = eina_strbuf_new(); + + eina_strbuf_append(buffer, data); + eina_strbuf_replace_all(buffer, " ", "-"); + eina_strbuf_replace(buffer, "Right", "right", 1); + eina_strbuf_replace(buffer, "Left", "left", 1); + name = eina_strbuf_string_get(buffer); + + return name; +} + +static void +_close_verify_popup(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + fprint_device_enroll_stop_call(new_proxy1, _verify_stopp_cb, NULL); + + if (data) evas_object_del(data); + + edje_object_signal_emit(ly, "reset_finger", "reset_finger"); // for GROUP hands/left_hand/right/hand + edje_object_signal_emit(ly, "not_enrolled_finger", "not_enrolled_finger"); // for GROUP finger + fprint_device_list_enrolled_fingers_call(new_proxy1, enrolled_fingers_cb, NULL, currentuser); + _update_theme(); +} + +static void +_close_enroll_popup(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + fprint_device_enroll_stop_call(new_proxy1, _enroll_stopp_cb, NULL); + + if (data) + { + evas_object_del(data); + data = NULL; + } + + edje_object_signal_emit(ly, "reset_finger", "reset_finger"); // for GROUP hands/left_hand/right/hand + edje_object_signal_emit(ly, "not_enrolled_finger", "not_enrolled_finger"); // for GROUP finger + // enrolled__failed + fprint_device_list_enrolled_fingers_call(new_proxy1, enrolled_fingers_cb, NULL, currentuser); + _update_theme(); +} + +static void +_dismiss_hover(void *data, Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Evas_Object *hv = data; + elm_hover_dismiss(hv); +} + +static void +_enroll_prop_get(void *data EINA_UNUSED, Eldbus_Pending *pending EINA_UNUSED, const char *propname EINA_UNUSED, Eldbus_Proxy *proxy EINA_UNUSED, Eldbus_Error_Info *error_info, int value) +{ + if (error_info) + { + printf("MESSAGE _enroll_prop_get: %s\n", error_info->message); + printf("ERROR _enroll_prop_get: %s\n", error_info->error); + //TODO: display the error + } + else + { + enroll_num = value; + enroll_count_value = 10 / (double)enroll_num; + } +} + +static void +_verify_start_cb(Eldbus_Proxy *proxy EINA_UNUSED, void *data, Eldbus_Pending *pending EINA_UNUSED, Eldbus_Error_Info *error) +{ + Evas_Object *popup; + + if (error) + { + printf("MESSAGE _verify_start_cb: %s\n", error->message); + printf("ERROR _verify_start_cb: %s\n", error->error); + //TODO: display the error + popup = data; + evas_object_del(popup); + popup = NULL; + } +} + +static void +_enroll_start_cb(Eldbus_Proxy *proxy EINA_UNUSED, void *data, Eldbus_Pending *pending EINA_UNUSED, Eldbus_Error_Info *error) +{ + Evas_Object *popup = data; + + if (error) + { + printf("MESSAGE _enroll_start_cb: %s\n", error->message); + printf("ERROR _enroll_start_cb: %s\n", error->error); + //TODO: display the error + if (popup) evas_object_del(popup); + popup = NULL; + } +} + +static void +_popup_verify_cb(void *data, Evas_Object *obj EINA_UNUSED) +{ + Evas_Object *popup, *box, *lb, *sep, *button; + char buf[PATH_MAX]; + char buf1[PATH_MAX]; + const char *fingername; + + fingername = _to_readable_fingername(data); + + popup = elm_popup_add(win); + elm_popup_scrollable_set(popup, EINA_FALSE); + + box = elm_box_add(popup); + evas_object_show(box); + + lb = elm_label_add(box); + elm_object_text_set(lb, "Verify:"); + evas_object_show(lb); + elm_box_pack_end(box, lb); + + snprintf(buf, sizeof(buf), "%s", fingername); + + lb = elm_label_add(box); + elm_object_text_set(lb, buf); + evas_object_show(lb); + elm_box_pack_end(box, lb); + + ly_popup = elm_layout_add(box); + snprintf(buf, sizeof(buf), "%s/themes/enlightenment_fprint.edj", elm_app_data_dir_get()); + elm_layout_file_set(ly_popup, buf, "verify"); + evas_object_size_hint_weight_set(ly_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(ly_popup, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(ly_popup); + elm_box_pack_end(box, ly_popup); + + snprintf(buf1, sizeof(buf1), "please %s on device", device_type); + lb = elm_label_add(box); + elm_object_text_set(lb, buf1); + evas_object_show(lb); + elm_box_pack_end(box, lb); + + sep = elm_separator_add(box); + elm_separator_horizontal_set(sep, EINA_TRUE); + evas_object_size_hint_weight_set(sep, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(sep, EVAS_HINT_FILL, 0.0); + evas_object_show(sep); + elm_box_pack_end(box, sep); + + lb_status = elm_label_add(box); + elm_object_text_set(lb_status, "waiting for enroll"); //TODO: swipe or press auslesen + evas_object_show(lb_status); + elm_box_pack_end(box, lb_status); + + sep = elm_separator_add(box); + elm_separator_horizontal_set(sep, EINA_TRUE); + evas_object_size_hint_weight_set(sep, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(sep, EVAS_HINT_FILL, 0.0); + evas_object_show(sep); + elm_box_pack_end(box, sep); + + button = elm_button_add(box); + elm_object_text_set(button, "close"); + evas_object_smart_callback_add(button, "clicked", _close_verify_popup, popup); + evas_object_show(button); + elm_box_pack_end(box, button); + + elm_object_content_set(popup, box); + + evas_object_show(popup); + + evas_object_smart_callback_add(popup, "block,clicked", _close_verify_popup, popup); + fprint_device_verify_start_call(new_proxy1, _verify_start_cb, NULL, data); +} + +static void +_popup_enroll_cb(void *data, Evas_Object *obj EINA_UNUSED) +{ + Evas_Object *popup, *box, *lb, *sep, *button; + char buf[PATH_MAX]; + char buf1[PATH_MAX]; + const char *fingername; + + fingername = _to_readable_fingername(data); + + popup = elm_popup_add(win); + elm_popup_scrollable_set(popup, EINA_FALSE); + evas_object_smart_callback_add(popup, "block,clicked", _close_enroll_popup, popup); + + box = elm_box_add(popup); + evas_object_show(box); + + lb = elm_label_add(box); + elm_object_text_set(lb, "Enroll:"); + evas_object_show(lb); + elm_box_pack_end(box, lb); + + snprintf(buf, sizeof(buf), "%s", fingername); + + lb = elm_label_add(box); + elm_object_text_set(lb, buf); + evas_object_show(lb); + elm_box_pack_end(box, lb); + + ly_popup = elm_layout_add(box); + snprintf(buf, sizeof(buf), "%s/themes/enlightenment_fprint.edj", elm_app_data_dir_get()); + elm_layout_file_set(ly_popup, buf, "enroll"); + evas_object_size_hint_weight_set(ly_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(ly_popup, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(ly_popup); + elm_box_pack_end(box, ly_popup); + + snprintf(buf1, sizeof(buf1), "please %s on device", device_type); + lb = elm_label_add(box); + elm_object_text_set(lb, buf1); + evas_object_show(lb); + elm_box_pack_end(box, lb); + + sep = elm_separator_add(box); + elm_separator_horizontal_set(sep, EINA_TRUE); + evas_object_size_hint_weight_set(sep, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(sep, EVAS_HINT_FILL, 0.0); + evas_object_show(sep); + elm_box_pack_end(box, sep); + + lb_status = elm_label_add(box); + elm_object_text_set(lb_status, "waiting for enroll"); //TODO: swipe or press auslesen + evas_object_show(lb_status); + elm_box_pack_end(box, lb_status); + + sep = elm_separator_add(box); + elm_separator_horizontal_set(sep, EINA_TRUE); + evas_object_size_hint_weight_set(sep, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(sep, EVAS_HINT_FILL, 0.0); + evas_object_show(sep); + elm_box_pack_end(box, sep); + + button = elm_button_add(box); + elm_object_text_set(button, "close"); + evas_object_smart_callback_add(button, "clicked", _close_enroll_popup, popup); + evas_object_show(button); + elm_box_pack_end(box, button); + + elm_object_content_set(popup, box); + + evas_object_show(popup); + + fprint_device_enroll_start_call(new_proxy1, _enroll_start_cb, popup, data); +} + +static void +delete_selected_finger(Eldbus_Proxy *proxy EINA_UNUSED, void *data, Eldbus_Pending *pending EINA_UNUSED, Eldbus_Error_Info *error) +{ + if (error) + { + printf("MESSAGE delete_selected_finger: %s\n", error->message); + printf("ERROR delete_selected_finger: %s\n", error->error); + } + else + { + edje_object_signal_emit(ly, "reset_finger", "reset_finger"); // for GROUP hands/left_hand/right/hand + edje_object_signal_emit(ly, "not_enrolled_finger", "not_enrolled_finger"); // for GROUP finger + fprint_device_list_enrolled_fingers_call(new_proxy1, enrolled_fingers_cb, NULL, currentuser); + + _dismiss_hover(data, NULL, NULL); + _update_theme(); + } +} + +static void +delete_all_finger(Eldbus_Proxy *prox EINA_UNUSED, void *data, Eldbus_Pending *pending EINA_UNUSED, Eldbus_Error_Info *error) +{ + if (error) + { + printf("MESSAGE delete_all_finger: %s\n", error->message); + printf("ERROR delete_all_finger: %s\n", error->error); + } + else + { + edje_object_signal_emit(ly, "reset_finger", "reset_finger"); // for GROUP hands/left_hand/right/hand + edje_object_signal_emit(ly, "not_enrolled_finger", "not_enrolled_finger"); // for GROUP finger + fprint_device_list_enrolled_fingers_call(new_proxy1, enrolled_fingers_cb, NULL, currentuser); + + _dismiss_hover(data, NULL, NULL); + } +} + +static void +_verify_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + _popup_verify_cb(data, NULL); +} + +static void +_enroll_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + _popup_enroll_cb(data, NULL); +} + +static void +_delete_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + fprint_device_delete_enrolled_finger_call(new_proxy1, delete_selected_finger, NULL, data); +} + +static void +_delete_all_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + fprint_device_delete_enrolled_fingers2_call(new_proxy1, delete_all_finger, data); +} + +void +fingerprint_clicked_finger_mode(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + Evas_Object *hv, *bt, *bx, *lb; + char buf[PATH_MAX]; + const char *layout; + const char *fingername; + const char *txt; + int i, found = 0; + + Evas_Object *left_list = evas_object_data_get(data, "left_list"); + Evas_Object *right_list = evas_object_data_get(data, "right_list"); + Elm_Object_Item *selected_item; + + selected_item = elm_list_selected_item_get(left_list); + + if (selected_item == NULL) + selected_item = elm_list_selected_item_get(right_list); + + if (selected_item == NULL) return; + + fingername = _to_fprint_fingername(elm_object_item_text_get(selected_item)); + + currentfinger = strdup(fingername); + + snprintf(buf, sizeof(buf), "%s", elm_object_item_text_get(selected_item)); + + hv = elm_hover_add(win); + bx = elm_box_add(win); + + elm_layout_file_get(ly, NULL, &layout); + + if (strcmp(layout, "finger") == 0) + elm_object_part_content_set(hv, "middle", bx); + else + elm_object_part_content_set(hv, "bottom", bx); + + evas_object_show(bx); + + lb = elm_label_add(bx); + elm_object_text_set(lb, buf); + evas_object_show(lb); + elm_box_pack_end(bx, lb); + + for (i = 0; i < (int)eina_value_array_count(&array); i++) + { + eina_value_array_get(&array, i, &txt); + + if (!strcmp(txt, fingername)) found = 1; + } + + if (found == 1) + { + bt = elm_button_add(win); + elm_object_text_set(bt, "verify"); + evas_object_smart_callback_add(bt, "clicked", _dismiss_hover, hv); + evas_object_smart_callback_add(bt, "clicked", _verify_cb, fingername); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_object_text_set(bt, "delete"); + evas_object_smart_callback_add(bt, "clicked", _dismiss_hover, hv); + evas_object_smart_callback_add(bt, "clicked", _delete_selected_cb, fingername); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + } + else + { + bt = elm_button_add(win); + elm_object_text_set(bt, "enroll"); + evas_object_smart_callback_add(bt, "clicked", _dismiss_hover, hv); + evas_object_smart_callback_add(bt, "clicked", _enroll_cb, fingername); + + elm_box_pack_end(bx, bt); + evas_object_show(bt); + } + + if (eina_value_array_count(&array) != 0) + { + bt = elm_button_add(win); + elm_object_text_set(bt, "delete all"); + evas_object_smart_callback_add(bt, "clicked", _delete_all_cb, hv); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + } + + elm_hover_parent_set(hv, win); + elm_hover_target_set(hv, obj); + + evas_object_show(hv); +} + +void +fingerprint_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + Evas_Object *hv, *bt, *bx, *lb; + char buf[PATH_MAX]; + const char *layout; + const char *fingername; + const char *txt; + int i, found = 0; + + currentfinger = data; + + printf("CURRENTFINGER: %s\n", currentfinger); + + fingername = _to_readable_fingername(data); + snprintf(buf, sizeof(buf), "%s", fingername); + + hv = elm_hover_add(win); + bx = elm_box_add(win); + + elm_layout_file_get(ly, NULL, &layout); + + if (strcmp(layout, "finger") == 0) + elm_object_part_content_set(hv, "middle", bx); + else + elm_object_part_content_set(hv, "bottom", bx); + + evas_object_show(bx); + + lb = elm_label_add(bx); + elm_object_text_set(lb, buf); + evas_object_show(lb); + elm_box_pack_end(bx, lb); + + for (i = 0; i < (int)eina_value_array_count(&array); i++) + { + eina_value_array_get(&array, i, &txt); + + if (!strcmp(txt, data)) found = 1; + } + + if (found == 1) + { + bt = elm_button_add(win); + elm_object_text_set(bt, "verify"); + evas_object_smart_callback_add(bt, "clicked", _dismiss_hover, hv); + evas_object_smart_callback_add(bt, "clicked", _verify_cb, data); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + + bt = elm_button_add(win); + elm_object_text_set(bt, "delete"); + evas_object_smart_callback_add(bt, "clicked", _dismiss_hover, hv); + evas_object_smart_callback_add(bt, "clicked", _delete_selected_cb, data); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + } + else + { + bt = elm_button_add(win); + elm_object_text_set(bt, "enroll"); + evas_object_smart_callback_add(bt, "clicked", _dismiss_hover, hv); + evas_object_smart_callback_add(bt, "clicked", _enroll_cb, data); + + elm_box_pack_end(bx, bt); + evas_object_show(bt); + } + + if (eina_value_array_count(&array) != 0) + { + bt = elm_button_add(win); + elm_object_text_set(bt, "delete all"); + evas_object_smart_callback_add(bt, "clicked", _delete_all_cb, hv); + elm_box_pack_end(bx, bt); + evas_object_show(bt); + } + + elm_hover_parent_set(hv, win); + elm_hover_target_set(hv, obj); + + evas_object_show(hv); +} + +static void +_switch_hand(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + char buf[PATH_MAX]; + snprintf(buf, sizeof(buf), "%s/themes/enlightenment_fprint.edj", elm_app_data_dir_get()); + elm_layout_file_set(ly, buf, data); + + fprint_device_list_enrolled_fingers_call(new_proxy1, enrolled_fingers_cb, NULL, currentuser); + _update_theme(); +} + +static void +_finger_mode_select(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + const char *txt, *fingername; + unsigned i; + const Eina_List *l, *items; + Elm_Object_Item *list_it, *selected_item; + + items = elm_list_items_get(data); + + EINA_LIST_FOREACH(items, l, list_it) + { + elm_list_item_selected_set(list_it, EINA_FALSE); + } + + selected_item = elm_list_selected_item_get(obj); + + printf("FINGERNAME LIST FPRINT FINGERNAME1: %s\n", elm_object_item_text_get(selected_item)); + + fingername = _to_fprint_fingername(elm_object_item_text_get(selected_item)); + + printf("FINGERNAME LIST FPRINT FINGERNAME: %s\n", fingername); + + for (i = 0; i < eina_value_array_count(&array); i++) + { + eina_value_array_get(&array, i, &txt); + + printf("\t%s:%s\n", txt, fingername); + + if (!strcmp(txt, fingername)) + { + edje_object_signal_emit(ly, "enrolled_finger", "enrolled_finger"); + break; + } + edje_object_signal_emit(ly, "not_enrolled_finger", "not_enrolled_finger"); + } +} + +static void +_update_theme(void) +{ + Evas_Object *swallow_button, *right_list = NULL, *left_list, *leftright_list, *icon = NULL; + char buf[PATH_MAX]; + + // ALL 10 FINGERS + // LEFT + swallow_button = elm_button_add(win); + elm_object_style_set(swallow_button, "blank"); + evas_object_smart_callback_add(swallow_button, "clicked", fingerprint_clicked, "left-little-finger"); + evas_object_show(swallow_button); + elm_object_part_content_set(ly, "swallow_left-little-finger", swallow_button); + + swallow_button = elm_button_add(win); + elm_object_style_set(swallow_button, "blank"); + evas_object_smart_callback_add(swallow_button, "clicked", fingerprint_clicked, "left-ring-finger"); + evas_object_show(swallow_button); + elm_object_part_content_set(ly, "swallow_left-ring-finger", swallow_button); + + swallow_button = elm_button_add(win); + elm_object_style_set(swallow_button, "blank"); + evas_object_smart_callback_add(swallow_button, "clicked", fingerprint_clicked, "left-middle-finger"); + evas_object_show(swallow_button); + elm_object_part_content_set(ly, "swallow_left-middle-finger", swallow_button); + + swallow_button = elm_button_add(win); + elm_object_style_set(swallow_button, "blank"); + evas_object_smart_callback_add(swallow_button, "clicked", fingerprint_clicked, "left-index-finger"); + evas_object_show(swallow_button); + elm_object_part_content_set(ly, "swallow_left-index-finger", swallow_button); + + swallow_button = elm_button_add(win); + elm_object_style_set(swallow_button, "blank"); + evas_object_smart_callback_add(swallow_button, "clicked", fingerprint_clicked, "left-thumb"); + evas_object_show(swallow_button); + elm_object_part_content_set(ly, "swallow_left-thumb", swallow_button); + + // RIGHT + swallow_button = elm_button_add(win); + elm_object_style_set(swallow_button, "blank"); + evas_object_smart_callback_add(swallow_button, "clicked", fingerprint_clicked, "right-little-finger"); + evas_object_show(swallow_button); + elm_object_part_content_set(ly, "swallow_right-little-finger", swallow_button); + + swallow_button = elm_button_add(win); + elm_object_style_set(swallow_button, "blank"); + evas_object_smart_callback_add(swallow_button, "clicked", fingerprint_clicked, "right-ring-finger"); + evas_object_show(swallow_button); + elm_object_part_content_set(ly, "swallow_right-ring-finger", swallow_button); + + swallow_button = elm_button_add(win); + elm_object_style_set(swallow_button, "blank"); + evas_object_smart_callback_add(swallow_button, "clicked", fingerprint_clicked, "right-middle-finger"); + evas_object_show(swallow_button); + elm_object_part_content_set(ly, "swallow_right-middle-finger", swallow_button); + + swallow_button = elm_button_add(win); + elm_object_style_set(swallow_button, "blank"); + evas_object_smart_callback_add(swallow_button, "clicked", fingerprint_clicked, "right-index-finger"); + evas_object_show(swallow_button); + elm_object_part_content_set(ly, "swallow_right-index-finger", swallow_button); + + swallow_button = elm_button_add(win); + elm_object_style_set(swallow_button, "blank"); + evas_object_smart_callback_add(swallow_button, "clicked", fingerprint_clicked, "right-thumb"); + evas_object_show(swallow_button); + elm_object_part_content_set(ly, "swallow_right-thumb", swallow_button); + + // SWITCH LEFT/RIGHT HAND + leftright_list = elm_list_add(win); + elm_list_multi_select_set(leftright_list, EINA_FALSE); + elm_list_select_mode_set(leftright_list, ELM_OBJECT_SELECT_MODE_ALWAYS); + evas_object_size_hint_weight_set(leftright_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + elm_list_mode_set(leftright_list, ELM_LIST_EXPAND); + elm_list_item_append(leftright_list, "Left Hand", NULL, NULL, _switch_hand, "left_hand"); + elm_list_item_append(leftright_list, "Right Hand", NULL, NULL, _switch_hand, "right_hand"); + evas_object_show(leftright_list); + elm_object_part_content_set(ly, "swallow_hand_switch", leftright_list); + + // ONE FINGER + left_list = elm_list_add(win); + elm_list_multi_select_set(left_list, EINA_FALSE); + elm_list_select_mode_set(left_list, ELM_OBJECT_SELECT_MODE_ALWAYS); + evas_object_size_hint_weight_set(left_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_list_mode_set(left_list, ELM_LIST_EXPAND); + + right_list = elm_list_add(win); + elm_list_multi_select_set(right_list, EINA_FALSE); + elm_list_select_mode_set(right_list, ELM_OBJECT_SELECT_MODE_ALWAYS); + evas_object_size_hint_weight_set(right_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_list_mode_set(right_list, ELM_LIST_EXPAND); + + //// + Eina_List *left_hand_list = NULL; + Eina_List *right_hand_list = NULL; + Eina_List *l; + const char *fingername; + unsigned i = 0; + int found; + const char *txt; + const char *list_item; + + elm_list_clear(right_list); + elm_list_clear(left_list); + + if (!eina_list_count(left_hand_list) || (eina_list_count(left_hand_list) == 0)) + { + left_hand_list = eina_list_append(left_hand_list, "Left little finger"); + left_hand_list = eina_list_append(left_hand_list, "Left ring finger"); + left_hand_list = eina_list_append(left_hand_list, "Left middle finger"); + left_hand_list = eina_list_append(left_hand_list, "Left index finger"); + left_hand_list = eina_list_append(left_hand_list, "Left thumb"); + } + + if (!eina_list_count(right_hand_list) || (eina_list_count(right_hand_list) == 0)) + { + right_hand_list = eina_list_append(right_hand_list, "Right little finger"); + right_hand_list = eina_list_append(right_hand_list, "Right ring finger"); + right_hand_list = eina_list_append(right_hand_list, "Right middle finger"); + right_hand_list = eina_list_append(right_hand_list, "Right index finger"); + right_hand_list = eina_list_append(right_hand_list, "Right thumb"); + } + + + EINA_LIST_FOREACH(left_hand_list, l, list_item) + { + icon = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/themes/enlightenment_fprint.edj", elm_app_data_dir_get()); + elm_image_file_set(icon, buf, "icon"); + evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(20), ELM_SCALE_SIZE(20)); + evas_object_size_hint_max_set(icon, ELM_SCALE_SIZE(20), ELM_SCALE_SIZE(20)); + evas_object_show(icon); + + printf("LEFT LIST ITEM:\n"); + found = 0; + fingername = _to_fprint_fingername(list_item); + + for (i = 0; i < eina_value_array_count(&array); i++) + { + eina_value_array_get(&array, i, &txt); + + if (!strcmp(txt, fingername)) + { + printf("LEFT LIST ITEM: %s\n",fingername); + elm_list_item_append(left_list, fingername, icon, NULL, _finger_mode_select, right_list); + found = 1; + } + } + + if (found != 1) + elm_list_item_append(left_list, fingername, NULL, NULL, _finger_mode_select, right_list); + } + + EINA_LIST_FOREACH(right_hand_list, l, list_item) + { + icon = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/themes/enlightenment_fprint.edj", elm_app_data_dir_get()); + elm_image_file_set(icon, buf, "icon"); + evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(20), ELM_SCALE_SIZE(20)); + evas_object_size_hint_max_set(icon, ELM_SCALE_SIZE(20), ELM_SCALE_SIZE(20)); + evas_object_show(icon); + + printf("RIGHT LIST ITEM:\n"); + found = 0; + fingername = _to_fprint_fingername(list_item); + for (i = 0; i < eina_value_array_count(&array); i++) + { + eina_value_array_get(&array, i, &txt); + + if (!strcmp(txt, fingername)) + { + printf("RIGHT LIST ITEM: %s\n",fingername); + elm_list_item_append(right_list, fingername, icon, NULL, _finger_mode_select, left_list); + found = 1; + } + } + if (found != 1) + elm_list_item_append(right_list, fingername, NULL, NULL, _finger_mode_select, left_list); + } + + elm_list_go(left_list); + evas_object_show(left_list); + elm_object_part_content_set(ly, "swallow_select-finger-left", left_list); + + elm_list_go(right_list); + evas_object_show(right_list); + elm_object_part_content_set(ly, "swallow_select-finger-right", right_list); + + swallow_button = elm_button_add(win); + elm_object_style_set(swallow_button, "blank"); + + evas_object_data_set(swallow_button, "left_list", left_list); + evas_object_data_set(swallow_button, "right_list", right_list); + + evas_object_smart_callback_add(swallow_button, "clicked", fingerprint_clicked_finger_mode, swallow_button); + evas_object_show(swallow_button); + elm_object_part_content_set(ly, "swallow_select-finger", swallow_button); +} + +static void +_select_mode(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + char buf[PATH_MAX]; + + snprintf(buf, sizeof(buf), "%s/themes/enlightenment_fprint.edj", elm_app_data_dir_get()); + elm_layout_file_set(ly, buf, data); + + fprint_device_list_enrolled_fingers_call(new_proxy1, enrolled_fingers_cb, NULL, currentuser); + _update_theme(); +} + +/* +static void +get_devices(Eldbus_Proxy *proxy, void *data, Eldbus_Pending *pending, Eldbus_Error_Info *error, Eina_Value *args) +{ + if (error) + printf("ERROR: %s\n", error->error); + if (error) + printf("MESSAGE: %s\n", error->message); +}*/ + +static void +get_default_device(Eldbus_Proxy *proxy EINA_UNUSED, void *data EINA_UNUSED, Eldbus_Pending *pending EINA_UNUSED, Eldbus_Error_Info *error, const char *device) +{ + printf("DEFAULT: %s\n", device); + + if (device) + default_device = strdup(device); + + printf("DDEFAULT: %s\n", default_device); + if (error) + printf("ERROR get_default_device: %s\n", error->error); + if (error) + printf("MESSAGE get_default_device: %s\n", error->message); +} + +static void +enrolled_fingers_cb(Eldbus_Proxy *proxy EINA_UNUSED, void *data EINA_UNUSED, Eldbus_Pending *pending EINA_UNUSED, Eldbus_Error_Info *error EINA_UNUSED, Eina_Value *args) +{ + const char *txt; + unsigned i; + + eina_value_flush(&array); + if (error) + { + printf("ERROR enrolled_fingers_cb: %s\n", error->error); + printf("MESSAGE enrolled_fingers_cb: %s\n", error->message); + } + else + { + eina_value_struct_value_get(args, "arg0", &array); + for (i = 0; i < eina_value_array_count(&array); i++) + { + eina_value_array_get(&array, i, &txt); + edje_object_signal_emit(ly, "enrolled_finger", txt); + } + } +} + +static void +get_device_proberties(void *data, Eldbus_Pending *pending EINA_UNUSED, const char *propname EINA_UNUSED, Eldbus_Proxy *proxy EINA_UNUSED, Eldbus_Error_Info *error_info EINA_UNUSED, const char *value) +{ + char buf[PATH_MAX]; + Evas_Object *lb = data; + + if (value) + { + printf("NAME: %s\n", value); + snprintf(buf, sizeof(buf), "Device Name: %s", value); + elm_object_text_set(lb, buf); + } + else + elm_object_text_set(lb, "NO DEVICE"); +} + +static void +get_device_type(void *data, Eldbus_Pending *pending EINA_UNUSED, const char *propname EINA_UNUSED, Eldbus_Proxy *proxy EINA_UNUSED, Eldbus_Error_Info *error_info EINA_UNUSED, const char *value) +{ + char buf[PATH_MAX]; + Evas_Object *lb1 = data; + + if (value) + { + device_type = strdup(value); + printf("Type: %s\n", device_type); + snprintf(buf, sizeof(buf), "Device Type: %s", device_type); + elm_object_text_set(lb1, buf); + } +} + +static void +retry_claim_device(void* data, Evas_Object* o EINA_UNUSED, void* event EINA_UNUSED) +{ + Evas_Object *notify = data; + + if (notify) evas_object_del(notify); + + fprint_device_claim_call(new_proxy1, claim_device, NULL, currentuser); +} + +static void +claim_device(Eldbus_Proxy *proxy EINA_UNUSED, void *data EINA_UNUSED, Eldbus_Pending *pending EINA_UNUSED, Eldbus_Error_Info *error) +{ + if (error) + { + printf("ERROR claim_device: %s\n", error->error); + printf("MESSAGE claim_device: %s\n", error->message); + + Evas_Object *notify, *bx, *bxv, *o; + + notify = elm_notify_add(win); + + bx = elm_box_add(notify); + + o = elm_label_add(bx); + elm_object_text_set(o, "Could not claim device
Please cancel all other fprint sessions
and press retry
"); + evas_object_show(o); + elm_box_pack_end(bx, o); + + bxv = elm_box_add(notify); + o = elm_button_add(bxv); + elm_object_text_set(o, "retry"); + evas_object_smart_callback_add(o, "clicked", retry_claim_device, notify); + evas_object_show(o); + elm_box_pack_end(bxv, o); + + evas_object_show(bxv); + + elm_box_pack_end(bx, bxv); + + evas_object_show(bx); + elm_object_content_set(notify, bx); + evas_object_show(notify); + } +} + +static void +_enroll_stopp_cb(Eldbus_Proxy *proxy EINA_UNUSED, void *data EINA_UNUSED, Eldbus_Pending *pending EINA_UNUSED, Eldbus_Error_Info *error) +{ + if (error) + { + printf("MESSAGE _enroll_stopp_cb: %s\n", error->message); + printf("ERROR _enroll_stopp_cb: %s\n", error->error); + } +} + +static void +_verify_stopp_cb(Eldbus_Proxy *proxy EINA_UNUSED, void *data EINA_UNUSED, Eldbus_Pending *pending EINA_UNUSED, Eldbus_Error_Info *error) +{ + if (error) + { + printf("MESSAGE _verify_stopp_cb: %s\n", error->message); + printf("ERROR _verify_stopp_cb: %s\n", error->error); + } +} + +static void +_restart_verify(void) +{ + fprint_device_verify_start_call(new_proxy1, _verify_start_cb, NULL, currentfinger); +} + +static void +_verify_status(void *data EINA_UNUSED, const Eldbus_Message *msg) +{ + char buf[PATH_MAX]; + const char *status; + + printf("C-FINGER VERFIY STATUS: %s\n", currentfinger); + + EINA_SAFETY_ON_TRUE_RETURN(eldbus_message_error_get(msg, NULL, NULL)); + + if (!eldbus_message_arguments_get(msg, "s", &status)) + { + fprintf(stderr, "Error: could not get entry contents\n"); + return; + } + + if (!strcmp(status, "verify-match")) + { + snprintf(buf, sizeof(buf), "%s", status); + elm_object_text_set(lb_status, buf);//FIXME lb_status ist nicht mehr vorhanden wenn über block,clicked das popup gelöscht worden ist. + + edje_object_signal_emit(ly_popup, "success", "success"); + + const char *layout; + elm_layout_file_get(ly_popup, NULL, &layout); + + fprint_device_verify_stop_call(new_proxy1, _verify_stopp_cb, NULL); + + _restart_verify(); + } + else if (!strcmp(status, "verify-retry-scan")) + { + snprintf(buf, sizeof(buf), "%s", status); + elm_object_text_set(lb_status, buf); + } + else if (!strcmp(status, "verify-swipe-too-short")) + { + snprintf(buf, sizeof(buf), "%s", status); + elm_object_text_set(lb_status, buf); + } + else if (!strcmp(status, "verify-finger-not-centered")) + { + snprintf(buf, sizeof(buf), "%s", status); + elm_object_text_set(lb_status, buf); + } + else if (!strcmp(status, "verify-remove-and-retry")) + { + snprintf(buf, sizeof(buf), "%s", status); + elm_object_text_set(lb_status, buf); + } + else if (!strcmp(status, "verify-disconnected")) + { + snprintf(buf, sizeof(buf), "%s", status); + elm_object_text_set(lb_status, buf); + + edje_object_signal_emit(ly_popup, "failed", "failed");// FIXME ly_popup ist nicht mehr vorhanden wenn über block,clicked das popup gelöscht worden ist. + + fprint_device_verify_stop_call(new_proxy1, _verify_stopp_cb, NULL); + _restart_verify(); + } + else if (!strcmp(status, "verify-no-match")) + { + snprintf(buf, sizeof(buf), "%s
retry", status); + elm_object_text_set(lb_status, buf); + + edje_object_signal_emit(ly_popup, "failed", "failed"); + + fprint_device_verify_stop_call(new_proxy1, _verify_stopp_cb, NULL); + _restart_verify(); + } + else + { + elm_object_text_set(lb_status, "unknown error"); + + edje_object_signal_emit(ly_popup, "failed", "failed"); + + fprint_device_verify_stop_call(new_proxy1, _verify_stopp_cb, NULL); + } +} + +static void +_enroll_status(void *data EINA_UNUSED, const Eldbus_Message *msg) +{ + //TODO: Theme an die Anzahl der verlangten enrolls anpassen. Theme = 5, + + const char *status; + char buf[PATH_MAX]; + char buf1[PATH_MAX]; + EINA_SAFETY_ON_TRUE_RETURN(eldbus_message_error_get(msg, NULL, NULL)); + + if (!eldbus_message_arguments_get(msg, "s", &status)) + { + fprintf(stderr, "Error: could not get entry contents\n"); + return; + } + + snprintf(buf1, sizeof(buf1), "%i", step); + + if (!strcmp(status, "enroll-stage-passed")) + { + snprintf(buf, sizeof(buf), "Enroll %i of %i
%s", step, enroll_num, status); + elm_object_text_set(lb_status, buf); //FIXME lb_status ist nicht mehr vorhanden wenn über block,clicked das popup gelöscht worden ist. + + enroll_count = enroll_count + enroll_count_value; + + if (enroll_count <= 4) + edje_object_signal_emit(ly_popup, "success", "1"); + else if (enroll_count >= 4 && (enroll_count <= 6)) + edje_object_signal_emit(ly_popup, "success", "2"); + else if (enroll_count >= 6 && (enroll_count <= 8)) + edje_object_signal_emit(ly_popup, "success", "3"); + else if (enroll_count >= 8 && (enroll_count <= 10)) + edje_object_signal_emit(ly_popup, "success", "4"); + else if (enroll_count >= 10) + edje_object_signal_emit(ly_popup, "success", "5"); + + const char *layout; + elm_layout_file_get(ly_popup, NULL, &layout); + printf("LAYOUT %s\n", layout); + + step++; + } + else if (!strcmp(status, "enroll-completed")) + { + snprintf(buf, sizeof(buf), "Enroll %i of %i
%s", step, enroll_num, status); + elm_object_text_set(lb_status, buf); + + edje_object_signal_emit(ly_popup, "success", "5"); + fprint_device_list_enrolled_fingers_call(new_proxy1, enrolled_fingers_cb, NULL, currentuser); + enroll_count = 1; + step = 1; + } + else if (!strcmp(status, "enroll-swipe-too-short") || !strcmp(status, "enroll-retry-scan") || !strcmp(status, "enroll-finger-not-centered") || !strcmp(status, "enroll-remove-and-retry") || !strcmp(status, "enroll-remove-and-retry")) + { + snprintf(buf, sizeof(buf), "Enroll %i of %i
%s", step, enroll_num, status); + elm_object_text_set(lb_status, buf); + + if (enroll_count <= 4) + edje_object_signal_emit(ly_popup, "failed", "1"); + else if (enroll_count >= 4 && (enroll_count <= 6)) + edje_object_signal_emit(ly_popup, "failed", "2"); + else if (enroll_count >= 6 && (enroll_count <= 8)) + edje_object_signal_emit(ly_popup, "failed", "3"); + else if (enroll_count >= 8 && (enroll_count <= 10)) + edje_object_signal_emit(ly_popup, "failed", "4"); + else if (enroll_count >= 10) + edje_object_signal_emit(ly_popup, "failed", "5"); + } + else if (!strcmp(status, "enroll-failed")) + { + elm_object_text_set(lb_status, "enroll failed"); + + edje_object_signal_emit(ly_popup, "failed", buf1); // FIXME ly_popup ist nicht mehr vorhanden wenn über block,clicked das popup gelöscht worden ist. + step = 1; + + fprint_device_enroll_stop_call(new_proxy1, _enroll_stopp_cb, NULL); + } + else if (!strcmp(status, "enroll-disconnected")) + { + elm_object_text_set(lb_status, "enroll disconnected"); + + edje_object_signal_emit(ly_popup, "enrolled__failed", "enrolled__failed"); + enroll_count = 1; + step = 1; + + fprint_device_enroll_stop_call(new_proxy1, _enroll_stopp_cb, NULL); + } + else if (!strcmp(status, "enroll-data-full")) + { + elm_object_text_set(lb_status, "enroll.data full
No further prints can be enrolled on this device"); + + edje_object_signal_emit(ly_popup, "enrolled__failed", "enrolled__failed"); + step = 1; + + fprint_device_enroll_stop_call(new_proxy1, _enroll_stopp_cb, NULL); + } + else + { + elm_object_text_set(lb_status, "unknown error"); + + edje_object_signal_emit(ly_popup, "enrolled__failed", "enrolled__failed"); + enroll_count = 1; + step = 1; + fprint_device_enroll_stop_call(new_proxy1, _enroll_stopp_cb, NULL); + } +} + +int +e_auth_shutdown(void) +{ + if (conn) eldbus_connection_unref(conn); + conn = NULL; + return 1; +} + +EAPI_MAIN int +elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) +{ + Evas_Object *box, *lb, *lb1, *lb2, *h_box, *panel, *hv, *p_box, *sep; + char buf[PATH_MAX]; + char buf1[PATH_MAX]; + + eina_value_array_setup(&array, EINA_VALUE_TYPE_STRING, 1); + + elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR); + elm_app_compile_lib_dir_set(PACKAGE_LIB_DIR); + elm_app_compile_data_dir_set(PACKAGE_DATA_DIR); + + elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); + + eldbus_init(); + + conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM); + if (!conn) + { + fprintf(stderr, "Error: could not get system bus\n"); + return EXIT_FAILURE; + } + + currentuser = getenv("USER"); + currentfinger = ""; + ly_popup = NULL; + lb_status = NULL; + + new_proxy = fprint_manager_proxy_get(conn, "net.reactivated.Fprint", "/net/reactivated/Fprint/Manager"); + + p1 = fprint_manager_get_default_device_call(new_proxy, get_default_device, NULL); + default_device = "/net/reactivated/Fprint/Device/0"; //FIXME wenn ich default_device über die funkion hole ist die variable nicht gefüllt für fprint_device_proxy_get //FIXME + printf("DEFAULT DEVICE %s\n\n", default_device); + + new_proxy1 = fprint_device_proxy_get(conn, "net.reactivated.Fprint", default_device); + + fprint_device_claim_call(new_proxy1, claim_device, NULL, ""); + + eldbus_signal_handler_add(conn, "net.reactivated.Fprint", default_device, "net.reactivated.Fprint.Device", "EnrollStatus", _enroll_status, NULL); + eldbus_signal_handler_add(conn, "net.reactivated.Fprint", default_device, "net.reactivated.Fprint.Device", "VerifyStatus", _verify_status, NULL); + +// p = fprint_manager_get_devices_call(new_proxy, get_devices, NULL); + + fprint_device_list_enrolled_fingers_call(new_proxy1, enrolled_fingers_cb, NULL, ""); + + fprint_device_num_enroll_stages_propget(new_proxy1, _enroll_prop_get, NULL); //NUM enroll states needed + printf("NUM enroll states: %i\n", enroll_num); + + // set app informations + elm_app_info_set(elm_main, "enlightenment", "COPYING"); + + win = elm_win_util_standard_add("main", "Fingerprint Password Settings"); + elm_win_title_set(win, "Fingerprint Password Settings"); + elm_win_autodel_set(win, EINA_TRUE); + + box = elm_box_add(win); + evas_object_show(box); + + h_box = elm_box_add(win); + elm_box_homogeneous_set(h_box, EINA_TRUE); + elm_box_horizontal_set(h_box, EINA_TRUE); + + lb = elm_label_add(win); + elm_object_text_set(lb, "Choose finger and click on fingerprint to select action"); + evas_object_show(lb); + elm_box_pack_end(box, lb); + + ly = elm_layout_add(h_box); + snprintf(buf, sizeof(buf), "%s/themes/enlightenment_fprint.edj", elm_app_data_dir_get()); + elm_layout_file_set(ly, buf, "right_hand"); + evas_object_show(ly); + + _update_theme(); + + elm_box_pack_end(h_box, ly); + + evas_object_show(h_box); + + elm_box_pack_end(box, h_box); + + h_box = elm_box_add(win); + elm_box_homogeneous_set(h_box, EINA_TRUE); + elm_box_horizontal_set(h_box, EINA_TRUE); + evas_object_size_hint_align_set( h_box, EVAS_HINT_FILL, EVAS_HINT_FILL); + + hv = elm_hoversel_add(h_box); + elm_object_text_set(hv, "One hand"); + elm_hoversel_auto_update_set(hv, EINA_TRUE); + elm_hoversel_hover_parent_set(hv, win); + elm_hoversel_item_add(hv, "One hand", NULL, ELM_ICON_NONE, _select_mode, "right_hand"); + elm_hoversel_item_add(hv, "Both hands", NULL, ELM_ICON_NONE, _select_mode, "hands"); + elm_hoversel_item_add(hv, "One finger", NULL, ELM_ICON_NONE, _select_mode, "finger"); + evas_object_show(hv); + elm_box_pack_end(h_box, hv); + + evas_object_show(h_box); + + elm_box_pack_end(box, h_box); + + panel = elm_panel_add(box); + elm_panel_orient_set(panel, ELM_PANEL_ORIENT_BOTTOM); + evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(panel); + + p_box = elm_box_add(panel); + elm_box_horizontal_set(p_box, EINA_TRUE); + evas_object_size_hint_align_set(p_box, EVAS_HINT_FILL, EVAS_HINT_FILL); + + lb = elm_label_add(panel); + fprint_device_name_propget(new_proxy1, get_device_proberties, lb); // DEVICE NAME + evas_object_show(lb); + elm_box_pack_end(p_box, lb); + + sep = elm_separator_add(panel); + elm_separator_horizontal_set(sep, EINA_FALSE); + evas_object_show(sep); + elm_box_pack_end(p_box, sep); + + lb1 = elm_label_add(panel); + fprint_device_scan_type_propget(new_proxy1, get_device_type, lb1); // DEVICE TYPE + evas_object_show(lb1); + elm_box_pack_end(p_box, lb1); + + sep = elm_separator_add(panel); + elm_separator_horizontal_set(sep, EINA_FALSE); + evas_object_show(sep); + elm_box_pack_end(p_box, sep); + + snprintf(buf1, sizeof(buf1), "User: %s", currentuser); + + lb2 = elm_label_add(panel); + elm_object_text_set(lb2, buf1); + evas_object_show(lb2); + elm_box_pack_end(p_box, lb2); + + elm_object_content_set(panel, p_box); + + elm_box_pack_end(box, panel); + + elm_win_resize_object_add(win, box); + evas_object_show(win); + + elm_run(); + + if (conn) eldbus_connection_unref(conn); + conn = NULL; + + return 0; +} +ELM_MAIN() diff --git a/src/bin/tools/fprint/src/manager.xml b/src/bin/tools/fprint/src/manager.xml new file mode 100644 index 000000000..e51ced925 --- /dev/null +++ b/src/bin/tools/fprint/src/manager.xml @@ -0,0 +1,47 @@ + +]> + + + + + + + + An array of object paths for devices. + + + + + + Enumerate all the fingerprint readers attached to the system. If there are + no devices available, an empty array is returned. + + + + + + + + + + The object path for the default device. + + + + + + Returns the default fingerprint reader device. + + + + + if the device does not exist + + + + + + diff --git a/src/bin/tools/fprint/src/meson.build b/src/bin/tools/fprint/src/meson.build new file mode 100644 index 000000000..b80de9231 --- /dev/null +++ b/src/bin/tools/fprint/src/meson.build @@ -0,0 +1,27 @@ +inc = include_directories('../../../../..') +deps = [ + dep_elementary +] + +xml_codegen_result = [] + +foreach file : ['device', 'manager'] + xml_codegen_result += custom_target('dbus_codegen_'+file, + input: file+'.xml', + output: ['eldbus_fprint_' + file + '.h', 'eldbus_fprint_' + file + '.c'], + command: [eldbus_codegen, '-O', meson.current_build_dir(), '@INPUT@'], + ) +endforeach + + +src = [ + 'enlightenment_fprint.c', +] + +executable('enlightenment_fprint', + src + xml_codegen_result, + include_directories: inc, + dependencies : deps, + gui_app : true, + install_dir : join_paths(dir_bin), + install : true) diff --git a/src/bin/tools/meson.build b/src/bin/tools/meson.build index 767cc2274..041e8c4eb 100644 --- a/src/bin/tools/meson.build +++ b/src/bin/tools/meson.build @@ -3,3 +3,4 @@ subdir('filemanager') subdir('open') subdir('askpass') subdir('remote') +subdir('fprint')