Merge branch 'master' of git://git.netsurf-browser.org/netsurf
Conflicts: atari/gui.h
This commit is contained in:
commit
a9ac9c00fc
|
@ -1,12 +1,12 @@
|
|||
##
|
||||
## ca-bundle.crt -- Bundle of CA Root Certificates
|
||||
##
|
||||
## Certificate data from Mozilla as of: Sat Dec 29 20:03:40 2012
|
||||
## Certificate data from Mozilla as of: Tue Jan 28 09:38:07 2014
|
||||
##
|
||||
## This is a bundle of X.509 certificates of public Certificate Authorities
|
||||
## (CA). These were automatically extracted from Mozilla's root certificates
|
||||
## file (certdata.txt). This file can be found in the mozilla source tree:
|
||||
## http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1
|
||||
## http://mxr.mozilla.org/mozilla-release/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1
|
||||
##
|
||||
## It contains the certificates in PEM format and therefore
|
||||
## can be directly used with curl / libcurl / php_curl, or with
|
||||
|
@ -14,7 +14,6 @@
|
|||
## Just configure this file as the SSLCACertificateFile.
|
||||
##
|
||||
|
||||
# @(#) $RCSfile: certdata.txt,v $ $Revision: 1.87 $ $Date: 2012/12/29 16:32:45 $
|
||||
|
||||
GTE CyberTrust Global Root
|
||||
==========================
|
||||
|
@ -91,46 +90,6 @@ BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95
|
|||
70+sB3c4
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
Digital Signature Trust Co. Global CA 1
|
||||
=======================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE
|
||||
ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMTAeFw05ODEy
|
||||
MTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs
|
||||
IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUA
|
||||
A4GLADCBhwKBgQCgbIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJE
|
||||
NySZj9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlVSn5JTe2i
|
||||
o74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo
|
||||
BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0
|
||||
dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw
|
||||
IoAPMTk5ODEyMTAxODEwMjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQY
|
||||
MBaAFGp5fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i+DAM
|
||||
BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB
|
||||
ACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lNQseSJqBcNJo4cvj9axY+IO6CizEq
|
||||
kzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4
|
||||
RbyhkwS7hp86W0N6w4pl
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
Digital Signature Trust Co. Global CA 3
|
||||
=======================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE
|
||||
ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMjAeFw05ODEy
|
||||
MDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs
|
||||
IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUA
|
||||
A4GLADCBhwKBgQC/k48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGOD
|
||||
VvsoLeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3oTQPMx7JS
|
||||
xhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo
|
||||
BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0
|
||||
dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw
|
||||
IoAPMTk5ODEyMDkxOTE3MjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQY
|
||||
MBaAFB6CTShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5WzAM
|
||||
BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB
|
||||
AEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHRxdf0CiUPPXiBng+xZ8SQTGPdXqfi
|
||||
up/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVLB3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1
|
||||
mPnHfxsb1gYgAlihw6ID
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
Verisign Class 3 Public Primary Certification Authority
|
||||
=======================================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
|
@ -344,11 +303,11 @@ n9cd2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=
|
|||
Entrust.net Premium 2048 Secure Server CA
|
||||
=========================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u
|
||||
MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u
|
||||
ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp
|
||||
bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV
|
||||
BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx
|
||||
NzUwNTFaFw0xOTEyMjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3
|
||||
NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3
|
||||
d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl
|
||||
MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u
|
||||
ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
|
||||
|
@ -356,14 +315,13 @@ MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL
|
|||
Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr
|
||||
hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW
|
||||
nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi
|
||||
VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo3QwcjARBglghkgBhvhC
|
||||
AQEEBAMCAAcwHwYDVR0jBBgwFoAUVeSB0RGAvtiJuQijMfmhJAkWuXAwHQYDVR0OBBYEFFXkgdER
|
||||
gL7YibkIozH5oSQJFrlwMB0GCSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0B
|
||||
AQUFAAOCAQEAWUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo
|
||||
oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQh7A6tcOdBTcS
|
||||
o8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18f3v/rxzP5tsHrV7bhZ3QKw0z
|
||||
2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfNB/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjX
|
||||
OP/swNlQ8C5LWK5Gb9Auw2DaclVyvUxFnmG6v4SBkgPR0ml8xQ==
|
||||
VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E
|
||||
BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ
|
||||
KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy
|
||||
T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf
|
||||
zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT
|
||||
J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e
|
||||
nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
Baltimore CyberTrust Root
|
||||
|
@ -421,26 +379,6 @@ lSE/9dR+WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN/Bf+
|
|||
KpYrtWKmpj29f5JZzVoqgrI3eQ==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
Equifax Secure eBusiness CA 2
|
||||
=============================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDIDCCAomgAwIBAgIEN3DPtTANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEXMBUGA1UE
|
||||
ChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0y
|
||||
MB4XDTk5MDYyMzEyMTQ0NVoXDTE5MDYyMzEyMTQ0NVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoT
|
||||
DkVxdWlmYXggU2VjdXJlMSYwJAYDVQQLEx1FcXVpZmF4IFNlY3VyZSBlQnVzaW5lc3MgQ0EtMjCB
|
||||
nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA5Dk5kx5SBhsoNviyoynF7Y6yEb3+6+e0dMKP/wXn
|
||||
2Z0GvxLIPw7y1tEkshHe0XMJitSxLJgJDR5QRrKDpkWNYmi7hRsgcDKqQM2mll/EcTc/BPO3QSQ5
|
||||
BxoeLmFYoBIL5aXfxavqN3HMHMg3OrmXUqesxWoklE6ce8/AatbfIb0CAwEAAaOCAQkwggEFMHAG
|
||||
A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORXF1aWZheCBTZWN1cmUx
|
||||
JjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0yMQ0wCwYDVQQDEwRDUkwxMBoG
|
||||
A1UdEAQTMBGBDzIwMTkwNjIzMTIxNDQ1WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUUJ4L6q9e
|
||||
uSBIplBqy/3YIHqngnYwHQYDVR0OBBYEFFCeC+qvXrkgSKZQasv92CB6p4J2MAwGA1UdEwQFMAMB
|
||||
Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAAyGgq3oThr1
|
||||
jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia
|
||||
78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUm
|
||||
V+GRMOrN
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
AddTrust Low-Value Services Root
|
||||
================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
|
@ -1405,29 +1343,6 @@ wUpgpZKpsaSgYMN4h7Mi8yrrW6ntBas3D7Hi05V2Y1Z0jFhyGzflZKG+TQyTmAyX9odtsz/ny4Cm
|
|||
VM+h4k0460tQtcsm9MracEpqoeJ5quGnM/b9Sh/22WA=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
Wells Fargo Root CA
|
||||
===================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID5TCCAs2gAwIBAgIEOeSXnjANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UEBhMCVVMxFDASBgNV
|
||||
BAoTC1dlbGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhv
|
||||
cml0eTEvMC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN
|
||||
MDAxMDExMTY0MTI4WhcNMjEwMTE0MTY0MTI4WjCBgjELMAkGA1UEBhMCVVMxFDASBgNVBAoTC1dl
|
||||
bGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEv
|
||||
MC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG
|
||||
SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVqDM7Jvk0/82bfuUER84A4n135zHCLielTWi5MbqNQ1mX
|
||||
x3Oqfz1cQJ4F5aHiidlMuD+b+Qy0yGIZLEWukR5zcUHESxP9cMIlrCL1dQu3U+SlK93OvRw6esP3
|
||||
E48mVJwWa2uv+9iWsWCaSOAlIiR5NM4OJgALTqv9i86C1y8IcGjBqAr5dE8Hq6T54oN+J3N0Prj5
|
||||
OEL8pahbSCOz6+MlsoCultQKnMJ4msZoGK43YjdeUXWoWGPAUe5AeH6orxqg4bB4nVCMe+ez/I4j
|
||||
sNtlAHCEAQgAFG5Uhpq6zPk3EPbg3oQtnaSFN9OH4xXQwReQfhkhahKpdv0SAulPIV4XAgMBAAGj
|
||||
YTBfMA8GA1UdEwEB/wQFMAMBAf8wTAYDVR0gBEUwQzBBBgtghkgBhvt7hwcBCzAyMDAGCCsGAQUF
|
||||
BwIBFiRodHRwOi8vd3d3LndlbGxzZmFyZ28uY29tL2NlcnRwb2xpY3kwDQYJKoZIhvcNAQEFBQAD
|
||||
ggEBANIn3ZwKdyu7IvICtUpKkfnRLb7kuxpo7w6kAOnu5+/u9vnldKTC2FJYxHT7zmu1Oyl5GFrv
|
||||
m+0fazbuSCUlFLZWohDo7qd/0D+j0MNdJu4HzMPBJCGHHt8qElNvQRbn7a6U+oxy+hNH8Dx+rn0R
|
||||
OhPs7fpvcmR7nX1/Jv16+yWt6j4pf0zjAFcysLPp7VMX2YuyFA4w6OXVE8Zkr8QA1dhYJPz1j+zx
|
||||
x32l2w8n0cbyQIjmH/ZhqPRCyLk306m+LFZ4wnKbWV01QIroTmMatukgalHizqSQ33ZwmVxwQ023
|
||||
tqcZZE6St8WRPH9IFmV7Fv3L/PvZ1dZPIWU7Sn9Ho/s=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
Swisscom Root CA 1
|
||||
==================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
|
@ -2803,29 +2718,6 @@ YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r
|
|||
kpeDMdmztcpHWD9f
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
TC TrustCenter Universal CA III
|
||||
===============================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID4TCCAsmgAwIBAgIOYyUAAQACFI0zFQLkbPQwDQYJKoZIhvcNAQEFBQAwezELMAkGA1UEBhMC
|
||||
REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy
|
||||
IFVuaXZlcnNhbCBDQTEoMCYGA1UEAxMfVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJSTAe
|
||||
Fw0wOTA5MDkwODE1MjdaFw0yOTEyMzEyMzU5NTlaMHsxCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNU
|
||||
QyBUcnVzdENlbnRlciBHbWJIMSQwIgYDVQQLExtUQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0Ex
|
||||
KDAmBgNVBAMTH1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQSBJSUkwggEiMA0GCSqGSIb3DQEB
|
||||
AQUAA4IBDwAwggEKAoIBAQDC2pxisLlxErALyBpXsq6DFJmzNEubkKLF5+cvAqBNLaT6hdqbJYUt
|
||||
QCggbergvbFIgyIpRJ9Og+41URNzdNW88jBmlFPAQDYvDIRlzg9uwliT6CwLOunBjvvya8o84pxO
|
||||
juT5fdMnnxvVZ3iHLX8LR7PH6MlIfK8vzArZQe+f/prhsq75U7Xl6UafYOPfjdN/+5Z+s7Vy+Eut
|
||||
CHnNaYlAJ/Uqwa1D7KRTyGG299J5KmcYdkhtWyUB0SbFt1dpIxVbYYqt8Bst2a9c8SaQaanVDED1
|
||||
M4BDj5yjdipFtK+/fz6HP3bFzSreIMUWWMv5G/UPyw0RUmS40nZid4PxWJ//AgMBAAGjYzBhMB8G
|
||||
A1UdIwQYMBaAFFbn4VslQ4Dg9ozhcbyO5YAvxEjiMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/
|
||||
BAQDAgEGMB0GA1UdDgQWBBRW5+FbJUOA4PaM4XG8juWAL8RI4jANBgkqhkiG9w0BAQUFAAOCAQEA
|
||||
g8ev6n9NCjw5sWi+e22JLumzCecYV42FmhfzdkJQEw/HkG8zrcVJYCtsSVgZ1OK+t7+rSbyUyKu+
|
||||
KGwWaODIl0YgoGhnYIg5IFHYaAERzqf2EQf27OysGh+yZm5WZ2B6dF7AbZc2rrUNXWZzwCUyRdhK
|
||||
BgePxLcHsU0GDeGl6/R1yrqc0L2z0zIkTO5+4nYES0lT2PLpVDP85XEfPRRclkvxOvIAu2y0+pZV
|
||||
CIgJwcyRGSmwIC3/yzikQOEXvnlhgP8HA4ZMTnsGnxGGjYnuJ8Tb4rwZjgvDwxPHLQNjO9Po5KIq
|
||||
woIIlBZU8O8fJ5AluA0OKBtHd0e9HKgl8ZS0Zg==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
Autoridad de Certificacion Firmaprofesional CIF A62634068
|
||||
=========================================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
|
@ -3552,3 +3444,342 @@ uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU
|
|||
3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM
|
||||
dcGWxZ0=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
TURKTRUST Certificate Services Provider Root 2007
|
||||
=================================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOcUktUUlVTVCBF
|
||||
bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP
|
||||
MA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg
|
||||
QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4X
|
||||
DTA3MTIyNTE4MzcxOVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxl
|
||||
a3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMCVFIxDzAN
|
||||
BgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp
|
||||
bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4gKGMpIEFyYWzEsWsgMjAwNzCCASIw
|
||||
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9N
|
||||
YvDdE3ePYakqtdTyuTFYKTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQv
|
||||
KUmi8wUG+7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveGHtya
|
||||
KhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6PIzdezKKqdfcYbwnT
|
||||
rqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M733WB2+Y8a+xwXrXgTW4qhe04MsC
|
||||
AwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHkYb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAP
|
||||
BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/s
|
||||
Px+EnWVUXKgWAkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I
|
||||
aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5mxRZNTZPz/OO
|
||||
Xl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsaXRik7r4EW5nVcV9VZWRi1aKb
|
||||
BFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZqxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAK
|
||||
poRq0Tl9
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
D-TRUST Root Class 3 CA 2 2009
|
||||
==============================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK
|
||||
DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe
|
||||
Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxE
|
||||
LVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIw
|
||||
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOAD
|
||||
ER03UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42tSHKXzlA
|
||||
BF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9RySPocq60vFYJfxLLHLGv
|
||||
KZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsMlFqVlNpQmvH/pStmMaTJOKDfHR+4CS7z
|
||||
p+hnUquVH+BGPtikw8paxTGA6Eian5Rp/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUC
|
||||
AwEAAaOCARowggEWMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ
|
||||
4PGEMA4GA1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVjdG9y
|
||||
eS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUyMENBJTIwMiUyMDIw
|
||||
MDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3QwQ6BBoD+G
|
||||
PWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3JsL2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAw
|
||||
OS5jcmwwDQYJKoZIhvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm
|
||||
2H6NMLVwMeniacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0
|
||||
o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV
|
||||
dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph
|
||||
X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
D-TRUST Root Class 3 CA 2 EV 2009
|
||||
=================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK
|
||||
DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw
|
||||
OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK
|
||||
DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw
|
||||
OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS
|
||||
egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh
|
||||
zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T
|
||||
7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60
|
||||
sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure35
|
||||
11H3a6UCAwEAAaOCASQwggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyv
|
||||
cop9NteaHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFwOi8v
|
||||
ZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xhc3MlMjAzJTIwQ0El
|
||||
MjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1ERT9jZXJ0aWZpY2F0ZXJldm9jYXRp
|
||||
b25saXN0MEagRKBChkBodHRwOi8vd3d3LmQtdHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xh
|
||||
c3NfM19jYV8yX2V2XzIwMDkuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+
|
||||
PPoeUSbrh/Yp3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05
|
||||
nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNFCSuGdXzfX2lX
|
||||
ANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7naxpeG0ILD5EJt/rDiZE4OJudA
|
||||
NCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqXKVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVv
|
||||
w9y4AyHqnxbxLFS1
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
PSCProcert
|
||||
==========
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIJhjCCB26gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCCAR4xPjA8BgNVBAMTNUF1dG9yaWRhZCBk
|
||||
ZSBDZXJ0aWZpY2FjaW9uIFJhaXogZGVsIEVzdGFkbyBWZW5lem9sYW5vMQswCQYDVQQGEwJWRTEQ
|
||||
MA4GA1UEBxMHQ2FyYWNhczEZMBcGA1UECBMQRGlzdHJpdG8gQ2FwaXRhbDE2MDQGA1UEChMtU2lz
|
||||
dGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMUMwQQYDVQQLEzpTdXBl
|
||||
cmludGVuZGVuY2lhIGRlIFNlcnZpY2lvcyBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMSUw
|
||||
IwYJKoZIhvcNAQkBFhZhY3JhaXpAc3VzY2VydGUuZ29iLnZlMB4XDTEwMTIyODE2NTEwMFoXDTIw
|
||||
MTIyNTIzNTk1OVowgdExJjAkBgkqhkiG9w0BCQEWF2NvbnRhY3RvQHByb2NlcnQubmV0LnZlMQ8w
|
||||
DQYDVQQHEwZDaGFjYW8xEDAOBgNVBAgTB01pcmFuZGExKjAoBgNVBAsTIVByb3ZlZWRvciBkZSBD
|
||||
ZXJ0aWZpY2Fkb3MgUFJPQ0VSVDE2MDQGA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZp
|
||||
Y2FjaW9uIEVsZWN0cm9uaWNhMQswCQYDVQQGEwJWRTETMBEGA1UEAxMKUFNDUHJvY2VydDCCAiIw
|
||||
DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANW39KOUM6FGqVVhSQ2oh3NekS1wwQYalNo97BVC
|
||||
wfWMrmoX8Yqt/ICV6oNEolt6Vc5Pp6XVurgfoCfAUFM+jbnADrgV3NZs+J74BCXfgI8Qhd19L3uA
|
||||
3VcAZCP4bsm+lU/hdezgfl6VzbHvvnpC2Mks0+saGiKLt38GieU89RLAu9MLmV+QfI4tL3czkkoh
|
||||
RqipCKzx9hEC2ZUWno0vluYC3XXCFCpa1sl9JcLB/KpnheLsvtF8PPqv1W7/U0HU9TI4seJfxPmO
|
||||
EO8GqQKJ/+MMbpfg353bIdD0PghpbNjU5Db4g7ayNo+c7zo3Fn2/omnXO1ty0K+qP1xmk6wKImG2
|
||||
0qCZyFSTXai20b1dCl53lKItwIKOvMoDKjSuc/HUtQy9vmebVOvh+qBa7Dh+PsHMosdEMXXqP+UH
|
||||
0quhJZb25uSgXTcYOWEAM11G1ADEtMo88aKjPvM6/2kwLkDd9p+cJsmWN63nOaK/6mnbVSKVUyqU
|
||||
td+tFjiBdWbjxywbk5yqjKPK2Ww8F22c3HxT4CAnQzb5EuE8XL1mv6JpIzi4mWCZDlZTOpx+FIyw
|
||||
Bm/xhnaQr/2v/pDGj59/i5IjnOcVdo/Vi5QTcmn7K2FjiO/mpF7moxdqWEfLcU8UC17IAggmosvp
|
||||
r2uKGcfLFFb14dq12fy/czja+eevbqQ34gcnAgMBAAGjggMXMIIDEzASBgNVHRMBAf8ECDAGAQH/
|
||||
AgEBMDcGA1UdEgQwMC6CD3N1c2NlcnRlLmdvYi52ZaAbBgVghl4CAqASDBBSSUYtRy0yMDAwNDAz
|
||||
Ni0wMB0GA1UdDgQWBBRBDxk4qpl/Qguk1yeYVKIXTC1RVDCCAVAGA1UdIwSCAUcwggFDgBStuyId
|
||||
xuDSAaj9dlBSk+2YwU2u06GCASakggEiMIIBHjE+MDwGA1UEAxM1QXV0b3JpZGFkIGRlIENlcnRp
|
||||
ZmljYWNpb24gUmFpeiBkZWwgRXN0YWRvIFZlbmV6b2xhbm8xCzAJBgNVBAYTAlZFMRAwDgYDVQQH
|
||||
EwdDYXJhY2FzMRkwFwYDVQQIExBEaXN0cml0byBDYXBpdGFsMTYwNAYDVQQKEy1TaXN0ZW1hIE5h
|
||||
Y2lvbmFsIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExQzBBBgNVBAsTOlN1cGVyaW50ZW5k
|
||||
ZW5jaWEgZGUgU2VydmljaW9zIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExJTAjBgkqhkiG
|
||||
9w0BCQEWFmFjcmFpekBzdXNjZXJ0ZS5nb2IudmWCAQowDgYDVR0PAQH/BAQDAgEGME0GA1UdEQRG
|
||||
MESCDnByb2NlcnQubmV0LnZloBUGBWCGXgIBoAwMClBTQy0wMDAwMDKgGwYFYIZeAgKgEgwQUklG
|
||||
LUotMzE2MzUzNzMtNzB2BgNVHR8EbzBtMEagRKBChkBodHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52
|
||||
ZS9sY3IvQ0VSVElGSUNBRE8tUkFJWi1TSEEzODRDUkxERVIuY3JsMCOgIaAfhh1sZGFwOi8vYWNy
|
||||
YWl6LnN1c2NlcnRlLmdvYi52ZTA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9v
|
||||
Y3NwLnN1c2NlcnRlLmdvYi52ZTBBBgNVHSAEOjA4MDYGBmCGXgMBAjAsMCoGCCsGAQUFBwIBFh5o
|
||||
dHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcNAQELBQADggIBACtZ6yKZu4Sq
|
||||
T96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmN
|
||||
g7+mvTV+LFwxNG9s2/NkAZiqlCxB3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4q
|
||||
uxtxj7mkoP3YldmvWb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1
|
||||
n8GhHVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHmpHmJWhSn
|
||||
FFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXzsOfIt+FTvZLm8wyWuevo
|
||||
5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bEqCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq
|
||||
3TNWOByyrYDT13K9mmyZY+gAu0F2BbdbmRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5
|
||||
poLWccret9W6aAjtmcz9opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3Y
|
||||
eMLEYC/HYvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
China Internet Network Information Center EV Certificates Root
|
||||
==============================================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCQ04xMjAwBgNV
|
||||
BAoMKUNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyMUcwRQYDVQQDDD5D
|
||||
aGluYSBJbnRlcm5ldCBOZXR3b3JrIEluZm9ybWF0aW9uIENlbnRlciBFViBDZXJ0aWZpY2F0ZXMg
|
||||
Um9vdDAeFw0xMDA4MzEwNzExMjVaFw0zMDA4MzEwNzExMjVaMIGKMQswCQYDVQQGEwJDTjEyMDAG
|
||||
A1UECgwpQ2hpbmEgSW50ZXJuZXQgTmV0d29yayBJbmZvcm1hdGlvbiBDZW50ZXIxRzBFBgNVBAMM
|
||||
PkNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyIEVWIENlcnRpZmljYXRl
|
||||
cyBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm35z7r07eKpkQ0H1UN+U8i6y
|
||||
jUqORlTSIRLIOTJCBumD1Z9S7eVnAztUwYyZmczpwA//DdmEEbK40ctb3B75aDFk4Zv6dOtouSCV
|
||||
98YPjUesWgbdYavi7NifFy2cyjw1l1VxzUOFsUcW9SxTgHbP0wBkvUCZ3czY28Sf1hNfQYOL+Q2H
|
||||
klY0bBoQCxfVWhyXWIQ8hBouXJE0bhlffxdpxWXvayHG1VA6v2G5BY3vbzQ6sm8UY78WO5upKv23
|
||||
KzhmBsUs4qpnHkWnjQRmQvaPK++IIGmPMowUc9orhpFjIpryp9vOiYurXccUwVswah+xt54ugQEC
|
||||
7c+WXmPbqOY4twIDAQABo2MwYTAfBgNVHSMEGDAWgBR8cks5x8DbYqVPm6oYNJKiyoOCWTAPBgNV
|
||||
HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUfHJLOcfA22KlT5uqGDSSosqD
|
||||
glkwDQYJKoZIhvcNAQEFBQADggEBACrDx0M3j92tpLIM7twUbY8opJhJywyA6vPtI2Z1fcXTIWd5
|
||||
0XPFtQO3WKwMVC/GVhMPMdoG52U7HW8228gd+f2ABsqjPWYWqJ1MFn3AlUa1UeTiH9fqBk1jjZaM
|
||||
7+czV0I664zBechNdn3e9rG3geCg+aF4RhcaVpjwTj2rHO3sOdwHSPdj/gauwqRcalsyiMXHM4Ws
|
||||
ZkJHwlgkmeHlPuV1LI5D1l08eB6olYIpUNHRFrrvwb562bTYzB5MRuF3sTGrvSrIzo9uoV1/A3U0
|
||||
5K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATywy39FCqQmbkHzJ8=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
Swisscom Root CA 2
|
||||
==================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIF2TCCA8GgAwIBAgIQHp4o6Ejy5e/DfEoeWhhntjANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQG
|
||||
EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy
|
||||
dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMjAeFw0xMTA2MjQwODM4MTRaFw0zMTA2
|
||||
MjUwNzM4MTRaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln
|
||||
aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAyMIIC
|
||||
IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlUJOhJ1R5tMJ6HJaI2nbeHCOFvErjw0DzpPM
|
||||
LgAIe6szjPTpQOYXTKueuEcUMncy3SgM3hhLX3af+Dk7/E6J2HzFZ++r0rk0X2s682Q2zsKwzxNo
|
||||
ysjL67XiPS4h3+os1OD5cJZM/2pYmLcX5BtS5X4HAB1f2uY+lQS3aYg5oUFgJWFLlTloYhyxCwWJ
|
||||
wDaCFCE/rtuh/bxvHGCGtlOUSbkrRsVPACu/obvLP+DHVxxX6NZp+MEkUp2IVd3Chy50I9AU/SpH
|
||||
Wrumnf2U5NGKpV+GY3aFy6//SSj8gO1MedK75MDvAe5QQQg1I3ArqRa0jG6F6bYRzzHdUyYb3y1a
|
||||
SgJA/MTAtukxGggo5WDDH8SQjhBiYEQN7Aq+VRhxLKX0srwVYv8c474d2h5Xszx+zYIdkeNL6yxS
|
||||
NLCK/RJOlrDrcH+eOfdmQrGrrFLadkBXeyq96G4DsguAhYidDMfCd7Camlf0uPoTXGiTOmekl9Ab
|
||||
mbeGMktg2M7v0Ax/lZ9vh0+Hio5fCHyqW/xavqGRn1V9TrALacywlKinh/LTSlDcX3KwFnUey7QY
|
||||
Ypqwpzmqm59m2I2mbJYV4+by+PGDYmy7Velhk6M99bFXi08jsJvllGov34zflVEpYKELKeRcVVi3
|
||||
qPyZ7iVNTA6z00yPhOgpD/0QVAKFyPnlw4vP5w8CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw
|
||||
HQYDVR0hBBYwFDASBgdghXQBUwIBBgdghXQBUwIBMBIGA1UdEwEB/wQIMAYBAf8CAQcwHQYDVR0O
|
||||
BBYEFE0mICKJS9PVpAqhb97iEoHF8TwuMB8GA1UdIwQYMBaAFE0mICKJS9PVpAqhb97iEoHF8Twu
|
||||
MA0GCSqGSIb3DQEBCwUAA4ICAQAyCrKkG8t9voJXiblqf/P0wS4RfbgZPnm3qKhyN2abGu2sEzsO
|
||||
v2LwnN+ee6FTSA5BesogpxcbtnjsQJHzQq0Qw1zv/2BZf82Fo4s9SBwlAjxnffUy6S8w5X2lejjQ
|
||||
82YqZh6NM4OKb3xuqFp1mrjX2lhIREeoTPpMSQpKwhI3qEAMw8jh0FcNlzKVxzqfl9NX+Ave5XLz
|
||||
o9v/tdhZsnPdTSpxsrpJ9csc1fV5yJmz/MFMdOO0vSk3FQQoHt5FRnDsr7p4DooqzgB53MBfGWcs
|
||||
a0vvaGgLQ+OswWIJ76bdZWGgr4RVSJFSHMYlkSrQwSIjYVmvRRGFHQEkNI/Ps/8XciATwoCqISxx
|
||||
OQ7Qj1zB09GOInJGTB2Wrk9xseEFKZZZ9LuedT3PDTcNYtsmjGOpI99nBjx8Oto0QuFmtEYE3saW
|
||||
mA9LSHokMnWRn6z3aOkquVVlzl1h0ydw2Df+n7mvoC5Wt6NlUe07qxS/TFED6F+KBZvuim6c779o
|
||||
+sjaC+NCydAXFJy3SuCvkychVSa1ZC+N8f+mQAWFBVzKBxlcCxMoTFh/wqXvRdpg065lYZ1Tg3TC
|
||||
rvJcwhbtkj6EPnNgiLx29CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX
|
||||
5OfNeOI5wSsSnqaeG8XmDtkx2Q==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
Swisscom Root EV CA 2
|
||||
=====================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAwZzELMAkGA1UE
|
||||
BhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdpdGFsIENlcnRpZmljYXRlIFNl
|
||||
cnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcN
|
||||
MzEwNjI1MDg0NTA4WjBnMQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsT
|
||||
HERpZ2l0YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYg
|
||||
Q0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7BxUglgRCgz
|
||||
o3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD1ycfMQ4jFrclyxy0uYAy
|
||||
Xhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPHoCE2G3pXKSinLr9xJZDzRINpUKTk4Rti
|
||||
GZQJo/PDvO/0vezbE53PnUgJUmfANykRHvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8Li
|
||||
qG12W0OfvrSdsyaGOx9/5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaH
|
||||
Za0zKcQvidm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHLOdAG
|
||||
alNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8qyIL5XctcfaCNYGu+HuB5ur+rPQa
|
||||
m3Rc6I8k9l2dRsQs0h4rIWqDJ2dVSqTjyDKXZpBy2uPUZC5f46Fq9mDU5zXNysRojddxyNMkM3Ox
|
||||
bPlq4SjbX8Y96L5V5jcb7STZDxmPX2MYWFCBUWVv8p9+agTnNCRxunZLWB4ZvRVgRaoMEkABnRDi
|
||||
xzgHcgplwLa7JSnaFp6LNYth7eVxV4O1PHGf40+/fh6Bn0GXAgMBAAGjgYYwgYMwDgYDVR0PAQH/
|
||||
BAQDAgGGMB0GA1UdIQQWMBQwEgYHYIV0AVMCAgYHYIV0AVMCAjASBgNVHRMBAf8ECDAGAQH/AgED
|
||||
MB0GA1UdDgQWBBRF2aWBbj2ITY1x0kbBbkUe88SAnTAfBgNVHSMEGDAWgBRF2aWBbj2ITY1x0kbB
|
||||
bkUe88SAnTANBgkqhkiG9w0BAQsFAAOCAgEAlDpzBp9SSzBc1P6xXCX5145v9Ydkn+0UjrgEjihL
|
||||
j6p7jjm02Vj2e6E1CqGdivdj5eu9OYLU43otb98TPLr+flaYC/NUn81ETm484T4VvwYmneTwkLbU
|
||||
wp4wLh/vx3rEUMfqe9pQy3omywC0Wqu1kx+AiYQElY2NfwmTv9SoqORjbdlk5LgpWgi/UOGED1V7
|
||||
XwgiG/W9mR4U9s70WBCCswo9GcG/W6uqmdjyMb3lOGbcWAXH7WMaLgqXfIeTK7KK4/HsGOV1timH
|
||||
59yLGn602MnTihdsfSlEvoqq9X46Lmgxk7lq2prg2+kupYTNHAq4Sgj5nPFhJpiTt3tm7JFe3VE/
|
||||
23MPrQRYCd0EApUKPtN236YQHoA96M2kZNEzx5LH4k5E4wnJTsJdhw4Snr8PyQUQ3nqjsTzyP6Wq
|
||||
J3mtMX0f/fwZacXduT98zca0wjAefm6S139hdlqP65VNvBFuIXxZN5nQBrz5Bm0yFqXZaajh3DyA
|
||||
HmBR3NdUIR7KYndP+tiPsys6DXhyyWhBWkdKwqPrGtcKqzwyVcgKEZzfdNbwQBUdyLmPtTbFr/gi
|
||||
uMod89a2GQ+fYWVq6nTIfI/DT11lgh/ZDYnadXL77/FHZxOzyNEZiCcmmpl5fx7kLD977vHeTYuW
|
||||
l8PVP3wbI+2ksx0WckNLIOFZfsLorSa/ovc=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
CA Disig Root R1
|
||||
================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFaTCCA1GgAwIBAgIJAMMDmu5QkG4oMA0GCSqGSIb3DQEBBQUAMFIxCzAJBgNVBAYTAlNLMRMw
|
||||
EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp
|
||||
ZyBSb290IFIxMB4XDTEyMDcxOTA5MDY1NloXDTQyMDcxOTA5MDY1NlowUjELMAkGA1UEBhMCU0sx
|
||||
EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp
|
||||
c2lnIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCqw3j33Jijp1pedxiy
|
||||
3QRkD2P9m5YJgNXoqqXinCaUOuiZc4yd39ffg/N4T0Dhf9Kn0uXKE5Pn7cZ3Xza1lK/oOI7bm+V8
|
||||
u8yN63Vz4STN5qctGS7Y1oprFOsIYgrY3LMATcMjfF9DCCMyEtztDK3AfQ+lekLZWnDZv6fXARz2
|
||||
m6uOt0qGeKAeVjGu74IKgEH3G8muqzIm1Cxr7X1r5OJeIgpFy4QxTaz+29FHuvlglzmxZcfe+5nk
|
||||
CiKxLU3lSCZpq+Kq8/v8kiky6bM+TR8noc2OuRf7JT7JbvN32g0S9l3HuzYQ1VTW8+DiR0jm3hTa
|
||||
YVKvJrT1cU/J19IG32PK/yHoWQbgCNWEFVP3Q+V8xaCJmGtzxmjOZd69fwX3se72V6FglcXM6pM6
|
||||
vpmumwKjrckWtc7dXpl4fho5frLABaTAgqWjR56M6ly2vGfb5ipN0gTco65F97yLnByn1tUD3AjL
|
||||
LhbKXEAz6GfDLuemROoRRRw1ZS0eRWEkG4IupZ0zXWX4Qfkuy5Q/H6MMMSRE7cderVC6xkGbrPAX
|
||||
ZcD4XW9boAo0PO7X6oifmPmvTiT6l7Jkdtqr9O3jw2Dv1fkCyC2fg69naQanMVXVz0tv/wQFx1is
|
||||
XxYb5dKj6zHbHzMVTdDypVP1y+E9Tmgt2BLdqvLmTZtJ5cUoobqwWsagtQIDAQABo0IwQDAPBgNV
|
||||
HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ
|
||||
04IwDQYJKoZIhvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR
|
||||
xVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaASfX8MPWbTx9B
|
||||
LxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXoHqJPYNcHKfyyo6SdbhWSVhlM
|
||||
CrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpBemOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5Gfb
|
||||
VSUZP/3oNn6z4eGBrxEWi1CXYBmCAMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85
|
||||
YmLLW1AL14FABZyb7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKS
|
||||
ds+xDzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvkF7mGnjix
|
||||
lAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqFa3qdnom2piiZk4hA9z7N
|
||||
UaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsTQ6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJ
|
||||
a7+h89n07eLw4+1knj0vllJPgFOL
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
CA Disig Root R2
|
||||
================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNVBAYTAlNLMRMw
|
||||
EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp
|
||||
ZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQyMDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sx
|
||||
EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp
|
||||
c2lnIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbC
|
||||
w3OeNcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNHPWSb6Wia
|
||||
xswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3Ix2ymrdMxp7zo5eFm1tL7
|
||||
A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbeQTg06ov80egEFGEtQX6sx3dOy1FU+16S
|
||||
GBsEWmjGycT6txOgmLcRK7fWV8x8nhfRyyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqV
|
||||
g8NTEQxzHQuyRpDRQjrOQG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa
|
||||
5Beny912H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJQfYE
|
||||
koopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUDi/ZnWejBBhG93c+A
|
||||
Ak9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORsnLMOPReisjQS1n6yqEm70XooQL6i
|
||||
Fh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNV
|
||||
HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5u
|
||||
Qu0wDQYJKoZIhvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM
|
||||
tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqfGopTpti72TVV
|
||||
sRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkblvdhuDvEK7Z4bLQjb/D907Je
|
||||
dR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W8
|
||||
1k/BfDxujRNt+3vrMNDcTa/F1balTFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjx
|
||||
mHHEt38OFdAlab0inSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01
|
||||
utI3gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18DrG5gPcFw0
|
||||
sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3OszMOl6W8KjptlwlCFtaOg
|
||||
UxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8xL4ysEr3vQCj8KWefshNPZiTEUxnpHikV
|
||||
7+ZtsH8tZ/3zbBt1RqPlShfppNcL
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
ACCVRAIZ1
|
||||
=========
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UEAwwJQUNDVlJB
|
||||
SVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQswCQYDVQQGEwJFUzAeFw0xMTA1
|
||||
MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQBgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwH
|
||||
UEtJQUNDVjENMAsGA1UECgwEQUNDVjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4IC
|
||||
DwAwggIKAoICAQCbqau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gM
|
||||
jmoYHtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWoG2ioPej0
|
||||
RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpAlHPrzg5XPAOBOp0KoVdD
|
||||
aaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhrIA8wKFSVf+DuzgpmndFALW4ir50awQUZ
|
||||
0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDG
|
||||
WuzndN9wrqODJerWx5eHk6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs7
|
||||
8yM2x/474KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMOm3WR
|
||||
5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpacXpkatcnYGMN285J
|
||||
9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPluUsXQA+xtrn13k/c4LOsOxFwYIRK
|
||||
Q26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYIKwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRw
|
||||
Oi8vd3d3LmFjY3YuZXMvZmlsZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEu
|
||||
Y3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2
|
||||
VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeTVfZW6oHlNsyM
|
||||
Hj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIGCCsGAQUFBwICMIIBFB6CARAA
|
||||
QQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUAcgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBh
|
||||
AO0AegAgAGQAZQAgAGwAYQAgAEEAQwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUA
|
||||
YwBuAG8AbABvAGcA7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBj
|
||||
AHQAcgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAAQwBQAFMA
|
||||
IABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUAczAwBggrBgEFBQcCARYk
|
||||
aHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2MuaHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0
|
||||
dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRtaW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2
|
||||
MV9kZXIuY3JsMA4GA1UdDwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZI
|
||||
hvcNAQEFBQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdpD70E
|
||||
R9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gUJyCpZET/LtZ1qmxN
|
||||
YEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+mAM/EKXMRNt6GGT6d7hmKG9Ww7Y49
|
||||
nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepDvV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJ
|
||||
TS+xJlsndQAJxGJ3KQhfnlmstn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3
|
||||
sCPdK6jT2iWH7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h
|
||||
I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szAh1xA2syVP1Xg
|
||||
Nce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xFd3+YJ5oyXSrjhO7FmGYvliAd
|
||||
3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2HpPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3p
|
||||
EfbRD0tVNEYqi4Y7
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
TWCA Global Root CA
|
||||
===================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcxEjAQBgNVBAoT
|
||||
CVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMTVFdDQSBHbG9iYWwgUm9vdCBD
|
||||
QTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQK
|
||||
EwlUQUlXQU4tQ0ExEDAOBgNVBAsTB1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3Qg
|
||||
Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2C
|
||||
nJfF10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz0ALfUPZV
|
||||
r2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfChMBwqoJimFb3u/Rk28OKR
|
||||
Q4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbHzIh1HrtsBv+baz4X7GGqcXzGHaL3SekV
|
||||
tTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1W
|
||||
KKD+u4ZqyPpcC1jcxkt2yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99
|
||||
sy2sbZCilaLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYPoA/p
|
||||
yJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQABDzfuBSO6N+pjWxn
|
||||
kjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcEqYSjMq+u7msXi7Kx/mzhkIyIqJdI
|
||||
zshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC
|
||||
AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g
|
||||
cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn
|
||||
LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M
|
||||
8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg
|
||||
/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg
|
||||
lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP
|
||||
A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m
|
||||
i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8
|
||||
EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3
|
||||
zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0=
|
||||
-----END CERTIFICATE-----
|
||||
|
|
|
@ -158,12 +158,6 @@ version.</p>
|
|||
<span><a href="#mit">MIT</a></span>
|
||||
</dd>
|
||||
|
||||
<dt><a href="http://www.libmng.com">libmng</a></dt>
|
||||
<dd>
|
||||
<span>© 2000–2007 Gerard Juyn, Glenn Randers-Pehrson</span>
|
||||
<span><a href="#mng">MNG</a></span>
|
||||
</dd>
|
||||
|
||||
<dt><a href="http://ro-oslib.sourceforge.net/">OSLib</a></dt>
|
||||
<dd>
|
||||
<span>© 1994–1998 Jonathan Coxhead and contributors</span>
|
||||
|
@ -642,34 +636,6 @@ ltmain.sh). Another support script, install-sh, is copyright by X Consortium
|
|||
but is also freely distributable.
|
||||
</div>
|
||||
|
||||
<a name="mng" />
|
||||
<h3>MNG Licence</h3>
|
||||
<div class="licence">The MNG Library is supplied "AS IS". The Contributing Authors
|
||||
disclaim all warranties, expressed or implied, including, without
|
||||
limitation, the warranties of merchantability and of fitness for any
|
||||
purpose. The Contributing Authors assume no liability for direct,
|
||||
indirect, incidental, special, exemplary, or consequential damages,
|
||||
which may result from the use of the MNG Library, even if advised of
|
||||
the possibility of such damage.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
source code, or portions hereof, for any purpose, without fee, subject
|
||||
to the following restrictions:
|
||||
|
||||
1. The origin of this source code must not be misrepresented;
|
||||
you must not claim that you wrote the original software.
|
||||
|
||||
2. Altered versions must be plainly marked as such and must not be
|
||||
misrepresented as being the original source.
|
||||
|
||||
3. This Copyright notice may not be removed or altered from any source
|
||||
or altered source distribution.
|
||||
|
||||
The Contributing Authors specifically permit, without fee, and
|
||||
encourage the use of this source code as a component to supporting
|
||||
the MNG and JNG file format in commercial products. If you use this
|
||||
source code in a product, acknowledgment would be highly appreciated.
|
||||
</div>
|
||||
|
||||
<a name="oslib" />
|
||||
<h3>OSLib Licence</h3>
|
||||
|
|
|
@ -150,13 +150,7 @@ dl.components > dd > span + span {
|
|||
<span><a href="#mit">MIT</a></span>
|
||||
</dd>
|
||||
|
||||
<dt><a href="http://www.libmng.com">libmng</a></dt>
|
||||
<dd>
|
||||
<span>© 2000–2007 Gerard Juyn, Glenn Randers-Pehrson</span>
|
||||
<span><a href="#mng">MNG</a></span>
|
||||
</dd>
|
||||
|
||||
<dt><a href="http://ro-oslib.sourceforge.net/">OSLib</a></dt>
|
||||
q<dt><a href="http://ro-oslib.sourceforge.net/">OSLib</a></dt>
|
||||
<dd>
|
||||
<span>© 1994–1998 Jonathan Coxhead and contributors</span>
|
||||
<span><a href="#oslib">OSLib</a></span>
|
||||
|
@ -631,35 +625,6 @@ ltmain.sh). Another support script, install-sh, is copyright by X Consortium
|
|||
but is also freely distributable.
|
||||
</div>
|
||||
|
||||
<a name="mng" />
|
||||
<h3>Licenza MNG</h3>
|
||||
<div class="licence">The MNG Library is supplied "AS IS". The Contributing Authors
|
||||
disclaim all warranties, expressed or implied, including, without
|
||||
limitation, the warranties of merchantability and of fitness for any
|
||||
purpose. The Contributing Authors assume no liability for direct,
|
||||
indirect, incidental, special, exemplary, or consequential damages,
|
||||
which may result from the use of the MNG Library, even if advised of
|
||||
the possibility of such damage.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
source code, or portions hereof, for any purpose, without fee, subject
|
||||
to the following restrictions:
|
||||
|
||||
1. The origin of this source code must not be misrepresented;
|
||||
you must not claim that you wrote the original software.
|
||||
|
||||
2. Altered versions must be plainly marked as such and must not be
|
||||
misrepresented as being the original source.
|
||||
|
||||
3. This Copyright notice may not be removed or altered from any source
|
||||
or altered source distribution.
|
||||
|
||||
The Contributing Authors specifically permit, without fee, and
|
||||
encourage the use of this source code as a component to supporting
|
||||
the MNG and JNG file format in commercial products. If you use this
|
||||
source code in a product, acknowledgment would be highly appreciated.
|
||||
</div>
|
||||
|
||||
<a name="oslib" />
|
||||
<h3>Licenza OSLib</h3>
|
||||
<div class="licence">The copyright holder has granted a small relaxation of the
|
||||
|
|
|
@ -16,7 +16,6 @@ test/nsoption
|
|||
test/nsurl
|
||||
test/urldbtest
|
||||
test/llcache
|
||||
utils/testament.h
|
||||
codedocs
|
||||
nsgtk
|
||||
nsfb
|
||||
|
|
|
@ -70,10 +70,6 @@ openssl
|
|||
|
||||
libpng
|
||||
|
||||
libmng
|
||||
http://www.aminet.net/dev/lib/libmng_so.lha
|
||||
http://www.aminet.net/dev/lib/libmng.lha
|
||||
|
||||
liblcms
|
||||
http://www.aminet.net/dev/lib/liblcms_so.lha
|
||||
http://www.aminet.net/dev/lib/liblcms_so.lha
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--------------------------------------------------------------------------------
|
||||
Build Instructions for AmigaOS NetSurf 13 February 2010
|
||||
Build Instructions for AmigaOS NetSurf 02 May 2014
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
This document provides instructions for building the AmigaOS version of
|
||||
|
@ -59,19 +59,9 @@
|
|||
To build and install these libraries, simply enter each of their directories
|
||||
and run:
|
||||
|
||||
1> gmake install
|
||||
1> gmake PREFIX=/path/to/buildsystem
|
||||
|
||||
| Note: We advise enabling iconv() support in libparserutils, which vastly
|
||||
| increases the number of supported character sets. To do this,
|
||||
| create a file called Makefile.config.override in the libparserutils
|
||||
| directory, containing the following lines:
|
||||
|
|
||||
| CFLAGS += -DWITH_ICONV_FILTER
|
||||
| LDFLAGS += -liconv
|
||||
|
|
||||
| This requires libiconv as iconv support in newlib.library is buggy.
|
||||
|
|
||||
| For more information, consult the libparserutils README file.
|
||||
The path MUST be in UNIX format and point to directory containing "share".
|
||||
|
||||
| Note: Building libsvgtiny requires gperf, which is available from Aminet:
|
||||
|
|
||||
|
@ -83,21 +73,17 @@
|
|||
|
||||
A version of libcurl built for newlib is available from Aminet
|
||||
|
||||
http://www.aminet.net/package/dev/lib/libcurl
|
||||
|
||||
There is a shared object version included with some OWB releases. To use
|
||||
this when compiling with Cairo support, a link must be made:
|
||||
|
||||
1> makelink sdk:local/newlib/lib/libcurl.so sobjs:libcurl-7.16.so soft
|
||||
http://www.os4depot.net/share/development/library/misc/libcurl.lha
|
||||
|
||||
|
||||
libmng
|
||||
|
||||
libpng
|
||||
--------
|
||||
|
||||
NetSurf uses libMNG to display MNG and PNG files.
|
||||
It builds without any problems on OS4, or available from Aminet:
|
||||
NetSurf uses libPNG to display PNG files.
|
||||
It builds without any problems on OS4, or available from OS4Depot:
|
||||
|
||||
http://www.aminet.net/package/dev/lib/libmng_so
|
||||
http://www.os4depot.net/share/development/library/graphics/libpng.lha
|
||||
|
||||
|
||||
OpenSSL
|
||||
|
@ -107,12 +93,6 @@
|
|||
|
||||
http://www.os4depot.net/share/development/library/misc/libopenssl.lha
|
||||
|
||||
There is a shared object version included with some OWB releases. To use
|
||||
this when compiling with Cairo support, a link must be made:
|
||||
|
||||
1> makelink sdk:local/newlib/lib/libssl.so sobjs:libssl-0.9.8.so soft
|
||||
1> makelink sdk:local/newlib/lib/libcrypto.so sobjs:libssl-0.9.8.so soft
|
||||
|
||||
|
||||
Libharu
|
||||
---------
|
||||
|
@ -141,19 +121,9 @@
|
|||
http://www.aminet.net/package/comm/www/OpenURL-OS4
|
||||
|
||||
|
||||
General requirements
|
||||
----------------------
|
||||
Spidermonkey
|
||||
--------------
|
||||
|
||||
SDK:newlib/include/strings.h needs to be modified by adding the following:
|
||||
Experimental Javascript support requires Spidermonkey. The patches to
|
||||
build v1.7 are available from the NetSurf toolchains Git repository.
|
||||
|
||||
extern int strcasecmp(const char *, const char *);
|
||||
extern int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
amiga/version.c is generated by version.rexx using the SVN command. If
|
||||
the source has not been checked out from SVN, or is being cross-compiled,
|
||||
this file will need to be created by hand. See the end of version.rexx
|
||||
for the variables that are defined in the file.
|
||||
|
||||
Please note that building with Cairo (option NETSURF_AMIGA_USE_CAIRO) will
|
||||
link NetSurf against shared objects, and require the OS4.1 SDK to build and
|
||||
AmigaOS 4.1 to run.
|
||||
|
|
|
@ -89,10 +89,10 @@
|
|||
TODO
|
||||
|
||||
|
||||
libmng
|
||||
libpng
|
||||
--------
|
||||
|
||||
NetSurf uses libMNG to display MNG and PNG files.
|
||||
NetSurf uses libPNG to display PNG files.
|
||||
It should build just fine on BeOS.
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--------------------------------------------------------------------------------
|
||||
Build Instructions for Framebuffer NetSurf 13 February 2010
|
||||
Build Instructions for Framebuffer NetSurf 16 March 2014
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
This document provides instructions for building the Framebuffer version of
|
||||
|
@ -7,8 +7,153 @@
|
|||
|
||||
Framebuffer NetSurf has been tested on Ubuntu and Debian.
|
||||
|
||||
Depending on the framebuffer frontend selected the build may need specific
|
||||
libraries installed, e.g. the SDL port requires SDL1.2 or later
|
||||
|
||||
There are two ways to get NetSurf building. The QUICK-START (recommended),
|
||||
and the manual build. Whichever you choose, you should read both the
|
||||
"Fonts", and "Selecting a frontend and appropriate options" sections below.
|
||||
|
||||
|
||||
Quick Start
|
||||
=============
|
||||
|
||||
See the QUICK-START document, which provides a simple environment with
|
||||
which you can fetch, build and install NetSurf and its dependencies.
|
||||
|
||||
The QUICK-START is the recommended way to build NetSurf.
|
||||
|
||||
|
||||
Manual building
|
||||
=================
|
||||
|
||||
If you can't follow the quick start instructions, you will have to build
|
||||
NetSurf manually. The instructions for doing this are given below.
|
||||
|
||||
|
||||
Obtaining the build dependencies
|
||||
----------------------------------
|
||||
|
||||
Many of NetSurf's dependencies are packaged on various operating systems.
|
||||
The remainder must be installed manually. Currently, some of the libraries
|
||||
developed as part of the NetSurf project have not had official releases.
|
||||
Hopefully they will soon be released with downloadable tarballs and packaged
|
||||
in common distros. For now, you'll have to make do with Git checkouts.
|
||||
|
||||
Package installation
|
||||
--------------------
|
||||
|
||||
Debian-like OS:
|
||||
|
||||
$ apt-get install libcurl3-dev libpng-dev
|
||||
|
||||
Recent OS versions might need libcurl4-dev instead of libcurl3-dev but
|
||||
note that when it has not been built with OpenSSL, the SSL_CTX is not
|
||||
available and results that certification details won't be presented in case
|
||||
they are invalid. But as this is currently unimplemented in the Framebuffer
|
||||
flavour of NetSurf, this won't make a difference at all.
|
||||
|
||||
Fedora:
|
||||
|
||||
$ yum install curl-devel libpng-devel lcms-devel
|
||||
|
||||
Other:
|
||||
|
||||
You'll need to install the development resources for libcurl3 and libpng.
|
||||
|
||||
|
||||
Preparing your workspace
|
||||
--------------------------
|
||||
|
||||
NetSurf has a number of libraries which must be built in-order and
|
||||
installed into your workspace. Each library depends on a core build
|
||||
system which NetSurf projects use. This build system relies on the
|
||||
presence of things like pkg-config to find libraries and also certain
|
||||
environment variables in order to work correctly.
|
||||
|
||||
Assuming you are preparing a workspace in /home/netsurf/workspace then
|
||||
the following steps will set you up:
|
||||
|
||||
Make the workspace directory and change to it
|
||||
---------------------------------------------
|
||||
|
||||
$ mkdir -p ${HOME}/netsurf/workspace
|
||||
$ cd ${HOME}/netsurf/workspace
|
||||
|
||||
Make the temporary install space
|
||||
--------------------------------
|
||||
|
||||
$ mkdir inst
|
||||
|
||||
Make an environment script
|
||||
--------------------------
|
||||
$ cat > env.sh <<'EOF'
|
||||
export PKG_CONFIG_PATH=${HOME}/netsurf/workspace/inst/lib/pkgconfig::
|
||||
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/netsurf/workspace/inst/lib
|
||||
export PREFIX=${HOME}/netsurf/workspace/inst
|
||||
EOF
|
||||
|
||||
Change to workspace and source the environment
|
||||
----------------------------------------------
|
||||
|
||||
Whenever you wish to start development in a new shell, run the following:
|
||||
|
||||
$ cd ${HOME}/netsurf/workspace
|
||||
$ source env.sh
|
||||
|
||||
From here on, any commands in this document assume you have sourced your
|
||||
shell environment.
|
||||
|
||||
|
||||
The NetSurf project's libraries
|
||||
---------------------------------
|
||||
|
||||
The NetSurf project has developed several libraries which are required by
|
||||
the browser. These are:
|
||||
|
||||
BuildSystem -- Shared build system, needed to build the other libraries
|
||||
LibParserUtils -- Parser building utility functions
|
||||
LibWapcaplet -- String internment
|
||||
Hubbub -- HTML5 compliant HTML parser
|
||||
LibCSS -- CSS parser and selection engine
|
||||
LibNSGIF -- GIF format image decoder
|
||||
LibNSBMP -- BMP and ICO format image decoder
|
||||
LibROSprite -- RISC OS Sprite format image decoder
|
||||
LibNSFB -- Framebuffer abstraction
|
||||
|
||||
To fetch each of these libraries, run the appropriate commands from the
|
||||
Docs/LIBRARIES file.
|
||||
|
||||
To build and install these libraries, simply enter each of their directories
|
||||
and run:
|
||||
|
||||
$ make install
|
||||
|
||||
| Note: We advise enabling iconv() support in libparserutils, which vastly
|
||||
| increases the number of supported character sets. To do this,
|
||||
| create a file called Makefile.config.override in the libparserutils
|
||||
| directory, containing the following line:
|
||||
|
|
||||
| CFLAGS += -DWITH_ICONV_FILTER
|
||||
|
|
||||
| For more information, consult the libparserutils README file.
|
||||
|
||||
|
||||
Getting the NetSurf source
|
||||
----------------------------
|
||||
|
||||
From your workspace directory, run the following command to get the NetSurf
|
||||
source:
|
||||
|
||||
$ git clone git://git.netsurf-browser.org/netsurf.git
|
||||
|
||||
And change to the 'netsurf' directory:
|
||||
|
||||
$ cd netsurf
|
||||
|
||||
|
||||
Building and executing NetSurf
|
||||
================================
|
||||
--------------------------------
|
||||
|
||||
First of all, you should examine the contents of Makefile.defaults
|
||||
and enable and disable relevant features as you see fit in a
|
||||
|
@ -203,79 +348,3 @@ Index: framebuffer/font_freetype.c
|
|||
The documentation of libnsfb should be consulted for futher
|
||||
information about supported frontends and their configuration.
|
||||
|
||||
|
||||
Obtaining NetSurf's build dependencies
|
||||
========================================
|
||||
|
||||
Many of NetSurf's dependencies are packaged on various operating systems.
|
||||
The remainder must be installed manually. Currently, some of the libraries
|
||||
developed as part of the NetSurf project have not had official releases.
|
||||
Hopefully they will soon be released with downloadable tarballs and packaged
|
||||
in common distros. For now, you'll have to make do with Git checkouts.
|
||||
|
||||
Package installation
|
||||
----------------------
|
||||
|
||||
Debian-like OS:
|
||||
|
||||
$ apt-get install libcurl3-dev libmng-dev
|
||||
|
||||
Recent OS versions might need libcurl4-dev instead of libcurl3-dev but
|
||||
note that when it has not been built with OpenSSL, the SSL_CTX is not
|
||||
available and results that certification details won't be presented in case
|
||||
they are invalid. But as this is currently unimplemented in the Framebuffer
|
||||
flavour of NetSurf, this won't make a difference at all.
|
||||
|
||||
Fedora:
|
||||
|
||||
$ yum install curl-devel libmng-devel lcms-devel
|
||||
|
||||
Other:
|
||||
|
||||
You'll need to install the development resources for libcurl3 and libmng.
|
||||
|
||||
Note that if you don't require MNG or JNG image support, NetSurf can be
|
||||
configured to use libpng instead of libmng. If you wish to do this, install
|
||||
the libpng development package instead.
|
||||
|
||||
The NetSurf project's libraries
|
||||
---------------------------------
|
||||
|
||||
The NetSurf project has developed several libraries which are required by
|
||||
the browser. These are:
|
||||
|
||||
LibParserUtils -- Parser building utility functions
|
||||
LibWapcaplet -- String internment
|
||||
Hubbub -- HTML5 compliant HTML parser
|
||||
LibCSS -- CSS parser and selection engine
|
||||
LibNSGIF -- GIF format image decoder
|
||||
LibNSBMP -- BMP and ICO format image decoder
|
||||
LibROSprite -- RISC OS Sprite format image decoder
|
||||
LibNSFB -- Framebuffer abstraction
|
||||
|
||||
To fetch each of these libraries, run the appropriate commands from the
|
||||
Docs/LIBRARIES file.
|
||||
|
||||
To build and install these libraries, simply enter each of their directories
|
||||
and run:
|
||||
|
||||
$ sudo make install
|
||||
|
||||
| Note: We advise enabling iconv() support in libparserutils, which vastly
|
||||
| increases the number of supported character sets. To do this,
|
||||
| create a file called Makefile.config.override in the libparserutils
|
||||
| directory, containing the following line:
|
||||
|
|
||||
| CFLAGS += -DWITH_ICONV_FILTER
|
||||
|
|
||||
| For more information, consult the libparserutils README file.
|
||||
|
||||
General requirements
|
||||
----------------------
|
||||
|
||||
Depending on the frontend selected the build may need specific
|
||||
libraries installed, e.g. the SDL port requires SDL1.2 or later
|
||||
|
||||
Installing these libraries will often will pull in loads of things,
|
||||
like the PNG and JPEG libraries, colour management libraries, zlib,
|
||||
OpenSSL etc that NetSurf also depends on.
|
||||
|
|
|
@ -1,16 +1,172 @@
|
|||
--------------------------------------------------------------------------------
|
||||
Build Instructions for GTK NetSurf 8 April 2010
|
||||
Build Instructions for GTK NetSurf 16 March 2014
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
This document provides instructions for building the GTK version of NetSurf
|
||||
and provides guidance on obtaining NetSurf's build dependencies.
|
||||
|
||||
GTK NetSurf has been tested on Debian, Ubuntu, Fedora 8, FreeBSD, NetBSD and
|
||||
Solaris 10.
|
||||
Solaris 10. NetSurf requires at minimum GTK 2.12.
|
||||
|
||||
|
||||
Quick Start
|
||||
=============
|
||||
|
||||
See the QUICK-START document, which provides a simple environment with
|
||||
which you can fetch, build and install NetSurf and its dependencies.
|
||||
|
||||
The QUICK-START is the recommended way to build NetSurf.
|
||||
|
||||
|
||||
Manual building
|
||||
=================
|
||||
|
||||
If you can't follow the quick start instructions, you will have to build
|
||||
NetSurf manually. The instructions for doing this are given below.
|
||||
|
||||
|
||||
Obtaining the build dependencies
|
||||
----------------------------------
|
||||
|
||||
Many of NetSurf's dependencies are packaged on various operating systems.
|
||||
The remainder must be installed manually. Currently, some of the libraries
|
||||
developed as part of the NetSurf project have not had official releases.
|
||||
Hopefully they will soon be released with downloadable tarballs and packaged
|
||||
in common distros. For now, you'll have to make do with Git checkouts.
|
||||
|
||||
Package installation
|
||||
--------------------
|
||||
|
||||
Debian-like OS:
|
||||
|
||||
$ apt-get install libgtk2.0-dev libcurl3-dev libpng-dev
|
||||
$ apt-get install librsvg2-dev libjpeg-dev
|
||||
|
||||
If you want to build with gtk 3 replace libgtk2.0-dev with libgtk-3-dev
|
||||
|
||||
Recent OS versions might need libcurl4-dev instead of libcurl3-dev but
|
||||
note that when it has not been built with OpenSSL, the SSL_CTX is not
|
||||
available and results that certification details won't be presented in case
|
||||
they are invalid. But as this is currently unimplemented in the GTK
|
||||
flavour of NetSurf, this won't make a difference at all.
|
||||
|
||||
For experimental javascript support the mozilla spiermonkey library
|
||||
is required:
|
||||
|
||||
$ apt-get install libmozjs-dev
|
||||
|
||||
Fedora:
|
||||
|
||||
$ yum install curl-devel libpng-devel
|
||||
$ yum install librsvg2-devel expat-devel
|
||||
|
||||
Other:
|
||||
|
||||
You'll need to install the development resources for libglade2, libcurl3,
|
||||
libpng and librsvg.
|
||||
|
||||
Libharu
|
||||
-------
|
||||
|
||||
NetSurf can use Haru PDF to enable PDF export. Haru PDF can be obtained
|
||||
from http://libharu.org/. We require libharu 2.2 or later.
|
||||
|
||||
| Note: libharu cannot be auto-detected by the Makefile. If you wish to
|
||||
| enable it, do so by creating a Makefile.config file.
|
||||
|
||||
|
||||
Preparing your workspace
|
||||
--------------------------
|
||||
|
||||
NetSurf has a number of libraries which must be built in-order and
|
||||
installed into your workspace. Each library depends on a core build
|
||||
system which NetSurf projects use. This build system relies on the
|
||||
presence of things like pkg-config to find libraries and also certain
|
||||
environment variables in order to work correctly.
|
||||
|
||||
Assuming you are preparing a workspace in /home/netsurf/workspace then
|
||||
the following steps will set you up:
|
||||
|
||||
Make the workspace directory and change to it
|
||||
---------------------------------------------
|
||||
|
||||
$ mkdir -p ${HOME}/netsurf/workspace
|
||||
$ cd ${HOME}/netsurf/workspace
|
||||
|
||||
Make the temporary install space
|
||||
--------------------------------
|
||||
|
||||
$ mkdir inst
|
||||
|
||||
Make an environment script
|
||||
--------------------------
|
||||
$ cat > env.sh <<'EOF'
|
||||
export PKG_CONFIG_PATH=${HOME}/netsurf/workspace/inst/lib/pkgconfig::
|
||||
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/netsurf/workspace/inst/lib
|
||||
export PREFIX=${HOME}/netsurf/workspace/inst
|
||||
EOF
|
||||
|
||||
Change to workspace and source the environment
|
||||
----------------------------------------------
|
||||
|
||||
Whenever you wish to start development in a new shell, run the following:
|
||||
|
||||
$ cd ${HOME}/netsurf/workspace
|
||||
$ source env.sh
|
||||
|
||||
From here on, any commands in this document assume you have sourced your
|
||||
shell environment.
|
||||
|
||||
|
||||
The NetSurf project's libraries
|
||||
---------------------------------
|
||||
|
||||
The NetSurf project has developed several libraries which are required by
|
||||
the browser. These are:
|
||||
|
||||
BuildSystem -- Shared build system, needed to build the other libraries
|
||||
LibParserUtils -- Parser building utility functions
|
||||
LibWapcaplet -- String internment
|
||||
Hubbub -- HTML5 compliant HTML parser
|
||||
LibCSS -- CSS parser and selection engine
|
||||
LibNSGIF -- GIF format image decoder
|
||||
LibNSBMP -- BMP and ICO format image decoder
|
||||
LibROSprite -- RISC OS Sprite format image decoder
|
||||
|
||||
To fetch each of these libraries, run the appropriate commands from the
|
||||
Docs/LIBRARIES file, from within your workspace directory.
|
||||
|
||||
To build and install these libraries, simply enter each of their directories
|
||||
and run:
|
||||
|
||||
$ make install
|
||||
|
||||
| Note: We advise enabling iconv() support in libparserutils, which vastly
|
||||
| increases the number of supported character sets. To do this,
|
||||
| create a file called Makefile.config.override in the libparserutils
|
||||
| directory, containing the following line:
|
||||
|
|
||||
| CFLAGS += -DWITH_ICONV_FILTER
|
||||
|
|
||||
| For more information, consult the libparserutils README file.
|
||||
|
||||
Now you should have all the NetSurf project libraries built and installed.
|
||||
|
||||
|
||||
Getting the NetSurf source
|
||||
----------------------------
|
||||
|
||||
From your workspace directory, run the following command to get the NetSurf
|
||||
source:
|
||||
|
||||
$ git clone git://git.netsurf-browser.org/netsurf.git
|
||||
|
||||
And change to the 'netsurf' directory:
|
||||
|
||||
$ cd netsurf
|
||||
|
||||
Building and executing NetSurf
|
||||
================================
|
||||
--------------------------------
|
||||
|
||||
First of all, you should examine the contents of Makefile.defaults
|
||||
and enable and disable relevant features as you see fit by creating
|
||||
|
@ -18,11 +174,11 @@
|
|||
detected and used, and where this is the case they are set to such.
|
||||
Others cannot be automatically detected from the Makefile, so you
|
||||
will either need to install the dependencies, or set them to NO.
|
||||
|
||||
|
||||
You should then obtain NetSurf's dependencies, keeping in mind which options
|
||||
you have enabled in the configuration file. See the next section for
|
||||
specifics.
|
||||
|
||||
|
||||
Once done, to build GTK NetSurf on a UNIX-like platform, simply run:
|
||||
|
||||
$ make
|
||||
|
@ -41,108 +197,9 @@
|
|||
sets up some environment variables which enable NetSurf to find its
|
||||
resources.
|
||||
|
||||
|
||||
Note for packagers
|
||||
====================
|
||||
|
||||
If you are packaging NetSurf, see the PACKAGING-GTK document.
|
||||
|
||||
|
||||
Obtaining NetSurf's build dependencies
|
||||
========================================
|
||||
|
||||
Many of NetSurf's dependencies are packaged on various operating systems.
|
||||
The remainder must be installed manually. Currently, some of the libraries
|
||||
developed as part of the NetSurf project have not had official releases.
|
||||
Hopefully they will soon be released with downloadable tarballs and packaged
|
||||
in common distros. For now, you'll have to make do with Git checkouts.
|
||||
|
||||
Some of NetSurf's own libraries will be installed in /usr/local/ by default.
|
||||
Fedora, and perhaps some other distributions of Linux, do not ship a
|
||||
pkg-config that will search here, so you will either need to change where
|
||||
these libraries install, or do the following before building NetSurf itself;
|
||||
|
||||
$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
|
||||
$ export PKG_CONFIG_PATH
|
||||
|
||||
Package installation
|
||||
----------------------
|
||||
|
||||
Debian-like OS:
|
||||
|
||||
$ apt-get install libgtk2.0-dev libcurl3-dev libmng-dev
|
||||
$ apt-get install librsvg2-dev liblcms1-dev libjpeg-dev
|
||||
|
||||
If you want to build with gtk 3 replace libgtk2.0-dev with libgtk-3-dev
|
||||
|
||||
Recent OS versions might need libcurl4-dev instead of libcurl3-dev but
|
||||
note that when it has not been built with OpenSSL, the SSL_CTX is not
|
||||
available and results that certification details won't be presented in case
|
||||
they are invalid. But as this is currently unimplemented in the GTK
|
||||
flavour of NetSurf, this won't make a difference at all.
|
||||
|
||||
For experimental javascript support the mozilla spiermonkey library
|
||||
is required:
|
||||
|
||||
$ apt-get install libmozjs-dev
|
||||
|
||||
Fedora:
|
||||
|
||||
$ yum install curl-devel libmng-devel
|
||||
$ yum install librsvg2-devel lcms-devel expat-devel
|
||||
|
||||
Other:
|
||||
|
||||
You'll need to install the development resources for libglade2, libcurl3,
|
||||
libmng and librsvg.
|
||||
|
||||
Note that if you don't require MNG or JNG image support, NetSurf can be
|
||||
configured to use libpng instead of libmng. If you wish to do this, install
|
||||
the libpng development package instead.
|
||||
|
||||
The NetSurf project's libraries
|
||||
---------------------------------
|
||||
|
||||
The NetSurf project has developed several libraries which are required by
|
||||
the browser. These are:
|
||||
|
||||
LibParserUtils -- Parser building utility functions
|
||||
LibWapcaplet -- String internment
|
||||
Hubbub -- HTML5 compliant HTML parser
|
||||
LibCSS -- CSS parser and selection engine
|
||||
LibNSGIF -- GIF format image decoder
|
||||
LibNSBMP -- BMP and ICO format image decoder
|
||||
LibROSprite -- RISC OS Sprite format image decoder
|
||||
|
||||
To fetch each of these libraries, run the appropriate commands from the
|
||||
Docs/LIBRARIES file.
|
||||
|
||||
To build and install these libraries, simply enter each of their directories
|
||||
and run:
|
||||
|
||||
$ sudo make install
|
||||
|
||||
| Note: We advise enabling iconv() support in libparserutils, which vastly
|
||||
| increases the number of supported character sets. To do this,
|
||||
| create a file called Makefile.config.override in the libparserutils
|
||||
| directory, containing the following line:
|
||||
|
|
||||
| CFLAGS += -DWITH_ICONV_FILTER
|
||||
|
|
||||
| For more information, consult the libparserutils README file.
|
||||
|
||||
Libharu
|
||||
---------
|
||||
|
||||
NetSurf can use Haru PDF to enable PDF export. Haru PDF can be obtained
|
||||
from http://libharu.org/. We require libharu 2.2 or later.
|
||||
|
||||
| Note: libharu cannot be auto-detected by the Makefile. If you wish to
|
||||
| enable it, do so by creating a Makefile.config file.
|
||||
|
||||
General requirements
|
||||
----------------------
|
||||
|
||||
NetSurf requires at minimum GTK 2.12. Earlier versions will not work. It also
|
||||
depends on Cairo for rendering, but you should have this already with
|
||||
versions of GTK 2.12 or later.
|
||||
|
||||
This will pull in loads of things, like all the GTK dev libraries, the PNG
|
||||
and JPEG libraries, colour management libraries, zlib, OpenSSL etc that
|
||||
NetSurf also depends on.
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
--------------------------------------------------------------------------------
|
||||
Build Instructions for Monkey NetSurf 13 March 2011
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
This document provides instructions for building the Monkey
|
||||
automation version of NetSurf and provides guidance on obtaining
|
||||
NetSurf's build dependencies.
|
||||
|
||||
Monkey NetSurf has been tested on Ubuntu 10.10/amd64.
|
||||
|
||||
|
||||
Building and executing NetSurf
|
||||
==============================
|
||||
|
||||
First of all, you should examine the contents of Makefile.defaults
|
||||
and enable and disable relevant features as you see fit by creating
|
||||
a Makefile.config file. Some of these options can be automatically
|
||||
detected and used, and where this is the case they are set to such.
|
||||
Others cannot be automatically detected from the Makefile, so you
|
||||
will either need to install the dependencies, or set them to NO.
|
||||
|
||||
You should then obtain NetSurf's dependencies, keeping in mind which options
|
||||
you have enabled in the configuration file. See the next section for
|
||||
specifics.
|
||||
|
||||
Once done, to build Monkey NetSurf on a UNIX-like platform, simply run:
|
||||
|
||||
$ make TARGET=monkey
|
||||
|
||||
If that produces errors, you probably don't have some of NetSurf's
|
||||
build dependencies installed. See "Obtaining NetSurf's dependencies"
|
||||
below. Or turn off the complaining features in a Makefile.config
|
||||
file. You may need to "make clean" before attempting to build after
|
||||
installing the dependencies.
|
||||
|
||||
Run NetSurf by executing the "nsmonkey" command from within the build tree.
|
||||
|
||||
$ ./nsmonkey
|
||||
|
||||
If you are packaging NetSurf, do NOT package nsmonkey. It is a debug tool.
|
||||
|
||||
|
||||
Obtaining NetSurf's build dependencies
|
||||
======================================
|
||||
|
||||
Many of NetSurf's dependencies are packaged on various operating systems.
|
||||
The remainder must be installed manually. Currently, some of the libraries
|
||||
developed as part of the NetSurf project have not had official releases.
|
||||
Hopefully they will soon be released with downloadable tarballs and packaged
|
||||
in common distros. For now, you'll have to make do with Git checkouts.
|
||||
|
||||
Some of NetSurf's own libraries will be installed in /usr/local/ by default.
|
||||
Fedora, and perhaps some other distributions of Linux, do not ship a
|
||||
pkg-config that will search here, so you will either need to change where
|
||||
these libraries install, or do the following before building NetSurf itself;
|
||||
|
||||
$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
|
||||
$ export PKG_CONFIG_PATH
|
||||
|
||||
Package installation
|
||||
----------------------
|
||||
|
||||
Debian-like OS:
|
||||
|
||||
$ apt-get install libcurl3-dev
|
||||
|
||||
Recent OS versions might need libcurl4-dev instead of libcurl3-dev but
|
||||
note that when it has not been built with OpenSSL, the SSL_CTX is not
|
||||
available and results that certification details won't be presented in case
|
||||
they are invalid. But as this is currently unimplemented in the GTK
|
||||
flavour of NetSurf, this won't make a difference at all.
|
||||
|
||||
|
||||
The NetSurf project's libraries
|
||||
-------------------------------
|
||||
|
||||
The NetSurf project has developed several libraries which are required by
|
||||
the browser. These are:
|
||||
|
||||
LibParserUtils -- Parser building utility functions
|
||||
LibWapcaplet -- String internment
|
||||
Hubbub -- HTML5 compliant HTML parser
|
||||
LibCSS -- CSS parser and selection engine
|
||||
LibNSGIF -- GIF format image decoder
|
||||
LibNSBMP -- BMP and ICO format image decoder
|
||||
LibROSprite -- RISC OS Sprite format image decoder
|
||||
|
||||
To fetch each of these libraries, run the appropriate commands from the
|
||||
Docs/LIBRARIES file.
|
||||
|
||||
To build and install these libraries, simply enter each of their directories
|
||||
and run:
|
||||
|
||||
$ sudo make install
|
||||
|
||||
| Note: We advise enabling iconv() support in libparserutils, which vastly
|
||||
| increases the number of supported character sets. To do this,
|
||||
| create a file called Makefile.config.override in the libparserutils
|
||||
| directory, containing the following line:
|
||||
|
|
||||
| CFLAGS += -DWITH_ICONV_FILTER
|
||||
|
|
||||
| For more information, consult the libparserutils README file.
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
--------------------------------------------------------------------------------
|
||||
Build Instructions for RISC OS NetSurf 16 July 2012
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
This document provides instructions for building the RISC OS NetSurf
|
||||
natively on a RISC OS computer and provides guidance on obtaining NetSurf's
|
||||
build dependencies.
|
||||
|
||||
RISC OS NetSurf should work on RISC OS 4.02 and above.
|
||||
|
||||
| Note: This guide assumes that you have the RISC OS SVN client installed,
|
||||
| and that you have used it to fetch the NetSurf source. It also
|
||||
| assumes that you have the following requirements installed:
|
||||
|
|
||||
| + OSLib 6.80 or later
|
||||
| + Perl 5.8.8 or later
|
||||
| + GCC 3.4.6 release 3 or later
|
||||
| + The latest NSTools
|
||||
|
||||
If you want to cross-compile NetSurf for RISC OS, use the BUILDING-ROCross
|
||||
document.
|
||||
|
||||
|
||||
Building and executing NetSurf
|
||||
================================
|
||||
|
||||
| Note: The version of make supplied with RISC OS GCC 3 is old and has a bug
|
||||
| that prevents NetSurf from building. Either ensure that NSTools is
|
||||
| seen before GCC, or replace the make inside "!GCC.bin" with the make
|
||||
| from "!NSTools.bin".
|
||||
| The minimum version of make that works is v3.81. You can check what
|
||||
| version you have by running, '*make --version'.
|
||||
|
||||
| Note: The pre-built libraries currently supplied in NSTools are AOF format,
|
||||
| and will not work with GCC4, which requires them to be in ELF format.
|
||||
| If you want to build NetSurf with GCC4, you will need to build the
|
||||
| libraries yourself. See "Obtaining NetSurf's dependencies" below for
|
||||
| details.
|
||||
|
||||
You can examine the contents of Makefile.defaults and enable and disable
|
||||
features as you see fit by creating a Makefile.config file. The default
|
||||
settings will work fine.
|
||||
|
||||
You should then obtain NetSurf's dependencies, keeping in mind which options
|
||||
you have enabled in the configuration file. See the next section for
|
||||
specifics.
|
||||
|
||||
Once done, to build RISC OS NetSurf on a RISC OS system, set the CSD to the
|
||||
directory containing the NetSurf sources, set the next slot to at least
|
||||
6000K, and in a TaskWindow, simply run:
|
||||
|
||||
*make
|
||||
|
||||
If that produces errors, you probably don't have some of NetSurf's build
|
||||
dependencies installed, or your libraries may be out of date.
|
||||
|
||||
See "Obtaining NetSurf's dependencies" below. Or turn off the complaining
|
||||
features in a Makefile.config file. You may need to "make clean" before
|
||||
attempting to build after installing the dependencies.
|
||||
|
||||
Once NetSurf is compiled, the !RunImage is put into the !NetSurf
|
||||
application directory, so you can simply double click it as normal.
|
||||
|
||||
To confirm that you're running your own development NetSurf build, view the
|
||||
Info window from the NetSurf iconbar menu. The Version string should read
|
||||
|
||||
#.0 (Development)
|
||||
|
||||
where # is the next major release version number.
|
||||
|
||||
|
||||
Obtaining NetSurf's build dependencies
|
||||
========================================
|
||||
|
||||
NSTools contains all of the tools needed to build NetSurf, such as make,
|
||||
uname and ccres. It also contains pre-built libraries.
|
||||
|
||||
Currently NSTools contains libraries which are in a format that are in a
|
||||
format which is compatible with RISC OS GCC3 but not RISC OS GCC4. Until
|
||||
NSTools is updated with GCC4 compatible libraries, it is recommended that
|
||||
you use GCC3 for native builds.
|
||||
|
||||
The NSTools on the web site is not auto-built, so it may not always have
|
||||
the latest versions of the NetSurf project's own libraries. In this case
|
||||
you will need to build the libraries yourself and update your copy of
|
||||
NSTools.
|
||||
|
||||
Fetching the sources
|
||||
----------------------
|
||||
|
||||
Use SVN to obtain the latest versions of each of the libraries. To do this,
|
||||
set the CSD to a directory where you want to keep your copies of the library
|
||||
sources, and run the appropriate commands from the Docs/LIBRARIES file.
|
||||
|
||||
The above will create a directory for each of the libraries containing their
|
||||
sources.
|
||||
|
||||
| Note: We advise enabling iconv() support in libparserutils, which vastly
|
||||
| increases the number of supported character sets. To do this,
|
||||
| create a file called Makefile.config.override in the libparserutils
|
||||
| directory, containing the following line:
|
||||
|
|
||||
| CFLAGS += -DWITH_ICONV_FILTER
|
||||
|
|
||||
| For more information, consult the libparserutils README file.
|
||||
|
||||
Updating NSTools' copies of the libraries
|
||||
-------------------------------------------
|
||||
|
||||
Set the CSD to the directory of the library you want to build, set your next
|
||||
slot to at least 6000K and in a TaskWindow, run
|
||||
|
||||
*svn update
|
||||
|
||||
This updates your local copy of the source to the latest version. To build
|
||||
and install the library into NSTools, run:
|
||||
|
||||
*make install
|
||||
|
||||
| Note: If you are using GCC3, you may get a warning from AR when you run
|
||||
| make. This can be ignored.
|
|
@ -56,8 +56,6 @@
|
|||
|
||||
$ ../autobuilder/build libpng12-0
|
||||
|
||||
$ ../autobuilder/build libmng1
|
||||
|
||||
$ ../autobuilder/build oslib
|
||||
|
||||
B. NetSurf libraries
|
||||
|
|
|
@ -703,7 +703,9 @@ INPUT_ENCODING = UTF-8
|
|||
FILE_PATTERNS = *.c \
|
||||
*.h \
|
||||
*.y \
|
||||
*.l
|
||||
*.l \
|
||||
*.cpp \
|
||||
*.m
|
||||
|
||||
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
|
||||
# should be searched for input files as well. Possible values are YES and NO.
|
||||
|
@ -717,12 +719,7 @@ RECURSIVE = NO
|
|||
# Note that relative paths are relative to the directory from which doxygen is
|
||||
# run.
|
||||
|
||||
EXCLUDE = css/css_enum.c \
|
||||
css/css_enum.h \
|
||||
css/parser.c \
|
||||
css/parser.h \
|
||||
css/scanner.c \
|
||||
css/scanner.h
|
||||
EXCLUDE =
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
||||
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||
|
@ -1788,7 +1785,7 @@ MSCFILE_DIRS =
|
|||
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
|
||||
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
|
||||
|
||||
DOT_GRAPH_MAX_NODES = 50
|
||||
DOT_GRAPH_MAX_NODES = 100
|
||||
|
||||
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
|
||||
# graphs generated by dot. A depth value of 3 means that only nodes reachable
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
--------------------------------------------------------------------------------
|
||||
Quick Build Steps for NetSurf 26 February 2014
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
This document provides steps for building NetSurf.
|
||||
|
||||
|
||||
Grab a temporary env.sh
|
||||
--------------------------
|
||||
|
||||
$ wget http://git.netsurf-browser.org/netsurf.git/plain/Docs/env.sh
|
||||
$ source env.sh
|
||||
|
||||
|
||||
Install any packages you need
|
||||
-------------------------------
|
||||
|
||||
Installs all packages required to build NetSurf and the NetSurf project
|
||||
libraries.
|
||||
|
||||
$ ns-package-install
|
||||
|
||||
If your package manager is not supported, you will have to install third
|
||||
party packages manually.
|
||||
|
||||
|
||||
Get the NetSurf project source code from Git
|
||||
----------------------------------------------
|
||||
|
||||
$ ns-clone
|
||||
|
||||
|
||||
Build and install our project libraries
|
||||
-----------------------------------------
|
||||
|
||||
Updates NetSurf project library sources to latest, builds and installs them.
|
||||
|
||||
$ ns-pull-install
|
||||
|
||||
|
||||
Switch to new NetSurf workspace
|
||||
---------------------------------
|
||||
|
||||
$ rm env.sh
|
||||
$ cd ~/dev-netsurf/workspace
|
||||
$ source env.sh
|
||||
|
||||
|
||||
Build and run NetSurf
|
||||
-----------------------
|
||||
|
||||
$ cd netsurf
|
||||
|
||||
To build the native front end (the GTK front end on Linux, BSDs, etc) you
|
||||
could do:
|
||||
|
||||
$ make
|
||||
$ ./nsgtk
|
||||
|
||||
To build the framebuffer front end, you could do:
|
||||
|
||||
$ make TARGET=framebuffer
|
||||
$ ./nsfb
|
||||
|
||||
|
||||
Not working?
|
||||
==============
|
||||
|
||||
If the above steps are inapplicable, or don't work, you can build manually.
|
||||
Follow the instructions in the BUILDING-* documents in the Docs/ directory
|
||||
the NetSurf browser source tree.
|
||||
|
114
Docs/env.sh
114
Docs/env.sh
|
@ -22,13 +22,22 @@ if [ "x${TARGET_WORKSPACE}" = "x" ]; then
|
|||
fi
|
||||
|
||||
if [ "x${USE_CPUS}" = "x" ]; then
|
||||
NCPUS=$(grep -c "^processor" /proc/cpuinfo 2>/dev/null)
|
||||
NCPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null)
|
||||
NCPUS="${NCPUS:-1}"
|
||||
NCPUS=$((NCPUS * 2))
|
||||
USE_CPUS="-j${NCPUS}"
|
||||
fi
|
||||
|
||||
# The GTK version to build for (either 2 or 3 currently)
|
||||
if [ "x${NETSURF_GTK_MAJOR}" = "x" ]; then
|
||||
NETSURF_GTK_MAJOR=3
|
||||
fi
|
||||
|
||||
# The host system doing the building
|
||||
HOST_ABI=$(uname -s)
|
||||
|
||||
# setup environment
|
||||
echo "HOST_ABI=${HOST_ABI}"
|
||||
echo "TARGET_ABI=${TARGET_ABI}"
|
||||
echo "TARGET_WORKSPACE=${TARGET_WORKSPACE}"
|
||||
echo "USE_CPUS=${USE_CPUS}"
|
||||
|
@ -37,27 +46,43 @@ export PREFIX=${TARGET_WORKSPACE}/inst-${TARGET_ABI}
|
|||
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}::
|
||||
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PREFIX}/lib
|
||||
export PATH=${PATH}:${PREFIX}/bin
|
||||
export NETSURF_GTK_MAJOR
|
||||
|
||||
# NetSurf GIT repositories
|
||||
NS_GIT="git://git.netsurf-browser.org"
|
||||
|
||||
# internal libraries all frontends require (order is important)
|
||||
NS_INTERNAL_LIBS="buildsystem libwapcaplet libparserutils libhubbub libdom libcss libnsgif libnsbmp libsvgtiny librosprite"
|
||||
# internal libraries only required by some frontends
|
||||
NS_FRONTEND_LIBS="libnsfb"
|
||||
# internal libraries required for the risc os target abi
|
||||
NS_RISCOS_LIBS="librufl libpencil"
|
||||
# tools required to build the browser
|
||||
NS_TOOLS="nsgenbind"
|
||||
NS_INTERNAL_LIBS="buildsystem libwapcaplet libparserutils libhubbub libdom libcss libnsgif libnsbmp"
|
||||
|
||||
# The browser itself
|
||||
NS_BROWSER="netsurf"
|
||||
|
||||
# deb packages
|
||||
NS_DEV_DEB="build-essential pkg-config git gperf"
|
||||
NS_TOOL_DEB="flex bison"
|
||||
NS_GTK_DEB="libgtk2.0-dev libcurl3-dev libmng-dev librsvg2-dev liblcms1-dev libjpeg-dev libmozjs-dev"
|
||||
# add target specific libraries
|
||||
if [ "x${TARGET_ABI}" = "xHaiku" ]; then
|
||||
# tools required to build the browser
|
||||
NS_TOOLS=""
|
||||
NS_FRONTEND_LIBS=""
|
||||
elif [ "x${TARGET_ABI}" = "xriscos" ]; then
|
||||
# tools required to build the browser
|
||||
NS_TOOLS="nsgenbind"
|
||||
# libraries required for the risc os target abi
|
||||
NS_FRONTEND_LIBS="libsvgtiny librufl libpencil librosprite"
|
||||
else
|
||||
# tools required to build the browser
|
||||
NS_TOOLS="nsgenbind"
|
||||
# internal libraries only required by some frontends
|
||||
NS_FRONTEND_LIBS="libsvgtiny libnsfb"
|
||||
fi
|
||||
|
||||
#add target specific libraries
|
||||
if [ "x${TARGET_ABI}" = "xriscos" ]; then
|
||||
NS_FRONTEND_LIBS="${NS_FRONTEND_LIBS} ${NS_RISCOS_LIBS}"
|
||||
################ OS Package installation ################
|
||||
|
||||
# deb packages for dpkg based systems
|
||||
NS_DEV_DEB="build-essential pkg-config git gperf libcurl3-dev libpng-dev libjpeg-dev libmozjs185-dev"
|
||||
NS_TOOL_DEB="flex bison libhtml-parser-perl"
|
||||
if [ "x${NETSURF_GTK_MAJOR}" = "x3" ]; then
|
||||
NS_GTK_DEB="libgtk-3-dev librsvg2-dev"
|
||||
else
|
||||
NS_GTK_DEB="libgtk2.0-dev librsvg2-dev"
|
||||
fi
|
||||
|
||||
# apt get commandline to install necessary dev packages
|
||||
|
@ -66,6 +91,63 @@ ns-apt-get-install()
|
|||
sudo apt-get install $(echo ${NS_DEV_DEB} ${NS_TOOL_DEB} ${NS_GTK_DEB})
|
||||
}
|
||||
|
||||
# RPM packages for rpm based systems (tested on fedora 20)
|
||||
NS_DEV_RPM="git gcc pkgconfig libexpat-devel openssl-devel js-devel-1.8.5 libcurl-devel perl-Digest-MD5-File libjpeg-devel libpng-devel"
|
||||
NS_TOOL_RPM="flex bison"
|
||||
if [ "x${NETSURF_GTK_MAJOR}" = "x3" ]; then
|
||||
NS_GTK_RPM="gtk3-devel librsvg2-devel"
|
||||
else
|
||||
NS_GTK_RPM="gtk2-devel librsvg2-devel"
|
||||
fi
|
||||
|
||||
# yum commandline to install necessary dev packages
|
||||
ns-yum-install()
|
||||
{
|
||||
sudo yum -y install $(echo ${NS_DEV_RPM} ${NS_TOOL_RPM} ${NS_GTK_RPM})
|
||||
}
|
||||
|
||||
# Haiku secondary arch suffix:
|
||||
# empty for primary (gcc2 on x86),
|
||||
# "_x86" for gcc4 secondary.
|
||||
HA=
|
||||
# Haiku packages
|
||||
NS_DEV_HPKG="curl${HA}_devel libpng${HA}_devel jpeg${HA}_devel openssl${HA}_devel libiconv${HA}_devel expat${HA}_devel pkgconfig${HA} gperf${HA}"
|
||||
|
||||
# pkgman commandline to install necessary dev packages
|
||||
ns-pkgman-install()
|
||||
{
|
||||
pkgman install $(echo ${NS_DEV_HPKG})
|
||||
}
|
||||
|
||||
# generic for help text
|
||||
NS_DEV_GEN="git, gcc, pkgconfig, expat library, openssl library, spidermonkey-1.8.5 library, libcurl, perl, perl MD5 digest, libjpeg library, libpng library"
|
||||
NS_TOOL_GEN="flex tool, bison tool"
|
||||
if [ "x${NETSURF_GTK_MAJOR}" = "x3" ]; then
|
||||
NS_GTK_GEN="gtk+ 3 toolkit library, librsvg2 library"
|
||||
else
|
||||
NS_GTK_GEN="gtk+ 2 toolkit library, librsvg2 library"
|
||||
fi
|
||||
|
||||
|
||||
# Genertic OS package install
|
||||
# looks for package managers and tries to use them if present
|
||||
ns-package-install()
|
||||
{
|
||||
if [ -x "/usr/bin/apt-get" ]; then
|
||||
ns-apt-get-install
|
||||
elif [ -x "/usr/bin/yum" ]; then
|
||||
ns-yum-install
|
||||
elif [ -x "/bin/pkgman" ]; then
|
||||
ns-pkgman-install
|
||||
else
|
||||
echo "Unable to determine OS packaging system in use."
|
||||
echo "Please ensure development packages are installed for:"
|
||||
echo ${NS_DEV_GEN}"," ${NS_TOOL_GEN}"," ${NS_GTK_GEN}
|
||||
fi
|
||||
}
|
||||
|
||||
################ Development helpers ################
|
||||
|
||||
# git pull in all repos parameters are passed to git pull
|
||||
ns-pull()
|
||||
{
|
||||
|
@ -107,7 +189,7 @@ ns-make-libs()
|
|||
done
|
||||
}
|
||||
|
||||
# issues a make command to all libraries
|
||||
# issues a make command for framebuffer libraries
|
||||
ns-make-libnsfb()
|
||||
{
|
||||
echo " MAKE: make -C libnsfb $USE_CPUS $*"
|
||||
|
|
|
@ -0,0 +1,204 @@
|
|||
Source Object (low level) cache backing store
|
||||
=============================================
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The source object cache provides a system to extend the life of source
|
||||
objects (html files, images etc.) after they are no longer immediately
|
||||
being used.
|
||||
|
||||
Only fetch types where we have well defined rules on caching are
|
||||
considered, in practice this limits us to HTTP(S). The section in
|
||||
RFC2616 [1] on caching specifies these rules.
|
||||
|
||||
To futher extend the objects lifetime they can be pushed into a
|
||||
backing store where the objects are available for reuse less quickly
|
||||
than from RAM but faster than retriving from the network again.
|
||||
|
||||
The backing store implementation provides a key:value infrastructure
|
||||
with a simple store, retrive and invalidate interface.
|
||||
|
||||
Generic filesystem backing store
|
||||
--------------------------------
|
||||
|
||||
Although the backing store interface is fully pluggable a generic
|
||||
implementation based on storing objects on the filesystem in a
|
||||
heirachy of directories.
|
||||
|
||||
The option to alter the backing store format exists and is controled
|
||||
by a version field. It is implementation defined what happens if a
|
||||
version mis-match occours.
|
||||
|
||||
As the backing store only holds cache data one should not expect a
|
||||
great deal of effort to be expended converting formats (i.e. the cache
|
||||
may simply be discarded).
|
||||
|
||||
Layout version 1.1
|
||||
------------------
|
||||
|
||||
An object has an identifier value generated from the url (NetSurf
|
||||
backing stores uses the url as the unique key). The value used is
|
||||
obtained using nsurl_hash() which is currently a 32 bit FNV so is
|
||||
directly usable.
|
||||
|
||||
This identifier is adequate to ensure the collision rate for the
|
||||
hashed url values (a collision for every 2^16 urls added) is
|
||||
sufficiently low the overhead of returning the wrong object (which
|
||||
backing stores are permitted to do) is not significat.
|
||||
|
||||
An entry list is maintained which contains all the metadata about a
|
||||
given identifier. This list is limited in length to constrain the
|
||||
resources necessary to maintain it. It is made persistant to avoid the
|
||||
overhead of reconstructing it at initialisation and to keep the data
|
||||
used to improve the eviction decisions.
|
||||
|
||||
Each object is stored and retrived directly into the filesystem using
|
||||
a filename generated from a RFC4648 base32 encoding of an address
|
||||
value. The objects address is derived from the identifier by cropping
|
||||
it to a shorter length.
|
||||
|
||||
A mapping between the object address and its entry is maintained which
|
||||
uses storage directly proportional to the size of the address length.
|
||||
|
||||
The cropping length is stored in the control file with the default
|
||||
values set at compile time. This allows existing backing stores to
|
||||
continue operating with existing data independantly of new default
|
||||
setting. This setting gives some ability to tune the default cache
|
||||
index size to values suitable for a specific host operating system.
|
||||
|
||||
E.g. Linux based systems can easily cope with several megabytes of
|
||||
mmaped index but RISC OS might want to limit this to a few megabytes
|
||||
of heap at most.
|
||||
|
||||
The files are stored on disc using their base32 address value.
|
||||
By creating a directory for each character of the encoded filename
|
||||
(except the last which is of course the leafname) we create a
|
||||
directory structure where no directory has more than 32 entries.
|
||||
|
||||
E.g. A 19bit address of 0x1 would be base32 encoded into AAAB
|
||||
resulting in the data being stored in a file path of
|
||||
"/store/prefix/d/B/A/A/BAAAAA".
|
||||
|
||||
An address of 0x00040001 encodes to BAAB and a file path of
|
||||
"/store/prefix/m/B/A/A/BAABAAA"
|
||||
|
||||
Version 1.0
|
||||
-----------
|
||||
|
||||
The version 1 layout was identical to the 1.1 except base64url
|
||||
encoding was used, this proved problematic as some systems filesystems
|
||||
were case insensitive so upper and lower case letetrs collided.
|
||||
|
||||
There is no upgrade provision from the previous version simply delete
|
||||
the cache directory.
|
||||
|
||||
Control files
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
control
|
||||
+++++++
|
||||
A control file is used to hold a list of values describing how the
|
||||
other files in the backing store should be used.
|
||||
|
||||
entries
|
||||
+++++++
|
||||
|
||||
this file contains a table of entries describing the files held on the
|
||||
filesystem.
|
||||
|
||||
Each control file table entry is 28 bytes and consists of
|
||||
|
||||
- signed 64 bit value for last use time
|
||||
|
||||
- 32bit full url hash allowing for index reconstruction and
|
||||
addiitonal collision detection. Also the possibility of increasing
|
||||
the ADDRESS_LENGTH although this would require renaming all the
|
||||
existing files in the cache and is not currently implemented.
|
||||
|
||||
- unsigned 32bit length for data
|
||||
|
||||
- unsigned 32bit length for metadata
|
||||
|
||||
- unsigned 16bit value for number of times used.
|
||||
|
||||
- unsigned 16bit value for flags
|
||||
|
||||
- unsigned 16bit value for data block index (unused)
|
||||
|
||||
- unsigned 16bit value for metatdata block index (unused)
|
||||
|
||||
Address to entry index
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
An entry index is held in RAM that allows looking up the address to
|
||||
map to an entry in the control file.
|
||||
|
||||
The index is the only data structure whose size is directly depndant
|
||||
on the length of the hash specificaly:
|
||||
|
||||
(2 ^ (ADDRESS_BITS - 3)) * ENTRY_BITS) in bytes
|
||||
|
||||
where ADDRESS_BITS is how long the address is in bits and ENTRY_BITS
|
||||
is how many entries the control file (and hence the while
|
||||
cache) may hold.
|
||||
|
||||
RISCOS values
|
||||
+++++++++++++
|
||||
|
||||
By limiting the ENTRY_BITS size to 14 (16,384 entries) the entries
|
||||
list is limited to 448kilobytes.
|
||||
|
||||
The typical values for RISC OS would set ADDRESS_BITS to 18. This
|
||||
spreads the entries over 262144 hash values which uses 512 kilobytes
|
||||
for the index. Limiting the hash space like this reduces the
|
||||
efectiveness of the cache.
|
||||
|
||||
A small ADDRESS_LENGTH causes a collision (two urls with the same
|
||||
address) to happen roughly for every 2 ^ (ADDRESS_BITS / 2) = 2 ^ 9 =
|
||||
512 objects stored. This roughly translates to a cache miss due to
|
||||
collision every ten pages navigated to.
|
||||
|
||||
Larger systems
|
||||
++++++++++++++
|
||||
|
||||
In general ENTRY_BITS set to 16 as this limits the store to 65536
|
||||
objects which given the average size of an object at 8 kilobytes
|
||||
yeilds half a gigabyte of disc used which is judged to be sufficient.
|
||||
|
||||
For larger systems e.g. those using GTK frontend we would most likely
|
||||
select ADDRESS_BITS as 22 resulting in a collision every 2048 objects
|
||||
but the index using some 8 Megabytes
|
||||
|
||||
Typical values
|
||||
--------------
|
||||
|
||||
Example 1
|
||||
~~~~~~~~~
|
||||
|
||||
For a store with 1034 objects genrated from a random navigation of
|
||||
pages linked from the about:welcome page.
|
||||
|
||||
Metadata total size is 593608 bytes an average of 574 bytes. The
|
||||
majority of the storage is used to hold the urls and headers.
|
||||
|
||||
Data total size is 9180475 bytes a mean of 8879 bytes 1648726 in the
|
||||
largest 10 entries which if excluded gives 7355 bytes average size
|
||||
|
||||
Example 2
|
||||
~~~~~~~~~
|
||||
|
||||
355 pages navigated in 80 minutes from about:welcome page and a
|
||||
handful of additional sites (google image search and reddit)
|
||||
|
||||
2018 objects in cache at quit. 400 objects from news.bbc.co.uk alone
|
||||
|
||||
Metadata total 987,439 bytes mean of 489 bytes
|
||||
|
||||
data total 33,127,831 bytes mean of 16,416 bytes
|
||||
|
||||
with one single 5,000,811 byte gif
|
||||
|
||||
data totals without gif is 28,127,020 mean 13,945
|
||||
|
||||
[1] http://tools.ietf.org/html/rfc2616#section-13
|
121
Makefile
121
Makefile
|
@ -70,6 +70,9 @@ else
|
|||
ifeq ($(TARGET),)
|
||||
TARGET := beos
|
||||
endif
|
||||
ifeq ($(TARGET),haiku)
|
||||
TARGET := beos
|
||||
endif
|
||||
else
|
||||
ifeq ($(HOST),AmigaOS)
|
||||
HOST := amiga
|
||||
|
@ -131,14 +134,20 @@ ifneq ($(TARGET),riscos)
|
|||
endif
|
||||
endif
|
||||
|
||||
Q=@
|
||||
VQ=@
|
||||
PERL=perl
|
||||
MKDIR=mkdir
|
||||
TOUCH=touch
|
||||
STRIP=strip
|
||||
SPLIT_MESSAGES=$(PERL) utils/split-messages.pl
|
||||
|
||||
# build verbosity
|
||||
ifeq ($(V),1)
|
||||
Q:=
|
||||
else
|
||||
Q=@
|
||||
endif
|
||||
VQ=@
|
||||
|
||||
# Override this only if the host compiler is called something different
|
||||
HOST_CC := gcc
|
||||
|
||||
|
@ -314,6 +323,8 @@ DEPROOT := $(OBJROOT)/deps
|
|||
TOOLROOT := $(OBJROOT)/tools
|
||||
|
||||
|
||||
# A macro that conditionaly adds flags to the build when a feature is enabled.
|
||||
#
|
||||
# 1: Feature name (ie, NETSURF_USE_BMP -> BMP)
|
||||
# 2: Parameters to add to CFLAGS
|
||||
# 3: Parameters to add to LDFLAGS
|
||||
|
@ -321,6 +332,7 @@ TOOLROOT := $(OBJROOT)/tools
|
|||
define feature_enabled
|
||||
ifeq ($$(NETSURF_USE_$(1)),YES)
|
||||
CFLAGS += $(2)
|
||||
CXXFLAGS += $(2)
|
||||
LDFLAGS += $(3)
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
$$(info M.CONFIG: $(4) enabled (NETSURF_USE_$(1) := YES))
|
||||
|
@ -335,6 +347,35 @@ define feature_enabled
|
|||
endif
|
||||
endef
|
||||
|
||||
# A macro that conditionaly adds flags to the build with a uniform display.
|
||||
#
|
||||
# 1: Feature name (ie, NETSURF_USE_BMP -> BMP)
|
||||
# 2: Human-readable name for the feature
|
||||
# 3: Parameters to add to CFLAGS when enabled
|
||||
# 4: Parameters to add to LDFLAGS when enabled
|
||||
# 5: Parameters to add to CFLAGS when disabled
|
||||
# 6: Parameters to add to LDFLAGS when disabled
|
||||
define feature_switch
|
||||
ifeq ($$(NETSURF_USE_$(1)),YES)
|
||||
CFLAGS += $(3)
|
||||
CXXFLAGS += $(3)
|
||||
LDFLAGS += $(4)
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
$$(info M.CONFIG: $(2) enabled (NETSURF_USE_$(1) := YES))
|
||||
endif
|
||||
else ifeq ($$(NETSURF_USE_$(1)),NO)
|
||||
CFLAGS += $(5)
|
||||
CXXFLAGS += $(5)
|
||||
LDFLAGS += $(6)
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
$$(info M.CONFIG: $(2) disabled (NETSURF_USE_$(1) := NO))
|
||||
endif
|
||||
else
|
||||
$$(info M.CONFIG: $(4) error (NETSURF_USE_$(1) := $$(NETSURF_USE_$(1))))
|
||||
$$(error NETSURF_USE_$(1) must be YES or NO)
|
||||
endif
|
||||
endef
|
||||
|
||||
# Extend flags with appropriate values from pkg-config for enabled features
|
||||
#
|
||||
# 1: pkg-config required modules for feature
|
||||
|
@ -348,6 +389,7 @@ define pkg_config_find_and_add
|
|||
|
||||
ifeq ($$(PKG_CONFIG_$(1)_EXISTS),yes)
|
||||
CFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(1))
|
||||
CXXFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(1))
|
||||
LDFLAGS += $$(shell $$(PKG_CONFIG) --libs $(1))
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
$$(info PKG.CNFG: $(2) ($(1)) enabled)
|
||||
|
@ -375,6 +417,7 @@ define pkg_config_find_and_add_enabled
|
|||
ifeq ($$(NETSURF_USE_$(1)),YES)
|
||||
ifeq ($$(NETSURF_FEATURE_$(1)_AVAILABLE),yes)
|
||||
CFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(2)) $$(NETSURF_FEATURE_$(1)_CFLAGS)
|
||||
CXXFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(2)) $$(NETSURF_FEATURE_$(1)_CFLAGS)
|
||||
LDFLAGS += $$(shell $$(PKG_CONFIG) --libs $(2)) $$(NETSURF_FEATURE_$(1)_LDFLAGS)
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
$$(info M.CONFIG: $(3) ($(2)) enabled (NETSURF_USE_$(1) := YES))
|
||||
|
@ -388,6 +431,7 @@ define pkg_config_find_and_add_enabled
|
|||
else ifeq ($$(NETSURF_USE_$(1)),AUTO)
|
||||
ifeq ($$(NETSURF_FEATURE_$(1)_AVAILABLE),yes)
|
||||
CFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(2)) $$(NETSURF_FEATURE_$(1)_CFLAGS)
|
||||
CXXFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(2)) $$(NETSURF_FEATURE_$(1)_CFLAGS)
|
||||
LDFLAGS += $$(shell $$(PKG_CONFIG) --libs $(2)) $$(NETSURF_FEATURE_$(1)_LDFLAGS)
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
$$(info M.CONFIG: $(3) ($(2)) auto-enabled (NETSURF_USE_$(1) := AUTO))
|
||||
|
@ -415,39 +459,57 @@ endef
|
|||
# General flag setup
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# Set up the WARNFLAGS here so that they can be overridden in the Makefile.config
|
||||
WARNFLAGS = -W -Wall -Wundef -Wpointer-arith \
|
||||
-Wcast-align -Wwrite-strings -Wstrict-prototypes \
|
||||
-Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
|
||||
-Wnested-externs -Wuninitialized
|
||||
# Set up the warning flags here so that they can be overridden in the
|
||||
# Makefile.config
|
||||
COMMON_WARNFLAGS = -W -Wall -Wundef -Wpointer-arith -Wcast-align \
|
||||
-Wwrite-strings -Wmissing-declarations -Wuninitialized
|
||||
ifneq ($(CC_MAJOR),2)
|
||||
WARNFLAGS += -Wno-unused-parameter
|
||||
COMMON_WARNFLAGS += -Wno-unused-parameter
|
||||
endif
|
||||
# deal with lots of unwanted warnings from javascript
|
||||
ifeq ($(call cc_ver_ge,4,6),1)
|
||||
WARNFLAGS += -Wno-unused-but-set-variable
|
||||
COMMON_WARNFLAGS += -Wno-unused-but-set-variable
|
||||
endif
|
||||
# deal with chaging warning flags on differing HOST systems
|
||||
ifeq ($(HOST),OpenBSD)
|
||||
# OpenBSD headers are not compatible with redundant declaration warning
|
||||
COMMON_WARNFLAGS += -Wno-redundant-decls
|
||||
else
|
||||
COMMON_WARNFLAGS += -Wredundant-decls
|
||||
endif
|
||||
|
||||
# c++ default warning flags
|
||||
CXXWARNFLAGS :=
|
||||
|
||||
# C default warning flags
|
||||
CWARNFLAGS := -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
|
||||
|
||||
# Pull in the configuration
|
||||
include Makefile.defaults
|
||||
|
||||
$(eval $(call feature_enabled,JPEG,-DWITH_JPEG,-ljpeg,JPEG (libjpeg)))
|
||||
$(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,JNG/MNG/PNG (libmng)))
|
||||
# Build flags for libjpeg as it has no pkgconfig file
|
||||
$(eval $(call feature_switch,JPEG,JPEG (libjpeg),-DWITH_JPEG,-ljpeg,-UWITH_JPEG,))
|
||||
|
||||
$(eval $(call feature_enabled,HARU_PDF,-DWITH_PDF_EXPORT,-lhpdf -lpng,PDF export (haru)))
|
||||
$(eval $(call feature_enabled,LIBICONV_PLUG,-DLIBICONV_PLUG,,glibc internal iconv))
|
||||
# Build flags for haru
|
||||
$(eval $(call feature_switch,HARU_PDF,PDF export (haru),-DWITH_PDF_EXPORT,-lhpdf -lpng,-UWITH_PDF_EXPORT,))
|
||||
|
||||
# Build flags for iconv
|
||||
$(eval $(call feature_switch,LIBICONV_PLUG,glibc internal iconv,-DLIBICONV_PLUG,,-ULIBICONV_PLUG,-liconv))
|
||||
|
||||
# common libraries without pkg-config support
|
||||
LDFLAGS += -lz
|
||||
|
||||
# add top level and build directory to include search path
|
||||
CFLAGS += -I. -I$(OBJROOT)
|
||||
CXXFLAGS += -I. -I$(OBJROOT)
|
||||
|
||||
# export the user agent format
|
||||
CFLAGS += -DNETSURF_UA_FORMAT_STRING=\"$(NETSURF_UA_FORMAT_STRING)\"
|
||||
CXXFLAGS += -DNETSURF_UA_FORMAT_STRING=\"$(NETSURF_UA_FORMAT_STRING)\"
|
||||
|
||||
# set the default homepage to use
|
||||
CFLAGS += -DNETSURF_HOMEPAGE=\"$(NETSURF_HOMEPAGE)\"
|
||||
CXXFLAGS += -DNETSURF_HOMEPAGE=\"$(NETSURF_HOMEPAGE)\"
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# General make rules
|
||||
|
@ -556,7 +618,7 @@ ifeq ($(TARGET),beos)
|
|||
$(Q)$(BEOS_SETVER) $(EXETARGET) \
|
||||
-app $(VERSION_MAJ) $(VERSION_MIN) 0 d 0 \
|
||||
-short "NetSurf $(VERSION_FULL)" \
|
||||
-long "NetSurf $(VERSION_FULL) © 2003 - 2013 The NetSurf Developers"
|
||||
-long "NetSurf $(VERSION_FULL) © 2003 - 2014 The NetSurf Developers"
|
||||
$(VQ)echo " MIMESET: $(EXETARGET)"
|
||||
$(Q)$(BEOS_MIMESET) $(EXETARGET)
|
||||
endif
|
||||
|
@ -610,26 +672,24 @@ clean-target:
|
|||
$(call clean_install_messages, !NetSurf/Resources)
|
||||
|
||||
clean-testament:
|
||||
$(VQ)echo " CLEAN: utils/testament.h"
|
||||
$(Q)$(RM) utils/testament.h
|
||||
$(VQ)echo " CLEAN: testament.h"
|
||||
$(Q)$(RM) $(OBJROOT)/testament.h
|
||||
|
||||
clean-builddir:
|
||||
$(VQ)echo " CLEAN: $(OBJROOT)"
|
||||
$(Q)$(RM) -r $(OBJROOT)
|
||||
CLEANS += clean-builddir
|
||||
|
||||
all-program: $(EXETARGET) post-exe
|
||||
|
||||
.PHONY: all-program all-messages testament
|
||||
|
||||
testament $(OBJROOT)/testament.h:
|
||||
$(Q)$(PERL) utils/git-testament.pl $(CURDIR) $(OBJROOT)/testament.h
|
||||
|
||||
all-messages:
|
||||
$(call split_install_messages, any, !NetSurf/Resources)
|
||||
|
||||
.PHONY: testament
|
||||
testament utils/testament.h:
|
||||
$(Q)if test -d .svn; then \
|
||||
$(PERL) utils/svn-testament.pl $(CURDIR) utils/testament.h; \
|
||||
else \
|
||||
$(PERL) utils/git-testament.pl $(CURDIR) utils/testament.h; \
|
||||
fi
|
||||
|
||||
post-exe: $(POSTEXES)
|
||||
all-program: all-messages $(EXETARGET) $(POSTEXES)
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
|
@ -668,7 +728,7 @@ $$(DEPROOT)/$(3) $$(OBJROOT)/$(2): $$(OBJROOT)/created
|
|||
> $$(DEPROOT)/$(3)
|
||||
$$(VQ)echo " COMPILE: $(1)"
|
||||
$$(Q)$$(RM) $$(OBJROOT)/$(2)
|
||||
$$(Q)$$(CC) $$(CFLAGS) -o $$(OBJROOT)/$(2) -c $(1)
|
||||
$$(Q)$$(CC) $$(CFLAGS) $$(COMMON_WARNFLAGS) $$(CWARNFLAGS) -o $$(OBJROOT)/$(2) -c $(1)
|
||||
|
||||
endef
|
||||
else
|
||||
|
@ -677,7 +737,8 @@ $$(DEPROOT)/$(3) $$(OBJROOT)/$(2): $$(OBJROOT)/created
|
|||
$$(VQ)echo " COMPILE: $(1)"
|
||||
$$(Q)$$(RM) $$(DEPROOT)/$(3)
|
||||
$$(Q)$$(RM) $$(OBJROOT)/$(2)
|
||||
$$(Q)$$(CC) $$(CFLAGS) -MMD -MT '$$(DEPROOT)/$(3) $$(OBJROOT)/$(2)' \
|
||||
$$(Q)$$(CC) $$(CFLAGS) $$(COMMON_WARNFLAGS) $$(CWARNFLAGS) \
|
||||
-MMD -MT '$$(DEPROOT)/$(3) $$(OBJROOT)/$(2)' \
|
||||
-MF $$(DEPROOT)/$(3) -o $$(OBJROOT)/$(2) -c $(1)
|
||||
|
||||
endef
|
||||
|
@ -687,12 +748,12 @@ define compile_target_cpp
|
|||
$$(DEPROOT)/$(3) $$(OBJROOT)/$(2): $$(OBJROOT)/created
|
||||
$$(VQ)echo " DEP: $(1)"
|
||||
$$(Q)$$(RM) $$(DEPROOT)/$(3)
|
||||
$$(Q)$$(CC) $$(CFLAGS) -MM \
|
||||
$$(Q)$$(CC) $$(CFLAGS) $$(COMMON_WARNFLAGS) $$(CXXWARNFLAGS) -MM \
|
||||
$(1) | sed 's,^.*:,$$(DEPROOT)/$(3) $$(OBJROOT)/$(2):,' \
|
||||
> $$(DEPROOT)/$(3)
|
||||
$$(VQ)echo " COMPILE: $(1)"
|
||||
$$(Q)$$(RM) $$(OBJROOT)/$(2)
|
||||
$$(Q)$$(CXX) $$(CFLAGS) -o $$(OBJROOT)/$(2) -c $(1)
|
||||
$$(Q)$$(CXX) $$(CXXFLAGS) $$(COMMON_WARNFLAGS) $$(CXXWARNFLAGS) -o $$(OBJROOT)/$(2) -c $(1)
|
||||
|
||||
endef
|
||||
|
||||
|
|
|
@ -8,10 +8,9 @@
|
|||
# To see the available config options, look at Makefile.defaults, but make any
|
||||
# alterations in your Makefile.config
|
||||
|
||||
|
||||
### To enable/disable MNG support, uncomment the appropriate line below.
|
||||
# override NETSURF_USE_MNG := YES
|
||||
# override NETSURF_USE_MNG := NO
|
||||
### To enable/disable PNG support, uncomment the appropriate line below.
|
||||
# override NETSURF_USE_PNG := YES
|
||||
# override NETSURF_USE_PNG := NO
|
||||
|
||||
### To enable/disable SVGTiny support, uncomment the appropriate line below.
|
||||
# override NETSURF_USE_NSSVG := YES
|
||||
|
|
|
@ -43,16 +43,10 @@ NETSURF_USE_GIF := YES
|
|||
# Valid options: YES, NO (highly recommended)
|
||||
NETSURF_USE_JPEG := YES
|
||||
|
||||
# Enable NetSurf's use of libpng for displaying PNGs. If MNG and PNG
|
||||
# are both enabled then NetSurf will choose libpng for PNGs, leaving
|
||||
# MNGs and JNGs to libmng.
|
||||
# Valid options: YES, NO (at least one of PNG/MNG highly recommended)
|
||||
# Enable NetSurf's use of libpng for displaying PNGs.
|
||||
# Valid options: YES, NO (highly recommended)
|
||||
NETSURF_USE_PNG := YES
|
||||
|
||||
# Enable NetSurf's use of libmng for displaying MNGs, JNGs and PNGs
|
||||
# Valid options: YES, NO (at least one of PNG/MNG highly recommended)
|
||||
NETSURF_USE_MNG := YES
|
||||
|
||||
# Enable NetSurf's use of libwebp for displaying WebPs
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_WEBP := NO
|
||||
|
@ -92,9 +86,17 @@ NETSURF_HOMEPAGE := "about:welcome"
|
|||
# Valid options: YES, NO
|
||||
NETSURF_USE_LIBICONV_PLUG := YES
|
||||
|
||||
# Enable building the source object cache filesystem based backing store.
|
||||
# implementation.
|
||||
# Valid options: YES, NO
|
||||
NETSURF_FS_BACKING_STORE := NO
|
||||
|
||||
# Initial CFLAGS. Optimisation level etc. tend to be target specific.
|
||||
CFLAGS :=
|
||||
|
||||
# Initial CXXFLAGS. Optimisation level etc. tend to be target specific.
|
||||
CXXFLAGS :=
|
||||
|
||||
# Default installation/execution prefix
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
|
|
3
README
3
README
|
@ -8,8 +8,7 @@
|
|||
Building NetSurf
|
||||
==================
|
||||
|
||||
Read the appropriate BUILDING-* document in the Docs/ directory for
|
||||
instructions.
|
||||
Read the QUICK-START document in the Docs/ directory for instructions.
|
||||
|
||||
|
||||
Creating a new port
|
||||
|
|
|
@ -2,45 +2,40 @@
|
|||
# Amiga-specific options
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# Force using glibc internal iconv implementation instead of external libiconv
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_LIBICONV_PLUG := YES
|
||||
# Force using glibc internal iconv implementation instead of external libiconv
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_LIBICONV_PLUG := YES
|
||||
|
||||
# Enable NetSurf's use of librosprite for displaying RISC OS Sprites
|
||||
# Valid options: YES, NO, AUTO
|
||||
NETSURF_USE_ROSPRITE := NO
|
||||
# Enable NetSurf's use of librosprite for displaying RISC OS Sprites
|
||||
# Valid options: YES, NO, AUTO
|
||||
NETSURF_USE_ROSPRITE := NO
|
||||
|
||||
# Enable NetSurf's use of libmng for displaying MNGs, JNGs and PNGs
|
||||
# Valid options: YES, NO (at least one of PNG/MNG/DT highly recommended)
|
||||
NETSURF_USE_MNG := NO
|
||||
# Enable NetSurf's use of libwebp for displaying WebPs
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_WEBP := NO
|
||||
|
||||
# Enable NetSurf's use of libwebp for displaying WebPs
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_WEBP := NO
|
||||
# Enable NetSurf to display Amiga icons
|
||||
# Valid options: YES, NO (recommended)
|
||||
NETSURF_USE_AMIGA_ICON := YES
|
||||
|
||||
# Enable NetSurf to display Amiga icons
|
||||
# Valid options: YES, NO (recommended)
|
||||
NETSURF_USE_AMIGA_ICON := YES
|
||||
# Enable NetSurf's use of DataTypes for unknown filetypes
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_AMIGA_DATATYPES := YES
|
||||
|
||||
# Enable NetSurf's use of DataTypes for unknown filetypes
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_AMIGA_DATATYPES := YES
|
||||
# Enable NetSurf's use of libsvgtiny for displaying SVGs
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_NSSVG := YES
|
||||
|
||||
# Enable NetSurf's use of libsvgtiny for displaying SVGs
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_NSSVG := YES
|
||||
# Enable building the source object cache filesystem based backing store.
|
||||
# Valid options: YES, NO
|
||||
NETSURF_FS_BACKING_STORE := YES
|
||||
|
||||
# Enable NetSurf's use of libcairo for some plotter functions
|
||||
# This will also link NetSurf with shared objects, and
|
||||
# requires AmigaOS 4.1 or higher to run the resulting executable
|
||||
# Valid options: YES, NO, AUTO
|
||||
NETSURF_USE_AMIGA_CAIRO := AUTO
|
||||
# Enable NetSurf's use of Spidermonkey 1.80+
|
||||
# Only here to stop the build complaining;
|
||||
# enable NETSURF_USE_MOZJS instead for JavaScript support
|
||||
# Valid options: NO
|
||||
NETSURF_USE_JS := NO
|
||||
|
||||
# Optimisation levels
|
||||
CFLAGS += -O2 -gstabs
|
||||
|
||||
# Enable NetSurf's use of Spidermonkey 1.80+
|
||||
# Only here to stop the build complaining;
|
||||
# enable NETSURF_USE_MOZJS instead for JavaScript support
|
||||
# Valid options: NO
|
||||
NETSURF_USE_JS := NO
|
||||
|
||||
# Optimisation levels
|
||||
CFLAGS += -O2 -gstabs
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Amiga target setup
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
CFLAGS += -std=c99 -Dnsamiga -DFETCHER_CURLL_SCHEDULED
|
||||
CFLAGS += -std=c99 -Dnsamiga
|
||||
|
||||
ifneq ($(SUBTARGET),os3)
|
||||
CFLAGS += -U__STRICT_ANSI__ -D__USE_INLINE__ -D__USE_BASETYPE__
|
||||
|
@ -15,7 +15,6 @@ NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
|
|||
NETSURF_FEATURE_WEBP_CFLAGS := -DWITH_WEBP
|
||||
NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
|
||||
NETSURF_FEATURE_VIDEO_CFLAGS := -DWITH_VIDEO
|
||||
NETSURF_FEATURE_AMIGA_CAIRO_CFLAGS := -DNS_AMIGA_CAIRO
|
||||
|
||||
ifeq ($(HOST),amiga)
|
||||
$(eval $(call feature_enabled,ROSPRITE,-DWITH_NSSPRITE,-lrosprite,Sprite (librosprite)))
|
||||
|
@ -23,30 +22,23 @@ ifeq ($(HOST),amiga)
|
|||
$(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
|
||||
$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
|
||||
$(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
|
||||
$(eval $(call feature_enabled,MNG,,-llcms -ljpeg,PNG/JNG/MNG (libmng)))
|
||||
$(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp,WebP (libwebp)))
|
||||
$(eval $(call feature_enabled,VIDEO,-DWITH_VIDEO -I /SDK/local/newlib/include/glib-2.0,-lgstreamer-0.10 -lglib-2.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lintl -lffi,Video (libgstreamer)))
|
||||
$(eval $(call feature_enabled,JS,-DXP_UNIX -DWITH_JS -DJS_VERSION=185,-lstdc++ -lmozjs185,JavaScript))
|
||||
$(eval $(call feature_enabled,MOZJS,-DXP_AMIGA -DWITH_MOZJS -DJS_VERSION=170 -DJSVERSION_LATEST=170 -DJSOPTION_JIT=0 -DJSCLASS_GLOBAL_FLAGS=0,-ljs -lfdlibm,JavaScript))
|
||||
$(eval $(call feature_enabled,AMIGA_CAIRO,-DNS_AMIGA_CAIRO,,Cairo))
|
||||
$(eval $(call feature_enabled,AMIGA_ICON,-DWITH_AMIGA_ICON,,Amiga icon))
|
||||
$(eval $(call feature_enabled,AMIGA_DATATYPES,-DWITH_AMIGA_DATATYPES,,DataTypes))
|
||||
|
||||
CFLAGS += -I /SDK/local/common/include/libpng12
|
||||
LDFLAGS += -lcurl -lrtmp -lpthread -ltre -lintl -lauto -lpbl
|
||||
LDFLAGS += -lssl -lcrypto -ldom -lhubbub -lcss -lparserutils -lwapcaplet
|
||||
|
||||
ifeq ($(NETSURF_USE_AMIGA_CAIRO),YES)
|
||||
CFLAGS += -I /SDK/local/common/include/cairo
|
||||
LDFLAGS += -use-dynld -ldl -lcairo -lpixman-1 -lfreetype -lfontconfig -lpng -lexpat
|
||||
endif
|
||||
else
|
||||
$(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
|
||||
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
|
||||
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
|
||||
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG))
|
||||
$(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,NSSVG))
|
||||
$(eval $(call pkg_config_find_and_add_enabled,AMIGA_CAIRO,cairo,Cairo))
|
||||
$(eval $(call feature_enabled,MOZJS,-DXP_AMIGA -DWITH_MOZJS -DJS_VERSION=170 -DJSVERSION_LATEST=170 -DJSOPTION_JIT=0 -DJSCLASS_GLOBAL_FLAGS=0,-ljs,JavaScript))
|
||||
$(eval $(call feature_enabled,AMIGA_ICON,-DWITH_AMIGA_ICON,,Amiga icon))
|
||||
$(eval $(call feature_enabled,AMIGA_DATATYPES,-DWITH_AMIGA_DATATYPES,,DataTypes))
|
||||
|
||||
|
@ -54,7 +46,7 @@ else
|
|||
CFLAGS += $(shell $(PKG_CONFIG) --cflags libcurl openssl)
|
||||
CFLAGS += $(shell $(PKG_CONFIG) --cflags tre libdom libcss)
|
||||
|
||||
LDFLAGS += $(shell $(PKG_CONFIG) --libs libcurl openssl)
|
||||
LDFLAGS += $(shell $(PKG_CONFIG) --static --libs libcurl openssl)
|
||||
LDFLAGS += $(shell $(PKG_CONFIG) --libs tre libdom libcss)
|
||||
LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib
|
||||
|
||||
|
@ -109,7 +101,7 @@ AMIGA_LIBRARIES := parserutils.library nsgif.library nsbmp.library iconv.library
|
|||
AMIGA_LIBS := $(addprefix /Libs/,$(AMIGA_LIBRARIES))
|
||||
AMIGA_SHARED_OBJS := libjpeg.so.12 libcurl.so.7 librtmp.so.0 libsvgtiny.so.0 \
|
||||
libssl.so.1.0.0 libcrypto.so.1.0.0 libcss.so.0 libwapcaplet.so.0 libpng12.so \
|
||||
libdom.so.0 libhubbub.so.0 libtre.so.5 libintl.so
|
||||
libdom.so.0 libhubbub.so.0 libtre.so.5 libintl.so libparserutils.so.0
|
||||
AMIGA_SOBJS := $(addprefix /SObjs/,$(AMIGA_SHARED_OBJS))
|
||||
AMIGA_DISTRIBUTION_FILES := amiga/dist/*
|
||||
AMIGA_INSTALL_TARGET_DIR := NetSurf_Amiga
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
#include "amigaguide_class.h"
|
||||
|
||||
|
||||
|
||||
struct localObjectData
|
||||
{
|
||||
struct NewAmigaGuide nag;
|
||||
|
@ -15,7 +17,6 @@ struct localObjectData
|
|||
AMIGAGUIDECONTEXT agHandle;
|
||||
uint32 agContextID;
|
||||
uint32 agSignal;
|
||||
BOOL agActive;
|
||||
};
|
||||
|
||||
struct Library *AmigaGuideBase = NULL;
|
||||
|
@ -34,6 +35,7 @@ uint32 om_set(Class *, Object *, struct opSet *);
|
|||
uint32 om_get(Class *, Object *, struct opGet *);
|
||||
uint32 agm_open(Class *, Object *, Msg);
|
||||
uint32 agm_close(Class *, Object *, Msg);
|
||||
uint32 agm_process(Class *, Object *, Msg);
|
||||
|
||||
|
||||
/* *************************** class initialization and disposal ***************************** */
|
||||
|
@ -107,6 +109,9 @@ static uint32 dispatchAGClass(Class *cl, Object *o, Msg msg)
|
|||
case AGM_CLOSE:
|
||||
return agm_close(cl, o, msg);
|
||||
|
||||
case AGM_PROCESS:
|
||||
return agm_process(cl, o, msg);
|
||||
|
||||
default:
|
||||
return IIntuition->IDoSuperMethodA(cl, o, msg);
|
||||
}
|
||||
|
@ -128,7 +133,6 @@ uint32 om_new(Class *cl, Object *o, struct opSet *msg)
|
|||
if ( (lod = (struct localObjectData *)INST_DATA(cl, retVal)) )
|
||||
{
|
||||
// Initialize values.
|
||||
lod->agActive = FALSE;
|
||||
lod->agHandle = NULL;
|
||||
lod->agContextID = 0;
|
||||
lod->nag.nag_Name = NULL;
|
||||
|
@ -169,10 +173,9 @@ uint32 om_dispose(Class *cl, Object *o, Msg msg)
|
|||
uint32 om_set(Class *cl, Object *o, struct opSet *msg)
|
||||
{
|
||||
struct localObjectData *lod = (struct localObjectData *)INST_DATA(cl, o);
|
||||
struct TagItem *tags, *ti;
|
||||
|
||||
|
||||
tags = msg->ops_AttrList;
|
||||
struct TagItem *ti = NULL, *tags = msg->ops_AttrList;
|
||||
uint32 retVal = 0L;
|
||||
|
||||
|
||||
while ((ti = IUtility->NextTagItem (&tags)))
|
||||
{
|
||||
|
@ -180,31 +183,32 @@ uint32 om_set(Class *cl, Object *o, struct opSet *msg)
|
|||
{
|
||||
case AMIGAGUIDE_Name:
|
||||
lod->nag.nag_Name = (STRPTR)ti->ti_Data;
|
||||
lod->agActive = FALSE; // Database name has changed, we must setup the help system again.
|
||||
retVal++;
|
||||
break;
|
||||
|
||||
case AMIGAGUIDE_Screen:
|
||||
lod->nag.nag_Screen = (struct Screen *)ti->ti_Data;
|
||||
lod->agActive = FALSE; // Screen pointer has changed, we must setup the help system again.
|
||||
retVal++;
|
||||
break;
|
||||
|
||||
case AMIGAGUIDE_PubScreen:
|
||||
lod->nag.nag_PubScreen = (STRPTR)ti->ti_Data;
|
||||
lod->agActive = FALSE; // Pubscreen name has changed, we must setup the help system again.
|
||||
retVal++;
|
||||
break;
|
||||
|
||||
case AMIGAGUIDE_BaseName:
|
||||
lod->nag.nag_BaseName = (STRPTR)ti->ti_Data;
|
||||
lod->agActive = FALSE; // Application basename has changed, we must setup the help system again.
|
||||
retVal++;
|
||||
break;
|
||||
|
||||
case AMIGAGUIDE_ContextArray:
|
||||
lod->nag.nag_Context = (STRPTR *)ti->ti_Data;
|
||||
lod->agActive = FALSE; // Context array has changed, we must setup the help system again.
|
||||
retVal++;
|
||||
break;
|
||||
|
||||
case AMIGAGUIDE_ContextID:
|
||||
lod->agContextID = (uint32)ti->ti_Data;
|
||||
retVal++;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -212,38 +216,7 @@ uint32 om_set(Class *cl, Object *o, struct opSet *msg)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Setup the help system, if not ready yet or needs changing.
|
||||
if ( lod->agActive == FALSE )
|
||||
{
|
||||
// Shut down help system should it already be running.
|
||||
if ( lod->agHandle ) agm_close(cl, o, (Msg)msg);
|
||||
|
||||
// (Re)establish the AmigaGuide context and open the database asynchronously.
|
||||
if ( (lod->agHandle = IAmigaGuide->OpenAmigaGuideAsync(&(lod->nag), NULL)) )
|
||||
{
|
||||
if ( (lod->agSignal = IAmigaGuide->AmigaGuideSignal(lod->agHandle)) )
|
||||
{
|
||||
// Wait until the help system is up and running.
|
||||
IExec->Wait(lod->agSignal);
|
||||
while ( !(lod->agActive) )
|
||||
{
|
||||
while ( (lod->agm = IAmigaGuide->GetAmigaGuideMsg(lod->agHandle)) )
|
||||
{
|
||||
// The AmigaGuide process started OK.
|
||||
if ( lod->agm->agm_Type == ActiveToolID ) lod->agActive = TRUE;
|
||||
|
||||
// Opening the guide file failed for some reason, continue as usual.
|
||||
if ( lod->agm->agm_Type == ToolStatusID && lod->agm->agm_Pri_Ret ) lod->agActive = TRUE;
|
||||
|
||||
IAmigaGuide->ReplyAmigaGuideMsg(lod->agm);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (uint32)lod->agHandle;
|
||||
return retVal;
|
||||
|
||||
}
|
||||
|
||||
|
@ -261,32 +234,37 @@ uint32 om_get(Class *cl, Object *o, struct opGet *msg)
|
|||
{
|
||||
case AMIGAGUIDE_Name:
|
||||
*(msg->opg_Storage) = (uint32)lod->nag.nag_Name;
|
||||
retVal = 1;
|
||||
retVal = 1L;
|
||||
break;
|
||||
|
||||
case AMIGAGUIDE_Screen:
|
||||
*(msg->opg_Storage) = (uint32)lod->nag.nag_Screen;
|
||||
retVal = 1;
|
||||
retVal = 1L;
|
||||
break;
|
||||
|
||||
case AMIGAGUIDE_PubScreen:
|
||||
*(msg->opg_Storage) = (uint32)lod->nag.nag_PubScreen;
|
||||
retVal = 1;
|
||||
retVal = 1L;
|
||||
break;
|
||||
|
||||
case AMIGAGUIDE_BaseName:
|
||||
*(msg->opg_Storage) = (uint32)lod->nag.nag_BaseName;
|
||||
retVal = 1;
|
||||
retVal = 1L;
|
||||
break;
|
||||
|
||||
case AMIGAGUIDE_ContextArray:
|
||||
*(msg->opg_Storage) = (uint32)lod->nag.nag_Context;
|
||||
retVal = 1;
|
||||
retVal = 1L;
|
||||
break;
|
||||
|
||||
case AMIGAGUIDE_ContextID:
|
||||
*(msg->opg_Storage) = (uint32)lod->agContextID;
|
||||
retVal = 1;
|
||||
retVal = 1L;
|
||||
break;
|
||||
|
||||
case AMIGAGUIDE_Signal:
|
||||
*(msg->opg_Storage) = (uint32)lod->agSignal;
|
||||
retVal = 1L;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -304,23 +282,47 @@ uint32 om_get(Class *cl, Object *o, struct opGet *msg)
|
|||
uint32 agm_open(Class *cl, Object *o, Msg msg)
|
||||
{
|
||||
struct localObjectData *lod = (struct localObjectData *)INST_DATA(cl, o);
|
||||
uint32 retVal = 0;
|
||||
BOOL agActive = FALSE;
|
||||
uint32 retVal = 0L;
|
||||
|
||||
|
||||
if ( (lod->agHandle) && (lod->agActive) )
|
||||
{
|
||||
if ( lod->nag.nag_Context )
|
||||
// Close a previous instance.
|
||||
if ( lod->agHandle ) agm_close(cl, o, msg);
|
||||
|
||||
// (Re)establish the AmigaGuide context and open the database asynchronously.
|
||||
if ( (lod->agHandle = IAmigaGuide->OpenAmigaGuideAsync(&(lod->nag), NULL)) )
|
||||
{
|
||||
// A context node array is provided = open the current context node.
|
||||
IAmigaGuide->SetAmigaGuideContext(lod->agHandle, lod->agContextID, NULL);
|
||||
retVal = IAmigaGuide->SendAmigaGuideContext(lod->agHandle, NULL);
|
||||
if ( (lod->agSignal = IAmigaGuide->AmigaGuideSignal(lod->agHandle)) )
|
||||
{
|
||||
// Wait until the database is displayed and ready.
|
||||
IExec->Wait(lod->agSignal);
|
||||
while ( agActive == FALSE )
|
||||
{
|
||||
while ( (lod->agm = IAmigaGuide->GetAmigaGuideMsg(lod->agHandle)) )
|
||||
{
|
||||
// The AmigaGuide process started OK.
|
||||
if ( lod->agm->agm_Type == ActiveToolID ) agActive = TRUE;
|
||||
|
||||
// Opening the guide file failed for some reason, continue as usual.
|
||||
if ( lod->agm->agm_Type == ToolStatusID && lod->agm->agm_Pri_Ret ) agActive = TRUE;
|
||||
|
||||
IAmigaGuide->ReplyAmigaGuideMsg(lod->agm);
|
||||
}
|
||||
}
|
||||
if ( lod->nag.nag_Context )
|
||||
{
|
||||
// A context node array is provided = open the current context node.
|
||||
IAmigaGuide->SetAmigaGuideContext(lod->agHandle, lod->agContextID, NULL);
|
||||
retVal = IAmigaGuide->SendAmigaGuideContext(lod->agHandle, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No context array is provided = open the main node.
|
||||
retVal = IAmigaGuide->SendAmigaGuideCmd(lod->agHandle, "LINK MAIN", TAG_DONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No context array is provided = open the main node.
|
||||
retVal = IAmigaGuide->SendAmigaGuideCmd(lod->agHandle, "LINK MAIN", TAG_DONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
@ -332,15 +334,52 @@ uint32 agm_open(Class *cl, Object *o, Msg msg)
|
|||
uint32 agm_close(Class *cl, Object *o, Msg msg)
|
||||
{
|
||||
struct localObjectData *lod = (struct localObjectData *)INST_DATA(cl, o);
|
||||
uint32 retVal = 0L;
|
||||
|
||||
|
||||
if ( lod->agHandle )
|
||||
{
|
||||
IAmigaGuide->CloseAmigaGuide(lod->agHandle);
|
||||
lod->agHandle = NULL;
|
||||
lod->agActive = FALSE;
|
||||
lod->agSignal = 0;
|
||||
retVal = 1L;
|
||||
}
|
||||
|
||||
return (uint32)lod->agHandle;
|
||||
return retVal;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
uint32 agm_process(Class *cl, Object *o, Msg msg)
|
||||
{
|
||||
struct localObjectData *lod = (struct localObjectData *)INST_DATA(cl, o);
|
||||
uint32 retVal = 0L;
|
||||
|
||||
|
||||
if (lod->agHandle)
|
||||
{
|
||||
while ( (lod->agm = IAmigaGuide->GetAmigaGuideMsg(lod->agHandle)) )
|
||||
{
|
||||
switch (lod->agm->agm_Type)
|
||||
{
|
||||
case ShutdownMsgID:
|
||||
agm_close(cl, o, msg);
|
||||
retVal = 1L;
|
||||
break;
|
||||
|
||||
default:
|
||||
//printf("%d\n", lod->agm->agm_Type);
|
||||
break;
|
||||
}
|
||||
IAmigaGuide->ReplyAmigaGuideMsg(lod->agm);
|
||||
}
|
||||
}
|
||||
|
||||
return retVal;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -27,10 +27,13 @@
|
|||
#define AMIGAGUIDE_BaseName (AMIGAGUIDE_Dummy + 4) // Basename of the application that opens the help file.
|
||||
#define AMIGAGUIDE_ContextArray (AMIGAGUIDE_Dummy + 5) // Context node array (must be NULL-terminated).
|
||||
#define AMIGAGUIDE_ContextID (AMIGAGUIDE_Dummy + 6) // Index value of the node to display.
|
||||
#define AMIGAGUIDE_Signal (AMIGAGUIDE_Dummy + 7) // Signal mask to wait on
|
||||
|
||||
// method definition
|
||||
#define AGM_OPEN WM_OPEN
|
||||
#define AGM_CLOSE WM_CLOSE
|
||||
#define AGM_Dummy AMIGAGUIDE_Dummy + 100
|
||||
#define AGM_OPEN AGM_Dummy + 1
|
||||
#define AGM_CLOSE AGM_Dummy + 2
|
||||
#define AGM_PROCESS AGM_Dummy + 3
|
||||
|
||||
// function prototypes
|
||||
Class *initAGClass(void);
|
||||
|
|
|
@ -196,12 +196,12 @@ int ami_find_tab_bw(struct gui_window_2 *gwin, struct browser_window *bw)
|
|||
|
||||
struct browser_window *ami_find_tab(int window, int tab)
|
||||
{
|
||||
int windows = 0, tabs = 0;
|
||||
struct nsObject *node, *nnode;
|
||||
struct gui_window_2 *gwin;
|
||||
|
||||
if(!IsMinListEmpty(window_list))
|
||||
{
|
||||
int windows = 0;
|
||||
|
||||
node = (struct nsObject *)GetHead((struct List *)window_list);
|
||||
|
||||
do
|
||||
|
@ -248,8 +248,7 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
|
|||
browser_window_navigate(curbw,
|
||||
url,
|
||||
NULL,
|
||||
BROWSER_WINDOW_DOWNLOAD |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
BW_NAVIGATE_DOWNLOAD,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
@ -257,9 +256,8 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
|
|||
}
|
||||
else if(cmd->ac_ArgList[2])
|
||||
{
|
||||
browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY |
|
||||
BROWSER_WINDOW_TAB,
|
||||
browser_window_create(BW_CREATE_HISTORY |
|
||||
BW_CREATE_TAB,
|
||||
url,
|
||||
NULL,
|
||||
bw,
|
||||
|
@ -267,8 +265,7 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
|
|||
}
|
||||
else if(cmd->ac_ArgList[1])
|
||||
{
|
||||
browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY,
|
||||
browser_window_create(BW_CREATE_HISTORY,
|
||||
url,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -281,16 +278,14 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
|
|||
browser_window_navigate(bw,
|
||||
url,
|
||||
NULL,
|
||||
BROWSER_WINDOW_HISTORY |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
BW_NAVIGATE_HISTORY,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY,
|
||||
browser_window_create(BW_CREATE_HISTORY,
|
||||
url,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -510,8 +505,7 @@ STATIC VOID rx_home(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
|
|||
browser_window_navigate(bw,
|
||||
url,
|
||||
NULL,
|
||||
BROWSER_WINDOW_HISTORY |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
BW_NAVIGATE_HISTORY,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
@ -575,7 +569,6 @@ STATIC VOID rx_windows(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((
|
|||
|
||||
STATIC VOID rx_active(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused)))
|
||||
{
|
||||
int windows = 0, tabs = 0;
|
||||
int window = 0, tab = 0;
|
||||
struct browser_window *bw = curbw;
|
||||
struct nsObject *node, *nnode;
|
||||
|
@ -585,6 +578,8 @@ STATIC VOID rx_active(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((u
|
|||
|
||||
if(!IsMinListEmpty(window_list))
|
||||
{
|
||||
int windows = 0;
|
||||
|
||||
node = (struct nsObject *)GetHead((struct List *)window_list);
|
||||
|
||||
do
|
||||
|
|
|
@ -152,7 +152,9 @@ bool bitmap_save(void *bitmap, const char *path, unsigned flags)
|
|||
int err = 0;
|
||||
Object *dto = NULL;
|
||||
|
||||
if(!ami_download_check_overwrite(path, NULL, 0)) return false;
|
||||
if ((flags & AMI_BITMAP_FORCE_OVERWRITE) == 0) {
|
||||
if(!ami_download_check_overwrite(path, NULL, 0)) return false;
|
||||
}
|
||||
|
||||
if(dto = ami_datatype_object_from_bitmap(bitmap))
|
||||
{
|
||||
|
@ -453,7 +455,7 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
|
|||
COMPTAG_DestHeight,height,
|
||||
COMPTAG_OffsetX,0,
|
||||
COMPTAG_OffsetY,0,
|
||||
COMPTAG_FriendBitMap,friendbm,
|
||||
COMPTAG_FriendBitMap, scrn->RastPort.BitMap,
|
||||
TAG_DONE);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <libraries/Picasso96.h>
|
||||
|
||||
#define AMI_BITMAP_FORMAT RGBFB_R8G8B8A8
|
||||
#define AMI_BITMAP_FORCE_OVERWRITE 0xFF
|
||||
|
||||
struct bitmap {
|
||||
int width;
|
||||
|
|
|
@ -16,10 +16,21 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <proto/iffparse.h>
|
||||
#include <proto/intuition.h>
|
||||
#include <proto/exec.h>
|
||||
#include <proto/datatypes.h>
|
||||
#include <proto/diskfont.h>
|
||||
|
||||
#include <diskfont/diskfonttag.h>
|
||||
#include <datatypes/textclass.h>
|
||||
#include <datatypes/pictureclass.h>
|
||||
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/utf8.h"
|
||||
#include "desktop/gui.h"
|
||||
#include "desktop/plotters.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "utils/nsoption.h"
|
||||
|
||||
#include "amiga/bitmap.h"
|
||||
#include "amiga/clipboard.h"
|
||||
|
@ -31,18 +42,6 @@
|
|||
#include "amiga/menu.h"
|
||||
#include "amiga/utf8.h"
|
||||
|
||||
#include "utils/utf8.h"
|
||||
|
||||
#include <proto/iffparse.h>
|
||||
#include <proto/intuition.h>
|
||||
#include <proto/exec.h>
|
||||
#include <proto/datatypes.h>
|
||||
#include <proto/diskfont.h>
|
||||
|
||||
#include <diskfont/diskfonttag.h>
|
||||
#include <datatypes/textclass.h>
|
||||
#include <datatypes/pictureclass.h>
|
||||
|
||||
#define ID_UTF8 MAKE_ID('U','T','F','8')
|
||||
|
||||
struct IFFHandle *iffh = NULL;
|
||||
|
@ -107,17 +106,6 @@ void gui_start_selection(struct gui_window *g)
|
|||
OnMenu(g->shared->win, AMI_MENU_CUT);
|
||||
}
|
||||
|
||||
void gui_clear_selection(struct gui_window *g)
|
||||
{
|
||||
if(!g) return;
|
||||
if(!g->shared->win) return;
|
||||
if(nsoption_bool(kiosk_mode) == true) return;
|
||||
|
||||
OffMenu(g->shared->win, AMI_MENU_CLEAR);
|
||||
OffMenu(g->shared->win, AMI_MENU_CUT);
|
||||
OffMenu(g->shared->win, AMI_MENU_COPY);
|
||||
}
|
||||
|
||||
char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codeset, size_t *text_length)
|
||||
{
|
||||
struct CollectionItem *ci_new = NULL, *ci_next, *ci_curr = ci;
|
||||
|
@ -197,12 +185,10 @@ char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codeset, size
|
|||
|
||||
void gui_get_clipboard(char **buffer, size_t *length)
|
||||
{
|
||||
struct ContextNode *cn;
|
||||
struct CollectionItem *ci = NULL;
|
||||
struct StoredProperty *sp = NULL;
|
||||
ULONG rlen=0,error;
|
||||
struct CSet *cset;
|
||||
LONG codeset = 0;
|
||||
|
||||
if(OpenIFF(iffh,IFFF_READ)) return;
|
||||
|
||||
|
@ -216,6 +202,7 @@ void gui_get_clipboard(char **buffer, size_t *length)
|
|||
if(ci = FindCollection(iffh, ID_FTXT, ID_UTF8)) {
|
||||
*buffer = ami_clipboard_cat_collection(ci, 106, length);
|
||||
} else if(ci = FindCollection(iffh, ID_FTXT, ID_CHRS)) {
|
||||
LONG codeset = 0;
|
||||
if(sp = FindProp(iffh, ID_FTXT, ID_CSET)) {
|
||||
cset = (struct CSet *)sp->sp_Data;
|
||||
codeset = cset->CodeSet;
|
||||
|
@ -226,7 +213,7 @@ void gui_get_clipboard(char **buffer, size_t *length)
|
|||
CloseIFF(iffh);
|
||||
}
|
||||
|
||||
void gui_set_clipboard(const char *buffer, size_t length,
|
||||
static void gui_set_clipboard(const char *buffer, size_t length,
|
||||
nsclipboard_styles styles[], int n_styles)
|
||||
{
|
||||
char *text;
|
||||
|
@ -257,7 +244,7 @@ void gui_set_clipboard(const char *buffer, size_t length,
|
|||
if(nsoption_bool(clipboard_write_utf8)) {
|
||||
WriteChunkBytes(iffh, buffer, length);
|
||||
} else {
|
||||
if(utf8_to_local_encoding(buffer, length, &text) == UTF8_CONVERT_OK) {
|
||||
if(utf8_to_local_encoding(buffer, length, &text) == NSERROR_OK) {
|
||||
char *p;
|
||||
|
||||
p = text;
|
||||
|
@ -387,3 +374,10 @@ bool ami_easy_clipboard_svg(struct hlcache_handle *c)
|
|||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct gui_clipboard_table clipboard_table = {
|
||||
.get = gui_get_clipboard,
|
||||
.set = gui_set_clipboard,
|
||||
};
|
||||
|
||||
struct gui_clipboard_table *amiga_clipboard_table = &clipboard_table;
|
||||
|
|
|
@ -25,6 +25,11 @@ struct hlcache_handle;
|
|||
struct selection;
|
||||
struct gui_window;
|
||||
struct gui_window_2;
|
||||
struct gui_clipboard_table;
|
||||
|
||||
extern struct gui_clipboard_table *amiga_clipboard_table;
|
||||
|
||||
void gui_start_selection(struct gui_window *g);
|
||||
|
||||
void ami_clipboard_init(void);
|
||||
void ami_clipboard_free(void);
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
#include "amiga/theme.h"
|
||||
#include "amiga/tree.h"
|
||||
#include "amiga/utf8.h"
|
||||
#include "desktop/browser_history.h"
|
||||
#include "desktop/browser_private.h"
|
||||
#include "desktop/local_history.h"
|
||||
#include "desktop/hotlist.h"
|
||||
#include "desktop/searchweb.h"
|
||||
#include "desktop/textinput.h"
|
||||
|
@ -53,7 +53,7 @@
|
|||
|
||||
static uint32 ami_context_menu_hook(struct Hook *hook, Object *item, APTR reserved);
|
||||
static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR reserved);
|
||||
static bool ami_context_menu_history(const struct history *history, int x0, int y0,
|
||||
static bool ami_context_menu_history(const struct browser_window *bw, int x0, int y0,
|
||||
int x1, int y1, const struct history_entry *entry, void *user_data);
|
||||
|
||||
static uint32 ami_popup_hook(struct Hook *hook,Object *item,APTR reserved);
|
||||
|
@ -269,7 +269,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
|
|||
PMIA_UserData, nsurl_access(hlcache_handle_get_url(userdata)),
|
||||
PMIA_CommKey, "B",
|
||||
TAG_DONE),
|
||||
TAG_DONE),
|
||||
PMEND,
|
||||
TAG_DONE),
|
||||
~0);
|
||||
break;
|
||||
|
@ -324,7 +324,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
|
|||
PMIA_UserData, userdata,
|
||||
PMIA_Disabled, (content_get_type(userdata) != CONTENT_HTML),
|
||||
TAG_DONE),
|
||||
TAG_DONE),
|
||||
PMEND,
|
||||
TAG_DONE),
|
||||
~0);
|
||||
break;
|
||||
|
@ -364,7 +364,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
|
|||
PMIA_UserData, userdata,
|
||||
PMIA_Disabled, !browser_window_stop_available(userdata),
|
||||
TAG_DONE),
|
||||
TAG_DONE),
|
||||
PMEND,
|
||||
TAG_DONE),
|
||||
~0);
|
||||
break;
|
||||
|
@ -410,7 +410,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
|
|||
PMIA_ID, CMID_SAVEURL,
|
||||
PMIA_UserData, userdata,
|
||||
TAG_DONE),
|
||||
TAG_DONE),
|
||||
PMEND,
|
||||
TAG_DONE),
|
||||
~0);
|
||||
break;
|
||||
|
@ -467,7 +467,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
|
|||
PMIA_UserData, userdata,
|
||||
PMIA_Disabled, !ami_mime_content_to_cmd(userdata),
|
||||
TAG_DONE),
|
||||
TAG_DONE),
|
||||
PMEND,
|
||||
TAG_DONE),
|
||||
~0);
|
||||
break;
|
||||
|
@ -598,8 +598,8 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y)
|
|||
ctxmenuhook.h_SubEntry = NULL;
|
||||
ctxmenuhook.h_Data = gwin;
|
||||
|
||||
ctxmenuobj = NewObject( POPUPMENU_GetClass(), NULL,
|
||||
PMA_MenuHandler, &ctxmenuhook,
|
||||
ctxmenuobj = NewObject( POPUPMENU_GetClass(), NULL,
|
||||
PMA_MenuHandler, &ctxmenuhook,
|
||||
TAG_DONE);
|
||||
|
||||
if(gwin->bw && gwin->bw->history &&
|
||||
|
@ -607,7 +607,7 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y)
|
|||
gwin->win->MouseX, gwin->win->MouseY))
|
||||
{
|
||||
gwin->temp = 0;
|
||||
history_enumerate_back(gwin->bw->history, ami_context_menu_history, gwin);
|
||||
browser_window_history_enumerate_back(gwin->bw, ami_context_menu_history, gwin);
|
||||
|
||||
IDoMethod(ctxmenuobj, PM_INSERT,
|
||||
NewObject(POPUPMENU_GetItemClass(), NULL,
|
||||
|
@ -630,7 +630,7 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y)
|
|||
gwin->win->MouseX, gwin->win->MouseY))
|
||||
{
|
||||
gwin->temp = 0;
|
||||
history_enumerate_forward(gwin->bw->history, ami_context_menu_history, gwin);
|
||||
browser_window_history_enumerate_forward(gwin->bw, ami_context_menu_history, gwin);
|
||||
|
||||
IDoMethod(ctxmenuobj, PM_INSERT,
|
||||
NewObject(POPUPMENU_GetItemClass(), NULL,
|
||||
|
@ -707,7 +707,7 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y)
|
|||
|
||||
static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved)
|
||||
{
|
||||
int32 itemid = 0;
|
||||
int32 itemid = 0;
|
||||
struct gui_window_2 *gwin = hook->h_Data;
|
||||
APTR userdata = NULL;
|
||||
struct browser_window *bw;
|
||||
|
@ -718,10 +718,9 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
|
|||
nsurl *url;
|
||||
nserror error;
|
||||
|
||||
if(GetAttrs(item,PMIA_ID,&itemid,
|
||||
PMIA_UserData,&userdata,
|
||||
TAG_DONE))
|
||||
{
|
||||
if(GetAttrs(item, PMIA_ID, &itemid,
|
||||
PMIA_UserData, &userdata,
|
||||
TAG_DONE)) {
|
||||
switch(itemid)
|
||||
{
|
||||
case CMID_SELECTFILE:
|
||||
|
@ -742,17 +741,11 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
|
|||
strlcpy(fname,filereq->fr_Drawer,1024);
|
||||
AddPart(fname,filereq->fr_File,1024);
|
||||
|
||||
if(utf8_from_local_encoding(fname,0,&utf8_fn) != UTF8_CONVERT_OK)
|
||||
{
|
||||
warn_user("NoMemory","");
|
||||
break;
|
||||
}
|
||||
|
||||
browser_window_drop_file_at_point(
|
||||
file_input->bw,
|
||||
file_input->x,
|
||||
file_input->y,
|
||||
utf8_fn);
|
||||
fname);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -786,8 +779,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
|
|||
case CMID_URLOPENWIN:
|
||||
error = nsurl_create(userdata, &url);
|
||||
if (error == NSERROR_OK) {
|
||||
error = browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY,
|
||||
error = browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY,
|
||||
url,
|
||||
hlcache_handle_get_url(gwin->bw->current_content),
|
||||
gwin->bw,
|
||||
|
@ -805,9 +797,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
|
|||
case CMID_URLOPENTAB:
|
||||
error = nsurl_create(userdata, &url);
|
||||
if (error == NSERROR_OK) {
|
||||
error = browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY |
|
||||
BROWSER_WINDOW_TAB,
|
||||
error = browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY | BW_CREATE_TAB,
|
||||
url,
|
||||
hlcache_handle_get_url(gwin->bw->current_content),
|
||||
gwin->bw,
|
||||
|
@ -830,8 +820,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
|
|||
browser_window_navigate(gwin->bw,
|
||||
url,
|
||||
hlcache_handle_get_url(gwin->bw->current_content),
|
||||
BROWSER_WINDOW_DOWNLOAD |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
BW_NAVIGATE_DOWNLOAD,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
@ -845,8 +834,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
|
|||
browser_window_navigate(gwin->bw,
|
||||
hlcache_handle_get_url(userdata),
|
||||
hlcache_handle_get_url(gwin->bw->current_content),
|
||||
BROWSER_WINDOW_HISTORY |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
BW_NAVIGATE_HISTORY,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
@ -862,8 +850,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
|
|||
browser_window_navigate(gwin->bw,
|
||||
url,
|
||||
hlcache_handle_get_url(gwin->bw->current_content),
|
||||
BROWSER_WINDOW_HISTORY |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
BW_NAVIGATE_HISTORY,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
@ -923,7 +910,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
|
|||
}
|
||||
else
|
||||
{
|
||||
history_go(gwin->bw, gwin->bw->history,
|
||||
browser_window_history_go(gwin->bw,
|
||||
(struct history_entry *)userdata, false);
|
||||
}
|
||||
break;
|
||||
|
@ -938,8 +925,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
|
|||
browser_window_navigate(gwin->bw,
|
||||
url,
|
||||
NULL,
|
||||
BROWSER_WINDOW_HISTORY |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
BW_NAVIGATE_HISTORY,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
@ -996,27 +982,27 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
|
|||
case CMID_SELSEARCH:
|
||||
{
|
||||
char *sel;
|
||||
char *urltxt;
|
||||
nsurl *url;
|
||||
|
||||
if(sel = browser_window_get_selection(gwin->bw))
|
||||
{
|
||||
urltxt = search_web_from_term(sel);
|
||||
nserror ret;
|
||||
nsurl *url;
|
||||
|
||||
if (nsurl_create(urltxt, &url) != NSERROR_OK) {
|
||||
warn_user("NoMemory", 0);
|
||||
} else {
|
||||
browser_window_navigate(gwin->bw,
|
||||
url,
|
||||
NULL,
|
||||
BROWSER_WINDOW_HISTORY |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
ret = search_web_omni(sel, SEARCH_WEB_OMNI_SEARCHONLY, &url);
|
||||
free(sel);
|
||||
if (ret == NSERROR_OK) {
|
||||
ret = browser_window_navigate(gwin->bw,
|
||||
url,
|
||||
NULL,
|
||||
BW_NAVIGATE_HISTORY,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
nsurl_unref(url);
|
||||
}
|
||||
free(sel);
|
||||
if (ret != NSERROR_OK) {
|
||||
warn_user(messages_get_errorcode(ret), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -1262,8 +1248,9 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r
|
|||
return itemid;
|
||||
}
|
||||
|
||||
static bool ami_context_menu_history(const struct history *history, int x0, int y0,
|
||||
int x1, int y1, const struct history_entry *entry, void *user_data)
|
||||
static bool ami_context_menu_history(const struct browser_window *bw,
|
||||
int x0, int y0, int x1, int y1,
|
||||
const struct history_entry *entry, void *user_data)
|
||||
{
|
||||
struct gui_window_2 *gwin = (struct gui_window_2 *)user_data;
|
||||
|
||||
|
@ -1272,7 +1259,7 @@ static bool ami_context_menu_history(const struct history *history, int x0, int
|
|||
|
||||
IDoMethod(ctxmenuobj, PM_INSERT,
|
||||
NewObject(POPUPMENU_GetItemClass(), NULL,
|
||||
PMIA_Title, (ULONG)history_entry_get_title(entry),
|
||||
PMIA_Title, (ULONG)browser_window_history_entry_get_title(entry),
|
||||
PMIA_ID, CMID_HISTORY,
|
||||
PMIA_UserData, entry,
|
||||
TAG_DONE),
|
||||
|
@ -1288,7 +1275,7 @@ static uint32 ami_popup_hook(struct Hook *hook,Object *item,APTR reserved)
|
|||
|
||||
if(GetAttr(PMIA_ID, item, &itemid))
|
||||
{
|
||||
form_select_process_selection(gwin->shared->bw->current_content,gwin->shared->control,itemid);
|
||||
form_select_process_selection(gwin->shared->control,itemid);
|
||||
}
|
||||
|
||||
return itemid;
|
||||
|
|
|
@ -27,4 +27,7 @@ void ami_context_menu_free(void);
|
|||
BOOL ami_context_menu_mouse_trap(struct gui_window_2 *gwin, BOOL trap);
|
||||
void ami_context_menu_show(struct gui_window_2 *gwin, int x, int y);
|
||||
void ami_context_menu_show_tree(struct tree *tree, struct Window *win, int type);
|
||||
|
||||
void gui_create_form_select_menu(struct browser_window *bw, struct form_control *control);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -43,223 +43,6 @@
|
|||
)
|
||||
)
|
||||
|
||||
(procedure p_failedsobjs
|
||||
(if #failedsobjs
|
||||
(message "The following shared objects failed to copy. These will be updated on next reboot.\n\n" #failedsobjs)
|
||||
)
|
||||
)
|
||||
|
||||
(procedure p_schedulesobj #sobj
|
||||
(transcript "Scheduling update of " #sobj " for next reboot")
|
||||
|
||||
(set #failedsobjs (cat #failedsobjs "\n" #sobj))
|
||||
|
||||
(makedir "SObjs:so-installer")
|
||||
|
||||
(copyfiles
|
||||
(source (tackon "SObjs" #sobj))
|
||||
(dest "SObjs:so-installer")
|
||||
)
|
||||
|
||||
(startup "Shared object installer"
|
||||
(prompt "Adding commands to user-startup to schedule copy of " #sobj " on next reboot")
|
||||
(help @startup-help)
|
||||
(command "if EXISTS SObjs:so-installer\n")
|
||||
(command " copy SObjs:so-installer SObjs: CLONE FORCE QUIET\n")
|
||||
(command " delete SObjs:so-installer ALL FORCE QUIET\n")
|
||||
(command "endif\n")
|
||||
)
|
||||
)
|
||||
|
||||
(procedure p_comparesobj2 #sobj1_full #sobj2_full
|
||||
(set #same 0)
|
||||
|
||||
(set #sobj-version (getversion (#sobj1_full)))
|
||||
(if (= #sobj-version 0)
|
||||
(
|
||||
(if (exists (#sobj2_full))
|
||||
(
|
||||
(set #file-newer (earlier (#sobj2_full) (#sobj1_full)))
|
||||
(set #old-size (getsize (#sobj2_full)))
|
||||
(set #new-size (getsize (#sobj1_full)))
|
||||
|
||||
(if (AND (= #old-size #new-size) (= #file-newer 0)) (set #same 1))
|
||||
)
|
||||
)
|
||||
)
|
||||
; else if version info is available
|
||||
(
|
||||
(set #sobj-oldversion (getversion (#sobj2_full)))
|
||||
|
||||
(if (<= #sobj-version #sobj-oldversion) (set #same 1))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(procedure p_comparesobj #sobj
|
||||
(set #sobj1 (tackon "SObjs/" #sobj))
|
||||
(set #sobj2 (tackon "SObjs:" #sobj))
|
||||
|
||||
(p_comparesobj2 #sobj1 #sobj2)
|
||||
)
|
||||
|
||||
(procedure p_linksobj #sobj #sobj_link
|
||||
(set #sobj2 (tackon "SObjs:" #sobj_link))
|
||||
|
||||
(p_comparesobj2 (tackon "SObjs/" #sobj) #sobj2)
|
||||
|
||||
(if (= #same 0) ;if #sobj is newer than that pointed to by #sobj_link
|
||||
(
|
||||
(if (exists (#sobj2))
|
||||
(transcript "Deleting " #sobj2)
|
||||
(delete #sobj2 (optional "force")) ;prevent dodgy recursive links
|
||||
)
|
||||
(set #linkcmd (cat "makelink " #sobj2 " SObjs:" #sobj " soft"))
|
||||
(transcript "Running " #linkcmd)
|
||||
(run #linkcmd)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(procedure p_copysobj #sobj
|
||||
(set #sobj-version (getversion (tackon "SObjs/" #sobj)))
|
||||
|
||||
(if (= #sobj-version 0)
|
||||
(
|
||||
(transcript "Date compare " #sobj)
|
||||
|
||||
(if (exists (tackon "SObjs:" #sobj))
|
||||
(
|
||||
(set #file-newer (earlier (tackon "SObjs:" #sobj) (tackon "SObjs/" #sobj)))
|
||||
|
||||
(if (= #file-newer 0)
|
||||
(
|
||||
(set #newer-text "has an older datestamp")
|
||||
)
|
||||
;else
|
||||
(
|
||||
(set #newer-text "has a newer datestamp")
|
||||
)
|
||||
)
|
||||
|
||||
(set #old-size (getsize (tackon "SObjs:" #sobj)))
|
||||
(set #new-size (getsize (tackon "SObjs/" #sobj)))
|
||||
|
||||
(if (AND (= #old-size #new-size) (= #file-newer 0))
|
||||
(
|
||||
(set #copy 0)
|
||||
)
|
||||
;else
|
||||
(
|
||||
(if (OR (= @user-level 2) (AND (= @user-level 1) (<> #file-newer 0)))
|
||||
; Expert users are always prompted
|
||||
; Average users are prompted if the file trying to be copied is newer
|
||||
; Novice users are never prompted
|
||||
; This is roughly equivalent to (copylib (confirm))
|
||||
; No prompting occurs if the destination does not exist (silent copy)
|
||||
; or the files are the same size and the one being copied isn't newer (don't copy)
|
||||
(
|
||||
(set #copy
|
||||
(askbool
|
||||
(prompt "Copying " #sobj "...\n\n"
|
||||
"Version to install: " #new-size " bytes\n"
|
||||
"Version currently installed: " #old-size " bytes\n\n"
|
||||
"The file to copy " #newer-text)
|
||||
(help @askbool-help)
|
||||
(default #file-newer)
|
||||
(choices "Proceed with copy" "Skip this part")
|
||||
)
|
||||
)
|
||||
)
|
||||
;else
|
||||
(
|
||||
(set #copy #file-newer)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
; else if dest file does not exist
|
||||
(
|
||||
(set #copy 1)
|
||||
)
|
||||
)
|
||||
|
||||
(if (<> #copy 0)
|
||||
(
|
||||
(if (<> #AutoInstall 1)
|
||||
(
|
||||
(copyfiles
|
||||
(prompt "Copying " #sobj "...")
|
||||
(help @copyfiles-help)
|
||||
(source (tackon "SObjs/" #sobj))
|
||||
(dest "SObjs:")
|
||||
(optional "nofail" "force")
|
||||
)
|
||||
)
|
||||
;else
|
||||
(
|
||||
(run "CopyStore SObjs/" #sobj " SObjs:")
|
||||
)
|
||||
)
|
||||
|
||||
(p_comparesobj #sobj)
|
||||
(if (= #same 0)
|
||||
(
|
||||
(p_schedulesobj #sobj)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
; else if version info is available
|
||||
(
|
||||
(if (<> #AutoInstall 1)
|
||||
(
|
||||
(copylib
|
||||
(prompt "Copying " #sobj "...")
|
||||
(help @copylib-help)
|
||||
(source (tackon "SObjs/" #sobj))
|
||||
(dest "SObjs:")
|
||||
(optional "nofail" "force")
|
||||
(confirm "expert")
|
||||
)
|
||||
)
|
||||
;else
|
||||
(
|
||||
(run "CopyStore SObjs/" #sobj " SObjs:")
|
||||
)
|
||||
)
|
||||
|
||||
(p_comparesobj #sobj)
|
||||
(if (= #same 0)
|
||||
(
|
||||
(p_schedulesobj #sobj)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(procedure p_copylib #lib
|
||||
(if (<> #AutoInstall 1)
|
||||
(
|
||||
(copylib
|
||||
(prompt "Copying " #lib "...")
|
||||
(help @copylib-help)
|
||||
(source (tackon "Libs/" #lib))
|
||||
(dest "Libs:")
|
||||
(optional "nofail" "force")
|
||||
(confirm "expert")
|
||||
)
|
||||
)
|
||||
;else
|
||||
(
|
||||
(run "CopyStore Libs/" #lib " Libs:")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(procedure p_chk_launch-handler #protocol
|
||||
(run "C:Search >T:NS_Install.tmp " (tackon "ENVARC:launch-handler/URL" #protocol) " NetSurf" (safe))
|
||||
(set #has_entry (getsize "T:NS_Install.tmp"))
|
||||
|
@ -274,6 +57,9 @@
|
|||
|
||||
(if (<> #AutoInstall 1) (welcome))
|
||||
|
||||
; (hopefully temporary) workaround for a bug in Installer:
|
||||
(if (= @language "dutch") (set @askdir-help ""))
|
||||
|
||||
(complete 0)
|
||||
|
||||
(set @default-dest (getenv "AppPaths/NetSurf"))
|
||||
|
@ -309,72 +95,9 @@
|
|||
(set #icon-exists (exists (tackon @default-dest "NetSurf.info")))
|
||||
(set osver (getversion))
|
||||
(set osver (/ osver 65536))
|
||||
(set #versions-available 0)
|
||||
|
||||
(set #static-filename "NetSurf")
|
||||
(set #cairo-filename "NetSurf")
|
||||
|
||||
(if (exists "NetSurf")
|
||||
(
|
||||
(if (exists "SObjs")
|
||||
(
|
||||
(if (>= osver 53)
|
||||
(
|
||||
(set #cairo-name "Shared objects/part-Cairo")
|
||||
(set #versions-available (+ #versions-available 1))
|
||||
(set #cairo-version 1)
|
||||
)
|
||||
;else
|
||||
(
|
||||
(set #cairo-version 0)
|
||||
(set #cairo-name "")
|
||||
)
|
||||
)
|
||||
)
|
||||
;else
|
||||
(
|
||||
; assume static if sobjs is not present
|
||||
(set #static-name "Static/graphics.library")
|
||||
(set #versions-available (+ #versions-available 1))
|
||||
(set #cairo-version 0)
|
||||
(set #static-filename "NetSurf")
|
||||
)
|
||||
)
|
||||
)
|
||||
; else
|
||||
(
|
||||
(set #cairo-version 0)
|
||||
(set #cairo-name "")
|
||||
)
|
||||
)
|
||||
|
||||
(transcript "Versions avaiable for install: " #versions-available " " #static-name " " #cairo-name)
|
||||
|
||||
(if (= #versions-available 0)
|
||||
(
|
||||
(abort "Did not find any compatible versions of NetSurf to install!\n\n"
|
||||
"NetSurf requires AmigaOS 4.1 or higher.")
|
||||
)
|
||||
)
|
||||
|
||||
(complete 10)
|
||||
|
||||
(if (AND (> @user-level 0) (> #versions-available 1))
|
||||
(
|
||||
(set #cairo-version
|
||||
(askchoice
|
||||
(prompt "Which version of NetSurf would you like to install?")
|
||||
(help "The Cairo version has anti-aliasing of graphical elements.\n\n"
|
||||
@askchoice-help)
|
||||
(choices #static-name #cairo-name)
|
||||
(default #cairo-version)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(complete 15)
|
||||
|
||||
(set #user (getenv "user"))
|
||||
(if (= #user "") (set #user "Default"))
|
||||
|
||||
|
@ -415,7 +138,7 @@
|
|||
)
|
||||
)
|
||||
|
||||
(complete 18)
|
||||
(complete 15)
|
||||
|
||||
(if (>= osver 53)
|
||||
(
|
||||
|
@ -436,7 +159,7 @@
|
|||
)
|
||||
)
|
||||
|
||||
(complete 19)
|
||||
(complete 20)
|
||||
|
||||
(set #runfixfonts
|
||||
(askbool
|
||||
|
@ -449,9 +172,7 @@
|
|||
)
|
||||
)
|
||||
|
||||
(complete 20)
|
||||
|
||||
(set #netsurf-name (select #cairo-version #static-filename #cairo-filename))
|
||||
(complete 25)
|
||||
|
||||
(working "Installing NetSurf")
|
||||
|
||||
|
@ -460,7 +181,7 @@
|
|||
(copyfiles
|
||||
(prompt "Copying NetSurf...")
|
||||
(help @copyfiles-help)
|
||||
(source #netsurf-name)
|
||||
(source "NetSurf")
|
||||
(dest @default-dest)
|
||||
(newname "NetSurf")
|
||||
(optional "askuser" "force" "oknodelete")
|
||||
|
@ -473,7 +194,7 @@
|
|||
)
|
||||
)
|
||||
|
||||
(complete 30)
|
||||
(complete 40)
|
||||
|
||||
(if #searchengines-exist
|
||||
(rename (tackon @default-dest "Resources/SearchEngines") (tackon @default-dest "Resources/SearchEngines.backup"))
|
||||
|
@ -483,6 +204,8 @@
|
|||
(run "c:filenote Rexx/ViewSource.nsrx \"View source\"")
|
||||
(run "c:filenote Rexx/GetVideo.nsrx \"Get video\"")
|
||||
|
||||
(complete 50)
|
||||
|
||||
(copyfiles
|
||||
(prompt "Copying files")
|
||||
(source "")
|
||||
|
@ -494,6 +217,8 @@
|
|||
; (all)
|
||||
)
|
||||
|
||||
(complete 65)
|
||||
|
||||
(copyfiles
|
||||
(prompt "Copying additional documentation")
|
||||
(source "")
|
||||
|
@ -504,34 +229,7 @@
|
|||
(optional "nofail")
|
||||
)
|
||||
|
||||
(set #complete 40)
|
||||
(working "Copying Libraries")
|
||||
|
||||
(if (exists "Libs")
|
||||
(
|
||||
(foreach "Libs" "#?"
|
||||
(complete #complete)
|
||||
(p_copylib @each-name)
|
||||
(set #complete (+ #complete 2))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(set #complete 60)
|
||||
|
||||
(if (= #cairo-version 1)
|
||||
(
|
||||
(working "Copying Shared Objects")
|
||||
|
||||
(foreach "SObjs" "#?"
|
||||
(complete #complete)
|
||||
(p_copysobj @each-name)
|
||||
(set #complete (+ #complete 1))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(complete 90)
|
||||
(complete 70)
|
||||
|
||||
(if #themeshort
|
||||
(
|
||||
|
@ -578,7 +276,7 @@
|
|||
)
|
||||
)
|
||||
|
||||
(complete 95)
|
||||
(complete 75)
|
||||
|
||||
(if (= (exists "ENVARC:Sys/def_css.info") 0)
|
||||
(copyfiles
|
||||
|
@ -591,7 +289,7 @@
|
|||
)
|
||||
)
|
||||
|
||||
(complete 96)
|
||||
(complete 80)
|
||||
|
||||
(working "Setting MIME types")
|
||||
(p_setmimetype "css" "text/css")
|
||||
|
@ -611,7 +309,7 @@
|
|||
(p_setmimetype "zip" "application/x-zip")
|
||||
(p_setmimetype "js" "application/javascript")
|
||||
|
||||
(complete 97)
|
||||
(complete 85)
|
||||
|
||||
(if (>= osver 53)
|
||||
(if (= (exists "Rexx:NetSurf") 0)
|
||||
|
@ -659,7 +357,7 @@
|
|||
)
|
||||
)
|
||||
|
||||
(complete 98)
|
||||
(complete 90)
|
||||
|
||||
(if (= #addlaunchhandler 1)
|
||||
(
|
||||
|
@ -691,7 +389,7 @@
|
|||
)
|
||||
)
|
||||
|
||||
(complete 99)
|
||||
(complete 95)
|
||||
|
||||
(working "Running FixFonts")
|
||||
|
||||
|
@ -708,7 +406,6 @@
|
|||
(exit (quiet))
|
||||
)
|
||||
(
|
||||
(p_failedsobjs)
|
||||
(exit)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
@{b}NetSurf@{ub} Amiga-specific documentation
|
||||
http://www.netsurf-browser.org
|
||||
|
||||
@{" Change Log " link ChangeLog/Main}
|
||||
@{" Licence " link COPYING/Main}
|
||||
|
||||
@{" GUI " link GUI}
|
||||
@{" Preferences GUI " link Prefs}
|
||||
|
||||
|
@ -121,7 +118,6 @@ There are a couple of Amiga-specific options which can only be changed directly
|
|||
@{b}kiosk_mode@{ub} No gadgets
|
||||
@{b}printer_unit@{ub} Specifies which printer.device unit to print to
|
||||
@{b}drag_save_icons@{ub} Enables displaying Workbench-style transparent icons under the pointer when performing drag saves (ctrl-drag of objects available if NetSurf is running on the Workbench screen) and text selection drags. If set to 0 the pointer style will change instead. OS 4.0 users may want to set this to 0 as icons will appear opaque and obscure the drop position.
|
||||
@{b}cairo_renderer@{ub} Set rendering engine. -1 = palette-mapped (set automatically when required), 0 = graphics.library (default), 1 = Cairo/graphics.library mixed, 2 = Full Cairo.
|
||||
@{b}monitor_aspect_x@{ub}/@{b}monitor_aspect_y@{ub} Correct aspect ratio for displays (default of 0 means "assume square pixels").
|
||||
@{b}screen_compositing@{ub} Use compositing on NetSurf's own screen. 0=disable, 1=enable, 2=default (NB: This is indirectly modified by changing the "simple refresh" option in the GUI)
|
||||
@{b}resize_with_contents@{ub} Set to 1 to respect GUI prefs' "resize with contents" option. Default is to use old-style "resize on release"
|
||||
|
@ -183,6 +179,7 @@ Commands are:
|
|||
|
||||
@{b}OPEN URL/A,NEW=NEWWINDOW/S,NEWTAB/S,SAVEAS/K,W=WINDOW/K/N,T=TAB/K/N@{ub}
|
||||
Opens URL in current window or a new window/tab if NEWWINDOW/NEWTAB is specified. Saves the location without displaying if SAVEAS and a filename is specified (SAVEAS available in 2.6325)
|
||||
Note that if the URL is non-ASCII it is expected to be encoded in UTF-8 (file: references should always be in local charset due to filesystem limitations). Usually this is not relevant, as all normalised URLs will be in their ASCII form.
|
||||
|
||||
@{b}SAVE FILENAME/A,W=WINDOW/K/N,T=TAB/K/N@{ub} (2.6027)
|
||||
Saves current page source to FILENAME
|
||||
|
@ -255,6 +252,10 @@ Under OS4.1 Update 1, launch-handler is used in preference to OpenURL. The
|
|||
Installer script can add the relevant configuration to launch URLs in NetSurf.
|
||||
Please ensure your email application is configured in URL Prefs for mailto:
|
||||
links clicked within NetSurf.
|
||||
|
||||
Note that a helper script is installed in S:ARexx which can be used instead of
|
||||
the main executable, to stop the NetSurf executable from being loaded again if
|
||||
it is already running.
|
||||
@endnode
|
||||
|
||||
@node hotlist "Hotlist menu"
|
||||
|
@ -367,8 +368,6 @@ There are a number of options which can be changed that will affect the speed of
|
|||
@{b}Cache native versions@{ub} to @{b}Scaled@{ub} (or preferably @{b}All@{ub}, but this will use more graphics mem, and scaling images is a bigger performance hit)
|
||||
Deselect @{b}Higher quality scaling@{ub}, this will be very slow if not done in hardware.@{lindent}
|
||||
|
||||
@{lindent 2}* In @{"Options" link Options}, set cairo_renderer:1@{lindent}
|
||||
|
||||
@{lindent 2}* In @{"Options" link Options}, increase redraw_tile_size_x/y (increasing this value uses more graphics mem)@{lindent}
|
||||
|
||||
@{lindent 2}* In @{"Options" link Options}, set font_antialiasing:0@{lindent}
|
||||
|
|
|
@ -2,23 +2,21 @@ Short: Fast CSS capable web browser
|
|||
Uploader: chris@unsatisfactorysoftware.co.uk (Chris Young)
|
||||
Author: NetSurf contributors (OS4 port by Chris Young)
|
||||
Type: comm/www
|
||||
Version: 3.1 development
|
||||
Version: 3.3
|
||||
Architecture: ppc-amigaos >= 4.0.0
|
||||
|
||||
This is a test build of NetSurf 3.1 for AmigaOS 4.
|
||||
It is beta software, which means it is unstable and missing
|
||||
features - use at your own risk!
|
||||
|
||||
This is provided for testing purposes only. For the latest
|
||||
stable version, visit http://www.netsurf-browser.org
|
||||
This is NetSurf 3.3 for AmigaOS 4.
|
||||
For the latest version, visit http://www.netsurf-browser.org
|
||||
|
||||
Please report bugs to chris@unsatisfactorysoftware.co.uk,
|
||||
on the Amigans.net forums or on the NetSurf mailing list.
|
||||
|
||||
See http://www.netsurf-browser.org for more information about NetSurf.
|
||||
See http://www.netsurf-browser.org for more information about
|
||||
NetSurf.
|
||||
|
||||
This software is licensed under the GPL, and the sources are
|
||||
available from http://www.netsurf-browser.org. A copy can
|
||||
also be obtained directly from the maintainer of this port,
|
||||
chris@unsatisfactorysoftware.co.uk, in the event that the
|
||||
website is unavailable.
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ struct gui_download_window {
|
|||
struct dlnode *dln;
|
||||
struct browser_window *bw;
|
||||
struct download_context *ctx;
|
||||
char *url;
|
||||
const char *url;
|
||||
char fname[1024];
|
||||
int result;
|
||||
};
|
||||
|
@ -85,13 +85,13 @@ enum {
|
|||
|
||||
int downloads_in_progress = 0;
|
||||
|
||||
struct gui_download_window *gui_download_window_create(download_context *ctx,
|
||||
static struct gui_download_window *gui_download_window_create(download_context *ctx,
|
||||
struct gui_window *gui)
|
||||
{
|
||||
const char *url = download_context_get_url(ctx);
|
||||
const char *mime_type = download_context_get_mime_type(ctx);
|
||||
const char *url = nsurl_access(download_context_get_url(ctx));
|
||||
unsigned long total_size = download_context_get_total_length(ctx);
|
||||
struct gui_download_window *dw;
|
||||
char *dl_filename = ami_utf8_easy(download_context_get_filename(ctx));
|
||||
APTR va[3];
|
||||
|
||||
dw = AllocVecTags(sizeof(struct gui_download_window), AVT_ClearWithValue, 0, TAG_DONE);
|
||||
|
@ -107,9 +107,9 @@ struct gui_download_window *gui_download_window_create(download_context *ctx,
|
|||
if(AslRequestTags(savereq,
|
||||
ASLFR_Window, gui->shared->win,
|
||||
ASLFR_SleepWindow, TRUE,
|
||||
ASLFR_TitleText,messages_get("NetSurf"),
|
||||
ASLFR_Screen,scrn,
|
||||
ASLFR_InitialFile, download_context_get_filename(ctx),
|
||||
ASLFR_TitleText, messages_get("NetSurf"),
|
||||
ASLFR_Screen, scrn,
|
||||
ASLFR_InitialFile, dl_filename,
|
||||
TAG_DONE))
|
||||
{
|
||||
strlcpy(dw->fname, savereq->fr_Drawer, 1024);
|
||||
|
@ -127,10 +127,11 @@ struct gui_download_window *gui_download_window_create(download_context *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
if(dl_filename) ami_utf8_free(dl_filename);
|
||||
dw->size = total_size;
|
||||
dw->downloaded = 0;
|
||||
if(gui) dw->bw = gui->shared->bw;
|
||||
dw->url = (char *)strdup((char *)url);
|
||||
dw->url = url;
|
||||
|
||||
va[0] = (APTR)dw->downloaded;
|
||||
va[1] = (APTR)dw->size;
|
||||
|
@ -191,7 +192,7 @@ struct gui_download_window *gui_download_window_create(download_context *ctx,
|
|||
return dw;
|
||||
}
|
||||
|
||||
nserror gui_download_window_data(struct gui_download_window *dw,
|
||||
static nserror gui_download_window_data(struct gui_download_window *dw,
|
||||
const char *data, unsigned int size)
|
||||
{
|
||||
APTR va[3];
|
||||
|
@ -225,29 +226,15 @@ nserror gui_download_window_data(struct gui_download_window *dw,
|
|||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
void gui_download_window_error(struct gui_download_window *dw,
|
||||
const char *error_msg)
|
||||
{
|
||||
warn_user("Unwritten","");
|
||||
dw->result = AMINS_DLOAD_ERROR;
|
||||
gui_download_window_done(dw);
|
||||
}
|
||||
|
||||
void ami_download_window_abort(struct gui_download_window *dw)
|
||||
{
|
||||
download_context_abort(dw->ctx);
|
||||
dw->result = AMINS_DLOAD_ABORT;
|
||||
gui_download_window_done(dw);
|
||||
}
|
||||
|
||||
void gui_download_window_done(struct gui_download_window *dw)
|
||||
static void gui_download_window_done(struct gui_download_window *dw)
|
||||
{
|
||||
struct dlnode *dln,*dln2 = NULL;
|
||||
struct browser_window *bw = dw->bw;
|
||||
struct browser_window *bw;
|
||||
bool queuedl = false;
|
||||
STRPTR sendcmd = NULL;
|
||||
|
||||
if(!dw) return;
|
||||
bw = dw->bw;
|
||||
|
||||
if((nsoption_bool(download_notify)) && (dw->result == AMINS_DLOAD_OK))
|
||||
{
|
||||
|
@ -273,7 +260,6 @@ void gui_download_window_done(struct gui_download_window *dw)
|
|||
|
||||
FClose(dw->fh);
|
||||
SetComment(dw->fname, dw->url);
|
||||
if(dw->url) free(dw->url);
|
||||
|
||||
downloads_in_progress--;
|
||||
|
||||
|
@ -287,14 +273,29 @@ void gui_download_window_done(struct gui_download_window *dw)
|
|||
browser_window_navigate(bw,
|
||||
url,
|
||||
NULL,
|
||||
BROWSER_WINDOW_DOWNLOAD |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
BW_NAVIGATE_DOWNLOAD,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
nsurl_unref(url);
|
||||
}
|
||||
}
|
||||
ami_try_quit(); /* In case the only window open was this download */
|
||||
}
|
||||
|
||||
static void gui_download_window_error(struct gui_download_window *dw,
|
||||
const char *error_msg)
|
||||
{
|
||||
warn_user("Unwritten","");
|
||||
dw->result = AMINS_DLOAD_ERROR;
|
||||
gui_download_window_done(dw);
|
||||
}
|
||||
|
||||
void ami_download_window_abort(struct gui_download_window *dw)
|
||||
{
|
||||
download_context_abort(dw->ctx);
|
||||
dw->result = AMINS_DLOAD_ABORT;
|
||||
gui_download_window_done(dw);
|
||||
}
|
||||
|
||||
BOOL ami_download_window_event(struct gui_download_window *dw)
|
||||
|
@ -344,7 +345,6 @@ void ami_free_download_list(struct List *dllist)
|
|||
void
|
||||
gui_window_save_link(struct gui_window *g, const char *url, const char *title)
|
||||
{
|
||||
BPTR fh = 0;
|
||||
char fname[1024];
|
||||
STRPTR openurlstring,linkname;
|
||||
struct DiskObject *dobj = NULL;
|
||||
|
@ -366,6 +366,8 @@ gui_window_save_link(struct gui_window *g, const char *url, const char *title)
|
|||
|
||||
if(ami_download_check_overwrite(fname, g->shared->win, 0))
|
||||
{
|
||||
BPTR fh;
|
||||
|
||||
if(fh = FOpen(fname,MODE_NEWFILE,0))
|
||||
{
|
||||
/* TODO: Should be URLOpen on OS4.1 */
|
||||
|
@ -398,8 +400,6 @@ BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG si
|
|||
/* Return TRUE if file can be (over-)written */
|
||||
int32 res = 0;
|
||||
BPTR lock = 0;
|
||||
BPTR fh = 0;
|
||||
int64 oldsize = 0;
|
||||
char *overwritetext;
|
||||
|
||||
if(nsoption_bool(ask_overwrite) == false) return TRUE;
|
||||
|
@ -409,6 +409,9 @@ BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG si
|
|||
if(lock)
|
||||
{
|
||||
if(size) {
|
||||
BPTR fh;
|
||||
int64 oldsize = 0;
|
||||
|
||||
if(fh = OpenFromLock(lock)) {
|
||||
oldsize = GetFileSize(fh);
|
||||
Close(fh);
|
||||
|
@ -430,3 +433,12 @@ BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG si
|
|||
if(res == 1) return TRUE;
|
||||
else return FALSE;
|
||||
}
|
||||
|
||||
static struct gui_download_table download_table = {
|
||||
.create = gui_download_window_create,
|
||||
.data = gui_download_window_data,
|
||||
.error = gui_download_window_error,
|
||||
.done = gui_download_window_done,
|
||||
};
|
||||
|
||||
struct gui_download_table *amiga_download_table = &download_table;
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
#include "amiga/gui.h"
|
||||
|
||||
extern struct gui_download_table *amiga_download_table;
|
||||
|
||||
struct download_context;
|
||||
struct gui_download_window;
|
||||
|
||||
|
@ -36,4 +38,7 @@ void ami_download_window_abort(struct gui_download_window *dw);
|
|||
BOOL ami_download_window_event(struct gui_download_window *dw);
|
||||
void ami_free_download_list(struct List *dllist);
|
||||
BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG size);
|
||||
|
||||
void gui_window_save_link(struct gui_window *g, const char *url, const char *title);
|
||||
|
||||
#endif
|
||||
|
|
15
amiga/drag.c
15
amiga/drag.c
|
@ -50,11 +50,13 @@ ULONG drag_icon_width;
|
|||
ULONG drag_icon_height;
|
||||
BOOL drag_in_progress = FALSE;
|
||||
|
||||
void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
|
||||
struct gui_window *g)
|
||||
void gui_drag_save_object(struct gui_window *g, hlcache_handle *c,
|
||||
gui_save_type type)
|
||||
{
|
||||
const char *filetype = NULL;
|
||||
|
||||
/* Check we are running on Workbench */
|
||||
if(nsoption_charp(pubscreen_name) == NULL) return;
|
||||
if(strcmp(nsoption_charp(pubscreen_name), "Workbench")) return;
|
||||
|
||||
switch(type)
|
||||
|
@ -98,9 +100,8 @@ void gui_drag_save_selection(struct gui_window *g, const char *selection)
|
|||
|
||||
void ami_drag_save(struct Window *win)
|
||||
{
|
||||
ULONG which = WBO_NONE,type;
|
||||
char path[1025],dpath[1025];
|
||||
const char *source_data;
|
||||
ULONG which = WBO_NONE, type;
|
||||
char path[1025], dpath[1025];
|
||||
ULONG source_size;
|
||||
|
||||
ami_drag_icon_close(NULL);
|
||||
|
@ -195,10 +196,8 @@ void ami_drag_save(struct Window *win)
|
|||
void ami_drag_icon_show(struct Window *win, const char *type)
|
||||
{
|
||||
struct DiskObject *dobj = NULL;
|
||||
ULONG *icondata1;
|
||||
ULONG width, height;
|
||||
long format = 0;
|
||||
int err = 0;
|
||||
int err;
|
||||
int deftype = WBPROJECT;
|
||||
|
||||
drag_in_progress = TRUE;
|
||||
|
|
|
@ -26,6 +26,9 @@ int drag_save;
|
|||
void *drag_save_data;
|
||||
struct gui_window *drag_save_gui;
|
||||
|
||||
void gui_drag_save_selection(struct gui_window *g, const char *selection);
|
||||
void gui_drag_save_object(struct gui_window *g, hlcache_handle *c, gui_save_type type);
|
||||
|
||||
void ami_drag_save(struct Window *win);
|
||||
void ami_drag_icon_show(struct Window *win, const char *type);
|
||||
void ami_drag_icon_close(struct Window *win);
|
||||
|
|
|
@ -92,7 +92,6 @@ static const content_handler amiga_dt_anim_content_handler = {
|
|||
|
||||
nserror amiga_dt_anim_init(void)
|
||||
{
|
||||
char dt_mime[50];
|
||||
struct DataType *dt, *prevdt = NULL;
|
||||
lwc_string *type;
|
||||
lwc_error lerror;
|
||||
|
@ -161,14 +160,11 @@ bool amiga_dt_anim_convert(struct content *c)
|
|||
amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c;
|
||||
union content_msg_data msg_data;
|
||||
int width, height;
|
||||
char title[100];
|
||||
const uint8 *data;
|
||||
UBYTE *bm_buffer;
|
||||
ULONG size;
|
||||
Object *dto;
|
||||
struct BitMapHeader *bmh;
|
||||
unsigned int bm_flags = BITMAP_NEW | BITMAP_OPAQUE;
|
||||
int bm_format = PBPAFMT_RGBA;
|
||||
struct adtFrame adt_frame;
|
||||
APTR clut;
|
||||
|
||||
|
@ -341,20 +337,20 @@ APTR ami_colormap_to_clut(struct ColorMap *cmap)
|
|||
{
|
||||
int i;
|
||||
UBYTE *clut = AllocVecTags(256 * 4, AVT_ClearWithValue, 0, TAG_DONE); /* NB: Was not MEMF_PRIVATE */
|
||||
ULONG colour[3 * 256];
|
||||
ULONG colr[256 * 4];
|
||||
|
||||
if(!clut) return NULL;
|
||||
|
||||
/* Get the palette from the ColorMap */
|
||||
GetRGB32(cmap, 0, 256, (ULONG *)&colour);
|
||||
GetRGB32(cmap, 0, 256, (ULONG *)&colr);
|
||||
|
||||
/* convert it to a table of ARGB values */
|
||||
for(i = 0; i < 1024; i += 4)
|
||||
{
|
||||
clut[i] = (0xff << 24) |
|
||||
((colour[i] & 0xff000000) >> 8) |
|
||||
((colour[i + 1] & 0xff000000) >> 16) |
|
||||
((colour[i + 2] & 0xff000000) >> 24);
|
||||
((colr[i] & 0xff000000) >> 8) |
|
||||
((colr[i + 1] & 0xff000000) >> 16) |
|
||||
((colr[i + 2] & 0xff000000) >> 24);
|
||||
}
|
||||
|
||||
return clut;
|
||||
|
|
|
@ -62,7 +62,6 @@ struct amiga_dt_picture_content {
|
|||
|
||||
nserror amiga_dt_picture_init(void)
|
||||
{
|
||||
char dt_mime[50];
|
||||
struct DataType *dt, *prevdt = NULL;
|
||||
lwc_string *type;
|
||||
lwc_error lerror;
|
||||
|
@ -175,7 +174,6 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
|
|||
UBYTE *bm_buffer;
|
||||
Object *dto;
|
||||
struct bitmap *bitmap;
|
||||
unsigned int bm_flags = BITMAP_NEW;
|
||||
#ifdef __amigaos4__
|
||||
int bm_format = PBPAFMT_RGBA;
|
||||
#else
|
||||
|
@ -185,7 +183,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
|
|||
|
||||
if(dto = amiga_dt_picture_newdtobject(adt))
|
||||
{
|
||||
bitmap = bitmap_create(c->width, c->height, bm_flags);
|
||||
bitmap = bitmap_create(c->width, c->height, BITMAP_NEW);
|
||||
if (!bitmap) {
|
||||
msg_data.error = messages_get("NoMemory");
|
||||
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
|
||||
|
@ -214,14 +212,10 @@ bool amiga_dt_picture_convert(struct content *c)
|
|||
{
|
||||
LOG(("amiga_dt_picture_convert"));
|
||||
|
||||
union content_msg_data msg_data;
|
||||
int width, height;
|
||||
char *title;
|
||||
UBYTE *bm_buffer;
|
||||
Object *dto;
|
||||
struct BitMapHeader *bmh;
|
||||
unsigned int bm_flags = BITMAP_NEW;
|
||||
int bm_format = PBPAFMT_RGBA;
|
||||
char *filetype;
|
||||
|
||||
if(dto = amiga_dt_picture_newdtobject((struct amiga_dt_picture_content *)c))
|
||||
|
|
|
@ -77,7 +77,6 @@ void amiga_dt_sound_play(Object *dto)
|
|||
|
||||
nserror amiga_dt_sound_init(void)
|
||||
{
|
||||
char dt_mime[50];
|
||||
struct DataType *dt, *prevdt = NULL;
|
||||
lwc_string *type;
|
||||
lwc_error lerror;
|
||||
|
@ -146,12 +145,9 @@ bool amiga_dt_sound_convert(struct content *c)
|
|||
LOG(("amiga_dt_sound_convert"));
|
||||
|
||||
amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c;
|
||||
union content_msg_data msg_data;
|
||||
int width = 50, height = 50;
|
||||
char title[100];
|
||||
const uint8 *data;
|
||||
ULONG size;
|
||||
Object *dto;
|
||||
|
||||
data = (uint8 *)content__get_source_data(c, &size);
|
||||
|
||||
|
|
41
amiga/file.c
41
amiga/file.c
|
@ -22,6 +22,7 @@
|
|||
#include "amiga/filetype.h"
|
||||
#include "amiga/icon.h"
|
||||
#include "amiga/iff_dr2d.h"
|
||||
#include "amiga/misc.h"
|
||||
#include "amiga/save_pdf.h"
|
||||
#include "amiga/theme.h"
|
||||
|
||||
|
@ -30,12 +31,12 @@
|
|||
|
||||
#include "desktop/browser_private.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/file.h"
|
||||
#include "desktop/save_complete.h"
|
||||
#include "desktop/save_pdf/pdf_plotters.h"
|
||||
#include "desktop/save_text.h"
|
||||
|
||||
#include "utils/messages.h"
|
||||
#include "utils/url.h"
|
||||
|
||||
#include <proto/asl.h>
|
||||
#include <proto/dos.h>
|
||||
|
@ -48,8 +49,6 @@ static struct Hook aslhookfunc;
|
|||
static const ULONG ami_file_asl_mime_hook(struct Hook *mh,
|
||||
struct FileRequester *fr, struct AnchorPathOld *ap)
|
||||
{
|
||||
BPTR file = 0;
|
||||
char buffer[10];
|
||||
char fname[1024];
|
||||
BOOL ret = FALSE;
|
||||
char *mt = NULL;
|
||||
|
@ -62,7 +61,7 @@ static const ULONG ami_file_asl_mime_hook(struct Hook *mh,
|
|||
strcpy(fname,fr->fr_Drawer);
|
||||
AddPart(fname,ap->ap_Info.fib_FileName,1024);
|
||||
|
||||
mt = fetch_mimetype(fname);
|
||||
mt = strdup(fetch_filetype(fname));
|
||||
lerror = lwc_intern_string(mt, strlen(mt), &lwc_mt);
|
||||
if (lerror != lwc_error_ok)
|
||||
return FALSE;
|
||||
|
@ -78,7 +77,7 @@ static const ULONG ami_file_asl_mime_hook(struct Hook *mh,
|
|||
|
||||
void ami_file_open(struct gui_window_2 *gwin)
|
||||
{
|
||||
char *temp, *temp2;
|
||||
char *temp;
|
||||
nsurl *url;
|
||||
|
||||
if(AslRequestTags(filereq,
|
||||
|
@ -95,23 +94,20 @@ void ami_file_open(struct gui_window_2 *gwin)
|
|||
{
|
||||
strlcpy(temp, filereq->fr_Drawer, 1024);
|
||||
AddPart(temp, filereq->fr_File, 1024);
|
||||
temp2 = path_to_url(temp);
|
||||
|
||||
if (nsurl_create(temp2, &url) != NSERROR_OK) {
|
||||
if (netsurf_path_to_nsurl(temp, &url) != NSERROR_OK) {
|
||||
warn_user("NoMemory", 0);
|
||||
} else {
|
||||
browser_window_navigate(gwin->bw,
|
||||
url,
|
||||
NULL,
|
||||
BROWSER_WINDOW_HISTORY |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
BW_NAVIGATE_HISTORY,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
nsurl_unref(url);
|
||||
}
|
||||
|
||||
free(temp2);
|
||||
FreeVec(temp);
|
||||
}
|
||||
}
|
||||
|
@ -151,23 +147,19 @@ void ami_file_save(int type, char *fname, struct Window *win,
|
|||
struct hlcache_handle *object, struct hlcache_handle *favicon,
|
||||
struct browser_window *bw)
|
||||
{
|
||||
BPTR lock = 0;
|
||||
BPTR lock, fh;
|
||||
const char *source_data;
|
||||
ULONG source_size;
|
||||
struct bitmap *bm;
|
||||
BPTR fh=0;
|
||||
|
||||
ami_update_pointer(win, GUI_POINTER_WAIT);
|
||||
|
||||
if(ami_download_check_overwrite(fname, win, 0))
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
if(ami_download_check_overwrite(fname, win, 0)) {
|
||||
switch(type) {
|
||||
case AMINS_SAVE_SOURCE:
|
||||
if((source_data = content_get_source_data(object, &source_size)))
|
||||
{
|
||||
if(fh = FOpen(fname, MODE_NEWFILE,0))
|
||||
{
|
||||
if((source_data = content_get_source_data(object, &source_size))) {
|
||||
BPTR fh;
|
||||
if(fh = FOpen(fname, MODE_NEWFILE,0)) {
|
||||
FWrite(fh, source_data, 1, source_size);
|
||||
FClose(fh);
|
||||
}
|
||||
|
@ -179,8 +171,7 @@ void ami_file_save(int type, char *fname, struct Window *win,
|
|||
break;
|
||||
|
||||
case AMINS_SAVE_COMPLETE:
|
||||
if(lock = CreateDir(fname))
|
||||
{
|
||||
if(lock = CreateDir(fname)) {
|
||||
UnLock(lock);
|
||||
save_complete(object, fname, ami_file_set_type);
|
||||
amiga_icon_superimpose_favicon(fname, favicon, NULL);
|
||||
|
@ -195,15 +186,13 @@ void ami_file_save(int type, char *fname, struct Window *win,
|
|||
break;
|
||||
|
||||
case AMINS_SAVE_IFF:
|
||||
if((bm = content_get_bitmap(object)))
|
||||
{
|
||||
if((bm = content_get_bitmap(object))) {
|
||||
bm->url = (char *)nsurl_access(hlcache_handle_get_url(object));
|
||||
bm->title = (char *)content_get_title(object);
|
||||
bitmap_save(bm, fname, 0);
|
||||
}
|
||||
#ifdef WITH_NS_SVG
|
||||
else if(ami_mime_compare(object, "svg") == true)
|
||||
{
|
||||
else if(ami_mime_compare(object, "svg") == true) {
|
||||
ami_save_svg(object, fname);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -55,9 +55,7 @@ enum
|
|||
const char *fetch_filetype(const char *unix_path)
|
||||
{
|
||||
static char mimetype[50];
|
||||
STRPTR ttype = NULL;
|
||||
struct DiskObject *dobj = NULL;
|
||||
BPTR lock = 0;
|
||||
struct DataType *dtn;
|
||||
BOOL found = FALSE;
|
||||
lwc_string *lwc_mimetype;
|
||||
|
@ -66,8 +64,7 @@ const char *fetch_filetype(const char *unix_path)
|
|||
We'll just do a filename check here for quickness, although the
|
||||
first word ought to be checked against WB_DISKMAGIC really. */
|
||||
|
||||
if(strncmp(unix_path + strlen(unix_path) - 5, ".info", 5) == 0)
|
||||
{
|
||||
if(strncmp(unix_path + strlen(unix_path) - 5, ".info", 5) == 0) {
|
||||
strcpy(mimetype,"image/x-amiga-icon");
|
||||
found = TRUE;
|
||||
}
|
||||
|
@ -76,32 +73,26 @@ const char *fetch_filetype(const char *unix_path)
|
|||
/* Secondly try getting a tooltype "MIMETYPE" and use that as the MIME type.
|
||||
Will fail over to default icons if the file doesn't have a real icon. */
|
||||
|
||||
if(!found)
|
||||
{
|
||||
if(!found) {
|
||||
if(dobj = GetIconTags(unix_path,ICONGETA_FailIfUnavailable,FALSE,
|
||||
TAG_DONE))
|
||||
{
|
||||
TAG_DONE)) {
|
||||
STRPTR ttype = NULL;
|
||||
ttype = FindToolType(dobj->do_ToolTypes, "MIMETYPE");
|
||||
if(ttype)
|
||||
{
|
||||
if(ttype) {
|
||||
strcpy(mimetype,ttype);
|
||||
found = TRUE;
|
||||
}
|
||||
|
||||
FreeDiskObject(dobj);
|
||||
}
|
||||
}
|
||||
|
||||
/* If that didn't work, use the MIME file and DataTypes */
|
||||
|
||||
if(!found)
|
||||
{
|
||||
if (lock = Lock (unix_path, ACCESS_READ))
|
||||
{
|
||||
if (dtn = ObtainDataTypeA (DTST_FILE, (APTR)lock, NULL))
|
||||
{
|
||||
if(ami_mime_from_datatype(dtn, &lwc_mimetype, NULL))
|
||||
{
|
||||
if(!found) {
|
||||
BPTR lock;
|
||||
if (lock = Lock (unix_path, ACCESS_READ)) {
|
||||
if (dtn = ObtainDataTypeA (DTST_FILE, (APTR)lock, NULL)) {
|
||||
if(ami_mime_from_datatype(dtn, &lwc_mimetype, NULL)) {
|
||||
strcpy(mimetype, lwc_string_data(lwc_mimetype));
|
||||
found = TRUE;
|
||||
ReleaseDataType(dtn);
|
||||
|
@ -144,12 +135,6 @@ const char *fetch_filetype(const char *unix_path)
|
|||
return mimetype;
|
||||
}
|
||||
|
||||
|
||||
char *fetch_mimetype(const char *ro_path)
|
||||
{
|
||||
return strdup(fetch_filetype(ro_path));
|
||||
}
|
||||
|
||||
const char *ami_content_type_to_file_type(content_type type)
|
||||
{
|
||||
switch(type)
|
||||
|
@ -179,9 +164,7 @@ const char *ami_content_type_to_file_type(content_type type)
|
|||
|
||||
nserror ami_mime_init(const char *mimefile)
|
||||
{
|
||||
lwc_string *type;
|
||||
lwc_error lerror;
|
||||
nserror error;
|
||||
char buffer[256];
|
||||
BPTR fh = 0;
|
||||
struct RDArgs *rargs = NULL;
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
struct hlcache_handle;
|
||||
struct ami_mime_entry;
|
||||
|
||||
const char *fetch_filetype(const char *unix_path);
|
||||
|
||||
nserror ami_mime_init(const char *mimefile);
|
||||
void ami_mime_free(void);
|
||||
void ami_mime_entry_free(struct ami_mime_entry *mimeentry);
|
||||
|
@ -46,4 +48,5 @@ bool ami_mime_compare(struct hlcache_handle *c, const char *type);
|
|||
|
||||
/* deprecated */
|
||||
const char *ami_content_type_to_file_type(content_type type);
|
||||
|
||||
#endif
|
||||
|
|
73
amiga/font.c
73
amiga/font.c
|
@ -23,12 +23,12 @@
|
|||
#include "amiga/gui.h"
|
||||
#include "amiga/utf8.h"
|
||||
#include "amiga/object.h"
|
||||
#include "amiga/schedule.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "css/css.h"
|
||||
#include "css/utils.h"
|
||||
#include "render/font.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/schedule.h"
|
||||
#include "utils/utf8.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
|
@ -149,9 +149,9 @@ ULONG ami_xdpi;
|
|||
int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp,
|
||||
uint16 *char1, uint16 *char2, uint32 x, uint32 y, uint32 emwidth, bool aa);
|
||||
int32 ami_font_width_glyph(struct OutlineFont *ofont,
|
||||
uint16 *char1, uint16 *char2, uint32 emwidth);
|
||||
const uint16 *char1, const uint16 *char2, uint32 emwidth);
|
||||
struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle,
|
||||
uint16 *codepoint);
|
||||
const uint16 *codepoint);
|
||||
static void ami_font_cleanup(struct MinList *ami_font_list);
|
||||
|
||||
static bool nsfont_width(const plot_font_style_t *fstyle,
|
||||
|
@ -204,15 +204,13 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
|
|||
FIXED kern = 0;
|
||||
struct OutlineFont *ofont, *ufont = NULL;
|
||||
uint32 tx=0,i=0;
|
||||
size_t len, utf8len = 0;
|
||||
uint8 *utf8;
|
||||
int utf8_pos = 0;
|
||||
uint32 co = 0;
|
||||
int utf16charlen;
|
||||
ULONG emwidth = (ULONG)NSA_FONT_EMWIDTH(fstyle->size);
|
||||
int32 tempx;
|
||||
|
||||
if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return false;
|
||||
if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return false;
|
||||
outf16 = utf16;
|
||||
if(!(ofont = ami_open_outline_font(fstyle, 0))) return false;
|
||||
|
||||
|
@ -291,30 +289,35 @@ bool nsfont_split(const plot_font_style_t *fstyle,
|
|||
int x, size_t *char_offset, int *actual_x)
|
||||
{
|
||||
ULONG co;
|
||||
uint16 *utf16 = NULL,*outf16 = NULL;
|
||||
uint16 *utf16next = NULL;
|
||||
uint16 *utf16_str = NULL;
|
||||
const uint16 *utf16 = NULL;
|
||||
const uint16 *utf16next = NULL;
|
||||
FIXED kern = 0;
|
||||
int utf16charlen = 0;
|
||||
struct OutlineFont *ofont, *ufont = NULL;
|
||||
uint32 tx=0;
|
||||
int utf8_pos = 0;
|
||||
int32 tempx = 0;
|
||||
ULONG emwidth = (ULONG)NSA_FONT_EMWIDTH(fstyle->size);
|
||||
|
||||
if(utf8_to_enc((char *)string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return false;
|
||||
outf16 = utf16;
|
||||
if(!(ofont = ami_open_outline_font(fstyle, 0))) return false;
|
||||
/* Get utf16 conversion of string for glyph measuring routines */
|
||||
if (utf8_to_enc(string, "UTF-16", length, (char **)&utf16_str) !=
|
||||
NSERROR_OK)
|
||||
return false;
|
||||
|
||||
utf16 = utf16_str;
|
||||
if (!(ofont = ami_open_outline_font(fstyle, 0)))
|
||||
return false;
|
||||
|
||||
*char_offset = 0;
|
||||
*actual_x = 0;
|
||||
|
||||
if (*utf16 == 0xFEFF) utf16++;
|
||||
|
||||
while (utf8_pos < length) {
|
||||
if ((*utf16 < 0xD800) || (0xDBFF < *utf16))
|
||||
utf16charlen = 1;
|
||||
utf16next = utf16 + 1;
|
||||
else
|
||||
utf16charlen = 2;
|
||||
|
||||
utf16next = &utf16[utf16charlen];
|
||||
utf16next = utf16 + 2;
|
||||
|
||||
tempx = ami_font_width_glyph(ofont, utf16, utf16next, emwidth);
|
||||
|
||||
|
@ -332,21 +335,13 @@ bool nsfont_split(const plot_font_style_t *fstyle,
|
|||
/* Got a space */
|
||||
*actual_x = tx;
|
||||
*char_offset = utf8_pos;
|
||||
|
||||
if (x < tx) {
|
||||
/* Beyond available width,
|
||||
* so don't look further */
|
||||
free(outf16);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
tx += tempx;
|
||||
|
||||
if ((x < tx) && (*char_offset != 0)) {
|
||||
/* Reached available width, and a space was found;
|
||||
* split there. */
|
||||
free(outf16);
|
||||
free(utf16_str);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -354,14 +349,13 @@ bool nsfont_split(const plot_font_style_t *fstyle,
|
|||
utf8_pos = utf8_next(string, length, utf8_pos);
|
||||
}
|
||||
|
||||
free(outf16);
|
||||
free(utf16_str);
|
||||
|
||||
/* No spaces to split at, or everything fits */
|
||||
assert(*char_offset == 0 || x >= tx);
|
||||
|
||||
*char_offset = length;
|
||||
*actual_x = tx;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -432,7 +426,7 @@ struct ami_font_node *ami_font_open(const char *font)
|
|||
* \return outline font or NULL on error
|
||||
*/
|
||||
struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle,
|
||||
uint16 *codepoint)
|
||||
const uint16 *codepoint)
|
||||
{
|
||||
struct ami_font_node *node;
|
||||
struct OutlineFont *ofont;
|
||||
|
@ -642,13 +636,14 @@ int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp,
|
|||
}
|
||||
|
||||
int32 ami_font_width_glyph(struct OutlineFont *ofont,
|
||||
uint16 *char1, uint16 *char2, uint32 emwidth)
|
||||
const uint16 *char1, const uint16 *char2, uint32 emwidth)
|
||||
{
|
||||
int32 char_advance = 0;
|
||||
FIXED kern = 0;
|
||||
struct MinList *gwlist;
|
||||
FIXED char1w;
|
||||
struct MinList *gwlist = NULL;
|
||||
FIXED char1w = 0;
|
||||
struct GlyphWidthEntry *gwnode;
|
||||
bool skip_c2 = false;
|
||||
|
||||
if ((*char1 >= 0xD800) && (*char1 <= 0xDBFF)) {
|
||||
/* We don't support UTF-16 surrogates yet, so just return. */
|
||||
|
@ -657,9 +652,11 @@ int32 ami_font_width_glyph(struct OutlineFont *ofont,
|
|||
|
||||
if ((*char2 >= 0xD800) && (*char2 <= 0xDBFF)) {
|
||||
/* Don't attempt to kern a UTF-16 surrogate */
|
||||
*char2 = 0;
|
||||
skip_c2 = true;
|
||||
}
|
||||
|
||||
|
||||
if (*char2 < 0x0020) skip_c2 = true;
|
||||
|
||||
if(ESetInfo(&ofont->olf_EEngine,
|
||||
OT_GlyphCode, *char1,
|
||||
OT_GlyphCode2, *char1,
|
||||
|
@ -674,7 +671,7 @@ int32 ami_font_width_glyph(struct OutlineFont *ofont,
|
|||
|
||||
kern = 0;
|
||||
|
||||
if(*char2) {
|
||||
if(!skip_c2) {
|
||||
if(ESetInfo(&ofont->olf_EEngine,
|
||||
OT_GlyphCode, *char1,
|
||||
OT_GlyphCode2, *char2,
|
||||
|
@ -687,7 +684,7 @@ int32 ami_font_width_glyph(struct OutlineFont *ofont,
|
|||
}
|
||||
char_advance = (ULONG)(((char1w - kern) * emwidth) / 65536);
|
||||
|
||||
if(*char2) EReleaseInfo(&ofont->olf_EEngine,
|
||||
if(!skip_c2) EReleaseInfo(&ofont->olf_EEngine,
|
||||
OT_TextKernPair, kern,
|
||||
TAG_END);
|
||||
|
||||
|
@ -732,7 +729,7 @@ ULONG ami_unicode_text(struct RastPort *rp, const char *string, ULONG length,
|
|||
if(!string || string[0]=='\0') return 0;
|
||||
if(!length) return 0;
|
||||
|
||||
if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return 0;
|
||||
if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != NSERROR_OK) return 0;
|
||||
outf16 = utf16;
|
||||
if(!(ofont = ami_open_outline_font(fstyle, 0))) return 0;
|
||||
|
||||
|
@ -831,7 +828,7 @@ void ami_init_fonts(void)
|
|||
NewList(&ami_diskfontlib_list);
|
||||
|
||||
/* run first cleanup in ten minutes */
|
||||
schedule(60000, (schedule_callback_fn)ami_font_cleanup, ami_font_list);
|
||||
ami_schedule(600000, ami_font_cleanup, ami_font_list);
|
||||
}
|
||||
|
||||
void ami_close_fonts(void)
|
||||
|
@ -875,7 +872,7 @@ static void ami_font_cleanup(struct MinList *ami_font_list)
|
|||
}while(node=nnode);
|
||||
|
||||
/* reschedule to run in five minutes */
|
||||
schedule(30000, (schedule_callback_fn)ami_font_cleanup, ami_font_list);
|
||||
ami_schedule(300000, ami_font_cleanup, ami_font_list);
|
||||
}
|
||||
|
||||
void ami_font_setdevicedpi(int id)
|
||||
|
|
|
@ -71,7 +71,7 @@ struct ami_font_scan_window {
|
|||
* \param glypharray an array of 0xffff lwc_string pointers
|
||||
* \return font name or NULL
|
||||
*/
|
||||
const char *ami_font_scan_lookup(uint16 *code, lwc_string **glypharray)
|
||||
const char *ami_font_scan_lookup(const uint16 *code, lwc_string **glypharray)
|
||||
{
|
||||
if(*code >= 0xd800 && *code <= 0xdbff) {
|
||||
/* This is a multi-byte character, we don't support falback for these yet. */
|
||||
|
@ -294,7 +294,7 @@ ULONG ami_font_scan_fonts(struct MinList *list,
|
|||
*/
|
||||
ULONG ami_font_scan_list(struct MinList *list)
|
||||
{
|
||||
int afShortage, afSize = 100, i;
|
||||
int afShortage, afSize = 100;
|
||||
struct AvailFontsHeader *afh;
|
||||
struct AvailFonts *af;
|
||||
ULONG found = 0;
|
||||
|
@ -315,7 +315,7 @@ ULONG ami_font_scan_list(struct MinList *list)
|
|||
if(afh) {
|
||||
af = (struct AvailFonts *)&(afh[1]);
|
||||
|
||||
for(i = 0; i < afh->afh_NumEntries; i++) {
|
||||
for(int i = 0; i < afh->afh_NumEntries; i++) {
|
||||
if(af[i].af_Attr.ta_Style == FS_NORMAL) {
|
||||
if(af[i].af_Attr.ta_Name != NULL) {
|
||||
node = (struct nsObject *)FindIName((struct List *)list,
|
||||
|
|
|
@ -25,6 +25,6 @@ void ami_font_scan_init(const char *filename, bool force_scan, bool save,
|
|||
lwc_string **glypharray);
|
||||
void ami_font_scan_fini(lwc_string **glypharray);
|
||||
void ami_font_scan_save(const char *filename, lwc_string **glypharray);
|
||||
const char *ami_font_scan_lookup(uint16 *code, lwc_string **glypharray);
|
||||
const char *ami_font_scan_lookup(const uint16 *code, lwc_string **glypharray);
|
||||
|
||||
#endif
|
||||
|
|
1497
amiga/gui.c
1497
amiga/gui.c
File diff suppressed because it is too large
Load Diff
12
amiga/gui.h
12
amiga/gui.h
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2008-2012 Chris Young <chris@unsatisfactorysoftware.co.uk>
|
||||
* Copyright 2008-2014 Chris Young <chris@unsatisfactorysoftware.co.uk>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
|
@ -111,6 +111,8 @@ struct gui_window_2 {
|
|||
ULONG hotlist_items;
|
||||
char *hotlist_toolbar_lab[AMI_GUI_TOOLBAR_MAX];
|
||||
struct List hotlist_toolbar_list;
|
||||
struct List *web_search_list;
|
||||
Object *search_bm;
|
||||
char *svbuffer;
|
||||
char *status;
|
||||
char *wintitle;
|
||||
|
@ -120,7 +122,6 @@ struct gui_window_2 {
|
|||
BOOL rmbtrapped;
|
||||
struct AppIcon *appicon; /* iconify appicon */
|
||||
struct DiskObject *dobj; /* iconify appicon */
|
||||
struct Hook search_ico_hook;
|
||||
struct Hook favicon_hook;
|
||||
struct Hook throbber_hook;
|
||||
gui_drag_type drag_op;
|
||||
|
@ -153,6 +154,7 @@ struct gui_window
|
|||
|
||||
void ami_get_msg(void);
|
||||
void ami_close_all_tabs(struct gui_window_2 *gwin);
|
||||
void ami_try_quit(void);
|
||||
void ami_quit_netsurf(void);
|
||||
void ami_schedule_redraw(struct gui_window_2 *gwin, bool full_redraw);
|
||||
STRPTR ami_locale_langs(void);
|
||||
|
@ -160,10 +162,12 @@ int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie);
|
|||
bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y);
|
||||
BOOL ami_gadget_hit(Object *obj, int x, int y);
|
||||
void ami_gui_history(struct gui_window_2 *gwin, bool back);
|
||||
void ami_gui_hotlist_toolbar_update_all(void);
|
||||
void ami_gui_hotlist_update_all(void);
|
||||
void ami_gui_tabs_toggle_all(void);
|
||||
bool ami_locate_resource(char *fullpath, const char *file);
|
||||
void ami_gui_update_hotlist_button(struct gui_window_2 *gwin);
|
||||
nserror ami_gui_new_blank_tab(struct gui_window_2 *gwin);
|
||||
char *ami_gui_get_cache_favicon_name(nsurl *url, bool only_if_avail);
|
||||
|
||||
struct TextFont *origrpfont;
|
||||
struct MinList *window_list;
|
||||
|
@ -175,4 +179,6 @@ struct browser_window *curbw;
|
|||
struct gui_globals browserglob;
|
||||
uint32 ami_appid;
|
||||
BOOL ami_autoscroll;
|
||||
BOOL popupmenu_lib_ok;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ enum
|
|||
#define OPTS_MAX_TABS 10
|
||||
#define OPTS_MAX_SCREEN 4
|
||||
#define OPTS_MAX_PROXY 5
|
||||
#define OPTS_MAX_NATIVEBM 3
|
||||
#define OPTS_MAX_NATIVEBM 4
|
||||
#define OPTS_MAX_DITHER 4
|
||||
|
||||
struct ami_gui_opts_window {
|
||||
|
@ -216,10 +216,7 @@ CONST_STRPTR nativebmopts[OPTS_MAX_NATIVEBM];
|
|||
CONST_STRPTR ditheropts[OPTS_MAX_DITHER];
|
||||
CONST_STRPTR fontopts[6];
|
||||
CONST_STRPTR gadlab[OPTS_LAST];
|
||||
STRPTR *websearch_list;
|
||||
|
||||
STRPTR *ami_gui_opts_websearch(void);
|
||||
void ami_gui_opts_websearch_free(STRPTR *websearchlist);
|
||||
struct List *websearch_list;
|
||||
|
||||
void ami_gui_opts_setup(void)
|
||||
{
|
||||
|
@ -299,7 +296,7 @@ void ami_gui_opts_setup(void)
|
|||
gadlab[GID_OPTS_FONT_MINSIZE] = (char *)ami_utf8_easy((char *)messages_get("Minimum"));
|
||||
gadlab[GID_OPTS_FONT_ANTIALIASING] = (char *)ami_utf8_easy((char *)messages_get("FontAntialiasing"));
|
||||
gadlab[GID_OPTS_CACHE_MEM] = (char *)ami_utf8_easy((char *)messages_get("Size"));
|
||||
gadlab[GID_OPTS_CACHE_DISC] = (char *)ami_utf8_easy((char *)messages_get("Duration"));
|
||||
gadlab[GID_OPTS_CACHE_DISC] = (char *)ami_utf8_easy((char *)messages_get("Size"));
|
||||
gadlab[GID_OPTS_OVERWRITE] = (char *)ami_utf8_easy((char *)messages_get("ConfirmOverwrite"));
|
||||
gadlab[GID_OPTS_NOTIFY] = (char *)ami_utf8_easy((char *)messages_get("DownloadNotify"));
|
||||
gadlab[GID_OPTS_DLDIR] = (char *)ami_utf8_easy((char *)messages_get("DownloadDir"));
|
||||
|
@ -406,9 +403,12 @@ void ami_gui_opts_open(void)
|
|||
BOOL proxyhostdisabled = TRUE, proxyauthdisabled = TRUE, proxybypassdisabled = FALSE;
|
||||
BOOL disableanims, animspeeddisabled = FALSE, acceptlangdisabled = FALSE;
|
||||
BOOL scaleselected = nsoption_bool(scale_quality), scaledisabled = FALSE;
|
||||
BOOL ditherdisable = TRUE;
|
||||
BOOL download_notify_disabled = FALSE;
|
||||
BOOL ptr_disable = FALSE;
|
||||
char animspeed[10];
|
||||
char *homepage_url_lc = ami_utf8_easy(nsoption_charp(homepage_url));
|
||||
|
||||
struct TextAttr fontsans, fontserif, fontmono, fontcursive, fontfantasy;
|
||||
|
||||
if(gow && gow->win)
|
||||
|
@ -446,6 +446,9 @@ void ami_gui_opts_open(void)
|
|||
screenmodeid = strtoul(nsoption_charp(screen_modeid),NULL,0);
|
||||
}
|
||||
|
||||
if(ami_plot_screen_is_palettemapped() == true)
|
||||
ditherdisable = FALSE;
|
||||
|
||||
if(nsoption_bool(http_proxy) == true)
|
||||
{
|
||||
proxytype = nsoption_int(http_proxy_auth) + 1;
|
||||
|
@ -553,7 +556,7 @@ void ami_gui_opts_open(void)
|
|||
LAYOUT_AddChild, gow->objects[GID_OPTS_HOMEPAGE] = StringObject,
|
||||
GA_ID, GID_OPTS_HOMEPAGE,
|
||||
GA_RelVerify, TRUE,
|
||||
STRINGA_TextVal, nsoption_charp(homepage_url),
|
||||
STRINGA_TextVal, homepage_url_lc,
|
||||
STRINGA_BufferPos,0,
|
||||
StringEnd,
|
||||
CHILD_Label, LabelObject,
|
||||
|
@ -907,6 +910,7 @@ void ami_gui_opts_open(void)
|
|||
LAYOUT_AddChild, gow->objects[GID_OPTS_DITHERQ] = ChooserObject,
|
||||
GA_ID, GID_OPTS_DITHERQ,
|
||||
GA_RelVerify, TRUE,
|
||||
GA_Disabled, ditherdisable,
|
||||
CHOOSER_PopUp, TRUE,
|
||||
CHOOSER_LabelArray, ditheropts,
|
||||
CHOOSER_Selected, nsoption_int(dither_quality),
|
||||
|
@ -1150,15 +1154,14 @@ void ami_gui_opts_open(void)
|
|||
LAYOUT_AddChild, gow->objects[GID_OPTS_CACHE_DISC] = IntegerObject,
|
||||
GA_ID, GID_OPTS_CACHE_DISC,
|
||||
GA_RelVerify, TRUE,
|
||||
GA_Disabled, TRUE,
|
||||
INTEGER_Number, nsoption_int(disc_cache_age),
|
||||
INTEGER_Number, nsoption_uint(disc_cache_size) / 1048576,
|
||||
INTEGER_Minimum, 0,
|
||||
INTEGER_Maximum, 366,
|
||||
INTEGER_Maximum, 4096,
|
||||
INTEGER_Arrows, TRUE,
|
||||
IntegerEnd,
|
||||
CHILD_WeightedWidth, 0,
|
||||
CHILD_Label, LabelObject,
|
||||
LABEL_Text, gadlab[LAB_OPTS_DAYS],
|
||||
LABEL_Text, gadlab[LAB_OPTS_MB],
|
||||
LabelEnd,
|
||||
LayoutEnd,
|
||||
CHILD_Label, LabelObject,
|
||||
|
@ -1306,7 +1309,7 @@ void ami_gui_opts_open(void)
|
|||
GA_ID, GID_OPTS_SEARCH_PROV,
|
||||
GA_RelVerify, TRUE,
|
||||
CHOOSER_PopUp, TRUE,
|
||||
CHOOSER_LabelArray, websearch_list,
|
||||
CHOOSER_Labels, websearch_list,
|
||||
CHOOSER_Selected, nsoption_int(search_provider),
|
||||
CHOOSER_MaxLabels, 40,
|
||||
ChooserEnd,
|
||||
|
@ -1328,6 +1331,7 @@ void ami_gui_opts_open(void)
|
|||
GA_RelVerify, TRUE,
|
||||
GA_Text, gadlab[GID_OPTS_CONTEXTMENU],
|
||||
GA_Selected, nsoption_bool(context_menu),
|
||||
GA_Disabled, !popupmenu_lib_ok,
|
||||
CheckBoxEnd,
|
||||
#endif
|
||||
LAYOUT_AddChild, gow->objects[GID_OPTS_FASTSCROLL] = CheckBoxObject,
|
||||
|
@ -1523,6 +1527,7 @@ void ami_gui_opts_open(void)
|
|||
gow->node = AddObject(window_list,AMINS_GUIOPTSWINDOW);
|
||||
gow->node->objstruct = gow;
|
||||
}
|
||||
ami_utf8_free(homepage_url_lc);
|
||||
}
|
||||
|
||||
void ami_gui_opts_use(bool save)
|
||||
|
@ -1537,7 +1542,7 @@ void ami_gui_opts_use(bool save)
|
|||
ami_update_pointer(gow->win, GUI_POINTER_WAIT);
|
||||
|
||||
GetAttr(STRINGA_TextVal,gow->objects[GID_OPTS_HOMEPAGE],(ULONG *)&data);
|
||||
nsoption_set_charp(homepage_url, (char *)strdup((char *)data));
|
||||
nsoption_set_charp(homepage_url, (char *)ami_to_utf8_easy((char *)data));
|
||||
|
||||
GetAttr(STRINGA_TextVal,gow->objects[GID_OPTS_CONTENTLANG],(ULONG *)&data);
|
||||
nsoption_set_charp(accept_language, (char *)strdup((char *)data));
|
||||
|
@ -1742,7 +1747,8 @@ void ami_gui_opts_use(bool save)
|
|||
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_CACHE_MEM],(ULONG *)&nsoption_int(memory_cache_size));
|
||||
nsoption_set_int(memory_cache_size, nsoption_int(memory_cache_size) * 1048576);
|
||||
|
||||
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_CACHE_DISC],(ULONG *)&nsoption_int(disc_cache_age));
|
||||
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_CACHE_DISC],(ULONG *)&nsoption_uint(disc_cache_size));
|
||||
nsoption_set_uint(disc_cache_size, nsoption_uint(disc_cache_size) * 1048576);
|
||||
|
||||
GetAttr(GA_Selected,gow->objects[GID_OPTS_OVERWRITE],(ULONG *)&data);
|
||||
if (data) {
|
||||
|
@ -1802,8 +1808,7 @@ void ami_gui_opts_use(bool save)
|
|||
ami_gui_tabs_toggle_all();
|
||||
|
||||
GetAttr(CHOOSER_Selected,gow->objects[GID_OPTS_SEARCH_PROV],(ULONG *)&nsoption_int(search_provider));
|
||||
search_web_provider_details(nsoption_int(search_provider));
|
||||
search_web_retrieve_ico(false);
|
||||
search_web_select_provider(nsoption_int(search_provider));
|
||||
|
||||
GetAttr(GA_Selected,gow->objects[GID_OPTS_CLIPBOARD],(ULONG *)&data);
|
||||
if (data) {
|
||||
|
@ -1929,10 +1934,10 @@ BOOL ami_gui_opts_event(void)
|
|||
case WMHI_GADGETHELP:
|
||||
if((result & WMHI_GADGETMASK) == 0) {
|
||||
/* Pointer not over our window */
|
||||
ami_help_open(AMI_HELP_MAIN);
|
||||
ami_help_open(AMI_HELP_MAIN, scrn);
|
||||
} else {
|
||||
/* TODO: Make this sensitive to the tab the user is currently on */
|
||||
ami_help_open(AMI_HELP_PREFS);
|
||||
ami_help_open(AMI_HELP_PREFS, scrn);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -2110,39 +2115,41 @@ BOOL ami_gui_opts_event(void)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
STRPTR *ami_gui_opts_websearch(void)
|
||||
struct List *ami_gui_opts_websearch(void)
|
||||
{
|
||||
char buf[300];
|
||||
ULONG ref = 0;
|
||||
STRPTR *websearchlist;
|
||||
struct List *list;
|
||||
struct Node *node;
|
||||
const char *name;
|
||||
int iter;
|
||||
|
||||
websearchlist = AllocVecTagList(200, NULL); /* NB: Was not MEMF_PRIVATE */
|
||||
list = AllocVecTagList(sizeof(struct List), NULL);
|
||||
NewList(list);
|
||||
|
||||
if (nsoption_charp(search_engines_file) == NULL) return websearchlist;
|
||||
if (nsoption_charp(search_engines_file) == NULL) return list;
|
||||
|
||||
FILE *f = fopen(nsoption_charp(search_engines_file), "r");
|
||||
if (f == NULL) return websearchlist;
|
||||
|
||||
while (fgets(buf, sizeof(buf), f) != NULL) {
|
||||
if (buf[0] == '\0') continue;
|
||||
buf[strlen(buf)-1] = '\0';
|
||||
websearchlist[ref] = strdup(strtok(buf, "|"));
|
||||
ref++;
|
||||
for (iter = search_web_iterate_providers(0, &name);
|
||||
iter != -1;
|
||||
iter = search_web_iterate_providers(iter, &name)) {
|
||||
node = AllocChooserNode(CNA_Text, name, TAG_DONE);
|
||||
AddTail(list, node);
|
||||
}
|
||||
fclose(f);
|
||||
websearchlist[ref] = NULL;
|
||||
|
||||
return websearchlist;
|
||||
return list;
|
||||
}
|
||||
|
||||
void ami_gui_opts_websearch_free(STRPTR *websearchlist)
|
||||
void ami_gui_opts_websearch_free(struct List *websearchlist)
|
||||
{
|
||||
ULONG ref = 0;
|
||||
struct Node *node;
|
||||
struct Node *nnode;
|
||||
|
||||
while (websearchlist[ref] != NULL) {
|
||||
free(websearchlist[ref]);
|
||||
ref++;
|
||||
}
|
||||
if(IsListEmpty(websearchlist)) return;
|
||||
node = GetHead(websearchlist);
|
||||
|
||||
do {
|
||||
nnode = GetSucc(node);
|
||||
Remove(node);
|
||||
} while(node = nnode);
|
||||
|
||||
FreeVec(websearchlist);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,15 @@
|
|||
|
||||
#ifndef AMIGA_GUI_OPTIONS_H
|
||||
#define AMIGA_GUI_OPTIONS_H
|
||||
/* Prefs GUI control */
|
||||
void ami_gui_opts_open(void);
|
||||
BOOL ami_gui_opts_event(void);
|
||||
void ami_gui_opts_close(void);
|
||||
|
||||
/* Web search list */
|
||||
struct List *ami_gui_opts_websearch(void);
|
||||
void ami_gui_opts_websearch_free(struct List *websearchlist);
|
||||
|
||||
char *current_user_options;
|
||||
#endif
|
||||
|
||||
|
|
21
amiga/help.c
21
amiga/help.c
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2013 Chris Young <chris@unsatisfactorysoftware.co.uk>
|
||||
* Copyright 2013-4 Chris Young <chris@unsatisfactorysoftware.co.uk>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
|
@ -45,8 +45,9 @@ void ami_help_init(struct Screen *screen)
|
|||
TAG_DONE);
|
||||
}
|
||||
|
||||
void ami_help_open(ULONG node)
|
||||
void ami_help_open(ULONG node, struct Screen *screen)
|
||||
{
|
||||
if(AmigaGuideObject == NULL) ami_help_init(screen);
|
||||
SetAttrs(AmigaGuideObject, AMIGAGUIDE_ContextID, node, TAG_DONE);
|
||||
IDoMethod(AmigaGuideObject, AGM_OPEN, NULL);
|
||||
}
|
||||
|
@ -62,5 +63,21 @@ void ami_help_free(void)
|
|||
|
||||
void ami_help_new_screen(struct Screen *screen)
|
||||
{
|
||||
if(AmigaGuideObject == NULL) return;
|
||||
SetAttrs(AmigaGuideObject, AMIGAGUIDE_Screen, screen, TAG_DONE);
|
||||
}
|
||||
|
||||
ULONG ami_help_signal(void)
|
||||
{
|
||||
ULONG ag_sig = 0;
|
||||
if(AmigaGuideObject)
|
||||
GetAttr(AMIGAGUIDE_Signal, AmigaGuideObject, &ag_sig);
|
||||
return ag_sig;
|
||||
}
|
||||
|
||||
void ami_help_process(void)
|
||||
{
|
||||
ULONG ret = IDoMethod(AmigaGuideObject, AGM_PROCESS, NULL);
|
||||
if(ret) ami_help_free();
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,10 @@ enum {
|
|||
|
||||
struct Screen;
|
||||
|
||||
void ami_help_init(struct Screen *screen);
|
||||
void ami_help_open(ULONG node);
|
||||
void ami_help_open(ULONG node, struct Screen *screen);
|
||||
void ami_help_free(void);
|
||||
void ami_help_new_screen(struct Screen *screen);
|
||||
ULONG ami_help_signal(void);
|
||||
void ami_help_process(void);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -25,14 +25,13 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "desktop/browser_history.h"
|
||||
#include "desktop/browser_private.h"
|
||||
#include "desktop/local_history.h"
|
||||
#include "desktop/plotters.h"
|
||||
#include "amiga/os3support.h"
|
||||
#include "amiga/object.h"
|
||||
#include "amiga/gui.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/url.h"
|
||||
#include "utils/utils.h"
|
||||
#include <proto/intuition.h>
|
||||
#include "amiga/history_local.h"
|
||||
|
@ -52,7 +51,7 @@
|
|||
#include <reaction/reaction.h>
|
||||
#include <reaction/reaction_macros.h>
|
||||
|
||||
static struct history *history_current = 0;
|
||||
static struct browser_window *history_bw;
|
||||
/* Last position of mouse in window. */
|
||||
static int mouse_x = 0;
|
||||
/* Last position of mouse in window. */
|
||||
|
@ -74,11 +73,10 @@ static void ami_history_scroller_hook(struct Hook *hook,Object *object,struct In
|
|||
void ami_history_open(struct browser_window *bw, struct history *history)
|
||||
{
|
||||
int width, height;
|
||||
struct IBox *bbox;
|
||||
|
||||
assert(history);
|
||||
|
||||
history_current = history;
|
||||
history_bw = bw;
|
||||
|
||||
if(!hwindow)
|
||||
{
|
||||
|
@ -87,7 +85,7 @@ void ami_history_open(struct browser_window *bw, struct history *history)
|
|||
ami_init_layers(&hwindow->gg, scrn->Width, scrn->Height);
|
||||
|
||||
hwindow->bw = bw;
|
||||
history_size(history, &width, &height);
|
||||
browser_window_history_size(bw, &width, &height);
|
||||
|
||||
hwindow->scrollerhook.h_Entry = (void *)ami_history_scroller_hook;
|
||||
hwindow->scrollerhook.h_Data = hwindow;
|
||||
|
@ -173,7 +171,7 @@ void ami_history_redraw(struct history_window *hw)
|
|||
SetRPAttrs(glob->rp, RPTAG_APenColor, 0xffffffff, TAG_DONE);
|
||||
RectFill(glob->rp, 0, 0, bbox->Width - 1, bbox->Height - 1);
|
||||
|
||||
history_redraw_rectangle(history_current, xs, ys,
|
||||
browser_window_history_redraw_rectangle(history_bw, xs, ys,
|
||||
bbox->Width + xs, bbox->Height + ys, 0, 0, &ctx);
|
||||
|
||||
glob = &browserglob;
|
||||
|
@ -210,13 +208,13 @@ bool ami_history_click(struct history_window *hw,uint16 code)
|
|||
switch(code)
|
||||
{
|
||||
case SELECTUP:
|
||||
history_click(hw->bw,history_current,x,y,false);
|
||||
browser_window_history_click(history_bw,x,y,false);
|
||||
ami_history_redraw(hw);
|
||||
ami_schedule_redraw(hw->bw->window->shared, true);
|
||||
break;
|
||||
|
||||
case MIDDLEUP:
|
||||
history_click(hw->bw,history_current,x,y,true);
|
||||
browser_window_history_click(history_bw,x,y,true);
|
||||
ami_history_redraw(hw);
|
||||
break;
|
||||
|
||||
|
@ -239,7 +237,6 @@ BOOL ami_history_event(struct history_window *hw)
|
|||
/* return TRUE if window destroyed */
|
||||
ULONG class,result,relevent = 0;
|
||||
uint16 code;
|
||||
struct MenuItem *item;
|
||||
const char *url;
|
||||
struct IBox *bbox;
|
||||
ULONG xs, ys;
|
||||
|
@ -265,7 +262,7 @@ BOOL ami_history_event(struct history_window *hw)
|
|||
GetAttr(SCROLLER_Top, hw->objects[OID_HSCROLL], (ULONG *)&xs);
|
||||
GetAttr(SCROLLER_Top, hw->objects[OID_VSCROLL], (ULONG *)&ys);
|
||||
|
||||
url = history_position_url(history_current,
|
||||
url = browser_window_history_position_url(history_bw,
|
||||
hw->win->MouseX - bbox->Left + xs,
|
||||
hw->win->MouseY - bbox->Top + ys);
|
||||
|
||||
|
@ -297,7 +294,7 @@ void ami_history_update_extent(struct history_window *hw)
|
|||
struct IBox *bbox;
|
||||
int width, height;
|
||||
|
||||
history_size(hw->bw->history, &width, &height);
|
||||
browser_window_history_size(hw->bw, &width, &height);
|
||||
GetAttr(SPACE_AreaBox,hw->objects[GID_BROWSER],(ULONG *)&bbox);
|
||||
|
||||
RefreshSetGadgetAttrs((APTR)hw->objects[OID_VSCROLL],hw->win,NULL,
|
||||
|
|
16
amiga/icon.c
16
amiga/icon.c
|
@ -39,6 +39,7 @@
|
|||
#include "amiga/os3support.h"
|
||||
#include "amiga/bitmap.h"
|
||||
#include "amiga/icon.h"
|
||||
#include "amiga/misc.h"
|
||||
#include "desktop/plotters.h"
|
||||
#include "image/bitmap.h"
|
||||
#include "content/content_protected.h"
|
||||
|
@ -46,6 +47,7 @@
|
|||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/url.h"
|
||||
#include "utils/file.h"
|
||||
|
||||
#define THUMBNAIL_WIDTH 100 /* Icon sizes for thumbnails, usually the same as */
|
||||
#define THUMBNAIL_HEIGHT 86 /* WIDTH/HEIGHT in desktop/thumbnail.c */
|
||||
|
@ -139,18 +141,15 @@ bool amiga_icon_convert(struct content *c)
|
|||
ULONG size;
|
||||
int width = 0, height = 0;
|
||||
long format = 0;
|
||||
int err = 0;
|
||||
int err;
|
||||
uint8 r, g, b, a;
|
||||
ULONG offset;
|
||||
const char *url;
|
||||
char *filename;
|
||||
char *filename = NULL;
|
||||
char *p;
|
||||
ULONG trans, pals1;
|
||||
struct ColorRegister *pal1;
|
||||
|
||||
url = nsurl_access(content_get_url(c));
|
||||
filename = url_to_path(url);
|
||||
|
||||
netsurf_nsurl_to_path(content_get_url(c), &filename);
|
||||
/* This loader will only work on local files, so fail if not a local path */
|
||||
if(filename == NULL)
|
||||
{
|
||||
|
@ -365,7 +364,7 @@ void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct
|
|||
ULONG *icondata1, *icondata2;
|
||||
ULONG width, height;
|
||||
long format = 0;
|
||||
int err = 0;
|
||||
int err;
|
||||
|
||||
if(dobj == NULL) return;
|
||||
|
||||
|
@ -420,11 +419,10 @@ void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct
|
|||
void amiga_icon_superimpose_favicon(char *path, struct hlcache_handle *icon, char *type)
|
||||
{
|
||||
struct DiskObject *dobj = NULL;
|
||||
struct BitMap *bm = NULL;
|
||||
ULONG *icondata1, *icondata2;
|
||||
ULONG width, height;
|
||||
long format = 0;
|
||||
int err = 0;
|
||||
int err;
|
||||
ULONG trans1, pals1;
|
||||
ULONG trans2, pals2;
|
||||
struct ColorRegister *pal1;
|
||||
|
|
|
@ -31,7 +31,7 @@ ULONG numcols;
|
|||
ULONG findcolour(ULONG newcol)
|
||||
{
|
||||
ULONG i;
|
||||
ULONG colour = 0xFFFFFFFF;
|
||||
ULONG colr = 0xFFFFFFFF;
|
||||
UBYTE red,grn,blu;
|
||||
|
||||
red = svgtiny_RED(newcol);
|
||||
|
@ -41,21 +41,20 @@ ULONG findcolour(ULONG newcol)
|
|||
for(i=0;i<numcols;i++)
|
||||
{
|
||||
if((cm[i].red == red) && (cm[i].green == grn) && (cm[i].blue == blu))
|
||||
colour = i;
|
||||
colr = i;
|
||||
}
|
||||
|
||||
return colour;
|
||||
return colr;
|
||||
}
|
||||
|
||||
void addcolour(ULONG newcol)
|
||||
{
|
||||
int i;
|
||||
ULONG colour;
|
||||
ULONG colr;
|
||||
UBYTE red,grn,blu;
|
||||
|
||||
colour = findcolour(newcol);
|
||||
colr = findcolour(newcol);
|
||||
|
||||
if(colour == 0xFFFFFFFF)
|
||||
if(colr == 0xFFFFFFFF)
|
||||
{
|
||||
cm[numcols].red = svgtiny_RED(newcol);
|
||||
cm[numcols].green = svgtiny_GREEN(newcol);
|
||||
|
@ -342,7 +341,6 @@ int main(int argc, char **argv)
|
|||
{
|
||||
BPTR fh = 0;
|
||||
char *buffer;
|
||||
size_t n;
|
||||
struct IFFHandle *iffh = NULL;
|
||||
int64 size;
|
||||
LONG rarray[] = {0,0};
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <proto/openurl.h>
|
||||
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "utils/url.h"
|
||||
|
||||
struct Library *OpenURLBase = NULL;
|
||||
|
@ -49,7 +50,7 @@ struct ami_protocol *ami_openurl_add_protocol(const char *url)
|
|||
struct ami_protocol *ami_p =
|
||||
(struct ami_protocol *)AllocVecTagList(sizeof(struct ami_protocol), NULL);
|
||||
|
||||
if(url_scheme(url, &ami_p->protocol) != URL_FUNC_OK)
|
||||
if(url_scheme(url, &ami_p->protocol) != NSERROR_OK)
|
||||
{
|
||||
FreeVec(ami_p);
|
||||
return NULL;
|
||||
|
@ -105,8 +106,6 @@ BOOL ami_openurl_check_list(struct MinList *list, const char *url)
|
|||
|
||||
void ami_openurl_open(void)
|
||||
{
|
||||
struct ami_protocol *ami_p;
|
||||
|
||||
if(nsoption_bool(use_openurl_lib)) {
|
||||
if(OpenURLBase = OpenLibrary("openurl.library",0))
|
||||
IOpenURL = (struct OpenURLIFace *)GetInterface(OpenURLBase,"main",1,NULL);
|
||||
|
@ -124,26 +123,31 @@ void ami_openurl_close(const char *scheme)
|
|||
ami_openurl_free_list(&ami_unsupportedprotocols);
|
||||
}
|
||||
|
||||
void gui_launch_url(const char *url)
|
||||
nserror gui_launch_url(struct nsurl *url)
|
||||
{
|
||||
APTR procwin = SetProcWindow((APTR)-1L);
|
||||
char *launchurl = NULL;
|
||||
BPTR fptr = 0;
|
||||
|
||||
if(ami_openurl_check_list(&ami_unsupportedprotocols, url) == FALSE)
|
||||
if(ami_openurl_check_list(&ami_unsupportedprotocols, nsurl_access(url)) == FALSE)
|
||||
{
|
||||
if(IOpenURL)
|
||||
{
|
||||
URL_OpenA((STRPTR)url,NULL);
|
||||
} else {
|
||||
if(launchurl = ASPrintf("URL:%s",url)) {
|
||||
fptr = Open(launchurl,MODE_OLDFILE);
|
||||
if(fptr) Close(fptr);
|
||||
else ami_openurl_add_protocol(url);
|
||||
if(launchurl = ASPrintf("URL:%s", nsurl_access(url))) {
|
||||
BPTR fptr = Open(launchurl,MODE_OLDFILE);
|
||||
if(fptr)
|
||||
{
|
||||
Close(fptr);
|
||||
} else {
|
||||
ami_openurl_add_protocol(nsurl_access(url));
|
||||
}
|
||||
FreeVec(launchurl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SetProcWindow(procwin);
|
||||
SetProcWindow(procwin);
|
||||
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
|
|
@ -25,4 +25,7 @@
|
|||
|
||||
void ami_openurl_open(void);
|
||||
void ami_openurl_close(void);
|
||||
|
||||
nserror gui_launch_url(struct nsurl *url);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "desktop/401login.h"
|
||||
#include "amiga/os3support.h"
|
||||
#include "amiga/gui.h"
|
||||
#include "amiga/object.h"
|
||||
|
@ -24,7 +23,6 @@
|
|||
#include <proto/exec.h>
|
||||
#include <proto/intuition.h>
|
||||
#include <proto/utility.h>
|
||||
#include "utils/url.h"
|
||||
#include "content/urldb.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/errors.h"
|
||||
|
@ -93,7 +91,7 @@ void gui_401login_open(nsurl *url, const char *realm,
|
|||
|
||||
lw->objects[OID_MAIN] = WindowObject,
|
||||
WA_ScreenTitle,nsscreentitle,
|
||||
WA_Title,lw->url,
|
||||
WA_Title, nsurl_access(lw->url),
|
||||
WA_Activate, TRUE,
|
||||
WA_DepthGadget, TRUE,
|
||||
WA_DragBar, TRUE,
|
||||
|
|
|
@ -24,4 +24,8 @@
|
|||
struct gui_login_window;
|
||||
|
||||
BOOL ami_401login_event(struct gui_login_window *lw);
|
||||
|
||||
void gui_401login_open(nsurl *url, const char *realm,
|
||||
nserror (*cb)(bool proceed, void *pw), void *cbpw);
|
||||
|
||||
#endif
|
||||
|
|
168
amiga/menu.c
168
amiga/menu.c
|
@ -35,8 +35,6 @@
|
|||
#include <images/label.h>
|
||||
#include <proto/bitmap.h>
|
||||
#include <images/bitmap.h>
|
||||
#include <proto/glyph.h>
|
||||
#include <images/glyph.h>
|
||||
|
||||
#include <reaction/reaction_macros.h>
|
||||
|
||||
|
@ -58,12 +56,19 @@
|
|||
#include "amiga/theme.h"
|
||||
#include "amiga/tree.h"
|
||||
#include "amiga/utf8.h"
|
||||
#include "amiga/schedule.h"
|
||||
#include "desktop/hotlist.h"
|
||||
#include "desktop/browser_private.h"
|
||||
#include "desktop/gui.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/schedule.h"
|
||||
|
||||
/* This is here temporarily until we get a new SDK */
|
||||
#define LABEL_MenuMode (LABEL_Dummy+12)
|
||||
/* (BOOL) Use highlighting that fits in better visually in a
|
||||
menu. Defaults to FALSE. */
|
||||
/**/
|
||||
|
||||
|
||||
enum {
|
||||
NSA_GLYPH_SUBMENU,
|
||||
|
@ -357,13 +362,34 @@ void ami_menu_free_glyphs(void)
|
|||
menu_glyphs_loaded = false;
|
||||
}
|
||||
|
||||
static int ami_menu_calc_item_width(struct gui_window_2 *gwin, int j, struct RastPort *rp)
|
||||
{
|
||||
int space_width = TextLength(rp, " ", 1);
|
||||
int item_size;
|
||||
|
||||
item_size = TextLength(rp, gwin->menulab[j], strlen(gwin->menulab[j]));
|
||||
item_size += space_width;
|
||||
|
||||
if(gwin->menukey[j]) {
|
||||
item_size += TextLength(rp, &gwin->menukey[j], 1);
|
||||
item_size += menu_glyph_width[NSA_GLYPH_AMIGAKEY];
|
||||
/**TODO: take account of the size of other imagery too
|
||||
*/
|
||||
}
|
||||
|
||||
return item_size;
|
||||
}
|
||||
|
||||
|
||||
static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin)
|
||||
{
|
||||
int i, j;
|
||||
int txtlen = 0;
|
||||
int txtlen = 0, subtxtlen = 0;
|
||||
int left_posn;
|
||||
struct RastPort *rp = &scrn->RastPort;
|
||||
struct DrawInfo *dri = GetScreenDrawInfo(scrn);
|
||||
|
||||
int space_width = TextLength(rp, " ", 1);
|
||||
|
||||
if(menu_glyphs_loaded == false)
|
||||
ami_menu_load_glyphs(dri);
|
||||
|
||||
|
@ -372,18 +398,10 @@ static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin)
|
|||
if(gwin->menutype[i] == NM_TITLE) {
|
||||
j = i + 1;
|
||||
txtlen = 0;
|
||||
int item_size = 0;
|
||||
do {
|
||||
if(gwin->menulab[j] != NM_BARLABEL) {
|
||||
if(gwin->menutype[j] == NM_ITEM) {
|
||||
item_size = TextLength(rp, gwin->menulab[j], strlen(gwin->menulab[j]));
|
||||
if(gwin->menukey[j]) {
|
||||
item_size += TextLength(rp, &gwin->menukey[j], 1);
|
||||
item_size += menu_glyph_width[NSA_GLYPH_AMIGAKEY];
|
||||
/**TODO: take account of the size of other imagery too
|
||||
*/
|
||||
}
|
||||
|
||||
int item_size = ami_menu_calc_item_width(gwin, j, rp);
|
||||
if(item_size > txtlen) {
|
||||
txtlen = item_size;
|
||||
}
|
||||
|
@ -398,32 +416,76 @@ static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin)
|
|||
using label.image if there's a bitmap associated with the item. */
|
||||
if((gwin->menuicon[i] != NULL) && (gwin->menulab[i] != NM_BARLABEL)) {
|
||||
int icon_width = 0;
|
||||
Object *blank_space = NULL;
|
||||
Object *submenuarrow = NULL;
|
||||
Object *icon = BitMapObject,
|
||||
BITMAP_Screen, scrn,
|
||||
BITMAP_SourceFile, gwin->menuicon[i],
|
||||
BITMAP_Masking, TRUE,
|
||||
BitMapEnd;
|
||||
|
||||
/* \todo make this scale the bitmap to these dimensions */
|
||||
SetAttrs(icon,
|
||||
BITMAP_Width, 16,
|
||||
BITMAP_Height, 16,
|
||||
TAG_DONE);
|
||||
|
||||
GetAttr(IA_Width, icon, (ULONG *)&icon_width);
|
||||
|
||||
|
||||
if(gwin->menutype[i] == NM_SUB) {
|
||||
left_posn = subtxtlen;
|
||||
} else {
|
||||
left_posn = txtlen;
|
||||
}
|
||||
|
||||
left_posn = left_posn -
|
||||
TextLength(rp, gwin->menulab[i], strlen(gwin->menulab[i])) -
|
||||
icon_width - space_width;
|
||||
|
||||
if((gwin->menutype[i] == NM_ITEM) && (gwin->menutype[i+1] == NM_SUB)) {
|
||||
left_posn -= menu_glyph_width[NSA_GLYPH_SUBMENU];
|
||||
|
||||
submenuarrow = NewObject(NULL, "sysiclass",
|
||||
SYSIA_Which, MENUSUB,
|
||||
SYSIA_DrawInfo, dri,
|
||||
IA_Left, txtlen - TextLength(rp, gwin->menulab[i], strlen(gwin->menulab[i])) -
|
||||
menu_glyph_width[NSA_GLYPH_SUBMENU] - icon_width,
|
||||
SYSIA_Which, MENUSUB,
|
||||
SYSIA_DrawInfo, dri,
|
||||
IA_Left, left_posn,
|
||||
TAG_DONE);
|
||||
|
||||
j = i + 1;
|
||||
subtxtlen = 0;
|
||||
do {
|
||||
if(gwin->menulab[j] != NM_BARLABEL) {
|
||||
if(gwin->menutype[j] == NM_SUB) {
|
||||
int item_size = ami_menu_calc_item_width(gwin, j, rp);
|
||||
if(item_size > subtxtlen) {
|
||||
subtxtlen = item_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
j++;
|
||||
} while((gwin->menutype[j] == NM_SUB));
|
||||
}
|
||||
|
||||
/**TODO: Checkmark/MX images and keyboard shortcuts
|
||||
*/
|
||||
|
||||
if(gwin->menutype[i] == NM_SUB) {
|
||||
blank_space = NewObject(NULL, "fillrectclass",
|
||||
IA_Height, 0,
|
||||
IA_Width, left_posn + icon_width,
|
||||
TAG_DONE);
|
||||
}
|
||||
|
||||
gwin->menuobj[i] = LabelObject,
|
||||
LABEL_MenuMode, TRUE,
|
||||
LABEL_DrawInfo, dri,
|
||||
LABEL_DisposeImage, TRUE,
|
||||
LABEL_Image, icon,
|
||||
LABEL_Text, " ",
|
||||
LABEL_Text, gwin->menulab[i],
|
||||
LABEL_DisposeImage, TRUE,
|
||||
LABEL_Image, blank_space,
|
||||
LABEL_DisposeImage, TRUE,
|
||||
LABEL_Image, submenuarrow,
|
||||
LabelEnd;
|
||||
|
||||
|
@ -455,8 +517,6 @@ static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin)
|
|||
|
||||
struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
|
||||
{
|
||||
int i;
|
||||
|
||||
gwin->menu = AllocVecTags(sizeof(struct NewMenu) * (AMI_MENU_AREXX_MAX + 1),
|
||||
AVT_ClearWithValue, 0, TAG_DONE);
|
||||
ami_init_menulabs(gwin);
|
||||
|
@ -479,10 +539,6 @@ struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
|
|||
if(nsoption_bool(background_images) == true)
|
||||
gwin->menu[M_IMGBACK].nm_Flags |= CHECKED;
|
||||
|
||||
/* Set up scheduler to refresh the hotlist menu */
|
||||
if(nsoption_int(menu_refresh) > 0)
|
||||
schedule(nsoption_int(menu_refresh), (void *)ami_menu_refresh, gwin);
|
||||
|
||||
return(gwin->menu);
|
||||
}
|
||||
|
||||
|
@ -548,7 +604,7 @@ void ami_menu_arexx_scan(struct gui_window_2 *gwin)
|
|||
static bool ami_menu_hotlist_add(void *userdata, int level, int item, const char *title, nsurl *url, bool is_folder)
|
||||
{
|
||||
UBYTE type;
|
||||
char *icon;
|
||||
STRPTR icon;
|
||||
struct gui_window_2 *gw = (struct gui_window_2 *)userdata;
|
||||
|
||||
if(item >= AMI_MENU_HOTLIST_MAX) return false;
|
||||
|
@ -567,9 +623,10 @@ static bool ami_menu_hotlist_add(void *userdata, int level, int item, const char
|
|||
}
|
||||
|
||||
if(is_folder == true) {
|
||||
icon = "icons/directory.png";
|
||||
icon = ASPrintf("icons/directory.png");
|
||||
} else {
|
||||
icon = "icons/content.png";
|
||||
icon = ami_gui_get_cache_favicon_name(url, true);
|
||||
if (icon == NULL) icon = ASPrintf("icons/content.png");
|
||||
}
|
||||
|
||||
ami_menu_alloc_item(gw, item, type, title,
|
||||
|
@ -577,6 +634,8 @@ static bool ami_menu_hotlist_add(void *userdata, int level, int item, const char
|
|||
if((is_folder == true) && (type == NM_SUB))
|
||||
gw->menu[item].nm_Flags = NM_ITEMDISABLED;
|
||||
|
||||
if(icon) FreeVec(icon);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -697,8 +756,7 @@ static void ami_menu_item_project_newwin(struct Hook *hook, APTR window, struct
|
|||
|
||||
error = nsurl_create(nsoption_charp(homepage_url), &url);
|
||||
if (error == NSERROR_OK) {
|
||||
error = browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY,
|
||||
error = browser_window_create(BW_CREATE_HISTORY,
|
||||
url,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -713,25 +771,10 @@ static void ami_menu_item_project_newwin(struct Hook *hook, APTR window, struct
|
|||
static void ami_menu_item_project_newtab(struct Hook *hook, APTR window, struct IntuiMessage *msg)
|
||||
{
|
||||
struct gui_window_2 *gwin;
|
||||
nsurl *url;
|
||||
nserror error;
|
||||
|
||||
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
|
||||
|
||||
|
||||
error = nsurl_create(nsoption_charp(homepage_url), &url);
|
||||
if (error == NSERROR_OK) {
|
||||
error = browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY |
|
||||
BROWSER_WINDOW_TAB,
|
||||
url,
|
||||
NULL,
|
||||
gwin->bw,
|
||||
NULL);
|
||||
nsurl_unref(url);
|
||||
}
|
||||
if (error != NSERROR_OK) {
|
||||
warn_user(messages_get_errorcode(error), 0);
|
||||
}
|
||||
error = ami_gui_new_blank_tab(gwin);
|
||||
}
|
||||
|
||||
static void ami_menu_item_project_open(struct Hook *hook, APTR window, struct IntuiMessage *msg)
|
||||
|
@ -801,18 +844,9 @@ static void ami_menu_item_project_about(struct Hook *hook, APTR window, struct I
|
|||
TDR_TitleString, messages_get("NetSurf"),
|
||||
TDR_Window, gwin->win,
|
||||
TDR_GadgetString, temp2,
|
||||
#ifndef NDEBUG
|
||||
TDR_FormatString,"NetSurf %s\n%s\nBuild date %s\n\nhttp://www.netsurf-browser.org",
|
||||
#else
|
||||
TDR_FormatString,"NetSurf %s\n%s\n\nhttp://www.netsurf-browser.org",
|
||||
#endif
|
||||
TDR_FormatString,"NetSurf %s\nBuild date %s\n\nhttp://www.netsurf-browser.org",
|
||||
TDR_Arg1,netsurf_version,
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
TDR_Arg2,"Cairo (OS4.1+) SObjs build",
|
||||
#else
|
||||
TDR_Arg2,"graphics.library static build",
|
||||
#endif
|
||||
TDR_Arg3,verdate,
|
||||
TDR_Arg2,verdate,
|
||||
TAG_DONE);
|
||||
|
||||
free(temp2);
|
||||
|
@ -825,8 +859,7 @@ static void ami_menu_item_project_about(struct Hook *hook, APTR window, struct I
|
|||
|
||||
if(url) {
|
||||
if (error == NSERROR_OK) {
|
||||
error = browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY,
|
||||
error = browser_window_create(BW_CREATE_HISTORY,
|
||||
url,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -867,8 +900,12 @@ static void ami_menu_item_edit_copy(struct Hook *hook, APTR window, struct Intui
|
|||
}
|
||||
else if(bm = content_get_bitmap(gwin->bw->current_content))
|
||||
{
|
||||
bm->url = (char *)nsurl_access(hlcache_handle_get_url(gwin->bw->current_content));
|
||||
bm->title = (char *)content_get_title(gwin->bw->current_content);
|
||||
/** @todo It should be checked that the lifetime of
|
||||
* the objects containing the values returned (and the
|
||||
* constness cast away) is safe.
|
||||
*/
|
||||
bm->url = (char *)nsurl_access(browser_window_get_url(gwin->bw));
|
||||
bm->title = (char *)browser_window_get_title(gwin->bw);
|
||||
ami_easy_clipboard_bitmap(bm);
|
||||
}
|
||||
#ifdef WITH_NS_SVG
|
||||
|
@ -1041,7 +1078,6 @@ static void ami_menu_item_hotlist_show(struct Hook *hook, APTR window, struct In
|
|||
static void ami_menu_item_hotlist_entries(struct Hook *hook, APTR window, struct IntuiMessage *msg)
|
||||
{
|
||||
nsurl *url = hook->h_Data;
|
||||
nserror error;
|
||||
struct gui_window_2 *gwin;
|
||||
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
|
||||
|
||||
|
@ -1050,8 +1086,7 @@ static void ami_menu_item_hotlist_entries(struct Hook *hook, APTR window, struct
|
|||
browser_window_navigate(gwin->bw,
|
||||
url,
|
||||
NULL,
|
||||
BROWSER_WINDOW_HISTORY |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
BW_NAVIGATE_HISTORY,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
@ -1109,13 +1144,13 @@ static void ami_menu_item_arexx_entries(struct Hook *hook, APTR window, struct I
|
|||
char *script = hook->h_Data;
|
||||
char *temp;
|
||||
struct gui_window_2 *gwin;
|
||||
BPTR lock = 0;
|
||||
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
|
||||
|
||||
if(script)
|
||||
{
|
||||
if(temp = AllocVecTagList(1024, NULL))
|
||||
{
|
||||
BPTR lock;
|
||||
if(lock = Lock(nsoption_charp(arexx_dir), SHARED_LOCK)) {
|
||||
DevNameFromLock(lock, temp, 1024, DN_FULLPATH);
|
||||
AddPart(temp, script, 1024);
|
||||
|
@ -1126,3 +1161,4 @@ static void ami_menu_item_arexx_entries(struct Hook *hook, APTR window, struct I
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
317
amiga/misc.c
317
amiga/misc.c
|
@ -19,8 +19,10 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <proto/dos.h>
|
||||
#include <proto/exec.h>
|
||||
|
@ -34,8 +36,10 @@
|
|||
#include "amiga/utf8.h"
|
||||
#include "desktop/cookie_manager.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/corestrings.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/url.h"
|
||||
#include "utils/file.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
void warn_user(const char *warning, const char *detail)
|
||||
|
@ -43,7 +47,6 @@ void warn_user(const char *warning, const char *detail)
|
|||
Object *req = NULL;
|
||||
char *utf8warning = ami_utf8_easy(messages_get(warning));
|
||||
STRPTR bodytext = NULL;
|
||||
LONG result = 0;
|
||||
|
||||
LOG(("%s %s", warning, detail));
|
||||
|
||||
|
@ -63,7 +66,7 @@ void warn_user(const char *warning, const char *detail)
|
|||
TAG_DONE);
|
||||
|
||||
if (req) {
|
||||
result = IDoMethod(req, RM_OPENREQ, NULL, NULL, scrn);
|
||||
LONG result = IDoMethod(req, RM_OPENREQ, NULL, NULL, scrn);
|
||||
DisposeObject(req);
|
||||
}
|
||||
|
||||
|
@ -106,54 +109,91 @@ void die(const char *error)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
char *url_to_path(const char *url)
|
||||
/**
|
||||
* Create a path from a nsurl using amiga file handling.
|
||||
*
|
||||
* @param[in] url The url to encode.
|
||||
* @param[out] path_out A string containing the result path which should
|
||||
* be freed by the caller.
|
||||
* @return NSERROR_OK and the path is written to \a path or error code
|
||||
* on faliure.
|
||||
*/
|
||||
static nserror amiga_nsurl_to_path(struct nsurl *url, char **path_out)
|
||||
{
|
||||
char *tmps, *unesc, *slash, *colon, *url2;
|
||||
lwc_string *urlpath;
|
||||
char *path;
|
||||
bool match;
|
||||
lwc_string *scheme;
|
||||
nserror res;
|
||||
char *colon;
|
||||
char *slash;
|
||||
|
||||
if (strncmp(url, "file://", SLEN("file://")) != 0)
|
||||
return NULL;
|
||||
if ((url == NULL) || (path_out == NULL)) {
|
||||
return NSERROR_BAD_PARAMETER;
|
||||
}
|
||||
|
||||
url += SLEN("file://");
|
||||
scheme = nsurl_get_component(url, NSURL_SCHEME);
|
||||
|
||||
if (strncmp(url, "localhost", SLEN("localhost")) == 0)
|
||||
url += SLEN("localhost");
|
||||
if (lwc_string_caseless_isequal(scheme, corestring_lwc_file,
|
||||
&match) != lwc_error_ok)
|
||||
{
|
||||
return NSERROR_BAD_PARAMETER;
|
||||
}
|
||||
lwc_string_unref(scheme);
|
||||
if (match == false) {
|
||||
return NSERROR_BAD_PARAMETER;
|
||||
}
|
||||
|
||||
if (strncmp(url, "/", SLEN("/")) == 0)
|
||||
url += SLEN("/");
|
||||
urlpath = nsurl_get_component(url, NSURL_PATH);
|
||||
if (urlpath == NULL) {
|
||||
return NSERROR_BAD_PARAMETER;
|
||||
}
|
||||
|
||||
if(*url == '\0')
|
||||
return NULL; /* file:/// is not a valid path */
|
||||
res = url_unescape(lwc_string_data(urlpath) + 1, &path);
|
||||
lwc_string_unref(urlpath);
|
||||
if (res != NSERROR_OK) {
|
||||
return res;
|
||||
}
|
||||
|
||||
url2 = malloc(strlen(url) + 2);
|
||||
strcpy(url2, url);
|
||||
|
||||
colon = strchr(url2, ':');
|
||||
colon = strchr(path, ':');
|
||||
if(colon == NULL)
|
||||
{
|
||||
if(slash = strchr(url2, '/'))
|
||||
slash = strchr(path, '/');
|
||||
if(slash)
|
||||
{
|
||||
*slash = ':';
|
||||
}
|
||||
else
|
||||
{
|
||||
int len = strlen(url2);
|
||||
url2[len] = ':';
|
||||
url2[len + 1] = '\0';
|
||||
int len = strlen(path);
|
||||
path[len] = ':';
|
||||
path[len + 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
if(url_unescape(url2,&unesc) == URL_FUNC_OK)
|
||||
return unesc;
|
||||
*path_out = path;
|
||||
|
||||
return (char *)url2;
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
char *path_to_url(const char *path)
|
||||
/**
|
||||
* Create a nsurl from a path using amiga file handling.
|
||||
*
|
||||
* Perform the necessary operations on a path to generate a nsurl.
|
||||
*
|
||||
* @param[in] path The path to convert.
|
||||
* @param[out] url_out pointer to recive the nsurl, The returned url
|
||||
* must be unreferenced by the caller.
|
||||
* @return NSERROR_OK and the url is placed in \a url or error code on
|
||||
* faliure.
|
||||
*/
|
||||
static nserror amiga_path_to_nsurl(const char *path, struct nsurl **url_out)
|
||||
{
|
||||
char *colon = NULL;
|
||||
char *r = NULL;
|
||||
char newpath[1024 + strlen(path)];
|
||||
BPTR lock = 0;
|
||||
nserror ret;
|
||||
|
||||
if(lock = Lock(path, MODE_OLDFILE))
|
||||
{
|
||||
|
@ -163,40 +203,19 @@ char *path_to_url(const char *path)
|
|||
else strlcpy(newpath, path, sizeof newpath);
|
||||
|
||||
r = malloc(strlen(newpath) + SLEN("file:///") + 1);
|
||||
if (r == NULL) {
|
||||
return NSERROR_NOMEM;
|
||||
}
|
||||
|
||||
if(colon = strchr(newpath, ':')) *colon = '/';
|
||||
|
||||
strcpy(r, "file:///");
|
||||
strcat(r, newpath);
|
||||
|
||||
return r;
|
||||
}
|
||||
ret = nsurl_create(r, url_out);
|
||||
free(r);
|
||||
|
||||
/**
|
||||
* Return the filename part of a full path
|
||||
*
|
||||
* \param path full path and filename
|
||||
* \return filename (will be freed with free())
|
||||
*/
|
||||
|
||||
char *filename_from_path(char *path)
|
||||
{
|
||||
return strdup(FilePart(path));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a path component/filename to an existing path
|
||||
*
|
||||
* \param path buffer containing path + free space
|
||||
* \param length length of buffer "path"
|
||||
* \param newpart string containing path component to add to path
|
||||
* \return true on success
|
||||
*/
|
||||
|
||||
bool path_add_part(char *path, int length, const char *newpart)
|
||||
{
|
||||
if(AddPart(path, newpart, length)) return true;
|
||||
else return false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -224,3 +243,197 @@ char *translate_escape_chars(const char *s)
|
|||
ret[ii] = '\0';
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a posix path from one or more component elemnts.
|
||||
*
|
||||
* If a string is allocated it must be freed by the caller.
|
||||
*
|
||||
* @param[in,out] str pointer to string pointer if this is NULL enough
|
||||
* storage will be allocated for the complete path.
|
||||
* @param[in,out] size The size of the space available if \a str not
|
||||
* NULL on input and if not NULL set to the total
|
||||
* output length on output.
|
||||
* @param[in] nelm The number of elements.
|
||||
* @param[in] ap The elements of the path as string pointers.
|
||||
* @return NSERROR_OK and the complete path is written to str
|
||||
* or error code on faliure.
|
||||
*/
|
||||
static nserror amiga_vmkpath(char **str, size_t *size, size_t nelm, va_list ap)
|
||||
{
|
||||
const char *elm[16];
|
||||
size_t elm_len[16];
|
||||
size_t elm_idx;
|
||||
char *fname;
|
||||
size_t fname_len = 0;
|
||||
|
||||
/* check the parameters are all sensible */
|
||||
if ((nelm == 0) || (nelm > 16)) {
|
||||
return NSERROR_BAD_PARAMETER;
|
||||
}
|
||||
if ((*str != NULL) && (size == NULL)) {
|
||||
/* if the caller is providing the buffer they must say
|
||||
* how much space is available.
|
||||
*/
|
||||
return NSERROR_BAD_PARAMETER;
|
||||
}
|
||||
|
||||
/* calculate how much storage we need for the complete path
|
||||
* with all the elements.
|
||||
*/
|
||||
for (elm_idx = 0; elm_idx < nelm; elm_idx++) {
|
||||
elm[elm_idx] = va_arg(ap, const char *);
|
||||
/* check the argument is not NULL */
|
||||
if (elm[elm_idx] == NULL) {
|
||||
return NSERROR_BAD_PARAMETER;
|
||||
}
|
||||
elm_len[elm_idx] = strlen(elm[elm_idx]);
|
||||
fname_len += elm_len[elm_idx];
|
||||
}
|
||||
fname_len += nelm; /* allow for separators and terminator */
|
||||
|
||||
/* ensure there is enough space */
|
||||
fname = *str;
|
||||
if (fname != NULL) {
|
||||
if (fname_len > *size) {
|
||||
return NSERROR_NOSPACE;
|
||||
}
|
||||
} else {
|
||||
fname = malloc(fname_len);
|
||||
if (fname == NULL) {
|
||||
return NSERROR_NOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
/* copy the first element complete */
|
||||
memmove(fname, elm[0], elm_len[0]);
|
||||
fname[elm_len[0]] = 0;
|
||||
|
||||
/* add the remaining elements */
|
||||
for (elm_idx = 1; elm_idx < nelm; elm_idx++) {
|
||||
if (!AddPart(fname, elm[elm_idx], fname_len)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*str = fname;
|
||||
if (size != NULL) {
|
||||
*size = fname_len;
|
||||
}
|
||||
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the basename of a file using posix path handling.
|
||||
*
|
||||
* This gets the last element of a path and returns it.
|
||||
*
|
||||
* @param[in] path The path to extract the name from.
|
||||
* @param[in,out] str Pointer to string pointer if this is NULL enough
|
||||
* storage will be allocated for the path element.
|
||||
* @param[in,out] size The size of the space available if \a
|
||||
* str not NULL on input and set to the total
|
||||
* output length on output.
|
||||
* @return NSERROR_OK and the complete path is written to str
|
||||
* or error code on faliure.
|
||||
*/
|
||||
static nserror amiga_basename(const char *path, char **str, size_t *size)
|
||||
{
|
||||
const char *leafname;
|
||||
char *fname;
|
||||
|
||||
if (path == NULL) {
|
||||
return NSERROR_BAD_PARAMETER;
|
||||
}
|
||||
|
||||
leafname = FilePart(path);
|
||||
if (leafname == NULL) {
|
||||
return NSERROR_BAD_PARAMETER;
|
||||
}
|
||||
|
||||
fname = strdup(leafname);
|
||||
if (fname == NULL) {
|
||||
return NSERROR_NOMEM;
|
||||
}
|
||||
|
||||
*str = fname;
|
||||
if (size != NULL) {
|
||||
*size = strlen(fname);
|
||||
}
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that all directory elements needed to store a filename exist.
|
||||
*
|
||||
* @param fname The filename to ensure the path to exists.
|
||||
* @return NSERROR_OK on success or error code on failure.
|
||||
*/
|
||||
static nserror amiga_mkdir_all(const char *fname)
|
||||
{
|
||||
char *dname;
|
||||
char *sep;
|
||||
struct stat sb;
|
||||
|
||||
dname = strdup(fname);
|
||||
|
||||
sep = strrchr(dname, '/');
|
||||
if (sep == NULL) {
|
||||
/* no directory separator path is just filename so its ok */
|
||||
free(dname);
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
*sep = 0; /* null terminate directory path */
|
||||
|
||||
if (stat(dname, &sb) == 0) {
|
||||
free(dname);
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
/* path to file exists and is a directory */
|
||||
return NSERROR_OK;
|
||||
}
|
||||
return NSERROR_NOT_DIRECTORY;
|
||||
}
|
||||
*sep = '/'; /* restore separator */
|
||||
|
||||
sep = dname;
|
||||
while (*sep == '/') {
|
||||
sep++;
|
||||
}
|
||||
while ((sep = strchr(sep, '/')) != NULL) {
|
||||
*sep = 0;
|
||||
if (stat(dname, &sb) != 0) {
|
||||
if (nsmkdir(dname, S_IRWXU) != 0) {
|
||||
/* could not create path element */
|
||||
free(dname);
|
||||
return NSERROR_NOT_FOUND;
|
||||
}
|
||||
} else {
|
||||
if (! S_ISDIR(sb.st_mode)) {
|
||||
/* path element not a directory */
|
||||
free(dname);
|
||||
return NSERROR_NOT_DIRECTORY;
|
||||
}
|
||||
}
|
||||
*sep = '/'; /* restore separator */
|
||||
/* skip directory separators */
|
||||
while (*sep == '/') {
|
||||
sep++;
|
||||
}
|
||||
}
|
||||
|
||||
free(dname);
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
/* amiga file handling operations */
|
||||
static struct gui_file_table file_table = {
|
||||
.mkpath = amiga_vmkpath,
|
||||
.basename = amiga_basename,
|
||||
.nsurl_to_path = amiga_nsurl_to_path,
|
||||
.path_to_nsurl = amiga_path_to_nsurl,
|
||||
.mkdir_all = amiga_mkdir_all,
|
||||
};
|
||||
|
||||
struct gui_file_table *amiga_file_table = &file_table;
|
||||
|
|
|
@ -18,6 +18,11 @@
|
|||
|
||||
#ifndef AMIGA_MISC_H
|
||||
#define AMIGA_MISC_H
|
||||
|
||||
extern struct gui_file_table *amiga_file_table;
|
||||
|
||||
char *translate_escape_chars(const char *s);
|
||||
int32 ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -77,7 +77,6 @@ NSOPTION_INTEGER(cookies_window_ypos, 0)
|
|||
NSOPTION_INTEGER(cookies_window_xsize, 0)
|
||||
NSOPTION_INTEGER(cookies_window_ysize, 0)
|
||||
NSOPTION_INTEGER(web_search_width, 0)
|
||||
NSOPTION_INTEGER(cairo_renderer, 0)
|
||||
NSOPTION_BOOL(direct_render, false)
|
||||
NSOPTION_BOOL(window_simple_refresh, false)
|
||||
NSOPTION_BOOL(resize_with_contents, false)
|
||||
|
@ -87,6 +86,4 @@ NSOPTION_INTEGER(redraw_tile_size_y, 0)
|
|||
NSOPTION_INTEGER(monitor_aspect_x, 0)
|
||||
NSOPTION_INTEGER(monitor_aspect_y, 0)
|
||||
NSOPTION_BOOL(accept_lang_locale, true)
|
||||
NSOPTION_INTEGER(menu_refresh, 0)
|
||||
|
||||
|
||||
|
|
548
amiga/plotters.c
548
amiga/plotters.c
|
@ -71,11 +71,6 @@ bool palette_mapped = false;
|
|||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
#include <cairo/cairo.h>
|
||||
#include <cairo/cairo-amigaos.h>
|
||||
#endif
|
||||
|
||||
#define PATT_DOT 0xAAAA
|
||||
#define PATT_DASH 0xCCCC
|
||||
#define PATT_LINE 0xFFFF
|
||||
|
@ -102,42 +97,6 @@ const struct plotter_table amiplot = {
|
|||
.option_knockout = true,
|
||||
};
|
||||
|
||||
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
void ami_cairo_set_colour(cairo_t *cr,colour c)
|
||||
{
|
||||
int r, g, b;
|
||||
|
||||
r = c & 0xff;
|
||||
g = (c & 0xff00) >> 8;
|
||||
b = (c & 0xff0000) >> 16;
|
||||
|
||||
cairo_set_source_rgba(glob->cr, r / 255.0,
|
||||
g / 255.0, b / 255.0, 1.0);
|
||||
}
|
||||
|
||||
void ami_cairo_set_solid(cairo_t *cr)
|
||||
{
|
||||
double dashes = 0;
|
||||
|
||||
cairo_set_dash(glob->cr, &dashes, 0, 0);
|
||||
}
|
||||
|
||||
void ami_cairo_set_dotted(cairo_t *cr)
|
||||
{
|
||||
double cdashes = 1;
|
||||
|
||||
cairo_set_dash(glob->cr, &cdashes, 1, 0);
|
||||
}
|
||||
|
||||
void ami_cairo_set_dashed(cairo_t *cr)
|
||||
{
|
||||
double cdashes = 3;
|
||||
|
||||
cairo_set_dash(glob->cr, &cdashes, 1, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
|
||||
{
|
||||
/* init shared bitmaps *
|
||||
|
@ -148,7 +107,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
|
|||
struct BitMap *friend = NULL;
|
||||
|
||||
depth = GetBitMapAttr(scrn->RastPort.BitMap, BMA_DEPTH);
|
||||
if((depth < 16) || (nsoption_int(cairo_renderer) == -1)) {
|
||||
if(depth < 16) {
|
||||
palette_mapped = true;
|
||||
} else {
|
||||
palette_mapped = false;
|
||||
|
@ -195,19 +154,10 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
|
|||
if((!gg->tmprasbuf) || (!gg->rp->TmpRas)) warn_user("NoMemory","");
|
||||
|
||||
InitTmpRas(gg->rp->TmpRas, gg->tmprasbuf, width*height);
|
||||
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
gg->surface = cairo_amigaos_surface_create(gg->rp->BitMap);
|
||||
gg->cr = cairo_create(gg->surface);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ami_free_layers(struct gui_globals *gg)
|
||||
{
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
cairo_destroy(gg->cr);
|
||||
cairo_surface_destroy(gg->surface);
|
||||
#endif
|
||||
if(gg->rp)
|
||||
{
|
||||
DeleteLayer(0,gg->rp->Layer);
|
||||
|
@ -239,16 +189,16 @@ void ami_clearclipreg(struct gui_globals *gg)
|
|||
gg->rect.MaxY = scrn->Height-1;
|
||||
}
|
||||
|
||||
static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colour)
|
||||
static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colr)
|
||||
{
|
||||
struct ami_plot_pen *node;
|
||||
ULONG pen = ObtainBestPenA(scrn->ViewPort.ColorMap,
|
||||
(colour & 0x000000ff) << 24,
|
||||
(colour & 0x0000ff00) << 16,
|
||||
(colour & 0x00ff0000) << 8,
|
||||
(colr & 0x000000ff) << 24,
|
||||
(colr & 0x0000ff00) << 16,
|
||||
(colr & 0x00ff0000) << 8,
|
||||
NULL);
|
||||
|
||||
if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx", colour));
|
||||
if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx", colr));
|
||||
|
||||
if(shared_pens != NULL) {
|
||||
if(node = (struct ami_plot_pen *)AllocVecTagList(sizeof(struct ami_plot_pen), NULL)) {
|
||||
|
@ -278,26 +228,26 @@ void ami_plot_release_pens(struct MinList *shared_pens)
|
|||
}while(node = nnode);
|
||||
}
|
||||
|
||||
static void ami_plot_setapen(ULONG colour)
|
||||
static void ami_plot_setapen(ULONG colr)
|
||||
{
|
||||
if(palette_mapped == false) {
|
||||
SetRPAttrs(glob->rp, RPTAG_APenColor,
|
||||
ns_color_to_nscss(colour),
|
||||
ns_color_to_nscss(colr),
|
||||
TAG_DONE);
|
||||
} else {
|
||||
ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colour);
|
||||
ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
|
||||
if(pen != -1) SetAPen(glob->rp, pen);
|
||||
}
|
||||
}
|
||||
|
||||
static void ami_plot_setopen(ULONG colour)
|
||||
static void ami_plot_setopen(ULONG colr)
|
||||
{
|
||||
if(palette_mapped == false) {
|
||||
SetRPAttrs(glob->rp, RPTAG_OPenColor,
|
||||
ns_color_to_nscss(colour),
|
||||
ns_color_to_nscss(colr),
|
||||
TAG_DONE);
|
||||
} else {
|
||||
ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colour);
|
||||
ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
|
||||
if(pen != -1) SetOPen(glob->rp, pen);
|
||||
}
|
||||
}
|
||||
|
@ -309,90 +259,41 @@ bool ami_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
|
|||
#endif
|
||||
|
||||
if (style->fill_type != PLOT_OP_TYPE_NONE) {
|
||||
|
||||
if((nsoption_int(cairo_renderer) < 2) ||
|
||||
(palette_mapped == true))
|
||||
{
|
||||
ami_plot_setapen(style->fill_colour);
|
||||
RectFill(glob->rp, x0, y0, x1-1, y1-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
ami_cairo_set_colour(glob->cr, style->fill_colour);
|
||||
ami_cairo_set_solid(glob->cr);
|
||||
|
||||
cairo_set_line_width(glob->cr, 0);
|
||||
cairo_rectangle(glob->cr, x0, y0, x1 - x0, y1 - y0);
|
||||
cairo_fill(glob->cr);
|
||||
cairo_stroke(glob->cr);
|
||||
#endif
|
||||
}
|
||||
ami_plot_setapen(style->fill_colour);
|
||||
RectFill(glob->rp, x0, y0, x1-1, y1-1);
|
||||
}
|
||||
|
||||
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
|
||||
if((nsoption_int(cairo_renderer) < 2) ||
|
||||
(palette_mapped == true))
|
||||
{
|
||||
glob->rp->PenWidth = style->stroke_width;
|
||||
glob->rp->PenHeight = style->stroke_width;
|
||||
glob->rp->PenWidth = style->stroke_width;
|
||||
glob->rp->PenHeight = style->stroke_width;
|
||||
|
||||
switch (style->stroke_type) {
|
||||
case PLOT_OP_TYPE_SOLID: /**< Solid colour */
|
||||
default:
|
||||
glob->rp->LinePtrn = PATT_LINE;
|
||||
break;
|
||||
switch (style->stroke_type) {
|
||||
case PLOT_OP_TYPE_SOLID: /**< Solid colour */
|
||||
default:
|
||||
glob->rp->LinePtrn = PATT_LINE;
|
||||
break;
|
||||
|
||||
case PLOT_OP_TYPE_DOT: /**< Dotted plot */
|
||||
glob->rp->LinePtrn = PATT_DOT;
|
||||
break;
|
||||
case PLOT_OP_TYPE_DOT: /**< Dotted plot */
|
||||
glob->rp->LinePtrn = PATT_DOT;
|
||||
break;
|
||||
|
||||
case PLOT_OP_TYPE_DASH: /**< dashed plot */
|
||||
glob->rp->LinePtrn = PATT_DASH;
|
||||
break;
|
||||
}
|
||||
case PLOT_OP_TYPE_DASH: /**< dashed plot */
|
||||
glob->rp->LinePtrn = PATT_DASH;
|
||||
break;
|
||||
}
|
||||
|
||||
ami_plot_setapen(style->stroke_colour);
|
||||
Move(glob->rp, x0,y0);
|
||||
Draw(glob->rp, x1, y0);
|
||||
Draw(glob->rp, x1, y1);
|
||||
Draw(glob->rp, x0, y1);
|
||||
Draw(glob->rp, x0, y0);
|
||||
ami_plot_setapen(style->stroke_colour);
|
||||
Move(glob->rp, x0,y0);
|
||||
Draw(glob->rp, x1, y0);
|
||||
Draw(glob->rp, x1, y1);
|
||||
Draw(glob->rp, x0, y1);
|
||||
Draw(glob->rp, x0, y0);
|
||||
|
||||
glob->rp->PenWidth = 1;
|
||||
glob->rp->PenHeight = 1;
|
||||
glob->rp->LinePtrn = PATT_LINE;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
ami_cairo_set_colour(glob->cr, style->stroke_colour);
|
||||
|
||||
switch (style->stroke_type) {
|
||||
case PLOT_OP_TYPE_SOLID: /**< Solid colour */
|
||||
default:
|
||||
ami_cairo_set_solid(glob->cr);
|
||||
break;
|
||||
|
||||
case PLOT_OP_TYPE_DOT: /**< Doted plot */
|
||||
ami_cairo_set_dotted(glob->cr);
|
||||
break;
|
||||
|
||||
case PLOT_OP_TYPE_DASH: /**< dashed plot */
|
||||
ami_cairo_set_dashed(glob->cr);
|
||||
break;
|
||||
}
|
||||
|
||||
if (style->stroke_width == 0)
|
||||
cairo_set_line_width(glob->cr, 1);
|
||||
else
|
||||
cairo_set_line_width(glob->cr, style->stroke_width);
|
||||
|
||||
cairo_rectangle(glob->cr, x0, y0, x1 - x0, y1 - y0);
|
||||
cairo_stroke(glob->cr);
|
||||
#endif
|
||||
}
|
||||
glob->rp->PenWidth = 1;
|
||||
glob->rp->PenHeight = 1;
|
||||
glob->rp->LinePtrn = PATT_LINE;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -402,12 +303,10 @@ bool ami_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
|
|||
LOG(("[ami_plotter] Entered ami_line()"));
|
||||
#endif
|
||||
|
||||
if((nsoption_int(cairo_renderer) < 2) || (palette_mapped == true))
|
||||
{
|
||||
glob->rp->PenWidth = style->stroke_width;
|
||||
glob->rp->PenHeight = style->stroke_width;
|
||||
glob->rp->PenWidth = style->stroke_width;
|
||||
glob->rp->PenHeight = style->stroke_width;
|
||||
|
||||
switch (style->stroke_type) {
|
||||
switch (style->stroke_type) {
|
||||
case PLOT_OP_TYPE_SOLID: /**< Solid colour */
|
||||
default:
|
||||
glob->rp->LinePtrn = PATT_LINE;
|
||||
|
@ -420,50 +319,16 @@ bool ami_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
|
|||
case PLOT_OP_TYPE_DASH: /**< dashed plot */
|
||||
glob->rp->LinePtrn = PATT_DASH;
|
||||
break;
|
||||
}
|
||||
|
||||
ami_plot_setapen(style->stroke_colour);
|
||||
Move(glob->rp,x0,y0);
|
||||
Draw(glob->rp,x1,y1);
|
||||
|
||||
glob->rp->PenWidth = 1;
|
||||
glob->rp->PenHeight = 1;
|
||||
glob->rp->LinePtrn = PATT_LINE;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
ami_cairo_set_colour(glob->cr, style->stroke_colour);
|
||||
|
||||
switch (style->stroke_type) {
|
||||
case PLOT_OP_TYPE_SOLID: /**< Solid colour */
|
||||
default:
|
||||
ami_cairo_set_solid(glob->cr);
|
||||
break;
|
||||
ami_plot_setapen(style->stroke_colour);
|
||||
Move(glob->rp,x0,y0);
|
||||
Draw(glob->rp,x1,y1);
|
||||
|
||||
case PLOT_OP_TYPE_DOT: /**< Doted plot */
|
||||
ami_cairo_set_dotted(glob->cr);
|
||||
break;
|
||||
glob->rp->PenWidth = 1;
|
||||
glob->rp->PenHeight = 1;
|
||||
glob->rp->LinePtrn = PATT_LINE;
|
||||
|
||||
case PLOT_OP_TYPE_DASH: /**< dashed plot */
|
||||
ami_cairo_set_dashed(glob->cr);
|
||||
break;
|
||||
}
|
||||
|
||||
if (style->stroke_width == 0)
|
||||
cairo_set_line_width(glob->cr, 1);
|
||||
else
|
||||
cairo_set_line_width(glob->cr, style->stroke_width);
|
||||
|
||||
/* core expects horizontal and vertical lines to be on pixels, not
|
||||
* between pixels */
|
||||
cairo_move_to(glob->cr, (x0 == x1) ? x0 + 0.5 : x0,
|
||||
(y0 == y1) ? y0 + 0.5 : y0);
|
||||
cairo_line_to(glob->cr, (x0 == x1) ? x1 + 0.5 : x1,
|
||||
(y0 == y1) ? y1 + 0.5 : y1);
|
||||
cairo_stroke(glob->cr);
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -473,41 +338,21 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
|
|||
LOG(("[ami_plotter] Entered ami_polygon()"));
|
||||
#endif
|
||||
|
||||
int k;
|
||||
ULONG cx,cy;
|
||||
|
||||
if((nsoption_int(cairo_renderer) < 1) || (palette_mapped == true))
|
||||
{
|
||||
ULONG cx,cy;
|
||||
ami_plot_setapen(style->fill_colour);
|
||||
|
||||
ami_plot_setapen(style->fill_colour);
|
||||
|
||||
if(AreaMove(glob->rp,p[0],p[1]) == -1)
|
||||
LOG(("AreaMove: vector list full"));
|
||||
if(AreaMove(glob->rp,p[0],p[1]) == -1)
|
||||
LOG(("AreaMove: vector list full"));
|
||||
|
||||
for(k=1;k<n;k++)
|
||||
{
|
||||
if(AreaDraw(glob->rp,p[k*2],p[(k*2)+1]) == -1)
|
||||
LOG(("AreaDraw: vector list full"));
|
||||
}
|
||||
|
||||
if(AreaEnd(glob->rp) == -1)
|
||||
LOG(("AreaEnd: error"));
|
||||
for(int k = 1; k < n; k++) {
|
||||
if(AreaDraw(glob->rp,p[k*2],p[(k*2)+1]) == -1)
|
||||
LOG(("AreaDraw: vector list full"));
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
ami_cairo_set_colour(glob->cr, style->fill_colour);
|
||||
ami_cairo_set_solid(glob->cr);
|
||||
|
||||
cairo_set_line_width(glob->cr, 0);
|
||||
cairo_move_to(glob->cr, p[0], p[1]);
|
||||
for (k = 1; k != n; k++) {
|
||||
cairo_line_to(glob->cr, p[k * 2], p[k * 2 + 1]);
|
||||
}
|
||||
cairo_fill(glob->cr);
|
||||
cairo_stroke(glob->cr);
|
||||
#endif
|
||||
}
|
||||
if(AreaEnd(glob->rp) == -1)
|
||||
LOG(("AreaEnd: error"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -536,16 +381,6 @@ bool ami_clip(const struct rect *clip)
|
|||
if(reg) DisposeRegion(reg);
|
||||
}
|
||||
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
if((nsoption_int(cairo_renderer) == 2) && (palette_mapped == false))
|
||||
{
|
||||
cairo_reset_clip(glob->cr);
|
||||
cairo_rectangle(glob->cr, clip->x0, clip->y0,
|
||||
clip->x1 - clip->x0, clip->y1 - clip->y0);
|
||||
cairo_clip(glob->cr);
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -573,43 +408,17 @@ bool ami_disc(int x, int y, int radius, const plot_style_t *style)
|
|||
LOG(("[ami_plotter] Entered ami_disc()"));
|
||||
#endif
|
||||
|
||||
if((nsoption_int(cairo_renderer) < 2) || (palette_mapped == true))
|
||||
{
|
||||
if (style->fill_type != PLOT_OP_TYPE_NONE) {
|
||||
ami_plot_setapen(style->fill_colour);
|
||||
AreaCircle(glob->rp,x,y,radius);
|
||||
AreaEnd(glob->rp);
|
||||
}
|
||||
|
||||
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
|
||||
ami_plot_setapen(style->stroke_colour);
|
||||
DrawEllipse(glob->rp,x,y,radius,radius);
|
||||
}
|
||||
if (style->fill_type != PLOT_OP_TYPE_NONE) {
|
||||
ami_plot_setapen(style->fill_colour);
|
||||
AreaCircle(glob->rp,x,y,radius);
|
||||
AreaEnd(glob->rp);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
if (style->fill_type != PLOT_OP_TYPE_NONE) {
|
||||
ami_cairo_set_colour(glob->cr, style->fill_colour);
|
||||
ami_cairo_set_solid(glob->cr);
|
||||
|
||||
cairo_set_line_width(glob->cr, 0);
|
||||
|
||||
cairo_arc(glob->cr, x, y, radius, 0, M_PI * 2);
|
||||
cairo_fill(glob->cr);
|
||||
cairo_stroke(glob->cr);
|
||||
}
|
||||
|
||||
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
|
||||
ami_cairo_set_colour(glob->cr, style->stroke_colour);
|
||||
ami_cairo_set_solid(glob->cr);
|
||||
|
||||
cairo_set_line_width(glob->cr, 1);
|
||||
cairo_arc(glob->cr, x, y, radius, 0, M_PI * 2);
|
||||
cairo_stroke(glob->cr);
|
||||
}
|
||||
#endif
|
||||
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
|
||||
ami_plot_setapen(style->stroke_colour);
|
||||
DrawEllipse(glob->rp,x,y,radius,radius);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -644,25 +453,10 @@ bool ami_arc(int x, int y, int radius, int angle1, int angle2, const plot_style_
|
|||
LOG(("[ami_plotter] Entered ami_arc()"));
|
||||
#endif
|
||||
|
||||
if((nsoption_int(cairo_renderer) <= 0) || (palette_mapped == true)) {
|
||||
|
||||
if (angle2 < angle1) angle2 += 360;
|
||||
if (angle2 < angle1) angle2 += 360;
|
||||
|
||||
ami_plot_setapen(style->fill_colour);
|
||||
|
||||
ami_arc_gfxlib(x, y, radius, angle1, angle2);
|
||||
} else {
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
ami_cairo_set_colour(glob->cr, style->fill_colour);
|
||||
ami_cairo_set_solid(glob->cr);
|
||||
|
||||
cairo_set_line_width(glob->cr, 1);
|
||||
cairo_arc(glob->cr, x, y, radius,
|
||||
(angle1 + 90) * (M_PI / 180),
|
||||
(angle2 + 90) * (M_PI / 180));
|
||||
cairo_stroke(glob->cr);
|
||||
#endif
|
||||
}
|
||||
ami_plot_setapen(style->fill_colour);
|
||||
ami_arc_gfxlib(x, y, radius, angle1, angle2);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -711,6 +505,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
|
|||
COMPTAG_SrcHeight,height,
|
||||
COMPTAG_OffsetX,x,
|
||||
COMPTAG_OffsetY,y,
|
||||
COMPTAG_FriendBitMap, scrn->RastPort.BitMap,
|
||||
TAG_DONE);
|
||||
#endif
|
||||
}
|
||||
|
@ -873,6 +668,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct Ba
|
|||
COMPTAG_SrcHeight,bfbm->height,
|
||||
COMPTAG_OffsetX,xf,
|
||||
COMPTAG_OffsetY,yf,
|
||||
COMPTAG_FriendBitMap, scrn->RastPort.BitMap,
|
||||
TAG_DONE);
|
||||
#endif
|
||||
}
|
||||
|
@ -943,7 +739,6 @@ bool ami_path(const float *p, unsigned int n, colour fill, float width,
|
|||
colour c, const float transform[6])
|
||||
{
|
||||
unsigned int i;
|
||||
struct bez_point *old_p;
|
||||
struct bez_point start_p, cur_p, p_a, p_b, p_c, p_r;
|
||||
|
||||
#ifdef AMI_PLOTTER_DEBUG
|
||||
|
@ -958,153 +753,83 @@ bool ami_path(const float *p, unsigned int n, colour fill, float width,
|
|||
return false;
|
||||
}
|
||||
|
||||
if((nsoption_int(cairo_renderer) >= 1) && (palette_mapped == false))
|
||||
{
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
cairo_matrix_t old_ctm, n_ctm;
|
||||
|
||||
/* Save CTM */
|
||||
cairo_get_matrix(glob->cr, &old_ctm);
|
||||
|
||||
/* Set up line style and width */
|
||||
cairo_set_line_width(glob->cr, 1);
|
||||
ami_cairo_set_solid(glob->cr);
|
||||
|
||||
/* Load new CTM */
|
||||
n_ctm.xx = transform[0];
|
||||
n_ctm.yx = transform[1];
|
||||
n_ctm.xy = transform[2];
|
||||
n_ctm.yy = transform[3];
|
||||
n_ctm.x0 = transform[4];
|
||||
n_ctm.y0 = transform[5];
|
||||
|
||||
cairo_set_matrix(glob->cr, &n_ctm);
|
||||
|
||||
/* Construct path */
|
||||
for (i = 0; i < n; ) {
|
||||
if (p[i] == PLOTTER_PATH_MOVE) {
|
||||
cairo_move_to(glob->cr, p[i+1], p[i+2]);
|
||||
i += 3;
|
||||
} else if (p[i] == PLOTTER_PATH_CLOSE) {
|
||||
cairo_close_path(glob->cr);
|
||||
i++;
|
||||
} else if (p[i] == PLOTTER_PATH_LINE) {
|
||||
cairo_line_to(glob->cr, p[i+1], p[i+2]);
|
||||
i += 3;
|
||||
} else if (p[i] == PLOTTER_PATH_BEZIER) {
|
||||
cairo_curve_to(glob->cr, p[i+1], p[i+2],
|
||||
p[i+3], p[i+4],
|
||||
p[i+5], p[i+6]);
|
||||
i += 7;
|
||||
} else {
|
||||
LOG(("bad path command %f", p[i]));
|
||||
/* Reset matrix for safety */
|
||||
cairo_set_matrix(glob->cr, &old_ctm);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore original CTM */
|
||||
cairo_set_matrix(glob->cr, &old_ctm);
|
||||
|
||||
/* Now draw path */
|
||||
if (fill != NS_TRANSPARENT) {
|
||||
ami_cairo_set_colour(glob->cr,fill);
|
||||
|
||||
if (c != NS_TRANSPARENT) {
|
||||
/* Fill & Stroke */
|
||||
cairo_fill_preserve(glob->cr);
|
||||
ami_cairo_set_colour(glob->cr,c);
|
||||
cairo_stroke(glob->cr);
|
||||
} else {
|
||||
/* Fill only */
|
||||
cairo_fill(glob->cr);
|
||||
}
|
||||
} else if (c != NS_TRANSPARENT) {
|
||||
/* Stroke only */
|
||||
ami_cairo_set_colour(glob->cr,c);
|
||||
cairo_stroke(glob->cr);
|
||||
}
|
||||
#endif
|
||||
if (fill != NS_TRANSPARENT) {
|
||||
ami_plot_setapen(fill);
|
||||
if (c != NS_TRANSPARENT)
|
||||
ami_plot_setopen(c);
|
||||
} else {
|
||||
if (fill != NS_TRANSPARENT) {
|
||||
ami_plot_setapen(fill);
|
||||
if (c != NS_TRANSPARENT)
|
||||
ami_plot_setopen(c);
|
||||
if (c != NS_TRANSPARENT) {
|
||||
ami_plot_setapen(c);
|
||||
} else {
|
||||
if (c != NS_TRANSPARENT) {
|
||||
ami_plot_setapen(c);
|
||||
} else {
|
||||
return true; /* wholly transparent */
|
||||
}
|
||||
return true; /* wholly transparent */
|
||||
}
|
||||
}
|
||||
|
||||
/* Construct path */
|
||||
for (i = 0; i < n; ) {
|
||||
if (p[i] == PLOTTER_PATH_MOVE) {
|
||||
/* Construct path */
|
||||
for (i = 0; i < n; ) {
|
||||
if (p[i] == PLOTTER_PATH_MOVE) {
|
||||
if (fill != NS_TRANSPARENT) {
|
||||
if(AreaMove(glob->rp, p[i+1], p[i+2]) == -1)
|
||||
LOG(("AreaMove: vector list full"));
|
||||
} else {
|
||||
Move(glob->rp, p[i+1], p[i+2]);
|
||||
}
|
||||
/* Keep track for future Bezier curves/closes etc */
|
||||
start_p.x = p[i+1];
|
||||
start_p.y = p[i+2];
|
||||
cur_p.x = start_p.x;
|
||||
cur_p.y = start_p.y;
|
||||
i += 3;
|
||||
} else if (p[i] == PLOTTER_PATH_CLOSE) {
|
||||
if (fill != NS_TRANSPARENT) {
|
||||
if(AreaEnd(glob->rp) == -1)
|
||||
LOG(("AreaEnd: error"));
|
||||
} else {
|
||||
Draw(glob->rp, start_p.x, start_p.y);
|
||||
}
|
||||
i++;
|
||||
} else if (p[i] == PLOTTER_PATH_LINE) {
|
||||
if (fill != NS_TRANSPARENT) {
|
||||
if(AreaDraw(glob->rp, p[i+1], p[i+2]) == -1)
|
||||
LOG(("AreaDraw: vector list full"));
|
||||
} else {
|
||||
Draw(glob->rp, p[i+1], p[i+2]);
|
||||
}
|
||||
cur_p.x = p[i+1];
|
||||
cur_p.y = p[i+2];
|
||||
i += 3;
|
||||
} else if (p[i] == PLOTTER_PATH_BEZIER) {
|
||||
p_a.x = p[i+1];
|
||||
p_a.y = p[i+2];
|
||||
p_b.x = p[i+3];
|
||||
p_b.y = p[i+4];
|
||||
p_c.x = p[i+5];
|
||||
p_c.y = p[i+6];
|
||||
|
||||
for(double t = 0.0; t <= 1.0; t += 0.1) {
|
||||
ami_bezier(&cur_p, &p_a, &p_b, &p_c, t, &p_r);
|
||||
if (fill != NS_TRANSPARENT) {
|
||||
if(AreaMove(glob->rp, p[i+1], p[i+2]) == -1)
|
||||
LOG(("AreaMove: vector list full"));
|
||||
} else {
|
||||
Move(glob->rp, p[i+1], p[i+2]);
|
||||
}
|
||||
/* Keep track for future Bezier curves/closes etc */
|
||||
start_p.x = p[i+1];
|
||||
start_p.y = p[i+2];
|
||||
cur_p.x = start_p.x;
|
||||
cur_p.y = start_p.y;
|
||||
i += 3;
|
||||
} else if (p[i] == PLOTTER_PATH_CLOSE) {
|
||||
if (fill != NS_TRANSPARENT) {
|
||||
if(AreaEnd(glob->rp) == -1)
|
||||
LOG(("AreaEnd: error"));
|
||||
} else {
|
||||
Draw(glob->rp, start_p.x, start_p.y);
|
||||
}
|
||||
i++;
|
||||
} else if (p[i] == PLOTTER_PATH_LINE) {
|
||||
if (fill != NS_TRANSPARENT) {
|
||||
if(AreaDraw(glob->rp, p[i+1], p[i+2]) == -1)
|
||||
if(AreaDraw(glob->rp, p_r.x, p_r.y) == -1)
|
||||
LOG(("AreaDraw: vector list full"));
|
||||
} else {
|
||||
Draw(glob->rp, p[i+1], p[i+2]);
|
||||
Draw(glob->rp, p_r.x, p_r.y);
|
||||
}
|
||||
cur_p.x = p[i+1];
|
||||
cur_p.y = p[i+2];
|
||||
i += 3;
|
||||
} else if (p[i] == PLOTTER_PATH_BEZIER) {
|
||||
p_a.x = p[i+1];
|
||||
p_a.y = p[i+2];
|
||||
p_b.x = p[i+3];
|
||||
p_b.y = p[i+4];
|
||||
p_c.x = p[i+5];
|
||||
p_c.y = p[i+6];
|
||||
|
||||
for(double t = 0.0; t <= 1.0; t += 0.1) {
|
||||
ami_bezier(&cur_p, &p_a, &p_b, &p_c, t, &p_r);
|
||||
if (fill != NS_TRANSPARENT) {
|
||||
if(AreaDraw(glob->rp, p_r.x, p_r.y) == -1)
|
||||
LOG(("AreaDraw: vector list full"));
|
||||
} else {
|
||||
Draw(glob->rp, p_r.x, p_r.y);
|
||||
}
|
||||
}
|
||||
cur_p.x = p_c.x;
|
||||
cur_p.y = p_c.y;
|
||||
i += 7;
|
||||
} else {
|
||||
LOG(("bad path command %f", p[i]));
|
||||
/* End path for safety if using Area commands */
|
||||
if (fill != NS_TRANSPARENT) {
|
||||
AreaEnd(glob->rp);
|
||||
BNDRYOFF(glob->rp);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
cur_p.x = p_c.x;
|
||||
cur_p.y = p_c.y;
|
||||
i += 7;
|
||||
} else {
|
||||
LOG(("bad path command %f", p[i]));
|
||||
/* End path for safety if using Area commands */
|
||||
if (fill != NS_TRANSPARENT) {
|
||||
AreaEnd(glob->rp);
|
||||
BNDRYOFF(glob->rp);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (fill != NS_TRANSPARENT)
|
||||
BNDRYOFF(glob->rp);
|
||||
}
|
||||
if (fill != NS_TRANSPARENT)
|
||||
BNDRYOFF(glob->rp);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1113,3 +838,4 @@ bool ami_plot_screen_is_palettemapped(void)
|
|||
{
|
||||
return palette_mapped;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,9 +21,6 @@
|
|||
#include "desktop/plotters.h"
|
||||
#include <proto/layers.h>
|
||||
#include <proto/graphics.h>
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
#include <cairo/cairo.h>
|
||||
#endif
|
||||
|
||||
struct gui_globals
|
||||
{
|
||||
|
@ -34,10 +31,6 @@ struct gui_globals
|
|||
APTR tmprasbuf;
|
||||
struct Rectangle rect;
|
||||
struct MinList *shared_pens;
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cr;
|
||||
#endif
|
||||
};
|
||||
|
||||
extern const struct plotter_table amiplot;
|
||||
|
|
|
@ -132,7 +132,7 @@ void amiga_plugin_hack_destroy(struct content *c)
|
|||
{
|
||||
amiga_plugin_hack_content *plugin = (amiga_plugin_hack_content *) c;
|
||||
|
||||
LOG(("amiga_plugin_hack_destroy"));
|
||||
LOG(("amiga_plugin_hack_destroy %p", plugin));
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
#include "utils/config.h"
|
||||
#include "utils/errors.h"
|
||||
|
||||
struct hlcache_handle;
|
||||
|
||||
nserror amiga_plugin_hack_init(void);
|
||||
|
||||
void amiga_plugin_hack_execute(struct hlcache_handle *c);
|
||||
|
|
|
@ -375,10 +375,11 @@ BOOL ami_print_event(struct ami_print_window *pw)
|
|||
|
||||
void ami_print(struct hlcache_handle *c, int copies)
|
||||
{
|
||||
double height, print_height;
|
||||
double height;
|
||||
float scale = nsoption_int(print_scale) / 100.0;
|
||||
|
||||
if(!ami_print_info.msgport) return;
|
||||
if(ami_print_info.msgport == NULL)
|
||||
ami_print_init();
|
||||
|
||||
if(!(ami_print_info.PReq =
|
||||
(struct IODRPTagsReq *)AllocSysObjectTags(ASOT_IOREQUEST,
|
||||
|
@ -450,7 +451,8 @@ struct MsgPort *ami_print_init(void)
|
|||
|
||||
void ami_print_free(void)
|
||||
{
|
||||
FreeSysObject(ASOT_PORT,ami_print_info.msgport);
|
||||
FreeSysObject(ASOT_PORT, ami_print_info.msgport);
|
||||
ami_print_info.msgport = NULL;
|
||||
}
|
||||
|
||||
struct MsgPort *ami_print_get_msgport(void)
|
||||
|
@ -491,6 +493,7 @@ void ami_print_end(void)
|
|||
glob = &browserglob;
|
||||
|
||||
ami_print_close_device();
|
||||
ami_print_free();
|
||||
}
|
||||
|
||||
void ami_print_close_device(void)
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
# Resource.map
|
||||
favicon.ico:favicon.png
|
||||
default.ico:icons/search.png
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Resource.map
|
||||
favicon.ico:TBimages:list_file
|
||||
default.ico:TBimages:list_search
|
||||
icons/arrow-l.png:TBimages:list_mailreplied
|
||||
icons/search.png:TBimages:list_search
|
||||
icons/directory.png:TBimages:list_drawer
|
||||
|
|
228
amiga/schedule.c
228
amiga/schedule.c
|
@ -16,9 +16,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "utils/schedule.h"
|
||||
#include "amiga/os3support.h"
|
||||
#include "amiga/schedule.h"
|
||||
|
||||
#include <proto/exec.h>
|
||||
#include <proto/timer.h>
|
||||
|
@ -27,6 +25,10 @@
|
|||
#include <stdbool.h>
|
||||
#include <pbl.h>
|
||||
|
||||
#include "utils/errors.h"
|
||||
|
||||
#include "amiga/schedule.h"
|
||||
|
||||
struct nscallback
|
||||
{
|
||||
struct TimeVal tv;
|
||||
|
@ -37,31 +39,41 @@ struct nscallback
|
|||
|
||||
PblHeap *schedule_list;
|
||||
|
||||
void ami_remove_timer_event(struct nscallback *nscb);
|
||||
|
||||
/**
|
||||
* Schedule a callback.
|
||||
* Remove timer event
|
||||
*
|
||||
* \param t interval before the callback should be made / cs
|
||||
* \param callback callback function
|
||||
* \param p user parameter, passed to callback function
|
||||
* \param nscb callback
|
||||
*
|
||||
* The callback function will be called as soon as possible after t cs have
|
||||
* passed.
|
||||
* The timer event for the callback is aborted
|
||||
*/
|
||||
|
||||
void schedule(int t, void (*callback)(void *p), void *p)
|
||||
static void ami_schedule_remove_timer_event(struct nscallback *nscb)
|
||||
{
|
||||
struct nscallback *nscb;
|
||||
struct TimeVal tv;
|
||||
ULONG time_us = 0;
|
||||
|
||||
if(schedule_list == NULL) return;
|
||||
|
||||
nscb = AllocVecTagList(sizeof(struct nscallback), NULL);
|
||||
if(!nscb) return;
|
||||
|
||||
time_us = t*10000; /* t converted to µs */
|
||||
if(nscb->treq)
|
||||
{
|
||||
if(CheckIO((struct IORequest *)nscb->treq)==NULL)
|
||||
AbortIO((struct IORequest *)nscb->treq);
|
||||
|
||||
WaitIO((struct IORequest *)nscb->treq);
|
||||
FreeVec(nscb->treq);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add timer event
|
||||
*
|
||||
* \param nscb callback
|
||||
* \param t time in ms
|
||||
*
|
||||
* NetSurf will be signalled in t ms for this event.
|
||||
*/
|
||||
|
||||
static nserror ami_schedule_add_timer_event(struct nscallback *nscb, int t)
|
||||
{
|
||||
struct TimeVal tv;
|
||||
ULONG time_us = t * 1000; /* t converted to µs */
|
||||
|
||||
nscb->tv.Seconds = time_us / 1000000;
|
||||
nscb->tv.Microseconds = time_us % 1000000;
|
||||
|
@ -69,19 +81,72 @@ void schedule(int t, void (*callback)(void *p), void *p)
|
|||
GetSysTime(&tv);
|
||||
AddTime(&nscb->tv,&tv); // now contains time when event occurs
|
||||
|
||||
if(nscb->treq = AllocVecTagList(sizeof(struct TimeRequest), NULL))
|
||||
{
|
||||
if(nscb->treq = AllocVecTagList(sizeof(struct TimeRequest), NULL)) {
|
||||
*nscb->treq = *tioreq;
|
||||
nscb->treq->Request.io_Command=TR_ADDREQUEST;
|
||||
nscb->treq->Time.Seconds=nscb->tv.Seconds; // secs
|
||||
nscb->treq->Time.Microseconds=nscb->tv.Microseconds; // micro
|
||||
SendIO((struct IORequest *)nscb->treq);
|
||||
nscb->treq->Request.io_Command=TR_ADDREQUEST;
|
||||
nscb->treq->Time.Seconds=nscb->tv.Seconds; // secs
|
||||
nscb->treq->Time.Microseconds=nscb->tv.Microseconds; // micro
|
||||
SendIO((struct IORequest *)nscb->treq);
|
||||
} else {
|
||||
return NSERROR_NOMEM;
|
||||
}
|
||||
|
||||
nscb->callback = callback;
|
||||
nscb->p = p;
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
pblHeapInsert(schedule_list, nscb);
|
||||
/**
|
||||
* Locate a scheduled callback
|
||||
*
|
||||
* \param callback callback function
|
||||
* \param p user parameter, passed to callback function
|
||||
* \param remove remove callback from the heap
|
||||
*
|
||||
* A scheduled callback matching both callback and p is returned, or NULL if none present.
|
||||
*/
|
||||
|
||||
static struct nscallback *ami_schedule_locate(void (*callback)(void *p), void *p, bool remove)
|
||||
{
|
||||
PblIterator *iterator;
|
||||
struct nscallback *nscb;
|
||||
bool found_cb = false;
|
||||
|
||||
/* check there is something on the list */
|
||||
if (schedule_list == NULL) return NULL;
|
||||
if(pblHeapIsEmpty(schedule_list)) return NULL;
|
||||
|
||||
iterator = pblHeapIterator(schedule_list);
|
||||
|
||||
while ((nscb = pblIteratorNext(iterator)) != -1) {
|
||||
if ((nscb->callback == callback) && (nscb->p == p)) {
|
||||
if (remove == true) pblIteratorRemove(iterator);
|
||||
found_cb = true;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
pblIteratorFree(iterator);
|
||||
|
||||
if (found_cb == true) return nscb;
|
||||
else return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reschedule a callback.
|
||||
*
|
||||
* \param nscb callback
|
||||
* \param t time in ms
|
||||
*
|
||||
* The nscallback will be rescheduled for t ms.
|
||||
*/
|
||||
|
||||
static nserror ami_schedule_reschedule(struct nscallback *nscb, int t)
|
||||
{
|
||||
ami_schedule_remove_timer_event(nscb);
|
||||
if (ami_schedule_add_timer_event(nscb, t) != NSERROR_OK)
|
||||
return NSERROR_NOMEM;
|
||||
|
||||
pblHeapConstruct(schedule_list);
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -93,34 +158,23 @@ void schedule(int t, void (*callback)(void *p), void *p)
|
|||
* All scheduled callbacks matching both callback and p are removed.
|
||||
*/
|
||||
|
||||
void schedule_remove(void (*callback)(void *p), void *p)
|
||||
static nserror schedule_remove(void (*callback)(void *p), void *p)
|
||||
{
|
||||
PblIterator *iterator;
|
||||
struct nscallback *nscb;
|
||||
bool restoreheap = false;
|
||||
|
||||
if(schedule_list == NULL) return;
|
||||
if(pblHeapIsEmpty(schedule_list)) return;
|
||||
nscb = ami_schedule_locate(callback, p, true);
|
||||
|
||||
iterator = pblHeapIterator(schedule_list);
|
||||
if(nscb != NULL) {
|
||||
ami_schedule_remove_timer_event(nscb);
|
||||
FreeVec(nscb);
|
||||
pblHeapConstruct(schedule_list);
|
||||
}
|
||||
|
||||
while ((nscb = pblIteratorNext(iterator)) != -1)
|
||||
{
|
||||
if((nscb->callback == callback) && (nscb->p == p))
|
||||
{
|
||||
ami_remove_timer_event(nscb);
|
||||
pblIteratorRemove(iterator);
|
||||
FreeVec(nscb);
|
||||
restoreheap = true;
|
||||
}
|
||||
};
|
||||
|
||||
pblIteratorFree(iterator);
|
||||
|
||||
if(restoreheap) pblHeapConstruct(schedule_list);
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
void schedule_remove_all(void)
|
||||
static void schedule_remove_all(void)
|
||||
{
|
||||
PblIterator *iterator;
|
||||
struct nscallback *nscb;
|
||||
|
@ -131,7 +185,7 @@ void schedule_remove_all(void)
|
|||
|
||||
while ((nscb = pblIteratorNext(iterator)) != -1)
|
||||
{
|
||||
ami_remove_timer_event(nscb);
|
||||
ami_schedule_remove_timer_event(nscb);
|
||||
pblIteratorRemove(iterator);
|
||||
FreeVec(nscb);
|
||||
};
|
||||
|
@ -139,13 +193,16 @@ void schedule_remove_all(void)
|
|||
pblIteratorFree(iterator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process events up to current time.
|
||||
* This implementation only takes the top entry off the heap, it does not
|
||||
* venture to later scheduled events until the next time it is called -
|
||||
* immediately afterwards, if we're in a timer signalled loop.
|
||||
*/
|
||||
static int ami_schedule_compare(const void *prev, const void *next)
|
||||
{
|
||||
struct nscallback *nscb1 = *(struct nscallback **)prev;
|
||||
struct nscallback *nscb2 = *(struct nscallback **)next;
|
||||
|
||||
return CmpTime(&nscb1->tv, &nscb2->tv);
|
||||
}
|
||||
|
||||
|
||||
/* exported function documented in amiga/schedule.h */
|
||||
void schedule_run(BOOL poll)
|
||||
{
|
||||
struct nscallback *nscb;
|
||||
|
@ -170,34 +227,13 @@ void schedule_run(BOOL poll)
|
|||
|
||||
callback = nscb->callback;
|
||||
p = nscb->p;
|
||||
ami_remove_timer_event(nscb);
|
||||
ami_schedule_remove_timer_event(nscb);
|
||||
pblHeapRemoveFirst(schedule_list);
|
||||
FreeVec(nscb);
|
||||
callback(p);
|
||||
}
|
||||
|
||||
void ami_remove_timer_event(struct nscallback *nscb)
|
||||
{
|
||||
if(!nscb) return;
|
||||
|
||||
if(nscb->treq)
|
||||
{
|
||||
if(CheckIO((struct IORequest *)nscb->treq)==NULL)
|
||||
AbortIO((struct IORequest *)nscb->treq);
|
||||
|
||||
WaitIO((struct IORequest *)nscb->treq);
|
||||
FreeVec(nscb->treq);
|
||||
}
|
||||
}
|
||||
|
||||
int ami_schedule_compare(const void *prev, const void *next)
|
||||
{
|
||||
struct nscallback *nscb1 = *(struct nscallback **)prev;
|
||||
struct nscallback *nscb2 = *(struct nscallback **)next;
|
||||
|
||||
return CmpTime(&nscb1->tv, &nscb2->tv);
|
||||
}
|
||||
|
||||
/* exported function documented in amiga/schedule.h */
|
||||
BOOL ami_schedule_create(void)
|
||||
{
|
||||
schedule_list = pblHeapNew();
|
||||
|
@ -206,6 +242,7 @@ BOOL ami_schedule_create(void)
|
|||
pblHeapSetCompareFunction(schedule_list, ami_schedule_compare);
|
||||
}
|
||||
|
||||
/* exported function documented in amiga/schedule.h */
|
||||
void ami_schedule_free(void)
|
||||
{
|
||||
schedule_remove_all();
|
||||
|
@ -213,6 +250,7 @@ void ami_schedule_free(void)
|
|||
schedule_list = NULL;
|
||||
}
|
||||
|
||||
/* exported function documented in amiga/schedule.h */
|
||||
void ami_schedule_open_timer(void)
|
||||
{
|
||||
msgport = AllocSysObjectTags(ASOT_PORT,
|
||||
|
@ -231,14 +269,38 @@ void ami_schedule_open_timer(void)
|
|||
ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase,"main",1,NULL);
|
||||
}
|
||||
|
||||
/* exported function documented in amiga/schedule.h */
|
||||
void ami_schedule_close_timer(void)
|
||||
{
|
||||
if(ITimer)
|
||||
{
|
||||
DropInterface((struct Interface *)ITimer);
|
||||
}
|
||||
|
||||
if(ITimer) DropInterface((struct Interface *)ITimer);
|
||||
CloseDevice((struct IORequest *) tioreq);
|
||||
FreeSysObject(ASOT_IOREQUEST,tioreq);
|
||||
FreeSysObject(ASOT_PORT,msgport);
|
||||
}
|
||||
|
||||
/* exported function documented in amiga/schedule.h */
|
||||
nserror ami_schedule(int t, void (*callback)(void *p), void *p)
|
||||
{
|
||||
struct nscallback *nscb;
|
||||
|
||||
if(schedule_list == NULL) return NSERROR_INIT_FAILED;
|
||||
if (t < 0) return schedule_remove(callback, p);
|
||||
|
||||
if (nscb = ami_schedule_locate(callback, p, false)) {
|
||||
return ami_schedule_reschedule(nscb, t);
|
||||
}
|
||||
|
||||
nscb = AllocVecTagList(sizeof(struct nscallback), NULL);
|
||||
if(!nscb) return NSERROR_NOMEM;
|
||||
|
||||
if (ami_schedule_add_timer_event(nscb, t) != NSERROR_OK)
|
||||
return NSERROR_NOMEM;
|
||||
|
||||
nscb->callback = callback;
|
||||
nscb->p = p;
|
||||
|
||||
pblHeapInsert(schedule_list, nscb);
|
||||
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#ifndef AMIGA_SCHEDULE_H
|
||||
#define AMIGA_SCHEDULE_H
|
||||
#include <proto/timer.h>
|
||||
#include "utils/schedule.h"
|
||||
#include "amiga/os3support.h"
|
||||
|
||||
struct Device *TimerBase;
|
||||
|
@ -28,9 +27,42 @@ struct TimerIFace *ITimer;
|
|||
struct TimeRequest *tioreq;
|
||||
struct MsgPort *msgport;
|
||||
|
||||
/**
|
||||
* Schedule a callback.
|
||||
*
|
||||
* \param t interval before the callback should be made / ms
|
||||
* \param callback callback function
|
||||
* \param p user parameter, passed to callback function
|
||||
* \return NSERROR_OK on sucess or appropriate error on faliure
|
||||
*
|
||||
* The callback function will be called as soon as possible after t ms have
|
||||
* passed.
|
||||
*/
|
||||
nserror ami_schedule(int t, void (*callback)(void *p), void *p);
|
||||
|
||||
/**
|
||||
* Initialise amiga scheduler
|
||||
*
|
||||
* /return true if initialised ok or false on error.
|
||||
*/
|
||||
BOOL ami_schedule_create(void);
|
||||
|
||||
/**
|
||||
* Finalise amiga scheduler
|
||||
*
|
||||
*/
|
||||
void ami_schedule_free(void);
|
||||
|
||||
/**
|
||||
* Process events up to current time.
|
||||
*
|
||||
* This implementation only takes the top entry off the heap, it does not
|
||||
* venture to later scheduled events until the next time it is called -
|
||||
* immediately afterwards, if we're in a timer signalled loop.
|
||||
*/
|
||||
void schedule_run(BOOL poll);
|
||||
|
||||
void ami_schedule_open_timer(void);
|
||||
void ami_schedule_close_timer(void);
|
||||
BOOL ami_schedule_create(void);
|
||||
void ami_schedule_free(void);
|
||||
void schedule_run(BOOL poll);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -69,14 +69,15 @@ static void ami_search_add_recent(const char *string, void *p);
|
|||
static void ami_search_set_forward_state(bool active, void *p);
|
||||
static void ami_search_set_back_state(bool active, void *p);
|
||||
|
||||
static struct gui_search_callbacks ami_search_callbacks = {
|
||||
ami_search_set_forward_state,
|
||||
ami_search_set_back_state,
|
||||
static struct gui_search_table search_table = {
|
||||
ami_search_set_status,
|
||||
ami_search_set_hourglass,
|
||||
ami_search_add_recent
|
||||
ami_search_add_recent,
|
||||
ami_search_set_forward_state,
|
||||
ami_search_set_back_state,
|
||||
};
|
||||
|
||||
struct gui_search_table *amiga_search_table = &search_table;
|
||||
|
||||
/**
|
||||
* Change the displayed search status.
|
||||
|
@ -90,8 +91,6 @@ void ami_search_open(struct gui_window *gwin)
|
|||
if(fwin)
|
||||
{
|
||||
browser_window_search_clear(fwin->gwin->shared->bw);
|
||||
ami_search_set_forward_state(true, NULL);
|
||||
ami_search_set_back_state(true, NULL);
|
||||
fwin->gwin->shared->searchwin = NULL;
|
||||
fwin->gwin = gwin;
|
||||
gwin->shared->searchwin = fwin;
|
||||
|
@ -177,8 +176,6 @@ void ami_search_open(struct gui_window *gwin)
|
|||
void ami_search_close(void)
|
||||
{
|
||||
browser_window_search_clear(fwin->gwin->shared->bw);
|
||||
ami_search_set_forward_state(true, NULL);
|
||||
ami_search_set_back_state(true, NULL);
|
||||
fwin->gwin->shared->searchwin = NULL;
|
||||
DisposeObject(fwin->objects[OID_MAIN]);
|
||||
DelObject(fwin->node);
|
||||
|
@ -201,12 +198,7 @@ BOOL ami_search_event(void)
|
|||
switch(result & WMHI_GADGETMASK)
|
||||
{
|
||||
case GID_SEARCHSTRING:
|
||||
browser_window_search_clear(
|
||||
fwin->gwin->shared->bw);
|
||||
ami_search_set_forward_state(
|
||||
true, NULL);
|
||||
ami_search_set_back_state(
|
||||
true, NULL);
|
||||
browser_window_search_clear(fwin->gwin->shared->bw);
|
||||
|
||||
RefreshSetGadgetAttrs((struct Gadget *)fwin->objects[GID_PREV],
|
||||
fwin->win, NULL,
|
||||
|
@ -226,7 +218,7 @@ BOOL ami_search_event(void)
|
|||
ami_search_flags();
|
||||
browser_window_search(
|
||||
fwin->gwin->shared->bw,
|
||||
&ami_search_callbacks, NULL,
|
||||
NULL,
|
||||
flags, ami_search_string());
|
||||
ActivateWindow(fwin->gwin->shared->win);
|
||||
break;
|
||||
|
@ -237,7 +229,7 @@ BOOL ami_search_event(void)
|
|||
ami_search_flags();
|
||||
browser_window_search(
|
||||
fwin->gwin->shared->bw,
|
||||
&ami_search_callbacks, NULL,
|
||||
NULL,
|
||||
flags, ami_search_string());
|
||||
ActivateWindow(fwin->gwin->shared->win);
|
||||
break;
|
||||
|
|
|
@ -28,10 +28,10 @@ struct find_window {
|
|||
struct gui_window *gwin;
|
||||
};
|
||||
|
||||
struct gui_search_table *amiga_search_table;
|
||||
|
||||
void ami_search_open(struct gui_window *gwin);
|
||||
BOOL ami_search_event(void);
|
||||
void ami_search_close(void);
|
||||
|
||||
char *search_engines_file_location;
|
||||
char *search_default_ico_location;
|
||||
#endif
|
||||
|
|
|
@ -19,5 +19,10 @@
|
|||
#ifndef AMIGA_SSLCERT_H
|
||||
#define AMIGA_SSLCERT_H
|
||||
|
||||
void gui_cert_verify(nsurl *url,
|
||||
const struct ssl_cert_info *certs, unsigned long num,
|
||||
nserror (*cb)(bool proceed, void *pw), void *cbpw);
|
||||
|
||||
void ami_ssl_free(struct treeview_window *twin);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -859,7 +859,6 @@ Class *MakeStringClass( void )
|
|||
|
||||
void FreeStringClass(Class *cl)
|
||||
{
|
||||
struct Library *libbase;
|
||||
URLHistory_Free();
|
||||
FreeClass(cl);
|
||||
}
|
||||
|
|
117
amiga/theme.c
117
amiga/theme.c
|
@ -36,11 +36,12 @@
|
|||
|
||||
#include "amiga/bitmap.h"
|
||||
#include "amiga/drag.h"
|
||||
#include "desktop/browser_private.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "amiga/schedule.h"
|
||||
#include "amiga/theme.h"
|
||||
#include "desktop/browser_private.h"
|
||||
#include "desktop/searchweb.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
struct BitMap *throbber = NULL;
|
||||
|
@ -123,7 +124,6 @@ int osmouseptr[AMI_LASTPOINTER+1] = {
|
|||
void ami_theme_init(void)
|
||||
{
|
||||
char themefile[1024];
|
||||
char searchico[1024];
|
||||
BPTR lock = 0;
|
||||
|
||||
strcpy(themefile,nsoption_charp(theme));
|
||||
|
@ -148,21 +148,17 @@ void ami_theme_init(void)
|
|||
UnLock(lock);
|
||||
messages_load(themefile);
|
||||
}
|
||||
|
||||
ami_get_theme_filename(searchico, "theme_search", false);
|
||||
search_default_ico_location = (char *)strdup(searchico);
|
||||
}
|
||||
|
||||
void ami_theme_throbber_setup(void)
|
||||
{
|
||||
char throbberfile[1024];
|
||||
Object *dto;
|
||||
struct bitmap *bm;
|
||||
|
||||
ami_get_theme_filename(throbberfile,"theme_throbber",false);
|
||||
throbber_frames=atoi(messages_get("theme_throbber_frames"));
|
||||
throbber_update_interval = atoi(messages_get("theme_throbber_delay"));
|
||||
if(throbber_update_interval == 0) throbber_update_interval = 100;
|
||||
if(throbber_update_interval == 0) throbber_update_interval = 250;
|
||||
|
||||
bm = ami_bitmap_from_datatype(throbberfile);
|
||||
throbber = ami_bitmap_get_native(bm, bm->width, bm->height, NULL);
|
||||
|
@ -275,11 +271,6 @@ void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
|
|||
}
|
||||
}
|
||||
|
||||
void gui_window_hide_pointer(struct gui_window *g)
|
||||
{
|
||||
ami_set_pointer(g->shared, AMI_GUI_POINTER_BLANK, true);
|
||||
}
|
||||
|
||||
void ami_init_mouse_pointers(void)
|
||||
{
|
||||
if(LIB_IS_AT_LEAST((struct Library *)IntuitionBase, 53, 42)) return;
|
||||
|
@ -294,7 +285,7 @@ void ami_init_mouse_pointers(void)
|
|||
|
||||
for(i=0;i<=AMI_LASTPOINTER;i++)
|
||||
{
|
||||
BPTR ptrfile = 0;
|
||||
BPTR ptrfile;
|
||||
mouseptrbm[i] = NULL;
|
||||
mouseptrobj[i] = NULL;
|
||||
char ptrfname[1024];
|
||||
|
@ -433,16 +424,8 @@ void gui_window_start_throbber(struct gui_window *g)
|
|||
}
|
||||
|
||||
g->throbbing = true;
|
||||
|
||||
if((cur_tab == g->tab) || (g->shared->tabs <= 1))
|
||||
{
|
||||
GetAttr(SPACE_AreaBox, g->shared->objects[GID_THROBBER],
|
||||
(ULONG *)&bbox);
|
||||
|
||||
if(g->shared->throbber_frame == 0) g->shared->throbber_frame=1;
|
||||
|
||||
BltBitMapRastPort(throbber,throbber_width,0,g->shared->win->RPort,bbox->Left,bbox->Top,throbber_width,throbber_height,0x0C0);
|
||||
}
|
||||
if(g->shared->throbber_frame == 0) g->shared->throbber_frame = 1;
|
||||
ami_throbber_redraw_schedule(throbber_update_interval, g);
|
||||
}
|
||||
|
||||
void gui_window_stop_throbber(struct gui_window *g)
|
||||
|
@ -462,8 +445,6 @@ void gui_window_stop_throbber(struct gui_window *g)
|
|||
g->shared->win, NULL);
|
||||
}
|
||||
|
||||
g->throbbing = false;
|
||||
|
||||
if((cur_tab == g->tab) || (g->shared->tabs <= 1))
|
||||
{
|
||||
GetAttr(SPACE_AreaBox, g->shared->objects[GID_THROBBER],
|
||||
|
@ -472,58 +453,58 @@ void gui_window_stop_throbber(struct gui_window *g)
|
|||
BltBitMapRastPort(throbber, 0, 0, g->shared->win->RPort, bbox->Left,
|
||||
bbox->Top, throbber_width, throbber_height, 0x0C0);
|
||||
}
|
||||
// g->shared->throbber_frame = 0;
|
||||
|
||||
g->throbbing = false;
|
||||
ami_throbber_redraw_schedule(-1, g);
|
||||
}
|
||||
|
||||
void ami_update_throbber(struct gui_window_2 *g,bool redraw)
|
||||
static void ami_throbber_update(void *p)
|
||||
{
|
||||
struct gui_window *g = (struct gui_window *)p;
|
||||
struct IBox *bbox;
|
||||
int frame = g->throbber_frame;
|
||||
int frame = 0;
|
||||
ULONG cur_tab = 0;
|
||||
|
||||
if(!g) return;
|
||||
if(!g->objects[GID_THROBBER]) return;
|
||||
if(!g->shared->objects[GID_THROBBER]) return;
|
||||
|
||||
if(g->bw->window->throbbing == false)
|
||||
{
|
||||
frame = 0;
|
||||
g->throbber_frame=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!redraw)
|
||||
{
|
||||
if(g->throbber_update_count < throbber_update_interval)
|
||||
{
|
||||
g->throbber_update_count++;
|
||||
return;
|
||||
}
|
||||
|
||||
g->throbber_update_count = 0;
|
||||
|
||||
g->throbber_frame++;
|
||||
if(g->throbber_frame > (throbber_frames-1))
|
||||
g->throbber_frame=1;
|
||||
|
||||
}
|
||||
if(g->throbbing == true) {
|
||||
frame = g->shared->throbber_frame;
|
||||
g->shared->throbber_frame++;
|
||||
if(g->shared->throbber_frame > (throbber_frames-1))
|
||||
g->shared->throbber_frame=1;
|
||||
}
|
||||
|
||||
GetAttr(SPACE_AreaBox,(Object *)g->objects[GID_THROBBER],(ULONG *)&bbox);
|
||||
if(g->tab_node && (g->shared->tabs > 1))
|
||||
{
|
||||
GetAttr(CLICKTAB_Current, g->shared->objects[GID_TABS],
|
||||
(ULONG *)&cur_tab);
|
||||
}
|
||||
|
||||
/*
|
||||
EraseRect(g->win->RPort,bbox->Left,bbox->Top,
|
||||
bbox->Left+throbber_width,bbox->Top+throbber_height);
|
||||
*/
|
||||
if((cur_tab == g->tab) || (g->shared->tabs <= 1))
|
||||
{
|
||||
GetAttr(SPACE_AreaBox, g->shared->objects[GID_THROBBER],
|
||||
(ULONG *)&bbox);
|
||||
|
||||
BltBitMapTags(BLITA_SrcX, throbber_width * frame,
|
||||
BLITA_SrcY,0,
|
||||
BLITA_DestX,bbox->Left,
|
||||
BLITA_DestY,bbox->Top,
|
||||
BLITA_Width,throbber_width,
|
||||
BLITA_Height,throbber_height,
|
||||
BLITA_Source,throbber,
|
||||
BLITA_Dest,g->win->RPort,
|
||||
BLITA_SrcType,BLITT_BITMAP,
|
||||
BLITA_DestType,BLITT_RASTPORT,
|
||||
// BLITA_UseSrcAlpha,TRUE,
|
||||
BltBitMapTags(BLITA_SrcX, throbber_width * frame,
|
||||
BLITA_SrcY, 0,
|
||||
BLITA_DestX, bbox->Left,
|
||||
BLITA_DestY, bbox->Top,
|
||||
BLITA_Width, throbber_width,
|
||||
BLITA_Height, throbber_height,
|
||||
BLITA_Source, throbber,
|
||||
BLITA_Dest, g->shared->win->RPort,
|
||||
BLITA_SrcType, BLITT_BITMAP,
|
||||
BLITA_DestType, BLITT_RASTPORT,
|
||||
// BLITA_UseSrcAlpha, TRUE,
|
||||
TAG_DONE);
|
||||
}
|
||||
|
||||
if(frame > 0) ami_throbber_redraw_schedule(throbber_update_interval, g);
|
||||
}
|
||||
|
||||
void ami_throbber_redraw_schedule(int t, struct gui_window *g)
|
||||
{
|
||||
ami_schedule(t, ami_throbber_update, g);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,4 +41,11 @@ void ami_reset_pointer(struct gui_window_2 *gwin);
|
|||
* and ALWAYS in preference to SetWindowPointer(), as it features more pointers and uses
|
||||
* the correct ones specified in user preferences. */
|
||||
void ami_update_pointer(struct Window *win, gui_pointer_shape shape);
|
||||
|
||||
void gui_window_start_throbber(struct gui_window *g);
|
||||
void gui_window_stop_throbber(struct gui_window *g);
|
||||
void ami_throbber_redraw_schedule(int t, struct gui_window *g);
|
||||
|
||||
void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap,
|
|||
if(GfxBase->LibNode.lib_Version >= 53) // AutoDoc says v52, but this function isn't in OS4.0, so checking for v53 (OS4.1)
|
||||
{
|
||||
float resample_scale = bitmap->width / (float)plot_width;
|
||||
uint32 flags = COMPFLAG_IgnoreDestAlpha | COMPFLAG_SrcAlphaOverride;
|
||||
uint32 flags = COMPFLAG_IgnoreDestAlpha;
|
||||
if(nsoption_bool(scale_quality)) flags |= COMPFLAG_SrcFilter;
|
||||
|
||||
CompositeTags(COMPOSITE_Src,browserglob.bm,bitmap->nativebm,
|
||||
|
@ -84,6 +84,7 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap,
|
|||
COMPTAG_DestHeight,bitmap->height,
|
||||
COMPTAG_OffsetX,0,
|
||||
COMPTAG_OffsetY,0,
|
||||
COMPTAG_FriendBitMap, scrn->RastPort.BitMap,
|
||||
TAG_DONE);
|
||||
}
|
||||
else
|
||||
|
|
22
amiga/tree.c
22
amiga/tree.c
|
@ -304,26 +304,26 @@ void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
|
|||
BOOL drag;
|
||||
nsurl *url = NULL;
|
||||
const char *title = NULL;
|
||||
bool ok = false;
|
||||
|
||||
if(drag = ami_drag_in_progress()) ami_drag_icon_close(twin->win);
|
||||
|
||||
if(drag && (twin != ami_window_at_pointer(AMINS_TVWINDOW)))
|
||||
{
|
||||
if((twin->type == AMI_TREE_HOTLIST) && (hotlist_has_selection())) {
|
||||
hotlist_get_selection(&url, &title);
|
||||
ok = hotlist_get_selection(&url, &title);
|
||||
} else if((twin->type == AMI_TREE_HISTORY) && (global_history_has_selection())) {
|
||||
global_history_get_selection(&url, &title);
|
||||
ok = global_history_get_selection(&url, &title);
|
||||
}
|
||||
|
||||
if((title == NULL) || (title && (url == NULL))) {
|
||||
if((ok == false) || (url == NULL)) {
|
||||
DisplayBeep(scrn);
|
||||
} else if(url) {
|
||||
if(gwin = ami_window_at_pointer(AMINS_WINDOW)) {
|
||||
browser_window_navigate(gwin->bw,
|
||||
url,
|
||||
NULL,
|
||||
BROWSER_WINDOW_HISTORY |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
BW_NAVIGATE_HISTORY,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
@ -332,9 +332,11 @@ void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
|
|||
hotlist_add_entry(url, title, true, y);
|
||||
}
|
||||
}
|
||||
tree_mouse_action(twin->tree, twin->mouse_state | twin->key_state,
|
||||
twin->drag_x, twin->drag_y); /* Keep the tree happy */
|
||||
tree_drag_end(twin->tree, twin->mouse_state,
|
||||
twin->drag_x, twin->drag_y,
|
||||
twin->drag_x, twin->drag_y); /* Keep the tree happy */
|
||||
twin->drag_x, twin->drag_y); /* Keep the tree happier */
|
||||
} else {
|
||||
if(tree_drag_status(twin->tree) == TREE_UNKNOWN_DRAG)
|
||||
DisplayBeep(scrn);
|
||||
|
@ -709,7 +711,7 @@ void ami_tree_close(struct treeview_window *twin)
|
|||
ami_ssl_free(twin);
|
||||
}
|
||||
|
||||
ami_gui_hotlist_toolbar_update_all();
|
||||
ami_gui_hotlist_update_all();
|
||||
}
|
||||
|
||||
void ami_tree_update_quals(struct treeview_window *twin)
|
||||
|
@ -1391,11 +1393,11 @@ void ami_tree_redraw_request(int x, int y, int width, int height, void *data)
|
|||
atrr_data->height = height;
|
||||
atrr_data->twin = (struct treeview_window *)data;
|
||||
|
||||
/**TODO: Queue these requests properly like the main browser code does
|
||||
/** /todo Queue these requests properly like the main browser code does
|
||||
**/
|
||||
|
||||
if(nsoption_bool(direct_render) == false)
|
||||
schedule(0, ami_tree_redraw_req, atrr_data);
|
||||
ami_schedule(0, ami_tree_redraw_req, atrr_data);
|
||||
else
|
||||
schedule(0, ami_tree_redraw_req_dr, atrr_data);
|
||||
ami_schedule(0, ami_tree_redraw_req_dr, atrr_data);
|
||||
}
|
||||
|
|
81
amiga/utf8.c
81
amiga/utf8.c
|
@ -18,48 +18,17 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "utils/utf8.h"
|
||||
#include "desktop/gui.h"
|
||||
#include <proto/exec.h>
|
||||
#include <proto/diskfont.h>
|
||||
#include <diskfont/diskfonttag.h>
|
||||
|
||||
void ami_utf8_free(char *ptr)
|
||||
{
|
||||
if(ptr) free(ptr);
|
||||
}
|
||||
#include "amiga/utf8.h"
|
||||
|
||||
char *ami_utf8_easy(const char *string)
|
||||
{
|
||||
char *localtext;
|
||||
|
||||
if(utf8_to_local_encoding(string,strlen(string),&localtext) == UTF8_CONVERT_OK)
|
||||
{
|
||||
return localtext;
|
||||
}
|
||||
else
|
||||
{
|
||||
return strdup(string);
|
||||
}
|
||||
}
|
||||
|
||||
char *ami_to_utf8_easy(const char *string)
|
||||
{
|
||||
char *localtext;
|
||||
|
||||
if(utf8_from_local_encoding(string,strlen(string),&localtext) == UTF8_CONVERT_OK)
|
||||
{
|
||||
return localtext;
|
||||
}
|
||||
else
|
||||
{
|
||||
return strdup(string);
|
||||
}
|
||||
}
|
||||
|
||||
utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
|
||||
char **result)
|
||||
nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
|
||||
{
|
||||
const char *encname = "ISO-8859-1";
|
||||
|
||||
|
@ -73,8 +42,7 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
|
|||
return utf8_from_enc(string,encname,len,result,NULL);
|
||||
}
|
||||
|
||||
utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
|
||||
char **result)
|
||||
nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
|
||||
{
|
||||
const char *encname = "ISO-8859-1";
|
||||
|
||||
|
@ -88,4 +56,43 @@ utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
|
|||
return utf8_to_enc(string,encname,len,result);
|
||||
}
|
||||
|
||||
void ami_utf8_free(char *ptr)
|
||||
{
|
||||
if(ptr) free(ptr);
|
||||
}
|
||||
|
||||
char *ami_utf8_easy(const char *string)
|
||||
{
|
||||
char *localtext;
|
||||
|
||||
if(utf8_to_local_encoding(string,strlen(string),&localtext) == NSERROR_OK)
|
||||
{
|
||||
return localtext;
|
||||
}
|
||||
else
|
||||
{
|
||||
return strdup(string);
|
||||
}
|
||||
}
|
||||
|
||||
char *ami_to_utf8_easy(const char *string)
|
||||
{
|
||||
char *localtext;
|
||||
|
||||
if(utf8_from_local_encoding(string,strlen(string),&localtext) == NSERROR_OK)
|
||||
{
|
||||
return localtext;
|
||||
}
|
||||
else
|
||||
{
|
||||
return strdup(string);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static struct gui_utf8_table utf8_table = {
|
||||
.utf8_to_local = utf8_to_local_encoding,
|
||||
.local_to_utf8 = utf8_from_local_encoding,
|
||||
};
|
||||
|
||||
struct gui_utf8_table *amiga_utf8_table = &utf8_table;
|
||||
|
|
|
@ -18,7 +18,14 @@
|
|||
|
||||
#ifndef AMIGA_UTF8_H
|
||||
#define AMIGA_UTF8_H
|
||||
|
||||
extern struct gui_utf8_table *ami_utf8_table;
|
||||
|
||||
char *ami_utf8_easy(const char *string);
|
||||
void ami_utf8_free(char *ptr);
|
||||
char *ami_to_utf8_easy(const char *string);
|
||||
|
||||
nserror utf8_from_local_encoding(const char *string, size_t len, char **result);
|
||||
nserror utf8_to_local_encoding(const char *string, size_t len, char **result);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,22 +16,23 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "utils/testament.h"
|
||||
#include "testament.h"
|
||||
|
||||
/* NB: AmigaOS revision numbers start at 1 (not 0) and are monotonically
|
||||
* incremental (v1.20 is higher than v1.3 and not the same as v1.2).
|
||||
* Consequently, this version pair may not match the user-facing one in
|
||||
* desktop/version.c.
|
||||
* desktop/version.c. Release revisions are prepended with 6000 to ensure
|
||||
* they are higher than CI builds, and make this less confusing.
|
||||
*/
|
||||
#define NETSURF_VERSION_MAJOR "3"
|
||||
#if defined(CI_BUILD)
|
||||
#define NETSURF_VERSION_MINOR CI_BUILD
|
||||
#else
|
||||
#define NETSURF_VERSION_MINOR "2"
|
||||
#define NETSURF_VERSION_MINOR "6000" "3"
|
||||
#endif
|
||||
|
||||
|
||||
static const __attribute__((used)) char *verstag = "\0$VER: NetSurf " NETSURF_VERSION_MAJOR "." NETSURF_VERSION_MINOR " (" WT_COMPILEDATE ")\0";
|
||||
const char * const verdate = WT_COMPILEDATE;
|
||||
const char * const verarexx = NETSURF_VERSION_MAJOR "." NETSURF_VERSION_MINOR;
|
||||
const char * const wt_revid = WT_REVID;
|
||||
|
||||
|
|
|
@ -2,59 +2,56 @@
|
|||
# Atari-specific options
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# Force using glibc internal iconv implementation instead of external libiconv
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_LIBICONV_PLUG := NO
|
||||
# Force using glibc internal iconv implementation instead of external libiconv
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_LIBICONV_PLUG := NO
|
||||
|
||||
# Enable NetSurf's use of librosprite for displaying RISC OS Sprites
|
||||
# Valid options: YES, NO, AUTO
|
||||
NETSURF_USE_ROSPRITE := NO
|
||||
# Enable NetSurf's use of librosprite for displaying RISC OS Sprites
|
||||
# Valid options: YES, NO, AUTO
|
||||
NETSURF_USE_ROSPRITE := NO
|
||||
|
||||
# Enable NetSurf's use of libwebp for displaying WebPs
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_WEBP := NO
|
||||
# Enable NetSurf's use of libwebp for displaying WebPs
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_WEBP := NO
|
||||
|
||||
# Enable NetSurf's use of librsvg in conjunction with Cairo to display SVGs
|
||||
# Valid options: YES, NO, AUTO
|
||||
NETSURF_USE_RSVG := AUTO
|
||||
# Enable NetSurf's use of librsvg in conjunction with Cairo to display SVGs
|
||||
# Valid options: YES, NO, AUTO
|
||||
NETSURF_USE_RSVG := AUTO
|
||||
|
||||
# Enable NetSurf's use of libsvgtiny for displaying SVGs
|
||||
# Valid options: YES, NO, AUTO
|
||||
NETSURF_USE_NSSVG := AUTO
|
||||
# Enable NetSurf's use of libsvgtiny for displaying SVGs
|
||||
# Valid options: YES, NO, AUTO
|
||||
NETSURF_USE_NSSVG := AUTO
|
||||
|
||||
NETSURF_USE_MNG := NO
|
||||
# Enable Spidermonkey JavaScript engine
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_MOZJS := NO
|
||||
|
||||
# Enable Spidermonkey JavaScript engine
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_MOZJS := NO
|
||||
# enable true type fonts via freetype2
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_ATARI_FREETYPE_FONT := YES
|
||||
|
||||
# enable true type fonts via freetype2
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_ATARI_FREETYPE_FONT := YES
|
||||
# Enable use of netsurf embedded font
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_ATARI_NETSURF_FONT := YES
|
||||
|
||||
# Enable use of netsurf embedded font
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_ATARI_NETSURF_FONT := YES
|
||||
# Enable VDI Font rendering
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_ATARI_VDI_FONT := NO
|
||||
|
||||
# Enable VDI Font rendering
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_ATARI_VDI_FONT := NO
|
||||
# Configure support for screen drivers with no true colour mode
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_ATARI_8BPP_SUPPORT := NO
|
||||
|
||||
# Configure support for screen drivers with no true colour mode
|
||||
# Valid options: YES, NO
|
||||
NETSURF_USE_ATARI_8BPP_SUPPORT := NO
|
||||
# Configure the CPU target
|
||||
# Valid options: 68000, 68020-60, 5475 (coldfire)
|
||||
ATARIARCH = 68020-60
|
||||
|
||||
# Configure the CPU target
|
||||
# Valid options: 68000, 68020-60, 5475 (coldfire)
|
||||
ATARIARCH = 68020-60
|
||||
# enable optimizations
|
||||
# -O2 is currently broken with m68000 / m68020-60 builds
|
||||
CFLAGS += -O3
|
||||
|
||||
# enable optimizations
|
||||
# -O2 is currently broken with m68000 / m68020-60 builds
|
||||
CFLAGS += -O3
|
||||
|
||||
# override warning flags removing -Wall
|
||||
WARNFLAGS = -W -Wundef -Wpointer-arith \
|
||||
# override warning flags removing -Wall
|
||||
WARNFLAGS = -W -Wundef -Wpointer-arith \
|
||||
-Wcast-align -Wwrite-strings -Wstrict-prototypes \
|
||||
-Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
|
||||
-Wnested-externs -Wuninitialized -Wl,-t
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
# the netsurf environment!
|
||||
STRIP := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*strip)
|
||||
STACK := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*stack)
|
||||
FT2CF := $(GCCSDK_INSTALL_ENV)/bin/freetype-config
|
||||
|
||||
ifeq ($(ATARIARCH),68000)
|
||||
PRGSUFFIX := 000.app
|
||||
|
@ -32,10 +33,9 @@ endif
|
|||
|
||||
# non-pkgconfig components
|
||||
|
||||
FREETYPE_FONT_CFLAGS := $(shell freetype-config --cflags) -DWITH_FREETYPE_FONT_DRIVER
|
||||
FREETYPE_FONT_CFLAGS := $(shell $(FT2CF) --cflags) -DWITH_FREETYPE_FONT_DRIVER
|
||||
SPIDERMONKEY_CFLAGS := -DWITH_MOZJS -DXP_UNIX -DJS_HAS_FILE_OBJECT=0 -DJSOPTION_JIT=0 -DPOSIX_SOURCE -D_BSD_SOURCE
|
||||
|
||||
$(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG/MNG/JNG (libmng)))
|
||||
$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng)))
|
||||
$(eval $(call feature_enabled,MOZJS,$(SPIDERMONKEY_CFLAGS),-ljs,JavaScript (Spidermonkey)))
|
||||
$(eval $(call feature_enabled,ATARI_FREETYPE_FONT,$(FREETYPE_FONT_CFLAGS),-lfreetype,(Freetype)))
|
||||
|
@ -59,7 +59,7 @@ endif
|
|||
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
|
||||
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
|
||||
|
||||
CFLAGS += -U__STRICT_ANSI__ -std=c99 -Dsmall $(WARNFLAGS) -Dnsatari \
|
||||
CFLAGS += -U__STRICT_ANSI__ -std=c99 -Dsmall -Dnsatari \
|
||||
-D_BSD_SOURCE \
|
||||
-D_XOPEN_SOURCE=600 \
|
||||
-D_POSIX_C_SOURCE=200112L \
|
||||
|
@ -69,7 +69,7 @@ CFLAGS += -U__STRICT_ANSI__ -std=c99 -Dsmall $(WARNFLAGS) -Dnsatari \
|
|||
LDFLAGS += -lcflib -lcurl
|
||||
LDFLAGS += -lcss -lparserutils -ldom -lwapcaplet -lhubbub
|
||||
LDFLAGS += -lssl -lcrypto
|
||||
LDFLAGS += -lz -liconv -lcares -lHermes -lgem -lm
|
||||
LDFLAGS += -lz -lcares -lHermes -lgem -lm
|
||||
LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib
|
||||
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
@ -28,16 +28,16 @@
|
|||
#include "atari/plot/plot.h"
|
||||
#include "atari/gemtk/gemtk.h"
|
||||
#include "atari/res/netsurf.rsh"
|
||||
#include "atari/about.h"
|
||||
#include "atari/about.h"
|
||||
|
||||
#include "utils/testament.h"
|
||||
#include "testament.h"
|
||||
#include "utils/useragent.h"
|
||||
#include "desktop/netsurf.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "utils/messages.h"
|
||||
|
||||
|
||||
#include "curl/curlver.h"
|
||||
#include "curl/curlver.h"
|
||||
|
||||
|
||||
static OBJECT * about_form = NULL;
|
||||
|
@ -50,9 +50,6 @@ static short __CDECL about_userdraw(PARMBLK *parmblock)
|
|||
{
|
||||
short pxy[8];
|
||||
short dummy;
|
||||
int content_len;
|
||||
char *content;
|
||||
short cur_x, cur_y;
|
||||
short cheight = 8, cwidth = gl_wchar;
|
||||
char c[2] = {0,0};
|
||||
|
||||
|
@ -73,6 +70,9 @@ static short __CDECL about_userdraw(PARMBLK *parmblock)
|
|||
};
|
||||
|
||||
if(parmblock->pb_currstate == parmblock->pb_prevstate){
|
||||
short cur_x, cur_y;
|
||||
char *content;
|
||||
int content_len;
|
||||
|
||||
content = (char*)parmblock->pb_parm;
|
||||
content_len = strlen(content);
|
||||
|
@ -170,8 +170,7 @@ void atari_about_show(void)
|
|||
if (goto_url != NULL) {
|
||||
nserr = nsurl_create(goto_url, &url);
|
||||
if (nserr == NSERROR_OK) {
|
||||
nserr = browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY,
|
||||
nserr = browser_window_create(BW_CREATE_HISTORY,
|
||||
url,
|
||||
NULL,
|
||||
NULL,
|
||||
|
|
568
atari/certview.c
568
atari/certview.c
|
@ -14,293 +14,287 @@
|
|||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "desktop/browser.h"
|
||||
#include "content/urldb.h"
|
||||
#include "desktop/sslcert_viewer.h"
|
||||
#include "desktop/gui.h"
|
||||
#include "desktop/core_window.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
#include "atari/gui.h"
|
||||
#include "atari/misc.h"
|
||||
#include "atari/treeview.h"
|
||||
#include "atari/certview.h"
|
||||
#include "atari/findfile.h"
|
||||
#include "atari/gemtk/gemtk.h"
|
||||
#include "atari/res/netsurf.rsh"
|
||||
|
||||
extern GRECT desk_area;
|
||||
|
||||
|
||||
/* Setup Atari Treeview Callbacks: */
|
||||
static nserror atari_sslcert_viewer_init_phase2(struct core_window *cw,
|
||||
struct core_window_callback_table * default_callbacks);
|
||||
static void atari_sslcert_viewer_finish(struct core_window *cw);
|
||||
static void atari_sslcert_viewer_keypress(struct core_window *cw,
|
||||
uint32_t ucs4);
|
||||
static void atari_sslcert_viewer_mouse_action(struct core_window *cw,
|
||||
browser_mouse_state mouse,
|
||||
int x, int y);
|
||||
static void atari_sslcert_viewer_draw(struct core_window *cw, int x,
|
||||
int y, struct rect *clip,
|
||||
const struct redraw_context *ctx);
|
||||
static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]);
|
||||
|
||||
static struct atari_treeview_callbacks atari_sslcert_viewer_treeview_callbacks = {
|
||||
.init_phase2 = atari_sslcert_viewer_init_phase2,
|
||||
.finish = atari_sslcert_viewer_finish,
|
||||
.draw = atari_sslcert_viewer_draw,
|
||||
.keypress = atari_sslcert_viewer_keypress,
|
||||
.mouse_action = atari_sslcert_viewer_mouse_action,
|
||||
.gemtk_user_func = handle_event
|
||||
};
|
||||
|
||||
/* static functions */
|
||||
static void atari_sslcert_viewer_destroy(struct atari_sslcert_viewer_s * cvwin);
|
||||
|
||||
|
||||
static nserror atari_sslcert_viewer_init_phase2(struct core_window *cw,
|
||||
struct core_window_callback_table *cb_t)
|
||||
{
|
||||
struct atari_sslcert_viewer_s *cvwin;
|
||||
struct sslcert_session_data *ssl_d;
|
||||
|
||||
cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw);
|
||||
|
||||
assert(cvwin);
|
||||
|
||||
ssl_d = cvwin->ssl_session_data;
|
||||
|
||||
assert(ssl_d);
|
||||
|
||||
LOG((""));
|
||||
|
||||
return(sslcert_viewer_init(cb_t, cw, ssl_d));
|
||||
}
|
||||
|
||||
static void atari_sslcert_viewer_finish(struct core_window *cw)
|
||||
{
|
||||
struct atari_sslcert_viewer_s *cvwin;
|
||||
|
||||
assert(cw);
|
||||
|
||||
cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw);
|
||||
|
||||
/* This will also free the session data: */
|
||||
sslcert_viewer_fini(cvwin->ssl_session_data);
|
||||
|
||||
LOG((""));
|
||||
}
|
||||
|
||||
static void atari_sslcert_viewer_draw(struct core_window *cw, int x,
|
||||
int y, struct rect *clip,
|
||||
const struct redraw_context *ctx)
|
||||
{
|
||||
struct atari_sslcert_viewer_s *cvwin;
|
||||
|
||||
assert(cw);
|
||||
|
||||
cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw);
|
||||
|
||||
assert(cvwin);
|
||||
|
||||
sslcert_viewer_redraw(cvwin->ssl_session_data, x, y, clip, ctx);
|
||||
}
|
||||
|
||||
static void atari_sslcert_viewer_keypress(struct core_window *cw, uint32_t ucs4)
|
||||
{
|
||||
struct atari_sslcert_viewer_s *cvwin;
|
||||
|
||||
assert(cw);
|
||||
|
||||
cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw);
|
||||
|
||||
LOG(("ucs4: %lu\n", ucs4));
|
||||
sslcert_viewer_keypress(cvwin->ssl_session_data, ucs4);
|
||||
}
|
||||
|
||||
static void atari_sslcert_viewer_mouse_action(struct core_window *cw,
|
||||
browser_mouse_state mouse,
|
||||
int x, int y)
|
||||
{
|
||||
struct atari_sslcert_viewer_s *cvwin;
|
||||
|
||||
assert(cw);
|
||||
|
||||
cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw);
|
||||
|
||||
if ((mouse & BROWSER_MOUSE_HOVER)) {
|
||||
sslcert_viewer_mouse_action(cvwin->ssl_session_data, mouse, x, y);
|
||||
} else {
|
||||
sslcert_viewer_mouse_action(cvwin->ssl_session_data, mouse, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
|
||||
{
|
||||
struct core_window *tv=NULL;
|
||||
GRECT tb_area;
|
||||
GUIWIN * gemtk_win;
|
||||
struct gui_window * gw;
|
||||
struct atari_sslcert_viewer_s *cvwin = NULL;
|
||||
char *cur_url = NULL;
|
||||
char *cur_title = NULL;
|
||||
short retval = 0;
|
||||
OBJECT *toolbar;
|
||||
|
||||
LOG((""));
|
||||
|
||||
if(ev_out->emo_events & MU_MESAG){
|
||||
switch (msg[0]) {
|
||||
|
||||
case WM_TOOLBAR:
|
||||
toolbar = gemtk_obj_get_tree(TOOLBAR_SSL_CERT);
|
||||
LOG(("CERTVIEWER WM_TOOLBAR"));
|
||||
tv = (struct core_window*) gemtk_wm_get_user_data(win);
|
||||
assert(tv);
|
||||
cvwin = (struct atari_sslcert_viewer_s *)
|
||||
atari_treeview_get_user_data(tv);
|
||||
switch (msg[4]) {
|
||||
|
||||
case TOOLBAR_SSL_CERT_TRUSTED:
|
||||
|
||||
if (toolbar[msg[4]].ob_state & OS_SELECTED) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
gemtk_win = atari_treeview_get_gemtk_window(tv);
|
||||
assert(gemtk_win);
|
||||
//gemtk_obj_get_tree(TOOLBAR_HOTLIST)[msg[4]].ob_state &= ~OS_SELECTED;
|
||||
atari_treeview_get_grect(tv, TREEVIEW_AREA_TOOLBAR, &tb_area);
|
||||
evnt_timer(150);
|
||||
gemtk_wm_exec_redraw(gemtk_win, &tb_area);
|
||||
retval = 1;
|
||||
break;
|
||||
|
||||
case WM_CLOSED:
|
||||
// TODO set perrmissions
|
||||
toolbar = gemtk_obj_get_tree(TOOLBAR_SSL_CERT);
|
||||
tv = (struct core_window*) gemtk_wm_get_user_data(win);
|
||||
assert(tv);
|
||||
cvwin = (struct atari_sslcert_viewer_s *)
|
||||
atari_treeview_get_user_data(tv);
|
||||
if (toolbar[TOOLBAR_SSL_CERT_TRUSTED].ob_state & OS_SELECTED) {
|
||||
sslcert_viewer_accept(cvwin->ssl_session_data);
|
||||
} else {
|
||||
sslcert_viewer_reject(cvwin->ssl_session_data);
|
||||
}
|
||||
atari_sslcert_viewer_destroy(cvwin);
|
||||
retval = 1;
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
return(retval);
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "desktop/browser.h"
|
||||
#include "content/urldb.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "desktop/sslcert_viewer.h"
|
||||
#include "desktop/gui.h"
|
||||
#include "desktop/core_window.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
#include "atari/gui.h"
|
||||
#include "atari/misc.h"
|
||||
#include "atari/treeview.h"
|
||||
#include "atari/certview.h"
|
||||
#include "atari/findfile.h"
|
||||
#include "atari/gemtk/gemtk.h"
|
||||
#include "atari/res/netsurf.rsh"
|
||||
|
||||
extern GRECT desk_area;
|
||||
|
||||
|
||||
/* Setup Atari Treeview Callbacks: */
|
||||
static nserror atari_sslcert_viewer_init_phase2(struct core_window *cw,
|
||||
struct core_window_callback_table * default_callbacks);
|
||||
static void atari_sslcert_viewer_finish(struct core_window *cw);
|
||||
static void atari_sslcert_viewer_keypress(struct core_window *cw,
|
||||
uint32_t ucs4);
|
||||
static void atari_sslcert_viewer_mouse_action(struct core_window *cw,
|
||||
browser_mouse_state mouse,
|
||||
int x, int y);
|
||||
static void atari_sslcert_viewer_draw(struct core_window *cw, int x,
|
||||
int y, struct rect *clip,
|
||||
const struct redraw_context *ctx);
|
||||
static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]);
|
||||
|
||||
static struct atari_treeview_callbacks atari_sslcert_viewer_treeview_callbacks = {
|
||||
.init_phase2 = atari_sslcert_viewer_init_phase2,
|
||||
.finish = atari_sslcert_viewer_finish,
|
||||
.draw = atari_sslcert_viewer_draw,
|
||||
.keypress = atari_sslcert_viewer_keypress,
|
||||
.mouse_action = atari_sslcert_viewer_mouse_action,
|
||||
.gemtk_user_func = handle_event
|
||||
};
|
||||
|
||||
/* static functions */
|
||||
static void atari_sslcert_viewer_destroy(struct atari_sslcert_viewer_s * cvwin);
|
||||
|
||||
|
||||
static nserror atari_sslcert_viewer_init_phase2(struct core_window *cw,
|
||||
struct core_window_callback_table *cb_t)
|
||||
{
|
||||
struct atari_sslcert_viewer_s *cvwin;
|
||||
struct sslcert_session_data *ssl_d;
|
||||
|
||||
cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw);
|
||||
|
||||
assert(cvwin);
|
||||
|
||||
ssl_d = cvwin->ssl_session_data;
|
||||
|
||||
assert(ssl_d);
|
||||
|
||||
LOG((""));
|
||||
|
||||
return(sslcert_viewer_init(cb_t, cw, ssl_d));
|
||||
}
|
||||
|
||||
static void atari_sslcert_viewer_init(struct atari_sslcert_viewer_s * cvwin,
|
||||
struct sslcert_session_data *ssl_d)
|
||||
{
|
||||
assert(cvwin->init == false);
|
||||
assert(cvwin->window == NULL);
|
||||
assert(cvwin->tv == NULL);
|
||||
|
||||
int flags = ATARI_TREEVIEW_WIDGETS;
|
||||
short handle = -1;
|
||||
GRECT desk;
|
||||
OBJECT * tree = gemtk_obj_get_tree(TOOLBAR_SSL_CERT);
|
||||
assert( tree );
|
||||
|
||||
handle = wind_create(flags, 0, 0, desk_area.g_w, desk_area.g_h);
|
||||
cvwin->window = gemtk_wm_add(handle,
|
||||
GEMTK_WM_FLAG_DEFAULTS, NULL);
|
||||
if (cvwin->window == NULL ) {
|
||||
gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT,
|
||||
"Failed to allocate Treeview:\nCertviewer");
|
||||
return;
|
||||
}
|
||||
wind_set_str(handle, WF_NAME, (char*)"SSL Certificate");
|
||||
gemtk_wm_set_toolbar(cvwin->window, tree, 0, 0);
|
||||
gemtk_wm_unlink(cvwin->window);
|
||||
|
||||
cvwin->ssl_session_data = ssl_d;
|
||||
cvwin->tv = atari_treeview_create(cvwin->window,
|
||||
&atari_sslcert_viewer_treeview_callbacks,
|
||||
cvwin, flags);
|
||||
|
||||
if (cvwin->tv == NULL) {
|
||||
/* handle it properly, clean up previous allocs */
|
||||
LOG(("Failed to allocate treeview"));
|
||||
return;
|
||||
}
|
||||
|
||||
cvwin->init = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* documented in certview.h
|
||||
*/
|
||||
void atari_sslcert_viewer_open(struct sslcert_session_data *ssl_d)
|
||||
{
|
||||
struct atari_sslcert_viewer_s * cvwin;
|
||||
|
||||
cvwin = calloc(1, sizeof(struct atari_sslcert_viewer_s));
|
||||
|
||||
assert(cvwin);
|
||||
|
||||
atari_sslcert_viewer_init(cvwin, ssl_d);
|
||||
|
||||
if (atari_treeview_is_open(cvwin->tv) == false) {
|
||||
|
||||
GRECT pos;
|
||||
pos.g_x = desk_area.g_w - desk_area.g_w / 4;
|
||||
pos.g_y = desk_area.g_y;
|
||||
pos.g_w = desk_area.g_w / 4;
|
||||
pos.g_h = desk_area.g_h;
|
||||
|
||||
atari_treeview_open(cvwin->tv, &pos);
|
||||
} else {
|
||||
wind_set(gemtk_wm_get_handle(cvwin->window), WF_TOP, 1, 0,
|
||||
0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void atari_sslcert_viewer_finish(struct core_window *cw)
|
||||
{
|
||||
struct atari_sslcert_viewer_s *cvwin;
|
||||
|
||||
assert(cw);
|
||||
|
||||
cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw);
|
||||
|
||||
/* This will also free the session data: */
|
||||
sslcert_viewer_fini(cvwin->ssl_session_data);
|
||||
|
||||
LOG((""));
|
||||
}
|
||||
|
||||
static void atari_sslcert_viewer_draw(struct core_window *cw, int x,
|
||||
int y, struct rect *clip,
|
||||
const struct redraw_context *ctx)
|
||||
{
|
||||
struct atari_sslcert_viewer_s *cvwin;
|
||||
|
||||
assert(cw);
|
||||
|
||||
cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw);
|
||||
|
||||
assert(cvwin);
|
||||
|
||||
sslcert_viewer_redraw(cvwin->ssl_session_data, x, y, clip, ctx);
|
||||
}
|
||||
|
||||
static void atari_sslcert_viewer_keypress(struct core_window *cw, uint32_t ucs4)
|
||||
{
|
||||
struct atari_sslcert_viewer_s *cvwin;
|
||||
|
||||
assert(cw);
|
||||
|
||||
cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw);
|
||||
|
||||
LOG(("ucs4: %lu\n", ucs4));
|
||||
sslcert_viewer_keypress(cvwin->ssl_session_data, ucs4);
|
||||
}
|
||||
|
||||
static void atari_sslcert_viewer_mouse_action(struct core_window *cw,
|
||||
browser_mouse_state mouse,
|
||||
int x, int y)
|
||||
{
|
||||
struct atari_sslcert_viewer_s *cvwin;
|
||||
|
||||
assert(cw);
|
||||
|
||||
cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw);
|
||||
|
||||
sslcert_viewer_mouse_action(cvwin->ssl_session_data, mouse, x, y);
|
||||
}
|
||||
|
||||
|
||||
static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
|
||||
{
|
||||
struct core_window *tv=NULL;
|
||||
GRECT tb_area;
|
||||
GUIWIN * gemtk_win;
|
||||
struct atari_sslcert_viewer_s *cvwin = NULL;
|
||||
short retval = 0;
|
||||
OBJECT *toolbar;
|
||||
|
||||
LOG((""));
|
||||
|
||||
if(ev_out->emo_events & MU_MESAG){
|
||||
switch (msg[0]) {
|
||||
|
||||
case WM_TOOLBAR:
|
||||
toolbar = gemtk_obj_get_tree(TOOLBAR_SSL_CERT);
|
||||
LOG(("CERTVIEWER WM_TOOLBAR"));
|
||||
tv = (struct core_window*) gemtk_wm_get_user_data(win);
|
||||
assert(tv);
|
||||
cvwin = (struct atari_sslcert_viewer_s *)
|
||||
atari_treeview_get_user_data(tv);
|
||||
switch (msg[4]) {
|
||||
|
||||
case TOOLBAR_SSL_CERT_TRUSTED:
|
||||
|
||||
if (toolbar[msg[4]].ob_state & OS_SELECTED) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
gemtk_win = atari_treeview_get_gemtk_window(tv);
|
||||
assert(gemtk_win);
|
||||
//gemtk_obj_get_tree(TOOLBAR_HOTLIST)[msg[4]].ob_state &= ~OS_SELECTED;
|
||||
atari_treeview_get_grect(tv, TREEVIEW_AREA_TOOLBAR, &tb_area);
|
||||
evnt_timer(150);
|
||||
gemtk_wm_exec_redraw(gemtk_win, &tb_area);
|
||||
retval = 1;
|
||||
break;
|
||||
|
||||
case WM_CLOSED:
|
||||
// TODO set perrmissions
|
||||
toolbar = gemtk_obj_get_tree(TOOLBAR_SSL_CERT);
|
||||
tv = (struct core_window*) gemtk_wm_get_user_data(win);
|
||||
assert(tv);
|
||||
cvwin = (struct atari_sslcert_viewer_s *)
|
||||
atari_treeview_get_user_data(tv);
|
||||
if (toolbar[TOOLBAR_SSL_CERT_TRUSTED].ob_state & OS_SELECTED) {
|
||||
sslcert_viewer_accept(cvwin->ssl_session_data);
|
||||
} else {
|
||||
sslcert_viewer_reject(cvwin->ssl_session_data);
|
||||
}
|
||||
atari_sslcert_viewer_destroy(cvwin);
|
||||
retval = 1;
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
return(retval);
|
||||
}
|
||||
|
||||
static void atari_sslcert_viewer_init(struct atari_sslcert_viewer_s * cvwin,
|
||||
struct sslcert_session_data *ssl_d)
|
||||
{
|
||||
assert(cvwin->init == false);
|
||||
assert(cvwin->window == NULL);
|
||||
assert(cvwin->tv == NULL);
|
||||
|
||||
int flags = ATARI_TREEVIEW_WIDGETS;
|
||||
short handle = -1;
|
||||
GRECT desk;
|
||||
OBJECT * tree = gemtk_obj_get_tree(TOOLBAR_SSL_CERT);
|
||||
assert( tree );
|
||||
|
||||
handle = wind_create(flags, 0, 0, desk_area.g_w, desk_area.g_h);
|
||||
cvwin->window = gemtk_wm_add(handle,
|
||||
GEMTK_WM_FLAG_DEFAULTS, NULL);
|
||||
if (cvwin->window == NULL ) {
|
||||
gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT,
|
||||
"Failed to allocate Treeview:\nCertviewer");
|
||||
return;
|
||||
}
|
||||
wind_set_str(handle, WF_NAME, (char*)"SSL Certificate");
|
||||
gemtk_wm_set_toolbar(cvwin->window, tree, 0, 0);
|
||||
gemtk_wm_unlink(cvwin->window);
|
||||
|
||||
cvwin->ssl_session_data = ssl_d;
|
||||
cvwin->tv = atari_treeview_create(cvwin->window,
|
||||
&atari_sslcert_viewer_treeview_callbacks,
|
||||
cvwin, flags);
|
||||
|
||||
if (cvwin->tv == NULL) {
|
||||
/* handle it properly, clean up previous allocs */
|
||||
LOG(("Failed to allocate treeview"));
|
||||
return;
|
||||
}
|
||||
|
||||
cvwin->init = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* documented in certview.h
|
||||
*/
|
||||
void atari_sslcert_viewer_open(struct sslcert_session_data *ssl_d)
|
||||
{
|
||||
struct atari_sslcert_viewer_s * cvwin;
|
||||
|
||||
cvwin = calloc(1, sizeof(struct atari_sslcert_viewer_s));
|
||||
|
||||
assert(cvwin);
|
||||
|
||||
atari_sslcert_viewer_init(cvwin, ssl_d);
|
||||
|
||||
if (atari_treeview_is_open(cvwin->tv) == false) {
|
||||
|
||||
GRECT pos;
|
||||
pos.g_x = desk_area.g_w - desk_area.g_w / 4;
|
||||
pos.g_y = desk_area.g_y;
|
||||
pos.g_w = desk_area.g_w / 4;
|
||||
pos.g_h = desk_area.g_h;
|
||||
|
||||
atari_treeview_open(cvwin->tv, &pos);
|
||||
} else {
|
||||
wind_set(gemtk_wm_get_handle(cvwin->window), WF_TOP, 1, 0,
|
||||
0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void atari_sslcert_viewer_destroy(struct atari_sslcert_viewer_s * cvwin)
|
||||
{
|
||||
assert(cvwin);
|
||||
assert(cvwin->init);
|
||||
assert(cvwin->window);
|
||||
|
||||
LOG((""));
|
||||
|
||||
if (atari_treeview_is_open(cvwin->tv))
|
||||
atari_treeview_close(cvwin->tv);
|
||||
wind_delete(gemtk_wm_get_handle(cvwin->window));
|
||||
gemtk_wm_remove(cvwin->window);
|
||||
cvwin->window = NULL;
|
||||
atari_treeview_delete(cvwin->tv);
|
||||
free(cvwin);
|
||||
LOG(("done"));
|
||||
}
|
||||
|
||||
static void atari_sslcert_viewer_destroy(struct atari_sslcert_viewer_s * cvwin)
|
||||
{
|
||||
assert(cvwin);
|
||||
assert(cvwin->init);
|
||||
assert(cvwin->window);
|
||||
|
||||
LOG((""));
|
||||
|
||||
if (atari_treeview_is_open(cvwin->tv))
|
||||
atari_treeview_close(cvwin->tv);
|
||||
wind_delete(gemtk_wm_get_handle(cvwin->window));
|
||||
gemtk_wm_remove(cvwin->window);
|
||||
cvwin->window = NULL;
|
||||
atari_treeview_delete(cvwin->tv);
|
||||
free(cvwin);
|
||||
LOG(("done"));
|
||||
}
|
||||
|
||||
|
|
|
@ -20,69 +20,69 @@
|
|||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <mint/osbind.h>
|
||||
#include <cflib.h>
|
||||
#include "atari/clipboard.h"
|
||||
#include "atari/gemtk/gemtk.h"
|
||||
|
||||
|
||||
static int filesize(char * path)
|
||||
{
|
||||
FILE *f;
|
||||
int fs;
|
||||
|
||||
f = fopen( path, "r+b");
|
||||
if(!f)
|
||||
return(-1);
|
||||
|
||||
fseek(f, 0L, SEEK_END);
|
||||
fs = ftell(f);
|
||||
fclose(f);
|
||||
|
||||
return(fs);
|
||||
}
|
||||
|
||||
int scrap_txt_write(char *str)
|
||||
{
|
||||
scrap_wtxt(str);
|
||||
|
||||
|
||||
// Send SC_CHANGED message:
|
||||
gemtk_send_msg(SC_CHANGED, 0, 2, 0, 0, 0, 0);
|
||||
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
char *scrap_txt_read(void)
|
||||
{
|
||||
char * buf = NULL;
|
||||
char path[80];
|
||||
int file;
|
||||
int len;
|
||||
|
||||
if (get_scrapdir (path))
|
||||
{
|
||||
strcat (path, "scrap.txt");
|
||||
len = filesize(path);
|
||||
if(len > 0){
|
||||
if ((file = (int) Fopen (path, 0)) >= 0)
|
||||
{
|
||||
buf = malloc(len);
|
||||
if(buf){
|
||||
len = Fread (file, len, buf);
|
||||
Fclose (file);
|
||||
buf[len] = '\0';
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <mint/osbind.h>
|
||||
#include <cflib.h>
|
||||
#include "atari/clipboard.h"
|
||||
#include "atari/gemtk/gemtk.h"
|
||||
|
||||
|
||||
static int filesize(char * path)
|
||||
{
|
||||
FILE *f;
|
||||
int fs;
|
||||
|
||||
f = fopen( path, "r+b");
|
||||
if(!f)
|
||||
return(-1);
|
||||
|
||||
fseek(f, 0L, SEEK_END);
|
||||
fs = ftell(f);
|
||||
fclose(f);
|
||||
|
||||
return(fs);
|
||||
}
|
||||
|
||||
int scrap_txt_write(char *str)
|
||||
{
|
||||
scrap_wtxt(str);
|
||||
|
||||
|
||||
// Send SC_CHANGED message:
|
||||
gemtk_send_msg(SC_CHANGED, 0, 2, 0, 0, 0, 0);
|
||||
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
char *scrap_txt_read(void)
|
||||
{
|
||||
char * buf = NULL;
|
||||
char path[80];
|
||||
|
||||
if (get_scrapdir (path))
|
||||
{
|
||||
int len;
|
||||
strcat (path, "scrap.txt");
|
||||
len = filesize(path);
|
||||
if(len > 0){
|
||||
int file;
|
||||
if ((file = (int) Fopen (path, 0)) >= 0)
|
||||
{
|
||||
buf = malloc(len);
|
||||
if(buf){
|
||||
len = Fread (file, len, buf);
|
||||
Fclose (file);
|
||||
buf[len] = '\0';
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
/*
|
||||
* Copyright 2013 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/*
|
||||
* Copyright 2013 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
|
@ -35,7 +35,6 @@
|
|||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/url.h"
|
||||
#include "atari/gui.h"
|
||||
#include "atari/misc.h"
|
||||
#include "atari/treeview.h"
|
||||
|
@ -103,24 +102,14 @@ static void atari_cookie_manager_mouse_action(struct core_window *cw,
|
|||
browser_mouse_state mouse,
|
||||
int x, int y)
|
||||
{
|
||||
if((mouse & BROWSER_MOUSE_HOVER) && cookie_manager_has_selection()){
|
||||
cookie_manager_mouse_action(mouse, x, y);
|
||||
} else {
|
||||
cookie_manager_mouse_action(mouse, x, y);
|
||||
}
|
||||
|
||||
cookie_manager_mouse_action(mouse, x, y);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
|
||||
{
|
||||
struct atari_treeview_window *tv=NULL;
|
||||
GRECT tb_area;
|
||||
GUIWIN * gemtk_win;
|
||||
struct gui_window * gw;
|
||||
char *cur_url = NULL;
|
||||
char *cur_title = NULL;
|
||||
short retval = 0;
|
||||
|
||||
LOG((""));
|
||||
|
@ -159,8 +148,8 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
|
|||
}
|
||||
|
||||
return(retval);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void atari_cookie_manager_init(void)
|
||||
{
|
||||
if (atari_cookie_manager.init == false) {
|
||||
|
@ -200,7 +189,7 @@ void atari_cookie_manager_init(void)
|
|||
}
|
||||
}
|
||||
atari_cookie_manager.init = true;
|
||||
}
|
||||
}
|
||||
void atari_cookie_manager_open(void)
|
||||
{
|
||||
assert(atari_cookie_manager.init);
|
||||
|
@ -220,13 +209,13 @@ void atari_cookie_manager_open(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void atari_cookie_manager_close(void)
|
||||
{
|
||||
atari_treeview_close(atari_cookie_manager.tv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void atari_cookie_manager_destroy(void)
|
||||
{
|
||||
if( atari_cookie_manager.init == false) {
|
||||
|
|
499
atari/ctxmenu.c
499
atari/ctxmenu.c
|
@ -1,116 +1,116 @@
|
|||
/*
|
||||
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
/*
|
||||
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <mint/osbind.h>
|
||||
#include <cflib.h>
|
||||
|
||||
#include "desktop/gui.h"
|
||||
#include "desktop/netsurf.h"
|
||||
#include "desktop/browser.h"
|
||||
#include "desktop/browser_private.h"
|
||||
#include "desktop/mouse.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "content/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/urldb.h"
|
||||
#include "css/css.h"
|
||||
#include "utils/log.h"
|
||||
#include <cflib.h>
|
||||
|
||||
#include "desktop/gui.h"
|
||||
#include "desktop/netsurf.h"
|
||||
#include "desktop/browser.h"
|
||||
#include "desktop/browser_private.h"
|
||||
#include "desktop/mouse.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "content/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/urldb.h"
|
||||
#include "css/css.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
#include "atari/gui.h"
|
||||
#include "atari/rootwin.h"
|
||||
#include "atari/misc.h"
|
||||
#include "atari/clipboard.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "atari/res/netsurf.rsh"
|
||||
#include "atari/ctxmenu.h"
|
||||
|
||||
|
||||
#define CNT_INVALID 0
|
||||
#define CNT_BROWSER 64
|
||||
#define CNT_HREF 128
|
||||
#define CNT_SELECTION 256
|
||||
#define CNT_INTERACTIVE 512
|
||||
#define CNT_IMG 1024
|
||||
|
||||
|
||||
struct s_context_info {
|
||||
unsigned long flags;
|
||||
struct contextual_content ccdata;
|
||||
};
|
||||
|
||||
struct s_context_info ctxinfo;
|
||||
|
||||
static struct s_context_info * get_context_info( struct gui_window * gw, short mx, short my )
|
||||
{
|
||||
hlcache_handle *h;
|
||||
GRECT area;
|
||||
struct contextual_content ccdata;
|
||||
#include "utils/utils.h"
|
||||
|
||||
#include "atari/gui.h"
|
||||
#include "atari/rootwin.h"
|
||||
#include "atari/misc.h"
|
||||
#include "atari/clipboard.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "atari/res/netsurf.rsh"
|
||||
#include "atari/ctxmenu.h"
|
||||
|
||||
|
||||
#define CNT_INVALID 0
|
||||
#define CNT_BROWSER 64
|
||||
#define CNT_HREF 128
|
||||
#define CNT_SELECTION 256
|
||||
#define CNT_INTERACTIVE 512
|
||||
#define CNT_IMG 1024
|
||||
|
||||
bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy);
|
||||
|
||||
struct s_context_info {
|
||||
unsigned long flags;
|
||||
struct contextual_content ccdata;
|
||||
};
|
||||
|
||||
struct s_context_info ctxinfo;
|
||||
|
||||
static struct s_context_info * get_context_info( struct gui_window * gw, short mx, short my )
|
||||
{
|
||||
hlcache_handle *h;
|
||||
GRECT area;
|
||||
struct browser_window * bw = gw->browser->bw;
|
||||
int sx, sy;
|
||||
|
||||
h = bw->current_content;
|
||||
int sx, sy;
|
||||
|
||||
h = bw->current_content;
|
||||
ctxinfo.flags = 0;
|
||||
|
||||
window_get_grect(gw->root, BROWSER_AREA_CONTENT, &area);
|
||||
if (POINT_WITHIN(mx, my, area)) {
|
||||
|
||||
mx -= area.g_x;
|
||||
mx -= area.g_x;
|
||||
my -= area.g_y;
|
||||
|
||||
if (!bw->current_content || content_get_type(h) != CONTENT_HTML){
|
||||
return(&ctxinfo);
|
||||
}
|
||||
|
||||
ctxinfo.flags |= CNT_BROWSER;
|
||||
if (!bw->current_content || content_get_type(h) != CONTENT_HTML){
|
||||
return(&ctxinfo);
|
||||
}
|
||||
|
||||
ctxinfo.flags |= CNT_BROWSER;
|
||||
|
||||
memset( &ctxinfo.ccdata, sizeof(struct contextual_content), 0 );
|
||||
|
||||
gui_window_get_scroll(gw, &sx, &sy);
|
||||
|
||||
browser_window_get_contextual_content( gw->browser->bw, mx+sx, my+sy,
|
||||
|
||||
browser_window_get_contextual_content( gw->browser->bw, mx+sx, my+sy,
|
||||
(struct contextual_content*)&ctxinfo.ccdata);
|
||||
|
||||
if( ctxinfo.ccdata.link_url ){
|
||||
ctxinfo.flags |= CNT_HREF;
|
||||
}
|
||||
if( ctxinfo.ccdata.object) {
|
||||
if( content_get_type(ctxinfo.ccdata.object) == CONTENT_IMAGE ){
|
||||
ctxinfo.flags |= CNT_IMG;
|
||||
}
|
||||
}
|
||||
if ( ctxinfo.ccdata.form_features == CTX_FORM_TEXT )
|
||||
|
||||
if( ctxinfo.ccdata.link_url ){
|
||||
ctxinfo.flags |= CNT_HREF;
|
||||
}
|
||||
if( ctxinfo.ccdata.object) {
|
||||
if( content_get_type(ctxinfo.ccdata.object) == CONTENT_IMAGE ){
|
||||
ctxinfo.flags |= CNT_IMG;
|
||||
}
|
||||
}
|
||||
if ( ctxinfo.ccdata.form_features == CTX_FORM_TEXT )
|
||||
ctxinfo.flags |= (CNT_INTERACTIVE | CNT_SELECTION);
|
||||
}
|
||||
|
||||
return(&ctxinfo);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
|
@ -147,60 +147,59 @@ static char * get_tmpfilename(const char * prefix, const char * suffix)
|
|||
} while(file_exists(tmpfilename));
|
||||
|
||||
return(tmpfilename);
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: do not open popup for gui_window, but for a rootwin?
|
||||
void context_popup(struct gui_window * gw, short x, short y)
|
||||
{
|
||||
|
||||
#define POP_FIRST_ITEM POP_CTX_CUT_SEL
|
||||
#define POP_LAST_ITEM POP_CTX_SAVE_LINK_AS
|
||||
|
||||
OBJECT * pop;
|
||||
int choice;
|
||||
struct s_context_info * ctx;
|
||||
unsigned long size;
|
||||
const char * data;
|
||||
FILE * fp_tmpfile;
|
||||
//TODO: do not open popup for gui_window, but for a rootwin?
|
||||
void context_popup(struct gui_window * gw, short x, short y)
|
||||
{
|
||||
|
||||
#define POP_FIRST_ITEM POP_CTX_CUT_SEL
|
||||
#define POP_LAST_ITEM POP_CTX_SAVE_LINK_AS
|
||||
|
||||
OBJECT * pop;
|
||||
int choice;
|
||||
struct s_context_info * ctx;
|
||||
unsigned long size;
|
||||
const char * data;
|
||||
FILE * fp_tmpfile;
|
||||
char cmdline[128];
|
||||
/* skip first byte, which must hold length of commandline: */
|
||||
char * tempfile = &cmdline[1];
|
||||
int err = 0;
|
||||
char * editor, *lastslash;
|
||||
MENU pop_menu, me_data;
|
||||
|
||||
pop = gemtk_obj_get_tree( POP_CTX );
|
||||
if (pop == NULL)
|
||||
return;
|
||||
ctx = get_context_info(gw, x, y);
|
||||
|
||||
/*
|
||||
Disable all items by default:
|
||||
*/
|
||||
for( choice = POP_FIRST_ITEM; choice<=POP_LAST_ITEM; choice++ ){
|
||||
SET_BIT(pop[ choice ].ob_state, OS_DISABLED, 1);
|
||||
}
|
||||
|
||||
if( ctx->flags & CNT_INTERACTIVE ){
|
||||
SET_BIT(pop[ POP_CTX_PASTE_SEL ].ob_state, OS_DISABLED, 0);
|
||||
}
|
||||
|
||||
if( (ctx->flags & CNT_BROWSER) ){
|
||||
SET_BIT(pop[ POP_CTX_SELECT_ALL ].ob_state, OS_DISABLED, 0);
|
||||
SET_BIT(pop[ POP_CTX_COPY_SEL ].ob_state, OS_DISABLED, 0);
|
||||
SET_BIT(pop[ POP_CTX_VIEW_SOURCE ].ob_state, OS_DISABLED, 0);
|
||||
char * tempfile = &cmdline[1];
|
||||
char * editor;
|
||||
MENU pop_menu, me_data;
|
||||
|
||||
pop = gemtk_obj_get_tree( POP_CTX );
|
||||
if (pop == NULL)
|
||||
return;
|
||||
ctx = get_context_info(gw, x, y);
|
||||
|
||||
/*
|
||||
Disable all items by default:
|
||||
*/
|
||||
for( choice = POP_FIRST_ITEM; choice<=POP_LAST_ITEM; choice++ ){
|
||||
SET_BIT(pop[ choice ].ob_state, OS_DISABLED, 1);
|
||||
}
|
||||
|
||||
if( ctx->flags & CNT_HREF ){
|
||||
SET_BIT(pop[ POP_CTX_COPY_LINK ].ob_state, OS_DISABLED, 0);
|
||||
SET_BIT(pop[ POP_CTX_OPEN_NEW ].ob_state, OS_DISABLED, 0);
|
||||
SET_BIT(pop[ POP_CTX_SAVE_LINK_AS ].ob_state, OS_DISABLED, 0);
|
||||
}
|
||||
|
||||
if( ctx->flags & CNT_IMG ){
|
||||
SET_BIT(pop[ POP_CTX_SAVE_AS ].ob_state, OS_DISABLED, 0);
|
||||
SET_BIT(pop[ POP_CTX_COPY_URL ].ob_state, OS_DISABLED, 0);
|
||||
SET_BIT(pop[ POP_CTX_OPEN_NEW ].ob_state, OS_DISABLED, 0);
|
||||
|
||||
if( ctx->flags & CNT_INTERACTIVE ){
|
||||
SET_BIT(pop[ POP_CTX_PASTE_SEL ].ob_state, OS_DISABLED, 0);
|
||||
}
|
||||
|
||||
if( (ctx->flags & CNT_BROWSER) ){
|
||||
SET_BIT(pop[ POP_CTX_SELECT_ALL ].ob_state, OS_DISABLED, 0);
|
||||
SET_BIT(pop[ POP_CTX_COPY_SEL ].ob_state, OS_DISABLED, 0);
|
||||
SET_BIT(pop[ POP_CTX_VIEW_SOURCE ].ob_state, OS_DISABLED, 0);
|
||||
}
|
||||
|
||||
if( ctx->flags & CNT_HREF ){
|
||||
SET_BIT(pop[ POP_CTX_COPY_LINK ].ob_state, OS_DISABLED, 0);
|
||||
SET_BIT(pop[ POP_CTX_OPEN_NEW ].ob_state, OS_DISABLED, 0);
|
||||
SET_BIT(pop[ POP_CTX_SAVE_LINK_AS ].ob_state, OS_DISABLED, 0);
|
||||
}
|
||||
|
||||
if( ctx->flags & CNT_IMG ){
|
||||
SET_BIT(pop[ POP_CTX_SAVE_AS ].ob_state, OS_DISABLED, 0);
|
||||
SET_BIT(pop[ POP_CTX_COPY_URL ].ob_state, OS_DISABLED, 0);
|
||||
SET_BIT(pop[ POP_CTX_OPEN_NEW ].ob_state, OS_DISABLED, 0);
|
||||
}
|
||||
|
||||
// point mn_tree tree to states popup:
|
||||
|
@ -208,121 +207,119 @@ void context_popup(struct gui_window * gw, short x, short y)
|
|||
pop_menu.mn_menu = 0;
|
||||
pop_menu.mn_item = POP_CTX_CUT_SEL;
|
||||
pop_menu.mn_scroll = SCROLL_NO;
|
||||
pop_menu.mn_keystate = 0;
|
||||
pop_menu.mn_keystate = 0;
|
||||
|
||||
menu_popup(&pop_menu, x, y, &me_data);
|
||||
choice = me_data.mn_item;
|
||||
choice = me_data.mn_item;
|
||||
|
||||
switch( choice ){
|
||||
case POP_CTX_COPY_SEL:
|
||||
browser_window_key_press(gw->browser->bw, KEY_COPY_SELECTION);
|
||||
break;
|
||||
|
||||
case POP_CTX_CUT_SEL:
|
||||
browser_window_key_press(gw->browser->bw, KEY_CUT_SELECTION);
|
||||
break;
|
||||
|
||||
switch( choice ){
|
||||
case POP_CTX_COPY_SEL:
|
||||
browser_window_key_press(gw->browser->bw, KEY_COPY_SELECTION);
|
||||
break;
|
||||
|
||||
case POP_CTX_CUT_SEL:
|
||||
browser_window_key_press(gw->browser->bw, KEY_CUT_SELECTION);
|
||||
break;
|
||||
|
||||
case POP_CTX_PASTE_SEL:
|
||||
browser_window_key_press(gw->browser->bw, KEY_PASTE);
|
||||
break;
|
||||
|
||||
case POP_CTX_SELECT_ALL:
|
||||
browser_window_key_press(gw->browser->bw, KEY_SELECT_ALL);
|
||||
break;
|
||||
|
||||
case POP_CTX_SAVE_AS:
|
||||
if (ctx->ccdata.object != NULL) {
|
||||
if( hlcache_handle_get_url(ctx->ccdata.object) != NULL ) {
|
||||
browser_window_navigate(
|
||||
gw->browser->bw,
|
||||
hlcache_handle_get_url(ctx->ccdata.object),
|
||||
hlcache_handle_get_url(gw->browser->bw->current_content),
|
||||
BROWSER_WINDOW_DOWNLOAD |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
case POP_CTX_SAVE_LINK_AS:
|
||||
if (ctx->ccdata.link_url != NULL) {
|
||||
nsurl *url;
|
||||
nserror error;
|
||||
browser_window_key_press(gw->browser->bw, KEY_PASTE);
|
||||
break;
|
||||
|
||||
error = nsurl_create(ctx->ccdata.link_url, &url);
|
||||
if (error == NSERROR_OK) {
|
||||
error = browser_window_navigate(
|
||||
gw->browser->bw,
|
||||
url,
|
||||
hlcache_handle_get_url(gw->browser->bw->current_content),
|
||||
BROWSER_WINDOW_DOWNLOAD |
|
||||
BROWSER_WINDOW_VERIFIABLE,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
nsurl_unref(url);
|
||||
}
|
||||
if (error != NSERROR_OK) {
|
||||
warn_user(messages_get_errorcode(error), 0);
|
||||
case POP_CTX_SELECT_ALL:
|
||||
browser_window_key_press(gw->browser->bw, KEY_SELECT_ALL);
|
||||
break;
|
||||
|
||||
case POP_CTX_SAVE_AS:
|
||||
if (ctx->ccdata.object != NULL) {
|
||||
if( hlcache_handle_get_url(ctx->ccdata.object) != NULL ) {
|
||||
browser_window_navigate(
|
||||
gw->browser->bw,
|
||||
hlcache_handle_get_url(ctx->ccdata.object),
|
||||
hlcache_handle_get_url(gw->browser->bw->current_content),
|
||||
BW_NAVIGATE_DOWNLOAD,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case POP_CTX_COPY_URL:
|
||||
if ((ctx->flags & CNT_IMG) && (ctx->ccdata.object != NULL)) {
|
||||
if( hlcache_handle_get_url(ctx->ccdata.object) != NULL ){
|
||||
scrap_txt_write((char*)nsurl_access(
|
||||
hlcache_handle_get_url(ctx->ccdata.object)));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case POP_CTX_COPY_LINK:
|
||||
if ((ctx->flags & CNT_HREF) && ctx->ccdata.link_url != NULL) {
|
||||
scrap_txt_write((char*)ctx->ccdata.link_url);
|
||||
}
|
||||
break;
|
||||
|
||||
case POP_CTX_OPEN_NEW:
|
||||
if ((ctx->flags & CNT_HREF) && ctx->ccdata.link_url) {
|
||||
}
|
||||
|
||||
case POP_CTX_SAVE_LINK_AS:
|
||||
if (ctx->ccdata.link_url != NULL) {
|
||||
nsurl *url;
|
||||
nserror error;
|
||||
|
||||
error = nsurl_create(ctx->ccdata.link_url, &url);
|
||||
if (error == NSERROR_OK) {
|
||||
error = browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY,
|
||||
error = browser_window_navigate(
|
||||
gw->browser->bw,
|
||||
url,
|
||||
hlcache_handle_get_url(gw->browser->bw->current_content),
|
||||
BW_NAVIGATE_DOWNLOAD,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
nsurl_unref(url);
|
||||
}
|
||||
if (error != NSERROR_OK) {
|
||||
warn_user(messages_get_errorcode(error), 0);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case POP_CTX_COPY_URL:
|
||||
if ((ctx->flags & CNT_IMG) && (ctx->ccdata.object != NULL)) {
|
||||
if( hlcache_handle_get_url(ctx->ccdata.object) != NULL ){
|
||||
scrap_txt_write((char*)nsurl_access(
|
||||
hlcache_handle_get_url(ctx->ccdata.object)));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case POP_CTX_COPY_LINK:
|
||||
if ((ctx->flags & CNT_HREF) && ctx->ccdata.link_url != NULL) {
|
||||
scrap_txt_write((char*)ctx->ccdata.link_url);
|
||||
}
|
||||
break;
|
||||
|
||||
case POP_CTX_OPEN_NEW:
|
||||
if ((ctx->flags & CNT_HREF) && ctx->ccdata.link_url) {
|
||||
nsurl *url;
|
||||
nserror error;
|
||||
|
||||
error = nsurl_create(ctx->ccdata.link_url, &url);
|
||||
if (error == NSERROR_OK) {
|
||||
error = browser_window_create(
|
||||
BW_CREATE_HISTORY | BW_CREATE_CLONE,
|
||||
url,
|
||||
hlcache_handle_get_url(gw->browser->bw->current_content),
|
||||
gw->browser->bw,
|
||||
hlcache_handle_get_url(gw->browser->bw->current_content),
|
||||
gw->browser->bw,
|
||||
NULL
|
||||
);
|
||||
);
|
||||
nsurl_unref(url);
|
||||
}
|
||||
if (error != NSERROR_OK) {
|
||||
warn_user(messages_get_errorcode(error), 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case POP_CTX_VIEW_SOURCE:
|
||||
editor = nsoption_charp(atari_editor);
|
||||
if (editor != NULL && strlen(editor)>0) {
|
||||
data = content_get_source_data(gw->browser->bw->current_content,
|
||||
}
|
||||
break;
|
||||
|
||||
case POP_CTX_VIEW_SOURCE:
|
||||
editor = nsoption_charp(atari_editor);
|
||||
if (editor != NULL && strlen(editor)>0) {
|
||||
data = content_get_source_data(gw->browser->bw->current_content,
|
||||
&size);
|
||||
if (size > 0 && data != NULL){
|
||||
snprintf(tempfile, 127, "%s", get_tmpfilename("ns-", ".html"));
|
||||
/* the GEMDOS cmdline contains the length of the commandline
|
||||
in the first byte: */
|
||||
cmdline[0] = (unsigned char)strlen(tempfile);
|
||||
LOG(("Creating temporay source file: %s\n", tempfile));
|
||||
fp_tmpfile = fopen(tempfile, "w");
|
||||
if (fp_tmpfile != NULL){
|
||||
fwrite(data, size, 1, fp_tmpfile);
|
||||
LOG(("Creating temporay source file: %s\n", tempfile));
|
||||
fp_tmpfile = fopen(tempfile, "w");
|
||||
if (fp_tmpfile != NULL){
|
||||
fwrite(data, size, 1, fp_tmpfile);
|
||||
fclose(fp_tmpfile);
|
||||
|
||||
// Send SH_WDRAW to notify files changed:
|
||||
|
@ -332,22 +329,22 @@ void context_popup(struct gui_window * gw, short x, short y)
|
|||
if(strlen(tempfile)<=125){
|
||||
shel_write(1, 1, 1, editor, cmdline);
|
||||
}
|
||||
} else {
|
||||
printf("Could not open temp file: %s!\n", tempfile );
|
||||
}
|
||||
|
||||
} else {
|
||||
LOG(("Invalid content!"));
|
||||
}
|
||||
} else {
|
||||
form_alert(0, "[1][Set option \"atari_editor\".][OK]");
|
||||
}
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
#undef POP_FIRST_ITEM
|
||||
#undef POP_LAST_ITEM
|
||||
|
||||
}
|
||||
} else {
|
||||
printf("Could not open temp file: %s!\n", tempfile );
|
||||
}
|
||||
|
||||
} else {
|
||||
LOG(("Invalid content!"));
|
||||
}
|
||||
} else {
|
||||
form_alert(0, "[1][Set option \"atari_editor\".][OK]");
|
||||
}
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
#undef POP_FIRST_ITEM
|
||||
#undef POP_LAST_ITEM
|
||||
|
||||
}
|
||||
|
|
637
atari/deskmenu.c
637
atari/deskmenu.c
|
@ -1,13 +1,30 @@
|
|||
/*
|
||||
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <cflib.h>
|
||||
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/url.h"
|
||||
#include "utils/messages.h"
|
||||
#include "desktop/browser.h"
|
||||
#include "desktop/browser_private.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "desktop/save_complete.h"
|
||||
#include "desktop/save_complete.h"
|
||||
#include "atari/res/netsurf.rsh"
|
||||
#include "atari/gemtk/gemtk.h"
|
||||
#include "atari/deskmenu.h"
|
||||
|
@ -27,19 +44,19 @@
|
|||
|
||||
typedef void __CDECL (*menu_evnt_func)(short item, short title, void * data);
|
||||
|
||||
struct s_accelerator
|
||||
{
|
||||
char ascii; /* either ascii or */
|
||||
long keycode; /* normalised keycode is valid */
|
||||
short mod; /* shift / ctrl etc */
|
||||
};
|
||||
struct s_accelerator
|
||||
{
|
||||
char ascii; /* either ascii or */
|
||||
long keycode; /* normalised keycode is valid */
|
||||
short mod; /* shift / ctrl etc */
|
||||
};
|
||||
|
||||
struct s_menu_item_evnt {
|
||||
short title; /* to which menu this item belongs */
|
||||
short rid; /* resource ID */
|
||||
menu_evnt_func menu_func; /* click handler */
|
||||
struct s_accelerator accel; /* accelerator info */
|
||||
char * menustr;
|
||||
struct s_menu_item_evnt {
|
||||
short title; /* to which menu this item belongs */
|
||||
short rid; /* resource ID */
|
||||
menu_evnt_func menu_func; /* click handler */
|
||||
struct s_accelerator accel; /* accelerator info */
|
||||
char * menustr;
|
||||
};
|
||||
|
||||
static void register_menu_str(struct s_menu_item_evnt * mi);
|
||||
|
@ -50,23 +67,23 @@ extern bool html_redraw_debug;
|
|||
extern struct gui_window * input_window;
|
||||
extern char options[PATH_MAX];
|
||||
extern const char * option_homepage_url;
|
||||
extern int option_window_width;
|
||||
extern int option_window_width;
|
||||
extern int option_window_height;
|
||||
extern int option_window_x;
|
||||
extern int option_window_y;
|
||||
|
||||
static OBJECT * h_gem_menu;
|
||||
|
||||
|
||||
/* Zero based resource tree ids: */
|
||||
#define T_ABOUT 0
|
||||
#define T_FILE MAINMENU_T_FILE - MAINMENU_T_FILE + 1
|
||||
#define T_EDIT MAINMENU_T_EDIT - MAINMENU_T_FILE + 1
|
||||
#define T_VIEW MAINMENU_T_VIEW - MAINMENU_T_FILE + 1
|
||||
#define T_NAV MAINMENU_T_NAVIGATE - MAINMENU_T_FILE + 1
|
||||
#define T_UTIL MAINMENU_T_UTIL - MAINMENU_T_FILE + 1
|
||||
#define T_HELP MAINMENU_T_NAVIGATE - MAINMENU_T_FILE + 1
|
||||
/* Count of the above defines: */
|
||||
|
||||
/* Zero based resource tree ids: */
|
||||
#define T_ABOUT 0
|
||||
#define T_FILE MAINMENU_T_FILE - MAINMENU_T_FILE + 1
|
||||
#define T_EDIT MAINMENU_T_EDIT - MAINMENU_T_FILE + 1
|
||||
#define T_VIEW MAINMENU_T_VIEW - MAINMENU_T_FILE + 1
|
||||
#define T_NAV MAINMENU_T_NAVIGATE - MAINMENU_T_FILE + 1
|
||||
#define T_UTIL MAINMENU_T_UTIL - MAINMENU_T_FILE + 1
|
||||
#define T_HELP MAINMENU_T_NAVIGATE - MAINMENU_T_FILE + 1
|
||||
/* Count of the above defines: */
|
||||
#define NUM_MENU_TITLES 7
|
||||
|
||||
|
||||
|
@ -102,50 +119,50 @@ static void __CDECL menu_cookies(short item, short title, void *data);
|
|||
static void __CDECL menu_vlog(short item, short title, void *data);
|
||||
static void __CDECL menu_help_content(short item, short title, void *data);
|
||||
|
||||
struct s_menu_item_evnt menu_evnt_tbl[] =
|
||||
{
|
||||
{T_ABOUT,MAINMENU_M_ABOUT, menu_about, {0,0,0}, NULL },
|
||||
{T_FILE, MAINMENU_M_NEWWIN, menu_new_win, {0,0,0}, NULL},
|
||||
{T_FILE, MAINMENU_M_OPENURL, menu_open_url, {'G',0,K_CTRL}, NULL},
|
||||
{T_FILE, MAINMENU_M_OPENFILE, menu_open_file, {'O',0,K_CTRL}, NULL},
|
||||
{T_FILE, MAINMENU_M_CLOSEWIN, menu_close_win, {0,0,0}, NULL},
|
||||
{T_FILE, MAINMENU_M_SAVEPAGE, menu_save_page, {0,NK_F3,0}, NULL},
|
||||
{T_FILE, MAINMENU_M_QUIT, menu_quit, {'Q',0,K_CTRL}, NULL},
|
||||
{T_EDIT, MAINMENU_M_CUT, menu_cut, {'X',0,K_CTRL}, NULL},
|
||||
{T_EDIT, MAINMENU_M_COPY, menu_copy, {'C',0,K_CTRL}, NULL},
|
||||
{T_EDIT, MAINMENU_M_PASTE, menu_paste, {'V',0,K_CTRL}, NULL},
|
||||
{T_EDIT, MAINMENU_M_FIND, menu_find, {0,NK_F4,0}, NULL},
|
||||
struct s_menu_item_evnt menu_evnt_tbl[] =
|
||||
{
|
||||
{T_ABOUT,MAINMENU_M_ABOUT, menu_about, {0,0,0}, NULL },
|
||||
{T_FILE, MAINMENU_M_NEWWIN, menu_new_win, {0,0,0}, NULL},
|
||||
{T_FILE, MAINMENU_M_OPENURL, menu_open_url, {'G',0,K_CTRL}, NULL},
|
||||
{T_FILE, MAINMENU_M_OPENFILE, menu_open_file, {'O',0,K_CTRL}, NULL},
|
||||
{T_FILE, MAINMENU_M_CLOSEWIN, menu_close_win, {0,0,0}, NULL},
|
||||
{T_FILE, MAINMENU_M_SAVEPAGE, menu_save_page, {0,NK_F3,0}, NULL},
|
||||
{T_FILE, MAINMENU_M_QUIT, menu_quit, {'Q',0,K_CTRL}, NULL},
|
||||
{T_EDIT, MAINMENU_M_CUT, menu_cut, {'X',0,K_CTRL}, NULL},
|
||||
{T_EDIT, MAINMENU_M_COPY, menu_copy, {'C',0,K_CTRL}, NULL},
|
||||
{T_EDIT, MAINMENU_M_PASTE, menu_paste, {'V',0,K_CTRL}, NULL},
|
||||
{T_EDIT, MAINMENU_M_FIND, menu_find, {0,NK_F4,0}, NULL},
|
||||
{T_VIEW, MAINMENU_M_RELOAD, menu_reload, {0,NK_F5,0}, NULL},
|
||||
{T_VIEW, MAINMENU_INC_SCALE, menu_inc_scale, {'+',0,K_CTRL}, NULL},
|
||||
{T_VIEW, MAINMENU_DEC_SCALE, menu_dec_scale, {'-',0,K_CTRL}, NULL},
|
||||
{T_VIEW, MAINMENU_M_TOOLBARS, menu_toolbars, {0,NK_F1,K_CTRL}, NULL},
|
||||
{T_VIEW, MAINMENU_M_SAVEWIN, menu_savewin, {0,0,0}, NULL},
|
||||
{T_VIEW, MAINMENU_DEC_SCALE, menu_dec_scale, {'-',0,K_CTRL}, NULL},
|
||||
{T_VIEW, MAINMENU_M_TOOLBARS, menu_toolbars, {0,NK_F1,K_CTRL}, NULL},
|
||||
{T_VIEW, MAINMENU_M_SAVEWIN, menu_savewin, {0,0,0}, NULL},
|
||||
{T_VIEW, MAINMENU_M_DEBUG_RENDER, menu_debug_render, {0,0,0}, NULL},
|
||||
{T_VIEW, MAINMENU_M_FG_IMAGES, menu_fg_images, {0,0,0}, NULL},
|
||||
{T_VIEW, MAINMENU_M_BG_IMAGES, menu_bg_images, {0,0,0}, NULL},
|
||||
{T_VIEW, MAINMENU_M_STOP, menu_stop, {0,NK_ESC,K_ALT}, NULL},
|
||||
{T_NAV, MAINMENU_M_BACK, menu_back, {0,NK_LEFT,K_ALT}, NULL},
|
||||
{T_NAV, MAINMENU_M_FORWARD, menu_forward, {0,NK_RIGHT,K_ALT}, NULL},
|
||||
{T_NAV, MAINMENU_M_HOME, menu_home, {0,0,0}, NULL},
|
||||
{T_UTIL, MAINMENU_M_LHISTORY,menu_lhistory, {0,NK_F7,0}, NULL},
|
||||
{T_UTIL, MAINMENU_M_GHISTORY, menu_ghistory, {0,NK_F7,K_CTRL}, NULL},
|
||||
{T_UTIL, MAINMENU_M_ADD_BOOKMARK, menu_add_bookmark, {'D',0,K_CTRL}, NULL},
|
||||
{T_VIEW, MAINMENU_M_BG_IMAGES, menu_bg_images, {0,0,0}, NULL},
|
||||
{T_VIEW, MAINMENU_M_STOP, menu_stop, {0,NK_ESC,K_ALT}, NULL},
|
||||
{T_NAV, MAINMENU_M_BACK, menu_back, {0,NK_LEFT,K_ALT}, NULL},
|
||||
{T_NAV, MAINMENU_M_FORWARD, menu_forward, {0,NK_RIGHT,K_ALT}, NULL},
|
||||
{T_NAV, MAINMENU_M_HOME, menu_home, {0,0,0}, NULL},
|
||||
{T_UTIL, MAINMENU_M_LHISTORY,menu_lhistory, {0,NK_F7,0}, NULL},
|
||||
{T_UTIL, MAINMENU_M_GHISTORY, menu_ghistory, {0,NK_F7,K_CTRL}, NULL},
|
||||
{T_UTIL, MAINMENU_M_ADD_BOOKMARK, menu_add_bookmark, {'D',0,K_CTRL}, NULL},
|
||||
{T_UTIL, MAINMENU_M_BOOKMARKS, menu_bookmarks, {0,NK_F6,0}, NULL},
|
||||
{T_UTIL, MAINMENU_M_COOKIES, menu_cookies, {0,0,0}, NULL},
|
||||
{T_UTIL, MAINMENU_M_CHOICES, menu_choices, {0,0,0}, NULL},
|
||||
{T_UTIL, MAINMENU_M_VLOG, menu_vlog, {'V',0,K_ALT}, NULL},
|
||||
{T_HELP, MAINMENU_M_HELP_CONTENT, menu_help_content, {0,NK_F1,0}, NULL},
|
||||
{-1, -1, NULL,{0,0,0}, NULL }
|
||||
{T_UTIL, MAINMENU_M_COOKIES, menu_cookies, {0,0,0}, NULL},
|
||||
{T_UTIL, MAINMENU_M_CHOICES, menu_choices, {0,0,0}, NULL},
|
||||
{T_UTIL, MAINMENU_M_VLOG, menu_vlog, {'V',0,K_ALT}, NULL},
|
||||
{T_HELP, MAINMENU_M_HELP_CONTENT, menu_help_content, {0,NK_F1,0}, NULL},
|
||||
{-1, -1, NULL,{0,0,0}, NULL }
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
static void __CDECL evnt_menu(WINDOW * win, short buff[8])
|
||||
{
|
||||
int title = buff[3];
|
||||
INT16 x,y;
|
||||
char *str;
|
||||
struct gui_window * gw = window_list;
|
||||
static void __CDECL evnt_menu(WINDOW * win, short buff[8])
|
||||
{
|
||||
int title = buff[3];
|
||||
INT16 x,y;
|
||||
char *str;
|
||||
struct gui_window * gw = window_list;
|
||||
int i=0;
|
||||
|
||||
deskmenu_dispatch_item(buff[3], buff[4]);
|
||||
|
@ -155,23 +172,22 @@ static void __CDECL evnt_menu(WINDOW * win, short buff[8])
|
|||
/*
|
||||
Menu item event handlers:
|
||||
*/
|
||||
|
||||
static void __CDECL menu_about(short item, short title, void *data)
|
||||
|
||||
static void __CDECL menu_about(short item, short title, void *data)
|
||||
{
|
||||
/*
|
||||
/*
|
||||
nsurl *url;
|
||||
nserror error;
|
||||
char buf[PATH_MAX];
|
||||
char buf[PATH_MAX];
|
||||
|
||||
LOG(("%s", __FUNCTION__));
|
||||
strcpy((char*)&buf, "file://");
|
||||
LOG(("%s", __FUNCTION__));
|
||||
strcpy((char*)&buf, "file://");
|
||||
strncat((char*)&buf, (char*)"./doc/README.TXT",
|
||||
PATH_MAX - (strlen("file://")+1) );
|
||||
PATH_MAX - (strlen("file://")+1) );
|
||||
|
||||
error = nsurl_create(buf, &url);
|
||||
if (error == NSERROR_OK) {
|
||||
error = browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY,
|
||||
error = browser_window_create(BW_CREATE_HISTORY,
|
||||
url,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -183,15 +199,15 @@ static void __CDECL menu_about(short item, short title, void *data)
|
|||
}
|
||||
*/
|
||||
atari_about_show();
|
||||
}
|
||||
|
||||
static void __CDECL menu_new_win(short item, short title, void *data)
|
||||
{
|
||||
}
|
||||
|
||||
static void __CDECL menu_new_win(short item, short title, void *data)
|
||||
{
|
||||
nsurl *url;
|
||||
nserror error;
|
||||
const char *addr;
|
||||
|
||||
LOG(("%s", __FUNCTION__));
|
||||
LOG(("%s", __FUNCTION__));
|
||||
|
||||
if (nsoption_charp(homepage_url) != NULL) {
|
||||
addr = nsoption_charp(homepage_url);
|
||||
|
@ -202,8 +218,7 @@ static void __CDECL menu_new_win(short item, short title, void *data)
|
|||
/* create an initial browser window */
|
||||
error = nsurl_create(addr, &url);
|
||||
if (error == NSERROR_OK) {
|
||||
error = browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY,
|
||||
error = browser_window_create(BW_CREATE_HISTORY,
|
||||
url,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -214,18 +229,17 @@ static void __CDECL menu_new_win(short item, short title, void *data)
|
|||
if (error != NSERROR_OK) {
|
||||
warn_user(messages_get_errorcode(error), 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void __CDECL menu_open_url(short item, short title, void *data)
|
||||
{
|
||||
struct gui_window * gw;
|
||||
struct browser_window * bw ;
|
||||
}
|
||||
|
||||
static void __CDECL menu_open_url(short item, short title, void *data)
|
||||
{
|
||||
struct gui_window * gw;
|
||||
struct browser_window * bw ;
|
||||
LOG(("%s", __FUNCTION__));
|
||||
|
||||
gw = input_window;
|
||||
if( gw == NULL ) {
|
||||
browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY,
|
||||
|
||||
gw = input_window;
|
||||
if( gw == NULL ) {
|
||||
browser_window_create(BW_CREATE_HISTORY,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -239,12 +253,12 @@ static void __CDECL menu_open_url(short item, short title, void *data)
|
|||
window_set_focus(gw->root, URL_WIDGET, NULL);
|
||||
|
||||
/* delete selection: */
|
||||
toolbar_key_input(gw->root->toolbar, NK_DEL);
|
||||
}
|
||||
|
||||
static void __CDECL menu_open_file(short item, short title, void *data)
|
||||
toolbar_key_input(gw->root->toolbar, NK_DEL);
|
||||
}
|
||||
|
||||
static void __CDECL menu_open_file(short item, short title, void *data)
|
||||
{
|
||||
|
||||
|
||||
LOG(("%s", __FUNCTION__));
|
||||
|
||||
const char * filename = file_select(messages_get("OpenFile"), "");
|
||||
|
@ -256,8 +270,7 @@ static void __CDECL menu_open_file(short item, short title, void *data)
|
|||
|
||||
error = nsurl_create(urltxt, &url);
|
||||
if (error == NSERROR_OK) {
|
||||
error = browser_window_create(BROWSER_WINDOW_VERIFIABLE |
|
||||
BROWSER_WINDOW_HISTORY,
|
||||
error = browser_window_create(BW_CREATE_HISTORY,
|
||||
url,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -271,18 +284,18 @@ static void __CDECL menu_open_file(short item, short title, void *data)
|
|||
free( urltxt );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void __CDECL menu_close_win(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window == NULL )
|
||||
return;
|
||||
gui_window_destroy( input_window );
|
||||
}
|
||||
|
||||
static void __CDECL menu_save_page(short item, short title, void *data)
|
||||
{
|
||||
}
|
||||
|
||||
static void __CDECL menu_close_win(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window == NULL )
|
||||
return;
|
||||
gui_window_destroy( input_window );
|
||||
}
|
||||
|
||||
static void __CDECL menu_save_page(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
static bool init = true;
|
||||
bool is_folder=false;
|
||||
|
@ -306,41 +319,40 @@ static void __CDECL menu_save_page(short item, short title, void *data)
|
|||
if( path != NULL ){
|
||||
save_complete(input_window->browser->bw->current_content, path, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void __CDECL menu_quit(short item, short title, void *data)
|
||||
{
|
||||
short buff[8];
|
||||
memset( &buff, 0, sizeof(short)*8 );
|
||||
LOG(("%s", __FUNCTION__));
|
||||
gemtk_wm_send_msg(NULL, AP_TERM, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
static void __CDECL menu_cut(short item, short title, void *data)
|
||||
{
|
||||
if( input_window != NULL )
|
||||
browser_window_key_press( input_window->browser->bw, KEY_CUT_SELECTION);
|
||||
}
|
||||
|
||||
static void __CDECL menu_copy(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window != NULL )
|
||||
browser_window_key_press( input_window->browser->bw, KEY_COPY_SELECTION);
|
||||
}
|
||||
|
||||
static void __CDECL menu_paste(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window != NULL )
|
||||
browser_window_key_press( input_window->browser->bw, KEY_PASTE);
|
||||
}
|
||||
|
||||
static void __CDECL menu_find(short item, short title, void *data)
|
||||
|
||||
}
|
||||
|
||||
static void __CDECL menu_quit(short item, short title, void *data)
|
||||
{
|
||||
static bool visible = false;
|
||||
LOG(("%s", __FUNCTION__));
|
||||
short buff[8];
|
||||
memset( &buff, 0, sizeof(short)*8 );
|
||||
LOG(("%s", __FUNCTION__));
|
||||
gemtk_wm_send_msg(NULL, AP_TERM, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
static void __CDECL menu_cut(short item, short title, void *data)
|
||||
{
|
||||
if( input_window != NULL )
|
||||
browser_window_key_press( input_window->browser->bw, KEY_CUT_SELECTION);
|
||||
}
|
||||
|
||||
static void __CDECL menu_copy(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window != NULL )
|
||||
browser_window_key_press( input_window->browser->bw, KEY_COPY_SELECTION);
|
||||
}
|
||||
|
||||
static void __CDECL menu_paste(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window != NULL )
|
||||
browser_window_key_press( input_window->browser->bw, KEY_PASTE);
|
||||
}
|
||||
|
||||
static void __CDECL menu_find(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if (input_window != NULL) {
|
||||
if (input_window->search) {
|
||||
window_close_search(input_window->root);
|
||||
|
@ -348,72 +360,76 @@ static void __CDECL menu_find(short item, short title, void *data)
|
|||
else {
|
||||
window_open_search(input_window->root, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void __CDECL menu_choices(short item, short title, void *data)
|
||||
}
|
||||
}
|
||||
|
||||
static void __CDECL menu_choices(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
open_settings();
|
||||
}
|
||||
|
||||
static void __CDECL menu_stop(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window == NULL )
|
||||
open_settings();
|
||||
}
|
||||
|
||||
static void __CDECL menu_stop(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window == NULL )
|
||||
return;
|
||||
|
||||
assert(input_window && input_window->root);
|
||||
toolbar_stop_click(input_window->root->toolbar);
|
||||
|
||||
}
|
||||
|
||||
static void __CDECL menu_reload(short item, short title, void *data)
|
||||
{
|
||||
if(input_window == NULL)
|
||||
return;
|
||||
toolbar_reload_click(input_window->root->toolbar);
|
||||
LOG(("%s", __FUNCTION__));
|
||||
assert(input_window && input_window->root);
|
||||
toolbar_stop_click(input_window->root->toolbar);
|
||||
|
||||
}
|
||||
|
||||
static void __CDECL menu_reload(short item, short title, void *data)
|
||||
{
|
||||
if(input_window == NULL)
|
||||
return;
|
||||
toolbar_reload_click(input_window->root->toolbar);
|
||||
LOG(("%s", __FUNCTION__));
|
||||
}
|
||||
|
||||
|
||||
static void __CDECL menu_inc_scale(short item, short title, void *data)
|
||||
static void __CDECL menu_inc_scale(short item, short title, void *data)
|
||||
{
|
||||
if(input_window == NULL)
|
||||
return;
|
||||
|
||||
gui_window_set_scale(input_window, gui_window_get_scale(input_window)+0.25);
|
||||
}
|
||||
|
||||
|
||||
static void __CDECL menu_dec_scale(short item, short title, void *data)
|
||||
{
|
||||
if(input_window == NULL)
|
||||
if(input_window == NULL)
|
||||
return;
|
||||
|
||||
gui_window_set_scale(input_window, gui_window_get_scale(input_window)-0.25);
|
||||
browser_window_set_scale(input_window->browser->bw,
|
||||
browser_window_get_scale(input_window->browser->bw) + 0.25,
|
||||
true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void __CDECL menu_toolbars(short item, short title, void *data)
|
||||
|
||||
static void __CDECL menu_dec_scale(short item, short title, void *data)
|
||||
{
|
||||
static int state = 0;
|
||||
if(input_window == NULL)
|
||||
return;
|
||||
|
||||
browser_window_set_scale(input_window->browser->bw,
|
||||
browser_window_get_scale(input_window->browser->bw) - 0.25,
|
||||
true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void __CDECL menu_toolbars(short item, short title, void *data)
|
||||
{
|
||||
static int state = 0;
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window != null && input_window->root->toolbar != null ){
|
||||
state = !state;
|
||||
// TODO: implement toolbar hide
|
||||
//toolbar_hide(input_window->root->toolbar, state );
|
||||
}
|
||||
}
|
||||
|
||||
static void __CDECL menu_savewin(short item, short title, void *data)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
static void __CDECL menu_savewin(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if (input_window && input_window->browser) {
|
||||
GRECT rect;
|
||||
wind_get_grect(gemtk_wm_get_handle(input_window->root->win), WF_CURRXYWH,
|
||||
&rect);
|
||||
&rect);
|
||||
option_window_width = rect.g_w;
|
||||
option_window_height = rect.g_h;
|
||||
option_window_x = rect.g_x;
|
||||
|
@ -424,112 +440,112 @@ static void __CDECL menu_savewin(short item, short title, void *data)
|
|||
nsoption_set_int(window_y, rect.g_y);
|
||||
nsoption_write((const char*)&options, NULL, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void __CDECL menu_debug_render(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
html_redraw_debug = !html_redraw_debug;
|
||||
if( input_window != NULL ) {
|
||||
|
||||
}
|
||||
|
||||
static void __CDECL menu_debug_render(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
html_redraw_debug = !html_redraw_debug;
|
||||
if( input_window != NULL ) {
|
||||
if ( input_window->browser != NULL
|
||||
&& input_window->browser->bw != NULL) {
|
||||
&& input_window->browser->bw != NULL) {
|
||||
GRECT rect;
|
||||
window_get_grect(input_window->root, BROWSER_AREA_CONTENT, &rect);
|
||||
window_get_grect(input_window->root, BROWSER_AREA_CONTENT, &rect);
|
||||
browser_window_reformat(input_window->browser->bw, false,
|
||||
rect.g_w, rect.g_h );
|
||||
menu_icheck(h_gem_menu, MAINMENU_M_DEBUG_RENDER,
|
||||
(html_redraw_debug) ? 1 : 0);
|
||||
}
|
||||
}
|
||||
(html_redraw_debug) ? 1 : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void __CDECL menu_fg_images(short item, short title, void *data)
|
||||
{
|
||||
static void __CDECL menu_fg_images(short item, short title, void *data)
|
||||
{
|
||||
nsoption_set_bool(foreground_images, !nsoption_bool(foreground_images));
|
||||
menu_icheck(h_gem_menu, MAINMENU_M_FG_IMAGES,
|
||||
(nsoption_bool(foreground_images)) ? 1 : 0);
|
||||
(nsoption_bool(foreground_images)) ? 1 : 0);
|
||||
}
|
||||
|
||||
static void __CDECL menu_bg_images(short item, short title, void *data)
|
||||
{
|
||||
static void __CDECL menu_bg_images(short item, short title, void *data)
|
||||
{
|
||||
nsoption_set_bool(background_images, !nsoption_bool(background_images));
|
||||
menu_icheck(h_gem_menu, MAINMENU_M_BG_IMAGES,
|
||||
(nsoption_bool(background_images)) ? 1 : 0);
|
||||
(nsoption_bool(background_images)) ? 1 : 0);
|
||||
}
|
||||
|
||||
static void __CDECL menu_back(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window == NULL )
|
||||
return;
|
||||
toolbar_back_click(input_window->root->toolbar);
|
||||
}
|
||||
|
||||
static void __CDECL menu_forward(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window == NULL )
|
||||
return;
|
||||
toolbar_forward_click(input_window->root->toolbar);
|
||||
}
|
||||
|
||||
static void __CDECL menu_home(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window == NULL )
|
||||
return;
|
||||
toolbar_home_click(input_window->root->toolbar);
|
||||
}
|
||||
|
||||
static void __CDECL menu_lhistory(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window == NULL )
|
||||
return;
|
||||
}
|
||||
|
||||
static void __CDECL menu_ghistory(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
atari_global_history_open();
|
||||
}
|
||||
|
||||
static void __CDECL menu_add_bookmark(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if (input_window) {
|
||||
if( input_window->browser->bw->current_content != NULL ){
|
||||
atari_hotlist_add_page(
|
||||
nsurl_access(hlcache_handle_get_url(input_window->browser->bw->current_content)),
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void __CDECL menu_bookmarks(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
atari_hotlist_open();
|
||||
static void __CDECL menu_back(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window == NULL )
|
||||
return;
|
||||
toolbar_back_click(input_window->root->toolbar);
|
||||
}
|
||||
|
||||
static void __CDECL menu_cookies(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
atari_cookie_manager_open();
|
||||
}
|
||||
|
||||
static void __CDECL menu_vlog(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
static void __CDECL menu_forward(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window == NULL )
|
||||
return;
|
||||
toolbar_forward_click(input_window->root->toolbar);
|
||||
}
|
||||
|
||||
static void __CDECL menu_home(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window == NULL )
|
||||
return;
|
||||
toolbar_home_click(input_window->root->toolbar);
|
||||
}
|
||||
|
||||
static void __CDECL menu_lhistory(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if( input_window == NULL )
|
||||
return;
|
||||
}
|
||||
|
||||
static void __CDECL menu_ghistory(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
atari_global_history_open();
|
||||
}
|
||||
|
||||
static void __CDECL menu_add_bookmark(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
if (input_window) {
|
||||
if( input_window->browser->bw->current_content != NULL ){
|
||||
atari_hotlist_add_page(
|
||||
nsurl_access(hlcache_handle_get_url(input_window->browser->bw->current_content)),
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void __CDECL menu_bookmarks(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
atari_hotlist_open();
|
||||
}
|
||||
|
||||
static void __CDECL menu_cookies(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
atari_cookie_manager_open();
|
||||
}
|
||||
|
||||
static void __CDECL menu_vlog(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
verbose_log = !verbose_log;
|
||||
menu_icheck(h_gem_menu, MAINMENU_M_VLOG, (verbose_log) ? 1 : 0);
|
||||
}
|
||||
|
||||
static void __CDECL menu_help_content(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
menu_icheck(h_gem_menu, MAINMENU_M_VLOG, (verbose_log) ? 1 : 0);
|
||||
}
|
||||
|
||||
static void __CDECL menu_help_content(short item, short title, void *data)
|
||||
{
|
||||
LOG(("%s", __FUNCTION__));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -618,7 +634,6 @@ static void register_menu_str( struct s_menu_item_evnt * mi )
|
|||
// find keycodes / chracters:
|
||||
if( str[x] <= 28 ){
|
||||
// parse symbol
|
||||
unsigned short keycode=0;
|
||||
switch( str[x] ){
|
||||
case 0x03:
|
||||
accel->keycode = NK_RIGHT;
|
||||
|
@ -674,8 +689,8 @@ void deskmenu_init(void)
|
|||
/* Install menu: */
|
||||
menu_bar(h_gem_menu, MENU_INSTALL);
|
||||
|
||||
/* parse and update menu items: */
|
||||
i = 0;
|
||||
/* parse and update menu items: */
|
||||
i = 0;
|
||||
while (menu_evnt_tbl[i].rid != -1) {
|
||||
if(menu_evnt_tbl[i].rid > 0 && menu_evnt_tbl[i].title > 0){
|
||||
register_menu_str( &menu_evnt_tbl[i] );
|
||||
|
@ -685,7 +700,7 @@ void deskmenu_init(void)
|
|||
menu_evnt_tbl[i].menustr);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
i++;
|
||||
}
|
||||
deskmenu_update();
|
||||
/* Redraw menu: */
|
||||
|
@ -700,14 +715,14 @@ void deskmenu_destroy(void)
|
|||
int i;
|
||||
|
||||
/* Remove menu from desktop: */
|
||||
menu_bar(h_gem_menu, MENU_REMOVE);
|
||||
menu_bar(h_gem_menu, MENU_REMOVE);
|
||||
|
||||
/* Free modified menu titles: */
|
||||
i=0;
|
||||
while(menu_evnt_tbl[i].rid != -1) {
|
||||
if( menu_evnt_tbl[i].menustr != NULL )
|
||||
free(menu_evnt_tbl[i].menustr);
|
||||
i++;
|
||||
i=0;
|
||||
while(menu_evnt_tbl[i].rid != -1) {
|
||||
if( menu_evnt_tbl[i].menustr != NULL )
|
||||
free(menu_evnt_tbl[i].menustr);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -734,21 +749,21 @@ int deskmenu_dispatch_item(short title, short item)
|
|||
|
||||
// legacy code, is this sensible?:
|
||||
/*
|
||||
while( gw ) {
|
||||
window_set_focus( gw, WIDGET_NONE, NULL );
|
||||
gw = gw->next;
|
||||
while( gw ) {
|
||||
window_set_focus( gw, WIDGET_NONE, NULL );
|
||||
gw = gw->next;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
while (menu_evnt_tbl[i].rid != -1) {
|
||||
while (menu_evnt_tbl[i].rid != -1) {
|
||||
if (menu_evnt_tbl[i].rid == item) {
|
||||
if (menu_evnt_tbl[i].menu_func != NULL) {
|
||||
if (menu_evnt_tbl[i].menu_func != NULL) {
|
||||
menu_evnt_tbl[i].menu_func(item, title, NULL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return(retval);
|
||||
|
@ -769,10 +784,10 @@ int deskmenu_dispatch_keypress(unsigned short kcode, unsigned short kstate,
|
|||
sascii = gemtk_keybd2ascii(kcode, K_LSHIFT);
|
||||
}
|
||||
|
||||
/* Iterate through the menu function table: */
|
||||
while( menu_evnt_tbl[i].rid != -1 && done == false) {
|
||||
/* Iterate through the menu function table: */
|
||||
while( menu_evnt_tbl[i].rid != -1 && done == false) {
|
||||
if( kstate == menu_evnt_tbl[i].accel.mod
|
||||
&& menu_evnt_tbl[i].accel.ascii != 0) {
|
||||
&& menu_evnt_tbl[i].accel.ascii != 0) {
|
||||
if( menu_evnt_tbl[i].accel.ascii == sascii) {
|
||||
if (menu_evnt_tbl[i].title > 0 && menu_evnt_tbl[i].rid > 0) {
|
||||
deskmenu_dispatch_item(menu_evnt_tbl[i].title,
|
||||
|
@ -781,15 +796,15 @@ int deskmenu_dispatch_keypress(unsigned short kcode, unsigned short kstate,
|
|||
else {
|
||||
/* Keyboard shortcut not displayed within menu: */
|
||||
menu_evnt_tbl[i].menu_func(0, 0, NULL);
|
||||
}
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* the accel code hides in the keycode: */
|
||||
if( menu_evnt_tbl[i].accel.keycode != 0) {
|
||||
if( menu_evnt_tbl[i].accel.keycode == (nkc & 0xFF) &&
|
||||
kstate == menu_evnt_tbl[i].accel.mod) {
|
||||
}
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* the accel code hides in the keycode: */
|
||||
if( menu_evnt_tbl[i].accel.keycode != 0) {
|
||||
if( menu_evnt_tbl[i].accel.keycode == (nkc & 0xFF) &&
|
||||
kstate == menu_evnt_tbl[i].accel.mod) {
|
||||
if (menu_evnt_tbl[i].title > 0 && menu_evnt_tbl[i].rid > 0) {
|
||||
deskmenu_dispatch_item(menu_evnt_tbl[i].title,
|
||||
menu_evnt_tbl[i].rid);
|
||||
|
@ -797,13 +812,13 @@ int deskmenu_dispatch_keypress(unsigned short kcode, unsigned short kstate,
|
|||
else {
|
||||
/* Keyboard shortcut not displayed within menu: */
|
||||
menu_evnt_tbl[i].menu_func(0, 0, NULL);
|
||||
}
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return((done==true) ? 1 : 0);
|
||||
}
|
||||
|
|
422
atari/download.c
422
atari/download.c
|
@ -1,49 +1,47 @@
|
|||
/*
|
||||
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
/*
|
||||
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "content/urldb.h"
|
||||
#include "content/fetch.h"
|
||||
#include "desktop/gui.h"
|
||||
#include "desktop/local_history.h"
|
||||
#include "desktop/netsurf.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "desktop/save_complete.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "desktop/download.h"
|
||||
#include "render/html.h"
|
||||
#include "utils/url.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "atari/gui.h"
|
||||
#include "atari/misc.h"
|
||||
#include "atari/res/netsurf.rsh"
|
||||
#include "atari/download.h"
|
||||
#include "atari/osspec.h"
|
||||
|
||||
#include "content/urldb.h"
|
||||
#include "content/fetch.h"
|
||||
#include "desktop/gui.h"
|
||||
#include "desktop/netsurf.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "desktop/save_complete.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "desktop/download.h"
|
||||
#include "render/html.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "atari/gui.h"
|
||||
#include "atari/misc.h"
|
||||
#include "atari/res/netsurf.rsh"
|
||||
#include "atari/download.h"
|
||||
#include "atari/osspec.h"
|
||||
|
||||
extern struct gui_window * input_window;
|
||||
extern GRECT desk_area;
|
||||
|
@ -124,7 +122,7 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
|
|||
}
|
||||
|
||||
return(retval);
|
||||
}
|
||||
}
|
||||
|
||||
static void on_redraw(struct gui_download_window *dw, GRECT *clip)
|
||||
{
|
||||
|
@ -148,8 +146,8 @@ static void on_redraw(struct gui_download_window *dw, GRECT *clip)
|
|||
((TEDINFO *)get_obspec(tree, DOWNLOAD_LBL_PERCENT))->te_ptext = dw->lbl_percent;
|
||||
((TEDINFO *)get_obspec(tree, DOWNLOAD_LBL_SPEED))->te_ptext = dw->lbl_speed;
|
||||
|
||||
if (dw->size_total > 0 ) {
|
||||
p = ((double)dw->size_downloaded / (double)dw->size_total * 100);
|
||||
if (dw->size_total > 0 ) {
|
||||
p = ((double)dw->size_downloaded / (double)dw->size_total * 100);
|
||||
}
|
||||
tree[DOWNLOAD_PROGRESS_DONE].ob_width = MAX( MIN( p*(DOWNLOAD_BAR_MAX/100),
|
||||
DOWNLOAD_BAR_MAX ), 1);
|
||||
|
@ -169,58 +167,58 @@ static void on_redraw(struct gui_download_window *dw, GRECT *clip)
|
|||
wind_get_grect(dw->aes_handle, WF_NEXTXYWH, &visible);
|
||||
}
|
||||
}
|
||||
|
||||
static void on_abort_click(struct gui_download_window *dw)
|
||||
{
|
||||
|
||||
static void on_abort_click(struct gui_download_window *dw)
|
||||
{
|
||||
if( dw->status == NSATARI_DOWNLOAD_COMPLETE
|
||||
|| dw->status == NSATARI_DOWNLOAD_ERROR ) {
|
||||
gemtk_wm_send_msg(dw->guiwin, WM_CLOSED, 0,0,0,0);
|
||||
}
|
||||
else if( dw->status != NSATARI_DOWNLOAD_CANCELED ){
|
||||
dw->abort = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void on_cbrdy_click(struct gui_download_window *dw)
|
||||
}
|
||||
else if( dw->status != NSATARI_DOWNLOAD_CANCELED ){
|
||||
dw->abort = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void on_cbrdy_click(struct gui_download_window *dw)
|
||||
{
|
||||
dw->close_on_finish = !dw->close_on_finish;
|
||||
dw->close_on_finish = !dw->close_on_finish;
|
||||
if (dw->close_on_finish && dw->status == NSATARI_DOWNLOAD_COMPLETE) {
|
||||
gemtk_wm_send_msg(dw->guiwin, WM_CLOSED, 0,0,0,0);
|
||||
}
|
||||
gemtk_wm_exec_redraw(dw->guiwin, NULL);
|
||||
evnt_timer(250);
|
||||
}
|
||||
|
||||
static void on_close(struct gui_download_window * dw)
|
||||
{
|
||||
gui_download_window_destroy(dw);
|
||||
}
|
||||
|
||||
static void gui_download_window_destroy( struct gui_download_window * gdw)
|
||||
{
|
||||
evnt_timer(250);
|
||||
}
|
||||
|
||||
static void on_close(struct gui_download_window * dw)
|
||||
{
|
||||
gui_download_window_destroy(dw);
|
||||
}
|
||||
|
||||
static void gui_download_window_destroy( struct gui_download_window * gdw)
|
||||
{
|
||||
|
||||
|
||||
LOG((""));
|
||||
if (gdw->status == NSATARI_DOWNLOAD_WORKING) {
|
||||
download_context_abort(gdw->ctx);
|
||||
}
|
||||
LOG((""));
|
||||
if (gdw->status == NSATARI_DOWNLOAD_WORKING) {
|
||||
download_context_abort(gdw->ctx);
|
||||
}
|
||||
|
||||
download_context_destroy(gdw->ctx);
|
||||
download_context_destroy(gdw->ctx);
|
||||
|
||||
if (gdw->destination) {
|
||||
free( gdw->destination );
|
||||
}
|
||||
if (gdw->fd != NULL) {
|
||||
fclose(gdw->fd);
|
||||
gdw->fd = NULL;
|
||||
}
|
||||
if (gdw->fbuf != NULL) {
|
||||
free( gdw->fbuf );
|
||||
}
|
||||
if (gdw->destination) {
|
||||
free( gdw->destination );
|
||||
}
|
||||
if (gdw->fd != NULL) {
|
||||
fclose(gdw->fd);
|
||||
gdw->fd = NULL;
|
||||
}
|
||||
if (gdw->fbuf != NULL) {
|
||||
free( gdw->fbuf );
|
||||
}
|
||||
gemtk_wm_remove(gdw->guiwin);
|
||||
wind_close(gdw->aes_handle);
|
||||
wind_delete(gdw->aes_handle);
|
||||
free(gdw);
|
||||
wind_delete(gdw->aes_handle);
|
||||
free(gdw);
|
||||
}
|
||||
|
||||
static char * select_filepath( const char * path, const char * filename )
|
||||
|
@ -244,15 +242,14 @@ static char * select_filepath( const char * path, const char * filename )
|
|||
|
||||
printf("download file: %s\n", ret);
|
||||
return(ret);
|
||||
}
|
||||
}
|
||||
|
||||
struct gui_download_window * gui_download_window_create(download_context *ctx,
|
||||
struct gui_window *parent)
|
||||
static struct gui_download_window *
|
||||
gui_download_window_create(download_context *ctx, struct gui_window *parent)
|
||||
{
|
||||
const char *filename;
|
||||
char *destination;
|
||||
char gdos_path[PATH_MAX];
|
||||
const char * url;
|
||||
const char *filename;
|
||||
char *destination;
|
||||
char gdos_path[PATH_MAX];
|
||||
struct gui_download_window * gdw;
|
||||
int dlgres = 0;
|
||||
OBJECT * tree = gemtk_obj_get_tree(DOWNLOAD);
|
||||
|
@ -261,19 +258,19 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
|
|||
|
||||
LOG(("Creating download window for gui window: %p", parent));
|
||||
|
||||
/* TODO: Implement real form and use messages file strings! */
|
||||
|
||||
/* TODO: Implement real form and use messages file strings! */
|
||||
|
||||
if (tree == NULL){
|
||||
die("Couldn't find AES Object tree for download window!");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
filename = download_context_get_filename((const download_context*)ctx);
|
||||
snprintf(alert, 200, "[2][Accept download?|%.*s][Yes|Save as...|No]",
|
||||
40,filename);
|
||||
dlgres = form_alert(2, alert);
|
||||
if( dlgres == 3){
|
||||
return( NULL );
|
||||
dlgres = form_alert(2, alert);
|
||||
if( dlgres == 3){
|
||||
return( NULL );
|
||||
}
|
||||
else if( dlgres == 2 ){
|
||||
gemdos_realpath(nsoption_charp(downloads_path), gdos_path);
|
||||
|
@ -288,39 +285,38 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
|
|||
destination = malloc( dstsize );
|
||||
snprintf(destination, dstsize, "%s/%s", gdos_path, filename);
|
||||
}
|
||||
|
||||
gdw = calloc(1, sizeof(struct gui_download_window));
|
||||
|
||||
gdw = calloc(1, sizeof(struct gui_download_window));
|
||||
if( gdw == NULL ){
|
||||
warn_user(NULL, "Out of memory!");
|
||||
free( destination );
|
||||
free( destination );
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
gdw->ctx = ctx;
|
||||
gdw->abort = false;
|
||||
gdw->start = clock() / CLOCKS_PER_SEC;
|
||||
gdw->lastrdw = 0;
|
||||
gdw->status = NSATARI_DOWNLOAD_WORKING;
|
||||
gdw->parent = parent;
|
||||
gdw->fbufsize = MAX(BUFSIZ, 48000);
|
||||
gdw->size_downloaded = 0;
|
||||
|
||||
gdw->ctx = ctx;
|
||||
gdw->abort = false;
|
||||
gdw->start = clock() / CLOCKS_PER_SEC;
|
||||
gdw->lastrdw = 0;
|
||||
gdw->status = NSATARI_DOWNLOAD_WORKING;
|
||||
gdw->parent = parent;
|
||||
gdw->fbufsize = MAX(BUFSIZ, 48000);
|
||||
gdw->size_downloaded = 0;
|
||||
gdw->size_total = download_context_get_total_length(ctx);
|
||||
gdw->destination = destination;
|
||||
gdw->tree = tree;
|
||||
url = download_context_get_url(ctx);
|
||||
|
||||
gdw->fd = fopen(gdw->destination, "wb");
|
||||
gdw->tree = tree;
|
||||
|
||||
gdw->fd = fopen(gdw->destination, "wb");
|
||||
if( gdw->fd == NULL ){
|
||||
char spare[200];
|
||||
snprintf(spare, 200, "Couldn't open %s for writing!", gdw->destination);
|
||||
gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT, spare);
|
||||
gui_download_window_destroy(gdw);
|
||||
return( NULL );
|
||||
gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT, spare);
|
||||
gui_download_window_destroy(gdw);
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
gdw->fbuf = malloc( gdw->fbufsize+1 );
|
||||
if( gdw->fbuf != NULL ){
|
||||
setvbuf( gdw->fd, gdw->fbuf, _IOFBF, gdw->fbufsize );
|
||||
|
||||
gdw->fbuf = malloc( gdw->fbufsize+1 );
|
||||
if( gdw->fbuf != NULL ){
|
||||
setvbuf( gdw->fd, gdw->fbuf, _IOFBF, gdw->fbufsize );
|
||||
}
|
||||
|
||||
gdw->aes_handle = wind_create_grect(CLOSER | NAME | MOVER, &desk_area);
|
||||
|
@ -328,17 +324,17 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
|
|||
unsigned long gwflags = GEMTK_WM_FLAG_DEFAULTS;
|
||||
gdw->guiwin = gemtk_wm_add(gdw->aes_handle, gwflags, on_aes_event);
|
||||
if( gdw->guiwin == NULL || gdw->fd == NULL ){
|
||||
die("could not create guiwin");
|
||||
gui_download_window_destroy(gdw);
|
||||
return( NULL );
|
||||
die("could not create guiwin");
|
||||
gui_download_window_destroy(gdw);
|
||||
return( NULL );
|
||||
}
|
||||
gemtk_wm_set_user_data(gdw->guiwin, gdw);
|
||||
gemtk_wm_set_toolbar(gdw->guiwin, tree, 0, 0);
|
||||
gemtk_wm_set_toolbar_redraw_func(gdw->guiwin, toolbar_redraw_cb);
|
||||
|
||||
strncpy((char*)&gdw->lbl_file, filename, MAX_SLEN_LBL_FILE-1);
|
||||
LOG(("created download: %s (total size: %d)",
|
||||
gdw->destination, gdw->size_total
|
||||
gemtk_wm_set_toolbar_redraw_func(gdw->guiwin, toolbar_redraw_cb);
|
||||
|
||||
strncpy((char*)&gdw->lbl_file, filename, MAX_SLEN_LBL_FILE-1);
|
||||
LOG(("created download: %s (total size: %d)",
|
||||
gdw->destination, gdw->size_total
|
||||
));
|
||||
|
||||
GRECT work, curr;
|
||||
|
@ -357,100 +353,104 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
|
|||
|
||||
return(gdw);
|
||||
}
|
||||
|
||||
|
||||
nserror gui_download_window_data(struct gui_download_window *dw,
|
||||
const char *data, unsigned int size)
|
||||
{
|
||||
|
||||
uint32_t clck = clock();
|
||||
uint32_t tnow = clck / (CLOCKS_PER_SEC>>3);
|
||||
|
||||
static nserror gui_download_window_data(struct gui_download_window *dw,
|
||||
const char *data, unsigned int size)
|
||||
{
|
||||
|
||||
uint32_t clck = clock();
|
||||
uint32_t tnow = clck / (CLOCKS_PER_SEC>>3);
|
||||
uint32_t sdiff = (clck / (CLOCKS_PER_SEC)) - dw->start;
|
||||
uint32_t p = 0;
|
||||
float speed;
|
||||
float pf = 0;
|
||||
|
||||
LOG((""));
|
||||
|
||||
OBJECT * tree = dw->tree;
|
||||
|
||||
if(dw->abort == true){
|
||||
dw->status = NSATARI_DOWNLOAD_CANCELED;
|
||||
dw->abort = false;
|
||||
dw->status = NSATARI_DOWNLOAD_CANCELED;
|
||||
dw->abort = false;
|
||||
download_context_abort(dw->ctx);
|
||||
gemtk_wm_exec_redraw(dw->guiwin, NULL);
|
||||
return(NSERROR_OK);
|
||||
}
|
||||
|
||||
/* save data */
|
||||
fwrite( data , size, sizeof(unsigned char),dw->fd );
|
||||
gemtk_wm_exec_redraw(dw->guiwin, NULL);
|
||||
return(NSERROR_OK);
|
||||
}
|
||||
|
||||
/* save data */
|
||||
fwrite( data , size, sizeof(unsigned char),dw->fd );
|
||||
dw->size_downloaded += size;
|
||||
|
||||
/* Update GUI */
|
||||
/* Update GUI */
|
||||
if ((tnow - dw->lastrdw) > 1) {
|
||||
float speed;
|
||||
|
||||
dw->lastrdw = tnow;
|
||||
speed = dw->size_downloaded / sdiff;
|
||||
|
||||
dw->lastrdw = tnow;
|
||||
speed = dw->size_downloaded / sdiff;
|
||||
|
||||
if( dw->size_total > 0 ){
|
||||
p = ((double)dw->size_downloaded / (double)dw->size_total * 100);
|
||||
snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
|
||||
"%lu%s", p, "%"
|
||||
);
|
||||
} else {
|
||||
snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
|
||||
"%s", "?%"
|
||||
);
|
||||
}
|
||||
snprintf( (char*)&dw->lbl_speed, MAX_SLEN_LBL_SPEED, "%s/s",
|
||||
human_friendly_bytesize(speed)
|
||||
);
|
||||
snprintf( (char*)&dw->lbl_done, MAX_SLEN_LBL_DONE, "%s / %s",
|
||||
human_friendly_bytesize(dw->size_downloaded),
|
||||
(dw->size_total>0) ? human_friendly_bytesize(dw->size_total) : "?"
|
||||
uint32_t p = 0;
|
||||
p = ((double)dw->size_downloaded / (double)dw->size_total * 100);
|
||||
snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
|
||||
"%lu%s", p, "%"
|
||||
);
|
||||
} else {
|
||||
snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
|
||||
"%s", "?%"
|
||||
);
|
||||
}
|
||||
snprintf( (char*)&dw->lbl_speed, MAX_SLEN_LBL_SPEED, "%s/s",
|
||||
human_friendly_bytesize(speed)
|
||||
);
|
||||
snprintf( (char*)&dw->lbl_done, MAX_SLEN_LBL_DONE, "%s / %s",
|
||||
human_friendly_bytesize(dw->size_downloaded),
|
||||
(dw->size_total>0) ? human_friendly_bytesize(dw->size_total) : "?"
|
||||
);
|
||||
|
||||
gemtk_wm_exec_redraw(dw->guiwin, NULL);
|
||||
}
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
void gui_download_window_error(struct gui_download_window *dw,
|
||||
const char *error_msg)
|
||||
{
|
||||
LOG(("%s", error_msg));
|
||||
strncpy((char*)&dw->lbl_file, error_msg, MAX_SLEN_LBL_FILE-1);
|
||||
dw->status = NSATARI_DOWNLOAD_ERROR;
|
||||
gemtk_wm_exec_redraw(dw->guiwin, NULL);
|
||||
gui_window_set_status(input_window, messages_get("Done") );
|
||||
// TODO: change abort to close
|
||||
}
|
||||
|
||||
void gui_download_window_done(struct gui_download_window *dw)
|
||||
{
|
||||
OBJECT * tree;
|
||||
LOG((""));
|
||||
|
||||
// TODO: change abort to close
|
||||
dw->status = NSATARI_DOWNLOAD_COMPLETE;
|
||||
|
||||
if( dw->fd != NULL ) {
|
||||
fclose( dw->fd );
|
||||
dw->fd = NULL;
|
||||
}
|
||||
|
||||
tree = dw->tree;
|
||||
if (dw->close_on_finish) {
|
||||
gemtk_wm_send_msg(dw->guiwin, WM_CLOSED, 0, 0, 0, 0);
|
||||
} else {
|
||||
snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
|
||||
"%lu%s", 100, "%"
|
||||
);
|
||||
snprintf( (char*)&dw->lbl_done, MAX_SLEN_LBL_DONE, "%s / %s",
|
||||
human_friendly_bytesize(dw->size_downloaded),
|
||||
(dw->size_total>0) ? human_friendly_bytesize(dw->size_total) : human_friendly_bytesize(dw->size_downloaded)
|
||||
);
|
||||
gemtk_wm_exec_redraw(dw->guiwin, NULL);
|
||||
}
|
||||
gui_window_set_status(input_window, messages_get("Done") );
|
||||
}
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
static void gui_download_window_error(struct gui_download_window *dw,
|
||||
const char *error_msg)
|
||||
{
|
||||
LOG(("%s", error_msg));
|
||||
strncpy((char*)&dw->lbl_file, error_msg, MAX_SLEN_LBL_FILE-1);
|
||||
dw->status = NSATARI_DOWNLOAD_ERROR;
|
||||
gemtk_wm_exec_redraw(dw->guiwin, NULL);
|
||||
gui_window_set_status(input_window, messages_get("Done") );
|
||||
// TODO: change abort to close
|
||||
}
|
||||
|
||||
static void gui_download_window_done(struct gui_download_window *dw)
|
||||
{
|
||||
LOG((""));
|
||||
|
||||
// TODO: change abort to close
|
||||
dw->status = NSATARI_DOWNLOAD_COMPLETE;
|
||||
|
||||
if( dw->fd != NULL ) {
|
||||
fclose( dw->fd );
|
||||
dw->fd = NULL;
|
||||
}
|
||||
|
||||
if (dw->close_on_finish) {
|
||||
gemtk_wm_send_msg(dw->guiwin, WM_CLOSED, 0, 0, 0, 0);
|
||||
} else {
|
||||
snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
|
||||
"%lu%s", 100, "%"
|
||||
);
|
||||
snprintf( (char*)&dw->lbl_done, MAX_SLEN_LBL_DONE, "%s / %s",
|
||||
human_friendly_bytesize(dw->size_downloaded),
|
||||
(dw->size_total>0) ? human_friendly_bytesize(dw->size_total) : human_friendly_bytesize(dw->size_downloaded)
|
||||
);
|
||||
gemtk_wm_exec_redraw(dw->guiwin, NULL);
|
||||
}
|
||||
gui_window_set_status(input_window, messages_get("Done") );
|
||||
}
|
||||
|
||||
static struct gui_download_table download_table = {
|
||||
.create = gui_download_window_create,
|
||||
.data = gui_download_window_data,
|
||||
.error = gui_download_window_error,
|
||||
.done = gui_download_window_done,
|
||||
};
|
||||
|
||||
struct gui_download_table *atari_download_table = &download_table;
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#ifndef NS_ATARI_DOWNLOAD_H
|
||||
#define NS_ATARI_DOWNLOAD_H
|
||||
|
||||
extern struct gui_download_table *atari_download_table;
|
||||
|
||||
#define MAX_SLEN_LBL_DONE 64
|
||||
#define MAX_SLEN_LBL_PERCENT 5
|
||||
#define MAX_SLEN_LBL_SPEED 13
|
||||
|
|
|
@ -16,28 +16,30 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "desktop/gui.h"
|
||||
|
||||
#include "atari/encoding.h"
|
||||
|
||||
|
||||
/* TODO: this need a rework..., encoding to atari st doesn|t always work.
|
||||
( gui_add_to_clipboard...) */
|
||||
utf8_convert_ret utf8_to_local_encoding(const char *string,
|
||||
nserror utf8_to_local_encoding(const char *string,
|
||||
size_t len,
|
||||
char **result)
|
||||
{
|
||||
utf8_convert_ret r;
|
||||
nserror r;
|
||||
r = utf8_to_enc(string, "ATARIST", len, result);
|
||||
if(r != UTF8_CONVERT_OK) {
|
||||
if(r != NSERROR_OK) {
|
||||
r = utf8_to_enc(string, "UTF-8", len, result);
|
||||
assert( r == UTF8_CONVERT_OK );
|
||||
assert( r == NSERROR_OK );
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
utf8_convert_ret utf8_from_local_encoding(const char *string,
|
||||
size_t len,
|
||||
char **result)
|
||||
nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
|
||||
{
|
||||
return utf8_from_enc(string, "ATARIST", len, result, NULL);
|
||||
}
|
||||
|
@ -69,3 +71,9 @@ int atari_to_ucs4(unsigned char atari)
|
|||
}
|
||||
|
||||
|
||||
static struct gui_utf8_table utf8_table = {
|
||||
.utf8_to_local = utf8_to_local_encoding,
|
||||
.local_to_utf8 = utf8_from_local_encoding,
|
||||
};
|
||||
|
||||
struct gui_utf8_table *atari_utf8_table = &utf8_table;
|
||||
|
|
|
@ -1,32 +1,37 @@
|
|||
/*
|
||||
* Copyright 2012 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/*
|
||||
* Copyright 2012 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef NS_ATARI_ENCODING_H
|
||||
#define NS_ATARI_ENCODING_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "css/css.h"
|
||||
#include "css/css.h"
|
||||
#include "render/font.h"
|
||||
#include "utils/utf8.h"
|
||||
|
||||
#include "utils/utf8.h"
|
||||
|
||||
struct gui_utf8_table *atari_utf8_table;
|
||||
|
||||
nserror utf8_to_local_encoding(const char *string, size_t len, char **result);
|
||||
nserror utf8_from_local_encoding(const char *string, size_t len, char **result);
|
||||
|
||||
int atari_to_ucs4( unsigned char atarichar);
|
||||
|
||||
#endif
|
||||
|
|
121
atari/filetype.c
121
atari/filetype.c
|
@ -1,70 +1,71 @@
|
|||
/*
|
||||
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/url.h"
|
||||
#include "utils/log.h"
|
||||
#include "content/fetch.h"
|
||||
|
||||
/**
|
||||
* filetype -- determine the MIME type of a local file
|
||||
*/
|
||||
const char *fetch_filetype(const char *unix_path)
|
||||
{
|
||||
/*
|
||||
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/log.h"
|
||||
#include "content/fetch.h"
|
||||
|
||||
#include "atari/filetype.h"
|
||||
|
||||
/**
|
||||
* filetype -- determine the MIME type of a local file
|
||||
*/
|
||||
const char *fetch_filetype(const char *unix_path)
|
||||
{
|
||||
int l;
|
||||
char * res = (char*)"text/html";
|
||||
l = strlen(unix_path);
|
||||
|
||||
LOG(("unix path: %s", unix_path));
|
||||
|
||||
|
||||
/* This line is added for devlopment versions running from the root dir: */
|
||||
if( strchr( unix_path, (int)'.' ) ){
|
||||
if (2 < l && strcasecmp(unix_path + l - 3, "f79") == 0)
|
||||
res = (char*)"text/css";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0)
|
||||
res = (char*)"text/css";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "jpg") == 0)
|
||||
res = (char*)"image/jpeg";
|
||||
else if (3 < l && strcasecmp(unix_path + l - 4, "jpeg") == 0)
|
||||
res = (char*)"image/jpeg";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "gif") == 0)
|
||||
res = (char*)"image/gif";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "png") == 0)
|
||||
res = (char*)"image/png";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "jng") == 0)
|
||||
res = (char*)"image/jng";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "svg") == 0)
|
||||
res = (char*)"image/svg";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "txt") == 0)
|
||||
if( strchr( unix_path, (int)'.' ) ){
|
||||
if (2 < l && strcasecmp(unix_path + l - 3, "f79") == 0)
|
||||
res = (char*)"text/css";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0)
|
||||
res = (char*)"text/css";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "jpg") == 0)
|
||||
res = (char*)"image/jpeg";
|
||||
else if (3 < l && strcasecmp(unix_path + l - 4, "jpeg") == 0)
|
||||
res = (char*)"image/jpeg";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "gif") == 0)
|
||||
res = (char*)"image/gif";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "png") == 0)
|
||||
res = (char*)"image/png";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "jng") == 0)
|
||||
res = (char*)"image/jng";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "svg") == 0)
|
||||
res = (char*)"image/svg";
|
||||
else if (2 < l && strcasecmp(unix_path + l - 3, "txt") == 0)
|
||||
res = (char*)"text/plain";
|
||||
} else {
|
||||
int n=0;
|
||||
int c;
|
||||
FILE * fp;
|
||||
char buffer[16];
|
||||
fp = fopen( unix_path, "r" );
|
||||
if( fp ){
|
||||
int n=0;
|
||||
int c;
|
||||
do {
|
||||
c = fgetc (fp);
|
||||
if( c != EOF )
|
||||
|
@ -84,14 +85,8 @@ const char *fetch_filetype(const char *unix_path)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
error:
|
||||
LOG(("mime type: %s", res ));
|
||||
return( res );
|
||||
}
|
||||
|
||||
|
||||
char *fetch_mimetype(const char *ro_path)
|
||||
{
|
||||
return strdup("text/plain");
|
||||
return( res );
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2008 Vincent Sanders <vince@simtec.co.uk>
|
||||
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
|
@ -16,10 +16,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "desktop/401login.h"
|
||||
#ifndef NS_ATARI_FILETYPE_H_
|
||||
#define NS_ATARI_FILETYPE_H_
|
||||
|
||||
void gui_401login_open(nsurl *url, const char *realm,
|
||||
nserror (*cb)(bool proceed, void *pw), void *cbpw)
|
||||
{
|
||||
cb(false, cbpw);
|
||||
}
|
||||
const char *fetch_filetype(const char *unix_path);
|
||||
|
||||
#endif
|
|
@ -68,59 +68,6 @@ char * local_file_to_url( const char * filename )
|
|||
#undef BACKSLASH
|
||||
}
|
||||
|
||||
/* convert an local path to an URL, memory for URL is allocated. */
|
||||
char *path_to_url(const char *path_in)
|
||||
{
|
||||
#define BACKSLASH 0x5C
|
||||
char * path;
|
||||
|
||||
LOG(("path2url in: %s\n", path_in));
|
||||
|
||||
path = (char*)path_in;
|
||||
|
||||
int urllen = strlen(path) + FILE_SCHEME_PREFIX_LEN + 1;
|
||||
char *url = malloc(urllen);
|
||||
|
||||
snprintf(url, urllen, "%s%s", FILE_SCHEME_PREFIX, path);
|
||||
|
||||
int i=0;
|
||||
while( url[i] != 0 ){
|
||||
if( url[i] == BACKSLASH ){
|
||||
url[i] = '/';
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
LOG(("path2url out: %s\n", url));
|
||||
return url;
|
||||
#undef BACKSLASH
|
||||
}
|
||||
|
||||
|
||||
char *url_to_path(const char *url)
|
||||
{
|
||||
char *url_path = curl_unescape(url, 0);
|
||||
char *path;
|
||||
char abspath[PATH_MAX+1];
|
||||
|
||||
LOG(( "url2path in: %s (%s)\n", url, url_path ));
|
||||
|
||||
// is the URL relative?
|
||||
if (url_path[7] == '.') {
|
||||
// yes, make it absolute...
|
||||
gemdos_realpath(url_path + (FILE_SCHEME_PREFIX_LEN-1), abspath);
|
||||
path = strdup(abspath);
|
||||
} else {
|
||||
path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN));
|
||||
}
|
||||
|
||||
curl_free(url_path);
|
||||
|
||||
LOG(( "url2path out: %s\n", path ));
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Locate a shared resource file by searching known places in order.
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define NS_ATARI_FINDFILE_H
|
||||
|
||||
extern char *atari_find_resource(char *buf, const char *filename, const char *def);
|
||||
char * local_file_to_url( const char * filename );
|
||||
char *local_file_to_url(const char *filename);
|
||||
|
||||
|
||||
#endif /* NETSURF_ATARI_FINDFILE_H */
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue