forked from enlightenment/efl
Compare commits
77 Commits
380c6d35db
...
37324274a7
Author | SHA1 | Date |
---|---|---|
|
37324274a7 | |
|
ebd24a4815 | |
|
305750875e | |
|
7e346e7bc2 | |
|
b3a83fdea6 | |
|
c9dae98611 | |
|
659640e4f4 | |
|
18177756ae | |
|
956eeb2b8c | |
|
a819f00c04 | |
|
8cc906628b | |
|
cdd3c35bb3 | |
|
49976ca388 | |
|
a6915ecfc5 | |
|
9e5bb18af1 | |
|
11cd98e119 | |
|
ae0c1783d4 | |
|
35bc3f933f | |
|
178b786f39 | |
|
5aefadeef3 | |
|
97845c1ee3 | |
|
7e839be3ab | |
|
12124b770b | |
|
35e486dbb5 | |
|
f0a966a65f | |
|
f1688d5110 | |
|
ab4394b4ad | |
|
1ff35f9a41 | |
|
5823aa2569 | |
|
d2073a4a56 | |
|
2a87cfecda | |
|
dca528a049 | |
|
f9e8839125 | |
|
d6d0caa46c | |
|
c216f5baf2 | |
|
c6b3242c60 | |
|
dce2557746 | |
|
2842eefee2 | |
|
248d62bf5e | |
|
f6abf24db2 | |
|
ec7a23ec82 | |
|
1704758e79 | |
|
53d18f0409 | |
|
c0e260d308 | |
|
c260bcbd33 | |
|
8272318d71 | |
|
cc66b5d011 | |
|
58ccd1031a | |
|
472cee52b2 | |
|
9447fb6bad | |
|
9d7fc64ca3 | |
|
a448fc785b | |
|
d9d81af314 | |
|
1e871074af | |
|
cfa8067a32 | |
|
a4e36e6f04 | |
|
5deea55b6a | |
|
9387d94b30 | |
|
b17bd6574f | |
|
9f3d7b9cff | |
|
510bd04c67 | |
|
58b6accc16 | |
|
07ac697db8 | |
|
4cea33945d | |
|
d3c1301efa | |
|
0d13612a27 | |
|
4b443e752f | |
|
8576ac9128 | |
|
14049351d5 | |
|
d18d55d66a | |
|
d45e5e350d | |
|
74955d73fc | |
|
bce87e4bc8 | |
|
cbdf29103c | |
|
d280b4b2dd | |
|
d9ec36e1de | |
|
86b25bbedd |
|
@ -32,8 +32,8 @@ For more documentation please see:
|
|||
|
||||
EFL is primarily developed on Linux (GNU/Linux) and should work on
|
||||
most distributions as long as dependencies are provided. It has been
|
||||
compiled and run also on Windows (using MSYS2 + mingw-w64 - please see
|
||||
[Phabricator windows docs](https://phab.enlightenment.org/w/windows)),
|
||||
compiled and run also on Windows (using MSYS2 + mingw-w64) - please see
|
||||
[windows docs](https://www.enlightenment.org/docs/distros/windows-start.md),
|
||||
Mac OS X, FreeBSD and NetBSD.
|
||||
|
||||
## Components
|
||||
|
@ -347,7 +347,7 @@ Required by default:
|
|||
* openjpeg2
|
||||
* gstreamer (Ensure all codecs you want are installed.)
|
||||
* zlib
|
||||
* luajit (lua 5.1 or 5.2 support optional)
|
||||
* lua (lua 5.1, luajit or lua 5.2 support optional)
|
||||
* libtiff
|
||||
* openssl
|
||||
* curl
|
||||
|
|
|
@ -337,7 +337,7 @@ color_tree {
|
|||
"/fg/normal/text-preedit";
|
||||
"/fg/normal/text-info";
|
||||
"/fg/normal/text-type";
|
||||
"/fg/nmormal/fileselector/pathsep";
|
||||
"/fg/normal/fileselector/pathsep";
|
||||
"/fg/selected/button/bar";
|
||||
"/fg/normal/button-anchor";
|
||||
"/fg/selected/thumb/bar";
|
||||
|
@ -406,6 +406,7 @@ color_tree {
|
|||
"/fg/normal/fileman/filesize/2";
|
||||
"/fg/selected/fileman/filesize/2";
|
||||
"/fg/normal/fileperm/execute";
|
||||
"/fg/normal/filegraph/bar";
|
||||
}
|
||||
":selected-alt-trans" {
|
||||
"/bg/normal/access";
|
||||
|
@ -475,6 +476,7 @@ color_tree {
|
|||
"/fg/normal/fileman/mount/off";
|
||||
"/fg/normal/progress/busy/2";
|
||||
"/fg/normal/gadgets/packagekit/pkg/low-priority";
|
||||
"/fg/normal/filegraph/bartop";
|
||||
}
|
||||
":light-high" {
|
||||
"/fg/normal/naviframe/top/overlap";
|
||||
|
@ -1292,7 +1294,7 @@ color_classes {
|
|||
// color_class { name: "/fg/disabled/flipselector/up";
|
||||
// color: 96 96 96 255; }
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// color_class { name: "/fg/nmormal/fileselector/pathsep";
|
||||
// color_class { name: "/fg/normal/fileselector/pathsep";
|
||||
// color: 51 153 255 255; }
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// color_class { name: "/bg/normal/button";
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
// Define this to enable a demo title blur
|
||||
//#define BLUR_TITLE 1
|
||||
// Define this to enable a demo blue behind everythnig - conflicts with title
|
||||
//#define BLUR_BEHIND 1
|
||||
|
||||
// Some values used if blur is enabled
|
||||
#define BLUR_FORCE_ALPHA 160
|
||||
#define BLUR_TITLE_AMOUNT "32"
|
||||
#define BLUR_BEHIND_AMOUNT "32"
|
||||
|
||||
group { name: "e/widgets/border/volume";
|
||||
images.image: "shadow_circle_vert.png" COMP;
|
||||
parts {
|
||||
|
@ -164,6 +174,15 @@ group { name: "e/widgets/border/default/border";
|
|||
}
|
||||
}
|
||||
WIN_SHAD("shadow_base", "shadow_clip", "win_shad_flat.png", 21, 21, 14, 28, 0.5)
|
||||
#ifdef BLUR_BEHIND
|
||||
snapshot { name: "title-blur"; mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "top";
|
||||
rel2.to: "bottom";
|
||||
filter.code: "padding_set { 0 } blur { "BLUR_BEHIND_AMOUNT", color = '#ffff' }";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
part { name: "client_clip"; type: RECT; mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to_y: "e.swallow.client";
|
||||
|
@ -193,12 +212,23 @@ group { name: "e/widgets/border/default/border";
|
|||
rel2.offset: -1 -1;
|
||||
}
|
||||
}
|
||||
#ifdef BLUR_TITLE
|
||||
snapshot { name: "title-blur"; mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel.to: "top";
|
||||
filter.code: "padding_set { 0 } blur { "BLUR_TITLE_AMOUNT", color = '#ffff' }";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
part { name: "top"; type: RECT; mouse_events: 0;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
rel2.to_y: "e.text.title";
|
||||
rel2.offset: -1 2;
|
||||
color_class: "/bg/normal/titlebar";
|
||||
#if defined(BLUR_TITLE) || defined(BLUR_BEHIND)
|
||||
color: 255 255 255 BLUR_FORCE_ALPHA;
|
||||
#endif
|
||||
offscale;
|
||||
}
|
||||
description { state: "focused" 0.0;
|
||||
|
@ -494,6 +524,9 @@ group { name: "e/widgets/border/default/border";
|
|||
description { state: "default" 0.0;
|
||||
color_class: "/bg/normal/border";
|
||||
rel.to: "bottom";
|
||||
#if defined(BLUR_BEHIND)
|
||||
color: 255 255 255 BLUR_FORCE_ALPHA;
|
||||
#endif
|
||||
}
|
||||
description { state: "focused" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
|
|
|
@ -263,7 +263,7 @@ group { "efl/border"; data.item: "version" "123";
|
|||
rel2.to_x: "event.minimize";
|
||||
rel2.to_y: "shadow_base";
|
||||
align: 0.5 0.0;
|
||||
color_class: "/fg/noemal/titlebar";
|
||||
color_class: "/fg/normal/titlebar";
|
||||
min: 0 16;
|
||||
text { font: FNBD; size: 10;
|
||||
text_class: "title_bar";
|
||||
|
@ -330,7 +330,7 @@ group { "efl/border"; data.item: "version" "123";
|
|||
rel.to: "event.close";
|
||||
min: 15 15; max: 15 15;
|
||||
fixed: 1 1;
|
||||
color_class: "/fg/noemal/titlebar/close";
|
||||
color_class: "/fg/normal/titlebar/close";
|
||||
}
|
||||
desc { "selected";
|
||||
inherit: "default";
|
||||
|
@ -345,7 +345,7 @@ group { "efl/border"; data.item: "version" "123";
|
|||
rel.to: "event.maximize";
|
||||
min: 15 15; max: 15 15;
|
||||
fixed: 1 1;
|
||||
color_class: "/fg/noemal/titlebar/maximize";
|
||||
color_class: "/fg/normal/titlebar/maximize";
|
||||
}
|
||||
desc { "selected";
|
||||
inherit: "default";
|
||||
|
|
|
@ -6,7 +6,7 @@ group { name: "elm/entry/path/separator/default";
|
|||
image.normal: "i-arrow-r";
|
||||
FIXED_SIZE(15, 15)
|
||||
aspect: 1.0 1.0;
|
||||
color_class: "/fg/nmormal/fileselector/pathsep";
|
||||
color_class: "/fg/normal/fileselector/pathsep";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -335,7 +335,7 @@ group { name: "elm/slider/horizontal/default";
|
|||
rel2.to_x: "elm.swallow.bar";
|
||||
}
|
||||
}
|
||||
part { name: "knob"; repeat_events: 1;
|
||||
part { name: "knob"; mouse_events: 0;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
|
@ -354,7 +354,7 @@ group { name: "elm/slider/horizontal/default";
|
|||
color_class: "/fg/disabled/slider/knob";
|
||||
}
|
||||
}
|
||||
part { name: "slideevent"; type: RECT; repeat_events: 1;
|
||||
part { name: "slideevent"; type: RECT; repeat_events: 0;
|
||||
scale: 1;
|
||||
ignore_flags: ON_HOLD;
|
||||
dragable.events: "elm.dragable.slider";
|
||||
|
@ -947,7 +947,7 @@ group { name: "elm/slider/vertical/default";
|
|||
rel2.to_y: "elm.swallow.bar";
|
||||
}
|
||||
}
|
||||
part { name: "knob"; repeat_events: 1;
|
||||
part { name: "knob"; mouse_events: 0;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
|
@ -966,7 +966,7 @@ group { name: "elm/slider/vertical/default";
|
|||
color_class: "/fg/disabled/slider/knob";
|
||||
}
|
||||
}
|
||||
part { name: "slideevent"; type: RECT; repeat_events: 1;
|
||||
part { name: "slideevent"; type: RECT; repeat_events: 0;
|
||||
scale: 1;
|
||||
ignore_flags: ON_HOLD;
|
||||
dragable.events: "elm.dragable.slider";
|
||||
|
@ -1614,7 +1614,7 @@ group { name: "elm/slider/range/horizontal/default";
|
|||
rel2.to_x: "elm.swallow.bar";
|
||||
}
|
||||
}
|
||||
part { name: "knob"; repeat_events: 1;
|
||||
part { name: "knob"; mouse_events: 0;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
|
@ -1633,7 +1633,7 @@ group { name: "elm/slider/range/horizontal/default";
|
|||
color_class: "/fg/disabled/slider/knob";
|
||||
}
|
||||
}
|
||||
part { name: "slideevent"; type: RECT; repeat_events: 1;
|
||||
part { name: "slideevent"; type: RECT; repeat_events: 0;
|
||||
scale: 1;
|
||||
ignore_flags: ON_HOLD;
|
||||
dragable.events: "elm.dragable.slider";
|
||||
|
@ -1677,7 +1677,7 @@ group { name: "elm/slider/range/horizontal/default";
|
|||
rel2.to_x: "elm.swallow.bar";
|
||||
}
|
||||
}
|
||||
part { name: "knob2"; repeat_events: 1;
|
||||
part { name: "knob2"; mouse_events: 0;
|
||||
clip_to: "enable2";
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
|
@ -1698,7 +1698,7 @@ group { name: "elm/slider/range/horizontal/default";
|
|||
color_class: "/fg/disabled/slider/knob";
|
||||
}
|
||||
}
|
||||
part { name: "slideevent2"; type: RECT; repeat_events: 1;
|
||||
part { name: "slideevent2"; type: RECT; repeat_events: 0;
|
||||
clip_to: "enable2";
|
||||
scale: 1;
|
||||
ignore_flags: ON_HOLD;
|
||||
|
@ -2298,7 +2298,7 @@ group { name: "elm/slider/range/vertical/default";
|
|||
rel2.to_y: "elm.swallow.bar";
|
||||
}
|
||||
}
|
||||
part { name: "knob"; repeat_events: 1;
|
||||
part { name: "knob"; mouse_events: 0;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
|
@ -2317,7 +2317,7 @@ group { name: "elm/slider/range/vertical/default";
|
|||
color_class: "/fg/disabled/slider/knob";
|
||||
}
|
||||
}
|
||||
part { name: "slideevent"; type: RECT; repeat_events: 1;
|
||||
part { name: "slideevent"; type: RECT; repeat_events: 0;
|
||||
scale: 1;
|
||||
ignore_flags: ON_HOLD;
|
||||
dragable.events: "elm.dragable.slider";
|
||||
|
@ -2361,7 +2361,7 @@ group { name: "elm/slider/range/vertical/default";
|
|||
rel2.to_y: "elm.swallow.bar";
|
||||
}
|
||||
}
|
||||
part { name: "knob2"; repeat_events: 1;
|
||||
part { name: "knob2"; mouse_events: 0;
|
||||
clip_to: "enable2";
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
|
@ -2381,7 +2381,7 @@ group { name: "elm/slider/range/vertical/default";
|
|||
color_class: "/fg/disabled/slider/knob";
|
||||
}
|
||||
}
|
||||
part { name: "slideevent2"; type: RECT; repeat_events: 1;
|
||||
part { name: "slideevent2"; type: RECT; repeat_events: 0;
|
||||
clip_to: "enable2";
|
||||
scale: 1;
|
||||
ignore_flags: ON_HOLD;
|
||||
|
|
|
@ -1065,6 +1065,263 @@ group { name: "e/fileman/default/filedate";
|
|||
}
|
||||
}
|
||||
|
||||
group { name: "e/fileman/default/check";
|
||||
parts {
|
||||
part { name: "base";
|
||||
clip_to: "selected";
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
image.normal: "i-check";
|
||||
rel1.offset: 3 3;
|
||||
rel2.offset: -4 -4;
|
||||
min: 15 15;
|
||||
max: 15 15;
|
||||
visible: 0;
|
||||
offscale;
|
||||
}
|
||||
description { state: "on" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "selected"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
rel.to: "base";
|
||||
color_class: "/fg/normal/fileman/item/check/check";
|
||||
}
|
||||
description { state: "selected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color_class: "/fg/selected/fileman/item/check/check";
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { signal: "e,state,selected"; source: "e";
|
||||
action: STATE_SET "selected" 0.0;
|
||||
target: "selected";
|
||||
}
|
||||
program { signal: "e,state,unselected"; source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "selected";
|
||||
}
|
||||
program { signal: "e,state,on"; source: "e";
|
||||
action: STATE_SET "on" 0.0;
|
||||
target: "base";
|
||||
}
|
||||
program { signal: "e,state,off"; source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "base";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/fileman/default/circle";
|
||||
script {
|
||||
hex(str[], len) {
|
||||
new i, val = 0;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
val <<= 4;
|
||||
if ((str[i] >= '0') && (str[i] <= '9')) {
|
||||
val += str[i] - '0';
|
||||
} else if ((str[i] >= 'a') && (str[i] <= 'f')) {
|
||||
val += 10 + str[i] - 'a';
|
||||
} else if ((str[i] >= 'A') && (str[i] <= 'F')) {
|
||||
val += 10 + str[i] - 'A';
|
||||
}
|
||||
}
|
||||
return val;
|
||||
}
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_STRING) && (id == 1)) {
|
||||
new cc[256];
|
||||
|
||||
getsarg(2, cc, 255);
|
||||
custom_state(PART:"base", "default", 0.0);
|
||||
if (!strncmp(cc, "cc:", 3)) {
|
||||
strcpy(cc, cc[3]);
|
||||
set_state_val(PART:"base", STATE_COLOR, 255, 255, 255, 255);
|
||||
set_state_val(PART:"base", STATE_COLOR_CLASS, cc);
|
||||
} else if (!strncmp(cc, "#", 1)) {
|
||||
new r = 255, g = 255, b = 255, a = 255;
|
||||
|
||||
strcpy(cc, cc[1]);
|
||||
if (strlen(cc) == 3) { // #35a
|
||||
r = hex(cc[0], 1);
|
||||
g = hex(cc[1], 1);
|
||||
b = hex(cc[2], 1);
|
||||
} else if (strlen(cc) == 4) { // #35af
|
||||
r = hex(cc[0], 1);
|
||||
g = hex(cc[1], 1);
|
||||
b = hex(cc[2], 1);
|
||||
a = hex(cc[3], 1);
|
||||
} else if (strlen(cc) == 6) { // #3355aa
|
||||
r = hex(cc[0], 2);
|
||||
g = hex(cc[2], 2);
|
||||
b = hex(cc[4], 2);
|
||||
} else if (strlen(cc) == 8) { // #3355aaff
|
||||
r = hex(cc[0], 2);
|
||||
g = hex(cc[2], 2);
|
||||
b = hex(cc[4], 2);
|
||||
a = hex(cc[6], 2);
|
||||
}
|
||||
set_state_val(PART:"base", STATE_COLOR, r, g, b, a);
|
||||
set_state_val(PART:"base", STATE_COLOR_CLASS, "");
|
||||
}
|
||||
set_state(PART:"base", "custom", 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
set { name: "file-circle-outline";
|
||||
image { image: "speaker-clip-160.png" COMP; size: 81 81 99999 99999; }
|
||||
image { image: "speaker-clip-080.png" COMP; size: 41 41 80 80 99999; }
|
||||
image { image: "speaker-clip-040.png" COMP; size: 0 0 40 40; }
|
||||
}
|
||||
part { name: "base"; mouse_events: 0;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
min: 15 15;
|
||||
max: 15 15;
|
||||
rel1.offset: 3 3;
|
||||
rel2.offset: -4 -4;
|
||||
image.normal: "i-radio";
|
||||
offscale;
|
||||
fixed: 1 1;
|
||||
}
|
||||
}
|
||||
part { name: "circle"; mouse_events: 0;
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
min: 17 17;
|
||||
max: 17 17;
|
||||
rel.to: "base";
|
||||
image.normal: "file-circle-outline";
|
||||
fixed: 1 1;
|
||||
color_class: "/fg/selected/list/item";
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "selected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { signal: "e,state,selected"; source: "e";
|
||||
action: STATE_SET "selected" 0.0;
|
||||
target: "circle";
|
||||
}
|
||||
program { signal: "e,state,unselected"; source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "circle";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/fileman/default/graph/base";
|
||||
parts {
|
||||
part { name: "e.swallow.content"; type: SWALLOW; scale;
|
||||
description { state: "default" 0.0; offscale;
|
||||
rel1 { offset: 2 2; }
|
||||
rel2 { offset: -3 -3; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/fileman/default/graph/bar";
|
||||
script {
|
||||
hex(str[], len) {
|
||||
new i, val = 0;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
val <<= 4;
|
||||
if ((str[i] >= '0') && (str[i] <= '9')) {
|
||||
val += str[i] - '0';
|
||||
} else if ((str[i] >= 'a') && (str[i] <= 'f')) {
|
||||
val += 10 + str[i] - 'a';
|
||||
} else if ((str[i] >= 'A') && (str[i] <= 'F')) {
|
||||
val += 10 + str[i] - 'A';
|
||||
}
|
||||
}
|
||||
return val;
|
||||
}
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_STRING) && (id == 1)) {
|
||||
new cc[256];
|
||||
|
||||
getsarg(2, cc, 255);
|
||||
custom_state(PART:"base", "default", 0.0);
|
||||
if (!strncmp(cc, "cc:", 3)) {
|
||||
strcpy(cc, cc[3]);
|
||||
set_state_val(PART:"base", STATE_COLOR, 255, 255, 255, 255);
|
||||
set_state_val(PART:"base", STATE_COLOR_CLASS, cc);
|
||||
} else if (!strncmp(cc, "#", 1)) {
|
||||
new r = 255, g = 255, b = 255, a = 255;
|
||||
|
||||
strcpy(cc, cc[1]);
|
||||
if (strlen(cc) == 3) { // #35a
|
||||
r = hex(cc[0], 1);
|
||||
g = hex(cc[1], 1);
|
||||
b = hex(cc[2], 1);
|
||||
} else if (strlen(cc) == 4) { // #35af
|
||||
r = hex(cc[0], 1);
|
||||
g = hex(cc[1], 1);
|
||||
b = hex(cc[2], 1);
|
||||
a = hex(cc[3], 1);
|
||||
} else if (strlen(cc) == 6) { // #3355aa
|
||||
r = hex(cc[0], 2);
|
||||
g = hex(cc[2], 2);
|
||||
b = hex(cc[4], 2);
|
||||
} else if (strlen(cc) == 8) { // #3355aaff
|
||||
r = hex(cc[0], 2);
|
||||
g = hex(cc[2], 2);
|
||||
b = hex(cc[4], 2);
|
||||
a = hex(cc[6], 2);
|
||||
}
|
||||
set_state_val(PART:"base", STATE_COLOR, r, g, b, a);
|
||||
set_state_val(PART:"base", STATE_COLOR_CLASS, "");
|
||||
}
|
||||
set_state(PART:"base", "custom", 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "drag_base"; type: SPACER; scale;
|
||||
description { state: "default" 0.0; offscale;
|
||||
rel1 { offset: 1 1; }
|
||||
rel2 { offset: -2 -2; }
|
||||
}
|
||||
}
|
||||
part { name: "base"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to_y: "e.dragable.value";
|
||||
rel2.to: "drag_base";
|
||||
color_class: "/fg/normal/filegraph/bar";
|
||||
}
|
||||
}
|
||||
part { name: "top"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
rel.to: "base";
|
||||
rel2.relative: 1.0 0.0;
|
||||
rel2.offset: -1 0;
|
||||
color_class: "/fg/normal/filegraph/bartop";
|
||||
}
|
||||
}
|
||||
part { name: "e.dragable.value"; type: SPACER;
|
||||
dragable.x: 0 0 0;
|
||||
dragable.y: 1 1 0;
|
||||
dragable.confine: "drag_base";
|
||||
description { state: "default" 0.0;
|
||||
min: 0 1;
|
||||
max: 99999 1;
|
||||
fixed: 1 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/fileman/default/list/detailed";
|
||||
inherit: "e/fileman/default/list/variable";
|
||||
parts {
|
||||
|
@ -1094,6 +1351,20 @@ group { name: "e/fileman/default/list/detailed";
|
|||
color_class: "/fg/disabled/list/item"; \
|
||||
} \
|
||||
}
|
||||
part { name: "e.text.label";
|
||||
description { state: "default" 0.0;
|
||||
rel2.to_x: "e.swallow.detail1";
|
||||
rel2.relative: 0.0 1.0;
|
||||
}
|
||||
description { state: "selected" 0.0;
|
||||
rel2.to_x: "e.swallow.detail1";
|
||||
rel2.relative: 0.0 1.0;
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
rel2.to_x: "e.swallow.detail1";
|
||||
rel2.relative: 0.0 1.0;
|
||||
}
|
||||
}
|
||||
DETAILTEXT("e.text.detail1", "e.swallow.detail1", "e.text.label")
|
||||
DETAILTEXT("e.text.detail2", "e.swallow.detail2", "e.text.detail1")
|
||||
DETAILTEXT("e.text.detail3", "e.swallow.detail3", "e.text.detail2")
|
||||
|
@ -1119,15 +1390,15 @@ group { name: "e/fileman/default/list/detailed";
|
|||
target: "e.text.detail5";
|
||||
target: "e.text.detail6";
|
||||
}
|
||||
part { name: "e.swallow.detail6"; type: SWALLOW; nomouse; scale;
|
||||
insert_after: "e.text.detail6";
|
||||
part { name: "e.swallow.detail6"; type: SWALLOW; scale;
|
||||
insert_after: "e.swallow.entry";
|
||||
description { state: "default" 0.0; offscale;
|
||||
align: 1.0 0.5; min: 15 5;
|
||||
rel1 { offset: -5 0; relative: 1.0 0.0; }
|
||||
rel2 { offset: -5 -1; relative: 1.0 1.0; }
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.detail5"; type: SWALLOW; nomouse; scale;
|
||||
part { name: "e.swallow.detail5"; type: SWALLOW; scale;
|
||||
insert_after: "e.swallow.detail6";
|
||||
description { state: "default" 0.0; offscale;
|
||||
align: 1.0 0.5; min: 20 5;
|
||||
|
@ -1135,7 +1406,7 @@ group { name: "e/fileman/default/list/detailed";
|
|||
rel2 { to_x: "e.swallow.detail6"; offset: -1 -1; relative: 0.0 1.0; }
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.detail4"; type: SWALLOW; nomouse; scale;
|
||||
part { name: "e.swallow.detail4"; type: SWALLOW; scale;
|
||||
insert_after: "e.swallow.detail5";
|
||||
description { state: "default" 0.0; offscale;
|
||||
align: 1.0 0.5; min: 20 5;
|
||||
|
@ -1143,7 +1414,7 @@ group { name: "e/fileman/default/list/detailed";
|
|||
rel2 { to_x: "e.swallow.detail5"; offset: -1 -1; relative: 0.0 1.0; }
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.detail3"; type: SWALLOW; nomouse; scale;
|
||||
part { name: "e.swallow.detail3"; type: SWALLOW; scale;
|
||||
insert_after: "e.swallow.detail4";
|
||||
description { state: "default" 0.0; offscale;
|
||||
align: 1.0 0.5; min: 20 5;
|
||||
|
@ -1151,7 +1422,7 @@ group { name: "e/fileman/default/list/detailed";
|
|||
rel2 { to_x: "e.swallow.detail4"; offset: -1 -1; relative: 0.0 1.0; }
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.detail2"; type: SWALLOW; nomouse; scale;
|
||||
part { name: "e.swallow.detail2"; type: SWALLOW; scale;
|
||||
insert_after: "e.swallow.detail3";
|
||||
description { state: "default" 0.0; offscale;
|
||||
align: 1.0 0.5; min: 20 5;
|
||||
|
@ -1159,7 +1430,7 @@ group { name: "e/fileman/default/list/detailed";
|
|||
rel2 { to_x: "e.swallow.detail3"; offset: -1 -1; relative: 0.0 1.0; }
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.detail1"; type: SWALLOW; nomouse; scale;
|
||||
part { name: "e.swallow.detail1"; type: SWALLOW; scale;
|
||||
insert_after: "e.swallow.detail2";
|
||||
description { state: "default" 0.0; offscale;
|
||||
align: 1.0 0.5; min: 20 5;
|
||||
|
@ -1167,20 +1438,6 @@ group { name: "e/fileman/default/list/detailed";
|
|||
rel2 { to_x: "e.swallow.detail2"; offset: -1 -1; relative: 0.0 1.0; }
|
||||
}
|
||||
}
|
||||
part { name: "e.text.label";
|
||||
description { state: "default" 0.0;
|
||||
rel2.to_x: "e.swallow.detail1";
|
||||
rel2.relative: 0.0 1.0;
|
||||
}
|
||||
description { state: "selected" 0.0;
|
||||
rel2.to_x: "e.swallow.detail1";
|
||||
rel2.relative: 0.0 1.0;
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
rel2.to_x: "e.swallow.detail1";
|
||||
rel2.relative: 0.0 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -889,6 +889,7 @@ ICON("preferences-desktop-screensaver", "i-screen")
|
|||
ICON("preferences-desktop-wallpaper", "i-picture-landscape")
|
||||
ICON("preferences-system", "i-gear")
|
||||
ICON("preferences-other", "i-gear-spanner")
|
||||
ICON("preferences-etc", "i-utilities")
|
||||
ICON("system-file-manager", "i-folder")
|
||||
ICON("applications-accessories", "i-scissor-rule")
|
||||
ICON("applications-development", "i-gear-curly-braces")
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
// Define this to enable blur background to winlist
|
||||
//#define BLUR_WINLIST 1
|
||||
|
||||
// Some values used if blur is enabled
|
||||
#define BLUR_WINLIST_AMOUNT "48"
|
||||
|
||||
group { name: "e/widgets/winlist/main";
|
||||
parts {
|
||||
part { name: "base"; type: RECT; mouse_events: 0;
|
||||
|
@ -270,27 +276,27 @@ group { name: "e/widgets/winlist/large/bg";
|
|||
color: 255 255 255 255; // no cc
|
||||
}
|
||||
}
|
||||
/*
|
||||
#ifdef BLUR_WINLIST
|
||||
snapshot { "bg_blur";
|
||||
clip_to: "bg_clip";
|
||||
description { state: "default" 0.0;
|
||||
filter.code: "padding_set { 0 } blur { state.pos * 50, color = '#ffff' }";
|
||||
filter.code: "padding_set { 0 } blur { state.pos * "BLUR_WINLIST_AMOUNT", color = '#ffff' }";
|
||||
visible: 0;
|
||||
}
|
||||
desc { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
filter.code: "padding_set { 0 } blur { (1.0 - state.pos) * 50, color = '#ffff' }";
|
||||
filter.code: "padding_set { 0 } blur { (1.0 - state.pos) * "BLUR_WINLIST_AMOUNT", color = '#ffff' }";
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
part { name: "bg_darken"; type: RECT;
|
||||
clip_to: "bg_clip";
|
||||
description { state: "default" 0.0;
|
||||
color_class: "/dim/normal/winlist/base";
|
||||
}
|
||||
}
|
||||
/*
|
||||
#ifdef BLUR_WINLIST
|
||||
part { name: "shadow"; mouse_events: 0;
|
||||
clip_to: "bg_clip";
|
||||
description { state: "default" 0.0;
|
||||
|
@ -298,26 +304,26 @@ group { name: "e/widgets/winlist/large/bg";
|
|||
rel2.relative: 2.0 2.0;
|
||||
image.normal: "screen_circular_shadow.png";
|
||||
fill.smooth: 0;
|
||||
color: 255 255 255 0; // no cc
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit;
|
||||
rel1.relative: 0.0 0.0;
|
||||
rel2.relative: 1.0 1.0;
|
||||
color: 255 255 255 255; // no cc
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
programs {
|
||||
program { signal: "e,state,visible,on"; source: "e";
|
||||
action: STATE_SET "visible" 0.0;
|
||||
transition: DECELERATE 0.2 USE_DURATION_FACTOR 1 CURRENT;
|
||||
target: "bg_clip";
|
||||
// target: "bg_blur";
|
||||
// target: "shadow";
|
||||
#ifdef BLUR_WINLIST
|
||||
target: "bg_blur";
|
||||
target: "shadow";
|
||||
#endif
|
||||
after: "show2";
|
||||
}
|
||||
program { name: "show2";
|
||||
|
@ -327,8 +333,10 @@ group { name: "e/widgets/winlist/large/bg";
|
|||
action: STATE_SET "default" 0.0;
|
||||
transition: ACCELERATE 0.2 USE_DURATION_FACTOR 1 CURRENT;
|
||||
target: "bg_clip";
|
||||
// target: "bg_blur";
|
||||
// target: "shadow";
|
||||
#ifdef BLUR_WINLIST
|
||||
target: "bg_blur";
|
||||
target: "shadow";
|
||||
#endif
|
||||
after: "hide2";
|
||||
}
|
||||
program { name: "hide2";
|
||||
|
|
|
@ -360,7 +360,7 @@ I160("i-monitor-speakers", "monitor-speakers")
|
|||
I160("i-briefcase", "briefcase")
|
||||
I160("i-app-window", "app-window")
|
||||
I160("i-beaker", "beaker")
|
||||
// not used yet I160("i-utilities", "utilities")
|
||||
I160("i-utilities", "utilities")
|
||||
I160("i-sun", "sun")
|
||||
I160("i-moon", "moon")
|
||||
I160("i-moon-clouds", "moon-clouds")
|
||||
|
|
11
meson.build
11
meson.build
|
@ -1,5 +1,5 @@
|
|||
project('efl', ['c','cpp'],
|
||||
version: '1.26.99',
|
||||
version: '1.27.99',
|
||||
default_options : ['buildtype=plain', 'warning_level=1', 'cpp_std=c++11'],
|
||||
meson_version : '>=0.50'
|
||||
)
|
||||
|
@ -118,6 +118,7 @@ if sys_windows
|
|||
error('Version of targetted Windows incorrect')
|
||||
endif
|
||||
add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: langs)
|
||||
add_global_arguments('-define:WIN32', language: 'cs')
|
||||
endif
|
||||
|
||||
if sys_sun
|
||||
|
@ -617,9 +618,11 @@ foreach evas_loader_map_inst : evas_loader_map
|
|||
meson.add_install_script('meson/evas_loader_conf.sh', evas_loader_original, evas_loader_link_types)
|
||||
endforeach
|
||||
|
||||
doxygen = find_program('doxygen', required : false)
|
||||
|
||||
if doxygen.found()
|
||||
doxygen = find_program('doxygen', required : get_option('docs'))
|
||||
if get_option('docs')
|
||||
if not doxygen.found()
|
||||
error('Need doxygen for docs')
|
||||
endif
|
||||
subdir('doc')
|
||||
endif
|
||||
|
||||
|
|
|
@ -330,7 +330,7 @@ option('dotnet',
|
|||
option('lua-interpreter',
|
||||
type: 'combo',
|
||||
choices: ['luajit', 'lua'],
|
||||
value: 'luajit',
|
||||
value: 'lua',
|
||||
description: 'Which Lua back-end library to use in efl'
|
||||
)
|
||||
|
||||
|
@ -382,3 +382,15 @@ option('max-fd-size',
|
|||
value : '8192',
|
||||
description : 'This is the maximim set of fds and thus maximum fd value allowed +1 in the ecore main loop handler'
|
||||
)
|
||||
|
||||
option('docs',
|
||||
type: 'boolean',
|
||||
value: false,
|
||||
description: 'Enable building C of documentation (Requires doxygen)'
|
||||
)
|
||||
|
||||
option('embedded-libunibreak',
|
||||
type : 'boolean',
|
||||
value : true,
|
||||
description : 'Use the embedded in-tree libunibreak instead of the system libunibreak.'
|
||||
)
|
||||
|
|
|
@ -68,7 +68,7 @@ do
|
|||
if [ $? -ne 0 ]; then
|
||||
echo "Failed compiling eet file."
|
||||
echo "Press 'Return' to reopen the editor, or ^C to abort."
|
||||
read
|
||||
read _dummy
|
||||
else
|
||||
DONE=1
|
||||
fi
|
||||
|
|
|
@ -3376,7 +3376,7 @@ _profiles_list_unselect_cb(void *data EINA_UNUSED,
|
|||
Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
if (elm_list_selected_item_get(obj)) return;
|
||||
if (!elm_list_selected_item_get(obj)) return;
|
||||
elm_object_disabled_set(evas_object_data_get(obj, "prof_del_btn"),
|
||||
EINA_TRUE);
|
||||
elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"),
|
||||
|
@ -4086,9 +4086,9 @@ _status_config_scrolling(Evas_Object *win,
|
|||
evas_object_smart_callback_add(sl, "delay,changed", smooth_win_change, NULL);
|
||||
|
||||
|
||||
evas_object_data_set(win, "scrolling", sc);
|
||||
evas_object_data_set(win, "scrolling", bx);
|
||||
|
||||
elm_naviframe_item_simple_push(naviframe, sc);
|
||||
elm_naviframe_item_simple_push(naviframe, bx);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -4383,11 +4383,16 @@ _status_config_full(Evas_Object *win,
|
|||
"Audio", _cf_audio, win);
|
||||
elm_toolbar_item_append(tb, "preferences-profile",
|
||||
"Profiles", _cf_profiles, win);
|
||||
elm_toolbar_item_append(tb, NULL, "Scrolling", _cf_scrolling, win);
|
||||
elm_toolbar_item_append(tb, NULL, "Rendering", _cf_rendering, win);
|
||||
elm_toolbar_item_append(tb, NULL, "Caches", _cf_caches, win);
|
||||
elm_toolbar_item_append(tb, NULL, "Focus", _cf_focus, win);
|
||||
elm_toolbar_item_append(tb, NULL, "Etc", _cf_etc, win);
|
||||
elm_toolbar_item_append(tb, "system-run",
|
||||
"Scrolling", _cf_scrolling, win);
|
||||
elm_toolbar_item_append(tb, "preferences-desktop",
|
||||
"Rendering", _cf_rendering, win);
|
||||
elm_toolbar_item_append(tb, "appointment-new",
|
||||
"Caches", _cf_caches, win);
|
||||
elm_toolbar_item_append(tb, "magnifying-glass",
|
||||
"Focus", _cf_focus, win);
|
||||
elm_toolbar_item_append(tb, "preferences-etc",
|
||||
"Etc", _cf_etc, win);
|
||||
|
||||
elm_box_pack_end(bx0, tb);
|
||||
evas_object_show(tb);
|
||||
|
|
|
@ -497,7 +497,7 @@ test_focus(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_inf
|
|||
}
|
||||
|
||||
{
|
||||
Evas_Object *rd, *rdg;
|
||||
Evas_Object *rd, *rdg = NULL;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
|
|
|
@ -487,7 +487,7 @@ char * get_fit_status(Eo * textblock)
|
|||
void
|
||||
test_textblock_fit(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
app = calloc(sizeof(APP), 1);
|
||||
app = calloc(1, sizeof(APP));
|
||||
|
||||
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||
|
||||
|
@ -616,7 +616,7 @@ static void _btn_clicked_mem(void *data EINA_UNUSED, Eo *obj, void *eventInfo EI
|
|||
void
|
||||
test_text_memory(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
app_mem = calloc(sizeof(APP_MEM), 1);
|
||||
app_mem = calloc(1, sizeof(APP_MEM));
|
||||
|
||||
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||
|
||||
|
|
|
@ -14,17 +14,25 @@ map = run_command('map_generate.sh').stdout()
|
|||
|
||||
efl_libs = configuration_data()
|
||||
efl_libs.set('EFL_MONO_LIBRARY_MAP', map)
|
||||
efl_libs.set('CUSTOM_EXPORTS_MONO_DL_MONO', 'eflcustomexportsmono')
|
||||
efl_libs.set('EVIL_DL_MONO', 'dl')
|
||||
if sys_osx
|
||||
efl_libs.set('LIBDL_DL_MONO', 'dl.dylib')
|
||||
efl_libs.set('CUSTOM_EXPORTS_MONO_DL_MONO', 'eflcustomexportsmono')
|
||||
elif sys_windows
|
||||
efl_libs.set('LIBDL_DL_MONO', 'libdl.dll')
|
||||
efl_libs.set('CUSTOM_EXPORTS_MONO_DL_MONO', 'libeflcustomexportsmono' + '-' + version_major)
|
||||
else
|
||||
efl_libs.set('LIBDL_DL_MONO', 'libdl.so')
|
||||
efl_libs.set('CUSTOM_EXPORTS_MONO_DL_MONO', 'eflcustomexportsmono')
|
||||
endif
|
||||
|
||||
foreach mono_libs : mono_sublibs
|
||||
key = mono_libs[0].to_upper()+'_DL_MONO'
|
||||
efl_libs.set(key, mono_libs[0].to_lower())
|
||||
if target_machine.system() == 'windows'
|
||||
efl_libs.set(key, 'lib' + mono_libs[0].to_lower() + '-' + version_major)
|
||||
else
|
||||
efl_libs.set(key, mono_libs[0].to_lower())
|
||||
endif
|
||||
endforeach
|
||||
|
||||
configure_file(
|
||||
|
|
|
@ -17,12 +17,13 @@
|
|||
<!-- </PropertyGroup> -->
|
||||
<PropertyGroup>
|
||||
<DefineConstants>@EFL_BETA@</DefineConstants>
|
||||
<DefineConstants>@EFL_WIN32@</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="@BINDING_SRC@/efl_mono/*.cs" />
|
||||
<!-- FIXME Windows support -->
|
||||
<Compile Include="@BINDING_SRC@/eo_mono/*.cs" Exclude="@BINDING_SRC@/eo_mono/*Windows.cs" />
|
||||
<Compile Include="@BINDING_SRC@/eo_mono/*.cs" />
|
||||
<Compile Include="@BINDING_SRC@/eina_mono/*.cs" />
|
||||
<Compile Include="@BINDING_SRC@/eolian_mono/*.cs" />
|
||||
<Compile Include="@BINDING_SRC@/eldbus_mono/*.cs" />
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#if !WIN32
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
@ -40,3 +42,5 @@ internal static partial class FunctionInterop
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -13,19 +13,26 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if WIN32
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Efl.Eo
|
||||
{
|
||||
|
||||
static partial class FunctionInterop
|
||||
internal static partial class FunctionInterop
|
||||
{
|
||||
[DllImport(efl.Libs.Libdl)]
|
||||
[DllImport(efl.Libs.Kernel32, CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)]
|
||||
internal static extern IntPtr GetProcAddress(IntPtr handle, string symbol);
|
||||
|
||||
private static IntPtr LoadFunctionPointer(IntPtr nativeLibraryHandle, string functionName)
|
||||
=> FunctionInterop.GetProcAddress(nativeLibraryHandle, functionName);
|
||||
private static IntPtr dlsym(IntPtr handle, string symbol) => FunctionInterop.GetProcAddress(handle, symbol);
|
||||
|
||||
internal static IntPtr LoadFunctionPointer(IntPtr nativeLibraryHandle, string functionName) =>
|
||||
FunctionInterop.GetProcAddress(nativeLibraryHandle, functionName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -13,6 +13,8 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#if !WIN32
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
@ -98,3 +100,5 @@ internal partial class NativeModule
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -13,16 +13,32 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#if WIN32
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Efl.Eo
|
||||
{
|
||||
|
||||
internal class partial NativeModule
|
||||
internal partial class NativeModule
|
||||
{
|
||||
[DllImport(efl.Libs.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
internal static extern IntPtr LoadLibrary(string libFilename);
|
||||
[DllImport(efl.Libs.Kernel32, EntryPoint = "LoadLibrary", CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
private static extern IntPtr _LoadLibrary(string libFilename);
|
||||
|
||||
internal static IntPtr LoadLibrary(string libFilename)
|
||||
{
|
||||
if (!libFilename.StartsWith("lib"))
|
||||
{
|
||||
libFilename = "lib" + libFilename + "-1";
|
||||
}
|
||||
return NativeModule._LoadLibrary(libFilename);
|
||||
}
|
||||
|
||||
[DllImport(efl.Libs.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
internal static extern void UnloadLibrary(IntPtr handle);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -81,7 +81,7 @@ internal static class Globals
|
|||
efl_ref(IntPtr eo);
|
||||
internal delegate void
|
||||
efl_unref_delegate(IntPtr eo);
|
||||
[DllImport(efl.Libs.CustomExports)] internal static extern void
|
||||
[DllImport(efl.Libs.Eo)] internal static extern void
|
||||
efl_unref(IntPtr eo);
|
||||
internal delegate int
|
||||
efl_ref_count_delegate(IntPtr eo);
|
||||
|
|
|
@ -4,11 +4,9 @@ mono_files += files(
|
|||
'FunctionWrapper.cs',
|
||||
'NativeModule.cs',
|
||||
'EoWrapper.cs',
|
||||
'WrapperSupervisor.cs'
|
||||
'WrapperSupervisor.cs',
|
||||
'FunctionWrapper_Windows.cs',
|
||||
'NativeModule_Windows.cs',
|
||||
'FunctionWrapper_Unix.cs',
|
||||
'NativeModule_Unix.cs'
|
||||
)
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
mono_files += files('FunctionWrapper_Windows.cs', 'NativeModule_Windows.cs')
|
||||
else
|
||||
mono_files += files('FunctionWrapper_Unix.cs', 'NativeModule_Unix.cs')
|
||||
endif
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
cmake = import('cmake')
|
||||
opt_var = cmake.subproject_options()
|
||||
opt_var.set_override_option('cpp_std', 'c++17')
|
||||
|
||||
inc_dir = include_directories(join_paths('..', '..', '..', 'bin', 'eolian_mono'))
|
||||
|
||||
eolian_mono_gen_bin = executable('eolian_mono',
|
||||
|
|
|
@ -81,6 +81,11 @@ foreach lib : mono_sublibs
|
|||
package_name = lib[0].to_lower()
|
||||
eo_file_subdirs = get_variable(package_name + '_eo_subdirs')
|
||||
file_location = join_paths('..', '..', 'lib', package_name)
|
||||
dllimport = package_name
|
||||
|
||||
if target_machine.system() == 'windows'
|
||||
dllimport = 'lib' + dllimport + '-' + version_major
|
||||
endif
|
||||
|
||||
if (package_name != 'eldbus')
|
||||
foreach eo_file_subdir : eo_file_subdirs
|
||||
|
@ -101,7 +106,7 @@ foreach lib : mono_sublibs
|
|||
input : join_paths(subdir_file_location, mono_gen_file),
|
||||
output : [mono_gen_file + '.cs'],
|
||||
command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories,
|
||||
'--dllimport', package_name,
|
||||
'--dllimport', dllimport,
|
||||
'-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
|
||||
'-e', get_option('mono-examples-dir'), partial,
|
||||
'@INPUT@'])
|
||||
|
@ -211,7 +216,22 @@ if (get_option('dotnet'))
|
|||
# The major version should be enough for now while we don't have to deal
|
||||
# with minor differences and dotnet core is far from version 10
|
||||
dotnet_major_version = dotnet_version.stdout().strip()[0].to_int()
|
||||
if dotnet_major_version == 3
|
||||
if dotnet_major_version == 8
|
||||
dotnet_core_app_version = '8.0'
|
||||
dotnet_standard_version = '2.1'
|
||||
elif dotnet_major_version == 7
|
||||
dotnet_core_app_version = '7.0'
|
||||
dotnet_standard_version = '2.1'
|
||||
elif dotnet_major_version == 6
|
||||
dotnet_core_app_version = '6.0'
|
||||
dotnet_standard_version = '2.1'
|
||||
elif dotnet_major_version == 5
|
||||
dotnet_core_app_version = '5.0'
|
||||
dotnet_standard_version = '2.1'
|
||||
elif dotnet_major_version == 4
|
||||
dotnet_core_app_version = '4.0'
|
||||
dotnet_standard_version = '2.1'
|
||||
elif dotnet_major_version == 3
|
||||
dotnet_core_app_version = '3.0'
|
||||
dotnet_standard_version = '2.1'
|
||||
elif dotnet_major_version == 2
|
||||
|
@ -232,6 +252,13 @@ if (get_option('dotnet'))
|
|||
lib_csproj_conf_data.set('EFL_BETA', '')
|
||||
endif
|
||||
|
||||
if target_machine.system() == 'windows'
|
||||
lib_csproj_conf_data.set('EFL_WIN32', 'WIN32')
|
||||
else
|
||||
lib_csproj_conf_data.set('EFL_WIN32', '')
|
||||
endif
|
||||
|
||||
|
||||
lib_csproj = configure_file(input: 'efl_sharp.csproj.in',
|
||||
output: 'efl_sharp.csproj',
|
||||
configuration: lib_csproj_conf_data)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Compile with:
|
||||
// gcc -o ecore_audio_custom ecore_audio_custom.c `pkg-config --libs --cflags ecore ecore-audio`
|
||||
#define EFL_BETA_API_SUPPORT
|
||||
#ifndef EFL_BETA_API_SUPPORT
|
||||
# define EFL_BETA_API_SUPPORT
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Compile with:
|
||||
// gcc -o ecore_audio_playback ecore_audio_playback.c `pkg-config --libs --cflags ecore eina ecore-audio`
|
||||
#define EFL_BETA_API_SUPPORT
|
||||
#ifndef EFL_BETA_API_SUPPORT
|
||||
# define EFL_BETA_API_SUPPORT
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Compile with:
|
||||
// gcc -o ecore_audio_to_ogg ecore_audio_to_ogg.c `pkg-config --libs --cflags ecore eina ecore-audio`
|
||||
#define EFL_BETA_API_SUPPORT
|
||||
#ifndef EFL_BETA_API_SUPPORT
|
||||
# define EFL_BETA_API_SUPPORT
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <libgen.h>
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: UTF-8\n"
|
||||
|
||||
msgid "LOADING"
|
||||
msgstr "Loading..."
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: UTF-8\n"
|
||||
|
||||
msgid "LOADING"
|
||||
msgstr "लोड हो रहा है..."
|
||||
|
||||
|
|
|
@ -33,6 +33,14 @@ struct _ecore_exe_dead_exe
|
|||
char *cmd;
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
* this job is used to close child processes when parent one is closed
|
||||
* see https://stackoverflow.com/a/53214/688348
|
||||
*/
|
||||
HANDLE _ecore_exe_win32_job = NULL;
|
||||
#endif
|
||||
|
||||
EAPI int ECORE_EXE_EVENT_ADD = 0;
|
||||
EAPI int ECORE_EXE_EVENT_DEL = 0;
|
||||
EAPI int ECORE_EXE_EVENT_DATA = 0;
|
||||
|
@ -338,6 +346,21 @@ ecore_exe_hup(Ecore_Exe *obj)
|
|||
void
|
||||
_ecore_exe_init(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
_ecore_exe_win32_job = CreateJobObject( NULL, NULL);
|
||||
if (_ecore_exe_win32_job)
|
||||
{
|
||||
JOBOBJECT_EXTENDED_LIMIT_INFORMATION jeli;
|
||||
|
||||
memset (&jeli, 0, sizeof(jeli));
|
||||
jeli.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
|
||||
if (!SetInformationJobObject(_ecore_exe_win32_job, JobObjectExtendedLimitInformation, &jeli, sizeof(jeli)))
|
||||
{
|
||||
CloseHandle(_ecore_exe_win32_job);
|
||||
_ecore_exe_win32_job = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
ECORE_EXE_EVENT_ADD = ecore_event_type_new();
|
||||
ECORE_EXE_EVENT_DEL = ecore_event_type_new();
|
||||
ECORE_EXE_EVENT_DATA = ecore_event_type_new();
|
||||
|
@ -358,6 +381,11 @@ _ecore_exe_shutdown(void)
|
|||
ECORE_EXE_EVENT_DEL,
|
||||
ECORE_EXE_EVENT_DATA,
|
||||
ECORE_EXE_EVENT_ERROR);
|
||||
|
||||
#ifdef _WIN32
|
||||
if (_ecore_exe_win32_job)
|
||||
CloseHandle(_ecore_exe_win32_job);
|
||||
#endif
|
||||
}
|
||||
|
||||
Ecore_Exe *
|
||||
|
|
|
@ -133,6 +133,10 @@ struct _Ecore_Exe_Data
|
|||
|
||||
typedef struct _Ecore_Exe_Data Ecore_Exe_Data;
|
||||
|
||||
#ifdef _WIN32
|
||||
extern HANDLE _ecore_exe_win32_job;
|
||||
#endif
|
||||
|
||||
EAPI extern int ECORE_EXE_EVENT_ADD;
|
||||
EAPI extern int ECORE_EXE_EVENT_DEL;
|
||||
EAPI extern int ECORE_EXE_EVENT_DATA;
|
||||
|
|
|
@ -512,6 +512,13 @@ _impl_ecore_exe_efl_object_finalize(Eo *obj, Ecore_Exe_Data *exe)
|
|||
goto error;
|
||||
}
|
||||
|
||||
if ((flags & ECORE_EXE_TERM_WITH_PARENT) && _ecore_exe_win32_job)
|
||||
{
|
||||
if (!AssignProcessToJobObject(_ecore_exe_win32_job, pi.hProcess))
|
||||
WRN("AssignProcessToJobObject failed (job: %p, process: %p",
|
||||
_ecore_exe_win32_job, pi.hProcess);
|
||||
}
|
||||
|
||||
/*
|
||||
* Close pipe handles (do not continue to modify the parent).
|
||||
* We need to make sure that no handles to the write end of the
|
||||
|
|
|
@ -447,7 +447,11 @@ _ecore_main_fdh_poll_add(Efl_Loop_Data *pd EINA_UNUSED, Ecore_Fd_Handler *fdh)
|
|||
fdh->gfd.events = _gfd_events_from_fdh(fdh);
|
||||
fdh->gfd.revents = 0;
|
||||
DBG("adding gpoll on %d %08x", fdh->fd, fdh->gfd.events);
|
||||
g_source_add_poll(ecore_glib_source, &fdh->gfd);
|
||||
if (ecore_glib_source)
|
||||
g_source_add_poll(ecore_glib_source, &fdh->gfd);
|
||||
else
|
||||
ERR("Failed to add gpoll on %d %08x. GSource is NULL",
|
||||
fdh->fd, fdh->gfd.events);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
|
@ -939,29 +943,6 @@ quit:
|
|||
static void
|
||||
_ecore_main_loop_setup(Eo *obj, Efl_Loop_Data *pd)
|
||||
{
|
||||
// Please note that this function is being also called in case of a bad
|
||||
// fd to reset the main loop.
|
||||
#ifdef HAVE_SYS_EPOLL_H
|
||||
pd->epoll_fd = epoll_create(1);
|
||||
if (pd->epoll_fd < 0) WRN("Failed to create epoll fd!");
|
||||
else
|
||||
{
|
||||
eina_file_close_on_exec(pd->epoll_fd, EINA_TRUE);
|
||||
|
||||
pd->epoll_pid = getpid();
|
||||
|
||||
// add polls on all our file descriptors
|
||||
Ecore_Fd_Handler *fdh;
|
||||
EINA_INLIST_FOREACH(pd->fd_handlers, fdh)
|
||||
{
|
||||
if (fdh->delete_me) continue;
|
||||
_ecore_epoll_add(pd->epoll_fd, fdh->fd,
|
||||
_ecore_poll_events_from_fdh(fdh), fdh);
|
||||
_ecore_main_fdh_poll_add(pd, fdh);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (obj == ML_OBJ)
|
||||
{
|
||||
#ifdef HAVE_LIBUV
|
||||
|
@ -1072,6 +1053,30 @@ _ecore_main_loop_setup(Eo *obj, Efl_Loop_Data *pd)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Please note that this function is being also called in case of a bad
|
||||
// fd to reset the main loop.
|
||||
#ifdef HAVE_SYS_EPOLL_H
|
||||
pd->epoll_fd = epoll_create(1);
|
||||
if (pd->epoll_fd < 0) WRN("Failed to create epoll fd!");
|
||||
else
|
||||
{
|
||||
eina_file_close_on_exec(pd->epoll_fd, EINA_TRUE);
|
||||
|
||||
pd->epoll_pid = getpid();
|
||||
|
||||
// add polls on all our file descriptors
|
||||
Ecore_Fd_Handler *fdh;
|
||||
EINA_INLIST_FOREACH(pd->fd_handlers, fdh)
|
||||
{
|
||||
if (fdh->delete_me) continue;
|
||||
_ecore_epoll_add(pd->epoll_fd, fdh->fd,
|
||||
_ecore_poll_events_from_fdh(fdh), fdh);
|
||||
_ecore_main_fdh_poll_add(pd, fdh);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
_ecore_main_timechanges_start(obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ ecore_drm2_plane_assign(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb, int x, int
|
|||
{
|
||||
Eina_List *l;
|
||||
Ecore_Drm2_Plane *plane;
|
||||
Ecore_Drm2_Plane_State *pstate;
|
||||
Ecore_Drm2_Plane_State *pstate, *pstate_chosen = NULL;
|
||||
|
||||
if (!_ecore_drm2_use_atomic) return NULL;
|
||||
|
||||
|
@ -68,12 +68,12 @@ ecore_drm2_plane_assign(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb, int x, int
|
|||
continue;
|
||||
|
||||
/* if we reach here, this FB can go on the cursor plane */
|
||||
goto out;
|
||||
pstate_chosen = pstate;
|
||||
}
|
||||
else if (pstate->type.value == DRM_PLANE_TYPE_OVERLAY)
|
||||
{
|
||||
/* there are no size checks for an overlay plane */
|
||||
goto out;
|
||||
pstate_chosen = pstate;
|
||||
}
|
||||
else if (pstate->type.value == DRM_PLANE_TYPE_PRIMARY)
|
||||
{
|
||||
|
@ -82,10 +82,15 @@ ecore_drm2_plane_assign(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb, int x, int
|
|||
continue;
|
||||
|
||||
/* if we reach here, this FB can go on the primary plane */
|
||||
goto out;
|
||||
pstate_chosen = pstate;
|
||||
}
|
||||
}
|
||||
|
||||
if (pstate_chosen)
|
||||
{
|
||||
pstate = pstate_chosen;
|
||||
goto out;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
out:
|
||||
|
|
|
@ -22,15 +22,6 @@ static Eina_Module *_ecore_evas_vnc = NULL;
|
|||
# define ECORE_EVAS_ENGINE_NAME "module.so"
|
||||
#endif
|
||||
|
||||
static inline Eina_Bool
|
||||
_file_exists(const char *file)
|
||||
{
|
||||
if (!file) return EINA_FALSE;
|
||||
|
||||
if (access(file, F_OK) == -1) return EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
||||
static Eina_Module *
|
||||
_ecore_evas_vnc_server_module_try_load(const char *prefix,
|
||||
|
@ -219,7 +210,7 @@ _ecore_evas_available_engines_get(void)
|
|||
eina_strbuf_append_printf(buf, "%s/%s/" ECORE_EVAS_ENGINE_NAME,
|
||||
info->path, MODULE_ARCH);
|
||||
|
||||
if (_file_exists(eina_strbuf_string_get(buf)))
|
||||
if (eina_file_access(eina_strbuf_string_get(buf), EINA_FILE_ACCESS_MODE_EXIST))
|
||||
{
|
||||
const char *name;
|
||||
|
||||
|
|
|
@ -606,111 +606,19 @@ ecore_file_dir_get(const char *file)
|
|||
EAPI Eina_Bool
|
||||
ecore_file_can_read(const char *file)
|
||||
{
|
||||
if (!file) return EINA_FALSE;
|
||||
if (!access(file, R_OK)) return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
return eina_file_access(file, EINA_FILE_ACCESS_MODE_READ);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
ecore_file_can_write(const char *file)
|
||||
{
|
||||
if (!file) return EINA_FALSE;
|
||||
if (!access(file, W_OK)) return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
return eina_file_access(file, EINA_FILE_ACCESS_MODE_WRITE);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
ecore_file_can_exec(const char *file)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
HANDLE h;
|
||||
HANDLE fm;
|
||||
char *base;
|
||||
char *base_nt;
|
||||
LARGE_INTEGER sz;
|
||||
WORD characteristics;
|
||||
#endif
|
||||
|
||||
if (!file || !*file) return EINA_FALSE;
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
* we parse the file to check if it is a PE file (EXE or DLL)
|
||||
* and we finally check whether it's a DLL or not.
|
||||
* Reference :
|
||||
* https://docs.microsoft.com/en-us/windows/win32/debug/pe-format
|
||||
*/
|
||||
h = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
if (h == INVALID_HANDLE_VALUE)
|
||||
goto test_bat;
|
||||
|
||||
if (!GetFileSizeEx(h, &sz))
|
||||
goto close_h;
|
||||
|
||||
/* a PE file must have at least the DOS and NT headers */
|
||||
if (sz.QuadPart < (LONGLONG)(sizeof(IMAGE_DOS_HEADER) + sizeof(IMAGE_NT_HEADERS)))
|
||||
goto close_h;
|
||||
|
||||
fm = CreateFileMapping(h, NULL, PAGE_READONLY, 0, 0, NULL);
|
||||
if (fm == NULL)
|
||||
goto close_h;
|
||||
|
||||
base = (char *)MapViewOfFile(fm, FILE_MAP_READ, 0, 0, 0);
|
||||
CloseHandle(fm);
|
||||
if (base == NULL)
|
||||
goto close_h;
|
||||
|
||||
/*
|
||||
* the PE file begins with the DOS header.
|
||||
* First magic number : the DOS header must begin with a DOS magic number,
|
||||
* that is "MZ", that is 0x5a4d, stored in a WORD.
|
||||
*/
|
||||
if (*((WORD *)base) != 0x5a4d)
|
||||
goto unmap_view;
|
||||
|
||||
/*
|
||||
* The position of the NT header is located at the offset 0x3c.
|
||||
*/
|
||||
base_nt = base + *((DWORD *)(base + 0x3c));
|
||||
/*
|
||||
* The NT header begins with the magic number "PE\0\0", that is
|
||||
* 0x00004550, stored in a DWORD.
|
||||
*/
|
||||
if (*((DWORD *)base_nt) != 0x00004550)
|
||||
goto unmap_view;
|
||||
|
||||
/*
|
||||
* to get informations about executable (EXE or DLL), we look at
|
||||
* the 'Characteristics' member of the NT header, located at the offset
|
||||
* 22 (4 for the magic number, 18 for the offset) from base_nt.
|
||||
* https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#characteristics
|
||||
*/
|
||||
characteristics = *((WORD *)(base_nt + 4 + 18));
|
||||
|
||||
UnmapViewOfFile(base);
|
||||
CloseHandle(h);
|
||||
|
||||
/*
|
||||
* 0x0002 : if set, EXE or DLL
|
||||
* 0x2000 : if set, DLL
|
||||
*/
|
||||
if ((characteristics & 0x0002) && !(characteristics & 0x2000))
|
||||
return EINA_TRUE;
|
||||
unmap_view:
|
||||
UnmapViewOfFile(base);
|
||||
close_h:
|
||||
CloseHandle(h);
|
||||
test_bat:
|
||||
/*
|
||||
* a .bat file, considered as an executable, is only a text file,
|
||||
* so we rely on the extension. Not the best but we cannot do more.
|
||||
*/
|
||||
return eina_str_has_extension(file, ".bat");
|
||||
#else
|
||||
if (!access(file, X_OK)) return EINA_TRUE;
|
||||
#endif
|
||||
return EINA_FALSE;
|
||||
return eina_file_access(file, EINA_FILE_ACCESS_MODE_EXEC);
|
||||
}
|
||||
|
||||
EAPI char *
|
||||
|
|
|
@ -467,7 +467,7 @@ ecore_x_root_screen_barriers_set(Ecore_X_Rectangle *screens, int num)
|
|||
Region reg, reg2, reg3;
|
||||
Window rwin, cwin;
|
||||
int rx, ry, wx, wy;
|
||||
int i, j;
|
||||
int i;
|
||||
int closest_dist, dist;
|
||||
int sx, sy, dx, dy;
|
||||
unsigned int mask;
|
||||
|
@ -537,50 +537,48 @@ ecore_x_root_screen_barriers_set(Ecore_X_Rectangle *screens, int num)
|
|||
bar_alloc = 0;
|
||||
if ((!screens) || (num <= 0)) return;
|
||||
|
||||
// set up new ones given the screen list given
|
||||
// new region
|
||||
reg = XCreateRegion();
|
||||
// add each screen rect + 1 pixel around it to reg
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
XRectangle xrect;
|
||||
|
||||
reg = XCreateRegion();
|
||||
reg2 = XCreateRegion();
|
||||
xrect.x = screens[i].x - 1;
|
||||
xrect.y = screens[i].y - 1;
|
||||
xrect.width = screens[i].width + 2;
|
||||
xrect.x = screens[i].x - 1;
|
||||
xrect.y = screens[i].y - 1;
|
||||
xrect.width = screens[i].width + 2;
|
||||
xrect.height = screens[i].height + 2;
|
||||
XUnionRectWithRegion(&xrect, reg, reg2);
|
||||
XDestroyRegion(reg);
|
||||
reg = reg2;
|
||||
}
|
||||
// del the content of each screen from the above
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
XRectangle xrect;
|
||||
|
||||
// reg == screen i + 1 pixel surrounding it
|
||||
for (j = 0; j < num; j++)
|
||||
{
|
||||
// create a region representing screen j
|
||||
reg2 = XCreateRegion();
|
||||
reg3 = XCreateRegion();
|
||||
xrect.x = screens[j].x;
|
||||
xrect.y = screens[j].y;
|
||||
xrect.width = screens[j].width;
|
||||
xrect.height = screens[j].height;
|
||||
XUnionRectWithRegion(&xrect, reg2, reg3);
|
||||
XDestroyRegion(reg2);
|
||||
reg2 = reg3;
|
||||
// reg2 == screen j
|
||||
|
||||
reg3 = XCreateRegion();
|
||||
XSubtractRegion(reg, reg2, reg3);
|
||||
XDestroyRegion(reg);
|
||||
XDestroyRegion(reg2);
|
||||
reg = reg3;
|
||||
// reg now has had screen j cut out of the boundary
|
||||
}
|
||||
// reg is the result of starting with screen i and then with a
|
||||
// 1 pixel boundary around it havnig adjacent screens "cut out"
|
||||
// of that boundary leaving only extra bounds where no screens
|
||||
// are adjacent
|
||||
// create just a rect with the screen in it
|
||||
reg2 = XCreateRegion();
|
||||
reg3 = XCreateRegion();
|
||||
xrect.x = screens[i].x;
|
||||
xrect.y = screens[i].y;
|
||||
xrect.width = screens[i].width;
|
||||
xrect.height = screens[i].height;
|
||||
XUnionRectWithRegion(&xrect, reg3, reg2);
|
||||
XDestroyRegion(reg3);
|
||||
|
||||
// now subtract it
|
||||
reg3 = XCreateRegion();
|
||||
XSubtractRegion(reg, reg2, reg3);
|
||||
XDestroyRegion(reg);
|
||||
XDestroyRegion(reg2);
|
||||
reg = reg3;
|
||||
}
|
||||
if (reg)
|
||||
{
|
||||
// walk rects and create barriers
|
||||
for (j = 0; j < reg->numRects; j++)
|
||||
for (i = 0; i < reg->numRects; i++)
|
||||
{
|
||||
int x1, y1, x2, y2;
|
||||
|
||||
|
@ -592,14 +590,15 @@ ecore_x_root_screen_barriers_set(Ecore_X_Rectangle *screens, int num)
|
|||
if (!t)
|
||||
{
|
||||
bar_num--;
|
||||
XDestroyRegion(reg);
|
||||
return;
|
||||
}
|
||||
bar = t;
|
||||
}
|
||||
x1 = reg->rects[j].x1;
|
||||
y1 = reg->rects[j].y1;
|
||||
x2 = reg->rects[j].x2 - 1;
|
||||
y2 = reg->rects[j].y2 - 1;
|
||||
x1 = reg->rects[i].x1;
|
||||
y1 = reg->rects[i].y1;
|
||||
x2 = reg->rects[i].x2 - 1;
|
||||
y2 = reg->rects[i].y2 - 1;
|
||||
bar[bar_num - 1] =
|
||||
XFixesCreatePointerBarrier(_ecore_x_disp,
|
||||
DefaultRootWindow(_ecore_x_disp),
|
||||
|
|
|
@ -31,11 +31,14 @@ eet_dictionary_free(Eet_Dictionary *ed)
|
|||
if (!ed) return;
|
||||
eina_rwlock_free(&ed->rwlock);
|
||||
|
||||
for (i = 0; i < ed->count; i++)
|
||||
if ((ed->all_allocated) && (ed->all))
|
||||
{
|
||||
if (ed->all_allocated[i >> 3] & (1 << (i & 0x7)))
|
||||
for (i = 0; i < ed->count; i++)
|
||||
{
|
||||
eina_stringshare_del(ed->all[i].str);
|
||||
if (ed->all_allocated[i >> 3] & (1 << (i & 0x7)))
|
||||
{
|
||||
eina_stringshare_del(ed->all[i].str);
|
||||
}
|
||||
}
|
||||
}
|
||||
free(ed->all);
|
||||
|
|
|
@ -1527,7 +1527,7 @@ eet_open(const char *file,
|
|||
{
|
||||
Eina_File *fp;
|
||||
Eet_File *ef;
|
||||
int file_len;
|
||||
int file_len, ret;
|
||||
unsigned long int size;
|
||||
|
||||
if (!file)
|
||||
|
@ -1566,6 +1566,12 @@ eet_open(const char *file,
|
|||
/* try open the file based on mode */
|
||||
if ((mode == EET_FILE_MODE_READ) || (mode == EET_FILE_MODE_READ_WRITE))
|
||||
{
|
||||
if (mode == EET_FILE_MODE_READ_WRITE)
|
||||
{
|
||||
/* do not use eina_file_access() here */
|
||||
ret = access(file, W_OK);
|
||||
if ((ret != 0) && (errno != ENOENT)) return NULL;
|
||||
}
|
||||
/* Prevent garbage in futur comparison. */
|
||||
fp = eina_file_open(file, EINA_FALSE);
|
||||
if (!fp)
|
||||
|
@ -1601,6 +1607,9 @@ open_error:
|
|||
size = 0;
|
||||
|
||||
fp = NULL;
|
||||
/* do not use eina_file_access() here */
|
||||
ret = access(file, W_OK);
|
||||
if ((ret != 0) && (errno != ENOENT)) return NULL;
|
||||
}
|
||||
|
||||
/* We found one */
|
||||
|
|
|
@ -460,23 +460,23 @@ eeze_disk_removable_get(Eeze_Disk *disk)
|
|||
EAPI Eina_Bool
|
||||
eeze_disk_can_mount(void)
|
||||
{
|
||||
if (sizeof(EEZE_MOUNT_BIN) == sizeof(""))
|
||||
return EINA_FALSE;
|
||||
return access(EEZE_MOUNT_BIN, X_OK | R_OK) == 0;
|
||||
return eina_file_access(EEZE_MOUNT_BIN,
|
||||
EINA_FILE_ACCESS_MODE_EXEC |
|
||||
EINA_FILE_ACCESS_MODE_READ);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
eeze_disk_can_unmount(void)
|
||||
{
|
||||
if (sizeof(EEZE_UNMOUNT_BIN) == sizeof(""))
|
||||
return EINA_FALSE;
|
||||
return access(EEZE_UNMOUNT_BIN, X_OK | R_OK) == 0;
|
||||
return eina_file_access(EEZE_UNMOUNT_BIN,
|
||||
EINA_FILE_ACCESS_MODE_EXEC |
|
||||
EINA_FILE_ACCESS_MODE_READ);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
eeze_disk_can_eject(void)
|
||||
{
|
||||
if (sizeof(EEZE_EJECT_BIN) == sizeof(""))
|
||||
return EINA_FALSE;
|
||||
return access(EEZE_EJECT_BIN, X_OK | R_OK) == 0;
|
||||
return eina_file_access(EEZE_EJECT_BIN,
|
||||
EINA_FILE_ACCESS_MODE_EXEC |
|
||||
EINA_FILE_ACCESS_MODE_READ);
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ static Eina_Bool
|
|||
_eeze_mount_lock_mtab(void)
|
||||
{
|
||||
// DBG("Locking mlock: %s", mnt_lock_get_linkfile(_eeze_mtab_lock));
|
||||
if (EINA_LIKELY(access("/etc/mtab", W_OK)))
|
||||
if (EINA_LIKELY(!eina_file_access("/etc/mtab", EINA_FILE_ACCESS_MODE_WRITE)))
|
||||
{
|
||||
INF("Insufficient privs for mtab lock, continuing without lock");
|
||||
return EINA_TRUE;
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
# include "evil_private.h" /* setenv */
|
||||
#endif
|
||||
|
||||
#include "Eo.h"
|
||||
#include "Eina.h"
|
||||
#include "Ecore.h"
|
||||
|
|
|
@ -545,91 +545,6 @@ efreet_desktop_util_cache_file(void)
|
|||
/*
|
||||
* Needs EAPI because of helper binaries
|
||||
*/
|
||||
#define SHSH(n, v) ((((v) << (n)) & 0xffffffff) | ((v) >> (32 - (n))))
|
||||
|
||||
static inline int
|
||||
int_to_bigendian(int in)
|
||||
{
|
||||
static const unsigned char test[4] = { 0x11, 0x22, 0x33, 0x44 };
|
||||
static const unsigned int *test_i = (const unsigned int *)test;
|
||||
if (test_i[0] == 0x44332211) return eina_swap32(in);
|
||||
return in;
|
||||
}
|
||||
|
||||
static void
|
||||
sha1(unsigned char *data, int size, unsigned char *dst)
|
||||
{
|
||||
unsigned int digest[5], word[80], wa, wb, wc, wd, we, t;
|
||||
unsigned char buf[64], *d;
|
||||
int idx, left, i;
|
||||
const unsigned int magic[4] =
|
||||
{ 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 };
|
||||
|
||||
idx = 0;
|
||||
digest[0] = 0x67452301; digest[1] = 0xefcdab89; digest[2] = 0x98badcfe;
|
||||
digest[3] = 0x10325476; digest[4] = 0xc3d2e1f0;
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
for (left = size, d = data; left > 0; left--, d++)
|
||||
{
|
||||
if ((idx == 0) && (left < 64))
|
||||
{
|
||||
memset(buf, 0, 60);
|
||||
buf[60] = (size >> 24) & 0xff;
|
||||
buf[61] = (size >> 16) & 0xff;
|
||||
buf[62] = (size >> 8) & 0xff;
|
||||
buf[63] = (size) & 0xff;
|
||||
}
|
||||
buf[idx] = *d;
|
||||
idx++;
|
||||
if ((idx == 64) || (left == 1))
|
||||
{
|
||||
if ((left == 1) && (idx < 64)) buf[idx] = 0x80;
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
word[i] = (unsigned int)buf[(i * 4) ] << 24;
|
||||
word[i] |= (unsigned int)buf[(i * 4) + 1] << 16;
|
||||
word[i] |= (unsigned int)buf[(i * 4) + 2] << 8;
|
||||
word[i] |= (unsigned int)buf[(i * 4) + 3];
|
||||
}
|
||||
for (i = 16; i < 80; i++)
|
||||
word[i] = SHSH(1,
|
||||
word[i - 3 ] ^ word[i - 8 ] ^
|
||||
word[i - 14] ^ word[i - 16]);
|
||||
wa = digest[0]; wb = digest[1]; wc = digest[2];
|
||||
wd = digest[3]; we = digest[4];
|
||||
for (i = 0; i < 80; i++)
|
||||
{
|
||||
if (i < 20)
|
||||
t = SHSH(5, wa) + ((wb & wc) | ((~wb) & wd)) +
|
||||
we + word[i] + magic[0];
|
||||
else if (i < 40)
|
||||
t = SHSH(5, wa) + (wb ^ wc ^ wd) +
|
||||
we + word[i] + magic[1];
|
||||
else if (i < 60)
|
||||
t = SHSH(5, wa) + ((wb & wc) | (wb & wd) | (wc & wd)) +
|
||||
we + word[i] + magic[2];
|
||||
else if (i < 80)
|
||||
t = SHSH(5, wa) + (wb ^ wc ^ wd) +
|
||||
we + word[i] + magic[3];
|
||||
we = wd;
|
||||
wd = wc;
|
||||
wc = SHSH(30, wb);
|
||||
wb = wa;
|
||||
wa = t;
|
||||
}
|
||||
digest[0] += wa; digest[1] += wb; digest[2] += wc;
|
||||
digest[3] += wd; digest[4] += we;
|
||||
idx = 0;
|
||||
}
|
||||
}
|
||||
t = int_to_bigendian(digest[0]); digest[0] = t;
|
||||
t = int_to_bigendian(digest[1]); digest[1] = t;
|
||||
t = int_to_bigendian(digest[2]); digest[2] = t;
|
||||
t = int_to_bigendian(digest[3]); digest[3] = t;
|
||||
t = int_to_bigendian(digest[4]); digest[4] = t;
|
||||
memcpy(dst, digest, 5 * 4);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
efreet_file_cache_fill(const char *file, Efreet_Cache_Check *check)
|
||||
|
@ -651,7 +566,7 @@ efreet_file_cache_fill(const char *file, Efreet_Cache_Check *check)
|
|||
if ((size > 0) && ((size_t)size >= sizeof(link))) return EINA_FALSE;
|
||||
if (stat(file, &st) != 0) return EINA_FALSE;
|
||||
}
|
||||
if (size > 0) sha1((unsigned char *)link, size, check->link_sha1);
|
||||
if (size > 0) eina_sha1((const unsigned char *)link, size, check->link_sha1);
|
||||
#endif
|
||||
check->uid = st.st_uid;
|
||||
check->gid = st.st_gid;
|
||||
|
|
|
@ -833,7 +833,7 @@ efreet_desktop_command_path_absolute(const char *path)
|
|||
int len = 0;
|
||||
|
||||
/* relative url */
|
||||
if (path[0] != '/')
|
||||
if (eina_file_path_relative(path))
|
||||
{
|
||||
if (!(buf = malloc(size))) return NULL;
|
||||
if (!getcwd(buf, size))
|
||||
|
|
|
@ -3125,7 +3125,7 @@ efreet_menu_path_get(Efreet_Menu_Internal *internal, const char *suffix)
|
|||
size_t len;
|
||||
|
||||
/* see if we've got an absolute or relative path */
|
||||
if (suffix[0] == '/')
|
||||
if (!eina_file_path_relative(suffix))
|
||||
snprintf(path, sizeof(path), "%s", suffix);
|
||||
|
||||
else
|
||||
|
|
|
@ -148,6 +148,21 @@ typedef enum {
|
|||
EINA_FILE_REMOVE /**< This memory is to be released and any content will be lost. Subsequent accesses will succeed but return fresh memory as if accessed for the first time. This may not succeed if the filesystem does not support it. @since 1.8 */
|
||||
} Eina_File_Populate;
|
||||
|
||||
/**
|
||||
* @typedef Eina_File_Access_Mode
|
||||
* @brief Type for enumeration of a file access mode.
|
||||
* @details This type is used with eina_file_access(). Enumerations can be
|
||||
* combined bitwise with the OR operator.
|
||||
* @since 1.28
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
EINA_FILE_ACCESS_MODE_EXIST = 0, /**< existence test: F_OK */
|
||||
EINA_FILE_ACCESS_MODE_EXEC = 1 << 0, /**< exec permission: X_OK */
|
||||
EINA_FILE_ACCESS_MODE_WRITE = 1 << 1, /**< write permission: W_OK */
|
||||
EINA_FILE_ACCESS_MODE_READ = 1 << 2, /**< read permission: R_OK */
|
||||
} Eina_File_Access_Mode;
|
||||
|
||||
/* Why do this? Well PATH_MAX may vary from when eina itself is compiled
|
||||
* to when the app using eina is compiled. Exposing the path buffer below
|
||||
* can't safely and portably vary based on how/when you compile. It should
|
||||
|
@ -245,6 +260,19 @@ struct _Eina_File_Line
|
|||
*/
|
||||
#define EINA_FILE_DIR_LIST_CB(function) ((Eina_File_Dir_List_Cb)function)
|
||||
|
||||
/**
|
||||
* @brief Determines if a path is relative or absolute.
|
||||
*
|
||||
* @param[in] path The path to check.
|
||||
*
|
||||
* @return #EINA_TRUE if the path is relative, #EINA_FALSE otherwise.
|
||||
*
|
||||
* The implementation simply checks if the first char in the path is
|
||||
* '/' on POSIX systems. On Windows, absolute paths begin with '\' or
|
||||
* 'C:\' (or other letter). If it is not, the path is considered relative.
|
||||
* If @p path is @c NULL, this function returns #EINA_FALSE.
|
||||
*/
|
||||
EINA_API Eina_Bool eina_file_path_relative(const char *path);
|
||||
|
||||
/**
|
||||
* @brief Lists all the files on the directory by calling the function for every file found.
|
||||
|
@ -817,6 +845,30 @@ EINA_API void eina_file_statgen_enable(void);
|
|||
*/
|
||||
EINA_API void eina_file_statgen_disable(void);
|
||||
|
||||
/**
|
||||
* @brief Determine the accessibility of a file or path.
|
||||
*
|
||||
* @param[in] path The path to check.
|
||||
* @param[in] mode Access permissions to be checked, or existence test.
|
||||
* @return #EINA_TRUE it @p path satisfies the tests, #EINA_FALSE otherwise.
|
||||
*
|
||||
* On Linux, this function just calls the access() function. On Windows, it
|
||||
* mimics as best as possible the behavior of access():
|
||||
* - Existence is always checked.
|
||||
* - As on Windows, a file is either read only or read/write, read permission
|
||||
* is equivalent to existence. so Write permission is equivalent to not
|
||||
* being read only.
|
||||
* - A directory is always executable, except if greater privilege is needed.
|
||||
*
|
||||
* The @p mode has the same values than F_OK, X_OK, W_OK and R_OK, and the
|
||||
* usage is the same than the access() function.
|
||||
*
|
||||
* If @p path is NULL or the epty string, this function returns #EINA_FALSE.
|
||||
*
|
||||
* @since 1.28
|
||||
*/
|
||||
EINA_API Eina_Bool eina_file_access(const char *path, Eina_File_Access_Mode mode);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -178,18 +178,6 @@ struct _Eina_Lines_Iterator
|
|||
/** Macro for logging Eina debug messages */
|
||||
#define DBG(...) EINA_LOG_DOM_DBG(_eina_file_log_dom, __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Determines if a path is relative or absolute.
|
||||
* The implementation simply checks if the first char in the path is '/'. If it
|
||||
* is not, the path is considered relative.
|
||||
*
|
||||
* @param[in] path The path to check.
|
||||
*
|
||||
* @return EINA_TRUE if the path is relative, EINA_FALSE otherwise.
|
||||
*
|
||||
*/
|
||||
Eina_Bool eina_file_path_relative(const char *path);
|
||||
|
||||
/**
|
||||
* @brief Gets the current directory and optionally appends a path to it.
|
||||
* If a string was passed in via the @p path parameter, it will
|
||||
|
|
|
@ -412,7 +412,7 @@ _eina_file_timestamp_compare(Eina_File *f, struct stat *st)
|
|||
if (f->length != (unsigned long long) st->st_size) return EINA_FALSE;
|
||||
if (f->inode != st->st_ino) return EINA_FALSE;
|
||||
#ifdef _STAT_VER_LINUX
|
||||
# if (defined __USE_MISC && defined st_mtime)
|
||||
# ifdef st_mtime
|
||||
if (f->mtime_nsec != (unsigned long int)st->st_mtim.tv_nsec)
|
||||
return EINA_FALSE;
|
||||
# else
|
||||
|
@ -521,13 +521,6 @@ eina_file_mmap_faulty(void *addr, long page_size)
|
|||
* Simplified logic for portability layer with eina_file_common *
|
||||
* ================================================================ */
|
||||
|
||||
Eina_Bool
|
||||
eina_file_path_relative(const char *path)
|
||||
{
|
||||
if (*path != '/') return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
Eina_Tmpstr *
|
||||
eina_file_current_directory_get(const char *path, size_t len)
|
||||
{
|
||||
|
@ -562,6 +555,15 @@ eina_file_cleanup(Eina_Tmpstr *path)
|
|||
|
||||
|
||||
|
||||
EINA_API Eina_Bool
|
||||
eina_file_path_relative(const char *path)
|
||||
{
|
||||
if (!path)
|
||||
return EINA_FALSE;
|
||||
|
||||
return *path != '/';
|
||||
}
|
||||
|
||||
EINA_API Eina_Bool
|
||||
eina_file_dir_list(const char *dir,
|
||||
Eina_Bool recursive,
|
||||
|
@ -868,11 +870,7 @@ eina_file_open(const char *path, Eina_Bool shared)
|
|||
n->length = file_stat.st_size;
|
||||
n->mtime = file_stat.st_mtime;
|
||||
#ifdef _STAT_VER_LINUX
|
||||
# if (defined __USE_MISC && defined st_mtime)
|
||||
n->mtime_nsec = (unsigned long int)file_stat.st_mtim.tv_nsec;
|
||||
# else
|
||||
n->mtime_nsec = (unsigned long int)file_stat.st_mtimensec;
|
||||
# endif
|
||||
#endif
|
||||
n->inode = file_stat.st_ino;
|
||||
n->fd = fd;
|
||||
|
@ -926,11 +924,7 @@ eina_file_refresh(Eina_File *file)
|
|||
file->length = file_stat.st_size;
|
||||
file->mtime = file_stat.st_mtime;
|
||||
#ifdef _STAT_VER_LINUX
|
||||
# if (defined __USE_MISC && defined st_mtime)
|
||||
file->mtime_nsec = (unsigned long int)file_stat.st_mtim.tv_nsec;
|
||||
# else
|
||||
file->mtime_nsec = (unsigned long int)file_stat.st_mtimensec;
|
||||
# endif
|
||||
#endif
|
||||
file->inode = file_stat.st_ino;
|
||||
|
||||
|
@ -1243,15 +1237,9 @@ eina_file_statat(void *container, Eina_File_Direct_Info *info, Eina_Stat *st)
|
|||
st->mtime = buf.st_mtime;
|
||||
st->ctime = buf.st_ctime;
|
||||
#ifdef _STAT_VER_LINUX
|
||||
# if (defined __USE_MISC && defined st_mtime)
|
||||
st->atimensec = buf.st_atim.tv_nsec;
|
||||
st->mtimensec = buf.st_mtim.tv_nsec;
|
||||
st->ctimensec = buf.st_ctim.tv_nsec;
|
||||
# else
|
||||
st->atimensec = buf.st_atimensec;
|
||||
st->mtimensec = buf.st_mtimensec;
|
||||
st->ctimensec = buf.st_ctimensec;
|
||||
# endif
|
||||
#else
|
||||
st->atimensec = 0;
|
||||
st->mtimensec = 0;
|
||||
|
@ -1585,3 +1573,13 @@ eina_file_mkdtemp(const char *templatename, Eina_Tmpstr **path)
|
|||
if (path) *path = eina_tmpstr_add(tmpdirname);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
||||
EINA_API Eina_Bool
|
||||
eina_file_access(const char *path, Eina_File_Access_Mode mode)
|
||||
{
|
||||
if (!path || !*path)
|
||||
return EINA_FALSE;
|
||||
|
||||
return access(path, mode) == 0;
|
||||
}
|
||||
|
|
|
@ -515,12 +515,6 @@ _eina_file_mkdtemp(char *__template)
|
|||
* Simplified logic for portability layer with eina_file_common *
|
||||
* ================================================================ */
|
||||
|
||||
Eina_Bool
|
||||
eina_file_path_relative(const char *path)
|
||||
{
|
||||
return !evil_path_is_absolute(path);
|
||||
}
|
||||
|
||||
Eina_Tmpstr *
|
||||
eina_file_current_directory_get(const char *path, size_t len)
|
||||
{
|
||||
|
@ -559,6 +553,29 @@ eina_file_cleanup(Eina_Tmpstr *path)
|
|||
* API *
|
||||
*============================================================================*/
|
||||
|
||||
EINA_API Eina_Bool
|
||||
eina_file_path_relative(const char *path)
|
||||
{
|
||||
/* see
|
||||
* https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#paths
|
||||
* absolute path if:
|
||||
* - is an UNC path (begins with \\)
|
||||
* - has a drive letter (C:\). \ is important here, otherwise it is relative
|
||||
* - begins with \
|
||||
*/
|
||||
|
||||
if (!path || *path == '\\')
|
||||
return EINA_FALSE;
|
||||
|
||||
if ((((*path >= 'a') && (*path <= 'z')) ||
|
||||
((*path >= 'A') && (*path <= 'Z'))) &&
|
||||
(path[1] == ':') &&
|
||||
((path[2] == '\\') || (path[2] == '/')))
|
||||
return EINA_FALSE;
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EINA_API Eina_Bool
|
||||
eina_file_dir_list(const char *dir,
|
||||
Eina_Bool recursive,
|
||||
|
@ -1269,3 +1286,48 @@ eina_file_mkdtemp(const char *templatename, Eina_Tmpstr **path)
|
|||
if (path) *path = eina_tmpstr_add(tmpdirname);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EINA_API Eina_Bool
|
||||
eina_file_access(const char *path, Eina_File_Access_Mode mode)
|
||||
{
|
||||
DWORD attr;
|
||||
|
||||
if (!path || !*path)
|
||||
return EINA_FALSE;
|
||||
|
||||
if ((mode != EINA_FILE_ACCESS_MODE_EXIST) &&
|
||||
((mode >> 3) != 0))
|
||||
return EINA_FALSE;
|
||||
|
||||
/*
|
||||
* Always check for existence for both files and directories
|
||||
*/
|
||||
attr = GetFileAttributes(path);
|
||||
if (attr == INVALID_FILE_ATTRIBUTES)
|
||||
return EINA_FALSE;
|
||||
|
||||
/*
|
||||
* On Windows a file or path is either read/write or read only.
|
||||
* So if it exists, it has at least read access.
|
||||
* So do something only if mode is EXEC or WRITE
|
||||
*/
|
||||
|
||||
if (mode & EINA_FILE_ACCESS_MODE_EXEC)
|
||||
{
|
||||
if (!(attr & FILE_ATTRIBUTE_DIRECTORY) &&
|
||||
!eina_str_has_extension(path, ".exe") &&
|
||||
!eina_str_has_extension(path, ".bat"))
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
if (mode & EINA_FILE_ACCESS_MODE_WRITE)
|
||||
{
|
||||
if (attr == INVALID_FILE_ATTRIBUTES)
|
||||
return EINA_FALSE;
|
||||
|
||||
if (attr & FILE_ATTRIBUTE_READONLY)
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
|
|
@ -225,7 +225,7 @@ eina_hash_add_alloc_by_hash(Eina_Hash *hash,
|
|||
|
||||
if (!hash->buckets)
|
||||
{
|
||||
hash->buckets = calloc(sizeof (Eina_Rbtree *), hash->size);
|
||||
hash->buckets = calloc(hash->size, sizeof(Eina_Rbtree *));
|
||||
if (!hash->buckets) goto on_error;
|
||||
|
||||
hash_head = NULL;
|
||||
|
|
|
@ -486,14 +486,20 @@ eina_value_pset(Eina_Value *value, const void *ptr)
|
|||
{
|
||||
if (type == EINA_VALUE_TYPE_STRINGSHARE)
|
||||
{
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
const char *str = *((const char * const *) ptr);
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
return eina_stringshare_replace((const char **)&value->value.ptr,
|
||||
str);
|
||||
}
|
||||
else if (type == EINA_VALUE_TYPE_STRING)
|
||||
{
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
const char *str = *((const char * const *) ptr);
|
||||
#pragma GCC diagnostic pop
|
||||
if (value->value.ptr == str) return EINA_TRUE;
|
||||
if (!str)
|
||||
{
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
#ifdef _WIN32
|
||||
# include <direct.h> /* getcwd */
|
||||
# include <evil_private.h> /* path_is_absolute realpath dladdr */
|
||||
# include <evil_private.h> /* realpath dladdr */
|
||||
#endif
|
||||
|
||||
#include "eina_config.h"
|
||||
|
@ -166,16 +166,6 @@ _path_sep_fix(char *buf)
|
|||
#endif
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_path_absolute_check(const char *path)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return evil_path_is_absolute(path);
|
||||
#else
|
||||
return (path[0] == EINA_PATH_SEP_C);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
_fallback(Eina_Prefix *pfx, const char *pkg_bin, const char *pkg_lib,
|
||||
const char *pkg_data, const char *pkg_locale, const char *envprefix)
|
||||
|
@ -284,9 +274,9 @@ _try_argv(Eina_Prefix *pfx, const char *argv0)
|
|||
char buf[PATH_MAX], buf2[PATH_MAX];
|
||||
|
||||
/* 1. is argv0 abs path? */
|
||||
if (_path_absolute_check(argv0))
|
||||
if (!eina_file_path_relative(argv0))
|
||||
{
|
||||
if (access(argv0, X_OK) == 0)
|
||||
if (eina_file_access(argv0, EINA_FILE_ACCESS_MODE_EXEC))
|
||||
{
|
||||
INF("Executable argv0 is full path = %s", argv0);
|
||||
STRDUP_REP(pfx->exe_path, argv0);
|
||||
|
@ -306,7 +296,7 @@ _try_argv(Eina_Prefix *pfx, const char *argv0)
|
|||
eina_file_path_join(joined, len, buf2, argv0);
|
||||
if (realpath(joined, buf))
|
||||
{
|
||||
if (access(buf, X_OK) == 0)
|
||||
if (eina_file_access(buf, EINA_FILE_ACCESS_MODE_EXEC))
|
||||
{
|
||||
INF("Executable relative argv0=%s, cwd=%s, realpath=%s",
|
||||
argv0, buf2, buf);
|
||||
|
@ -350,7 +340,7 @@ _try_argv(Eina_Prefix *pfx, const char *argv0)
|
|||
strcpy(buf2 + len + 1, argv0);
|
||||
if (realpath(buf2, buf))
|
||||
{
|
||||
if (access(buf, X_OK) == 0)
|
||||
if (eina_file_access(buf, EINA_FILE_ACCESS_MODE_EXEC))
|
||||
{
|
||||
STRDUP_REP(pfx->exe_path, buf);
|
||||
INF("Path %s is executable", pfx->exe_path);
|
||||
|
@ -579,7 +569,7 @@ eina_prefix_new(const char *argv0, void *symbol, const char *envprefix,
|
|||
{
|
||||
if (info_dl.dli_fname)
|
||||
{
|
||||
if (_path_absolute_check(info_dl.dli_fname))
|
||||
if (!eina_file_path_relative(info_dl.dli_fname))
|
||||
{
|
||||
INF("dladdr for symbol=%p: %s", symbol, info_dl.dli_fname);
|
||||
char *rlink = realpath(info_dl.dli_fname, NULL);
|
||||
|
|
|
@ -110,15 +110,9 @@ _eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread)
|
|||
est->mtime = st.st_mtime;
|
||||
est->ctime = st.st_ctime;
|
||||
#ifdef _STAT_VER_LINUX
|
||||
# if (defined __USE_MISC && defined st_mtime)
|
||||
est->atimensec = st.st_atim.tv_nsec;
|
||||
est->mtimensec = st.st_mtim.tv_nsec;
|
||||
est->ctimensec = st.st_ctim.tv_nsec;
|
||||
# else
|
||||
est->atimensec = st.st_atimensec;
|
||||
est->mtimensec = st.st_mtimensec;
|
||||
est->ctimensec = st.st_ctimensec;
|
||||
# endif
|
||||
#else
|
||||
est->atimensec = 0;
|
||||
est->mtimensec = 0;
|
||||
|
|
|
@ -128,15 +128,9 @@ _eio_file_struct_2_eina(Eina_Stat *es, _eio_stat_t *st)
|
|||
es->mtime = st->st_mtime;
|
||||
es->ctime = st->st_ctime;
|
||||
#ifdef _STAT_VER_LINUX
|
||||
# if (defined __USE_MISC && defined st_mtime)
|
||||
es->atimensec = st->st_atim.tv_nsec;
|
||||
es->mtimensec = st->st_mtim.tv_nsec;
|
||||
es->ctimensec = st->st_ctim.tv_nsec;
|
||||
# else
|
||||
es->atimensec = st->st_atimensec;
|
||||
es->mtimensec = st->st_mtimensec;
|
||||
es->ctimensec = st->st_ctimensec;
|
||||
# endif
|
||||
#else
|
||||
es->atimensec = 0;
|
||||
es->mtimensec = 0;
|
||||
|
|
|
@ -1526,7 +1526,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_U
|
|||
}
|
||||
else
|
||||
{
|
||||
ERR("Could not fetch a node located at %p", node->focusable);
|
||||
F_DBG("Could not fetch a node located at %p", node->focusable);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2164,25 +2164,6 @@ _icon_size_min_get(Evas_Object *image)
|
|||
return MAX(16, MIN(w, h));
|
||||
}
|
||||
|
||||
/* FIXME: move this code to ecore */
|
||||
#ifdef _WIN32
|
||||
static Eina_Bool
|
||||
_path_is_absolute(const char *path)
|
||||
{
|
||||
//TODO: Check if this works with all absolute paths in windows
|
||||
return (isalpha(*path)) && (*(path + 1) == ':') &&
|
||||
((*(path + 2) == '\\') || (*(path + 2) == '/'));
|
||||
}
|
||||
|
||||
#else
|
||||
static Eina_Bool
|
||||
_path_is_absolute(const char *path)
|
||||
{
|
||||
return *path == '/';
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static Eina_Bool
|
||||
_internal_efl_ui_image_icon_set(Evas_Object *obj, const char *name, Eina_Bool *fdo)
|
||||
{
|
||||
|
@ -2217,7 +2198,7 @@ _internal_efl_ui_image_icon_set(Evas_Object *obj, const char *name, Eina_Bool *f
|
|||
else
|
||||
eina_stringshare_replace(&sd->stdicon, NULL);
|
||||
|
||||
if (_path_is_absolute(name))
|
||||
if (!eina_file_path_relative(name))
|
||||
{
|
||||
if (fdo)
|
||||
*fdo = EINA_FALSE;
|
||||
|
|
|
@ -2903,25 +2903,6 @@ _icon_size_min_get(Evas_Object *image)
|
|||
return MAX(16, MIN(w, h));
|
||||
}
|
||||
|
||||
/* FIXME: move this code to ecore */
|
||||
#ifdef _WIN32
|
||||
static Eina_Bool
|
||||
_path_is_absolute(const char *path)
|
||||
{
|
||||
//TODO: Check if this works with all absolute paths in windows
|
||||
return (isalpha(*path)) && (*(path + 1) == ':') &&
|
||||
((*(path + 2) == '\\') || (*(path + 2) == '/'));
|
||||
}
|
||||
|
||||
#else
|
||||
static Eina_Bool
|
||||
_path_is_absolute(const char *path)
|
||||
{
|
||||
return *path == '/';
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static Eina_Bool
|
||||
_internal_efl_ui_image_zoomable_icon_set(Evas_Object *obj, const char *name, Eina_Bool *fdo, Eina_Bool resize)
|
||||
{
|
||||
|
@ -2956,7 +2937,7 @@ _internal_efl_ui_image_zoomable_icon_set(Evas_Object *obj, const char *name, Ein
|
|||
else
|
||||
eina_stringshare_replace(&sd->stdicon, NULL);
|
||||
|
||||
if (_path_is_absolute(name))
|
||||
if (!eina_file_path_relative(name))
|
||||
{
|
||||
if (fdo)
|
||||
*fdo = EINA_FALSE;
|
||||
|
|
|
@ -122,7 +122,7 @@ _size_cache_require(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd)
|
|||
pd->size_cache_dirty = EINA_FALSE;
|
||||
if (pd->size_cache)
|
||||
free(pd->size_cache);
|
||||
pd->size_cache = calloc(sizeof(int), eina_inarray_count(pd->group_cache));
|
||||
pd->size_cache = calloc(eina_inarray_count(pd->group_cache), sizeof(int));
|
||||
|
||||
for (unsigned int i = 0; i < eina_inarray_count(pd->group_cache); ++i)
|
||||
{
|
||||
|
|
|
@ -329,7 +329,7 @@ _drag_start(void *data,
|
|||
elm_object_focus_set(data, EINA_TRUE);
|
||||
_slider_update(data, EINA_TRUE);
|
||||
efl_event_callback_call(data, EFL_UI_SLIDER_INTERVAL_EVENT_SLIDER_DRAG_START, NULL);
|
||||
elm_widget_scroll_freeze_push(data);
|
||||
efl_ui_widget_scroll_freeze_push(data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -340,7 +340,7 @@ _drag_stop(void *data,
|
|||
{
|
||||
_slider_update(data, EINA_TRUE);
|
||||
efl_event_callback_call(data, EFL_UI_SLIDER_INTERVAL_EVENT_SLIDER_DRAG_STOP, NULL);
|
||||
elm_widget_scroll_freeze_pop(data);
|
||||
efl_ui_widget_scroll_freeze_pop(data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -413,7 +413,7 @@ _spacer_move_cb(void *data,
|
|||
{
|
||||
if (!sd->frozen)
|
||||
{
|
||||
elm_widget_scroll_freeze_push(data);
|
||||
efl_ui_widget_scroll_freeze_push(data);
|
||||
sd->frozen = EINA_TRUE;
|
||||
}
|
||||
ev->event_flags &= ~EVAS_EVENT_FLAG_ON_HOLD;
|
||||
|
@ -427,7 +427,7 @@ _spacer_move_cb(void *data,
|
|||
(data, EFL_UI_SLIDER_INTERVAL_EVENT_SLIDER_DRAG_STOP, NULL);
|
||||
if (sd->frozen)
|
||||
{
|
||||
elm_widget_scroll_freeze_pop(data);
|
||||
efl_ui_widget_scroll_freeze_pop(data);
|
||||
sd->frozen = EINA_FALSE;
|
||||
}
|
||||
return;
|
||||
|
@ -466,7 +466,7 @@ _spacer_up_cb(void *data,
|
|||
|
||||
if (sd->frozen)
|
||||
{
|
||||
elm_widget_scroll_freeze_pop(data);
|
||||
efl_ui_widget_scroll_freeze_pop(data);
|
||||
sd->frozen = EINA_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -492,7 +492,7 @@ _mouse_out_cb(void *data EINA_UNUSED,
|
|||
static char *
|
||||
_access_info_cb(void *data EINA_UNUSED, Evas_Object *obj)
|
||||
{
|
||||
const char *txt = elm_widget_access_info_get(obj);
|
||||
const char *txt = efl_ui_widget_access_info_get(obj);
|
||||
|
||||
if (!txt) txt = elm_layout_text_get(obj, NULL);
|
||||
if (txt) return strdup(txt);
|
||||
|
@ -506,7 +506,7 @@ _access_state_cb(void *data EINA_UNUSED, Evas_Object *obj)
|
|||
char *ret;
|
||||
Eina_Strbuf *buf = eina_strbuf_new();
|
||||
|
||||
if (elm_widget_disabled_get(obj))
|
||||
if (efl_ui_widget_disabled_get(obj))
|
||||
eina_strbuf_append(buf, " state: disabled");
|
||||
|
||||
if (eina_strbuf_length_get(buf))
|
||||
|
@ -713,7 +713,7 @@ _key_action_drag(Evas_Object *obj, const char *params)
|
|||
EOLIAN static Eina_Bool
|
||||
_efl_ui_slider_interval_efl_ui_widget_on_access_activate(Eo *obj, Efl_Ui_Slider_Interval_Data *sd, Efl_Ui_Activate act)
|
||||
{
|
||||
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
|
||||
if (efl_ui_widget_disabled_get) return EINA_FALSE;
|
||||
if (act == EFL_UI_ACTIVATE_DEFAULT) return EINA_FALSE;
|
||||
|
||||
if ((act == EFL_UI_ACTIVATE_UP) ||
|
||||
|
|
|
@ -3563,13 +3563,13 @@ _elm_win_xwin_update(Efl_Ui_Win_Data *sd)
|
|||
|
||||
if (image)
|
||||
{
|
||||
int w = 0, h = 0, stride, x, y;
|
||||
int w = 0, h = 0, stride = 0, x, y;
|
||||
Eina_Bool unmap = EINA_FALSE;
|
||||
Eina_Rw_Slice sl = {};
|
||||
Eina_Rw_Slice sl = { 0 };
|
||||
|
||||
if (efl_isa(image, EFL_CANVAS_IMAGE_CLASS))
|
||||
{
|
||||
Eina_Rect rect = {};
|
||||
Eina_Rect rect = { 0 };
|
||||
|
||||
unmap = EINA_TRUE;
|
||||
rect.size = efl_gfx_buffer_size_get(image);
|
||||
|
|
|
@ -28,25 +28,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
|||
{NULL, NULL}
|
||||
};
|
||||
|
||||
/* FIXME: move this code to ecore */
|
||||
#ifdef _WIN32
|
||||
static Eina_Bool
|
||||
_path_is_absolute(const char *path)
|
||||
{
|
||||
//TODO: Check if this works with all absolute paths in windows
|
||||
return (isalpha(*path)) && (*(path + 1) == ':') &&
|
||||
((*(path + 2) == '\\') || (*(path + 2) == '/'));
|
||||
}
|
||||
|
||||
#else
|
||||
static Eina_Bool
|
||||
_path_is_absolute(const char *path)
|
||||
{
|
||||
return *path == '/';
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static inline int
|
||||
_icon_size_min_get(Evas_Object *icon)
|
||||
{
|
||||
|
@ -462,7 +443,7 @@ _internal_elm_icon_standard_set(Evas_Object *obj,
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
if (_path_is_absolute(name))
|
||||
if (!eina_file_path_relative(name))
|
||||
{
|
||||
if (fdo)
|
||||
*fdo = EINA_FALSE;
|
||||
|
|
|
@ -1044,7 +1044,7 @@ elm_quicklaunch_prepare(int argc,
|
|||
strcat(p, "../lib/");
|
||||
strcat(p, exename);
|
||||
strcat(p, LIBEXT);
|
||||
if (access(exe2, R_OK | X_OK) != 0)
|
||||
if (!eina_file_access(exe2, EINA_FILE_ACCESS_MODE_EXEC | EINA_FILE_ACCESS_MODE_READ))
|
||||
ELM_SAFE_FREE(exe2, free);
|
||||
|
||||
/* Try linking to executable first. Works with PIE files. */
|
||||
|
@ -1308,7 +1308,7 @@ elm_quicklaunch_exe_path_get(const char *exe, const char *cwd)
|
|||
const char *pathitr;
|
||||
const Eina_List *l;
|
||||
char buf[PATH_MAX];
|
||||
if (exe[0] == '/') return strdup(exe);
|
||||
if (!eina_file_path_relative(exe)) return strdup(exe);
|
||||
if (cwd)
|
||||
pathlist = eina_list_append(pathlist, eina_stringshare_add(cwd));
|
||||
else
|
||||
|
@ -1348,7 +1348,7 @@ elm_quicklaunch_exe_path_get(const char *exe, const char *cwd)
|
|||
EINA_LIST_FOREACH(pathlist, l, pathitr)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe);
|
||||
if (!access(buf, R_OK | X_OK)) return strdup(buf);
|
||||
if (eina_file_access(buf, EINA_FILE_ACCESS_MODE_EXEC | EINA_FILE_ACCESS_MODE_READ)) return strdup(buf);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ _elm_module_add(const char *name, const char *as)
|
|||
{
|
||||
Elm_Module *m;
|
||||
|
||||
if (name[0] == '/') return NULL;
|
||||
if (!eina_file_path_relative(name)) return NULL;
|
||||
|
||||
m = eina_hash_find(modules, name);
|
||||
if (m)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <evil_private.h> /* strsep evil_path_absolute */
|
||||
# include <evil_private.h> /* strsep */
|
||||
#endif
|
||||
|
||||
#define EFL_ACCESS_OBJECT_PROTECTED
|
||||
|
@ -1816,11 +1816,7 @@ elm_prefs_file_set(Eo *obj, const char *file, const char *page)
|
|||
sd->file = eina_stringshare_printf("%s/%s", prefix, "preferences.epb");
|
||||
else
|
||||
{
|
||||
#ifndef _WIN32
|
||||
if (*file != '/') /* relative */
|
||||
#else
|
||||
if (!evil_path_is_absolute(file)) /* relative */
|
||||
#endif
|
||||
if (eina_file_path_relative(file))
|
||||
sd->file = eina_stringshare_printf("%s/%s", prefix, file);
|
||||
else
|
||||
sd->file = eina_stringshare_add(file);
|
||||
|
|
|
@ -107,10 +107,9 @@ _elm_theme_file_item_add(Eina_Inlist **files, const char *item, Eina_Bool prepen
|
|||
home = eina_environment_home_get();
|
||||
buf = eina_strbuf_new();
|
||||
|
||||
if ((item[0] == '/') ||
|
||||
if (!eina_file_path_relative(item) ||
|
||||
((item[0] == '.') && (item[1] == '/')) ||
|
||||
((item[0] == '.') && (item[1] == '.') && (item[2] == '/')) ||
|
||||
((isalpha(item[0])) && (item[1] == ':')))
|
||||
((item[0] == '.') && (item[1] == '.') && (item[2] == '/')))
|
||||
{
|
||||
f = eina_file_open(item, EINA_FALSE);
|
||||
if (!f) goto on_error;
|
||||
|
@ -898,9 +897,9 @@ elm_theme_list_item_path_get(const char *f, Eina_Bool *in_search_path)
|
|||
if (!home) home = "";
|
||||
}
|
||||
|
||||
if ((f[0] == '/') || ((f[0] == '.') && (f[1] == '/')) ||
|
||||
((f[0] == '.') && (f[1] == '.') && (f[2] == '/')) ||
|
||||
((isalpha(f[0])) && (f[1] == ':')))
|
||||
if (!eina_file_path_relative(f) ||
|
||||
((f[0] == '.') && (f[1] == '/')) ||
|
||||
((f[0] == '.') && (f[1] == '.') && (f[2] == '/')))
|
||||
{
|
||||
if (in_search_path) *in_search_path = EINA_FALSE;
|
||||
return strdup(f);
|
||||
|
|
|
@ -193,11 +193,13 @@ elua_state_new(const char *progname)
|
|||
lua_setfield(L, LUA_REGISTRYINDEX, "elua_ptr1");
|
||||
lua_setfield(L, LUA_REGISTRYINDEX, "elua_ptr2");
|
||||
return ret;
|
||||
#ifdef ENABLE_LUA_OLD
|
||||
err:
|
||||
lua_close(L);
|
||||
eina_stringshare_del(ret->progname);
|
||||
free(ret);
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
|
@ -94,7 +94,7 @@ emile_base64_encode_common(const Eina_Binbuf *in, Eina_Bool is_base64url_encode)
|
|||
|
||||
dest[k] = '\0';
|
||||
|
||||
return eina_strbuf_manage_new(dest);
|
||||
return eina_strbuf_manage_new_length(dest, k);
|
||||
}
|
||||
|
||||
static Eina_Binbuf *
|
||||
|
|
|
@ -94,19 +94,20 @@ _eo_obj_pointer_get(const Eo_Id obj_id, const char *func_name, const char *file,
|
|||
EINA_PREFETCH(&(data->tables[0]));
|
||||
domain = (obj_id >> SHIFT_DOMAIN) & MASK_DOMAIN;
|
||||
tdata = _eo_table_data_table_get(data, domain);
|
||||
EINA_PREFETCH(&(tdata->cache.id));
|
||||
if (EINA_UNLIKELY(!tdata)) goto err;
|
||||
|
||||
_eo_cache_prefetch(tdata);
|
||||
|
||||
if (EINA_LIKELY(domain != EFL_ID_DOMAIN_SHARED))
|
||||
{
|
||||
if (obj_id == tdata->cache.id)
|
||||
return tdata->cache.object;
|
||||
_Eo_Object *obj;
|
||||
|
||||
obj = _eo_cache_find(tdata, obj_id);
|
||||
if (obj) return obj;
|
||||
|
||||
mid_table_id = (obj_id >> SHIFT_MID_TABLE_ID) & MASK_MID_TABLE_ID;
|
||||
EINA_PREFETCH_NOCACHE(&(tdata->eo_ids_tables[mid_table_id])); //prefetch for line 119
|
||||
EINA_PREFETCH(&(tdata->eo_ids_tables[mid_table_id])); //prefetch for line 119
|
||||
table_id = (obj_id >> SHIFT_TABLE_ID) & MASK_TABLE_ID;
|
||||
EINA_PREFETCH_NOCACHE((tdata->eo_ids_tables[mid_table_id] + table_id)); //prefetch for line 121
|
||||
EINA_PREFETCH((tdata->eo_ids_tables[mid_table_id] + table_id)); //prefetch for line 121
|
||||
entry_id = (obj_id >> SHIFT_ENTRY_ID) & MASK_ENTRY_ID;
|
||||
generation = obj_id & MASK_GENERATIONS;
|
||||
|
||||
|
@ -126,8 +127,7 @@ _eo_obj_pointer_get(const Eo_Id obj_id, const char *func_name, const char *file,
|
|||
if (entry->active && (entry->generation == generation))
|
||||
{
|
||||
// Cache the result of that lookup
|
||||
tdata->cache.object = entry->ptr;
|
||||
tdata->cache.id = obj_id;
|
||||
_eo_cache_store(tdata, obj_id, entry->ptr);
|
||||
return entry->ptr;
|
||||
}
|
||||
}
|
||||
|
@ -136,17 +136,19 @@ _eo_obj_pointer_get(const Eo_Id obj_id, const char *func_name, const char *file,
|
|||
}
|
||||
else
|
||||
{
|
||||
_Eo_Object *obj;
|
||||
|
||||
eina_lock_take(&(_eo_table_data_shared_data->obj_lock));
|
||||
if (obj_id == tdata->cache.id)
|
||||
// yes we return keeping the lock locked. that's why
|
||||
// you must call _eo_obj_pointer_done() wrapped
|
||||
// by EO_OBJ_DONE() to release
|
||||
return tdata->cache.object;
|
||||
obj = _eo_cache_find(tdata, obj_id);
|
||||
if (obj) return obj;
|
||||
|
||||
mid_table_id = (obj_id >> SHIFT_MID_TABLE_ID) & MASK_MID_TABLE_ID;
|
||||
EINA_PREFETCH_NOCACHE(&(tdata->eo_ids_tables[mid_table_id]));
|
||||
EINA_PREFETCH(&(tdata->eo_ids_tables[mid_table_id]));
|
||||
table_id = (obj_id >> SHIFT_TABLE_ID) & MASK_TABLE_ID;
|
||||
EINA_PREFETCH_NOCACHE((tdata->eo_ids_tables[mid_table_id] + table_id));
|
||||
EINA_PREFETCH((tdata->eo_ids_tables[mid_table_id] + table_id));
|
||||
entry_id = (obj_id >> SHIFT_ENTRY_ID) & MASK_ENTRY_ID;
|
||||
generation = obj_id & MASK_GENERATIONS;
|
||||
|
||||
|
@ -167,8 +169,7 @@ _eo_obj_pointer_get(const Eo_Id obj_id, const char *func_name, const char *file,
|
|||
if (entry->active && (entry->generation == generation))
|
||||
{
|
||||
// Cache the result of that lookup
|
||||
tdata->cache.object = entry->ptr;
|
||||
tdata->cache.id = obj_id;
|
||||
_eo_cache_store(tdata, obj_id, entry->ptr);
|
||||
// yes we return keeping the lock locked. that's why
|
||||
// you must call _eo_obj_pointer_done() wrapped
|
||||
// by EO_OBJ_DONE() to release
|
||||
|
|
|
@ -305,13 +305,19 @@ typedef struct
|
|||
typedef struct _Eo_Id_Data Eo_Id_Data;
|
||||
typedef struct _Eo_Id_Table_Data Eo_Id_Table_Data;
|
||||
|
||||
#define CACHENUM 2
|
||||
#define CACHELINE 64
|
||||
#define CACHELRU 1
|
||||
|
||||
struct _Eo_Id_Table_Data
|
||||
{
|
||||
/* Cached eoid lookups */
|
||||
#if CACHENUM > 0
|
||||
Eo_Id cache_id[CACHENUM];
|
||||
_Eo_Object *cache_object[CACHENUM];
|
||||
#endif
|
||||
struct
|
||||
{
|
||||
Eo_Id id;
|
||||
_Eo_Object *object;
|
||||
const Eo *isa_id;
|
||||
const Efl_Class *klass;
|
||||
Eina_Bool isa;
|
||||
|
@ -343,6 +349,100 @@ extern Eina_TLS _eo_table_data;
|
|||
extern Eo_Id_Data *_eo_table_data_shared;
|
||||
extern Eo_Id_Table_Data *_eo_table_data_shared_data;
|
||||
|
||||
#ifndef CACHELRU
|
||||
static inline unsigned int
|
||||
_eo_cache_slot_get(void)
|
||||
{
|
||||
# if CACHENUM > 0
|
||||
static unsigned int num = 0;
|
||||
|
||||
return (++num) % CACHENUM;
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void
|
||||
_eo_cache_prefetch(Eo_Id_Table_Data *tdata EINA_UNUSED)
|
||||
{
|
||||
#if CACHENUM > 0
|
||||
int i;
|
||||
|
||||
for (i = 0; i < CACHENUM; i += (CACHELINE / sizeof(void *)))
|
||||
{
|
||||
EINA_PREFETCH(&(tdata->cache_id[i]));
|
||||
if ((sizeof(void *) * CACHENUM) >= CACHELINE)
|
||||
{
|
||||
EINA_PREFETCH(&(tdata->cache_object[i]));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline _Eo_Object *
|
||||
_eo_cache_find(Eo_Id_Table_Data *tdata EINA_UNUSED, Eo_Id obj_id EINA_UNUSED)
|
||||
{
|
||||
#if CACHENUM > 0
|
||||
int i;
|
||||
|
||||
for (i = 0; i < CACHENUM; i++)
|
||||
{
|
||||
if (obj_id == tdata->cache_id[i]) return tdata->cache_object[i];
|
||||
}
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void
|
||||
_eo_cache_store(Eo_Id_Table_Data *tdata EINA_UNUSED, Eo_Id obj_id EINA_UNUSED, _Eo_Object *obj EINA_UNUSED)
|
||||
{
|
||||
#if CACHENUM > 0
|
||||
# ifdef CACHELRU
|
||||
# if CACHENUM > 1
|
||||
memmove(&tdata->cache_id[1], &tdata->cache_id[0],
|
||||
(CACHENUM - 1) * sizeof(tdata->cache_id[0]));
|
||||
memmove(&tdata->cache_object[1], &tdata->cache_object[0],
|
||||
(CACHENUM - 1) * sizeof(tdata->cache_object[0]));
|
||||
# endif
|
||||
tdata->cache_id[0] = obj_id;
|
||||
tdata->cache_object[0] = obj;
|
||||
# else
|
||||
int slot = _eo_cache_slot_get();
|
||||
tdata->cache_id[slot] = obj_id;
|
||||
tdata->cache_object[slot] = obj;
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
_eo_cache_invalidate(Eo_Id_Table_Data *tdata EINA_UNUSED, Eo_Id obj_id EINA_UNUSED)
|
||||
{
|
||||
#if CACHENUM > 0
|
||||
int i;
|
||||
|
||||
for (i = 0; i < CACHENUM; i++)
|
||||
{
|
||||
if (obj_id == tdata->cache_id[i])
|
||||
{
|
||||
# ifdef CACHELRU
|
||||
if (EINA_LIKELY((CACHENUM - 1 - i) > 0))
|
||||
{
|
||||
memmove(&tdata->cache_id[i], &tdata->cache_id[i + 1],
|
||||
(CACHENUM - 1 - i) * sizeof(tdata->cache_id[0]));
|
||||
memmove(&tdata->cache_object[i], &tdata->cache_object[i + 1],
|
||||
(CACHENUM - 1 - i) * sizeof(tdata->cache_object[0]));
|
||||
}
|
||||
tdata->cache_id[CACHENUM - 1] = 0;
|
||||
tdata->cache_object[CACHENUM - 1] = NULL;
|
||||
# else
|
||||
tdata->cache_id[i] = 0;
|
||||
tdata->cache_object[i] = NULL;
|
||||
# endif
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline Eo_Id_Table_Data *
|
||||
_eo_table_data_table_new(Efl_Id_Domain domain)
|
||||
{
|
||||
|
@ -672,11 +772,7 @@ _eo_id_release(const Eo_Id obj_id)
|
|||
tdata->current_table = NULL;
|
||||
}
|
||||
// In case an object is destroyed, wipe out the cache
|
||||
if (tdata->cache.id == obj_id)
|
||||
{
|
||||
tdata->cache.id = 0;
|
||||
tdata->cache.object = NULL;
|
||||
}
|
||||
_eo_cache_invalidate(tdata, obj_id);
|
||||
if ((Eo_Id)tdata->cache.isa_id == obj_id)
|
||||
{
|
||||
tdata->cache.isa_id = NULL;
|
||||
|
@ -722,11 +818,7 @@ _eo_id_release(const Eo_Id obj_id)
|
|||
tdata->current_table = NULL;
|
||||
}
|
||||
// In case an object is destroyed, wipe out the cache
|
||||
if (tdata->cache.id == obj_id)
|
||||
{
|
||||
tdata->cache.id = 0;
|
||||
tdata->cache.object = NULL;
|
||||
}
|
||||
_eo_cache_invalidate(tdata, obj_id);
|
||||
if ((Eo_Id)tdata->cache.isa_id == obj_id)
|
||||
{
|
||||
tdata->cache.isa_id = NULL;
|
||||
|
|
|
@ -852,7 +852,7 @@ ethumb_file_set(Ethumb *e, const char *path, const char *key)
|
|||
|
||||
sanitized_path = eina_file_path_sanitize(path);
|
||||
DBG("ethumb=%p, path=%s, key=%s", e, sanitized_path ? sanitized_path : "", key ? key : "");
|
||||
if (sanitized_path && access(sanitized_path, R_OK))
|
||||
if (sanitized_path && !eina_file_access(sanitized_path, EINA_FILE_ACCESS_MODE_READ))
|
||||
{
|
||||
free(sanitized_path);
|
||||
return EINA_FALSE;
|
||||
|
|
|
@ -201,13 +201,8 @@ _timestamp_compare(Image_Timestamp *tstamp, struct stat *st)
|
|||
if (tstamp->size != st->st_size) return EINA_FALSE;
|
||||
if (tstamp->ino != st->st_ino) return EINA_FALSE;
|
||||
#ifdef _STAT_VER_LINUX
|
||||
#if (defined __USE_MISC && defined st_mtime)
|
||||
if (tstamp->mtime_nsec != (unsigned long int)st->st_mtim.tv_nsec)
|
||||
return EINA_FALSE;
|
||||
#else
|
||||
if (tstamp->mtime_nsec != (unsigned long int)st->st_mtimensec)
|
||||
return EINA_FALSE;
|
||||
#endif
|
||||
#endif
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
@ -219,11 +214,7 @@ _timestamp_build(Image_Timestamp *tstamp, struct stat *st)
|
|||
tstamp->size = st->st_size;
|
||||
tstamp->ino = st->st_ino;
|
||||
#ifdef _STAT_VER_LINUX
|
||||
#if (defined __USE_MISC && defined st_mtime)
|
||||
tstamp->mtime_nsec = (unsigned long int)st->st_mtim.tv_nsec;
|
||||
#else
|
||||
tstamp->mtime_nsec = (unsigned long int)st->st_mtimensec;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <evil_private.h> /* evil_path_is_absolute */
|
||||
#endif
|
||||
|
||||
#include <Eet.h>
|
||||
|
||||
#ifdef HAVE_FONTCONFIG
|
||||
|
@ -67,17 +63,6 @@ static FcConfig *fc_config = NULL;
|
|||
/* get the casefold feature! */
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
int
|
||||
_file_path_is_full_path(const char *path)
|
||||
{
|
||||
if (!path) return 0;
|
||||
#ifdef _WIN32
|
||||
if (evil_path_is_absolute(path)) return 1;
|
||||
#else
|
||||
if (path[0] == '/') return 1;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static DATA64
|
||||
_file_modified_time(const char *file)
|
||||
|
@ -787,7 +772,7 @@ evas_font_load(const Eina_List *font_paths, int hinting, Evas_Font_Description *
|
|||
}
|
||||
if (!font) /* Source load failed */
|
||||
{
|
||||
if (_file_path_is_full_path((char *)nm)) /* Try filename */
|
||||
if (!eina_file_path_relative((char *)nm)) /* Try filename */
|
||||
font = (Evas_Font_Set *)evas_common_font_load((char *)nm, size, wanted_rend, bitmap_scalable);
|
||||
else /* search font path */
|
||||
{
|
||||
|
@ -856,7 +841,7 @@ evas_font_load(const Eina_List *font_paths, int hinting, Evas_Font_Description *
|
|||
}
|
||||
if (!ok)
|
||||
{
|
||||
if (_file_path_is_full_path((char *)nm))
|
||||
if (!eina_file_path_relative((char *)nm))
|
||||
evas_common_font_add((RGBA_Font *)font, (char *)nm, size, wanted_rend, bitmap_scalable);
|
||||
else
|
||||
{
|
||||
|
|
|
@ -976,7 +976,7 @@ struct _Escape_Value
|
|||
size_t value_len;
|
||||
};
|
||||
|
||||
#define ESCAPE_VALUE(e,v) {e,v,strlen(e),strlen(v)}
|
||||
#define ESCAPE_VALUE(e,v) {e,v,sizeof(e)-1,sizeof(v)-1}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
|
|
@ -25,6 +25,8 @@ EVAS_API Cutout_Rects *evas_common_draw_context_cutouts_new (vo
|
|||
EVAS_API void evas_common_draw_context_cutouts_free (Cutout_Rects* rects);
|
||||
EVAS_API void evas_common_draw_context_cutouts_real_free (Cutout_Rects* rects);
|
||||
EVAS_API void evas_common_draw_context_cutouts_del (Cutout_Rects* rects, int idx);
|
||||
EVAS_API void evas_common_draw_context_cutout_max_set (RGBA_Draw_Context *dc, int max);
|
||||
EVAS_API void evas_common_draw_context_cutout_size_min_set (RGBA_Draw_Context *dc, int min);
|
||||
EVAS_API void evas_common_draw_context_add_cutout (RGBA_Draw_Context *dc, int x, int y, int w, int h);
|
||||
EVAS_API void evas_common_draw_context_clear_cutouts (RGBA_Draw_Context *dc);
|
||||
EVAS_API Cutout_Rects *evas_common_draw_context_apply_cutouts (RGBA_Draw_Context *dc, Cutout_Rects *recycle);
|
||||
|
|
|
@ -174,6 +174,8 @@ evas_common_draw_context_new(void)
|
|||
dc = _evas_common_draw_context_find();
|
||||
if (!dc) return NULL;
|
||||
memset(dc, 0, sizeof(RGBA_Draw_Context));
|
||||
dc->cutout.count_max = 0x7fffffff;
|
||||
dc->cutout.size_min = 8 * 8;
|
||||
return dc;
|
||||
}
|
||||
|
||||
|
@ -296,11 +298,23 @@ evas_common_draw_context_unset_multiplier(RGBA_Draw_Context *dc)
|
|||
dc->mul.use = 0;
|
||||
}
|
||||
|
||||
EVAS_API void
|
||||
evas_common_draw_context_cutout_max_set(RGBA_Draw_Context *dc, int max)
|
||||
{
|
||||
dc->cutout.count_max = max;
|
||||
}
|
||||
|
||||
EVAS_API void
|
||||
evas_common_draw_context_cutout_size_min_set(RGBA_Draw_Context *dc, int min)
|
||||
{
|
||||
dc->cutout.size_min = min;
|
||||
}
|
||||
|
||||
EVAS_API void
|
||||
evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int w, int h)
|
||||
{
|
||||
// if (dc->cutout.rects > 512) return;
|
||||
if (dc->cutout.active >= dc->cutout.count_max) return;
|
||||
if ((w * h) < dc->cutout.size_min) return;
|
||||
if (dc->clip.use)
|
||||
{
|
||||
#if 1 // this is a bit faster
|
||||
|
@ -335,8 +349,8 @@ evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int w,
|
|||
RECTS_CLIP_TO_RECT(x, y, w, h,
|
||||
dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
|
||||
#endif
|
||||
if ((w * h) < dc->cutout.size_min) return;
|
||||
}
|
||||
if ((w * h) <= (8 * 8)) return;
|
||||
if (dc->cutout.last_add.w > 0)
|
||||
{
|
||||
if ((dc->cutout.last_add.x == x) && (dc->cutout.last_add.y == y) &&
|
||||
|
|
|
@ -68,6 +68,8 @@ static const struct ext_loader_s loaders[] =
|
|||
|
||||
MATCHING(".jxl", "jxl"),
|
||||
|
||||
MATCHING(".qoi", "qoi"),
|
||||
|
||||
MATCHING(".avif", "avif"),
|
||||
MATCHING(".avifs", "avif"),
|
||||
|
||||
|
@ -195,8 +197,8 @@ static const struct ext_loader_s loaders[] =
|
|||
static const char *loaders_name[] =
|
||||
{ /* in order of most likely needed */
|
||||
"png", "jpeg", "eet", "xpm", "tiff", "gif", "svg", "webp", "pmaps",
|
||||
"bmp", "tga", "wbmp", "ico", "psd", "jp2k", "dds", "jxl", "avif", "heif",
|
||||
"generic"
|
||||
"bmp", "tga", "wbmp", "ico", "psd", "jp2k", "dds", "jxl", "qoi", "avif",
|
||||
"heif", "generic"
|
||||
};
|
||||
|
||||
struct evas_image_foreach_loader_data
|
||||
|
@ -413,11 +415,7 @@ _timestamp_build(Image_Timestamp *tstamp, struct stat *st)
|
|||
tstamp->size = st->st_size;
|
||||
tstamp->ino = st->st_ino;
|
||||
#ifdef _STAT_VER_LINUX
|
||||
# if (defined __USE_MISC && defined st_mtime)
|
||||
tstamp->mtime_nsec = (unsigned long int)st->st_mtim.tv_nsec;
|
||||
# else
|
||||
tstamp->mtime_nsec = (unsigned long int)st->st_mtimensec;
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@ evas_common_save_image_to_file(RGBA_Image *im, const char *file, const char *key
|
|||
saver = "avif";
|
||||
if (!strcasecmp(p, "jxl"))
|
||||
saver = "jxl";
|
||||
if (!strcasecmp(p, "qoi"))
|
||||
saver = "qoi";
|
||||
}
|
||||
|
||||
if (saver)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
# ifdef SCALE_USING_NEON
|
||||
# ifndef COLBLACK
|
||||
uint16x4_t temp_16x4;
|
||||
uint16x4_t temp_16x4 = { 0, 0, 0, 0 };
|
||||
uint16x4_t rv_16x4;
|
||||
uint16x4_t val1_16x4;
|
||||
uint16x4_t val3_16x4;
|
||||
|
@ -19,8 +19,8 @@
|
|||
uint16x8_t val2_val4_16x8;
|
||||
uint16x8_t x255_16x8;
|
||||
uint32x2_t res_32x2;
|
||||
uint32x2_t val1_val3_32x2;
|
||||
uint32x2_t val2_val4_32x2;
|
||||
uint32x2_t val1_val3_32x2 = { 0, 0 };
|
||||
uint32x2_t val2_val4_32x2 = { 0, 0 };
|
||||
uint8x8_t val1_val3_8x8;
|
||||
uint8x8_t val2_val4_8x8;
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
|||
uint16x4_t c1_val3_16x4;
|
||||
uint16x8_t c1_16x8;
|
||||
uint16x8_t c1_val3_16x8;
|
||||
uint32x2_t c1_32x2;
|
||||
uint32x2_t c1_32x2 = { 0, 0 };
|
||||
uint8x8_t c1_8x8;
|
||||
uint8x8_t c1_val3_8x8;
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
|||
uint16x8_t c1_val1_16x8;
|
||||
uint16x8_t c2_val3_16x8;
|
||||
uint16x8_t cv_rv_16x8;
|
||||
uint32x2_t c1_c2_32x2;
|
||||
uint32x2_t c1_c2_32x2 = { 0, 0 };
|
||||
uint8x8_t c1_c2_8x8;
|
||||
uint8x8_t val3_8x8;
|
||||
uint16x8_t val3_16x8;
|
||||
|
@ -247,21 +247,21 @@
|
|||
# ifndef COLBLACK
|
||||
# ifdef COLMUL
|
||||
uint16x4_t x255_16x4;
|
||||
uint16x4_t temp_16x4;
|
||||
uint16x4_t temp_16x4 = { 0, 0, 0, 0 };
|
||||
uint16x8_t cval_16x8;
|
||||
uint32x2_t res_32x2;
|
||||
uint8x8_t cval_8x8;
|
||||
uint16x4_t c1_16x4;
|
||||
uint16x4_t cval_16x4;
|
||||
uint16x4_t val1_16x4;
|
||||
uint32x2_t val1_32x2;
|
||||
uint32x2_t val1_32x2 = { 0, 0 };
|
||||
uint8x8_t val1_8x8;
|
||||
|
||||
x255_16x4 = vdup_n_u16(0xff);
|
||||
# ifdef COLSAME
|
||||
uint16x8_t c1_16x8;
|
||||
uint16x8_t val1_16x8;
|
||||
uint32x2_t c1_32x2;
|
||||
uint32x2_t c1_32x2 = { 0, 0 };
|
||||
uint8x8_t c1_8x8;
|
||||
|
||||
c1_32x2 = vset_lane_u32(c1, c1_32x2, 0);
|
||||
|
@ -277,7 +277,7 @@
|
|||
uint16x4_t cv_16x4;
|
||||
uint16x8_t c1_c2_16x8;
|
||||
uint16x8_t val1_16x8;
|
||||
uint32x2_t c1_c2_32x2;
|
||||
uint32x2_t c1_c2_32x2 = { 0, 0 };
|
||||
uint8x8_t c1_c2_8x8;
|
||||
|
||||
c1_c2_32x2 = vset_lane_u32(c1, c1_c2_32x2, 0);
|
||||
|
|
|
@ -30,7 +30,7 @@ _op_blend_mas_c_dp_neon(DATA32 *s EINA_UNUSED, DATA8 *m, DATA32 c, DATA32 *d, in
|
|||
uint16x8_t temp1_16x8;
|
||||
uint16x8_t x255_16x8;
|
||||
uint32x2_t c_32x2;
|
||||
uint32x2_t m_32x2;
|
||||
uint32x2_t m_32x2 = { 0, 0 };
|
||||
uint32x4_t a_32x4;
|
||||
uint32x4_t ad_32x4;
|
||||
uint32x4_t cond_32x4;
|
||||
|
@ -294,7 +294,7 @@ _op_blend_mas_can_dp_neon(DATA32 *s EINA_UNUSED, DATA8 *m, DATA32 c, DATA32 *d,
|
|||
uint16x8_t m1_16x8;
|
||||
uint16x8_t m_16x8;
|
||||
uint32x2_t c_32x2;
|
||||
uint32x2_t m_32x2;
|
||||
uint32x2_t m_32x2 = { 0, 0 };
|
||||
uint32x4_t d_32x4;
|
||||
uint32x4_t dc_32x4;
|
||||
uint32x4_t m_32x4;
|
||||
|
@ -695,7 +695,7 @@ _op_blend_rel_mas_c_dp_neon(DATA32 *s EINA_UNUSED, DATA8 *m, DATA32 c, DATA32 *d
|
|||
uint16x8_t temp1_16x8;
|
||||
uint16x8_t x255_16x8;
|
||||
uint32x2_t c_32x2;
|
||||
uint32x2_t m_32x2;
|
||||
uint32x2_t m_32x2 = { 0, 0 };
|
||||
uint32x4_t a_32x4;
|
||||
uint32x4_t ad_32x4;
|
||||
uint32x4_t cond_32x4;
|
||||
|
|
|
@ -13,7 +13,7 @@ _op_blend_pas_mas_dp_neon(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d,
|
|||
uint16x8_t temp1_16x8;
|
||||
uint16x8_t x255_16x8;
|
||||
uint32_t m_32;
|
||||
uint32x2_t m_32x2;
|
||||
uint32x2_t m_32x2 = {0, 0};
|
||||
uint32x4_t a_32x4;
|
||||
uint32x4_t ad_32x4;
|
||||
uint32x4_t cond_32x4;
|
||||
|
@ -217,7 +217,7 @@ _op_blend_p_mas_dp_neon(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, in
|
|||
uint16x8_t temp0_16x8;
|
||||
uint16x8_t temp1_16x8;
|
||||
uint16x8_t x255_16x8;
|
||||
uint32x2_t m_32x2;
|
||||
uint32x2_t m_32x2 = { 0, 0 };
|
||||
uint32x4_t a_32x4;
|
||||
uint32x4_t ad_32x4;
|
||||
uint32x4_t cond_32x4;
|
||||
|
|
|
@ -19,7 +19,7 @@ struct _Color_Name_Value
|
|||
unsigned char b;
|
||||
};
|
||||
|
||||
#define COLOR_NAME(name,r,g,b) {name,(unsigned char)strlen(name),r,g,b}
|
||||
#define COLOR_NAME(name,r,g,b) {name,(unsigned char)sizeof(name)-1,r,g,b}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
|
|
@ -210,6 +210,7 @@ EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, jxl);
|
|||
EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, pmaps);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, png);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, psd);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, qoi);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, svg);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, tga);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, tiff);
|
||||
|
@ -230,6 +231,7 @@ EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, eet);
|
|||
EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, jpeg);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, jxl);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, png);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, qoi);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, tiff);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, webp);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, tgv);
|
||||
|
@ -334,6 +336,9 @@ static const struct {
|
|||
#ifdef EVAS_STATIC_BUILD_PSD
|
||||
EVAS_EINA_STATIC_MODULE_USE(image_loader, psd),
|
||||
#endif
|
||||
#ifdef EVAS_STATIC_BUILD_QOI
|
||||
EVAS_EINA_STATIC_MODULE_USE(image_loader, qoi),
|
||||
#endif
|
||||
#ifdef EVAS_STATIC_BUILD_SVG
|
||||
EVAS_EINA_STATIC_MODULE_USE(image_loader, svg),
|
||||
#endif
|
||||
|
@ -380,6 +385,9 @@ static const struct {
|
|||
#ifdef EVAS_STATIC_BUILD_PNG
|
||||
EVAS_EINA_STATIC_MODULE_USE(image_saver, png),
|
||||
#endif
|
||||
#ifdef EVAS_STATIC_BUILD_QOI
|
||||
EVAS_EINA_STATIC_MODULE_USE(image_saver, qoi),
|
||||
#endif
|
||||
#ifdef EVAS_STATIC_BUILD_TIFF
|
||||
EVAS_EINA_STATIC_MODULE_USE(image_saver, tiff),
|
||||
#endif
|
||||
|
|
|
@ -15,10 +15,6 @@
|
|||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <evil_private.h> /* evil_path_is_absolute */
|
||||
#endif
|
||||
|
||||
#include "evas_common_private.h"
|
||||
#include "evas_private.h"
|
||||
|
||||
|
@ -28,18 +24,6 @@
|
|||
# define EVAS_PATH_SEPARATOR "/"
|
||||
#endif
|
||||
|
||||
int
|
||||
evas_file_path_is_full_path(const char *path)
|
||||
{
|
||||
if (!path) return 0;
|
||||
#ifdef _WIN32
|
||||
if (evil_path_is_absolute(path)) return 1;
|
||||
#else
|
||||
if (path[0] == '/') return 1;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *
|
||||
evas_file_path_join(const char *path, const char *end)
|
||||
{
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define _EVAS_PATH_H
|
||||
|
||||
|
||||
int evas_file_path_is_full_path (const char *path);
|
||||
char *evas_file_path_join (const char *path, const char *end);
|
||||
int evas_file_path_exists (const char *path);
|
||||
int evas_file_path_is_file (const char *path);
|
||||
|
|
|
@ -92,9 +92,18 @@ _interpolate_linear(DATA8 *output, int *points)
|
|||
{
|
||||
if (points[j] != -1)
|
||||
{
|
||||
int val1, val2, vald, pos, len;
|
||||
|
||||
output[j] = (DATA8) points[j];
|
||||
val1 = points[last_idx];
|
||||
val2 = points[j];
|
||||
vald = val2 - val1;
|
||||
len = j - last_idx;
|
||||
for (k = last_idx + 1; k < j; k++)
|
||||
output[k] = (DATA8) (points[j] + ((k - last_idx) * (points[j] - points[last_idx]) / (j - last_idx)));
|
||||
{
|
||||
pos = k - last_idx;
|
||||
output[k] = (DATA8) (val1 + ((pos * vald) / len));
|
||||
}
|
||||
last_idx = j;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -645,6 +645,8 @@ struct _Cutout_Rects
|
|||
Cutout_Rect *rects;
|
||||
int active;
|
||||
int max;
|
||||
int count_max;
|
||||
int size_min;
|
||||
struct {
|
||||
int x, w, y, h;
|
||||
} last_add;
|
||||
|
|
|
@ -29,6 +29,7 @@ evas_image_loaders_file = [
|
|||
['pmaps', 'shared', []],
|
||||
['png', 'static', [png]],
|
||||
['psd', 'shared', []],
|
||||
['qoi', 'shared', []],
|
||||
['tga', 'shared', []],
|
||||
['tgv', 'shared', [rg_etc, lz4]],
|
||||
['tiff', 'shared', [tiff]],
|
||||
|
@ -43,6 +44,7 @@ evas_image_savers_file = [
|
|||
['jpeg', 'static', [jpeg]],
|
||||
['jxl' , 'shared', [libjxl, libjxl_threads]],
|
||||
['png', 'static', [png]],
|
||||
['qoi', 'shared', []],
|
||||
['tgv', 'shared', [rg_etc, lz4]],
|
||||
['tiff', 'shared', [tiff]],
|
||||
['webp', 'shared', [webp]],
|
||||
|
|
|
@ -188,25 +188,3 @@ _evil_last_error_display(const char *fct)
|
|||
{
|
||||
fprintf(stderr, "[Evil] [%s] ERROR: %s\n", fct, evil_last_error_get());
|
||||
}
|
||||
|
||||
EVIL_API int
|
||||
evil_path_is_absolute(const char *path)
|
||||
{
|
||||
size_t length;
|
||||
|
||||
if (!path)
|
||||
return 0;
|
||||
|
||||
if (*path == '/' || *path == '\\') return 1;
|
||||
|
||||
length = strlen(path);
|
||||
if (length < 3) return 0;
|
||||
|
||||
if ((((*path >= 'a') && (*path <= 'z')) ||
|
||||
((*path >= 'A') && (*path <= 'Z'))) &&
|
||||
(path[1] == ':') &&
|
||||
((path[2] == '/') || (path[2] == '\\')))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -81,27 +81,4 @@ EVIL_API const char *evil_format_message(long err);
|
|||
|
||||
EVIL_API const char *evil_last_error_get(void);
|
||||
|
||||
/**
|
||||
* @brief check if the given path is absolute.
|
||||
*
|
||||
* @param path The path to check.
|
||||
* @return 1 if the given path is absolute, 0 otherwise.
|
||||
*
|
||||
* Check if the path @p path is absolute or not. An absolute path must
|
||||
* begin with a letter (upper or lower case), followed by by the char
|
||||
* ':', followed by the char '/' or '\'. If @p path is absolute this
|
||||
* function returns 1, otherwise it returns 0. If @p path is @c NULL,
|
||||
* it returns 0.
|
||||
*
|
||||
* Conformity: Non applicable.
|
||||
*
|
||||
* Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000,
|
||||
* Windows XP.
|
||||
*
|
||||
* @since 1.7
|
||||
*
|
||||
* @ingroup Evil
|
||||
*/
|
||||
EVIL_API int evil_path_is_absolute(const char *path);
|
||||
|
||||
#endif /* __EVIL_UTIL_H__ */
|
||||
|
|
|
@ -458,7 +458,7 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
|
|||
};
|
||||
|
||||
static Ecore_Evas*
|
||||
_ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha)
|
||||
_ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fullscreen, int hwsurface, int noframe EINA_UNUSED, int alpha)
|
||||
{
|
||||
Ecore_Evas_SDL_Switch_Data *swd;
|
||||
Ecore_Evas *ee;
|
||||
|
|
|
@ -158,7 +158,8 @@ struct _Evas_GL_Shared
|
|||
Eina_Bool etc1_subimage : 1;
|
||||
Eina_Bool s3tc : 1;
|
||||
// tuning params - per gpu/cpu combo?
|
||||
#define DEF_CUTOUT 4096
|
||||
#define DEF_CUTOUT 64
|
||||
#define DEF_CUTOUT_SIZE_MIN (64*64)
|
||||
|
||||
#define MAX_PIPES 32
|
||||
#define DEF_PIPES 8
|
||||
|
@ -188,6 +189,9 @@ struct _Evas_GL_Shared
|
|||
struct {
|
||||
int max;
|
||||
} cutout;
|
||||
struct {
|
||||
int min;
|
||||
} cutout_size;
|
||||
struct {
|
||||
int max;
|
||||
} pipes;
|
||||
|
|
|
@ -1004,6 +1004,7 @@ evas_gl_common_context_new(void)
|
|||
// magic numbers that are a result of imperical testing and getting
|
||||
// "best case" performance across a range of systems
|
||||
shared->info.tune.cutout.max = DEF_CUTOUT;
|
||||
shared->info.tune.cutout_size.min = DEF_CUTOUT_SIZE_MIN;
|
||||
shared->info.tune.pipes.max = DEF_PIPES;
|
||||
shared->info.tune.atlas.max_alloc_size = DEF_ATLAS_ALLOC;
|
||||
shared->info.tune.atlas.max_alloc_alpha_size = DEF_ATLAS_ALLOC_ALPHA;
|
||||
|
@ -1040,6 +1041,7 @@ evas_gl_common_context_new(void)
|
|||
} while (0)
|
||||
|
||||
GETENVOPT("EVAS_GL_CUTOUT_MAX", cutout.max, -1, 0x7fffffff);
|
||||
GETENVOPT("EVAS_GL_CUTOUT_SIZE_MIN", cutout_size.min, -1, 0x7fffffff);
|
||||
GETENVOPT("EVAS_GL_PIPES_MAX", pipes.max, 1, MAX_PIPES);
|
||||
GETENVOPT("EVAS_GL_ATLAS_ALLOC_SIZE", atlas.max_alloc_size, MIN_ATLAS_ALLOC, MAX_ATLAS_ALLOC);
|
||||
GETENVOPT("EVAS_GL_ATLAS_ALLOC_ALPHA_SIZE", atlas.max_alloc_alpha_size, MIN_ATLAS_ALLOC_ALPHA, MAX_ATLAS_ALLOC_ALPHA);
|
||||
|
@ -1109,6 +1111,7 @@ evas_gl_common_context_new(void)
|
|||
"\n"
|
||||
"EVAS_GL_GET_PROGRAM_BINARY: %i\n"
|
||||
"EVAS_GL_CUTOUT_MAX: %i\n"
|
||||
"EVAS_GL_CUTOUT_SIZE_MIN: %i\n"
|
||||
"EVAS_GL_PIPES_MAX: %i\n"
|
||||
"EVAS_GL_ATLAS_ALLOC_SIZE: %i\n"
|
||||
"EVAS_GL_ATLAS_ALLOC_ALPHA_SIZE: %i\n"
|
||||
|
@ -1128,6 +1131,7 @@ evas_gl_common_context_new(void)
|
|||
|
||||
(int)shared->info.bin_program,
|
||||
(int)shared->info.tune.cutout.max,
|
||||
(int)shared->info.tune.cutout_size.min,
|
||||
(int)shared->info.tune.pipes.max,
|
||||
(int)shared->info.tune.atlas.max_alloc_size,
|
||||
(int)shared->info.tune.atlas.max_alloc_alpha_size,
|
||||
|
|
|
@ -788,6 +788,10 @@ _rotate_image_data(Render_Engine_GL_Generic *re, Evas_GL_Image *im1)
|
|||
|
||||
// Create a new and temporary context
|
||||
dc = evas_common_draw_context_new();
|
||||
evas_common_draw_context_cutout_max_set
|
||||
(dc, gl_context->shared->info.tune.cutout.max);
|
||||
evas_common_draw_context_cutout_size_min_set
|
||||
(dc, gl_context->shared->info.tune.cutout_size.min);
|
||||
evas_common_draw_context_set_clip(dc, 0, 0, im2->w, im2->h);
|
||||
gl_context->dc = dc;
|
||||
|
||||
|
@ -2317,6 +2321,23 @@ eng_pixel_alpha_get(void *image, int x, int y, DATA8 *alpha, int src_region_x, i
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_context_new(void *engine)
|
||||
{
|
||||
Render_Engine_GL_Generic *re = engine;
|
||||
Evas_Engine_GL_Context *gl_context;
|
||||
void *ctx;
|
||||
|
||||
gl_context = gl_generic_context_find(re, 1);
|
||||
|
||||
ctx = pfunc.context_new(&re->software);
|
||||
evas_common_draw_context_cutout_max_set
|
||||
(ctx, gl_context->shared->info.tune.cutout.max);
|
||||
evas_common_draw_context_cutout_size_min_set
|
||||
(ctx, gl_context->shared->info.tune.cutout_size.min);
|
||||
return ctx;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_context_flush(void *engine)
|
||||
{
|
||||
|
@ -3110,6 +3131,7 @@ module_open(Evas_Module *em)
|
|||
ORD(engine_new);
|
||||
ORD(engine_free);
|
||||
|
||||
ORD(context_new);
|
||||
ORD(context_clip_image_set);
|
||||
ORD(context_clip_image_unset);
|
||||
ORD(context_clip_image_get);
|
||||
|
|
|
@ -53,6 +53,7 @@ _gaussian_interpolate(double **weights, double **offsets, double radius)
|
|||
max_index = (int) ceil(radius);
|
||||
if (max_index & 0x1) max_index++;
|
||||
values = alloca((max_index + 1) * sizeof(*values));
|
||||
values[0] = 0.0;
|
||||
_gaussian_calc(values, max_index, radius);
|
||||
|
||||
count = (max_index / 2) + 1;
|
||||
|
|
|
@ -0,0 +1,425 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "Evas_Loader.h"
|
||||
#include "evas_common_private.h"
|
||||
|
||||
/*
|
||||
* code based on original qoi.h code (MIT license):
|
||||
* https://github.com/phoboslab/qoi/blob/master/qoi.h
|
||||
* date: 2023 march the 14th
|
||||
*/
|
||||
|
||||
#define QOI_ZEROARR(a) memset((a),0,sizeof(a))
|
||||
|
||||
#define QOI_OP_INDEX 0x00 /* 00xxxxxx */
|
||||
#define QOI_OP_DIFF 0x40 /* 01xxxxxx */
|
||||
#define QOI_OP_LUMA 0x80 /* 10xxxxxx */
|
||||
#define QOI_OP_RUN 0xc0 /* 11xxxxxx */
|
||||
#define QOI_OP_RGB 0xfe /* 11111110 */
|
||||
#define QOI_OP_RGBA 0xff /* 11111111 */
|
||||
|
||||
#define QOI_MASK_2 0xc0 /* 11000000 */
|
||||
|
||||
#define QOI_COLOR_HASH(C) (C.rgba.r*3 + C.rgba.g*5 + C.rgba.b*7 + C.rgba.a*11)
|
||||
|
||||
#define QOI_MAGIC \
|
||||
(((unsigned int)'q') << 24 | ((unsigned int)'o') << 16 | \
|
||||
((unsigned int)'i') << 8 | ((unsigned int)'f'))
|
||||
|
||||
#define QOI_HEADER_SIZE 14
|
||||
|
||||
#define QOI_PIXELS_MAX ((unsigned int)400000000)
|
||||
|
||||
#ifdef ERR
|
||||
# undef ERR
|
||||
#endif
|
||||
#define ERR(...) EINA_LOG_DOM_ERR(_evas_loader_qoi_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef WRN
|
||||
# undef WRN
|
||||
#endif
|
||||
#define WRN(...) EINA_LOG_DOM_WARN(_evas_loader_qoi_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef INF
|
||||
# undef INF
|
||||
#endif
|
||||
#define INF(...) EINA_LOG_DOM_INFO(_evas_loader_qoi_log_dom, __VA_ARGS__)
|
||||
|
||||
typedef struct _Evas_Loader_Internal Evas_Loader_Internal;
|
||||
struct _Evas_Loader_Internal
|
||||
{
|
||||
Eina_File *f;
|
||||
Evas_Image_Load_Opts *opts;
|
||||
Evas_Image_Animated *animated;
|
||||
};
|
||||
|
||||
typedef union {
|
||||
struct { unsigned char r, g, b, a; } rgba;
|
||||
unsigned int v;
|
||||
} qoi_rgba_t;
|
||||
|
||||
static int _evas_loader_qoi_log_dom = -1;
|
||||
|
||||
static const unsigned char qoi_padding[8] = {0,0,0,0,0,0,0,1};
|
||||
|
||||
static unsigned int read_32(const unsigned char *data, int *p)
|
||||
{
|
||||
unsigned int a = data[(*p)++];
|
||||
unsigned int b = data[(*p)++];
|
||||
unsigned int c = data[(*p)++];
|
||||
unsigned int d = data[(*p)++];
|
||||
return a << 24 | b << 16 | c << 8 | d;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
evas_image_load_file_head_qoi_internal(Evas_Loader_Internal *loader EINA_UNUSED,
|
||||
Emile_Image_Property *prop,
|
||||
void *map, size_t length,
|
||||
int *error)
|
||||
{
|
||||
const unsigned char *bytes;
|
||||
unsigned int magic;
|
||||
unsigned char channels;
|
||||
unsigned char colorspace;
|
||||
int p = 0;
|
||||
Eina_Bool ret;
|
||||
|
||||
ret = EINA_FALSE;
|
||||
prop->w = 0;
|
||||
prop->h = 0;
|
||||
prop->alpha = EINA_FALSE;
|
||||
|
||||
if (length < QOI_HEADER_SIZE + sizeof(qoi_padding))
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bytes = (const unsigned char *)map;
|
||||
|
||||
magic = read_32(bytes, &p);
|
||||
if (magic != QOI_MAGIC)
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
|
||||
return ret;
|
||||
}
|
||||
|
||||
prop->w = read_32(bytes, &p);
|
||||
prop->h = read_32(bytes, &p);
|
||||
if ((prop->w < 1) ||
|
||||
(prop->h < 1) ||
|
||||
(prop->h >= QOI_PIXELS_MAX / prop->w) ||
|
||||
(prop->w > IMG_MAX_SIZE) ||
|
||||
(prop->h > IMG_MAX_SIZE) ||
|
||||
IMG_TOO_BIG(prop->w, prop->h))
|
||||
{
|
||||
*error= EVAS_LOAD_ERROR_GENERIC;
|
||||
return ret;
|
||||
}
|
||||
|
||||
channels = bytes[p++];
|
||||
colorspace = bytes[p++];
|
||||
|
||||
if ((channels < 3) ||
|
||||
(channels > 4) ||
|
||||
(colorspace > 1))
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
||||
return ret;
|
||||
}
|
||||
|
||||
prop->alpha = channels == 4;
|
||||
|
||||
*error = EVAS_LOAD_ERROR_NONE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
evas_image_load_file_data_qoi_internal(Evas_Loader_Internal *loader EINA_UNUSED,
|
||||
Emile_Image_Property *prop,
|
||||
void *pixels,
|
||||
void *map, size_t length,
|
||||
int *error)
|
||||
{
|
||||
qoi_rgba_t index[64];
|
||||
const unsigned char *bytes;
|
||||
qoi_rgba_t px;
|
||||
unsigned int *iter;
|
||||
unsigned int magic;
|
||||
unsigned char channels;
|
||||
unsigned char colorspace;
|
||||
int p = 0;
|
||||
int run = 0;
|
||||
int chunks_len;
|
||||
size_t px_len;
|
||||
size_t px_pos;
|
||||
Eina_Bool ret;
|
||||
|
||||
ret = EINA_FALSE;
|
||||
prop->w = 0;
|
||||
prop->h = 0;
|
||||
prop->alpha = EINA_FALSE;
|
||||
|
||||
if (length < QOI_HEADER_SIZE + sizeof(qoi_padding))
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bytes = (const unsigned char *)map;
|
||||
|
||||
magic = read_32(bytes, &p);
|
||||
if (magic != QOI_MAGIC)
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
|
||||
return ret;
|
||||
}
|
||||
|
||||
prop->w = read_32(bytes, &p);
|
||||
prop->h = read_32(bytes, &p);
|
||||
if ((prop->w < 1) ||
|
||||
(prop->h < 1) ||
|
||||
(prop->h >= QOI_PIXELS_MAX / prop->w) ||
|
||||
(prop->w > IMG_MAX_SIZE) ||
|
||||
(prop->h > IMG_MAX_SIZE) ||
|
||||
IMG_TOO_BIG(prop->w, prop->h))
|
||||
{
|
||||
*error= EVAS_LOAD_ERROR_GENERIC;
|
||||
return ret;
|
||||
}
|
||||
|
||||
channels = bytes[p++];
|
||||
colorspace = bytes[p++];
|
||||
|
||||
if ((channels < 3) ||
|
||||
(channels > 4) ||
|
||||
(colorspace > 1))
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
||||
return ret;
|
||||
}
|
||||
|
||||
prop->alpha = channels == 4;
|
||||
|
||||
px_len = prop->w * prop->h * channels;
|
||||
|
||||
QOI_ZEROARR(index);
|
||||
px.rgba.r = 0;
|
||||
px.rgba.g = 0;
|
||||
px.rgba.b = 0;
|
||||
px.rgba.a = 255;
|
||||
|
||||
iter = pixels;
|
||||
chunks_len = length - (int)sizeof(qoi_padding);
|
||||
for (px_pos = 0; px_pos < px_len; px_pos += channels, iter++)
|
||||
{
|
||||
if (run > 0)
|
||||
{
|
||||
run--;
|
||||
}
|
||||
else if (p < chunks_len)
|
||||
{
|
||||
int b1 = bytes[p++];
|
||||
|
||||
if (b1 == QOI_OP_RGB)
|
||||
{
|
||||
px.rgba.r = bytes[p++];
|
||||
px.rgba.g = bytes[p++];
|
||||
px.rgba.b = bytes[p++];
|
||||
}
|
||||
else if (b1 == QOI_OP_RGBA)
|
||||
{
|
||||
px.rgba.r = bytes[p++];
|
||||
px.rgba.g = bytes[p++];
|
||||
px.rgba.b = bytes[p++];
|
||||
px.rgba.a = bytes[p++];
|
||||
}
|
||||
else if ((b1 & QOI_MASK_2) == QOI_OP_INDEX)
|
||||
{
|
||||
px = index[b1];
|
||||
}
|
||||
else if ((b1 & QOI_MASK_2) == QOI_OP_DIFF)
|
||||
{
|
||||
px.rgba.r += ((b1 >> 4) & 0x03) - 2;
|
||||
px.rgba.g += ((b1 >> 2) & 0x03) - 2;
|
||||
px.rgba.b += ( b1 & 0x03) - 2;
|
||||
}
|
||||
else if ((b1 & QOI_MASK_2) == QOI_OP_LUMA)
|
||||
{
|
||||
int b2 = bytes[p++];
|
||||
int vg = (b1 & 0x3f) - 32;
|
||||
px.rgba.r += vg - 8 + ((b2 >> 4) & 0x0f);
|
||||
px.rgba.g += vg;
|
||||
px.rgba.b += vg - 8 + (b2 & 0x0f);
|
||||
}
|
||||
else if ((b1 & QOI_MASK_2) == QOI_OP_RUN)
|
||||
{
|
||||
run = (b1 & 0x3f);
|
||||
}
|
||||
|
||||
index[QOI_COLOR_HASH(px) % 64] = px;
|
||||
}
|
||||
|
||||
if (prop->alpha)
|
||||
*iter = (px.rgba.a << 24) |
|
||||
(((px.rgba.r * px.rgba.a) / 255) << 16) |
|
||||
(((px.rgba.g * px.rgba.a) / 255) << 8) |
|
||||
(((px.rgba.b * px.rgba.a) / 255));
|
||||
else
|
||||
*iter = (255 << 24) |
|
||||
(px.rgba.r << 16) |
|
||||
(px.rgba.g << 8) |
|
||||
(px.rgba.b);
|
||||
}
|
||||
|
||||
*error = EVAS_LOAD_ERROR_NONE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void *
|
||||
evas_image_load_file_open_qoi(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
|
||||
Evas_Image_Load_Opts *opts,
|
||||
Evas_Image_Animated *animated EINA_UNUSED,
|
||||
int *error)
|
||||
{
|
||||
Evas_Loader_Internal *loader;
|
||||
|
||||
loader = calloc(1, sizeof (Evas_Loader_Internal));
|
||||
if (!loader)
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
loader->f = f;
|
||||
loader->opts = opts;
|
||||
|
||||
return loader;
|
||||
}
|
||||
|
||||
static void
|
||||
evas_image_load_file_close_qoi(void *loader_data)
|
||||
{
|
||||
free(loader_data);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
evas_image_load_file_head_qoi(void *loader_data,
|
||||
Evas_Image_Property *prop,
|
||||
int *error)
|
||||
{
|
||||
Evas_Loader_Internal *loader = loader_data;
|
||||
Eina_File *f;
|
||||
void *map;
|
||||
Eina_Bool val;
|
||||
|
||||
f = loader->f;
|
||||
|
||||
map = eina_file_map_all(f, EINA_FILE_RANDOM);
|
||||
if (!map)
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
val = evas_image_load_file_head_qoi_internal(loader,
|
||||
(Emile_Image_Property *)prop,
|
||||
map, eina_file_size_get(f),
|
||||
error);
|
||||
|
||||
eina_file_map_free(f, map);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
evas_image_load_file_data_qoi(void *loader_data,
|
||||
Evas_Image_Property *prop,
|
||||
void *pixels,
|
||||
int *error)
|
||||
{
|
||||
Evas_Loader_Internal *loader;
|
||||
Eina_File *f;
|
||||
void *map;
|
||||
Eina_Bool val = EINA_FALSE;
|
||||
|
||||
loader = (Evas_Loader_Internal *)loader_data;
|
||||
f = loader->f;
|
||||
|
||||
map = eina_file_map_all(f, EINA_FILE_WILLNEED);
|
||||
if (!map)
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
|
||||
goto on_error;
|
||||
}
|
||||
|
||||
val = evas_image_load_file_data_qoi_internal(loader,
|
||||
(Emile_Image_Property *)prop,
|
||||
pixels,
|
||||
map, eina_file_size_get(f),
|
||||
error);
|
||||
|
||||
eina_file_map_free(f, map);
|
||||
|
||||
on_error:
|
||||
return val;
|
||||
}
|
||||
|
||||
static Evas_Image_Load_Func evas_image_load_qoi_func =
|
||||
{
|
||||
EVAS_IMAGE_LOAD_VERSION,
|
||||
evas_image_load_file_open_qoi,
|
||||
evas_image_load_file_close_qoi,
|
||||
evas_image_load_file_head_qoi,
|
||||
NULL,
|
||||
evas_image_load_file_data_qoi,
|
||||
NULL,
|
||||
EINA_TRUE,
|
||||
EINA_FALSE
|
||||
};
|
||||
|
||||
static int
|
||||
module_open(Evas_Module *em)
|
||||
{
|
||||
if (!em) return 0;
|
||||
|
||||
_evas_loader_qoi_log_dom = eina_log_domain_register("evas-qoi", EINA_COLOR_BLUE);
|
||||
if (_evas_loader_qoi_log_dom < 0)
|
||||
{
|
||||
EINA_LOG_ERR("Can not create a module log domain.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
em->functions = (void *)(&evas_image_load_qoi_func);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
module_close(Evas_Module *em EINA_UNUSED)
|
||||
{
|
||||
if (_evas_loader_qoi_log_dom >= 0)
|
||||
{
|
||||
eina_log_domain_unregister(_evas_loader_qoi_log_dom);
|
||||
_evas_loader_qoi_log_dom = -1;
|
||||
}
|
||||
}
|
||||
|
||||
static Evas_Module_Api evas_modapi =
|
||||
{
|
||||
EVAS_MODULE_API_VERSION,
|
||||
"qoi",
|
||||
"none",
|
||||
{
|
||||
module_open,
|
||||
module_close
|
||||
}
|
||||
};
|
||||
|
||||
EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_IMAGE_LOADER, image_loader, qoi);
|
||||
|
||||
#ifndef EVAS_STATIC_BUILD_QOI
|
||||
EVAS_EINA_MODULE_DEFINE(image_loader, qoi);
|
||||
#endif
|
|
@ -0,0 +1,273 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "evas_common_private.h"
|
||||
#include "evas_private.h"
|
||||
|
||||
/*
|
||||
* code based on original qoi.h code (MIT license):
|
||||
* https://github.com/phoboslab/qoi/blob/master/qoi.h
|
||||
* date: 2023 march the 14th
|
||||
*/
|
||||
|
||||
#define QOI_SRGB 0
|
||||
|
||||
#define QOI_ZEROARR(a) memset((a),0,sizeof(a))
|
||||
|
||||
#define QOI_OP_INDEX 0x00 /* 00xxxxxx */
|
||||
#define QOI_OP_DIFF 0x40 /* 01xxxxxx */
|
||||
#define QOI_OP_LUMA 0x80 /* 10xxxxxx */
|
||||
#define QOI_OP_RUN 0xc0 /* 11xxxxxx */
|
||||
#define QOI_OP_RGB 0xfe /* 11111110 */
|
||||
#define QOI_OP_RGBA 0xff /* 11111111 */
|
||||
|
||||
#define QOI_COLOR_HASH(C) (C.rgba.r*3 + C.rgba.g*5 + C.rgba.b*7 + C.rgba.a*11)
|
||||
|
||||
#define QOI_MAGIC \
|
||||
(((unsigned int)'q') << 24 | ((unsigned int)'o') << 16 | \
|
||||
((unsigned int)'i') << 8 | ((unsigned int)'f'))
|
||||
|
||||
#define QOI_HEADER_SIZE 14
|
||||
|
||||
#define QOI_PIXELS_MAX ((unsigned int)400000000)
|
||||
|
||||
typedef union {
|
||||
struct { unsigned char r, g, b, a; } rgba;
|
||||
unsigned int v;
|
||||
} qoi_rgba_t;
|
||||
|
||||
static const unsigned char qoi_padding[8] = {0,0,0,0,0,0,0,1};
|
||||
|
||||
static int
|
||||
save_image_qoi(RGBA_Image *im, const char *file, int quality EINA_UNUSED)
|
||||
{
|
||||
qoi_rgba_t index[64];
|
||||
qoi_rgba_t px;
|
||||
qoi_rgba_t px_prev;
|
||||
FILE *f;
|
||||
unsigned char *iter;
|
||||
unsigned int channels;
|
||||
unsigned int colorspace;
|
||||
unsigned int v;
|
||||
int run;
|
||||
int px_len;
|
||||
int px_end;
|
||||
int px_pos;
|
||||
int i;
|
||||
int ret = 0;
|
||||
|
||||
if (!im || !im->image.data || !file || !*file)
|
||||
return ret;
|
||||
|
||||
if (im->cache_entry.h >= QOI_PIXELS_MAX / im->cache_entry.w)
|
||||
return ret;
|
||||
|
||||
f = fopen(file, "wb");
|
||||
if (!f)
|
||||
return ret;
|
||||
|
||||
v = (0xff000000 & QOI_MAGIC) >> 24;
|
||||
if (fwrite(&v, 1, 1, f) != 1) goto close_f;
|
||||
v = (0x00ff0000 & QOI_MAGIC) >> 16;
|
||||
if (fwrite(&v, 1, 1, f) != 1) goto close_f;
|
||||
v = (0x0000ff00 & QOI_MAGIC) >> 8;
|
||||
if (fwrite(&v, 1, 1, f) != 1) goto close_f;
|
||||
v = (0x000000ff & QOI_MAGIC);
|
||||
if (fwrite(&v, 1, 1, f) != 1) goto close_f;
|
||||
|
||||
v = (0xff000000 & im->cache_entry.w) >> 24;
|
||||
if (fwrite(&v, 1, 1, f) != 1) goto close_f;
|
||||
v = (0x00ff0000 & im->cache_entry.w) >> 16;
|
||||
if (fwrite(&v, 1, 1, f) != 1) goto close_f;
|
||||
v = (0x0000ff00 & im->cache_entry.w) >> 8;
|
||||
if (fwrite(&v, 1, 1, f) != 1) goto close_f;
|
||||
v = (0x000000ff & im->cache_entry.w);
|
||||
if (fwrite(&v, 1, 1, f) != 1) goto close_f;
|
||||
|
||||
v = (0xff000000 & im->cache_entry.h) >> 24;
|
||||
if (fwrite(&v, 1, 1, f) != 1) goto close_f;
|
||||
v = (0x00ff0000 & im->cache_entry.h) >> 16;
|
||||
if (fwrite(&v, 1, 1, f) != 1) goto close_f;
|
||||
v = (0x0000ff00 & im->cache_entry.h) >> 8;
|
||||
if (fwrite(&v, 1, 1, f) != 1) goto close_f;
|
||||
v = (0x000000ff & im->cache_entry.h);
|
||||
if (fwrite(&v, 1, 1, f) != 1) goto close_f;
|
||||
|
||||
channels = 4;
|
||||
if (fwrite(&channels, 1, 1, f) != 1) goto close_f;
|
||||
|
||||
colorspace = QOI_SRGB;
|
||||
if (fwrite(&colorspace, 1, 1, f) != 1) goto close_f;
|
||||
|
||||
QOI_ZEROARR(index);
|
||||
|
||||
run = 0;
|
||||
px_prev.rgba.r = 0;
|
||||
px_prev.rgba.g = 0;
|
||||
px_prev.rgba.b = 0;
|
||||
px_prev.rgba.a = 255;
|
||||
px = px_prev;
|
||||
|
||||
px_len = im->cache_entry.w * im->cache_entry.h * channels;
|
||||
px_end = px_len - channels;
|
||||
|
||||
iter = (unsigned char *)im->image.data;
|
||||
for (px_pos = 0; px_pos < px_len; px_pos += channels, iter +=4)
|
||||
{
|
||||
px.rgba.a = *(iter + 3);
|
||||
if (px.rgba.a == 0)
|
||||
{
|
||||
px.rgba.b = *(iter + 0);
|
||||
px.rgba.g = *(iter + 1);
|
||||
px.rgba.r = *(iter + 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
px.rgba.b = *(iter + 0) * 255 / px.rgba.a;
|
||||
px.rgba.g = *(iter + 1) * 255 / px.rgba.a;
|
||||
px.rgba.r = *(iter + 2) * 255 / px.rgba.a;
|
||||
}
|
||||
|
||||
if (px.v == px_prev.v)
|
||||
{
|
||||
run++;
|
||||
if (run == 62 || px_pos == px_end)
|
||||
{
|
||||
unsigned char val = QOI_OP_RUN | (run - 1);
|
||||
if (fwrite(&val, 1, 1, f) != 1) goto close_f;
|
||||
run = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int index_pos;
|
||||
|
||||
if (run > 0)
|
||||
{
|
||||
unsigned char val = QOI_OP_RUN | (run - 1);
|
||||
if (fwrite(&val, 1, 1, f) != 1) goto close_f;
|
||||
run = 0;
|
||||
}
|
||||
|
||||
index_pos = QOI_COLOR_HASH(px) % 64;
|
||||
|
||||
if (index[index_pos].v == px.v)
|
||||
{
|
||||
unsigned char val = QOI_OP_INDEX | index_pos;
|
||||
if (fwrite(&val, 1, 1, f) != 1) goto close_f;
|
||||
}
|
||||
else
|
||||
{
|
||||
index[index_pos] = px;
|
||||
|
||||
if (px.rgba.a == px_prev.rgba.a)
|
||||
{
|
||||
signed char vr = px.rgba.r - px_prev.rgba.r;
|
||||
signed char vg = px.rgba.g - px_prev.rgba.g;
|
||||
signed char vb = px.rgba.b - px_prev.rgba.b;
|
||||
|
||||
signed char vg_r = vr - vg;
|
||||
signed char vg_b = vb - vg;
|
||||
|
||||
if (vr > -3 && vr < 2 &&
|
||||
vg > -3 && vg < 2 &&
|
||||
vb > -3 && vb < 2)
|
||||
{
|
||||
unsigned char val = QOI_OP_DIFF | (vr + 2) << 4 | (vg + 2) << 2 | (vb + 2);
|
||||
if (fwrite(&val, 1, 1, f) != 1) goto close_f;
|
||||
}
|
||||
else if (vg_r > -9 && vg_r < 8 &&
|
||||
vg > -33 && vg < 32 &&
|
||||
vg_b > -9 && vg_b < 8)
|
||||
{
|
||||
unsigned char val;
|
||||
|
||||
val = QOI_OP_LUMA | (vg + 32);
|
||||
if (fwrite(&val, 1, 1, f) != 1) goto close_f;
|
||||
|
||||
val = (vg_r + 8) << 4 | (vg_b + 8);
|
||||
if (fwrite(&val, 1, 1, f) != 1) goto close_f;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char val;
|
||||
|
||||
val = QOI_OP_RGB;
|
||||
if (fwrite(&val, 1, 1, f) != 1) goto close_f;
|
||||
if (fwrite(&px.rgba.r, 1, 1, f) != 1) goto close_f;
|
||||
if (fwrite(&px.rgba.g, 1, 1, f) != 1) goto close_f;
|
||||
if (fwrite(&px.rgba.b, 1, 1, f) != 1) goto close_f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char val;
|
||||
|
||||
val = QOI_OP_RGBA;
|
||||
if (fwrite(&val, 1, 1, f) != 1) goto close_f;
|
||||
if (fwrite(&px.rgba.r, 1, 1, f) != 1) goto close_f;
|
||||
if (fwrite(&px.rgba.g, 1, 1, f) != 1) goto close_f;
|
||||
if (fwrite(&px.rgba.b, 1, 1, f) != 1) goto close_f;
|
||||
if (fwrite(&px.rgba.a, 1, 1, f) != 1) goto close_f;
|
||||
}
|
||||
}
|
||||
}
|
||||
px_prev = px;
|
||||
}
|
||||
|
||||
for (i = 0; i < (int)sizeof(qoi_padding); i++)
|
||||
{
|
||||
if (fwrite(&qoi_padding[i], 1, 1, f) != 1) goto close_f;
|
||||
}
|
||||
|
||||
ret = 1;
|
||||
|
||||
close_f:
|
||||
fclose(f);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int evas_image_save_file_qoi(RGBA_Image *im, const char *file, const char *key EINA_UNUSED,
|
||||
int quality, int compress EINA_UNUSED, const char *encoding EINA_UNUSED)
|
||||
{
|
||||
return save_image_qoi(im, file, quality);
|
||||
}
|
||||
|
||||
|
||||
static Evas_Image_Save_Func evas_image_save_qoi_func =
|
||||
{
|
||||
evas_image_save_file_qoi
|
||||
};
|
||||
|
||||
static int
|
||||
module_open(Evas_Module *em)
|
||||
{
|
||||
if (!em) return 0;
|
||||
em->functions = (void *)(&evas_image_save_qoi_func);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
module_close(Evas_Module *em EINA_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
static Evas_Module_Api evas_modapi =
|
||||
{
|
||||
EVAS_MODULE_API_VERSION,
|
||||
"qoi",
|
||||
"none",
|
||||
{
|
||||
module_open,
|
||||
module_close
|
||||
}
|
||||
};
|
||||
|
||||
EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_IMAGE_SAVER, image_saver, qoi);
|
||||
|
||||
#ifndef EVAS_STATIC_BUILD_QOI
|
||||
EVAS_EINA_MODULE_DEFINE(image_saver, qoi);
|
||||
#endif
|
|
@ -1,32 +1,35 @@
|
|||
if (get_option('embedded-libunibreak'))
|
||||
libunibreak_src = [
|
||||
'unibreakbase.h',
|
||||
'unibreakdef.h',
|
||||
'linebreak.h',
|
||||
'linebreakdef.h',
|
||||
'wordbreakdef.h',
|
||||
'wordbreak.h',
|
||||
'unibreakbase.c',
|
||||
'unibreakdef.c',
|
||||
'linebreak.c',
|
||||
'linebreakdata.c',
|
||||
'linebreakdef.c',
|
||||
'wordbreak.c',
|
||||
'graphemebreak.c',
|
||||
'graphemebreak.h',
|
||||
'graphemebreakdef.h',
|
||||
'emojidef.h',
|
||||
'emojidef.c',
|
||||
]
|
||||
|
||||
libunibreak_src = [
|
||||
'unibreakbase.h',
|
||||
'unibreakdef.h',
|
||||
'linebreak.h',
|
||||
'linebreakdef.h',
|
||||
'wordbreakdef.h',
|
||||
'wordbreak.h',
|
||||
'unibreakbase.c',
|
||||
'unibreakdef.c',
|
||||
'linebreak.c',
|
||||
'linebreakdata.c',
|
||||
'linebreakdef.c',
|
||||
'wordbreak.c',
|
||||
'graphemebreak.c',
|
||||
'graphemebreak.h',
|
||||
'graphemebreakdef.h',
|
||||
'emojidef.h',
|
||||
'emojidef.c',
|
||||
]
|
||||
libunibreak_lib = static_library('libunibreak',
|
||||
libunibreak_src,
|
||||
include_directories : config_dir,
|
||||
install: false,
|
||||
)
|
||||
|
||||
libunibreak_lib = static_library('libunibreak',
|
||||
libunibreak_src,
|
||||
include_directories : config_dir,
|
||||
install: false,
|
||||
)
|
||||
|
||||
libunibreak = declare_dependency(
|
||||
include_directories: [include_directories('.')],
|
||||
link_with: libunibreak_lib,
|
||||
dependencies: [eina],
|
||||
)
|
||||
libunibreak = declare_dependency(
|
||||
include_directories: [include_directories('.')],
|
||||
link_with: libunibreak_lib,
|
||||
dependencies: [eina],
|
||||
)
|
||||
else
|
||||
libunibreak = dependency('libunibreak', version : '>=4.2')
|
||||
endif
|
||||
|
|
|
@ -53,18 +53,27 @@ _timer2_cb(void *data)
|
|||
timer->num_elem = 0;
|
||||
|
||||
// check add/delay timer 2
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-extra-args"
|
||||
fail_if(timer->add_timer2 > 1, "Error add/delay timer");
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// check set new delay for timer 1
|
||||
ecore_timer_delay(timer->timer1, timer->delay_1[timer->num_elem]);
|
||||
|
||||
// check set new interval for timer 1
|
||||
ecore_timer_interval_set(timer->timer1, timer->interval_1[timer->num_elem]);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-extra-args"
|
||||
fail_if(!EINA_DBL_EQ(timer->interval_1[timer->num_elem], ecore_timer_interval_get(timer->timer1)), "Error set new interval");
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// check set new precision
|
||||
ecore_timer_precision_set(timer->precision[timer->num_elem]);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-extra-args"
|
||||
fail_if(!EINA_DBL_EQ(timer->precision[timer->num_elem], ecore_timer_precision_get()), "Error set new precision");
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// check removal timer 2
|
||||
if (ecore_timer_del(timer->timer2))
|
||||
|
@ -100,7 +109,10 @@ _timer4_cb(void *data)
|
|||
// check frezze/thaw timer 3
|
||||
if (freeze_thaw)
|
||||
{
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-extra-args"
|
||||
fail_if(timer->check_freeze_thaw_timer3 != timer->count_timer3, "Error frezze/thaw timer");
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
ecore_timer_thaw(timer->timer3);
|
||||
freeze_thaw = 0;
|
||||
|
@ -153,7 +165,10 @@ EFL_START_TEST(ecore_test_timers)
|
|||
timer.timer4 = ecore_timer_add(TIMEOUT_4, _timer4_cb, &timer);
|
||||
timer.timer5 = ecore_timer_add(TIMEOUT_5, _timer5_cb, &timer);
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-extra-args"
|
||||
fail_if((!timer.timer1 || !timer.timer2 || !timer.timer3 || !timer.timer4 || !timer.timer5), "Error add timer\n");
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
ecore_main_loop_begin();
|
||||
|
||||
|
@ -207,7 +222,10 @@ EFL_START_TEST(ecore_test_timer_inside_call)
|
|||
c->t = ecore_timer_add(0.01, _timeri_cb, c);
|
||||
ecore_timer_add(1.0, timeout_timer_cb, NULL);
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-extra-args"
|
||||
fail_if(!c->t, "Error add timer\n");
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
ecore_main_loop_begin();
|
||||
}
|
||||
|
@ -217,7 +235,10 @@ EFL_END_TEST
|
|||
EFL_START_TEST(ecore_test_timer_valid_callbackfunc)
|
||||
{
|
||||
Ecore_Timer *t = NULL;
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-extra-args"
|
||||
fail_if((t = ecore_timer_add(0.5, NULL, NULL)), "ERROR: Invalid callback func!\n");
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
EFL_END_TEST
|
||||
|
||||
|
@ -259,7 +280,10 @@ _timer_cb(void *data)
|
|||
{
|
||||
count++;
|
||||
int num = (intptr_t) data;
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-extra-args"
|
||||
fail_if (num != count, "Error timer is called out of order");
|
||||
#pragma GCC diagnostic pop
|
||||
if (count == 8) ecore_main_loop_quit();
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue