forked from enlightenment/efl
Compare commits
115 Commits
Author | SHA1 | Date |
---|---|---|
Carsten Haitzler | cdd3c35bb3 | |
Vincent Torri | 49976ca388 | |
Vincent Torri | a6915ecfc5 | |
Vincent Torri | 9e5bb18af1 | |
Carsten Haitzler | 11cd98e119 | |
Carsten Haitzler | ae0c1783d4 | |
Carsten Haitzler | 35bc3f933f | |
Carsten Haitzler | 178b786f39 | |
Carsten Haitzler | 5aefadeef3 | |
Vincent Torri | 97845c1ee3 | |
Vincent Torri | 7e839be3ab | |
Ross Vandegrift | 12124b770b | |
Ross Vandegrift | 35e486dbb5 | |
Carsten Haitzler | f0a966a65f | |
Carsten Haitzler | f1688d5110 | |
Carsten Haitzler | ab4394b4ad | |
Carsten Haitzler | 1ff35f9a41 | |
Carsten Haitzler | 5823aa2569 | |
Carsten Haitzler | d2073a4a56 | |
Carsten Haitzler | 2a87cfecda | |
Carsten Haitzler | dca528a049 | |
Carsten Haitzler | f9e8839125 | |
Carsten Haitzler | d6d0caa46c | |
q66 | c216f5baf2 | |
Carsten Haitzler | c6b3242c60 | |
Carsten Haitzler | dce2557746 | |
Carsten Haitzler | 2842eefee2 | |
Carsten Haitzler | 248d62bf5e | |
Carsten Haitzler | f6abf24db2 | |
Carsten Haitzler | ec7a23ec82 | |
Dmitri Chudinov | 1704758e79 | |
Dmitri Chudinov | 53d18f0409 | |
Dmitri Chudinov | c0e260d308 | |
Dmitri Chudinov | c260bcbd33 | |
Vincent Torri | 8272318d71 | |
Dmitri Chudinov | cc66b5d011 | |
Dmitri Chudinov | 58ccd1031a | |
Dmitri Chudinov | 472cee52b2 | |
Carsten Haitzler | 9447fb6bad | |
Ryan Gammon | 9d7fc64ca3 | |
Dmitri Chudinov | a448fc785b | |
Dmitri Chudinov | d9d81af314 | |
Vincent Torri | 1e871074af | |
Carsten Haitzler | cfa8067a32 | |
Carsten Haitzler | a4e36e6f04 | |
Carsten Haitzler | 5deea55b6a | |
Vincent Torri | 9387d94b30 | |
Carsten Haitzler | b17bd6574f | |
Carsten Haitzler | 9f3d7b9cff | |
Carsten Haitzler | 510bd04c67 | |
Carsten Haitzler | 58b6accc16 | |
Carsten Haitzler | 07ac697db8 | |
Vincent Torri | 4cea33945d | |
Vincent Torri | d3c1301efa | |
Vincent Torri | 0d13612a27 | |
Vincent Torri | 4b443e752f | |
Vincent Torri | 8576ac9128 | |
Carsten Haitzler | 14049351d5 | |
Ryan Gammon | d18d55d66a | |
Ryan Gammon | d45e5e350d | |
Ryan Gammon | 74955d73fc | |
Ryan Gammon | bce87e4bc8 | |
Ryan Gammon | cbdf29103c | |
Boris Faure | d280b4b2dd | |
Dmitri Chudinov | d9ec36e1de | |
Dmitri Chudinov | 86b25bbedd | |
Carsten Haitzler | 08e73fe2eb | |
Christopher Michael | 6efb60be59 | |
Carsten Haitzler | 4f69aba3ea | |
Carsten Haitzler | cffad244ce | |
Carsten Haitzler | c6eb7990a6 | |
Carsten Haitzler | b7ecbd5476 | |
Carsten Haitzler | 97b809084c | |
Vincent Torri | 30a2cd1ec1 | |
Vincent Torri | 201a32279f | |
Vincent Torri | 8c30cb2ef8 | |
Carsten Haitzler | 92646486c2 | |
Carsten Haitzler | c2a7944c9b | |
Vincent Torri | ba36e65bbc | |
Carsten Haitzler | 17d43908c9 | |
Carsten Haitzler | 81cba676d7 | |
Carsten Haitzler | 51a17a4167 | |
Carsten Haitzler | 156660a56b | |
Carsten Haitzler | 5af8b5e4bc | |
Carsten Haitzler | daa58f6da7 | |
NorwayFun | 0b0c320ad6 | |
NorwayFun | a5e168da7b | |
hugok | d4c134ad03 | |
Carsten Haitzler | 8b4517806a | |
Carsten Haitzler | ef01c87b80 | |
Carsten Haitzler | 58010f0880 | |
Carsten Haitzler | 264cc7bb4d | |
Carsten Haitzler | c0bd61f7d9 | |
Carsten Haitzler | 21ad5e011f | |
Christopher Michael | 3267070da9 | |
Christopher Michael | d434a6039c | |
Carsten Haitzler | f93b08c76f | |
Carsten Haitzler | d9097d48fe | |
Carsten Haitzler | c0f61b4e37 | |
Carsten Haitzler | f67e9b4fff | |
Carsten Haitzler | 43805d788b | |
Christopher Michael | 6c642eb12b | |
Carsten Haitzler | ab92af333e | |
Carsten Haitzler | d1f1af054f | |
Carsten Haitzler | faf9745538 | |
Carsten Haitzler | d8a05e2662 | |
Carsten Haitzler | da2b8ca356 | |
Carsten Haitzler | 69e56608d3 | |
Dmitri Chudinov | ac245ef30b | |
Dmitri Chudinov | 0ceda5b7f9 | |
Dmitri Chudinov | c73c270b33 | |
Dmitri Chudinov | 3474d867aa | |
Carsten Haitzler | 0e22417f45 | |
orbea | bdd5b244e6 | |
Carsten Haitzler | 106e25be74 |
28
README.md
28
README.md
|
@ -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
|
||||
|
@ -439,16 +439,6 @@ these without understanding the implications. The defaults
|
|||
have been carefully considered to provide full functionality so users
|
||||
will not be missing anything.
|
||||
|
||||
### Cryptography
|
||||
|
||||
EFL officially offers openssl or gnutls as cryptography backends. By
|
||||
default it uses "openssl" to do signature, cipher and related. Alternatively
|
||||
one can use "gnutls" (some distros are strict about licenses and want gnutls
|
||||
instead of openssl) You can switch to gnutls with:
|
||||
``` sh
|
||||
-Dcrypto=gnutls
|
||||
```
|
||||
|
||||
-----
|
||||
|
||||
## Compiling and Installing
|
||||
|
@ -544,3 +534,15 @@ How to build with verbose output (full commands run):
|
|||
```sh
|
||||
ninja -C build -v
|
||||
```
|
||||
|
||||
-----
|
||||
|
||||
**NOTE:** Nvidia OpenGL-ES/EGL seems to have bugs and performance issues.
|
||||
All other drivers work just fine except Nvidia with OpenGL-ES/EGL. Users have
|
||||
reported stuttering and graphical glitches and sometimes windows not
|
||||
updating. If you want the best results and are stuck on Nvidia and unable to
|
||||
change that, then:
|
||||
|
||||
* Make sure you do not enable **Wayland** i.e. Meson option `-Dwl=false` (this is default anyway if not provided)
|
||||
* Make sure you do not enable **DRM** i.e. Meson option `-Ddrm=false` (this is default anyway if not provided)
|
||||
* Make sure **OpenGL** is **full** i.e. Meson option `-Dopengl=full`
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/sh -e
|
||||
meson -Dsystemd=false -Dv4l2=false -Davahi=false -Deeze=false -Dx11=false \
|
||||
-Dopengl=full -Dcocoa=true -Dnls=false \
|
||||
-Demotion-loaders-disabler=gstreamer1,libvlc,xine \
|
||||
-Dopengl=full -Dcocoa=true -Dnls=false -Dinput=false \
|
||||
-Decore-imf-loaders-disabler=scim,ibus \
|
||||
$@ . build
|
||||
|
|
|
@ -2,7 +2,7 @@ group "Elm_Config" struct {
|
|||
value "config_version" int: 131096;
|
||||
value "entry_select_allow" uchar: 1;
|
||||
value "engine" string: "";
|
||||
value "vsync" uchar: 0;
|
||||
value "vsync" uchar: 1;
|
||||
//
|
||||
value "thumbscroll_enable" uchar: 1;
|
||||
value "thumbscroll_threshold" int: 24;
|
||||
|
|
|
@ -2,7 +2,7 @@ group "Elm_Config" struct {
|
|||
value "config_version" int: 131096;
|
||||
value "entry_select_allow" uchar: 1;
|
||||
value "engine" string: "";
|
||||
value "vsync" uchar: 0;
|
||||
value "vsync" uchar: 1;
|
||||
value "thumbscroll_enable" uchar: 1;
|
||||
value "thumbscroll_threshold" int: 24;
|
||||
value "thumbscroll_hold_threshold" int: 100;
|
||||
|
|
|
@ -2,7 +2,7 @@ group "Elm_Config" struct {
|
|||
value "config_version" int: 131096;
|
||||
value "entry_select_allow" uchar: 1;
|
||||
value "engine" string: "";
|
||||
value "vsync" uchar: 0;
|
||||
value "vsync" uchar: 1;
|
||||
value "thumbscroll_enable" uchar: 0;
|
||||
value "thumbscroll_threshold" int: 4;
|
||||
value "thumbscroll_hold_threshold" int: 4;
|
||||
|
|
|
@ -198,6 +198,7 @@ color_tree {
|
|||
"/fg/selected/radio/radio";
|
||||
"/fg/normal/gadgets/backlight/base";
|
||||
"/fg-alt";
|
||||
"/fg/normal/fileman/filesize/0";
|
||||
}
|
||||
":fg-prehigh" {
|
||||
"/fg/normal/flipselector/down";
|
||||
|
@ -299,6 +300,7 @@ color_tree {
|
|||
"/fg-alt/pressed";
|
||||
"/fg-alt/selected";
|
||||
"/fg-alt/selected-pressed";
|
||||
"/fg/selected/fileman/filesize/0";
|
||||
}
|
||||
":selected" {
|
||||
"/bg/selected";
|
||||
|
@ -335,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";
|
||||
|
@ -361,6 +363,7 @@ color_tree {
|
|||
"/fg/normal/gadgets/mixer/volume/normal";
|
||||
"/fg/normal/gadgets/music_control/progress";
|
||||
"/fg/normal/gadgets/music_control/text/tag";
|
||||
"/fg/normal/fileman/filesize/1";
|
||||
}
|
||||
":selected-light" {
|
||||
"/bg/normal/tiling/position/base";
|
||||
|
@ -400,6 +403,10 @@ color_tree {
|
|||
"/fg/normal/gadgets/packagekit/pkg/bug";
|
||||
"/fg/normal/gadgets/packagekit/pkg/enhancement";
|
||||
"/fg/normal/gadgets/packagekit/pkg/security";
|
||||
"/fg/normal/fileman/filesize/2";
|
||||
"/fg/selected/fileman/filesize/2";
|
||||
"/fg/normal/fileperm/execute";
|
||||
"/fg/normal/filegraph/bar";
|
||||
}
|
||||
":selected-alt-trans" {
|
||||
"/bg/normal/access";
|
||||
|
@ -411,6 +418,8 @@ color_tree {
|
|||
"/fg/normal/text-line-added";
|
||||
"/fg/normal/desklock/fprint/success";
|
||||
"/fg/normal/gadgets/procstats/mem/all";
|
||||
"/fg/normal/fileman/filesize/3";
|
||||
"/fg/selected/fileman/filesize/3";
|
||||
}
|
||||
":selected2-dim" {
|
||||
"/fg/disabled/text-line-added";
|
||||
|
@ -419,6 +428,8 @@ color_tree {
|
|||
"/fg/normal/gadgets/procstats/cpu/all";
|
||||
"/fg/normal/gadgets/cpufreq/hands/max";
|
||||
"/fg/normal/gadgets/packagekit/pkg/important";
|
||||
"/fg/normal/fileman/filesize/4";
|
||||
"/fg/selected/fileman/filesize/4";
|
||||
}
|
||||
":selected4" {
|
||||
"/fg/normal/text-urgent";
|
||||
|
@ -428,6 +439,7 @@ color_tree {
|
|||
"/fg/normal/text-line-removed";
|
||||
"/fg/normal/gadgets/temperature/hi";
|
||||
"/fg/normal/gadgets/clock/analog/hands/secs";
|
||||
"/fg/normal/fileperm/write";
|
||||
}
|
||||
":selected4-dim" {
|
||||
"/fg/disabled/text-warning";
|
||||
|
@ -446,6 +458,7 @@ color_tree {
|
|||
}
|
||||
":selected6" {
|
||||
"/fg/normal/text-string";
|
||||
"/fg/selected/fileman/filesize/1";
|
||||
}
|
||||
":selected6-dim" {
|
||||
"/fg/disabled/text-string";
|
||||
|
@ -463,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";
|
||||
|
@ -546,6 +560,7 @@ color_tree {
|
|||
}
|
||||
":success" {
|
||||
"/fg/normal/text-success";
|
||||
"/fg/normal/fileperm/read";
|
||||
}
|
||||
":success-dim" {
|
||||
"/fg/disabled/text-success";
|
||||
|
@ -570,6 +585,7 @@ color_tree {
|
|||
}
|
||||
":number" {
|
||||
"/fg/normal/text-number";
|
||||
"/fg/normal/fileperm/setuid";
|
||||
}
|
||||
":number-dim" {
|
||||
"/fg/disabled/text-number";
|
||||
|
@ -1278,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;
|
||||
|
|
|
@ -267,11 +267,70 @@ group { name: "e/comp/frame/default";
|
|||
color_class: "/bg/selected/comp/win";
|
||||
}
|
||||
}
|
||||
#define FOCUSGLOWSZ 20
|
||||
part { name: "focusglow"; type: RECT;
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
rel.to: "e.swallow.content";
|
||||
}
|
||||
description { state: "active" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
offscale;
|
||||
rel1.offset: (0-FOCUSGLOWSZ) (0-FOCUSGLOWSZ);
|
||||
rel2.offset: (FOCUSGLOWSZ-1) (FOCUSGLOWSZ-1);
|
||||
color: 255 255 255 0; // no cc
|
||||
}
|
||||
}
|
||||
part { name: "focusglow1"; type: RECT;
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
clip_to: "focusglow";
|
||||
offscale;
|
||||
rel2.relative: 1.0 0.0;
|
||||
rel1.offset: (0-FOCUSGLOWSZ) (0-FOCUSGLOWSZ);
|
||||
rel2.offset: (FOCUSGLOWSZ-1) -1;
|
||||
color_class: "/bg/selected/comp/focusglow";
|
||||
}
|
||||
}
|
||||
part { name: "focusglow2"; type: RECT;
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
clip_to: "focusglow";
|
||||
offscale;
|
||||
rel1.relative: 0.0 1.0;
|
||||
rel1.offset: (0-FOCUSGLOWSZ) 0;
|
||||
rel2.offset: (FOCUSGLOWSZ-1) (FOCUSGLOWSZ-1);
|
||||
color_class: "/bg/selected/comp/focusglow";
|
||||
}
|
||||
}
|
||||
part { name: "focusglow3"; type: RECT;
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
clip_to: "focusglow";
|
||||
offscale;
|
||||
rel2.relative: 0.0 1.0;
|
||||
rel1.offset: (0-FOCUSGLOWSZ) 0;
|
||||
rel2.offset: -1 -1;
|
||||
color_class: "/bg/selected/comp/focusglow";
|
||||
}
|
||||
}
|
||||
part { name: "focusglow4"; type: RECT;
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
clip_to: "focusglow";
|
||||
offscale;
|
||||
rel1.relative: 1.0 0.0;
|
||||
rel1.offset: 0 0;
|
||||
rel2.offset: (FOCUSGLOWSZ-1) -1;
|
||||
color_class: "/bg/selected/comp/focusglow";
|
||||
}
|
||||
}
|
||||
#undef FOCUSGLOWSZ
|
||||
part { name: "e.swallow.content"; type: SWALLOW;
|
||||
clip_to: "focus-clipper";
|
||||
description { state: "default" 0.0;
|
||||
rel.to: "shower";
|
||||
}
|
||||
}
|
||||
}
|
||||
spacer { "gspacer";
|
||||
desc {
|
||||
|
@ -326,6 +385,21 @@ group { name: "e/comp/frame/default";
|
|||
transition: SINUSOIDAL 0.2 USE_DURATION_FACTOR 1;
|
||||
targets: "focus-clipper" "focus-shadow";
|
||||
}
|
||||
program { name: "focusbounce";
|
||||
signal: "e,state,focused"; source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "focusglow";
|
||||
sequence {
|
||||
action: STATE_SET "active" 0.0;
|
||||
target: "focusglow";
|
||||
transition: DECELERATE 0.3 USE_DURATION_FACTOR 1;
|
||||
}
|
||||
}
|
||||
program { name: "focusbounceoff";
|
||||
signal: "e,state,unfocused"; source: "e";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "focusglow";
|
||||
}
|
||||
/*
|
||||
program { name: "urgent1";
|
||||
signal: "e,state,urgent"; source: "e";
|
||||
|
@ -361,6 +435,15 @@ group { name: "e/comp/frame/rotate";
|
|||
alias: "e/comp/frame/rotate/fast"; // legacy
|
||||
inherit: "e/comp/frame/default";
|
||||
parts {
|
||||
part { name: "focusglow"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "active" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.content";
|
||||
description { state: "default";
|
||||
map {
|
||||
|
@ -394,6 +477,12 @@ group { name: "e/comp/frame/rotate";
|
|||
target: "e.swallow.content";
|
||||
transition: LINEAR 0.3 USE_DURATION_FACTOR 1;
|
||||
}
|
||||
program { name: "focusbounce";
|
||||
signal: "xxx";
|
||||
}
|
||||
program { name: "focusbounceoff";
|
||||
signal: "xxx";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -427,11 +516,28 @@ group { name: "e/comp/frame/popup";
|
|||
alias: "e/comp/frame/popup/fast"; // legacy
|
||||
inherit: "e/comp/frame/default";
|
||||
parts {
|
||||
part { name: "focusglow"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "active" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "focus-clipper";
|
||||
description { state: "default";
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "focusbounce";
|
||||
signal: "xxx";
|
||||
}
|
||||
program { name: "focusbounceoff";
|
||||
signal: "xxx";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/comp/frame/none";
|
||||
|
@ -455,6 +561,15 @@ group { name: "e/comp/frame/still";
|
|||
alias: "e/comp/frame/still/fast"; // legacy
|
||||
inherit: "e/comp/frame/default";
|
||||
parts {
|
||||
part { name: "focusglow"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "active" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "shower";
|
||||
description { state: "default" 0.0;
|
||||
rel1.relative: 0.0 0.0;
|
||||
|
@ -462,6 +577,14 @@ group { name: "e/comp/frame/still";
|
|||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "focusbounce";
|
||||
signal: "xxx";
|
||||
}
|
||||
program { name: "focusbounceoff";
|
||||
signal: "xxx";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/comp/frame/menu";
|
||||
|
@ -488,6 +611,15 @@ group { name: "e/comp/frame/everything";
|
|||
alias: "e/comp/frame/everything/fast"; // legacy
|
||||
inherit: "e/comp/frame/popup";
|
||||
parts {
|
||||
part { name: "focusglow"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "active" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "shadow";
|
||||
description { state: "hidden" 0.0;
|
||||
visible: 1;
|
||||
|
@ -500,6 +632,14 @@ group { name: "e/comp/frame/everything";
|
|||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "focusbounce";
|
||||
signal: "xxx";
|
||||
}
|
||||
program { name: "focusbounceoff";
|
||||
signal: "xxx";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/comp/frame/fullscreen";
|
||||
|
|
|
@ -17,7 +17,7 @@ group { name: "e/desklock/background";
|
|||
color_class: "/bg/normal/desklock/background";
|
||||
}
|
||||
}
|
||||
program { signal: "show"; source: "";
|
||||
program { name: "shower"; signal: "show"; source: "";
|
||||
action: STATE_SET "visible" 0.0;
|
||||
transition: SINUSOIDAL 0.5 USE_DURATION_FACTOR 1;
|
||||
target: "clip";
|
||||
|
@ -30,6 +30,14 @@ group { name: "e/desklock/background";
|
|||
action: SIGNAL_EMIT "e,action,hide,done" "e";
|
||||
}
|
||||
}
|
||||
program { signal: "e,action,show,immediate"; source: "e";
|
||||
action: ACTION_STOP;
|
||||
target: "shower";
|
||||
sequence {
|
||||
action: STATE_SET "visible" 0.0;
|
||||
target: "clip";
|
||||
}
|
||||
}
|
||||
part { name: "e.swallow.login_box"; type: SWALLOW;
|
||||
clip_to: "clip";
|
||||
description { state: "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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -908,3 +908,301 @@ group { name: "elm/radio/base/icon";
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "elm/radio/base/sort_header";
|
||||
script {
|
||||
BUTTONMODE_SCRIPT
|
||||
public sel;
|
||||
public eval_sel(m) {
|
||||
if (m) {
|
||||
set_state(PART:"ck_check", "selected", 0.0);
|
||||
} else {
|
||||
set_state(PART:"ck_check", "default", 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "shadow"; type: SPACER;
|
||||
description { state: "default";
|
||||
}
|
||||
desc { "pressed"; inherit;
|
||||
}
|
||||
desc { "disabled"; inherit;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.background"; nomouse;
|
||||
desc { "default";
|
||||
visible: 0;
|
||||
}
|
||||
desc { "visible"; inherit;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
rect { "icon_clip";
|
||||
desc { "default";
|
||||
color: 255 255 255 255; // no cc
|
||||
}
|
||||
desc { "pressed"; inherit;
|
||||
color: 255 255 255 255; // no cc
|
||||
}
|
||||
desc { "disabled"; inherit;
|
||||
color: 255 255 255 64; // no cc
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.content"; nomouse;
|
||||
clip_to: "icon_clip";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
rel1.to_x: "base";
|
||||
rel2.to_x: "base";
|
||||
rel1.offset: 4 4;
|
||||
rel1.relative: 1.0 0.0;
|
||||
rel2.relative: 0.0 1.0;
|
||||
rel2.offset: 4 -5;
|
||||
visible: 0;
|
||||
offscale;
|
||||
}
|
||||
desc { "visible"; inherit;
|
||||
fixed: 1 0;
|
||||
aspect: 1.0 1.0;
|
||||
min: ICMIN ICMIN;
|
||||
visible: 1;
|
||||
}
|
||||
desc { "icononly"; inherit;
|
||||
fixed: 0 0;
|
||||
align: 0.5 0.5;
|
||||
rel2.relative: 1.0 1.0;
|
||||
rel2.offset: -5 -5;
|
||||
rel2.to_x: "";
|
||||
visible: 1;
|
||||
min: ICMIN ICMIN;
|
||||
}
|
||||
}
|
||||
part { name: "base"; type: RECT;
|
||||
scale: 1;
|
||||
description { state: "default";
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
min: 13 13;
|
||||
max: 13 13;
|
||||
rel1.offset: 4 4;
|
||||
rel2.relative: 0.0 1.0;
|
||||
rel2.offset: 4 -5;
|
||||
aspect: 1.0 1.0; aspect_preference: VERTICAL;
|
||||
offscale;
|
||||
visible: 0;
|
||||
offscale;
|
||||
}
|
||||
desc { "pressed"; inherit;
|
||||
}
|
||||
desc { "disabled"; inherit;
|
||||
}
|
||||
}
|
||||
part { name: "ck_bg";
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
rel.to: "base";
|
||||
image.normal: "i-arrow-d";
|
||||
min: 15 15;
|
||||
max: 15 15;
|
||||
color_class: "/bg/normal/radio/base";
|
||||
}
|
||||
desc { "disabled"; inherit;
|
||||
color_class: "/bg/disabled/radio/base";
|
||||
}
|
||||
}
|
||||
part { name: "ck_check";
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
color_class: "/fg/selected/radio/radio";
|
||||
rel.to: "base";
|
||||
image.normal: "i-arrow-d";
|
||||
min: 15 15;
|
||||
max: 15 15;
|
||||
fixed: 1 1;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "selected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
desc { "disabled"; inherit;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "ck_press";
|
||||
scale: 1;
|
||||
description { state: "default" 0.0;
|
||||
color_class: "/fg/pressed/radio/radio";
|
||||
fixed: 1 1;
|
||||
rel.to: "base";
|
||||
image.normal: "i-arrow-d";
|
||||
min: 15 15;
|
||||
max: 15 15;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "pressed" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
text { "elm.text"; nomouse;
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
fixed: 0 1;
|
||||
color_class: "/fg/normal/radio/text";
|
||||
rel1.offset: 0 4;
|
||||
rel1.relative: 1.0 0.0;
|
||||
rel1.to_x: "elm.swallow.content";
|
||||
rel2.offset: -5 -5;
|
||||
text { font: FN; size: 10;
|
||||
align: 0.0 0.5;
|
||||
min: 0 0;
|
||||
ellipsis: 0;
|
||||
}
|
||||
visible: 0;
|
||||
offscale;
|
||||
min: 0 ICMIN;
|
||||
}
|
||||
desc { "visible"; inherit;
|
||||
fixed: 0 0;
|
||||
rel1.offset: 4 4;
|
||||
// text.min: 1 1;
|
||||
// text.ellipsis: -1;
|
||||
visible: 1;
|
||||
}
|
||||
desc { "pressed_visible"; inherit;
|
||||
fixed: 0 0;
|
||||
color_class: "/fg/pressed/radio/text";
|
||||
rel1.offset: 4 4;
|
||||
// text.min: 1 1;
|
||||
// text.ellipsis: -1;
|
||||
visible: 1;
|
||||
}
|
||||
desc { "textonly"; inherit;
|
||||
fixed: 0 0;
|
||||
// text.min: 1 1;
|
||||
// text.ellipsis: -1;
|
||||
visible: 1;
|
||||
}
|
||||
desc { "pressed_textonly"; inherit;
|
||||
fixed: 0 0;
|
||||
color_class: "/fg/pressed/radio/text";
|
||||
// text.min: 1 1;
|
||||
// text.ellipsis: -1;
|
||||
visible: 1;
|
||||
}
|
||||
desc { "disabled_visible"; inherit;
|
||||
fixed: 0 0;
|
||||
color_class: "/fg/disabled/radio/text";
|
||||
rel1.offset: 4 4;
|
||||
// text.min: 1 1;
|
||||
// text.ellipsis: -1;
|
||||
visible: 1;
|
||||
}
|
||||
desc { "disabled_textonly"; inherit;
|
||||
fixed: 0 0;
|
||||
color_class: "/fg/disabled/radio/text";
|
||||
// text.min: 1 1;
|
||||
// text.ellipsis: -1;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
rect { "event";
|
||||
ignore_flags: ON_HOLD;
|
||||
desc { "default";
|
||||
color: 0 0 0 0; // no cc
|
||||
}
|
||||
desc { "disabled"; inherit;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { signal: "mouse,clicked,1"; source: "event";
|
||||
action: SIGNAL_EMIT "elm,action,radio,toggle" "elm";
|
||||
}
|
||||
program { signal: "elm,state,radio,on"; source: "elm";
|
||||
script {
|
||||
new m = get_int(sel) | SELECTED;
|
||||
set_int(sel, m);
|
||||
eval_sel(m);
|
||||
}
|
||||
}
|
||||
program { signal: "elm,state,radio,off"; source: "elm";
|
||||
script {
|
||||
new m = get_int(sel) & ~SELECTED;
|
||||
set_int(sel, m);
|
||||
eval_sel(m);
|
||||
}
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "event";
|
||||
action: SIGNAL_EMIT "elm,action,press" "elm";
|
||||
after: "button_click_anim";
|
||||
}
|
||||
program { name: "button_click_anim";
|
||||
script { flag_set(PRESSED); }
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "event";
|
||||
script { eval_sel(get_int(sel) | SELECTED); }
|
||||
}
|
||||
program { signal: "mouse,up,1"; source: "event";
|
||||
action: SIGNAL_EMIT "elm,action,unpress" "elm";
|
||||
after: "button_unclick_anim";
|
||||
}
|
||||
program { name: "button_unclick_anim";
|
||||
script { flag_unset(PRESSED); }
|
||||
}
|
||||
program { signal: "mouse,up,1"; source: "event";
|
||||
script { eval_sel(get_int(sel)); }
|
||||
}
|
||||
program { signal: "mouse,clicked,1"; source: "event";
|
||||
action: SIGNAL_EMIT "elm,action,click" "elm";
|
||||
}
|
||||
program { signal: "elm,state,text,visible"; source: "elm";
|
||||
script { flag_set(LABEL); }
|
||||
}
|
||||
program { signal: "elm,state,text,hidden"; source: "elm";
|
||||
script { flag_unset(LABEL); }
|
||||
}
|
||||
program { signal: "elm,state,icon,visible"; source: "elm";
|
||||
script { flag_set(ICON); }
|
||||
}
|
||||
program { signal: "elm,state,icon,hidden"; source: "elm";
|
||||
script { flag_unset(ICON); }
|
||||
}
|
||||
program { signal: "elm,state,background,visible"; source: "elm";
|
||||
script { flag_set(BACKGROUND); }
|
||||
}
|
||||
program { signal: "elm,state,background,hidden"; source: "elm";
|
||||
script { flag_unset(BACKGROUND); }
|
||||
}
|
||||
program { signal: "elm,state,disabled"; source: "elm";
|
||||
script { flag_set(DISABLE); }
|
||||
}
|
||||
program { signal: "elm,state,enabled"; source: "elm";
|
||||
script { flag_unset(DISABLE); }
|
||||
}
|
||||
program { signal: "elm,state,disabled"; source: "elm";
|
||||
action: STATE_SET "disabled" 0.0;
|
||||
target: "ck_check";
|
||||
target: "ck_bg";
|
||||
}
|
||||
program { signal: "elm,state,enabled"; source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "ck_check";
|
||||
target: "ck_bg";
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "event";
|
||||
action: STATE_SET "pressed" 0.0;
|
||||
target: "ck_press";
|
||||
}
|
||||
program { signal: "mouse,up,1"; source: "event";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "ck_press";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,16 +28,12 @@ group { name: "elm/scroller/base/default";
|
|||
}
|
||||
part { name: "clipper"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
rel.to: "elm.swallow.background";
|
||||
rel.to: "elm.swallow.content";
|
||||
}
|
||||
}
|
||||
part { name: "elm.swallow.background"; type: SWALLOW;
|
||||
// scale: 1;
|
||||
clip_to: "clipper";
|
||||
description { state: "default" 0.0;
|
||||
// rel1.offset: 2 2;
|
||||
// rel2.offset: -3 -3;
|
||||
// offscale;
|
||||
}
|
||||
}
|
||||
part { name: "elm.swallow.content"; type: SWALLOW;
|
||||
|
@ -187,7 +183,7 @@ group { name: "elm/scroller/base/default";
|
|||
|
||||
part { name: "sh_clip"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
rel.to: "elm.swallow.background";
|
||||
rel.to: "clipper";
|
||||
}
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -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;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -732,6 +732,11 @@ ICON("utilities-terminal", "i-termprompt")
|
|||
|
||||
ICON("fprint", "i-fingerprint")
|
||||
|
||||
ICON("person-bust", "i-person-bust")
|
||||
|
||||
ICON("state-radio", "i-radio")
|
||||
ICON("state-check", "i-check")
|
||||
|
||||
#undef ICON
|
||||
|
||||
// regular icons
|
||||
|
@ -746,6 +751,7 @@ ICON("fprint", "i-fingerprint")
|
|||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
ICON("folder", "i-folder")
|
||||
ICON("file", "i-file")
|
||||
ICON("clock", "i-clock")
|
||||
|
@ -883,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";
|
||||
|
|
|
@ -152,6 +152,7 @@ I060("i-net-wifi-sig-3", "net-wifi-sig-3")
|
|||
I060("i-net-wifi-sig-4", "net-wifi-sig-4")
|
||||
I060("i-star", "star")
|
||||
I060("i-star-off", "star-off")
|
||||
I060("i-person-bust", "person-bust")
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// larger color icons (mostly efm or settings)
|
||||
|
@ -359,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")
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 249 B |
Binary file not shown.
After Width: | Height: | Size: 338 B |
Binary file not shown.
After Width: | Height: | Size: 625 B |
|
@ -0,0 +1,100 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
width="15"
|
||||
height="15"
|
||||
viewBox="0 0 15 15"
|
||||
sodipodi:docname="person-bust.svg"
|
||||
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
|
||||
inkscape:export-filename="/home/raster/C/th-efl/th/img/ic/stick-man-015.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<metadata
|
||||
id="metadata8">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs6">
|
||||
<linearGradient
|
||||
id="linearGradient4128"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
id="stop4126"
|
||||
offset="0"
|
||||
style="stop-color:#000000;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
inkscape:document-rotation="0"
|
||||
pagecolor="#404040"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1377"
|
||||
id="namedview4"
|
||||
showgrid="true"
|
||||
inkscape:zoom="75.133333"
|
||||
inkscape:cx="7.5"
|
||||
inkscape:cy="7.5"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g10"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:bbox-paths="false"
|
||||
inkscape:bbox-nodes="true"
|
||||
inkscape:snap-bbox-edge-midpoints="false"
|
||||
inkscape:object-paths="true"
|
||||
inkscape:snap-intersection-paths="true"
|
||||
inkscape:snap-smooth-nodes="true"
|
||||
inkscape:pagecheckerboard="0">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid837"
|
||||
spacingx="0.5"
|
||||
spacingy="0.5" />
|
||||
</sodipodi:namedview>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
inkscape:label="Image"
|
||||
id="g10">
|
||||
<circle
|
||||
r="2.5"
|
||||
cy="4.5"
|
||||
cx="7.5"
|
||||
id="path4112"
|
||||
style="fill:#fefefe;fill-opacity:1;stroke-width:2.75;stroke-linecap:round;stroke-linejoin:round" />
|
||||
<rect
|
||||
y="6.5"
|
||||
x="6.5"
|
||||
height="4"
|
||||
width="2"
|
||||
id="rect4116"
|
||||
style="fill:#fdfdfd;fill-opacity:1;stroke-width:0.888936;stroke-linecap:round;stroke-linejoin:round" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 3.5,13 h 8 v -3 c 0,-1 -1,-2 -2,-2 h -4 c -1,0 -2,1 -2,2 z"
|
||||
id="path865"
|
||||
sodipodi:nodetypes="ccccccc" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.0 KiB |
|
@ -948,11 +948,6 @@
|
|||
* @ref ecore_event_example_02_c "the explanation here".
|
||||
*/
|
||||
|
||||
/**
|
||||
* @example ecore_fd_handler_gnutls_example.c
|
||||
* Shows how to use fd handlers.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @example ecore_con_lookup_example.c
|
||||
* Shows how to make a simple DNS lookup. See the complete example description
|
||||
|
|
19
meson.build
19
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
|
||||
|
@ -218,15 +219,15 @@ else
|
|||
error('System ' + host_machine.system() + ' not known')
|
||||
endif
|
||||
|
||||
if sys_linux or sys_bsd or sys_sun
|
||||
config_h.set('_STAT_VER_LINUX', '1')
|
||||
endif
|
||||
|
||||
if host_os == 'freebsd' or host_os == 'dragonfly'
|
||||
# This is necessary. We MUST use OpenSSL in base as bringing in from ports
|
||||
# can cause major issues (2 copies of the same library).
|
||||
crypto = declare_dependency(link_args : [ '-lssl', '-lcrypto'])
|
||||
config_h.set('HAVE_OPENSSL', '1')
|
||||
elif get_option('crypto') == 'gnutls'
|
||||
# gcrypt does not want to provide a pkg config file so we try the lib
|
||||
crypto = [dependency('gnutls'), cc.find_library('gcrypt')]
|
||||
config_h.set('HAVE_GNUTLS', '1')
|
||||
elif get_option('crypto') == 'openssl'
|
||||
crypto = dependency('openssl')
|
||||
config_h.set('HAVE_OPENSSL', '1')
|
||||
|
@ -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
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ option('debug-threads',
|
|||
|
||||
option('build-examples',
|
||||
type : 'boolean',
|
||||
value : true,
|
||||
value : false,
|
||||
description : 'Compile examples'
|
||||
)
|
||||
|
||||
|
@ -108,7 +108,7 @@ option('build-tests',
|
|||
|
||||
option('crypto',
|
||||
type : 'combo',
|
||||
choices : ['gnutls', 'openssl'],
|
||||
choices : ['openssl'],
|
||||
value : 'openssl',
|
||||
description : 'Which SSL Crypto library used in efl'
|
||||
)
|
||||
|
@ -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.'
|
||||
)
|
||||
|
|
|
@ -1 +1 @@
|
|||
ar az_IR ca cs da de el eo es fa fi fr gl he hu it ja ko_KR ko lt nl pl ps pt ru sl sr tr ur vi yi zh_CN
|
||||
ar az_IR ca cs da de el eo es fa fi fr gl he hu it ja ka ko_KR ko lt nl pl ps pt ru sl sr tr ur vi yi zh_CN
|
||||
|
|
|
@ -406,7 +406,6 @@ src/examples/ecore/ecore_event_example_02.c
|
|||
src/examples/ecore/ecore_exe_example.c
|
||||
src/examples/ecore/ecore_exe_example_child.c
|
||||
src/examples/ecore/ecore_fd_handler_example.c
|
||||
src/examples/ecore/ecore_fd_handler_gnutls_example.c
|
||||
src/examples/ecore/ecore_file_download_example.c
|
||||
src/examples/ecore/ecore_getopt_example.c
|
||||
src/examples/ecore/ecore_idler_example.c
|
||||
|
@ -861,11 +860,9 @@ src/lib/ecore_con/efl_net_socket_tcp.c
|
|||
src/lib/ecore_con/efl_net_socket_udp.c
|
||||
src/lib/ecore_con/efl_net_socket_unix.c
|
||||
src/lib/ecore_con/efl_net_socket_windows.c
|
||||
src/lib/ecore_con/efl_net_ssl_conn-gnutls.c
|
||||
src/lib/ecore_con/efl_net_ssl_conn-none.c
|
||||
src/lib/ecore_con/efl_net_ssl_conn-openssl.c
|
||||
src/lib/ecore_con/efl_net_ssl_context.c
|
||||
src/lib/ecore_con/efl_net_ssl_ctx-gnutls.c
|
||||
src/lib/ecore_con/efl_net_ssl_ctx-none.c
|
||||
src/lib/ecore_con/efl_net_ssl_ctx-openssl.c
|
||||
src/lib/ecore_drm2/ecore_drm2.c
|
||||
|
@ -2484,7 +2481,6 @@ src/lib/embryo/embryo_time.c
|
|||
src/lib/emile/emile_base64.c
|
||||
src/lib/emile/emile_base64.h
|
||||
src/lib/emile/emile_cipher.c
|
||||
src/lib/emile/emile_cipher_gnutls.c
|
||||
src/lib/emile/emile_cipher.h
|
||||
src/lib/emile/emile_cipher_openssl.c
|
||||
src/lib/emile/emile_compress.c
|
||||
|
|
|
@ -0,0 +1,276 @@
|
|||
# Georgian translation for Efl.
|
||||
# Copyright (C) 2022 Enlightenment development team
|
||||
# This file is put in the public domain.
|
||||
# Temuri Doghonadze <temuri.doghonadze@gmail.com>, 2022.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: elementary 1.11\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-04-19 16:13+0200\n"
|
||||
"PO-Revision-Date: 2022-10-25 10:16+0200\n"
|
||||
"Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>\n"
|
||||
"Language-Team: Georgian <(nothing)>\n"
|
||||
"Language: ka\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 3.2\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:85
|
||||
msgid "Version:"
|
||||
msgstr "ვერსია:"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:94
|
||||
msgid "Usage:"
|
||||
msgstr "გამოყენება:"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:101
|
||||
#, c-format
|
||||
msgid "%s [options]"
|
||||
msgstr "%s [პარამეტრები]"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:301
|
||||
msgid "Copyright:"
|
||||
msgstr "უფლებები:"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:313
|
||||
msgid "License:"
|
||||
msgstr "ლიცენზია:"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:499
|
||||
msgid "Type: "
|
||||
msgstr "ტიპი: "
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:575
|
||||
msgid "Default: "
|
||||
msgstr "ნაგულისხმები: "
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:602
|
||||
msgid "Choices: "
|
||||
msgstr "არჩევანი: "
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:640 src/lib/ecore/ecore_getopt.c:641
|
||||
msgid "No categories available."
|
||||
msgstr "კატეგორიები ხელმიუწვდომელია."
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:645
|
||||
msgid "Categories: "
|
||||
msgstr "კატეგორიები: "
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:767
|
||||
msgid "Options:\n"
|
||||
msgstr "პარამეტრები:\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:776
|
||||
msgid "Positional arguments:\n"
|
||||
msgstr "პოზიციური არგუმენტები:\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:843
|
||||
#, c-format
|
||||
msgid "ERROR: unknown category '%s'.\n"
|
||||
msgstr "შეცდომა: უცნობი კატეგორია '%s'.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:947
|
||||
#, c-format
|
||||
msgid "ERROR: unknown option --%s.\n"
|
||||
msgstr "შეცდომა: უცნობი პარამეტრი --%s.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:949
|
||||
#, c-format
|
||||
msgid "ERROR: unknown option -%c.\n"
|
||||
msgstr "შეცდომა: უცნობი პარამეტრი -%c.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1012
|
||||
msgid "ERROR: "
|
||||
msgstr "შეცდომა: "
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1108 src/lib/ecore/ecore_getopt.c:1245
|
||||
#: src/lib/ecore/ecore_getopt.c:1261 src/lib/ecore/ecore_getopt.c:1276
|
||||
#: src/lib/ecore/ecore_getopt.c:1296 src/lib/ecore/ecore_getopt.c:1343
|
||||
#: src/lib/ecore/ecore_getopt.c:1463 src/lib/ecore/ecore_getopt.c:1504
|
||||
msgid "value has no pointer set.\n"
|
||||
msgstr "მნიშვნელობას მაჩვენებელი დაყენებული არ აქვს.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1140 src/lib/ecore/ecore_getopt.c:1363
|
||||
#, c-format
|
||||
msgid "unknown boolean value %s.\n"
|
||||
msgstr "უცნობი ლოგიკური მნიშვნელობა %s.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1191 src/lib/ecore/ecore_getopt.c:1451
|
||||
#, c-format
|
||||
msgid "invalid number format %s\n"
|
||||
msgstr "რიცხვის არასწორი ფორმატი %s\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1309
|
||||
#, c-format
|
||||
msgid "invalid choice \"%s\". Valid values are: "
|
||||
msgstr "არასწორი არჩევანი \"%s\". სწორი მნიშვნელობებია: "
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1337
|
||||
msgid "missing parameter to append.\n"
|
||||
msgstr "მისაწერი გამორჩენილი პარამეტრი.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1441
|
||||
msgid "could not parse value.\n"
|
||||
msgstr "მნიშვნელობის დამუშავების შეცდომა.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1498
|
||||
msgid "missing parameter.\n"
|
||||
msgstr "ნაკლული პარამეტრი.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1511
|
||||
msgid "missing callback function!\n"
|
||||
msgstr "ნაკლული უკუგამოძახების ფუნქცია!\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1542
|
||||
msgid "no version was defined.\n"
|
||||
msgstr "ვერსია აღწერილი არაა.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1559
|
||||
msgid "no copyright was defined.\n"
|
||||
msgstr "საავტორო უფლებები აღწერილი არაა.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1576
|
||||
msgid "no license was defined.\n"
|
||||
msgstr "ლიცენზია აღწერილი არაა.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1666
|
||||
#, c-format
|
||||
msgid "ERROR: unknown option --%s, ignored.\n"
|
||||
msgstr "შეცდომა: უცნობი პარამეტრი --%s. იგნორირებულია.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1706
|
||||
#, c-format
|
||||
msgid "ERROR: option --%s requires an argument!\n"
|
||||
msgstr "შეცდომა: პარამეტრისთვის --%s არგუმენტი აუცილებელია!\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1748
|
||||
#, c-format
|
||||
msgid "ERROR: unknown option -%c, ignored.\n"
|
||||
msgstr "შეცდომა: უცნობი პარამეტრი -%c, იგნორირებულია.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1793
|
||||
#, c-format
|
||||
msgid "ERROR: option -%c requires an argument!\n"
|
||||
msgstr "შეცდომა: პარამეტრისთვის -%c არგუმენტი აუცილებელია!\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1888
|
||||
#, c-format
|
||||
msgid "ERROR: missing required positional argument %s.\n"
|
||||
msgstr "შეცდომა: ნაკლული აუცილებელი პოზიციური არგუმენტი %s.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1920
|
||||
#, c-format
|
||||
msgid "ERROR: unsupported action type %d for positional argument %s\n"
|
||||
msgstr ""
|
||||
"შეცდომა: ქმედების მხარდაუჭერელი ტიპი (%d) პოზიციური არგუმენტისთვის %s\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:2041 src/lib/ecore/ecore_getopt.c:2107
|
||||
msgid "ERROR: no parser provided.\n"
|
||||
msgstr "შეცდომა: დამმუშავებელი მოწოდებული არაა.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:2046 src/lib/ecore/ecore_getopt.c:2112
|
||||
msgid "ERROR: no values provided.\n"
|
||||
msgstr "შეცდომა: მნიშვნელობები მითითებული არაა.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:2055 src/lib/ecore/ecore_getopt.c:2121
|
||||
msgid "ERROR: no arguments provided.\n"
|
||||
msgstr "შეცდომა: არგუმენტები მითითებული არაა.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:2081
|
||||
msgid "ERROR: invalid options found."
|
||||
msgstr "შეცდომა: აღმოჩენილია არასწორი პარამეტრები."
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:2087 src/lib/ecore/ecore_getopt.c:2154
|
||||
#, c-format
|
||||
msgid " See --%s.\n"
|
||||
msgstr " იხილეთ --%s.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:2089 src/lib/ecore/ecore_getopt.c:2156
|
||||
#, c-format
|
||||
msgid " See -%c.\n"
|
||||
msgstr " იხილეთ -%c.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:2148
|
||||
msgid "ERROR: invalid positional arguments found."
|
||||
msgstr "შეცდომა: ნაპოვნია არასწორი პოზიციური არგუმენტები."
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:2183
|
||||
#, c-format
|
||||
msgid "ERROR: incorrect geometry value '%s'\n"
|
||||
msgstr "შეცდომა: გეომეტრიის არასწორი მნიშვნელობა '%s'\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:2201
|
||||
#, c-format
|
||||
msgid "ERROR: incorrect size value '%s'\n"
|
||||
msgstr "შეცდომა: ზომის არასწორი მნიშვნელობა '%s'\n"
|
||||
|
||||
#: src/lib/efreet/efreet_base.c:127
|
||||
msgid "Desktop"
|
||||
msgstr "სამუშაო მაგიდა"
|
||||
|
||||
#: src/lib/efreet/efreet_base.c:135
|
||||
msgid "Downloads"
|
||||
msgstr "გადმოწერები"
|
||||
|
||||
#: src/lib/efreet/efreet_base.c:144
|
||||
msgid "Templates"
|
||||
msgstr "შაბლონები"
|
||||
|
||||
#: src/lib/efreet/efreet_base.c:153
|
||||
msgid "Public"
|
||||
msgstr "საჯარო"
|
||||
|
||||
#: src/lib/efreet/efreet_base.c:162
|
||||
msgid "Documents"
|
||||
msgstr "დოკუმენტები"
|
||||
|
||||
#: src/lib/efreet/efreet_base.c:170
|
||||
msgid "Music"
|
||||
msgstr "მუსიკა"
|
||||
|
||||
#: src/lib/efreet/efreet_base.c:178
|
||||
msgid "Pictures"
|
||||
msgstr "სურათები"
|
||||
|
||||
#: src/lib/efreet/efreet_base.c:186
|
||||
msgid "Videos"
|
||||
msgstr "ვიდეო"
|
||||
|
||||
#: src/lib/evas/common/language/evas_language_utils.c:205
|
||||
msgid "default:LTR"
|
||||
msgstr "default:LTR"
|
||||
|
||||
#: src/lib/elementary/elc_naviframe.c:408
|
||||
msgid "Title"
|
||||
msgstr "სათაური"
|
||||
|
||||
#: src/lib/elementary/elc_naviframe.c:415
|
||||
msgid "Subtitle"
|
||||
msgstr "სუბტიტრები"
|
||||
|
||||
#: src/lib/elementary/elc_naviframe.c:966
|
||||
msgid "Back"
|
||||
msgstr "უკან"
|
||||
|
||||
#: src/lib/elementary/elc_fileselector.c:1755
|
||||
msgid "Up"
|
||||
msgstr "მაღლა"
|
||||
|
||||
#: src/lib/elementary/elc_fileselector.c:1769
|
||||
msgid "Home"
|
||||
msgstr "საწყისი"
|
||||
|
||||
#: src/lib/elementary/elc_fileselector.c:1787
|
||||
msgid "Search"
|
||||
msgstr "ძებნა"
|
||||
|
||||
#: src/lib/elementary/elc_fileselector.c:2061
|
||||
msgid "OK"
|
||||
msgstr "დიახ"
|
||||
|
||||
#: src/lib/elementary/elc_fileselector.c:2070
|
||||
msgid "Cancel"
|
||||
msgstr "გაუქმება"
|
||||
|
38
po/pt.po
38
po/pt.po
|
@ -1,22 +1,23 @@
|
|||
# Portuguese translation for Efl.
|
||||
# Copyright (C) 2012 Enlightenment development team
|
||||
# This file is public domain.
|
||||
# Sérgio Marques <smarquespt@gmail.com>, 2010-2014
|
||||
# Sérgio Marques <smarquespt@gmail.com>, 2010-2014.
|
||||
# Hugo Carvalho <hugokarvalho@hotmail.com> 2021-2022.
|
||||
#
|
||||
#: src/lib/elementary/elm_config.c:4267
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Elementary\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-04-19 16:13+0200\n"
|
||||
"PO-Revision-Date: 2013-11-05 14:11-0000\n"
|
||||
"Last-Translator: Sérgio Marques <smarquespt@gmail.com>\n"
|
||||
"Language-Team: General\n"
|
||||
"PO-Revision-Date: 2022-10-02 22:21+0100\n"
|
||||
"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
|
||||
"Language-Team: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
|
||||
"Language: pt\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.6.4\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 3.1.1\n"
|
||||
"X-Launchpad-Export-Date: 2012-12-07 16:20+0000\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:85
|
||||
|
@ -30,7 +31,7 @@ msgstr "Utilização:"
|
|||
#: src/lib/ecore/ecore_getopt.c:101
|
||||
#, c-format
|
||||
msgid "%s [options]"
|
||||
msgstr "%s [opções]"
|
||||
msgstr "%s [options]"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:301
|
||||
msgid "Copyright:"
|
||||
|
@ -42,15 +43,15 @@ msgstr "Licença:"
|
|||
|
||||
#: src/lib/ecore/ecore_getopt.c:499
|
||||
msgid "Type: "
|
||||
msgstr "Tipo:"
|
||||
msgstr "Tipo: "
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:575
|
||||
msgid "Default: "
|
||||
msgstr "Padrão:"
|
||||
msgstr "Padrão: "
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:602
|
||||
msgid "Choices: "
|
||||
msgstr "Escolhas:"
|
||||
msgstr "Escolhas: "
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:640 src/lib/ecore/ecore_getopt.c:641
|
||||
msgid "No categories available."
|
||||
|
@ -58,7 +59,7 @@ msgstr "Nenhuma categoria disponível."
|
|||
|
||||
#: src/lib/ecore/ecore_getopt.c:645
|
||||
msgid "Categories: "
|
||||
msgstr "Categorias:"
|
||||
msgstr "Categorias: "
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:767
|
||||
msgid "Options:\n"
|
||||
|
@ -107,7 +108,7 @@ msgstr "formato numérico inválido %s\n"
|
|||
#: src/lib/ecore/ecore_getopt.c:1309
|
||||
#, c-format
|
||||
msgid "invalid choice \"%s\". Valid values are: "
|
||||
msgstr "escolha inválida \"%s\". O valores possíveis são:"
|
||||
msgstr "escolha inválida \"%s\". O valores possíveis são: "
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:1337
|
||||
msgid "missing parameter to append.\n"
|
||||
|
@ -186,12 +187,12 @@ msgstr "ERRO: encontradas opções inválidas."
|
|||
#: src/lib/ecore/ecore_getopt.c:2087 src/lib/ecore/ecore_getopt.c:2154
|
||||
#, c-format
|
||||
msgid " See --%s.\n"
|
||||
msgstr "Consulte --%s.\n"
|
||||
msgstr " Veja --%s.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:2089 src/lib/ecore/ecore_getopt.c:2156
|
||||
#, c-format
|
||||
msgid " See -%c.\n"
|
||||
msgstr "Consulte -%c.\n"
|
||||
msgstr " Veja -%c.\n"
|
||||
|
||||
#: src/lib/ecore/ecore_getopt.c:2148
|
||||
msgid "ERROR: invalid positional arguments found."
|
||||
|
@ -241,20 +242,19 @@ msgstr "Vídeos"
|
|||
|
||||
#: src/lib/evas/common/language/evas_language_utils.c:205
|
||||
msgid "default:LTR"
|
||||
msgstr "default:LTR"
|
||||
msgstr "padrão: LTR (da esquerda para a direita)"
|
||||
|
||||
#: src/lib/elementary/elc_naviframe.c:408
|
||||
msgid "Title"
|
||||
msgstr "Título"
|
||||
|
||||
#: src/lib/elementary/elc_naviframe.c:415
|
||||
#, fuzzy
|
||||
msgid "Subtitle"
|
||||
msgstr "Título"
|
||||
msgstr "Legenda"
|
||||
|
||||
#: src/lib/elementary/elc_naviframe.c:966
|
||||
msgid "Back"
|
||||
msgstr "Recuar"
|
||||
msgstr "Voltar"
|
||||
|
||||
#: src/lib/elementary/elc_fileselector.c:1755
|
||||
msgid "Up"
|
||||
|
@ -266,7 +266,7 @@ msgstr "Pasta pessoal"
|
|||
|
||||
#: src/lib/elementary/elc_fileselector.c:1787
|
||||
msgid "Search"
|
||||
msgstr ""
|
||||
msgstr "Procurar"
|
||||
|
||||
#: src/lib/elementary/elc_fileselector.c:2061
|
||||
msgid "OK"
|
||||
|
|
|
@ -4151,7 +4151,7 @@ do_xifdef(cpp_reader * pfile, struct directive *keyword,
|
|||
int c;
|
||||
|
||||
/* Detect a #ifndef at start of file (not counting comments). */
|
||||
if (ip->fname != 0 && keyword->type == T_IFNDEF)
|
||||
if (ip->fname != NULL && keyword->type == T_IFNDEF)
|
||||
start_of_file = pfile->only_seen_white == 2;
|
||||
|
||||
pfile->no_macro_expand++;
|
||||
|
|
|
@ -43,9 +43,9 @@ if meson.is_cross_build()
|
|||
edje_depends = []
|
||||
else
|
||||
if sys_windows == true
|
||||
edje_cc_exe = [edje_cc.full_path()]
|
||||
edje_cc_exe = [edje_cc]
|
||||
else
|
||||
edje_cc_exe = [env, asan_option, 'EFL_RUN_IN_TREE=1', edje_cc.full_path()]
|
||||
edje_cc_exe = [env, asan_option, 'EFL_RUN_IN_TREE=1', edje_cc]
|
||||
endif
|
||||
edje_depends = [edje_cc, epp, evas_engine_buffer_mod, embryo_cc]
|
||||
endif
|
||||
|
@ -97,7 +97,7 @@ if meson.is_cross_build()
|
|||
edje_codegen_path = _edje_codegen.path()
|
||||
edje_codegen_exe = [_edje_codegen]
|
||||
else
|
||||
edje_codegen_exe = [env, asan_option, 'EFL_RUN_IN_TREE=1', edje_codegen.full_path()]
|
||||
edje_codegen_exe = [env, asan_option, 'EFL_RUN_IN_TREE=1', edje_codegen]
|
||||
endif
|
||||
|
||||
edje_pick = executable('edje_pick',
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2029,7 +2029,7 @@ _status_config_etc(Evas_Object *win,
|
|||
elm_check_state_set(ck, elm_config_desktop_entry_get());
|
||||
|
||||
// desktop_entry
|
||||
CHECK_ADD("Entry Mangifiers", "Set popup magnifiers on start/end selection handles in entries", mag_change, NULL);
|
||||
CHECK_ADD("Entry Magnifiers", "Set popup magnifiers on start/end selection handles in entries", mag_change, NULL);
|
||||
elm_check_state_set(ck, elm_config_magnifier_enable_get());
|
||||
|
||||
// access
|
||||
|
@ -2455,7 +2455,8 @@ _status_config_icons(Evas_Object *win,
|
|||
ic = elm_icon_add(li);
|
||||
elm_image_file_set(ic, efreet_icon_path_find(th->name.internal, "folder", 48), NULL);
|
||||
list_it = elm_list_item_append(li, th->name.name, ic, NULL,
|
||||
_icon_theme_sel, th->name.internal);
|
||||
_icon_theme_sel,
|
||||
eina_stringshare_add(th->name.internal));
|
||||
|
||||
if (!strcmp(th->name.internal, "hicolor"))
|
||||
def_it = list_it;
|
||||
|
@ -3375,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"),
|
||||
|
@ -4085,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
|
||||
|
@ -4382,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++)
|
||||
{
|
||||
|
|
|
@ -36,7 +36,8 @@ _group_1_create(Evas_Object *bx, const char *style)
|
|||
|
||||
// radio 1
|
||||
ic = elm_icon_add(bx2);
|
||||
snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
|
||||
elm_icon_standard_set(ic, "menu/folder");
|
||||
// snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
|
||||
elm_image_file_set(ic, buf, NULL);
|
||||
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
|
||||
|
||||
|
@ -217,5 +218,14 @@ test_radio(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
_group_1_create(bx, "icon");
|
||||
_group_2_create(bx, "icon");
|
||||
|
||||
bx = elm_box_add(win);
|
||||
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_box_horizontal_set(bx, EINA_TRUE);
|
||||
elm_box_pack_end(bx0, bx);
|
||||
evas_object_show(bx);
|
||||
|
||||
_group_1_create(bx, "sort_header");
|
||||
_group_2_create(bx, "sort_header");
|
||||
|
||||
evas_object_show(win);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
/ecore_exe_example
|
||||
/ecore_exe_example_child
|
||||
/ecore_fd_handler_example
|
||||
/ecore_fd_handler_gnutls_example
|
||||
/ecore_file_download_example
|
||||
/ecore_getopt_example
|
||||
/ecore_idler_example
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// Compile with:
|
||||
// gcc -o ecore_audio_custom ecore_audio_custom.c `pkg-config --libs --cflags ecore ecore-audio`
|
||||
#ifndef EFL_BETA_API_SUPPORT
|
||||
# define EFL_BETA_API_SUPPORT
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -25,7 +28,7 @@ int read_cb(void *data EINA_UNUSED, Eo *eo_obj, void *buf, int len)
|
|||
float *val = buf;
|
||||
int i;
|
||||
|
||||
ecore_audio_obj_volume_get(eo_obj, &volume);
|
||||
volume = ecore_audio_obj_volume_get(eo_obj);
|
||||
|
||||
for(i=0; i<len/4; i++, phase1++)
|
||||
{
|
||||
|
@ -56,9 +59,9 @@ main(int argc, const char *argv[])
|
|||
|
||||
ecore_app_args_set(argc, argv);
|
||||
|
||||
out = efl_add_ref(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL);
|
||||
out = efl_add_ref(ECORE_AUDIO_OUT_PULSE_CLASS, NULL);
|
||||
|
||||
in = efl_add_ref(ECORE_AUDIO_OBJ_IN_CLASS, NULL);
|
||||
in = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL);
|
||||
if (!in)
|
||||
{
|
||||
printf("error when creating ecore audio source.\n");
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// Compile with:
|
||||
// gcc -o ecore_audio_playback ecore_audio_playback.c `pkg-config --libs --cflags ecore eina ecore-audio`
|
||||
#ifndef EFL_BETA_API_SUPPORT
|
||||
# define EFL_BETA_API_SUPPORT
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -9,6 +12,7 @@
|
|||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <Ecore.h>
|
||||
#include <Ecore_Audio.h>
|
||||
#include <Eina.h>
|
||||
|
@ -30,19 +34,19 @@ handle_cmd(char *cmd, size_t bread)
|
|||
if (!out)
|
||||
return;
|
||||
|
||||
ecore_audio_obj_out_inputs_get(out, &out_inputs);
|
||||
out_inputs = ecore_audio_obj_out_inputs_get(out);
|
||||
EINA_LIST_FOREACH(out_inputs, input, in)
|
||||
{
|
||||
ecore_audio_obj_in_seek(in, 0, SEEK_CUR, &pos);
|
||||
pos = ecore_audio_obj_in_seek(in, 0, SEEK_CUR);
|
||||
if (!strncmp(cmd, "<", bread))
|
||||
ecore_audio_obj_in_seek(in, -10, SEEK_CUR, &pos);
|
||||
pos = ecore_audio_obj_in_seek(in, -10, SEEK_CUR);/* */
|
||||
else if (!strncmp(cmd, ">", bread))
|
||||
ecore_audio_obj_in_seek(in, 10, SEEK_CUR, &pos);
|
||||
pos = ecore_audio_obj_in_seek(in, 10, SEEK_CUR);
|
||||
|
||||
min = pos / 60;
|
||||
|
||||
ecore_audio_obj_name_get(in, &name);
|
||||
ecore_audio_obj_in_length_get(in, &length);
|
||||
name = ecore_audio_obj_name_get(in);
|
||||
length = ecore_audio_obj_in_length_get(in);
|
||||
printf("Position: %2im %5.02fs (%0.2f%%) - %s\n", min, pos - min * 60, pos/length*100, name);
|
||||
|
||||
}
|
||||
|
@ -63,8 +67,8 @@ handle_cmd(char *cmd, size_t bread)
|
|||
{
|
||||
in = (Eo *)eina_list_data_get(inputs);
|
||||
|
||||
ecore_audio_obj_name_get(in, &name);
|
||||
ecore_audio_obj_in_length_get(in, &length);
|
||||
name = ecore_audio_obj_name_get(in);
|
||||
length = ecore_audio_obj_in_length_get(in);
|
||||
|
||||
printf("Start: %s (%0.2fs)\n", name, length);
|
||||
ret = ecore_audio_obj_out_input_attach(out, in);
|
||||
|
@ -84,8 +88,8 @@ handle_cmd(char *cmd, size_t bread)
|
|||
{
|
||||
in = (Eo *)eina_list_data_get(inputs);
|
||||
|
||||
ecore_audio_obj_name_get(in, &name);
|
||||
ecore_audio_obj_in_length_get(in, &length);
|
||||
name = ecore_audio_obj_name_get(in);
|
||||
length = ecore_audio_obj_in_length_get(in);
|
||||
|
||||
printf("Start: %s (%0.2fs)\n", name, length);
|
||||
ret = ecore_audio_obj_out_input_attach(out, in);
|
||||
|
@ -98,8 +102,8 @@ handle_cmd(char *cmd, size_t bread)
|
|||
EINA_LIST_FOREACH(out_inputs, input, in)
|
||||
{
|
||||
Eina_Bool loop;
|
||||
ecore_audio_obj_in_looped_get(in, &loop);
|
||||
ecore_audio_obj_name_get(in, &name);
|
||||
loop = ecore_audio_obj_in_looped_get(in);
|
||||
name = ecore_audio_obj_name_get(in);
|
||||
|
||||
printf("%s song %s\n", !loop?"Looping":"Not looping", name);
|
||||
ecore_audio_obj_in_looped_set(in, !loop);
|
||||
|
@ -124,11 +128,11 @@ handle_cmd(char *cmd, size_t bread)
|
|||
double speed;
|
||||
EINA_LIST_FOREACH(out_inputs, input, in)
|
||||
{
|
||||
ecore_audio_obj_in_speed_get(in, &speed);
|
||||
speed = ecore_audio_obj_in_speed_get(in);
|
||||
if (speed < 2.0)
|
||||
speed += 0.01;
|
||||
ecore_audio_obj_in_speed_set(in, speed);
|
||||
ecore_audio_obj_name_get(in, &name);
|
||||
name = ecore_audio_obj_name_get(in);
|
||||
printf("Speed: %3.0f%% (%s)\n", speed * 100, name);
|
||||
}
|
||||
}
|
||||
|
@ -137,11 +141,11 @@ handle_cmd(char *cmd, size_t bread)
|
|||
double speed;
|
||||
EINA_LIST_FOREACH(out_inputs, input, in)
|
||||
{
|
||||
ecore_audio_obj_in_speed_get(in, &speed);
|
||||
speed = ecore_audio_obj_in_speed_get(in);
|
||||
if (speed > 0.5)
|
||||
speed -= 0.01;
|
||||
ecore_audio_obj_in_speed_set(in, speed);
|
||||
ecore_audio_obj_name_get(in, &name);
|
||||
name = ecore_audio_obj_name_get(in);
|
||||
printf("Speed: %3.0f%% (%s)\n", speed * 100, name);
|
||||
}
|
||||
}
|
||||
|
@ -149,9 +153,9 @@ handle_cmd(char *cmd, size_t bread)
|
|||
{
|
||||
EINA_LIST_FOREACH(out_inputs, input, in)
|
||||
{
|
||||
ecore_audio_obj_paused_get(in, &paused);
|
||||
ecore_audio_obj_name_get(in, &name);
|
||||
ecore_audio_obj_in_remaining_get(in, &length);
|
||||
paused = ecore_audio_obj_paused_get(in);
|
||||
name = ecore_audio_obj_name_get(in);
|
||||
length = ecore_audio_obj_in_remaining_get(in);
|
||||
printf("%s %s\n%0.2f remaining\n", !paused ? "Paused" : "Unpaused", name, length);
|
||||
ecore_audio_obj_paused_set(in, !paused);
|
||||
}
|
||||
|
@ -191,12 +195,13 @@ handle_input(void *data EINA_UNUSED, Ecore_Fd_Handler *handler)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void _play_finished(void *data EINA_UNUSED, const Efl_Event *event)
|
||||
static void
|
||||
_play_finished(void *data EINA_UNUSED, const Efl_Event *event)
|
||||
{
|
||||
const char *name;
|
||||
Eina_Bool ret;
|
||||
|
||||
ecore_audio_obj_name_get(event->object, &name);
|
||||
name = ecore_audio_obj_name_get(event->object);
|
||||
printf("Done: %s\n", name);
|
||||
|
||||
inputs = eina_list_remove(inputs, event->object);
|
||||
|
@ -212,7 +217,7 @@ static void _play_finished(void *data EINA_UNUSED, const Efl_Event *event)
|
|||
const char *name;
|
||||
Eo *in = (Eo *)eina_list_data_get(inputs);
|
||||
|
||||
ecore_audio_obj_name_get(in, &name);
|
||||
name = ecore_audio_obj_name_get(in);
|
||||
printf("Start: %s\n", name);
|
||||
ret = ecore_audio_obj_out_input_attach(out, in);
|
||||
if (!ret)
|
||||
|
@ -223,8 +228,6 @@ static void _play_finished(void *data EINA_UNUSED, const Efl_Event *event)
|
|||
printf("Stream done\n");
|
||||
ecore_main_loop_quit();
|
||||
}
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -252,7 +255,7 @@ main(int argc, const char *argv[])
|
|||
{
|
||||
if (!strncmp(argv[i], "tone:", 5))
|
||||
{
|
||||
in = efl_add_ref(ECORE_AUDIO_OBJ_IN_TONE_CLASS, NULL);
|
||||
in = efl_add_ref(ECORE_AUDIO_IN_TONE_CLASS, NULL);
|
||||
if (!in)
|
||||
{
|
||||
printf("error when creating ecore audio source.\n");
|
||||
|
@ -276,7 +279,7 @@ main(int argc, const char *argv[])
|
|||
}
|
||||
else
|
||||
{
|
||||
in = efl_add_ref(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL);
|
||||
in = efl_add_ref(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL);
|
||||
if (!in)
|
||||
{
|
||||
printf("error when creating ecore audio source.\n");
|
||||
|
@ -291,7 +294,7 @@ main(int argc, const char *argv[])
|
|||
continue;
|
||||
}
|
||||
}
|
||||
efl_event_callback_add(in, ECORE_AUDIO_EV_IN_STOPPED, _play_finished, NULL);
|
||||
efl_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _play_finished, NULL);
|
||||
inputs = eina_list_append(inputs, in);
|
||||
}
|
||||
|
||||
|
@ -302,12 +305,12 @@ main(int argc, const char *argv[])
|
|||
if (!in)
|
||||
return 1;
|
||||
|
||||
ecore_audio_obj_name_get(in, &name);
|
||||
ecore_audio_obj_in_length_get(in, &length);
|
||||
name = ecore_audio_obj_name_get(in);
|
||||
length = ecore_audio_obj_in_length_get(in);
|
||||
|
||||
printf("Start: %s (%0.2fs)\n", name, length);
|
||||
|
||||
out = efl_add_ref(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL);
|
||||
out = efl_add_ref(ECORE_AUDIO_OUT_PULSE_CLASS, NULL);
|
||||
ret = ecore_audio_obj_out_input_attach(out, in);
|
||||
if (!ret)
|
||||
printf("Could not attach input %s\n", name);
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// Compile with:
|
||||
// gcc -o ecore_audio_to_ogg ecore_audio_to_ogg.c `pkg-config --libs --cflags ecore eina ecore-audio`
|
||||
#ifndef EFL_BETA_API_SUPPORT
|
||||
# define EFL_BETA_API_SUPPORT
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <libgen.h>
|
||||
|
@ -15,21 +18,20 @@
|
|||
double volume = 1;
|
||||
Eina_List *inputs = NULL;
|
||||
|
||||
static void _play_finished(void *data EINA_UNUSED, const Efl_Event *event)
|
||||
static void
|
||||
_play_finished(void *data EINA_UNUSED, const Efl_Event *event)
|
||||
{
|
||||
const char *name;
|
||||
Eo *out;
|
||||
|
||||
ecore_audio_obj_name_get(event->object, &name);
|
||||
name = ecore_audio_obj_name_get(event->object);
|
||||
printf("Done: %s\n", name);
|
||||
|
||||
ecore_audio_obj_in_output_get(event->object, &out);
|
||||
out = ecore_audio_obj_in_output_get(event->object);
|
||||
efl_unref(event->object);
|
||||
efl_unref(out);
|
||||
|
||||
ecore_main_loop_quit();
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -49,7 +51,7 @@ main(int argc, char *argv[])
|
|||
ecore_audio_init();
|
||||
|
||||
|
||||
in = efl_add_ref(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL);
|
||||
in = efl_add_ref(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL);
|
||||
efl_name_set(in, basename(argv[1]));
|
||||
ret = ecore_audio_obj_source_set(in, argv[1]);
|
||||
if (!ret) {
|
||||
|
@ -58,9 +60,9 @@ main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
efl_event_callback_add(in, ECORE_AUDIO_EV_IN_STOPPED, _play_finished, NULL);
|
||||
efl_event_callback_add(in, ECORE_AUDIO_IN_EVENT_IN_STOPPED, _play_finished, NULL);
|
||||
|
||||
out = efl_add_ref(ECORE_AUDIO_OBJ_OUT_SNDFILE_CLASS, NULL);
|
||||
out = efl_add_ref(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL);
|
||||
ret = ecore_audio_obj_source_set(out, argv[2]);
|
||||
if (!ret) {
|
||||
printf("Could not set %s as output\n", argv[2]);
|
||||
|
|
|
@ -1,232 +0,0 @@
|
|||
//Compile with:
|
||||
// gcc -o ecore_fd_handler_gnutls_example ecore_fd_handler_gnutls_example.c `pkg-config --cflags --libs ecore gnutls`
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
#ifdef HAVE_NETINET_TCP_H
|
||||
# include <netinet/tcp.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <gnutls/gnutls.h>
|
||||
#include <Ecore.h>
|
||||
|
||||
/* Ecore_Fd_Handler example
|
||||
* 2010 Mike Blumenkrantz
|
||||
* compile with gcc $(pkgconfig --cflags --libs gnutls ecore)
|
||||
*/
|
||||
|
||||
#define print(...) \
|
||||
do { \
|
||||
fprintf(stderr, "line %i: ", __LINE__); \
|
||||
fprintf(stderr, __VA_ARGS__); \
|
||||
fprintf(stderr, "\n");\
|
||||
} while(0)
|
||||
|
||||
static int done = 0;
|
||||
|
||||
static void
|
||||
tls_log_func(int level, const char *str)
|
||||
{
|
||||
fprintf(stderr, "|<%d>| %s", level, str);
|
||||
}
|
||||
|
||||
static const char *
|
||||
SSL_GNUTLS_PRINT_HANDSHAKE_STATUS(gnutls_handshake_description_t status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case GNUTLS_HANDSHAKE_HELLO_REQUEST:
|
||||
return "Hello request";
|
||||
|
||||
case GNUTLS_HANDSHAKE_CLIENT_HELLO:
|
||||
return "Client hello";
|
||||
|
||||
case GNUTLS_HANDSHAKE_SERVER_HELLO:
|
||||
return "Server hello";
|
||||
|
||||
case GNUTLS_HANDSHAKE_CERTIFICATE_PKT:
|
||||
return "Certificate packet";
|
||||
|
||||
case GNUTLS_HANDSHAKE_SERVER_KEY_EXCHANGE:
|
||||
return "Server key exchange";
|
||||
|
||||
case GNUTLS_HANDSHAKE_CERTIFICATE_REQUEST:
|
||||
return "Certificate request";
|
||||
|
||||
case GNUTLS_HANDSHAKE_SERVER_HELLO_DONE:
|
||||
return "Server hello done";
|
||||
|
||||
case GNUTLS_HANDSHAKE_CERTIFICATE_VERIFY:
|
||||
return "Certificate verify";
|
||||
|
||||
case GNUTLS_HANDSHAKE_CLIENT_KEY_EXCHANGE:
|
||||
return "Client key exchange";
|
||||
|
||||
case GNUTLS_HANDSHAKE_FINISHED:
|
||||
return "Finished";
|
||||
|
||||
case GNUTLS_HANDSHAKE_SUPPLEMENTAL:
|
||||
return "Supplemental";
|
||||
default:
|
||||
return "Uncaught state";
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Connects to the peer and returns a socket
|
||||
* descriptor.
|
||||
*/
|
||||
static int
|
||||
tcp_connect(void)
|
||||
{
|
||||
const char *PORT = "443";
|
||||
const char *SERVER = "69.58.181.89"; //verisign.com
|
||||
int err, sd;
|
||||
int flag = 1, curstate = 0;
|
||||
struct sockaddr_in sa;
|
||||
|
||||
/* sets some fd options such as nonblock */
|
||||
sd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (sd < 0) abort();
|
||||
if (fcntl(sd, F_SETFL, O_NONBLOCK) < 0) perror("fcntl");
|
||||
eina_file_close_on_exec(sd, EINA_TRUE);
|
||||
if (setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, (const void *)&curstate, sizeof(curstate)) < 0) perror("setsockopt");
|
||||
|
||||
if (setsockopt(sd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int)) < 0) perror("setsockopt");
|
||||
|
||||
memset(&sa, '\0', sizeof (sa));
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_port = eina_htons(atoi(PORT));
|
||||
if (inet_pton(AF_INET, SERVER, &sa.sin_addr)) perror("inet_pton");
|
||||
|
||||
/* connects to server
|
||||
*/
|
||||
err = connect(sd, (struct sockaddr *)&sa, sizeof (sa));
|
||||
if ((err < 0) && (errno != EINPROGRESS))
|
||||
{
|
||||
print("Connect error\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return sd;
|
||||
}
|
||||
|
||||
/* closes the given socket descriptor.
|
||||
*/
|
||||
static void
|
||||
tcp_close(int sd)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
shutdown(sd, SD_BOTH); /* no more receptions */
|
||||
closesocket(sd);
|
||||
#else
|
||||
shutdown(sd, SHUT_RDWR); /* no more receptions */
|
||||
close(sd);
|
||||
#endif
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_process_data(gnutls_session_t client, Ecore_Fd_Handler *fd_handler)
|
||||
{
|
||||
static int ret, lastret;
|
||||
static unsigned int count = 0;
|
||||
|
||||
if (!done)
|
||||
{
|
||||
lastret = ret;
|
||||
ret = gnutls_handshake(client);
|
||||
count++;
|
||||
if (gnutls_record_get_direction(client))
|
||||
ecore_main_fd_handler_active_set(fd_handler, ECORE_FD_WRITE);
|
||||
else
|
||||
ecore_main_fd_handler_active_set(fd_handler, ECORE_FD_READ);
|
||||
/* avoid printing messages infinity times */
|
||||
if (lastret != ret)
|
||||
{
|
||||
print("gnutls returned with: %s - %s", gnutls_strerror_name(ret), gnutls_strerror(ret));
|
||||
if ((ret == GNUTLS_E_WARNING_ALERT_RECEIVED) || (ret == GNUTLS_E_FATAL_ALERT_RECEIVED))
|
||||
print("Also received alert: %s", gnutls_alert_get_name(gnutls_alert_get(client)));
|
||||
print("last out: %s", SSL_GNUTLS_PRINT_HANDSHAKE_STATUS(gnutls_handshake_get_last_out(client)));
|
||||
print("last in: %s", SSL_GNUTLS_PRINT_HANDSHAKE_STATUS(gnutls_handshake_get_last_in(client)));
|
||||
}
|
||||
|
||||
if (gnutls_error_is_fatal(ret))
|
||||
{
|
||||
print("yarrr this be an error!");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
if (ret == GNUTLS_E_SUCCESS)
|
||||
{
|
||||
done = 1;
|
||||
print("Handshake successful in %u handshake calls!", count);
|
||||
ecore_main_loop_quit();
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
/* credentials */
|
||||
gnutls_anon_client_credentials_t c_anoncred;
|
||||
gnutls_certificate_credentials_t c_certcred;
|
||||
|
||||
gnutls_session_t client;
|
||||
int sd;
|
||||
|
||||
/* General init. */
|
||||
gnutls_global_init();
|
||||
ecore_init();
|
||||
gnutls_global_set_log_function(tls_log_func);
|
||||
gnutls_global_set_log_level(6);
|
||||
|
||||
/* Init client */
|
||||
gnutls_anon_allocate_client_credentials(&c_anoncred);
|
||||
gnutls_certificate_allocate_credentials(&c_certcred);
|
||||
gnutls_init(&client, GNUTLS_CLIENT);
|
||||
/* set very specific priorities */
|
||||
gnutls_priority_set_direct(client, "NONE:%VERIFY_ALLOW_X509_V1_CA_CRT:+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+COMP-DEFLATE:+COMP-NULL:+CTYPE-X509:+SHA1:+SHA256:+SHA384:+SHA512:+AES-256-CBC:+AES-128-CBC:+3DES-CBC:+VERS-TLS1.2:+VERS-TLS1.1:+VERS-TLS1.0:+VERS-SSL3.0", NULL);
|
||||
gnutls_credentials_set(client, GNUTLS_CRD_ANON, c_anoncred);
|
||||
gnutls_credentials_set(client, GNUTLS_CRD_CERTIFICATE, c_certcred);
|
||||
gnutls_server_name_set(client, GNUTLS_NAME_DNS, "www.verisign.com", strlen("www.verisign.com"));
|
||||
|
||||
/* connect to the peer
|
||||
*/
|
||||
sd = tcp_connect();
|
||||
|
||||
/* associate gnutls with socket */
|
||||
gnutls_transport_set_ptr(client, (gnutls_transport_ptr_t)(uintptr_t)sd);
|
||||
/* add a callback for data being available for send/receive on socket */
|
||||
if (!ecore_main_fd_handler_add(sd, ECORE_FD_READ | ECORE_FD_WRITE, (Ecore_Fd_Cb)_process_data, client, NULL, NULL))
|
||||
{
|
||||
print("could not create fd handler!");
|
||||
exit(1);
|
||||
}
|
||||
/* begin main loop */
|
||||
ecore_main_loop_begin();
|
||||
|
||||
gnutls_bye(client, GNUTLS_SHUT_RDWR);
|
||||
|
||||
gnutls_deinit(client);
|
||||
|
||||
tcp_close(sd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -18,13 +18,8 @@ if config_h.has('HAVE_FORK')
|
|||
examples += 'ecore_pipe_simple_example'
|
||||
endif
|
||||
|
||||
gnutls = dependency('gnutls', required : false)
|
||||
if gnutls.found()
|
||||
examples += ['ecore_fd_handler_gnutls_example']
|
||||
endif
|
||||
|
||||
foreach example : examples
|
||||
executable(example, example + '.c', dependencies: [eina, ecore, ecore_file, gnutls])
|
||||
executable(example, example + '.c', dependencies: [eina, ecore, ecore_file])
|
||||
endforeach
|
||||
|
||||
if get_option('gstreamer') == true
|
||||
|
@ -39,9 +34,9 @@ endif
|
|||
|
||||
|
||||
examples = [
|
||||
# 'ecore_audio_custom',
|
||||
# 'ecore_audio_playback',
|
||||
# 'ecore_audio_to_ogg',
|
||||
'ecore_audio_custom',
|
||||
'ecore_audio_playback',
|
||||
'ecore_audio_to_ogg',
|
||||
]
|
||||
|
||||
foreach example : examples
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -720,8 +720,7 @@ ECORE_CON_API Eina_Bool ecore_con_lookup(const char *name, Ecore_Con_Dns_Cb done
|
|||
|
||||
/**
|
||||
* @brief Returns if SSL support is available.
|
||||
* @return @c 1 if SSL is available and provided by gnutls,
|
||||
* @c 2 if SSL is available and provided by openssl,
|
||||
* @return @c 2 if SSL is available and provided by openssl,
|
||||
* @c 0 if it is not available.
|
||||
*/
|
||||
ECORE_CON_API int ecore_con_ssl_available_get(void);
|
||||
|
|
|
@ -165,9 +165,7 @@ ecore_con_shutdown(void)
|
|||
ECORE_CON_API int
|
||||
ecore_con_ssl_available_get(void)
|
||||
{
|
||||
#if HAVE_GNUTLS
|
||||
return 1;
|
||||
#elif HAVE_OPENSSL
|
||||
#ifdef HAVE_OPENSSL
|
||||
return 2;
|
||||
#else
|
||||
return 0;
|
||||
|
|
|
@ -96,11 +96,9 @@ static Eina_Error efl_net_ssl_conn_hostname_verify_set(Efl_Net_Ssl_Conn *conn, E
|
|||
static Eina_Error efl_net_ssl_conn_hostname_override_set(Efl_Net_Ssl_Conn *conn, const char *hostname);
|
||||
|
||||
#if HAVE_OPENSSL
|
||||
#include "efl_net_ssl_conn-openssl.c"
|
||||
#elif HAVE_GNUTLS
|
||||
#include "efl_net_ssl_conn-gnutls.c"
|
||||
# include "efl_net_ssl_conn-openssl.c"
|
||||
#else
|
||||
#include "efl_net_ssl_conn-none.c"
|
||||
# include "efl_net_ssl_conn-none.c"
|
||||
#endif
|
||||
|
||||
#define MY_CLASS EFL_NET_SOCKET_SSL_CLASS
|
||||
|
|
|
@ -1,362 +0,0 @@
|
|||
#include <gnutls/gnutls.h>
|
||||
#include <gnutls/x509.h>
|
||||
|
||||
struct _Efl_Net_Ssl_Conn {
|
||||
gnutls_session_t session;
|
||||
gnutls_datum_t ticket;
|
||||
Eo *sock;
|
||||
const char *hostname;
|
||||
Efl_Net_Ssl_Verify_Mode verify_mode;
|
||||
Eina_Bool hostname_verify;
|
||||
Eina_Bool is_dialer;
|
||||
};
|
||||
|
||||
static ssize_t
|
||||
_efl_net_ssl_conn_write(gnutls_transport_ptr_t transp, const void *buf, size_t len)
|
||||
{
|
||||
Eina_Slice slice = {
|
||||
.mem = buf,
|
||||
.len = len
|
||||
};
|
||||
Efl_Net_Ssl_Conn *conn = transp;
|
||||
Eina_Error err;
|
||||
|
||||
if ((!buf) || (len == 0)) return 0;
|
||||
if (!conn) return 0;
|
||||
|
||||
if (!efl_io_writer_can_write_get(conn->sock))
|
||||
{
|
||||
DBG("socket=%p would block if written!", conn->sock);
|
||||
gnutls_transport_set_errno(conn->session, EAGAIN);
|
||||
return -1;
|
||||
}
|
||||
|
||||
err = efl_io_writer_write(conn->sock, &slice, NULL);
|
||||
if (err)
|
||||
{
|
||||
gnutls_transport_set_errno(conn->session, err);
|
||||
return -1;
|
||||
}
|
||||
|
||||
gnutls_transport_set_errno(conn->session, 0);
|
||||
return slice.len;
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
_efl_net_ssl_conn_read(gnutls_transport_ptr_t transp, void *buf, size_t len)
|
||||
{
|
||||
Eina_Rw_Slice slice = {
|
||||
.mem = buf,
|
||||
.len = len
|
||||
};
|
||||
Efl_Net_Ssl_Conn *conn = transp;
|
||||
Eina_Error err;
|
||||
|
||||
if ((!buf) || (len == 0)) return 0;
|
||||
if (!conn) return 0;
|
||||
|
||||
if (!efl_io_reader_can_read_get(conn->sock))
|
||||
{
|
||||
DBG("socket=%p would block if read!", conn->sock);
|
||||
gnutls_transport_set_errno(conn->session, EAGAIN);
|
||||
return -1;
|
||||
}
|
||||
|
||||
err = efl_io_reader_read(conn->sock, &slice);
|
||||
if (err)
|
||||
{
|
||||
gnutls_transport_set_errno(conn->session, err);
|
||||
return -1;
|
||||
}
|
||||
|
||||
gnutls_transport_set_errno(conn->session, 0);
|
||||
return slice.len;
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
efl_net_ssl_conn_setup(Efl_Net_Ssl_Conn *conn, Eina_Bool is_dialer, Efl_Net_Socket *sock, Efl_Net_Ssl_Context *context)
|
||||
{
|
||||
gnutls_certificate_request_t req;
|
||||
int r;
|
||||
|
||||
EINA_SAFETY_ON_TRUE_RETURN_VAL(conn->session != NULL, EALREADY);
|
||||
|
||||
conn->is_dialer = is_dialer;
|
||||
|
||||
conn->session = efl_net_ssl_context_connection_new(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(conn->session, ENOSYS);
|
||||
|
||||
gnutls_handshake_set_private_extensions(conn->session, 1);
|
||||
|
||||
switch (conn->verify_mode)
|
||||
{
|
||||
case EFL_NET_SSL_VERIFY_MODE_NONE:
|
||||
req = GNUTLS_CERT_IGNORE;
|
||||
break;
|
||||
case EFL_NET_SSL_VERIFY_MODE_OPTIONAL:
|
||||
req = GNUTLS_CERT_REQUEST;
|
||||
break;
|
||||
case EFL_NET_SSL_VERIFY_MODE_REQUIRED:
|
||||
default:
|
||||
req = GNUTLS_CERT_REQUIRE;
|
||||
}
|
||||
gnutls_certificate_server_set_request(conn->session, req);
|
||||
|
||||
if (is_dialer)
|
||||
{
|
||||
r = gnutls_session_ticket_enable_client(conn->session);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_conn=%p could not enable session's ticket client: %s", conn, gnutls_strerror(r));
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
r = gnutls_session_ticket_key_generate(&conn->ticket);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_conn=%p could not generate session ticket: %s", conn, gnutls_strerror(r));
|
||||
goto error;
|
||||
}
|
||||
|
||||
r = gnutls_session_ticket_enable_server(conn->session, &conn->ticket);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_conn=%p could not enable session's ticket server: %s", conn, gnutls_strerror(r));
|
||||
goto error_ticket;
|
||||
}
|
||||
}
|
||||
|
||||
conn->sock = sock;
|
||||
gnutls_transport_set_ptr(conn->session, conn);
|
||||
gnutls_transport_set_push_function(conn->session, _efl_net_ssl_conn_write);
|
||||
gnutls_transport_set_pull_function(conn->session, _efl_net_ssl_conn_read);
|
||||
|
||||
return 0;
|
||||
|
||||
error_ticket:
|
||||
gnutls_free(conn->ticket.data);
|
||||
conn->ticket.data = NULL;
|
||||
|
||||
error:
|
||||
gnutls_deinit(conn->session);
|
||||
conn->session = NULL;
|
||||
return ENOSYS;
|
||||
}
|
||||
|
||||
static void
|
||||
efl_net_ssl_conn_teardown(Efl_Net_Ssl_Conn *conn)
|
||||
{
|
||||
if (conn->session)
|
||||
{
|
||||
gnutls_bye(conn->session, GNUTLS_SHUT_RDWR);
|
||||
gnutls_deinit(conn->session);
|
||||
conn->session = NULL;
|
||||
}
|
||||
|
||||
if (conn->ticket.data)
|
||||
{
|
||||
gnutls_free(conn->ticket.data);
|
||||
conn->ticket.data = NULL;
|
||||
}
|
||||
|
||||
eina_stringshare_replace(&conn->hostname, NULL);
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
efl_net_ssl_conn_write(Efl_Net_Ssl_Conn *conn, Eina_Slice *slice)
|
||||
{
|
||||
ssize_t r = gnutls_record_send(conn->session, slice->mem, slice->len);
|
||||
if (r < 0)
|
||||
{
|
||||
slice->len = 0;
|
||||
if (gnutls_error_is_fatal(r))
|
||||
{
|
||||
ERR("ssl_conn=%p could not send %zd bytes: %s", conn, slice->len, gnutls_strerror(r));
|
||||
return EINVAL;
|
||||
}
|
||||
DBG("ssl_conn=%p could not send %zd bytes: %s", conn, slice->len, gnutls_strerror(r));
|
||||
return EAGAIN;
|
||||
}
|
||||
slice->len = r;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
efl_net_ssl_conn_read(Efl_Net_Ssl_Conn *conn, Eina_Rw_Slice *slice)
|
||||
{
|
||||
ssize_t r = gnutls_record_recv(conn->session, slice->mem, slice->len);
|
||||
if (r < 0)
|
||||
{
|
||||
slice->len = 0;
|
||||
if (gnutls_error_is_fatal(r))
|
||||
{
|
||||
ERR("ssl_conn=%p could not receive %zd bytes: %s", conn, slice->len, gnutls_strerror(r));
|
||||
return EINVAL;
|
||||
}
|
||||
DBG("ssl_conn=%p could not receive %zd bytes: %s", conn, slice->len, gnutls_strerror(r));
|
||||
return EAGAIN;
|
||||
}
|
||||
slice->len = r;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
_efl_net_ssl_conn_verify(Efl_Net_Ssl_Conn *conn)
|
||||
{
|
||||
unsigned status = 0;
|
||||
int r;
|
||||
|
||||
r = gnutls_certificate_verify_peers2(conn->session, &status);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_conn=%p could not verify peer: %s", conn, gnutls_strerror(r));
|
||||
return EFL_NET_SOCKET_SSL_ERROR_HANDSHAKE;
|
||||
}
|
||||
|
||||
if (!status) return 0;
|
||||
|
||||
if (status & GNUTLS_CERT_INVALID)
|
||||
WRN("ssl_conn=%p The certificate is not trusted.", conn);
|
||||
if (status & GNUTLS_CERT_SIGNER_NOT_FOUND)
|
||||
WRN("ssl_conn=%p The certificate hasn't got a known issuer.", conn);
|
||||
if (status & GNUTLS_CERT_REVOKED)
|
||||
WRN("ssl_conn=%p The certificate has been revoked.", conn);
|
||||
if (status & GNUTLS_CERT_EXPIRED)
|
||||
WRN("ssl_conn=%p The certificate has expired", conn);
|
||||
if (status & GNUTLS_CERT_NOT_ACTIVATED)
|
||||
WRN("ssl_conn=%p The certificate is not yet activated", conn);
|
||||
|
||||
return EFL_NET_SOCKET_SSL_ERROR_CERTIFICATE_VERIFY_FAILED;
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
_efl_net_ssl_conn_hostname_verify(Efl_Net_Ssl_Conn *conn)
|
||||
{
|
||||
const gnutls_datum_t *list;
|
||||
unsigned int size;
|
||||
gnutls_x509_crt_t cert = NULL;
|
||||
int r;
|
||||
|
||||
if ((!conn->hostname) || (conn->hostname[0] == '\0'))
|
||||
{
|
||||
ERR("ssl_conn=%p no hostname, cannot verify", conn);
|
||||
return EFL_NET_SOCKET_SSL_ERROR_CERTIFICATE_VERIFY_FAILED;
|
||||
}
|
||||
|
||||
if (gnutls_certificate_type_get(conn->session) != GNUTLS_CRT_X509)
|
||||
{
|
||||
ERR("ssl_conn=%p PGP certificates are not yet supported!", conn);
|
||||
return EFL_NET_SOCKET_SSL_ERROR_CERTIFICATE_VERIFY_FAILED;
|
||||
}
|
||||
|
||||
list = gnutls_certificate_get_peers(conn->session, &size);
|
||||
if (!list)
|
||||
{
|
||||
ERR("ssl_conn=%p no peer certificate!", conn);
|
||||
return EFL_NET_SOCKET_SSL_ERROR_HANDSHAKE;
|
||||
}
|
||||
|
||||
r = gnutls_x509_crt_init(&cert);
|
||||
EINA_SAFETY_ON_TRUE_RETURN_VAL(r < 0, EFL_NET_SOCKET_SSL_ERROR_CERTIFICATE_VERIFY_FAILED);
|
||||
|
||||
r = gnutls_x509_crt_import(cert, &list[0], GNUTLS_X509_FMT_DER);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_conn=%p could not import x509 certificate to verify: %s", conn, gnutls_strerror(r));
|
||||
gnutls_x509_crt_deinit(cert);
|
||||
return EFL_NET_SOCKET_SSL_ERROR_CERTIFICATE_VERIFY_FAILED;
|
||||
}
|
||||
|
||||
r = gnutls_x509_crt_check_hostname(cert, conn->hostname);
|
||||
gnutls_x509_crt_deinit(cert);
|
||||
|
||||
if (r == 1)
|
||||
return 0;
|
||||
|
||||
ERR("ssl_conn=%p hostname='%s' doesn't match certificate.",
|
||||
conn, conn->hostname);
|
||||
return EFL_NET_SOCKET_SSL_ERROR_CERTIFICATE_VERIFY_FAILED;
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
efl_net_ssl_conn_handshake(Efl_Net_Ssl_Conn *conn, Eina_Bool *done)
|
||||
{
|
||||
int r = gnutls_handshake(conn->session);
|
||||
if (r < 0)
|
||||
{
|
||||
*done = EINA_FALSE;
|
||||
if (gnutls_error_is_fatal(r))
|
||||
{
|
||||
ERR("ssl_conn=%p could not handshake: %s", conn, gnutls_strerror(r));
|
||||
return EFL_NET_SOCKET_SSL_ERROR_HANDSHAKE;
|
||||
}
|
||||
|
||||
DBG("ssl_conn=%p did not finish handshake: %s", conn, gnutls_strerror(r));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (conn->verify_mode != EFL_NET_SSL_VERIFY_MODE_NONE)
|
||||
{
|
||||
Eina_Error err = _efl_net_ssl_conn_verify(conn);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (conn->hostname_verify)
|
||||
{
|
||||
Eina_Error err = _efl_net_ssl_conn_hostname_verify(conn);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
*done = EINA_TRUE;
|
||||
DBG("ssl_conn=%p handshake finished!", conn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
efl_net_ssl_conn_verify_mode_set(Efl_Net_Ssl_Conn *conn, Efl_Net_Ssl_Verify_Mode verify_mode)
|
||||
{
|
||||
gnutls_certificate_request_t req;
|
||||
conn->verify_mode = verify_mode;
|
||||
|
||||
switch (conn->verify_mode)
|
||||
{
|
||||
case EFL_NET_SSL_VERIFY_MODE_NONE:
|
||||
req = GNUTLS_CERT_IGNORE;
|
||||
break;
|
||||
case EFL_NET_SSL_VERIFY_MODE_OPTIONAL:
|
||||
req = GNUTLS_CERT_REQUEST;
|
||||
break;
|
||||
case EFL_NET_SSL_VERIFY_MODE_REQUIRED:
|
||||
default:
|
||||
req = GNUTLS_CERT_REQUIRE;
|
||||
}
|
||||
gnutls_certificate_server_set_request(conn->session, req);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
efl_net_ssl_conn_hostname_verify_set(Efl_Net_Ssl_Conn *conn, Eina_Bool hostname_verify)
|
||||
{
|
||||
conn->hostname_verify = hostname_verify;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
efl_net_ssl_conn_hostname_override_set(Efl_Net_Ssl_Conn *conn, const char *hostname)
|
||||
{
|
||||
int r;
|
||||
eina_stringshare_replace(&conn->hostname, hostname);
|
||||
if (!hostname) hostname = "";
|
||||
r = gnutls_server_name_set(conn->session, GNUTLS_NAME_DNS, hostname, strlen(hostname));
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_conn=%p could not set server name '%s': %s", conn, hostname, gnutls_strerror(r));
|
||||
return EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -27,7 +27,7 @@
|
|||
static int
|
||||
efl_net_socket_bio_create(BIO *b)
|
||||
{
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
#if (LIBRESSL_VERSION_NUMBER >= 0x3050000fL) || ((OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER))
|
||||
BIO_set_init(b, 1);
|
||||
BIO_set_data(b, NULL);
|
||||
BIO_set_flags(b, 0);
|
||||
|
@ -44,7 +44,7 @@ static int
|
|||
efl_net_socket_bio_destroy(BIO *b)
|
||||
{
|
||||
if (!b) return 0;
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
#if (LIBRESSL_VERSION_NUMBER >= 0x3050000fL) || ((OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER))
|
||||
BIO_set_init(b, 0);
|
||||
BIO_set_data(b, NULL);
|
||||
BIO_set_flags(b, 0);
|
||||
|
@ -63,7 +63,7 @@ efl_net_socket_bio_read(BIO *b, char *buf, int len)
|
|||
.mem = buf,
|
||||
.len = len
|
||||
};
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
#if (LIBRESSL_VERSION_NUMBER >= 0x3050000fL) || ((OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER))
|
||||
Eo *sock = BIO_get_data(b);
|
||||
#else
|
||||
Eo *sock = b->ptr;
|
||||
|
@ -99,7 +99,7 @@ efl_net_socket_bio_write(BIO *b, const char *buf, int len)
|
|||
.mem = buf,
|
||||
.len = len
|
||||
};
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
#if (LIBRESSL_VERSION_NUMBER >= 0x3050000fL) || ((OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER))
|
||||
Eo *sock = BIO_get_data(b);
|
||||
#else
|
||||
Eo *sock = b->ptr;
|
||||
|
@ -146,7 +146,7 @@ efl_net_socket_bio_puts(BIO *b, const char *str)
|
|||
static BIO_METHOD *
|
||||
__efl_net_socket_bio_get(void)
|
||||
{
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
#if (LIBRESSL_VERSION_NUMBER >= 0x3050000fL) || ((OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER))
|
||||
static BIO_METHOD *efl_net_socket_bio = NULL;
|
||||
|
||||
if (efl_net_socket_bio) return efl_net_socket_bio;
|
||||
|
@ -359,7 +359,7 @@ efl_net_ssl_conn_setup(Efl_Net_Ssl_Conn *conn, Eina_Bool is_dialer, Efl_Net_Sock
|
|||
conn->bio = BIO_new(__efl_net_socket_bio_get());
|
||||
EINA_SAFETY_ON_NULL_GOTO(conn->bio, error_bio);
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
#if (LIBRESSL_VERSION_NUMBER >= 0x3050000fL) || ((OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER))
|
||||
BIO_set_data(conn->bio, sock);
|
||||
#else
|
||||
conn->bio->ptr = sock;
|
||||
|
|
|
@ -81,11 +81,9 @@ static Eina_Error efl_net_ssl_ctx_hostname_verify_set(Efl_Net_Ssl_Ctx *ctx, Eina
|
|||
static Eina_Error efl_net_ssl_ctx_hostname_set(Efl_Net_Ssl_Ctx *ctx, const char *hostname);
|
||||
|
||||
#if HAVE_OPENSSL
|
||||
#include "efl_net_ssl_ctx-openssl.c"
|
||||
#elif HAVE_GNUTLS
|
||||
#include "efl_net_ssl_ctx-gnutls.c"
|
||||
# include "efl_net_ssl_ctx-openssl.c"
|
||||
#else
|
||||
#include "efl_net_ssl_ctx-none.c"
|
||||
# include "efl_net_ssl_ctx-none.c"
|
||||
#endif
|
||||
|
||||
#define MY_CLASS EFL_NET_SSL_CONTEXT_CLASS
|
||||
|
|
|
@ -1,307 +0,0 @@
|
|||
#include <gnutls/gnutls.h>
|
||||
|
||||
struct _Efl_Net_Ssl_Ctx {
|
||||
gnutls_certificate_credentials_t x509_cred;
|
||||
gnutls_priority_t priority;
|
||||
Eina_Bool is_dialer;
|
||||
};
|
||||
|
||||
static Eina_Error
|
||||
_efl_net_ssl_ctx_load_lists(Efl_Net_Ssl_Ctx *ctx, Efl_Net_Ssl_Ctx_Config cfg)
|
||||
{
|
||||
Eina_List *n, *n_next, *pk_node;
|
||||
const char *path;
|
||||
unsigned certificates_count = eina_list_count(*cfg.certificates);
|
||||
unsigned private_keys_count = eina_list_count(*cfg.private_keys);
|
||||
unsigned certificate_revocation_lists_count = eina_list_count(*cfg.certificate_revocation_lists);
|
||||
unsigned certificate_authorities_count = eina_list_count(*cfg.certificate_authorities);
|
||||
int r;
|
||||
|
||||
ctx->is_dialer = cfg.is_dialer;
|
||||
|
||||
if (cfg.load_defaults)
|
||||
{
|
||||
r = gnutls_certificate_set_x509_system_trust(ctx->x509_cred);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_ctx=%p could not load default paths: %s", ctx, gnutls_strerror(r));
|
||||
return ENOSYS;
|
||||
}
|
||||
DBG("ssl_ctx=%p loaded default paths", ctx);
|
||||
}
|
||||
else
|
||||
DBG("ssl_ctx=%p did not load default paths", ctx);
|
||||
|
||||
/* GNUTLS needs certificate-key pairs, so we do:
|
||||
*
|
||||
* - if no private keys, use certificate as its own key;
|
||||
*
|
||||
* - if a private keys, walk the list alongside certificates, but
|
||||
* do NOT delete elements if list sizes are different. Stop at
|
||||
* last private key, allowing a single private key for multiple
|
||||
* certificates.
|
||||
*/
|
||||
pk_node = *cfg.private_keys;
|
||||
EINA_LIST_FOREACH_SAFE(*cfg.certificates, n, n_next, path)
|
||||
{
|
||||
const char *key = pk_node ? pk_node->data : path;
|
||||
|
||||
r = gnutls_certificate_set_x509_key_file(ctx->x509_cred, path, key, GNUTLS_X509_FMT_PEM);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_ctx=%p could not use certificate from '%s' with key '%s': %s",
|
||||
ctx, path, key, gnutls_strerror(r));
|
||||
|
||||
if (pk_node)
|
||||
{
|
||||
if (eina_list_count(*cfg.private_keys) == eina_list_count(*cfg.certificates))
|
||||
{
|
||||
pk_node = pk_node->next;
|
||||
eina_stringshare_del(key);
|
||||
*cfg.private_keys = eina_list_remove_list(*cfg.private_keys, pk_node->prev);
|
||||
}
|
||||
else if (pk_node->next) pk_node = pk_node->next;
|
||||
}
|
||||
|
||||
eina_stringshare_del(path);
|
||||
*cfg.certificates = eina_list_remove_list(*cfg.certificates, n);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pk_node->next) pk_node = pk_node->next;
|
||||
}
|
||||
|
||||
DBG("ssl_ctx=%p loaded certificate '%s' with key '%s'", ctx, path, key);
|
||||
}
|
||||
if (certificates_count && !*cfg.certificates)
|
||||
{
|
||||
ERR("ssl_ctx=%p none of the required certificates were loaded!", ctx);
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
if (private_keys_count && !*cfg.private_keys)
|
||||
{
|
||||
ERR("ssl_ctx=%p none of the required private keys were loaded!", ctx);
|
||||
return EINVAL;
|
||||
}
|
||||
else if (pk_node != eina_list_last(*cfg.private_keys))
|
||||
{
|
||||
do
|
||||
{
|
||||
n = pk_node->next;
|
||||
path = n->data;
|
||||
ERR("ssl_ctx=%p extra private key is unused '%s'", ctx, path);
|
||||
eina_stringshare_del(path);
|
||||
*cfg.private_keys = eina_list_remove_list(*cfg.private_keys, n);
|
||||
}
|
||||
while (pk_node->next);
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH_SAFE(*cfg.certificate_revocation_lists, n, n_next, path)
|
||||
{
|
||||
r = gnutls_certificate_set_x509_crl_file(ctx->x509_cred, path, GNUTLS_X509_FMT_PEM);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_ctx=%p could not use certificate revocation lists from %s: %s",
|
||||
ctx, path, gnutls_strerror(r));
|
||||
eina_stringshare_del(path);
|
||||
*cfg.certificate_revocation_lists = eina_list_remove_list(*cfg.certificate_revocation_lists, n);
|
||||
continue;
|
||||
}
|
||||
|
||||
DBG("ssl_ctx=%p loaded certificate revocation lists '%s'", ctx, path);
|
||||
}
|
||||
if (certificate_revocation_lists_count && !*cfg.certificate_revocation_lists)
|
||||
{
|
||||
ERR("ssl_ctx=%p none of the required certificate revocation lists were loaded!", ctx);
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH_SAFE(*cfg.certificate_authorities, n, n_next, path)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
r = 0;
|
||||
if (stat(path, &st) != 0)
|
||||
{
|
||||
ERR("ssl_ctx=%p could not load certificate authorities from '%s': %s", ctx, path, eina_error_msg_get(errno));
|
||||
eina_stringshare_del(path);
|
||||
*cfg.certificate_authorities = eina_list_remove_list(*cfg.certificate_authorities, n);
|
||||
continue;
|
||||
}
|
||||
else if (S_ISDIR(st.st_mode))
|
||||
r = gnutls_certificate_set_x509_trust_dir(ctx->x509_cred, path, GNUTLS_X509_FMT_PEM);
|
||||
else
|
||||
r = gnutls_certificate_set_x509_trust_file(ctx->x509_cred, path, GNUTLS_X509_FMT_PEM);
|
||||
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_ctx=%p could not use certificate authorities from '%s': %s", ctx, path, gnutls_strerror(r));
|
||||
eina_stringshare_del(path);
|
||||
*cfg.certificate_authorities = eina_list_remove_list(*cfg.certificate_authorities, n);
|
||||
continue;
|
||||
}
|
||||
|
||||
DBG("ssl_ctx=%p loaded certificate authorities '%s'", ctx, path);
|
||||
}
|
||||
if (certificate_authorities_count && !*cfg.certificate_authorities)
|
||||
{
|
||||
ERR("ssl_ctx=%p none of the required certificate authorities were loaded!", ctx);
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void *
|
||||
efl_net_ssl_ctx_connection_new(Efl_Net_Ssl_Ctx *ctx)
|
||||
{
|
||||
gnutls_session_t session;
|
||||
int r;
|
||||
|
||||
r = gnutls_init(&session, ctx->is_dialer ? GNUTLS_CLIENT : GNUTLS_SERVER);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_ctx=%p could not create %s session: %s",
|
||||
ctx, ctx->is_dialer ? "dialer" : "server", gnutls_strerror(r));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!ctx->priority)
|
||||
{
|
||||
r = gnutls_set_default_priority(session);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_ctx=%p could not set default cipher priority: %s", ctx, gnutls_strerror(r));
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
r = gnutls_priority_set(session, ctx->priority);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_ctx=%p could not set cipher priority: %s", ctx, gnutls_strerror(r));
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
r = gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, ctx->x509_cred);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_ctx=%p could not set session credentials: %s", ctx, gnutls_strerror(r));
|
||||
goto error;
|
||||
}
|
||||
|
||||
return session;
|
||||
|
||||
error:
|
||||
gnutls_deinit(session);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
efl_net_ssl_ctx_setup(Efl_Net_Ssl_Ctx *ctx, Efl_Net_Ssl_Ctx_Config cfg)
|
||||
{
|
||||
Eina_Error err;
|
||||
const char *priority;
|
||||
int r;
|
||||
|
||||
EINA_SAFETY_ON_TRUE_RETURN_VAL(ctx->x509_cred != NULL, EALREADY);
|
||||
|
||||
switch (cfg.cipher)
|
||||
{
|
||||
case EFL_NET_SSL_CIPHER_AUTO:
|
||||
priority = NULL;
|
||||
break;
|
||||
case EFL_NET_SSL_CIPHER_TLSV1:
|
||||
priority = "NORMAL:%VERIFY_ALLOW_X509_V1_CA_CRT:!VERS-SSL3.0!VERS-TLS1.1:!VERS-TLS1.2";
|
||||
break;
|
||||
case EFL_NET_SSL_CIPHER_TLSV1_1:
|
||||
priority = "NORMAL:%VERIFY_ALLOW_X509_V1_CA_CRT:!VERS-SSL3.0:!VERS-TLS1.0:!VERS-TLS1.2";
|
||||
break;
|
||||
case EFL_NET_SSL_CIPHER_TLSV1_2:
|
||||
priority = "NORMAL:%VERIFY_ALLOW_X509_V1_CA_CRT:!VERS-SSL3.0:!VERS-TLS1.0:!VERS-TLS1.1";
|
||||
break;
|
||||
default:
|
||||
ERR("ssl_ctx=%p unsupported cipher %d", ctx, cfg.cipher);
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
if (priority)
|
||||
{
|
||||
const char *err_pos = NULL;
|
||||
r = gnutls_priority_init(&ctx->priority, priority, &err_pos);
|
||||
if (r < 0)
|
||||
{
|
||||
size_t off = err_pos - priority;
|
||||
if (r == GNUTLS_E_INVALID_REQUEST)
|
||||
{
|
||||
ERR("ssl_ctx=%p invalid syntax on GNUTLS priority string offset %zd: '%s'", ctx, off, priority);
|
||||
return EINVAL;
|
||||
}
|
||||
ERR("ssl_ctx=%p could not set GNUTLS priority offset %zd '%s': %s", ctx, off, priority, gnutls_strerror(r));
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
r = gnutls_certificate_allocate_credentials(&ctx->x509_cred);
|
||||
if (r < 0)
|
||||
{
|
||||
ERR("ssl_ctx=%p could not allocate X509 credentials: %s", ctx, gnutls_strerror(r));
|
||||
err = ENOSYS;
|
||||
goto err_cert_alloc;
|
||||
}
|
||||
|
||||
err = _efl_net_ssl_ctx_load_lists(ctx, cfg);
|
||||
if (err)
|
||||
{
|
||||
ERR("ssl_ctx=%p failed to load certificate, private keys, CRL or CA", ctx);
|
||||
goto err_load;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_load:
|
||||
gnutls_certificate_free_credentials(ctx->x509_cred);
|
||||
ctx->x509_cred = NULL;
|
||||
err_cert_alloc:
|
||||
gnutls_priority_deinit(ctx->priority);
|
||||
ctx->priority = NULL;
|
||||
return err;
|
||||
}
|
||||
|
||||
static void
|
||||
efl_net_ssl_ctx_teardown(Efl_Net_Ssl_Ctx *ctx)
|
||||
{
|
||||
if (ctx->x509_cred)
|
||||
{
|
||||
gnutls_certificate_free_credentials(ctx->x509_cred);
|
||||
ctx->x509_cred = NULL;
|
||||
}
|
||||
|
||||
if (ctx->priority)
|
||||
{
|
||||
gnutls_priority_deinit(ctx->priority);
|
||||
ctx->priority = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
efl_net_ssl_ctx_verify_mode_set(Efl_Net_Ssl_Ctx *ctx EINA_UNUSED, Efl_Net_Ssl_Verify_Mode verify_mode EINA_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
efl_net_ssl_ctx_hostname_verify_set(Efl_Net_Ssl_Ctx *ctx EINA_UNUSED, Eina_Bool hostname_verify EINA_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Eina_Error
|
||||
efl_net_ssl_ctx_hostname_set(Efl_Net_Ssl_Ctx *ctx EINA_UNUSED, const char *hostname EINA_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
|
@ -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),
|
||||
|
|
|
@ -14896,7 +14896,7 @@ _edje_generate_source_state_text(Edje *ed, Edje_Part_Description_Common *pd,
|
|||
source = (txt->text.id_source == -1) ? EINA_FALSE : EINA_TRUE;
|
||||
text_source = (txt->text.id_text_source == -1) ? EINA_FALSE : EINA_TRUE;
|
||||
ellipsis = EQ(txt->text.ellipsis, ZERO) ? EINA_FALSE : EINA_TRUE;
|
||||
style = (edje_string_id_get(&txt->text.style) == 0) ? EINA_FALSE : EINA_TRUE;
|
||||
style = (edje_string_id_get(&txt->text.style) == NULL) ? EINA_FALSE : EINA_TRUE;
|
||||
color_3 = ((txt->text.color3.r == 0) && (txt->text.color3.g == 0) &&
|
||||
(txt->text.color3.b == 0) && (txt->text.color3.a == 128)) ? EINA_FALSE : EINA_TRUE;
|
||||
}
|
||||
|
|
|
@ -14,20 +14,15 @@
|
|||
# else
|
||||
# include <sys/mman.h>
|
||||
# endif
|
||||
# ifdef HAVE_GNUTLS
|
||||
# include <gnutls/gnutls.h>
|
||||
# include <gnutls/x509.h>
|
||||
# else /* ifdef HAVE_GNUTLS */
|
||||
# include <openssl/rsa.h>
|
||||
# include <openssl/objects.h>
|
||||
# include <openssl/err.h>
|
||||
# include <openssl/ssl.h>
|
||||
# include <openssl/dh.h>
|
||||
# include <openssl/dsa.h>
|
||||
# include <openssl/evp.h>
|
||||
# include <openssl/x509.h>
|
||||
# include <openssl/pem.h>
|
||||
# endif /* ifdef HAVE_GNUTLS */
|
||||
# include <openssl/rsa.h>
|
||||
# include <openssl/objects.h>
|
||||
# include <openssl/err.h>
|
||||
# include <openssl/ssl.h>
|
||||
# include <openssl/dh.h>
|
||||
# include <openssl/dsa.h>
|
||||
# include <openssl/evp.h>
|
||||
# include <openssl/x509.h>
|
||||
# include <openssl/pem.h>
|
||||
#endif /* ifdef HAVE_SIGNATURE */
|
||||
|
||||
#ifdef HAVE_OPENSSL
|
||||
|
@ -35,15 +30,9 @@
|
|||
#endif /* ifdef HAVE_OPENSSL */
|
||||
|
||||
#ifdef HAVE_CIPHER
|
||||
# ifdef HAVE_GNUTLS
|
||||
# include <gnutls/abstract.h>
|
||||
# include <gnutls/x509.h>
|
||||
# include <gcrypt.h>
|
||||
# else /* ifdef HAVE_GNUTLS */
|
||||
# include <openssl/evp.h>
|
||||
# include <openssl/hmac.h>
|
||||
# include <openssl/rand.h>
|
||||
# endif /* ifdef HAVE_GNUTLS */
|
||||
# include <openssl/evp.h>
|
||||
# include <openssl/hmac.h>
|
||||
# include <openssl/rand.h>
|
||||
#endif /* ifdef HAVE_CIPHER */
|
||||
|
||||
#include <Emile.h>
|
||||
|
@ -51,25 +40,15 @@
|
|||
#include "Eet.h"
|
||||
#include "Eet_private.h"
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
# define MAX_KEY_LEN 32
|
||||
# define MAX_IV_LEN 16
|
||||
#else /* ifdef HAVE_GNUTLS */
|
||||
# define MAX_KEY_LEN EVP_MAX_KEY_LENGTH
|
||||
# define MAX_IV_LEN EVP_MAX_IV_LENGTH
|
||||
#endif /* ifdef HAVE_GNUTLS */
|
||||
#define MAX_KEY_LEN EVP_MAX_KEY_LENGTH
|
||||
#define MAX_IV_LEN EVP_MAX_IV_LENGTH
|
||||
|
||||
struct _Eet_Key
|
||||
{
|
||||
int references;
|
||||
#ifdef HAVE_SIGNATURE
|
||||
# ifdef HAVE_GNUTLS
|
||||
gnutls_x509_crt_t certificate;
|
||||
gnutls_x509_privkey_t private_key;
|
||||
# else /* ifdef HAVE_GNUTLS */
|
||||
X509 *certificate;
|
||||
EVP_PKEY *private_key;
|
||||
# endif /* ifdef HAVE_GNUTLS */
|
||||
#endif /* ifdef HAVE_SIGNATURE */
|
||||
};
|
||||
|
||||
|
@ -81,109 +60,6 @@ eet_identity_open(const char *certificate_file,
|
|||
#ifdef HAVE_SIGNATURE
|
||||
/* Signature declarations */
|
||||
Eet_Key *key = NULL;
|
||||
# ifdef HAVE_GNUTLS
|
||||
/* Gnutls private declarations */
|
||||
Eina_File *f = NULL;
|
||||
void *data = NULL;
|
||||
gnutls_datum_t load_file = { NULL, 0 };
|
||||
char pass[1024];
|
||||
|
||||
if (!emile_cipher_init()) return NULL;
|
||||
|
||||
/* Init */
|
||||
if (!(key = malloc(sizeof(Eet_Key))))
|
||||
goto on_error;
|
||||
|
||||
key->references = 1;
|
||||
|
||||
if (gnutls_x509_crt_init(&(key->certificate)))
|
||||
goto on_error;
|
||||
|
||||
if (gnutls_x509_privkey_init(&(key->private_key)))
|
||||
goto on_error;
|
||||
|
||||
/* Mmap certificate_file */
|
||||
f = eina_file_open(certificate_file, 0);
|
||||
if (!f)
|
||||
goto on_error;
|
||||
|
||||
/* let's make mmap safe and just get 0 pages for IO erro */
|
||||
eina_mmap_safety_enabled_set(EINA_TRUE);
|
||||
|
||||
data = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
|
||||
if (!data) goto on_error;
|
||||
|
||||
/* Import the certificate in Eet_Key structure */
|
||||
load_file.data = data;
|
||||
load_file.size = eina_file_size_get(f);
|
||||
if (gnutls_x509_crt_import(key->certificate, &load_file,
|
||||
GNUTLS_X509_FMT_PEM) < 0)
|
||||
goto on_error;
|
||||
|
||||
eina_file_map_free(f, data);
|
||||
|
||||
/* Reset values */
|
||||
eina_file_close(f);
|
||||
f = NULL;
|
||||
data = NULL;
|
||||
load_file.data = NULL;
|
||||
load_file.size = 0;
|
||||
|
||||
/* Mmap private_key_file */
|
||||
f = eina_file_open(private_key_file, 0);
|
||||
if (!f)
|
||||
goto on_error;
|
||||
|
||||
/* let's make mmap safe and just get 0 pages for IO erro */
|
||||
eina_mmap_safety_enabled_set(EINA_TRUE);
|
||||
|
||||
data = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
|
||||
if (!data)
|
||||
goto on_error;
|
||||
|
||||
/* Import the private key in Eet_Key structure */
|
||||
load_file.data = data;
|
||||
load_file.size = eina_file_size_get(f);
|
||||
/* Try to directly import the PEM encoded private key */
|
||||
if (gnutls_x509_privkey_import(key->private_key, &load_file,
|
||||
GNUTLS_X509_FMT_PEM) < 0)
|
||||
{
|
||||
/* Else ask for the private key pass */
|
||||
if (cb && cb(pass, 1024, 0, NULL))
|
||||
{
|
||||
/* If pass then try to decode the pkcs 8 private key */
|
||||
if (gnutls_x509_privkey_import_pkcs8(key->private_key, &load_file,
|
||||
GNUTLS_X509_FMT_PEM, pass, 0))
|
||||
goto on_error;
|
||||
}
|
||||
else
|
||||
/* Else try to import the pkcs 8 private key without pass */
|
||||
if (gnutls_x509_privkey_import_pkcs8(key->private_key, &load_file,
|
||||
GNUTLS_X509_FMT_PEM, NULL, 1))
|
||||
goto on_error;
|
||||
}
|
||||
|
||||
eina_file_map_free(f, data);
|
||||
eina_file_close(f);
|
||||
|
||||
return key;
|
||||
|
||||
on_error:
|
||||
if (data) eina_file_map_free(f, data);
|
||||
if (f) eina_file_close(f);
|
||||
|
||||
if (key)
|
||||
{
|
||||
if (key->certificate)
|
||||
gnutls_x509_crt_deinit(key->certificate);
|
||||
|
||||
if (key->private_key)
|
||||
gnutls_x509_privkey_deinit(key->private_key);
|
||||
|
||||
free(key);
|
||||
}
|
||||
|
||||
# else /* ifdef HAVE_GNUTLS */
|
||||
/* Openssl private declarations */
|
||||
EVP_PKEY *pkey = NULL;
|
||||
X509 *cert = NULL;
|
||||
|
@ -231,7 +107,6 @@ on_error:
|
|||
if (pkey)
|
||||
EVP_PKEY_free(pkey);
|
||||
|
||||
# endif /* ifdef HAVE_GNUTLS */
|
||||
#else
|
||||
(void) certificate_file;
|
||||
(void) private_key_file;
|
||||
|
@ -249,13 +124,8 @@ eet_identity_close(Eet_Key *key)
|
|||
if (!key || (key->references > 0))
|
||||
return;
|
||||
|
||||
# ifdef HAVE_GNUTLS
|
||||
gnutls_x509_crt_deinit(key->certificate);
|
||||
gnutls_x509_privkey_deinit(key->private_key);
|
||||
# else /* ifdef HAVE_GNUTLS */
|
||||
X509_free(key->certificate);
|
||||
EVP_PKEY_free(key->private_key);
|
||||
# endif /* ifdef HAVE_GNUTLS */
|
||||
free(key);
|
||||
# else
|
||||
(void)key;
|
||||
|
@ -267,92 +137,6 @@ eet_identity_print(Eet_Key *key,
|
|||
FILE *out)
|
||||
{
|
||||
#ifdef HAVE_SIGNATURE
|
||||
# ifdef HAVE_GNUTLS
|
||||
const char *names[6] = {
|
||||
"Modulus",
|
||||
"Public exponent",
|
||||
"Private exponent",
|
||||
"First prime",
|
||||
"Second prime",
|
||||
"Coefficient"
|
||||
};
|
||||
int err = 0;
|
||||
gnutls_datum_t data = { NULL, 0 };
|
||||
gnutls_datum_t rsa_raw[6];
|
||||
size_t size = 128;
|
||||
char *res = NULL;
|
||||
char buf[33];
|
||||
unsigned int i, j;
|
||||
|
||||
if (!key)
|
||||
return;
|
||||
|
||||
if (!emile_cipher_init()) return ;
|
||||
|
||||
if (key->private_key)
|
||||
{
|
||||
if (gnutls_x509_privkey_export_rsa_raw(key->private_key,
|
||||
rsa_raw + 0, /* Modulus */
|
||||
rsa_raw + 1, /* Public exponent */
|
||||
rsa_raw + 2, /* Private exponent */
|
||||
rsa_raw + 3, /* First prime */
|
||||
rsa_raw + 4, /* Second prime */
|
||||
rsa_raw + 5)) /* Coefficient */
|
||||
goto on_error;
|
||||
|
||||
if (!(res = malloc(size)))
|
||||
goto on_error;
|
||||
|
||||
fprintf(out, "Private Key:\n");
|
||||
buf[32] = '\0';
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
while ((err = gnutls_hex_encode(rsa_raw + i, res, &size)) ==
|
||||
GNUTLS_E_SHORT_MEMORY_BUFFER)
|
||||
{
|
||||
char *temp;
|
||||
|
||||
size += 128;
|
||||
if (!(temp = realloc(res, size)))
|
||||
goto on_error;
|
||||
res = temp;
|
||||
}
|
||||
if (err)
|
||||
goto on_error;
|
||||
|
||||
fprintf(out, "\t%s:\n", names[i]);
|
||||
for (j = 0; strlen(res) > j; j += 32)
|
||||
{
|
||||
snprintf(buf, 32, "%s", res + j);
|
||||
fprintf(out, "\t\t%s\n", buf);
|
||||
}
|
||||
}
|
||||
free(res);
|
||||
res = NULL;
|
||||
}
|
||||
|
||||
if (key->certificate)
|
||||
{
|
||||
fprintf(out, "Public certificate:\n");
|
||||
if (gnutls_x509_crt_print(key->certificate, GNUTLS_X509_CRT_FULL,
|
||||
&data))
|
||||
goto on_error;
|
||||
|
||||
fprintf(out, "%s\n", data.data);
|
||||
gnutls_free(data.data);
|
||||
data.data = NULL;
|
||||
}
|
||||
|
||||
on_error:
|
||||
if (res)
|
||||
free(res);
|
||||
|
||||
if (data.data)
|
||||
gnutls_free(data.data);
|
||||
|
||||
return;
|
||||
# else /* ifdef HAVE_GNUTLS */
|
||||
RSA *rsa;
|
||||
DSA *dsa;
|
||||
DH *dh;
|
||||
|
@ -385,7 +169,6 @@ on_error:
|
|||
|
||||
fprintf(out, "Public certificate:\n");
|
||||
X509_print_fp(out, key->certificate);
|
||||
# endif /* ifdef HAVE_GNUTLS */
|
||||
#else /* ifdef HAVE_SIGNATURE */
|
||||
key = NULL;
|
||||
out = NULL;
|
||||
|
@ -420,17 +203,6 @@ eet_identity_compute_sha1(const void *data_base,
|
|||
void *result;
|
||||
|
||||
#ifdef HAVE_SIGNATURE
|
||||
# ifdef HAVE_GNUTLS
|
||||
result = malloc(gcry_md_get_algo_dlen(GCRY_MD_SHA1));
|
||||
if (!result)
|
||||
return NULL;
|
||||
|
||||
gcry_md_hash_buffer(GCRY_MD_SHA1, result, data_base, data_length);
|
||||
if (sha1_length)
|
||||
*sha1_length = gcry_md_get_algo_dlen(GCRY_MD_SHA1);
|
||||
|
||||
# else /* ifdef HAVE_GNUTLS */
|
||||
# ifdef HAVE_OPENSSL
|
||||
result = malloc(SHA_DIGEST_LENGTH);
|
||||
if (!result)
|
||||
return NULL;
|
||||
|
@ -439,10 +211,6 @@ eet_identity_compute_sha1(const void *data_base,
|
|||
if (sha1_length)
|
||||
*sha1_length = SHA_DIGEST_LENGTH;
|
||||
|
||||
# else /* ifdef HAVE_OPENSSL */
|
||||
result = NULL;
|
||||
# endif /* ifdef HAVE_OPENSSL */
|
||||
# endif /* ifdef HAVE_GNUTLS */
|
||||
#else /* ifdef HAVE_SIGNATURE */
|
||||
data_base = NULL;
|
||||
data_length = 0;
|
||||
|
@ -465,21 +233,13 @@ eet_identity_sign(FILE *fp,
|
|||
int head[3];
|
||||
unsigned char *sign = NULL;
|
||||
unsigned char *cert = NULL;
|
||||
# ifdef HAVE_GNUTLS
|
||||
gnutls_datum_t datum = { NULL, 0 };
|
||||
size_t sign_len = 0;
|
||||
size_t cert_len = 0;
|
||||
gnutls_datum_t signum = { NULL, 0 };
|
||||
gnutls_privkey_t privkey;
|
||||
# else /* ifdef HAVE_GNUTLS */
|
||||
# if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
# if (LIBRESSL_VERSION_NUMBER >= 0x3050000fL) || ((OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER))
|
||||
EVP_MD_CTX *md_ctx;
|
||||
# else
|
||||
# else
|
||||
EVP_MD_CTX md_ctx;
|
||||
# endif
|
||||
# endif
|
||||
unsigned int sign_len = 0;
|
||||
int cert_len = 0;
|
||||
# endif /* ifdef HAVE_GNUTLS */
|
||||
|
||||
/* A few check and flush pending write. */
|
||||
if (!fp || !key || !key->certificate || !key->private_key)
|
||||
|
@ -503,56 +263,6 @@ eet_identity_sign(FILE *fp,
|
|||
if (data == MAP_FAILED)
|
||||
return EET_ERROR_MMAP_FAILED;
|
||||
|
||||
# ifdef HAVE_GNUTLS
|
||||
datum.data = data;
|
||||
datum.size = st_buf.st_size;
|
||||
|
||||
/* Get the signature length */
|
||||
if (gnutls_privkey_init(&privkey) < 0)
|
||||
{
|
||||
err = EET_ERROR_SIGNATURE_FAILED;
|
||||
goto on_error;
|
||||
}
|
||||
|
||||
if (gnutls_privkey_import_x509(privkey, key->private_key, 0) < 0)
|
||||
{
|
||||
err = EET_ERROR_SIGNATURE_FAILED;
|
||||
goto on_error;
|
||||
}
|
||||
|
||||
if (gnutls_privkey_sign_data(privkey, GNUTLS_DIG_SHA1, 0, &datum, &signum) < 0)
|
||||
{
|
||||
err = EET_ERROR_SIGNATURE_FAILED;
|
||||
goto on_error;
|
||||
}
|
||||
|
||||
sign = signum.data;
|
||||
sign_len = signum.size;
|
||||
|
||||
/* Get the certificate length */
|
||||
if (gnutls_x509_crt_export(key->certificate, GNUTLS_X509_FMT_DER, cert,
|
||||
&cert_len) &&
|
||||
!cert_len)
|
||||
{
|
||||
err = EET_ERROR_SIGNATURE_FAILED;
|
||||
goto on_error;
|
||||
}
|
||||
|
||||
/* Get the certificate */
|
||||
cert = malloc(cert_len);
|
||||
if (!cert ||
|
||||
gnutls_x509_crt_export(key->certificate, GNUTLS_X509_FMT_DER, cert,
|
||||
&cert_len))
|
||||
{
|
||||
if (!cert)
|
||||
err = EET_ERROR_OUT_OF_MEMORY;
|
||||
else
|
||||
err = EET_ERROR_SIGNATURE_FAILED;
|
||||
|
||||
goto on_error;
|
||||
}
|
||||
|
||||
# else /* ifdef HAVE_GNUTLS */
|
||||
sign_len = EVP_PKEY_size(key->private_key);
|
||||
sign = malloc(sign_len);
|
||||
if (!sign)
|
||||
|
@ -562,7 +272,7 @@ eet_identity_sign(FILE *fp,
|
|||
}
|
||||
|
||||
/* Do the signature. */
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
# if (LIBRESSL_VERSION_NUMBER >= 0x3050000fL) || ((OPENSSL_VERSION_NUMBER >= 0x10100000L) && (!defined(LIBRESSL_VERSION_NUMBER)))
|
||||
md_ctx = EVP_MD_CTX_new();
|
||||
if (!md_ctx)
|
||||
{
|
||||
|
@ -576,7 +286,7 @@ eet_identity_sign(FILE *fp,
|
|||
(unsigned int *)&sign_len,
|
||||
key->private_key);
|
||||
EVP_MD_CTX_free(md_ctx);
|
||||
#else
|
||||
# else
|
||||
EVP_SignInit(&md_ctx, EVP_sha1());
|
||||
EVP_SignUpdate(&md_ctx, data, st_buf.st_size);
|
||||
err = EVP_SignFinal(&md_ctx,
|
||||
|
@ -584,7 +294,7 @@ eet_identity_sign(FILE *fp,
|
|||
(unsigned int *)&sign_len,
|
||||
key->private_key);
|
||||
EVP_MD_CTX_cleanup(&md_ctx);
|
||||
#endif
|
||||
# endif
|
||||
if (err != 1)
|
||||
{
|
||||
ERR_print_errors_fp(stdout);
|
||||
|
@ -601,7 +311,6 @@ eet_identity_sign(FILE *fp,
|
|||
goto on_error;
|
||||
}
|
||||
|
||||
# endif /* ifdef HAVE_GNUTLS */
|
||||
/* Append the signature at the end of the file. */
|
||||
head[0] = (int)eina_htonl ((unsigned int)EET_MAGIC_SIGN);
|
||||
head[1] = (int)eina_htonl ((unsigned int)sign_len);
|
||||
|
@ -626,15 +335,6 @@ eet_identity_sign(FILE *fp,
|
|||
}
|
||||
|
||||
on_error:
|
||||
# ifdef HAVE_GNUTLS
|
||||
if (cert)
|
||||
free(cert);
|
||||
|
||||
# else /* ifdef HAVE_GNUTLS */
|
||||
if (cert)
|
||||
OPENSSL_free(cert);
|
||||
|
||||
# endif /* ifdef HAVE_GNUTLS */
|
||||
if (sign)
|
||||
free(sign);
|
||||
|
||||
|
@ -692,75 +392,14 @@ eet_identity_check(const void *data_base,
|
|||
sign = (unsigned char *)signature_base + sizeof(int) * 3;
|
||||
cert_der = sign + sign_len;
|
||||
|
||||
# ifdef HAVE_GNUTLS
|
||||
gnutls_x509_crt_t cert;
|
||||
gnutls_datum_t datum;
|
||||
gnutls_datum_t signature;
|
||||
gnutls_pubkey_t pubkey;
|
||||
unsigned char *hash;
|
||||
gcry_md_hd_t md;
|
||||
int err;
|
||||
|
||||
/* Create an understanding certificate structure for gnutls */
|
||||
datum.data = (void *)cert_der;
|
||||
datum.size = cert_len;
|
||||
gnutls_x509_crt_init(&cert);
|
||||
gnutls_x509_crt_import(cert, &datum, GNUTLS_X509_FMT_DER);
|
||||
|
||||
signature.data = (void *)sign;
|
||||
signature.size = sign_len;
|
||||
|
||||
/* Verify the signature */
|
||||
/*
|
||||
I am waiting for my patch being accepted in GnuTLS release.
|
||||
But we now have a way to prevent double computation of SHA1.
|
||||
*/
|
||||
err = gcry_md_open (&md, GCRY_MD_SHA1, 0);
|
||||
if (err < 0)
|
||||
return NULL;
|
||||
|
||||
gcry_md_write(md, data_base, data_length);
|
||||
|
||||
hash = gcry_md_read(md, GCRY_MD_SHA1);
|
||||
if (!hash)
|
||||
goto on_error;
|
||||
|
||||
datum.size = gcry_md_get_algo_dlen(GCRY_MD_SHA1);
|
||||
datum.data = hash;
|
||||
|
||||
if (gnutls_pubkey_init(&pubkey) < 0)
|
||||
goto on_error;
|
||||
|
||||
if (gnutls_pubkey_import_x509(pubkey, cert, 0) < 0)
|
||||
goto on_error;
|
||||
|
||||
if (gnutls_pubkey_verify_hash2(pubkey,
|
||||
gnutls_x509_crt_get_signature_algorithm(cert),
|
||||
0,
|
||||
&datum, &signature) < 0)
|
||||
goto on_error;
|
||||
|
||||
if (sha1)
|
||||
{
|
||||
*sha1 = malloc(datum.size);
|
||||
if (!*sha1) goto on_error;
|
||||
|
||||
memcpy(*sha1, hash, datum.size);
|
||||
*sha1_length = datum.size;
|
||||
}
|
||||
|
||||
gcry_md_close(md);
|
||||
gnutls_x509_crt_deinit(cert);
|
||||
|
||||
# else /* ifdef HAVE_GNUTLS */
|
||||
const unsigned char *tmp;
|
||||
EVP_PKEY *pkey;
|
||||
X509 *x509;
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
# if (LIBRESSL_VERSION_NUMBER >= 0x3050000fL) || ((OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER))
|
||||
EVP_MD_CTX *md_ctx;
|
||||
#else
|
||||
# else
|
||||
EVP_MD_CTX md_ctx;
|
||||
#endif
|
||||
# endif
|
||||
int err;
|
||||
|
||||
/* Strange but d2i_X509 seems to put 0 all over the place. */
|
||||
|
@ -779,7 +418,7 @@ eet_identity_check(const void *data_base,
|
|||
}
|
||||
|
||||
/* Verify the signature */
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
# if (LIBRESSL_VERSION_NUMBER >= 0x3050000fL) || ((OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER))
|
||||
md_ctx = EVP_MD_CTX_new();
|
||||
if (!md_ctx)
|
||||
{
|
||||
|
@ -795,12 +434,12 @@ eet_identity_check(const void *data_base,
|
|||
EVP_VerifyUpdate(md_ctx, data_base, data_length);
|
||||
err = EVP_VerifyFinal(md_ctx, sign, sign_len, pkey);
|
||||
EVP_MD_CTX_free(md_ctx);
|
||||
#else
|
||||
# else
|
||||
EVP_VerifyInit(&md_ctx, EVP_sha1());
|
||||
EVP_VerifyUpdate(&md_ctx, data_base, data_length);
|
||||
err = EVP_VerifyFinal(&md_ctx, sign, sign_len, pkey);
|
||||
EVP_MD_CTX_cleanup(&md_ctx);
|
||||
#endif
|
||||
# endif
|
||||
|
||||
X509_free(x509);
|
||||
EVP_PKEY_free(pkey);
|
||||
|
@ -814,7 +453,6 @@ eet_identity_check(const void *data_base,
|
|||
if (err != 1)
|
||||
return NULL;
|
||||
|
||||
# endif /* ifdef HAVE_GNUTLS */
|
||||
if (x509_length)
|
||||
*x509_length = cert_len;
|
||||
|
||||
|
@ -825,11 +463,6 @@ eet_identity_check(const void *data_base,
|
|||
*raw_signature_length = sign_len;
|
||||
|
||||
return cert_der;
|
||||
# ifdef HAVE_GNUTLS
|
||||
on_error:
|
||||
gcry_md_close(md);
|
||||
return NULL;
|
||||
# endif
|
||||
#else /* ifdef HAVE_SIGNATURE */
|
||||
data_base = NULL;
|
||||
data_length = 0;
|
||||
|
@ -858,34 +491,6 @@ eet_identity_certificate_print(const unsigned char *certificate,
|
|||
|
||||
if (!emile_cipher_init()) return ;
|
||||
|
||||
# ifdef HAVE_GNUTLS
|
||||
gnutls_datum_t datum;
|
||||
gnutls_x509_crt_t cert;
|
||||
|
||||
/* Create an understanding certificate structure for gnutls */
|
||||
datum.data = (void *)certificate;
|
||||
datum.size = der_length;
|
||||
if (gnutls_x509_crt_init(&cert))
|
||||
goto on_error;
|
||||
|
||||
if (gnutls_x509_crt_import(cert, &datum, GNUTLS_X509_FMT_DER))
|
||||
goto on_error;
|
||||
|
||||
/* Pretty print the certificate */
|
||||
datum.data = NULL;
|
||||
datum.size = 0;
|
||||
if (gnutls_x509_crt_print(cert, GNUTLS_X509_CRT_FULL, &datum))
|
||||
goto on_error;
|
||||
|
||||
INF("Public certificate :");
|
||||
INF("%s", datum.data);
|
||||
|
||||
on_error:
|
||||
if (datum.data)
|
||||
gnutls_free(datum.data);
|
||||
|
||||
gnutls_x509_crt_deinit(cert);
|
||||
# else /* ifdef HAVE_GNUTLS */
|
||||
const unsigned char *tmp;
|
||||
X509 *x509;
|
||||
|
||||
|
@ -903,7 +508,6 @@ on_error:
|
|||
X509_print_fp(out, x509);
|
||||
|
||||
X509_free(x509);
|
||||
# endif /* ifdef HAVE_GNUTLS */
|
||||
#else /* ifdef HAVE_SIGNATURE */
|
||||
certificate = NULL;
|
||||
der_length = 0;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -277,6 +277,7 @@ extern "C" {
|
|||
#include <eina_promise.h>
|
||||
#include <eina_vpath.h>
|
||||
#include <eina_abstract_content.h>
|
||||
#include <eina_sha.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -293,12 +293,14 @@ _signal_shutdown(void)
|
|||
}
|
||||
|
||||
static void
|
||||
_collect_bt(pthread_t pth)
|
||||
_collect_bt(Eina_Thread th)
|
||||
{
|
||||
// this async signals the thread to switch to the deebug signal handler
|
||||
// and collect a backtrace and other info from inside the thread
|
||||
#ifndef _WIN32
|
||||
pthread_kill(pth, SIG);
|
||||
pthread_kill((pthread_t)th, SIG); // we can cast Eina_Thread -> pthread_t
|
||||
#else
|
||||
(th); // silenmce unused warn
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -0,0 +1,122 @@
|
|||
/* EINA - EFL data type library
|
||||
* Copyright (C) 2023 Carsten Haitzler
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library;
|
||||
* if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "eina_private.h"
|
||||
#include "eina_sha.h"
|
||||
#include "eina_cpu.h"
|
||||
|
||||
/*============================================================================*
|
||||
* API *
|
||||
*============================================================================*/
|
||||
|
||||
|
||||
EINA_API void
|
||||
eina_sha1(const unsigned char *data, int size, unsigned char dst[20])
|
||||
{
|
||||
#define SHSH(n, v) ((((v) << (n)) & 0xffffffff) | ((v) >> (32 - (n))))
|
||||
unsigned int digest[5], word[80], wa, wb, wc, wd, we, t;
|
||||
unsigned char buf[64];
|
||||
const unsigned char *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 = eina_htonl(digest[0]); digest[0] = t;
|
||||
t = eina_htonl(digest[1]); digest[1] = t;
|
||||
t = eina_htonl(digest[2]); digest[2] = t;
|
||||
t = eina_htonl(digest[3]); digest[3] = t;
|
||||
t = eina_htonl(digest[4]); digest[4] = t;
|
||||
|
||||
memcpy(dst, digest, 5 * 4);
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/* EINA - EFL data type library
|
||||
* Copyright (C) 2023 Carsten Haitzler
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library;
|
||||
* if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EINA_SHA_H_
|
||||
#define EINA_SHA_H_
|
||||
|
||||
/**
|
||||
* @brief Calculate a SHA1 checksum of data
|
||||
*
|
||||
* This function calculates a SHA1 checksum of the binary data pointed to by
|
||||
* @p data of size @p size in bytes and will fill 20 bytes pointed to by
|
||||
* @p dst with the resulting 20 byte binary SHA1 sum.
|
||||
*
|
||||
* The input data should be a valid pointer to at least @p size bytes of data
|
||||
* that will be summed. @p dst should also point to a buffer of at least 20
|
||||
* bytes in size to store the checksum.
|
||||
*
|
||||
* @since 1.27
|
||||
*/
|
||||
EINA_API void eina_sha1(const unsigned char *data, int size, unsigned char dst[20]) EINA_ARG_NONNULL(1);
|
||||
|
||||
|
||||
#endif
|
|
@ -113,7 +113,8 @@ public_sub_headers = [
|
|||
'eina_freeq.h',
|
||||
'eina_slstr.h',
|
||||
'eina_vpath.h',
|
||||
'eina_abstract_content.h'
|
||||
'eina_abstract_content.h',
|
||||
'eina_sha.h'
|
||||
]
|
||||
|
||||
public_headers = [
|
||||
|
@ -197,6 +198,7 @@ eina_src = files([
|
|||
'eina_vpath.c',
|
||||
'eina_vpath_xdg.c',
|
||||
'eina_abstract_content.c',
|
||||
'eina_sha.c',
|
||||
]) + eina_mp_sources
|
||||
|
||||
if sys_windows == true
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -3556,9 +3556,6 @@ _entry_selection_callbacks_unregister(Evas_Object *obj)
|
|||
edje_object_signal_callback_del_full
|
||||
(sd->entry_edje, "selection,cleared", "elm.text",
|
||||
_entry_selection_cleared_signal_cb, obj);
|
||||
edje_object_signal_callback_del_full
|
||||
(sd->entry_edje, "entry,paste,request,*", "elm.text",
|
||||
_entry_paste_request_signal_cb, obj);
|
||||
edje_object_signal_callback_del_full
|
||||
(sd->entry_edje, "entry,copy,notify", "elm.text",
|
||||
_entry_copy_notify_signal_cb, obj);
|
||||
|
@ -3587,9 +3584,6 @@ _entry_selection_callbacks_register(Evas_Object *obj)
|
|||
edje_object_signal_callback_add
|
||||
(sd->entry_edje, "selection,cleared", "elm.text",
|
||||
_entry_selection_cleared_signal_cb, obj);
|
||||
edje_object_signal_callback_add
|
||||
(sd->entry_edje, "entry,paste,request,*", "elm.text",
|
||||
_entry_paste_request_signal_cb, obj);
|
||||
edje_object_signal_callback_add
|
||||
(sd->entry_edje, "entry,copy,notify", "elm.text",
|
||||
_entry_copy_notify_signal_cb, obj);
|
||||
|
@ -3920,6 +3914,10 @@ _elm_entry_efl_canvas_group_group_add(Eo *obj, Elm_Entry_Data *priv)
|
|||
(priv->entry_edje, "preedit,changed", "elm.text",
|
||||
_entry_preedit_changed_signal_cb, obj);
|
||||
|
||||
edje_object_signal_callback_add
|
||||
(priv->entry_edje, "entry,paste,request,*", "elm.text",
|
||||
_entry_paste_request_signal_cb, obj);
|
||||
|
||||
_entry_selection_callbacks_register(obj);
|
||||
|
||||
edje_object_signal_callback_add
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
@ -423,27 +404,37 @@ _internal_elm_icon_standard_set(Evas_Object *obj,
|
|||
Eina_Bool *fdo)
|
||||
{
|
||||
char *tmp;
|
||||
const char *stdtmp;
|
||||
Eina_Bool ret = EINA_FALSE;
|
||||
|
||||
ELM_ICON_DATA_GET(obj, sd);
|
||||
|
||||
/* try locating the icon using the specified theme */
|
||||
if (!strcmp(ELM_CONFIG_ICON_THEME_ELEMENTARY, elm_config_icon_theme_get()))
|
||||
stdtmp = sd->stdicon;
|
||||
sd->stdicon = NULL;
|
||||
ret = _icon_standard_set(obj, name);
|
||||
sd->stdicon = stdtmp;
|
||||
if (ret && fdo) *fdo = EINA_FALSE;
|
||||
if (!ret)
|
||||
{
|
||||
ret = _icon_standard_set(obj, name);
|
||||
if (ret && fdo) *fdo = EINA_FALSE;
|
||||
|
||||
if (!ret)
|
||||
/* try locating the icon using the specified theme */
|
||||
if (!strcmp(ELM_CONFIG_ICON_THEME_ELEMENTARY, elm_config_icon_theme_get()))
|
||||
{
|
||||
ret = _icon_freedesktop_set(obj, "hicolor", name, _icon_size_min_get(obj));
|
||||
ret = _icon_standard_set(obj, name);
|
||||
if (ret && fdo) *fdo = EINA_FALSE;
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
ret = _icon_freedesktop_set(obj, "hicolor", name, _icon_size_min_get(obj));
|
||||
if (ret && fdo) *fdo = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = _icon_freedesktop_set(obj, NULL, name, _icon_size_min_get(obj));
|
||||
if (ret && fdo) *fdo = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = _icon_freedesktop_set(obj, NULL, name, _icon_size_min_get(obj));
|
||||
if (ret && fdo) *fdo = EINA_TRUE;
|
||||
}
|
||||
|
||||
if (ret)
|
||||
{
|
||||
|
@ -452,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)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue