netsurf: branch master updated. release/3.0-598-gf5bdd4b
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/f5bdd4b10962659259423...
...commit http://git.netsurf-browser.org/netsurf.git/commit/f5bdd4b10962659259423e8...
...tree http://git.netsurf-browser.org/netsurf.git/tree/f5bdd4b10962659259423e8ef...
The branch, master has been updated
via f5bdd4b10962659259423e8efa2ddf80b9805053 (commit)
from ff480312fee43925e692c8798daad5ef2f722800 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=f5bdd4b109626592594...
commit f5bdd4b10962659259423e8efa2ddf80b9805053
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Move BITMAP_SAVE_FULL_ALPHA out of core to RISC OS front end, where it belongs.
diff --git a/image/bitmap.h b/image/bitmap.h
index 256e977..1932492 100644
--- a/image/bitmap.h
+++ b/image/bitmap.h
@@ -61,8 +61,6 @@
#define BITMAP_MODIFIED (1 << 1) /** buffer has been modified */
#define BITMAP_CLEAR_MEMORY (1 << 2) /** memory should be wiped */
-#define BITMAP_SAVE_FULL_ALPHA (1 << 0) /** save with full alpha channel (if not opaque) */
-
struct content;
/** An opaque image. */
diff --git a/riscos/bitmap.h b/riscos/bitmap.h
index 01d4171..1b7d1b9 100644
--- a/riscos/bitmap.h
+++ b/riscos/bitmap.h
@@ -23,6 +23,8 @@
#include "oslib/osspriteop.h"
#include "image/bitmap.h"
+#define BITMAP_SAVE_FULL_ALPHA (1 << 0) /** save with full alpha channel (if not opaque) */
+
struct osspriteop_area;
struct bitmap {
diff --git a/riscos/save.c b/riscos/save.c
index 511af91..4d17403 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -45,6 +45,7 @@
#include "desktop/thumbnail.h"
#include "image/bitmap.h"
#include "render/form.h"
+#include "riscos/bitmap.h"
#include "riscos/dialog.h"
#include "riscos/gui.h"
#include "riscos/menus.h"
-----------------------------------------------------------------------
Summary of changes:
image/bitmap.h | 2 --
riscos/bitmap.h | 2 ++
riscos/save.c | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/image/bitmap.h b/image/bitmap.h
index 256e977..1932492 100644
--- a/image/bitmap.h
+++ b/image/bitmap.h
@@ -61,8 +61,6 @@
#define BITMAP_MODIFIED (1 << 1) /** buffer has been modified */
#define BITMAP_CLEAR_MEMORY (1 << 2) /** memory should be wiped */
-#define BITMAP_SAVE_FULL_ALPHA (1 << 0) /** save with full alpha channel (if not opaque) */
-
struct content;
/** An opaque image. */
diff --git a/riscos/bitmap.h b/riscos/bitmap.h
index 01d4171..1b7d1b9 100644
--- a/riscos/bitmap.h
+++ b/riscos/bitmap.h
@@ -23,6 +23,8 @@
#include "oslib/osspriteop.h"
#include "image/bitmap.h"
+#define BITMAP_SAVE_FULL_ALPHA (1 << 0) /** save with full alpha channel (if not opaque) */
+
struct osspriteop_area;
struct bitmap {
diff --git a/riscos/save.c b/riscos/save.c
index 511af91..4d17403 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -45,6 +45,7 @@
#include "desktop/thumbnail.h"
#include "image/bitmap.h"
#include "render/form.h"
+#include "riscos/bitmap.h"
#include "riscos/dialog.h"
#include "riscos/gui.h"
#include "riscos/menus.h"
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-597-gff48031
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/ff480312fee43925e692c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/ff480312fee43925e692c87...
...tree http://git.netsurf-browser.org/netsurf.git/tree/ff480312fee43925e692c8798...
The branch, master has been updated
via ff480312fee43925e692c8798daad5ef2f722800 (commit)
via 4c6a176d39d47b79ee1c2a32116623a27446229f (commit)
via 138d8c4677d80882df09df0eeda2f77bae963d5f (commit)
from 1172d21b1c522bdd8b79cb1f7c6e1f11689f5b3e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=ff480312fee43925e69...
commit ff480312fee43925e692c8798daad5ef2f722800
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove BITMAP_READY flag.
diff --git a/image/bitmap.h b/image/bitmap.h
index 614e8b6..256e977 100644
--- a/image/bitmap.h
+++ b/image/bitmap.h
@@ -60,7 +60,6 @@
#define BITMAP_OPAQUE (1 << 0) /** image is opaque */
#define BITMAP_MODIFIED (1 << 1) /** buffer has been modified */
#define BITMAP_CLEAR_MEMORY (1 << 2) /** memory should be wiped */
-#define BITMAP_READY (1 << 3) /** fully initialised */
#define BITMAP_SAVE_FULL_ALPHA (1 << 0) /** save with full alpha channel (if not opaque) */
diff --git a/riscos/bitmap.c b/riscos/bitmap.c
index 60b0345..abb21ea 100644
--- a/riscos/bitmap.c
+++ b/riscos/bitmap.c
@@ -77,7 +77,6 @@ static bool bitmap_initialise(struct bitmap *bitmap)
if (!bitmap->sprite_area)
return false;
- bitmap->state |= BITMAP_READY;
/* area control block */
sprite_area = bitmap->sprite_area;
@@ -314,7 +313,7 @@ unsigned char *bitmap_get_buffer(void *vbitmap)
assert(bitmap);
/* dynamically create the buffer */
- if (!(bitmap->state & BITMAP_READY)) {
+ if (bitmap->sprite_area == NULL) {
if (!bitmap_initialise(bitmap))
return NULL;
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=4c6a176d39d47b79ee1...
commit 4c6a176d39d47b79ee1c2a32116623a27446229f
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove BITMAP_PERSISTENT flag.
diff --git a/image/bitmap.h b/image/bitmap.h
index 3ca5ccd..614e8b6 100644
--- a/image/bitmap.h
+++ b/image/bitmap.h
@@ -59,9 +59,8 @@
#define BITMAP_NEW 0
#define BITMAP_OPAQUE (1 << 0) /** image is opaque */
#define BITMAP_MODIFIED (1 << 1) /** buffer has been modified */
-#define BITMAP_PERSISTENT (1 << 2) /** retain between sessions */
-#define BITMAP_CLEAR_MEMORY (1 << 3) /** memory should be wiped */
-#define BITMAP_READY (1 << 4) /** fully initialised */
+#define BITMAP_CLEAR_MEMORY (1 << 2) /** memory should be wiped */
+#define BITMAP_READY (1 << 3) /** fully initialised */
#define BITMAP_SAVE_FULL_ALPHA (1 << 0) /** save with full alpha channel (if not opaque) */
diff --git a/windows/thumbnail.c b/windows/thumbnail.c
index e87745b..c4ef63c 100644
--- a/windows/thumbnail.c
+++ b/windows/thumbnail.c
@@ -68,7 +68,7 @@ thumbnail_create(hlcache_handle *content,
}
/* create a full size bitmap and plot into it */
- fsbitmap = bitmap_create(width, height, BITMAP_NEW | BITMAP_CLEAR_MEMORY | BITMAP_OPAQUE | BITMAP_PERSISTENT);
+ fsbitmap = bitmap_create(width, height, BITMAP_NEW | BITMAP_CLEAR_MEMORY | BITMAP_OPAQUE);
SelectObject(bufferdc, fsbitmap->windib);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=138d8c4677d80882df0...
commit 138d8c4677d80882df09df0eeda2f77bae963d5f
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove unused structure member.
diff --git a/riscos/bitmap.h b/riscos/bitmap.h
index 43a00a5..01d4171 100644
--- a/riscos/bitmap.h
+++ b/riscos/bitmap.h
@@ -31,10 +31,7 @@ struct bitmap {
unsigned int state;
- void *private_word;
-
osspriteop_area *sprite_area; /** Uncompressed data, or NULL */
-
};
void bitmap_overlay_sprite(struct bitmap *bitmap, const osspriteop_header *s);
-----------------------------------------------------------------------
Summary of changes:
image/bitmap.h | 4 +---
riscos/bitmap.c | 3 +--
riscos/bitmap.h | 3 ---
windows/thumbnail.c | 2 +-
4 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/image/bitmap.h b/image/bitmap.h
index 3ca5ccd..256e977 100644
--- a/image/bitmap.h
+++ b/image/bitmap.h
@@ -59,9 +59,7 @@
#define BITMAP_NEW 0
#define BITMAP_OPAQUE (1 << 0) /** image is opaque */
#define BITMAP_MODIFIED (1 << 1) /** buffer has been modified */
-#define BITMAP_PERSISTENT (1 << 2) /** retain between sessions */
-#define BITMAP_CLEAR_MEMORY (1 << 3) /** memory should be wiped */
-#define BITMAP_READY (1 << 4) /** fully initialised */
+#define BITMAP_CLEAR_MEMORY (1 << 2) /** memory should be wiped */
#define BITMAP_SAVE_FULL_ALPHA (1 << 0) /** save with full alpha channel (if not opaque) */
diff --git a/riscos/bitmap.c b/riscos/bitmap.c
index 60b0345..abb21ea 100644
--- a/riscos/bitmap.c
+++ b/riscos/bitmap.c
@@ -77,7 +77,6 @@ static bool bitmap_initialise(struct bitmap *bitmap)
if (!bitmap->sprite_area)
return false;
- bitmap->state |= BITMAP_READY;
/* area control block */
sprite_area = bitmap->sprite_area;
@@ -314,7 +313,7 @@ unsigned char *bitmap_get_buffer(void *vbitmap)
assert(bitmap);
/* dynamically create the buffer */
- if (!(bitmap->state & BITMAP_READY)) {
+ if (bitmap->sprite_area == NULL) {
if (!bitmap_initialise(bitmap))
return NULL;
}
diff --git a/riscos/bitmap.h b/riscos/bitmap.h
index 43a00a5..01d4171 100644
--- a/riscos/bitmap.h
+++ b/riscos/bitmap.h
@@ -31,10 +31,7 @@ struct bitmap {
unsigned int state;
- void *private_word;
-
osspriteop_area *sprite_area; /** Uncompressed data, or NULL */
-
};
void bitmap_overlay_sprite(struct bitmap *bitmap, const osspriteop_header *s);
diff --git a/windows/thumbnail.c b/windows/thumbnail.c
index e87745b..c4ef63c 100644
--- a/windows/thumbnail.c
+++ b/windows/thumbnail.c
@@ -68,7 +68,7 @@ thumbnail_create(hlcache_handle *content,
}
/* create a full size bitmap and plot into it */
- fsbitmap = bitmap_create(width, height, BITMAP_NEW | BITMAP_CLEAR_MEMORY | BITMAP_OPAQUE | BITMAP_PERSISTENT);
+ fsbitmap = bitmap_create(width, height, BITMAP_NEW | BITMAP_CLEAR_MEMORY | BITMAP_OPAQUE);
SelectObject(bufferdc, fsbitmap->windib);
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-594-g1172d21
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/1172d21b1c522bdd8b79c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/1172d21b1c522bdd8b79cb1...
...tree http://git.netsurf-browser.org/netsurf.git/tree/1172d21b1c522bdd8b79cb1f7...
The branch, master has been updated
via 1172d21b1c522bdd8b79cb1f7c6e1f11689f5b3e (commit)
from c720ecf449ab7c69098936ae9face5cf4f96dc19 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=1172d21b1c522bdd8b7...
commit 1172d21b1c522bdd8b79cb1f7c6e1f11689f5b3e
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove unused bitmap memory config window help text.
diff --git a/resources/FatMessages b/resources/FatMessages
index 6a3cbc8..8b1583a 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -5237,67 +5237,6 @@ fr.ro.HelpLanguageConfig10:\Ssauver ces réglages et fermer la fenêtre.|M\Asauv
it.ro.HelpLanguageConfig10:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
nl.ro.HelpLanguageConfig10:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
-en.ro.HelpMemoryConfig:\Tmemory configuration \w
-de.ro.HelpMemoryConfig:Fenster zur Konfiguration des nutzbaren Arbeitsspeichers
-fr.ro.HelpMemoryConfig:\Tla fenêtre de configuration de mémoire
-it.ro.HelpMemoryConfig:\Tmemory configuration \w
-nl.ro.HelpMemoryConfig:\Tmemory configuration \w
-en.ro.HelpMemoryConfig3:You can enter the maximum amount of memory NetSurf will use for storing uncompressed images here.
-de.ro.HelpMemoryConfig3:Hier kann die Maximalgröße des von NetSurf für nichtkomprimierte Bilder genutzten Speichers angegeben werden.
-fr.ro.HelpMemoryConfig3:Vous pouvez entrer ici la quantité maximum de mémoire que Netsurf utilisera pour stocker les images non-compressées.
-it.ro.HelpMemoryConfig3:You can enter the maximum amount of memory NetSurf will use for storing uncompressed images here.
-nl.ro.HelpMemoryConfig3:You can enter the maximum amount of memory NetSurf will use for storing uncompressed images here.
-en.ro.HelpMemoryConfig4:\Sreduce the amount of memory used for storing uncompressed images.
-de.ro.HelpMemoryConfig4:Klicken mit AUSWAHL verkleinert den Arbeitsspeicher zum Ablegen nichtkomprimierter Bilder.
-fr.ro.HelpMemoryConfig4:\Sréduire la quantité de mémoire utilisée pour stocker les images non-compressées.
-it.ro.HelpMemoryConfig4:\Sreduce the amount of memory used for storing uncompressed images.
-nl.ro.HelpMemoryConfig4:\Sreduce the amount of memory used for storing uncompressed images.
-en.ro.HelpMemoryConfig5:\Sincrease the amount of memory used for storing uncompressed images.
-de.ro.HelpMemoryConfig5:Klicken mit AUSWAHL vergrößert den Arbeitsspeicher zum Ablegen nichtkomprimierter Bilder.
-fr.ro.HelpMemoryConfig5:\Saugmenter la quantité de mémoire utilisée pour stocker les images non-compressées.
-it.ro.HelpMemoryConfig5:\Sincrease the amount of memory used for storing uncompressed images.
-nl.ro.HelpMemoryConfig5:\Sincrease the amount of memory used for storing uncompressed images.
-en.ro.HelpMemoryConfig7:This indicates whether NetSurf will try to make an intelligent guess at the most suitable amount of memory to use for storing uncompressed images.
-de.ro.HelpMemoryConfig7:NetSurf nimmt eine automatische intelligente Abschätzung der notwendigen Größe des Arbeitsspeichers zum Ablegen nichtkomprimierter Bilddaten vor.
-fr.ro.HelpMemoryConfig7:Ceci indiquera si Netsurf doit essayer de deviner intelligemment la quantité de mémoire la plus appropriée à utiliser pour le stockage d'images non-compressées.
-it.ro.HelpMemoryConfig7:This indicates whether NetSurf will try to make an intelligent guess at the most suitable amount of memory to use for storing uncompressed images.
-nl.ro.HelpMemoryConfig7:This indicates whether NetSurf will try to make an intelligent guess at the most suitable amount of memory to use for storing uncompressed images.
-en.ro.HelpMemoryConfig9:You can enter the maximum amount of memory NetSurf will use for storing compressed images here.
-de.ro.HelpMemoryConfig9:Hier kann die Maximalgröße des von NetSurf für komprimierte Bilder genutzten Speichers angegeben werden.
-fr.ro.HelpMemoryConfig9:Vous pouvez entrer ici la quantité de mémoire maximum que Netsurf utilisera pour le stockage d'images compressées.
-it.ro.HelpMemoryConfig9:You can enter the maximum amount of memory NetSurf will use for storing compressed images here.
-nl.ro.HelpMemoryConfig9:You can enter the maximum amount of memory NetSurf will use for storing compressed images here.
-en.ro.HelpMemoryConfig10:\Sreduce the amount of memory used for storing compressed images.
-de.ro.HelpMemoryConfig10:Klicken mit AUSWAHL verkleinert den Arbeitsspeicher zum Ablegen komprimierter Bilder.
-fr.ro.HelpMemoryConfig10:\Sréduire la quantité de mémoire utilisée pour le stockage d'images compressées.
-it.ro.HelpMemoryConfig10:\Sreduce the amount of memory used for storing compressed images.
-nl.ro.HelpMemoryConfig10:\Sreduce the amount of memory used for storing compressed images.
-en.ro.HelpMemoryConfig11:\Sincrease the amount of memory used for storing compressed images.
-de.ro.HelpMemoryConfig11:Klicken mit AUSWAHL vergrößert den Arbeitsspeicher zum Ablegen komprimierter Bilder.
-fr.ro.HelpMemoryConfig11:\Saugmenter la quantité de mémoire utilisée pour le stockage d'images compressées.
-it.ro.HelpMemoryConfig11:\Sincrease the amount of memory used for storing compressed images.
-nl.ro.HelpMemoryConfig11:\Sincrease the amount of memory used for storing compressed images.
-en.ro.HelpMemoryConfig13:This indicates whether NetSurf will try to make an intelligent guess at the most suitable amount of memory to use for storing uncompressed images.
-de.ro.HelpMemoryConfig13:NetSurf nimmt eine automatische intelligente Abschätzung der notwendigen Größe des Arbeitsspeichers zum Ablegen komprimierter Bilddaten vor.
-fr.ro.HelpMemoryConfig13:Ceci indiquera si Netsurf doit essayer de deviner intelligemment la quantité de mémoire la plus appropriée à utiliser pour le stockage d'images compressées.
-it.ro.HelpMemoryConfig13:This indicates whether NetSurf will try to make an intelligent guess at the most suitable amount of memory to use for storing uncompressed images.
-nl.ro.HelpMemoryConfig13:This indicates whether NetSurf will try to make an intelligent guess at the most suitable amount of memory to use for storing uncompressed images.
-en.ro.HelpMemoryConfig14:\Sreset the Memory options back to their default values.
-de.ro.HelpMemoryConfig14:Stellt die Standardeinstellungen wieder her.
-fr.ro.HelpMemoryConfig14:\Srevenir aux valeurs par défaut des options de Mémoire.
-it.ro.HelpMemoryConfig14:\Sreset the Memory options back to their default values.
-nl.ro.HelpMemoryConfig14:\Sreset the Memory options back to their default values.
-en.ro.HelpMemoryConfig15:\Sclose this \w without saving changes.|M\Areturn the memory options to the last saved configuration.
-de.ro.HelpMemoryConfig15:Klicken mit AUSWAHL schließt das Fenster ohne die Änderungen zu speichern.|MKlicken mit SPEZIAL stellt die zuletzt abgespeicherten Einstellungen wieder her.
-fr.ro.HelpMemoryConfig15:\Sfermer cette fenêtre sans sauver les changements|M\Arevenir aux options de Mémoire précédemment sauvegardées.
-it.ro.HelpMemoryConfig15:\Sclose this \w without saving changes.|M\Areturn the memory options to the last saved configuration.
-nl.ro.HelpMemoryConfig15:\Sclose this \w without saving changes.|M\Areturn the cache options to the last saved configuration.
-en.ro.HelpMemoryConfig16:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
-de.ro.HelpMemoryConfig16:Klicken mit AUSWAHL speichert die Einstellungen und schließt das Fenster.|MKlicken mit SPEZIAL speichert die Einstellungen ohne das Fenster zu schließen.
-fr.ro.HelpMemoryConfig16:\Ssauver ces réglages et fermer la fenêtre.|M\Asauver ces réglages sans fermer la fenêtre.
-it.ro.HelpMemoryConfig16:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
-nl.ro.HelpMemoryConfig16:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
-
en.ro.HelpSecurityConfig:\Tsecurity configuration \w
de.ro.HelpSecurityConfig:Fenster zur Konfiguration der Sicherheitseinstellungen
fr.ro.HelpSecurityConfig:\Tla fenêtre de configuration de sécurité
-----------------------------------------------------------------------
Summary of changes:
resources/FatMessages | 61 -------------------------------------------------
1 files changed, 0 insertions(+), 61 deletions(-)
diff --git a/resources/FatMessages b/resources/FatMessages
index 6a3cbc8..8b1583a 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -5237,67 +5237,6 @@ fr.ro.HelpLanguageConfig10:\Ssauver ces réglages et fermer la fenêtre.|M\Asauv
it.ro.HelpLanguageConfig10:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
nl.ro.HelpLanguageConfig10:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
-en.ro.HelpMemoryConfig:\Tmemory configuration \w
-de.ro.HelpMemoryConfig:Fenster zur Konfiguration des nutzbaren Arbeitsspeichers
-fr.ro.HelpMemoryConfig:\Tla fenêtre de configuration de mémoire
-it.ro.HelpMemoryConfig:\Tmemory configuration \w
-nl.ro.HelpMemoryConfig:\Tmemory configuration \w
-en.ro.HelpMemoryConfig3:You can enter the maximum amount of memory NetSurf will use for storing uncompressed images here.
-de.ro.HelpMemoryConfig3:Hier kann die Maximalgröße des von NetSurf für nichtkomprimierte Bilder genutzten Speichers angegeben werden.
-fr.ro.HelpMemoryConfig3:Vous pouvez entrer ici la quantité maximum de mémoire que Netsurf utilisera pour stocker les images non-compressées.
-it.ro.HelpMemoryConfig3:You can enter the maximum amount of memory NetSurf will use for storing uncompressed images here.
-nl.ro.HelpMemoryConfig3:You can enter the maximum amount of memory NetSurf will use for storing uncompressed images here.
-en.ro.HelpMemoryConfig4:\Sreduce the amount of memory used for storing uncompressed images.
-de.ro.HelpMemoryConfig4:Klicken mit AUSWAHL verkleinert den Arbeitsspeicher zum Ablegen nichtkomprimierter Bilder.
-fr.ro.HelpMemoryConfig4:\Sréduire la quantité de mémoire utilisée pour stocker les images non-compressées.
-it.ro.HelpMemoryConfig4:\Sreduce the amount of memory used for storing uncompressed images.
-nl.ro.HelpMemoryConfig4:\Sreduce the amount of memory used for storing uncompressed images.
-en.ro.HelpMemoryConfig5:\Sincrease the amount of memory used for storing uncompressed images.
-de.ro.HelpMemoryConfig5:Klicken mit AUSWAHL vergrößert den Arbeitsspeicher zum Ablegen nichtkomprimierter Bilder.
-fr.ro.HelpMemoryConfig5:\Saugmenter la quantité de mémoire utilisée pour stocker les images non-compressées.
-it.ro.HelpMemoryConfig5:\Sincrease the amount of memory used for storing uncompressed images.
-nl.ro.HelpMemoryConfig5:\Sincrease the amount of memory used for storing uncompressed images.
-en.ro.HelpMemoryConfig7:This indicates whether NetSurf will try to make an intelligent guess at the most suitable amount of memory to use for storing uncompressed images.
-de.ro.HelpMemoryConfig7:NetSurf nimmt eine automatische intelligente Abschätzung der notwendigen Größe des Arbeitsspeichers zum Ablegen nichtkomprimierter Bilddaten vor.
-fr.ro.HelpMemoryConfig7:Ceci indiquera si Netsurf doit essayer de deviner intelligemment la quantité de mémoire la plus appropriée à utiliser pour le stockage d'images non-compressées.
-it.ro.HelpMemoryConfig7:This indicates whether NetSurf will try to make an intelligent guess at the most suitable amount of memory to use for storing uncompressed images.
-nl.ro.HelpMemoryConfig7:This indicates whether NetSurf will try to make an intelligent guess at the most suitable amount of memory to use for storing uncompressed images.
-en.ro.HelpMemoryConfig9:You can enter the maximum amount of memory NetSurf will use for storing compressed images here.
-de.ro.HelpMemoryConfig9:Hier kann die Maximalgröße des von NetSurf für komprimierte Bilder genutzten Speichers angegeben werden.
-fr.ro.HelpMemoryConfig9:Vous pouvez entrer ici la quantité de mémoire maximum que Netsurf utilisera pour le stockage d'images compressées.
-it.ro.HelpMemoryConfig9:You can enter the maximum amount of memory NetSurf will use for storing compressed images here.
-nl.ro.HelpMemoryConfig9:You can enter the maximum amount of memory NetSurf will use for storing compressed images here.
-en.ro.HelpMemoryConfig10:\Sreduce the amount of memory used for storing compressed images.
-de.ro.HelpMemoryConfig10:Klicken mit AUSWAHL verkleinert den Arbeitsspeicher zum Ablegen komprimierter Bilder.
-fr.ro.HelpMemoryConfig10:\Sréduire la quantité de mémoire utilisée pour le stockage d'images compressées.
-it.ro.HelpMemoryConfig10:\Sreduce the amount of memory used for storing compressed images.
-nl.ro.HelpMemoryConfig10:\Sreduce the amount of memory used for storing compressed images.
-en.ro.HelpMemoryConfig11:\Sincrease the amount of memory used for storing compressed images.
-de.ro.HelpMemoryConfig11:Klicken mit AUSWAHL vergrößert den Arbeitsspeicher zum Ablegen komprimierter Bilder.
-fr.ro.HelpMemoryConfig11:\Saugmenter la quantité de mémoire utilisée pour le stockage d'images compressées.
-it.ro.HelpMemoryConfig11:\Sincrease the amount of memory used for storing compressed images.
-nl.ro.HelpMemoryConfig11:\Sincrease the amount of memory used for storing compressed images.
-en.ro.HelpMemoryConfig13:This indicates whether NetSurf will try to make an intelligent guess at the most suitable amount of memory to use for storing uncompressed images.
-de.ro.HelpMemoryConfig13:NetSurf nimmt eine automatische intelligente Abschätzung der notwendigen Größe des Arbeitsspeichers zum Ablegen komprimierter Bilddaten vor.
-fr.ro.HelpMemoryConfig13:Ceci indiquera si Netsurf doit essayer de deviner intelligemment la quantité de mémoire la plus appropriée à utiliser pour le stockage d'images compressées.
-it.ro.HelpMemoryConfig13:This indicates whether NetSurf will try to make an intelligent guess at the most suitable amount of memory to use for storing uncompressed images.
-nl.ro.HelpMemoryConfig13:This indicates whether NetSurf will try to make an intelligent guess at the most suitable amount of memory to use for storing uncompressed images.
-en.ro.HelpMemoryConfig14:\Sreset the Memory options back to their default values.
-de.ro.HelpMemoryConfig14:Stellt die Standardeinstellungen wieder her.
-fr.ro.HelpMemoryConfig14:\Srevenir aux valeurs par défaut des options de Mémoire.
-it.ro.HelpMemoryConfig14:\Sreset the Memory options back to their default values.
-nl.ro.HelpMemoryConfig14:\Sreset the Memory options back to their default values.
-en.ro.HelpMemoryConfig15:\Sclose this \w without saving changes.|M\Areturn the memory options to the last saved configuration.
-de.ro.HelpMemoryConfig15:Klicken mit AUSWAHL schließt das Fenster ohne die Änderungen zu speichern.|MKlicken mit SPEZIAL stellt die zuletzt abgespeicherten Einstellungen wieder her.
-fr.ro.HelpMemoryConfig15:\Sfermer cette fenêtre sans sauver les changements|M\Arevenir aux options de Mémoire précédemment sauvegardées.
-it.ro.HelpMemoryConfig15:\Sclose this \w without saving changes.|M\Areturn the memory options to the last saved configuration.
-nl.ro.HelpMemoryConfig15:\Sclose this \w without saving changes.|M\Areturn the cache options to the last saved configuration.
-en.ro.HelpMemoryConfig16:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
-de.ro.HelpMemoryConfig16:Klicken mit AUSWAHL speichert die Einstellungen und schließt das Fenster.|MKlicken mit SPEZIAL speichert die Einstellungen ohne das Fenster zu schließen.
-fr.ro.HelpMemoryConfig16:\Ssauver ces réglages et fermer la fenêtre.|M\Asauver ces réglages sans fermer la fenêtre.
-it.ro.HelpMemoryConfig16:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
-nl.ro.HelpMemoryConfig16:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
-
en.ro.HelpSecurityConfig:\Tsecurity configuration \w
de.ro.HelpSecurityConfig:Fenster zur Konfiguration der Sicherheitseinstellungen
fr.ro.HelpSecurityConfig:\Tla fenêtre de configuration de sécurité
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-593-gc720ecf
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/c720ecf449ab7c6909893...
...commit http://git.netsurf-browser.org/netsurf.git/commit/c720ecf449ab7c69098936a...
...tree http://git.netsurf-browser.org/netsurf.git/tree/c720ecf449ab7c69098936ae9...
The branch, master has been updated
via c720ecf449ab7c69098936ae9face5cf4f96dc19 (commit)
via 92ea400bd383c03ecfc9f76c59d5be3891d6bdea (commit)
via 8850d40cec3cc3ac79626f8550dad248dd883a0a (commit)
via 43e4cb2ad7242558d87100850e49ac01b9dfeaad (commit)
via 143e553593477ba42ecbda9858436e66aaf56d2c (commit)
via d041594fd9b793816e62a3209e6877c8055b7e3e (commit)
via dba846b5b84533cf940086312db2c596ebe3214e (commit)
from 1e4c733fc0d91a032ed2a8587b2f014eab7d0291 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c720ecf449ab7c69098...
commit c720ecf449ab7c69098936ae9face5cf4f96dc19
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove old debug window template.
diff --git a/riscos/dialog.c b/riscos/dialog.c
index 7a333e6..147dce9 100644
--- a/riscos/dialog.c
+++ b/riscos/dialog.c
@@ -70,7 +70,7 @@
wimp_w dialog_info, dialog_saveas,
dialog_401li,
dialog_zoom, dialog_pageinfo, dialog_objinfo, dialog_tooltip,
- dialog_warning, dialog_debug,
+ dialog_warning,
dialog_folder, dialog_entry, dialog_search, dialog_print,
dialog_url_complete, dialog_openurl;
@@ -121,10 +121,6 @@ void ro_gui_dialog_init(void)
ro_gui_theme_install_apply);
ro_gui_wimp_event_set_help_prefix(dialog_theme_install, "HelpThemeInst");
- /* debug window */
- dialog_debug = ro_gui_dialog_create("debug");
- ro_gui_wimp_event_set_help_prefix(dialog_debug, "HelpDebug");
-
/* search */
ro_gui_search_init();
diff --git a/riscos/gui.h b/riscos/gui.h
index 5089315..827af81 100644
--- a/riscos/gui.h
+++ b/riscos/gui.h
@@ -52,7 +52,7 @@ extern wimp_t task_handle; /**< RISC OS wimp task handle. */
extern wimp_w dialog_info, dialog_saveas, dialog_zoom, dialog_pageinfo,
dialog_objinfo, dialog_tooltip, dialog_warning, dialog_openurl,
- dialog_debug, dialog_folder, dialog_entry, dialog_url_complete,
+ dialog_folder, dialog_entry, dialog_url_complete,
dialog_search, dialog_print, dialog_theme_install;
extern wimp_w current_menu_window;
extern bool current_menu_open;
diff --git a/riscos/templates/de b/riscos/templates/de
index 785477d..905d57e 100644
--- a/riscos/templates/de
+++ b/riscos/templates/de
@@ -1040,30 +1040,6 @@ wimp_window {
}
wimp_window {
- template_name:"debug"
- visible:248,508,1052,972
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_BACK_ICON | wimp_WINDOW_CLOSE_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_TOGGLE_ICON | wimp_WINDOW_VSCROLL | wimp_WINDOW_SIZE_ICON | wimp_WINDOW_HSCROLL | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-880,1236,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
- work_flags:
- sprite_area:&1
- xmin:0
- ymin:0
- text_only:"NetSurf"
-}
-
-wimp_window {
template_name:"download"
visible:384,314,1180,594
xscroll:0
diff --git a/riscos/templates/en b/riscos/templates/en
index 1ec8ee2..a943b1e 100644
--- a/riscos/templates/en
+++ b/riscos/templates/en
@@ -1250,30 +1250,6 @@ wimp_window {
}
wimp_window {
- template_name:"debug"
- visible:248,508,1052,972
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_BACK_ICON | wimp_WINDOW_CLOSE_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_TOGGLE_ICON | wimp_WINDOW_VSCROLL | wimp_WINDOW_SIZE_ICON | wimp_WINDOW_HSCROLL | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-880,1236,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
- work_flags:
- sprite_area:&1
- xmin:0
- ymin:0
- text_only:"NetSurf"
-}
-
-wimp_window {
template_name:"download"
visible:486,610,1282,890
xscroll:0
diff --git a/riscos/templates/fr b/riscos/templates/fr
index be08cfe..30bcbfa 100644
--- a/riscos/templates/fr
+++ b/riscos/templates/fr
@@ -1040,30 +1040,6 @@ wimp_window {
}
wimp_window {
- template_name:"debug"
- visible:248,508,1052,972
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_BACK_ICON | wimp_WINDOW_CLOSE_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_TOGGLE_ICON | wimp_WINDOW_VSCROLL | wimp_WINDOW_SIZE_ICON | wimp_WINDOW_HSCROLL | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-880,1236,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
- work_flags:
- sprite_area:&1
- xmin:0
- ymin:0
- text_only:"NetSurf"
-}
-
-wimp_window {
template_name:"download"
visible:352,94,1148,374
xscroll:0
diff --git a/riscos/templates/nl b/riscos/templates/nl
index 13f7f59..dcc8af5 100644
--- a/riscos/templates/nl
+++ b/riscos/templates/nl
@@ -1252,30 +1252,6 @@ wimp_window {
}
wimp_window {
- template_name:"debug"
- visible:248,508,1052,972
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_BACK_ICON | wimp_WINDOW_CLOSE_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_TOGGLE_ICON | wimp_WINDOW_VSCROLL | wimp_WINDOW_SIZE_ICON | wimp_WINDOW_HSCROLL | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-880,1236,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
- work_flags:
- sprite_area:&1
- xmin:0
- ymin:0
- text_only:"NetSurf"
-}
-
-wimp_window {
template_name:"download"
visible:486,610,1282,890
xscroll:0
diff --git a/riscos/wimp.c b/riscos/wimp.c
index 1f3a452..87860ad 100644
--- a/riscos/wimp.c
+++ b/riscos/wimp.c
@@ -94,8 +94,6 @@ void ro_gui_wimp_cache_furniture_sizes(wimp_w w)
{
os_error *error;
- if (!w)
- w = dialog_debug;
if (furniture_window == w)
return;
furniture_window = w;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=92ea400bd383c03ecfc...
commit 92ea400bd383c03ecfc9f76c59d5be3891d6bdea
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Optimise treeview redraw. It draws its own background, so don't need white background in the template.
diff --git a/riscos/templates/de b/riscos/templates/de
index 8f3dddb..785477d 100644
--- a/riscos/templates/de
+++ b/riscos/templates/de
@@ -2454,7 +2454,7 @@ wimp_window {
title_fg:wimp_COLOUR_BLACK
title_bg:wimp_COLOUR_LIGHT_GREY
work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
+ work_bg:wimp_COLOUR_TRANSPARENT
scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
highlight_bg:wimp_COLOUR_CREAM
diff --git a/riscos/templates/en b/riscos/templates/en
index 2d6c70c..1ec8ee2 100644
--- a/riscos/templates/en
+++ b/riscos/templates/en
@@ -2662,7 +2662,7 @@ wimp_window {
title_fg:wimp_COLOUR_BLACK
title_bg:wimp_COLOUR_LIGHT_GREY
work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
+ work_bg:wimp_COLOUR_TRANSPARENT
scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
highlight_bg:wimp_COLOUR_CREAM
diff --git a/riscos/templates/fr b/riscos/templates/fr
index 6c9d4a1..be08cfe 100644
--- a/riscos/templates/fr
+++ b/riscos/templates/fr
@@ -2466,7 +2466,7 @@ wimp_window {
title_fg:wimp_COLOUR_BLACK
title_bg:wimp_COLOUR_LIGHT_GREY
work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
+ work_bg:wimp_COLOUR_TRANSPARENT
scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
highlight_bg:wimp_COLOUR_CREAM
diff --git a/riscos/templates/nl b/riscos/templates/nl
index 72a8ed5..13f7f59 100644
--- a/riscos/templates/nl
+++ b/riscos/templates/nl
@@ -2666,7 +2666,7 @@ wimp_window {
title_fg:wimp_COLOUR_BLACK
title_bg:wimp_COLOUR_LIGHT_GREY
work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
+ work_bg:wimp_COLOUR_TRANSPARENT
scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
highlight_bg:wimp_COLOUR_CREAM
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=8850d40cec3cc3ac796...
commit 8850d40cec3cc3ac79626f8550dad248dd883a0a
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove unused image cache config window template.
diff --git a/riscos/templates/de b/riscos/templates/de
index b6357f2..8f3dddb 100644
--- a/riscos/templates/de
+++ b/riscos/templates/de
@@ -966,194 +966,6 @@ wimp_window {
}
wimp_window {
- template_name:"con_memory"
- visible:750,578,1370,982
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_AUTO_REDRAW | wimp_WINDOW_FULL_SIZE | wimp_WINDOW_BACK_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_VERY_LIGHT_GREY
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-404,620,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | 0x27000000
- work_flags:
- sprite_area:&1
- xmin:620
- ymin:404
- text.text:"Arbeitsspeicher"
- text.size:*
- text.validation:""
- wimp_icon {
- extent:16,-292,604,-24
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:""
- text.size:*
- text.validation:"R4"
- }
- wimp_icon {
- extent:32,-52,268,-8
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:" Image memory "
- text_and_sprite.size:*
- text_and_sprite.validation:""
- }
- wimp_icon {
- extent:92,-104,216,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Direkt"
- }
- wimp_icon {
- extent:220,-108,388,-56
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta"
- }
- wimp_icon {
- extent:404,-100,436,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-100,468,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-104,532,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-160,564,-116
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"automatisch"
- text_and_sprite.size:19
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:28,-216,216,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Komprimiert"
- }
- wimp_icon {
- extent:220,-220,388,-168
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta"
- }
- wimp_icon {
- extent:404,-212,436,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-212,468,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-216,532,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-272,564,-228
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"automatisch"
- text_and_sprite.size:19
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:24,-376,188,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Standard"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:240,-376,404,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Abbruch"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:420,-384,604,-316
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"OK"
- text.size:4
- text.validation:"R6,3"
- }
-}
-
-wimp_window {
template_name:"con_theme"
visible:408,370,1316,974
xscroll:0
diff --git a/riscos/templates/en b/riscos/templates/en
index 2edf0dd..2d6c70c 100644
--- a/riscos/templates/en
+++ b/riscos/templates/en
@@ -1176,192 +1176,6 @@ wimp_window {
}
wimp_window {
- template_name:"con_memory"
- visible:1706,688,2326,1092
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_AUTO_REDRAW | wimp_WINDOW_BACK_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_VERY_LIGHT_GREY
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-404,620,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED
- work_flags:
- sprite_area:&1
- xmin:620
- ymin:404
- text_only:"Memory"
- wimp_icon {
- extent:16,-292,604,-24
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:""
- text.size:*
- text.validation:"R4"
- }
- wimp_icon {
- extent:32,-52,268,-8
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:" Image memory "
- text_and_sprite.size:*
- text_and_sprite.validation:""
- }
- wimp_icon {
- extent:92,-104,216,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Direct"
- }
- wimp_icon {
- extent:220,-108,388,-56
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta;A0-9."
- }
- wimp_icon {
- extent:404,-100,436,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-100,468,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-104,532,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-160,564,-116
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"Automatic handling"
- text_and_sprite.size:*
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:36,-216,216,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Compressed"
- }
- wimp_icon {
- extent:220,-220,388,-168
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta;A0-9."
- }
- wimp_icon {
- extent:404,-212,436,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-212,468,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-216,532,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-272,564,-228
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"Automatic handling"
- text_and_sprite.size:*
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:24,-376,188,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Default"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:236,-376,400,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Cancel"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:416,-384,600,-316
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Set"
- text.size:*
- text.validation:"R6,3"
- }
-}
-
-wimp_window {
template_name:"con_theme"
visible:410,38,1318,642
xscroll:0
diff --git a/riscos/templates/fr b/riscos/templates/fr
index 3df0a61..6c9d4a1 100644
--- a/riscos/templates/fr
+++ b/riscos/templates/fr
@@ -966,192 +966,6 @@ wimp_window {
}
wimp_window {
- template_name:"con_memory"
- visible:422,358,1042,762
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_AUTO_REDRAW | wimp_WINDOW_BACK_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_VERY_LIGHT_GREY
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-404,620,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
- work_flags:
- sprite_area:&1
- xmin:620
- ymin:404
- text_only:"M�moire"
- wimp_icon {
- extent:16,-292,604,-24
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:""
- text.size:*
- text.validation:"R4"
- }
- wimp_icon {
- extent:32,-52,316,-8
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:" M�moire d'image "
- text_and_sprite.size:*
- text_and_sprite.validation:""
- }
- wimp_icon {
- extent:92,-104,216,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Directe"
- }
- wimp_icon {
- extent:220,-108,388,-56
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta"
- }
- wimp_icon {
- extent:404,-100,436,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-100,468,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-104,532,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-160,564,-116
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"Gestion automatique"
- text_and_sprite.size:*
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:36,-216,216,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Compress�e"
- }
- wimp_icon {
- extent:220,-220,388,-168
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta"
- }
- wimp_icon {
- extent:404,-212,436,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-212,468,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-216,532,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-272,564,-228
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"Gestion automatique"
- text_and_sprite.size:*
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:24,-376,188,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Par d�faut"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:240,-376,404,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Annuler"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:420,-384,604,-316
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Valider"
- text.size:*
- text.validation:"R6,3"
- }
-}
-
-wimp_window {
template_name:"con_theme"
visible:408,370,1316,974
xscroll:0
diff --git a/riscos/templates/nl b/riscos/templates/nl
index 53915d3..72a8ed5 100644
--- a/riscos/templates/nl
+++ b/riscos/templates/nl
@@ -1178,192 +1178,6 @@ wimp_window {
}
wimp_window {
- template_name:"con_memory"
- visible:538,540,1158,944
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_AUTO_REDRAW | wimp_WINDOW_BACK_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_VERY_LIGHT_GREY
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-404,620,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED
- work_flags:
- sprite_area:&1
- xmin:620
- ymin:404
- text_only:"Geheugen"
- wimp_icon {
- extent:16,-292,604,-24
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:""
- text.size:*
- text.validation:"R4"
- }
- wimp_icon {
- extent:32,-52,268,-8
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:" Beeldgeheugen "
- text_and_sprite.size:*
- text_and_sprite.validation:""
- }
- wimp_icon {
- extent:92,-104,216,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Direct"
- }
- wimp_icon {
- extent:220,-108,388,-56
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta"
- }
- wimp_icon {
- extent:404,-100,436,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-100,468,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-104,532,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-160,564,-116
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"Automatisch afhandelen"
- text_and_sprite.size:*
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:36,-216,216,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Comprimeren"
- }
- wimp_icon {
- extent:220,-220,388,-168
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta"
- }
- wimp_icon {
- extent:404,-212,436,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-212,468,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-216,532,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-272,564,-228
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"Automatisch afhandelen"
- text_and_sprite.size:*
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:24,-376,188,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Verstek"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:236,-376,400,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Annuleer"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:416,-384,600,-316
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Instellen"
- text.size:*
- text.validation:"R6,3"
- }
-}
-
-wimp_window {
template_name:"con_theme"
visible:410,38,1318,642
xscroll:0
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=43e4cb2ad7242558d87...
commit 43e4cb2ad7242558d87100850e49ac01b9dfeaad
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove image memory options.
diff --git a/riscos/options.h b/riscos/options.h
index 3d4567f..9ee3592 100644
--- a/riscos/options.h
+++ b/riscos/options.h
@@ -51,8 +51,6 @@ NSOPTION_BOOL(buffer_everything, true)
NSOPTION_BOOL(open_browser_at_startup, false)
NSOPTION_BOOL(no_plugins, false)
NSOPTION_BOOL(block_popups, false)
-NSOPTION_INTEGER(image_memory_direct, -1)
-NSOPTION_INTEGER(image_memory_compressed, -1)
NSOPTION_BOOL(strip_extensions, false)
NSOPTION_BOOL(confirm_overwrite, true)
NSOPTION_STRING(url_path, "NetSurf:URL")
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=143e553593477ba42ec...
commit 143e553593477ba42ecbda9858436e66aaf56d2c
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove redundant bitmap compression/decompression/dropping-to-disc. The core now has a converted bitmap cache that is pruned more agressively.
diff --git a/resources/FatMessages b/resources/FatMessages
index b78b5a7..6a3cbc8 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -4743,21 +4743,16 @@ de.ro.HelpConfigure7:Sprachen einstellen
fr.ro.HelpConfigure7:Outil de configuration de langue
it.ro.HelpConfigure7:Language configuration tool
nl.ro.HelpConfigure7:Language configuration tool
-en.ro.HelpConfigure8:Memory configuration tool
-de.ro.HelpConfigure8:Arbeitsspeicher konfigurieren
-fr.ro.HelpConfigure8:Outil de configuration de la mémoire
-it.ro.HelpConfigure8:Memory configuration tool
-nl.ro.HelpConfigure8:Memory configuration tool
-en.ro.HelpConfigure9:Theme configuration tool
-de.ro.HelpConfigure9:Themenauswahl
-fr.ro.HelpConfigure9:Outil de configuration de thème
-it.ro.HelpConfigure9:Theme configuration tool
-nl.ro.HelpConfigure9:Theme configuration tool
-en.ro.HelpConfigure10:Security and Privacy configuration tool
-de.ro.HelpConfigure10:Sicherheitseinstellungen und Privatsphäre
-fr.ro.HelpConfigure10:Outil de configuration de la sécurité et de la confidentialité
-it.ro.HelpConfigure10:Security and Privacy configuration tool
-nl.ro.HelpConfigure10:Security and Privacy configuration tool
+en.ro.HelpConfigure8:Theme configuration tool
+de.ro.HelpConfigure8:Themenauswahl
+fr.ro.HelpConfigure8:Outil de configuration de thème
+it.ro.HelpConfigure8:Theme configuration tool
+nl.ro.HelpConfigure8:Theme configuration tool
+en.ro.HelpConfigure9:Security and Privacy configuration tool
+de.ro.HelpConfigure9:Sicherheitseinstellungen und Privatsphäre
+fr.ro.HelpConfigure9:Outil de configuration de la sécurité et de la confidentialité
+it.ro.HelpConfigure9:Security and Privacy configuration tool
+nl.ro.HelpConfigure9:Security and Privacy configuration tool
en.ro.HelpCacheConfig:\Tcache configuration \w.
de.ro.HelpCacheConfig:Das ist das Fenster der Cache-Konfiguration.
diff --git a/riscos/Makefile.target b/riscos/Makefile.target
index b32590b..3d64e24 100644
--- a/riscos/Makefile.target
+++ b/riscos/Makefile.target
@@ -83,7 +83,7 @@ S_RISCOS := 401login.c assert.c bitmap.c buffer.c cookies.c configure.c \
throbber.c url_bar.c) \
$(addprefix configure/,con_cache.c con_connect.c con_content.c \
con_fonts.c con_home.c con_image.c con_inter.c con_language.c \
- con_memory.c con_secure.c con_theme.c)
+ con_secure.c con_theme.c)
S_RISCOS := $(addprefix riscos/,$(S_RISCOS))
TPL_RISCOS := de en fr nl # TODO: It'd be nice to auto-detect these
TPL_RISCOS := $(addprefix riscos/templates/,$(TPL_RISCOS))
diff --git a/riscos/bitmap.c b/riscos/bitmap.c
index 0f54003..60b0345 100644
--- a/riscos/bitmap.c
+++ b/riscos/bitmap.c
@@ -50,222 +50,9 @@
/** Colour in the overlay sprite that allows the bitmap to show through */
#define OVERLAY_INDEX 0xfe
-#define MAINTENANCE_THRESHOLD 32
-
/** Size of buffer used when constructing mask data to be saved */
#define SAVE_CHUNK_SIZE 4096
-/** The head of the bitmap list
-*/
-struct bitmap *bitmap_head = NULL;
-
-/** Whether maintenance of the pool states is needed
-*/
-bool bitmap_maintenance = false;
-
-/** Whether maintenance of the pool is high priority
-*/
-bool bitmap_maintenance_priority = false;
-
-/** Maximum amount of memory for direct images
-*/
-unsigned int bitmap_direct_size;
-
-/** Current amount of memory for direct images
-*/
-unsigned int bitmap_direct_used = 0;
-
-/** Total size of compressed area
-*/
-unsigned int bitmap_compressed_size;
-
-/** Total size of compressed area
-*/
-unsigned int bitmap_compressed_used = 0;
-
-/** Compressed data header
-*/
-struct bitmap_compressed_header {
- int width;
- int height;
- char name[12];
- unsigned int flags;
- unsigned int input_size;
-};
-
-char bitmap_unixname[256];
-char bitmap_filename[256];
-
-
-
-static void bitmap_delete_file(struct bitmap *bitmap)
-{
- assert(bitmap->filename[0]);
- filename_release(bitmap->filename);
- bitmap->filename[0] = 0;
-}
-
-
-static void bitmap_load_file(struct bitmap *bitmap)
-{
- int len;
- fileswitch_object_type obj_type;
- os_error *error;
- char *r;
- struct bitmap_compressed_header *bitmap_compressed;
- osspriteop_header *bitmap_direct;
- int *data;
-
- assert(bitmap->filename);
-
- sprintf(bitmap_unixname, "%s/%s", TEMP_FILENAME_PREFIX,
- bitmap->filename);
- r = __riscosify(bitmap_unixname, 0, __RISCOSIFY_NO_SUFFIX,
- bitmap_filename, 256, 0);
- if (r == 0) {
- LOG(("__riscosify failed"));
- return;
- }
- error = xosfile_read_stamped_no_path(bitmap_filename,
- &obj_type, 0, 0, &len, 0, 0);
- if ((error) || (obj_type != fileswitch_IS_FILE))
- return;
-
- bitmap->compressed = malloc(len);
- if (!bitmap->compressed)
- return;
-
- error = xosfile_load_stamped_no_path(bitmap_filename,
- (byte *) bitmap->compressed, 0, 0, 0, 0, 0);
- if (error) {
- free(bitmap->compressed);
- bitmap->compressed = NULL;
- return;
- }
-
- data = (void *) bitmap->compressed;
-
- LOG(("Loaded file from disk"));
- /* Sanity check the file we've just loaded:
- * If it's an uncompressed buffer, then it's a raw sprite area,
- * including the total size word at the start. Therefore, we check
- * that:
- * a) The declared total area size == file length
- * b) The offset to the first free word == file length
- * c) There is only 1 sprite in the area
- * d) The name of the sprite in the area is "bitmap"
- *
- * If it's a compressed buffer, then we check that:
- * a) The declared input size + header size == file length
- * b) The name of the buffer is "bitmap"
- *
- * If it's neither of these, we fail.
- */
- if (*data == len && *(data + 3) == len && *(data + 1) == 1 &&
- strncmp(bitmap->compressed + 20, "bitmap", 6) == 0) {
- bitmap->sprite_area = (void *) bitmap->compressed;
- bitmap->compressed = NULL;
- bitmap_direct = (osspriteop_header *)(bitmap->sprite_area + 1);
- bitmap->width = bitmap_direct->width + 1;
- bitmap->height = bitmap_direct->height + 1;
- bitmap_direct_used += 16 + 44 +
- bitmap->width * bitmap->height * 4;
- } else if ((int) (*(data + 6) +
- sizeof(struct bitmap_compressed_header)) == len &&
- strncmp(bitmap->compressed + 8, "bitmap", 6) == 0) {
- bitmap_compressed = (void *) bitmap->compressed;
- bitmap_compressed_used -= bitmap_compressed->input_size +
- sizeof(struct bitmap_compressed_header);
- bitmap->width = bitmap_compressed->width;
- bitmap->height = bitmap_compressed->height;
- } else {
- free(bitmap->compressed);
- bitmap->compressed = NULL;
- return;
- }
- if (bitmap->state & BITMAP_MODIFIED)
- bitmap_delete_file(bitmap);
-}
-
-
-static void bitmap_save_file(struct bitmap *bitmap)
-{
- unsigned int area_size;
- const char *filename;
- char *r;
- os_error *error;
- struct bitmap_compressed_header *header;
-
- assert(bitmap);
-
- if (!bitmap->compressed && !bitmap->sprite_area) {
- LOG(("bitmap has no data"));
- return;
- }
-
- /* unmodified bitmaps will still have their file available */
- if ((!(bitmap->state & BITMAP_MODIFIED)) && bitmap->filename[0]) {
- if (bitmap->sprite_area)
- free(bitmap->sprite_area);
- bitmap->sprite_area = NULL;
- if (bitmap->compressed)
- free(bitmap->compressed);
- bitmap->compressed = NULL;
- return;
- }
-
- /* dump the data (compressed or otherwise) to disk */
- filename = filename_request();
- if (!filename) {
- LOG(("filename_request failed"));
- return;
- }
-
- strcpy(bitmap->filename, filename);
- sprintf(bitmap_unixname, "%s/%s", TEMP_FILENAME_PREFIX,
- bitmap->filename);
- r = __riscosify(bitmap_unixname, 0, __RISCOSIFY_NO_SUFFIX,
- bitmap_filename, 256, 0);
- if (r == 0) {
- LOG(("__riscosify failed"));
- return;
- }
- if (bitmap->compressed) {
- header = (void *) bitmap->compressed;
- area_size = header->input_size +
- sizeof(struct bitmap_compressed_header);
- error = xosfile_save_stamped(bitmap_filename, 0xffd,
- (byte *) bitmap->compressed,
- (byte *) bitmap->compressed + area_size);
- } else {
- area_size = bitmap->width * bitmap->height * 4 +
- sizeof(osspriteop_header) +
- sizeof(osspriteop_area);
- error = xosfile_save_stamped(bitmap_filename, 0xffd,
- (byte *) bitmap->sprite_area,
- ((byte *) bitmap->sprite_area) + area_size);
- }
-
- if (error) {
- LOG(("xosfile_save_stamped: 0x%x: %s",
- error->errnum, error->errmess));
- bitmap->filename[0] = 0;
- } else {
- if (bitmap->sprite_area) {
- bitmap_direct_used -= area_size;
- free(bitmap->sprite_area);
- }
- bitmap->sprite_area = NULL;
- if (bitmap->compressed) {
- bitmap_compressed_used -= area_size;
- free(bitmap->compressed);
- }
- bitmap->compressed = NULL;
- bitmap->state &= ~BITMAP_MODIFIED;
- LOG(("Saved file to disk"));
- }
-}
-
/**
* Initialise a bitmaps sprite area.
@@ -291,7 +78,6 @@ static bool bitmap_initialise(struct bitmap *bitmap)
if (!bitmap->sprite_area)
return false;
bitmap->state |= BITMAP_READY;
- bitmap_direct_used += area_size;
/* area control block */
sprite_area = bitmap->sprite_area;
@@ -312,177 +98,10 @@ static bool bitmap_initialise(struct bitmap *bitmap)
sprite->image = sprite->mask = 44;
sprite->mode = tinct_SPRITE_MODE;
- bitmap_maintenance = true;
- bitmap_maintenance_priority |=
- (bitmap_direct_used > bitmap_direct_size * 0.9);
return true;
}
-static void bitmap_decompress(struct bitmap *bitmap)
-{
- unsigned int area_size;
- _kernel_oserror *error;
- int output_size;
- struct bitmap_compressed_header *header;
-
- assert(bitmap->compressed);
-
- /* ensure the width/height is correct */
- header = (void *)bitmap->compressed;
- if ((header->width != bitmap->width) ||
- (header->height != bitmap->height)) {
- LOG(("Warning: Mismatch between bitmap and compressed sizes"));
- return;
- }
-
- /* create the image memory/header to decompress to */
- if (!bitmap_initialise(bitmap))
- return;
-
- /* decompress the data */
- output_size = bitmap->width * bitmap->height * 4 +
- sizeof(struct osspriteop_header);
- error = _swix(Tinct_Decompress, _IN(0) | _IN(2) | _IN(3) | _IN(7),
- bitmap->compressed,
- (char *)(bitmap->sprite_area + 1),
- output_size,
- 0);
- if (error) {
- LOG(("Decompression error"));
- free(bitmap->sprite_area);
- bitmap->sprite_area = NULL;
- } else {
- LOG(("Decompressed"));
- area_size = header->input_size +
- sizeof(struct bitmap_compressed_header);
- bitmap_compressed_used -= area_size;
- free(bitmap->compressed);
- bitmap->compressed = NULL;
- area_size = 16 + 44 + bitmap->width * bitmap->height * 4;
- bitmap_direct_used += area_size;
- }
-}
-
-
-static void bitmap_compress(struct bitmap *bitmap)
-{
- unsigned int area_size;
- _kernel_oserror *error;
- char *output;
- unsigned int output_size, new_size;
- unsigned int flags = 0;
- float calc;
-
- /* get the maximum output size (33/32 * size) */
- output_size = ((bitmap->width * bitmap->height * 4 * 33) >> 5) +
- sizeof(struct bitmap_compressed_header);
- output = malloc(output_size);
- if (!output)
- return;
-
- /* compress the data */
- if (bitmap->state & BITMAP_OPAQUE)
- flags |= tinct_OPAQUE_IMAGE;
- error = _swix(Tinct_Compress, _IN(0) | _IN(2) | _IN(7) | _OUT(0),
- (char *)(bitmap->sprite_area + 1),
- output,
- flags,
- &new_size);
- if (error) {
- LOG(("Compression error"));
- free(output);
- } else {
- bitmap->compressed = realloc(output, new_size);
- if (!bitmap->compressed) {
- free(output);
- } else {
- bitmap_compressed_used += new_size;
- if (bitmap->sprite_area) {
- area_size = 16 + 44 + bitmap->width *
- bitmap->height * 4;
- bitmap_direct_used -= area_size;
- free(bitmap->sprite_area);
- }
- bitmap->sprite_area = NULL;
- calc = (100 / (float)output_size) * new_size;
- LOG(("Compression: %i->%i, %.3f%%",
- output_size, new_size, calc));
- }
- }
-}
-
-
-/**
- * Initialise the bitmap memory pool.
- */
-
-void bitmap_initialise_memory(void)
-{
- int available_memory, direct_size, compressed_size;
- int free_slot;
- os_error *error;
-
- /* calculate how much memory is currently free
- (Note that the free_slot returned by wimp_slot_size
- includes the next_slot; the value displayed by the
- TaskManager has been adjusted to make it more logical
- for the user).
- */
- error = xwimp_slot_size(-1, -1, NULL, NULL, &free_slot);
- if (error) {
- LOG(("xwimp_slot_size: 0x%x: %s",
- error->errnum, error->errmess));
- warn_user("WimpError", error->errmess);
- return;
- }
- available_memory = free_slot;
-
- /* calculate our memory block sizes */
- if (nsoption_int(image_memory_direct) == -1) {
- /* claim 25% of free memory - min 256KB, max 32768KB */
- direct_size = available_memory / 4;
- if (direct_size < (256 << 10))
- direct_size = (256 << 10);
- if (direct_size > (32768 << 10))
- direct_size = (32768 << 10);
- } else {
- direct_size = (nsoption_int(image_memory_direct) << 10);
- }
- if (nsoption_int(image_memory_compressed) == -1) {
- /* claim 10% of free memory - min 256KB, max 4192KB */
- compressed_size = available_memory / 10;
- if (compressed_size < (256 << 10))
- compressed_size = 0;
- if (compressed_size > (4192 << 10))
- compressed_size = (4192 << 10);
- } else {
- compressed_size = (nsoption_int(image_memory_compressed) << 10);
- }
-
- /* set our values. No fixed buffers here, ho hum. */
- bitmap_direct_size = direct_size;
- bitmap_compressed_size = compressed_size;
- bitmap_maintenance = bitmap_maintenance_priority = true;
-}
-
-
-/**
- * Prepare for the end of a session.
- */
-
-void bitmap_quit(void)
-{
- struct bitmap *bitmap;
-
- for (bitmap = bitmap_head; bitmap; bitmap = bitmap->next)
- if ((bitmap->state & BITMAP_PERSISTENT) &&
- ((bitmap->state & BITMAP_MODIFIED) ||
- (bitmap->filename[0] == '\0')))
- bitmap_save_file(bitmap);
-}
-
-
/**
* Create a bitmap.
*
@@ -506,12 +125,6 @@ void *bitmap_create(int width, int height, unsigned int state)
bitmap->height = height;
bitmap->state = state;
- /* link into our list of bitmaps at the head */
- if (bitmap_head) {
- bitmap->next = bitmap_head;
- bitmap_head->previous = bitmap;
- }
- bitmap_head = bitmap;
return bitmap;
}
@@ -700,38 +313,13 @@ unsigned char *bitmap_get_buffer(void *vbitmap)
struct bitmap *bitmap = (struct bitmap *) vbitmap;
assert(bitmap);
- /* move to the head of the list */
- if (bitmap_head != bitmap) {
- if (bitmap->previous)
- bitmap->previous->next = bitmap->next;
- if (bitmap->next)
- bitmap->next->previous = bitmap->previous;
- bitmap->next = bitmap_head;
- bitmap_head->previous = bitmap;
- bitmap->previous = NULL;
- bitmap_head = bitmap;
- }
-
/* dynamically create the buffer */
if (!(bitmap->state & BITMAP_READY)) {
if (!bitmap_initialise(bitmap))
return NULL;
}
- /* image is already decompressed, no change to image states */
- if (bitmap->sprite_area)
- return ((unsigned char *) (bitmap->sprite_area)) + 16 + 44;
-
- /* load and/or decompress the image */
- if (bitmap->filename[0])
- bitmap_load_file(bitmap);
- if (bitmap->compressed)
- bitmap_decompress(bitmap);
-
- bitmap_maintenance = true;
- bitmap_maintenance_priority |=
- (bitmap_direct_used > bitmap_direct_size * 0.9);
-
+ /* image data area should exist */
if (bitmap->sprite_area)
return ((unsigned char *) (bitmap->sprite_area)) + 16 + 44;
@@ -762,34 +350,14 @@ size_t bitmap_get_rowstride(void *vbitmap)
void bitmap_destroy(void *vbitmap)
{
struct bitmap *bitmap = (struct bitmap *) vbitmap;
- struct bitmap_compressed_header *header;
- unsigned int area_size;
assert(bitmap);
- /* delink from list */
- bitmap_maintenance = true;
- if (bitmap_head == bitmap)
- bitmap_head = bitmap->next;
- if (bitmap->previous)
- bitmap->previous->next = bitmap->next;
- if (bitmap->next)
- bitmap->next->previous = bitmap->previous;
-
/* destroy bitmap */
if (bitmap->sprite_area) {
- area_size = 16 + 44 + bitmap->width * bitmap->height * 4;
- bitmap_direct_used -= area_size;
free(bitmap->sprite_area);
}
- if (bitmap->compressed) {
- header = (void *) bitmap->compressed;
- bitmap_compressed_used -= header->input_size +
- sizeof(struct bitmap_compressed_header);
- free(bitmap->compressed);
- }
- if (bitmap->filename[0])
- bitmap_delete_file(bitmap);
+
free(bitmap);
}
@@ -978,97 +546,6 @@ void bitmap_modified(void *vbitmap) {
}
-/**
- * Performs routine maintenance.
- */
-void bitmap_maintain(void)
-{
- unsigned int memory = 0;
- unsigned int compressed_memory = 0;
- struct bitmap *bitmap = bitmap_head;
- struct bitmap_compressed_header *header;
- unsigned int maintain_direct_size;
-
- LOG(("Performing maintenance."));
-
- /* under heavy loads allow an extra 30% to work with */
- maintain_direct_size = bitmap_direct_size;
- if (!bitmap_maintenance_priority)
- maintain_direct_size = maintain_direct_size * 0.7;
-
- if ((!bitmap) || ((bitmap_direct_used < maintain_direct_size) &&
- (bitmap_compressed_used < bitmap_compressed_size))) {
- bitmap_maintenance = bitmap_maintenance_priority;
- bitmap_maintenance_priority = false;
- return;
- }
-
- /* we don't change the first bitmap_MEMORY entries as they
- * will automatically be loaded/decompressed from whatever state
- * they are in when neeeded. */
- for (; bitmap && (memory < maintain_direct_size);
- bitmap = bitmap->next) {
- if (bitmap->sprite_area)
- memory += bitmap->width * bitmap->height * 4;
- else if ((bitmap->compressed) &&
- (!bitmap_maintenance_priority)) {
- header = (void *) bitmap->compressed;
- compressed_memory += header->input_size +
- sizeof(struct bitmap_compressed_header);
- }
- }
-
- if (!bitmap) {
- bitmap_maintenance = bitmap_maintenance_priority;
- bitmap_maintenance_priority = false;
- return;
- }
-
- /* under heavy loads, we ignore compression */
- if (!bitmap_maintenance_priority) {
- /* for the next section, up until bitmap_COMPRESSED we
- * forcibly compress the data if it's currently held directly
- * in memory */
- for (; bitmap && (compressed_memory < bitmap_compressed_size);
- bitmap = bitmap->next) {
- if (bitmap->sprite_area) {
- if ((bitmap->width * bitmap->height) <=
- (512 * 512))
- bitmap_compress(bitmap);
- else
- bitmap_save_file(bitmap);
- return;
- }
- if (bitmap->compressed) {
- header = (void *) bitmap->compressed;
- compressed_memory += header->input_size +
- sizeof(struct bitmap_compressed_header);
- }
- }
- if (!bitmap) {
- bitmap_maintenance = false;
- return;
- }
- }
-
- /* for the remaining entries we dump to disk */
- for (; bitmap; bitmap = bitmap->next) {
- if ((bitmap->sprite_area) || (bitmap->compressed)) {
- if (bitmap_maintenance_priority) {
- if (bitmap->sprite_area)
- bitmap_save_file(bitmap);
-
- } else {
- bitmap_save_file(bitmap);
- return;
- }
- }
- }
- bitmap_maintenance = bitmap_maintenance_priority;
- bitmap_maintenance_priority = false;
-}
-
-
int bitmap_get_width(void *vbitmap)
{
struct bitmap *bitmap = (struct bitmap *) vbitmap;
diff --git a/riscos/bitmap.h b/riscos/bitmap.h
index 1253830..43a00a5 100644
--- a/riscos/bitmap.h
+++ b/riscos/bitmap.h
@@ -34,33 +34,9 @@ struct bitmap {
void *private_word;
osspriteop_area *sprite_area; /** Uncompressed data, or NULL */
- char *compressed; /** Compressed data, or NULL */
- char filename[12]; /** Data filename, or '/0' */
-
- struct bitmap *previous; /** Previous bitmap */
- struct bitmap *next; /** Next bitmap */
};
void bitmap_overlay_sprite(struct bitmap *bitmap, const osspriteop_header *s);
-void bitmap_initialise_memory(void);
-void bitmap_quit(void);
-void bitmap_maintain(void);
-
-/** Whether maintenance of the pool states is needed
-*/
-extern bool bitmap_maintenance;
-
-/** Whether maintenance of the pool is high priority
-*/
-extern bool bitmap_maintenance_priority;
-
-/** Maximum amount of memory for direct images
-*/
-extern unsigned int bitmap_direct_size;
-
-/** Total size of compressed area
-*/
-extern unsigned int bitmap_compressed_size;
#endif
diff --git a/riscos/configure.c b/riscos/configure.c
index 99c69e1..0f5ee32 100644
--- a/riscos/configure.c
+++ b/riscos/configure.c
@@ -108,9 +108,6 @@ void ro_gui_configure_initialise(void)
ro_gui_configure_register("con_lang",
ro_gui_options_language_initialise,
ro_gui_wimp_event_finalise);
- ro_gui_configure_register("con_memory",
- ro_gui_options_memory_initialise,
- ro_gui_wimp_event_finalise);
ro_gui_configure_register("con_theme",
ro_gui_options_theme_initialise,
ro_gui_options_theme_finalise);
diff --git a/riscos/configure.h b/riscos/configure.h
index da29d1c..c190a6d 100644
--- a/riscos/configure.h
+++ b/riscos/configure.h
@@ -1,34 +1,34 @@
-/*
- * Copyright 2005 Richard Wilson <info(a)tinct.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/>.
- */
-
-/** \file
- * RISC OS option setting (interface).
- */
-
-
-#ifndef _NETSURF_RISCOS_CONFIGURE_H_
-#define _NETSURF_RISCOS_CONFIGURE_H_
-
-#include <stdbool.h>
-#include "oslib/os.h"
-#include "oslib/wimp.h"
-
-void ro_gui_configure_initialise(void);
-void ro_gui_configure_show(void);
+/*
+ * Copyright 2005 Richard Wilson <info(a)tinct.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/>.
+ */
-#endif
+/** \file
+ * RISC OS option setting (interface).
+ */
+
+
+#ifndef _NETSURF_RISCOS_CONFIGURE_H_
+#define _NETSURF_RISCOS_CONFIGURE_H_
+
+#include <stdbool.h>
+#include "oslib/os.h"
+#include "oslib/wimp.h"
+
+void ro_gui_configure_initialise(void);
+void ro_gui_configure_show(void);
+
+#endif
diff --git a/riscos/configure/con_memory.c b/riscos/configure/con_memory.c
deleted file mode 100644
index 2736849..0000000
--- a/riscos/configure/con_memory.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright 2006 Richard Wilson <info(a)tinct.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 <stdbool.h>
-#include "utils/nsoption.h"
-#include "riscos/bitmap.h"
-#include "riscos/wimp.h"
-#include "riscos/wimp_event.h"
-#include "riscos/dialog.h"
-#include "riscos/configure/configure.h"
-
-
-#define MEMORY_DIRECT_FIELD 3
-#define MEMORY_DIRECT_DEC 4
-#define MEMORY_DIRECT_INC 5
-#define MEMORY_DIRECT_TEXT 6
-#define MEMORY_DIRECT_AUTO 7
-#define MEMORY_COMPRESSED_FIELD 9
-#define MEMORY_COMPRESSED_DEC 10
-#define MEMORY_COMPRESSED_INC 11
-#define MEMORY_COMPRESSED_TEXT 12
-#define MEMORY_COMPRESSED_AUTO 13
-#define MEMORY_DEFAULT_BUTTON 14
-#define MEMORY_CANCEL_BUTTON 15
-#define MEMORY_OK_BUTTON 16
-
-static bool ro_gui_options_memory_click(wimp_pointer *pointer);
-static bool ro_gui_options_memory_ok(wimp_w w);
-static void ro_gui_options_update_shading(wimp_w w);
-
-bool ro_gui_options_memory_initialise(wimp_w w)
-{
- /* set the current values */
- ro_gui_set_icon_decimal(w, MEMORY_DIRECT_FIELD,
- (bitmap_direct_size * 10) >> 20, 1);
- ro_gui_set_icon_decimal(w, MEMORY_COMPRESSED_FIELD,
- (bitmap_compressed_size * 10) >> 20, 1);
- ro_gui_set_icon_selected_state(w, MEMORY_DIRECT_AUTO,
- (nsoption_int(image_memory_direct) == -1));
- ro_gui_set_icon_selected_state(w, MEMORY_COMPRESSED_AUTO,
- (nsoption_int(image_memory_compressed) == -1));
- ro_gui_options_update_shading(w);
-
- /* register icons */
- ro_gui_wimp_event_register_checkbox(w, MEMORY_DIRECT_AUTO);
- ro_gui_wimp_event_register_checkbox(w, MEMORY_COMPRESSED_AUTO);
- ro_gui_wimp_event_register_text_field(w, MEMORY_DIRECT_TEXT);
- ro_gui_wimp_event_register_text_field(w, MEMORY_COMPRESSED_TEXT);
- ro_gui_wimp_event_register_numeric_field(w, MEMORY_DIRECT_FIELD,
- MEMORY_DIRECT_INC, MEMORY_DIRECT_DEC,
- 10, 5120, 10, 1);
- ro_gui_wimp_event_register_numeric_field(w, MEMORY_COMPRESSED_FIELD,
- MEMORY_COMPRESSED_INC, MEMORY_COMPRESSED_DEC,
- 10, 5120, 10, 1);
- ro_gui_wimp_event_register_mouse_click(w,
- ro_gui_options_memory_click);
- ro_gui_wimp_event_register_cancel(w, MEMORY_CANCEL_BUTTON);
- ro_gui_wimp_event_register_ok(w, MEMORY_OK_BUTTON,
- ro_gui_options_memory_ok);
- ro_gui_wimp_event_set_help_prefix(w, "HelpMemoryConfig");
- ro_gui_wimp_event_memorise(w);
- return true;
-
-}
-
-bool ro_gui_options_memory_click(wimp_pointer *pointer)
-{
- switch (pointer->i) {
- case MEMORY_DIRECT_AUTO:
- ro_gui_options_update_shading(pointer->w);
- return false;
- case MEMORY_COMPRESSED_AUTO:
- ro_gui_options_update_shading(pointer->w);
- return false;
- case MEMORY_DEFAULT_BUTTON:
- ro_gui_set_icon_decimal(pointer->w, MEMORY_DIRECT_FIELD,
- (bitmap_direct_size * 10) >> 20, 1);
- ro_gui_set_icon_decimal(pointer->w, MEMORY_COMPRESSED_FIELD,
- (bitmap_compressed_size * 10) >> 20, 1);
- ro_gui_set_icon_selected_state(pointer->w,
- MEMORY_DIRECT_AUTO, true);
- ro_gui_set_icon_selected_state(pointer->w,
- MEMORY_COMPRESSED_AUTO, true);
- ro_gui_options_update_shading(pointer->w);
- return true;
- }
- return false;
-}
-
-void ro_gui_options_update_shading(wimp_w w)
-{
- bool shaded;
-
- shaded = ro_gui_get_icon_selected_state(w, MEMORY_DIRECT_AUTO);
- ro_gui_set_icon_shaded_state(w, MEMORY_DIRECT_FIELD, shaded);
- ro_gui_set_icon_shaded_state(w, MEMORY_DIRECT_INC, shaded);
- ro_gui_set_icon_shaded_state(w, MEMORY_DIRECT_DEC, shaded);
- ro_gui_set_icon_shaded_state(w, MEMORY_DIRECT_TEXT, shaded);
- shaded = ro_gui_get_icon_selected_state(w, MEMORY_COMPRESSED_AUTO);
- ro_gui_set_icon_shaded_state(w, MEMORY_COMPRESSED_FIELD, shaded);
- ro_gui_set_icon_shaded_state(w, MEMORY_COMPRESSED_INC, shaded);
- ro_gui_set_icon_shaded_state(w, MEMORY_COMPRESSED_DEC, shaded);
- ro_gui_set_icon_shaded_state(w, MEMORY_COMPRESSED_TEXT, shaded);
-}
-
-bool ro_gui_options_memory_ok(wimp_w w)
-{
- /* set the option values */
- if (ro_gui_get_icon_selected_state(w, MEMORY_DIRECT_AUTO))
- nsoption_set_int(image_memory_direct, -1);
- else
- nsoption_set_int(image_memory_direct,
- (((ro_gui_get_icon_decimal(w, MEMORY_DIRECT_FIELD, 1)
- << 10) + 1023) / 10));
- if (ro_gui_get_icon_selected_state(w, MEMORY_COMPRESSED_AUTO))
- nsoption_set_int(image_memory_compressed, -1);
- else
- nsoption_set_int(image_memory_compressed,
- (((ro_gui_get_icon_decimal(w, MEMORY_COMPRESSED_FIELD, 1)
- << 10) + 1023) / 10));
- /* update the memory usage */
- bitmap_initialise_memory();
- ro_gui_set_icon_decimal(w, MEMORY_DIRECT_FIELD,
- (bitmap_direct_size * 10) >> 20, 1);
- ro_gui_set_icon_decimal(w, MEMORY_COMPRESSED_FIELD,
- (bitmap_compressed_size * 10) >> 20, 1);
- /* save the options */
- ro_gui_save_options();
- return true;
-}
diff --git a/riscos/configure/configure.h b/riscos/configure/configure.h
index 5350be8..e5cdb39 100644
--- a/riscos/configure/configure.h
+++ b/riscos/configure/configure.h
@@ -36,7 +36,6 @@ bool ro_gui_options_image_initialise(wimp_w w);
void ro_gui_options_image_finalise(wimp_w w);
bool ro_gui_options_interface_initialise(wimp_w w);
bool ro_gui_options_language_initialise(wimp_w w);
-bool ro_gui_options_memory_initialise(wimp_w w);
bool ro_gui_options_security_initialise(wimp_w w);
bool ro_gui_options_theme_initialise(wimp_w w);
void ro_gui_options_theme_finalise(wimp_w w);
diff --git a/riscos/gui.c b/riscos/gui.c
index fc857f2..9b3bf4a 100644
--- a/riscos/gui.c
+++ b/riscos/gui.c
@@ -483,9 +483,6 @@ static void gui_init(int argc, char** argv)
/* Initialise save complete functionality */
save_complete_init();
- /* Initialise bitmap memory pool */
- bitmap_initialise_memory();
-
/* Load in visited URLs and Cookies */
urldb_load(nsoption_charp(url_path));
urldb_load_cookies(nsoption_charp(cookie_file));
@@ -921,7 +918,6 @@ int main(int argc, char** argv)
void gui_quit(void)
{
- bitmap_quit();
urldb_save_cookies(nsoption_charp(cookie_jar));
urldb_save(nsoption_charp(url_save));
ro_gui_window_quit();
@@ -1037,8 +1033,8 @@ void gui_poll(bool active)
track_poll_offset = ro_mouse_poll_interval();
if (active) {
event = wimp_poll(mask, &block, 0);
- } else if (sched_active || (track_poll_offset > 0) || browser_reformat_pending ||
- bitmap_maintenance) {
+ } else if (sched_active || (track_poll_offset > 0) ||
+ browser_reformat_pending) {
os_t t = os_read_monotonic_time();
if (track_poll_offset > 0)
@@ -1070,9 +1066,6 @@ void gui_poll(bool active)
if (browser_reformat_pending && event == wimp_NULL_REASON_CODE)
ro_gui_window_process_reformats();
- else if (bitmap_maintenance_priority ||
- (bitmap_maintenance && event == wimp_NULL_REASON_CODE))
- bitmap_maintain();
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=d041594fd9b793816e6...
commit d041594fd9b793816e62a3209e6877c8055b7e3e
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Lose forward declaration.
diff --git a/riscos/bitmap.c b/riscos/bitmap.c
index 9e808c7..0f54003 100644
--- a/riscos/bitmap.c
+++ b/riscos/bitmap.c
@@ -96,226 +96,197 @@ struct bitmap_compressed_header {
char bitmap_unixname[256];
char bitmap_filename[256];
-static bool bitmap_initialise(struct bitmap *bitmap);
-static void bitmap_decompress(struct bitmap *bitmap);
-static void bitmap_compress(struct bitmap *bitmap);
-static void bitmap_load_file(struct bitmap *bitmap);
-static void bitmap_save_file(struct bitmap *bitmap);
-static void bitmap_delete_file(struct bitmap *bitmap);
-/**
- * Initialise the bitmap memory pool.
- */
+static void bitmap_delete_file(struct bitmap *bitmap)
+{
+ assert(bitmap->filename[0]);
+ filename_release(bitmap->filename);
+ bitmap->filename[0] = 0;
+}
-void bitmap_initialise_memory(void)
+
+static void bitmap_load_file(struct bitmap *bitmap)
{
- int available_memory, direct_size, compressed_size;
- int free_slot;
+ int len;
+ fileswitch_object_type obj_type;
os_error *error;
+ char *r;
+ struct bitmap_compressed_header *bitmap_compressed;
+ osspriteop_header *bitmap_direct;
+ int *data;
- /* calculate how much memory is currently free
- (Note that the free_slot returned by wimp_slot_size
- includes the next_slot; the value displayed by the
- TaskManager has been adjusted to make it more logical
- for the user).
- */
- error = xwimp_slot_size(-1, -1, NULL, NULL, &free_slot);
- if (error) {
- LOG(("xwimp_slot_size: 0x%x: %s",
- error->errnum, error->errmess));
- warn_user("WimpError", error->errmess);
+ assert(bitmap->filename);
+
+ sprintf(bitmap_unixname, "%s/%s", TEMP_FILENAME_PREFIX,
+ bitmap->filename);
+ r = __riscosify(bitmap_unixname, 0, __RISCOSIFY_NO_SUFFIX,
+ bitmap_filename, 256, 0);
+ if (r == 0) {
+ LOG(("__riscosify failed"));
return;
}
- available_memory = free_slot;
+ error = xosfile_read_stamped_no_path(bitmap_filename,
+ &obj_type, 0, 0, &len, 0, 0);
+ if ((error) || (obj_type != fileswitch_IS_FILE))
+ return;
- /* calculate our memory block sizes */
- if (nsoption_int(image_memory_direct) == -1) {
- /* claim 25% of free memory - min 256KB, max 32768KB */
- direct_size = available_memory / 4;
- if (direct_size < (256 << 10))
- direct_size = (256 << 10);
- if (direct_size > (32768 << 10))
- direct_size = (32768 << 10);
- } else {
- direct_size = (nsoption_int(image_memory_direct) << 10);
+ bitmap->compressed = malloc(len);
+ if (!bitmap->compressed)
+ return;
+
+ error = xosfile_load_stamped_no_path(bitmap_filename,
+ (byte *) bitmap->compressed, 0, 0, 0, 0, 0);
+ if (error) {
+ free(bitmap->compressed);
+ bitmap->compressed = NULL;
+ return;
}
- if (nsoption_int(image_memory_compressed) == -1) {
- /* claim 10% of free memory - min 256KB, max 4192KB */
- compressed_size = available_memory / 10;
- if (compressed_size < (256 << 10))
- compressed_size = 0;
- if (compressed_size > (4192 << 10))
- compressed_size = (4192 << 10);
+
+ data = (void *) bitmap->compressed;
+
+ LOG(("Loaded file from disk"));
+ /* Sanity check the file we've just loaded:
+ * If it's an uncompressed buffer, then it's a raw sprite area,
+ * including the total size word at the start. Therefore, we check
+ * that:
+ * a) The declared total area size == file length
+ * b) The offset to the first free word == file length
+ * c) There is only 1 sprite in the area
+ * d) The name of the sprite in the area is "bitmap"
+ *
+ * If it's a compressed buffer, then we check that:
+ * a) The declared input size + header size == file length
+ * b) The name of the buffer is "bitmap"
+ *
+ * If it's neither of these, we fail.
+ */
+ if (*data == len && *(data + 3) == len && *(data + 1) == 1 &&
+ strncmp(bitmap->compressed + 20, "bitmap", 6) == 0) {
+ bitmap->sprite_area = (void *) bitmap->compressed;
+ bitmap->compressed = NULL;
+ bitmap_direct = (osspriteop_header *)(bitmap->sprite_area + 1);
+ bitmap->width = bitmap_direct->width + 1;
+ bitmap->height = bitmap_direct->height + 1;
+ bitmap_direct_used += 16 + 44 +
+ bitmap->width * bitmap->height * 4;
+ } else if ((int) (*(data + 6) +
+ sizeof(struct bitmap_compressed_header)) == len &&
+ strncmp(bitmap->compressed + 8, "bitmap", 6) == 0) {
+ bitmap_compressed = (void *) bitmap->compressed;
+ bitmap_compressed_used -= bitmap_compressed->input_size +
+ sizeof(struct bitmap_compressed_header);
+ bitmap->width = bitmap_compressed->width;
+ bitmap->height = bitmap_compressed->height;
} else {
- compressed_size = (nsoption_int(image_memory_compressed) << 10);
+ free(bitmap->compressed);
+ bitmap->compressed = NULL;
+ return;
}
-
- /* set our values. No fixed buffers here, ho hum. */
- bitmap_direct_size = direct_size;
- bitmap_compressed_size = compressed_size;
- bitmap_maintenance = bitmap_maintenance_priority = true;
+ if (bitmap->state & BITMAP_MODIFIED)
+ bitmap_delete_file(bitmap);
}
-/**
- * Prepare for the end of a session.
- */
-
-void bitmap_quit(void)
+static void bitmap_save_file(struct bitmap *bitmap)
{
- struct bitmap *bitmap;
-
- for (bitmap = bitmap_head; bitmap; bitmap = bitmap->next)
- if ((bitmap->state & BITMAP_PERSISTENT) &&
- ((bitmap->state & BITMAP_MODIFIED) ||
- (bitmap->filename[0] == '\0')))
- bitmap_save_file(bitmap);
-}
+ unsigned int area_size;
+ const char *filename;
+ char *r;
+ os_error *error;
+ struct bitmap_compressed_header *header;
+ assert(bitmap);
-/**
- * Create a bitmap.
- *
- * \param width width of image in pixels
- * \param height width of image in pixels
- * \param clear whether to clear the image ready for use
- * \return an opaque struct bitmap, or NULL on memory exhaustion
- */
+ if (!bitmap->compressed && !bitmap->sprite_area) {
+ LOG(("bitmap has no data"));
+ return;
+ }
-void *bitmap_create(int width, int height, unsigned int state)
-{
- struct bitmap *bitmap;
+ /* unmodified bitmaps will still have their file available */
+ if ((!(bitmap->state & BITMAP_MODIFIED)) && bitmap->filename[0]) {
+ if (bitmap->sprite_area)
+ free(bitmap->sprite_area);
+ bitmap->sprite_area = NULL;
+ if (bitmap->compressed)
+ free(bitmap->compressed);
+ bitmap->compressed = NULL;
+ return;
+ }
- if (width == 0 || height == 0)
- return NULL;
+ /* dump the data (compressed or otherwise) to disk */
+ filename = filename_request();
+ if (!filename) {
+ LOG(("filename_request failed"));
+ return;
+ }
- bitmap = calloc(1, sizeof(struct bitmap));
- if (!bitmap)
- return NULL;
- bitmap->width = width;
- bitmap->height = height;
- bitmap->state = state;
+ strcpy(bitmap->filename, filename);
+ sprintf(bitmap_unixname, "%s/%s", TEMP_FILENAME_PREFIX,
+ bitmap->filename);
+ r = __riscosify(bitmap_unixname, 0, __RISCOSIFY_NO_SUFFIX,
+ bitmap_filename, 256, 0);
+ if (r == 0) {
+ LOG(("__riscosify failed"));
+ return;
+ }
+ if (bitmap->compressed) {
+ header = (void *) bitmap->compressed;
+ area_size = header->input_size +
+ sizeof(struct bitmap_compressed_header);
+ error = xosfile_save_stamped(bitmap_filename, 0xffd,
+ (byte *) bitmap->compressed,
+ (byte *) bitmap->compressed + area_size);
+ } else {
+ area_size = bitmap->width * bitmap->height * 4 +
+ sizeof(osspriteop_header) +
+ sizeof(osspriteop_area);
+ error = xosfile_save_stamped(bitmap_filename, 0xffd,
+ (byte *) bitmap->sprite_area,
+ ((byte *) bitmap->sprite_area) + area_size);
+ }
- /* link into our list of bitmaps at the head */
- if (bitmap_head) {
- bitmap->next = bitmap_head;
- bitmap_head->previous = bitmap;
+ if (error) {
+ LOG(("xosfile_save_stamped: 0x%x: %s",
+ error->errnum, error->errmess));
+ bitmap->filename[0] = 0;
+ } else {
+ if (bitmap->sprite_area) {
+ bitmap_direct_used -= area_size;
+ free(bitmap->sprite_area);
+ }
+ bitmap->sprite_area = NULL;
+ if (bitmap->compressed) {
+ bitmap_compressed_used -= area_size;
+ free(bitmap->compressed);
+ }
+ bitmap->compressed = NULL;
+ bitmap->state &= ~BITMAP_MODIFIED;
+ LOG(("Saved file to disk"));
}
- bitmap_head = bitmap;
- return bitmap;
}
/**
- * Overlay a sprite onto the given bitmap
+ * Initialise a bitmaps sprite area.
*
- * \param bitmap bitmap object
- * \param s 8bpp sprite to be overlayed onto bitmap
+ * \param bitmap the bitmap to initialise
+ * \param clear whether to clear the image ready for use
*/
-void bitmap_overlay_sprite(struct bitmap *bitmap, const osspriteop_header *s)
+static bool bitmap_initialise(struct bitmap *bitmap)
{
- const os_colour *palette;
- const byte *sp, *mp;
- bool masked = false;
- bool alpha = false;
- os_error *error;
- int dp_offset;
- int sp_offset;
- unsigned *dp;
- int x, y;
- int w, h;
+ unsigned int area_size;
+ osspriteop_area *sprite_area;
+ osspriteop_header *sprite;
- assert(sprite_bpp(s) == 8);
+ assert(!bitmap->sprite_area);
- if ((unsigned)s->mode & 0x80000000U)
- alpha = true;
-
- error = xosspriteop_read_sprite_info(osspriteop_PTR,
- (osspriteop_area *)0x100,
- (osspriteop_id)s,
- &w, &h, NULL, NULL);
- if (error) {
- LOG(("xosspriteop_read_sprite_info: 0x%x:%s",
- error->errnum, error->errmess));
- return;
- }
- sp_offset = ((s->width + 1) * 4) - w;
-
- if (w > bitmap->width)
- w = bitmap->width;
- if (h > bitmap->height)
- h = bitmap->height;
-
- dp_offset = bitmap_get_rowstride(bitmap) / 4;
-
- dp = (void*)bitmap_get_buffer(bitmap);
- if (!dp)
- return;
- sp = (byte*)s + s->image;
- mp = (byte*)s + s->mask;
-
- sp += s->left_bit / 8;
- mp += s->left_bit / 8;
-
- if (s->image > (int)sizeof(*s))
- palette = (os_colour*)(s + 1);
- else
- palette = default_palette8;
-
- if (s->mask != s->image) {
- masked = true;
- bitmap_set_opaque(bitmap, false);
- }
-
- /* (partially-)transparent pixels in the overlayed sprite retain
- * their transparency in the output bitmap; opaque sprite pixels
- * are also propagated to the bitmap, except those which are the
- * OVERLAY_INDEX colour which allow the original bitmap contents to
- * show through */
- for (y = 0; y < h; y++) {
- unsigned *sdp = dp;
- for(x = 0; x < w; x++) {
- os_colour d = ((unsigned)palette[(*sp) << 1]) >> 8;
- if (*sp++ == OVERLAY_INDEX)
- d = *dp;
- if (masked) {
- if (alpha)
- d |= ((*mp << 24) ^ 0xff000000U);
- else if (*mp)
- d |= 0xff000000U;
- }
- *dp++ = d;
- mp++;
- }
- dp = sdp + dp_offset;
- sp += sp_offset;
- mp += sp_offset;
- }
-}
-
-
-/**
- * Initialise a bitmaps sprite area.
- *
- * \param bitmap the bitmap to initialise
- * \param clear whether to clear the image ready for use
- */
-
-bool bitmap_initialise(struct bitmap *bitmap)
-{
- unsigned int area_size;
- osspriteop_area *sprite_area;
- osspriteop_header *sprite;
-
- assert(!bitmap->sprite_area);
-
- area_size = 16 + 44 + bitmap->width * bitmap->height * 4;
- if (bitmap->state & BITMAP_CLEAR_MEMORY)
- bitmap->sprite_area = calloc(1, area_size);
- else
- bitmap->sprite_area = malloc(area_size);
+ area_size = 16 + 44 + bitmap->width * bitmap->height * 4;
+ if (bitmap->state & BITMAP_CLEAR_MEMORY)
+ bitmap->sprite_area = calloc(1, area_size);
+ else
+ bitmap->sprite_area = malloc(area_size);
if (!bitmap->sprite_area)
return false;
@@ -348,77 +319,363 @@ bool bitmap_initialise(struct bitmap *bitmap)
}
-/**
- * Sets whether a bitmap should be plotted opaque
- *
- * \param bitmap a bitmap, as returned by bitmap_create()
- * \param opaque whether the bitmap should be plotted opaque
- */
-void bitmap_set_opaque(void *vbitmap, bool opaque)
+static void bitmap_decompress(struct bitmap *bitmap)
{
- struct bitmap *bitmap = (struct bitmap *) vbitmap;
- assert(bitmap);
+ unsigned int area_size;
+ _kernel_oserror *error;
+ int output_size;
+ struct bitmap_compressed_header *header;
- if (opaque)
- bitmap->state |= BITMAP_OPAQUE;
- else
- bitmap->state &= ~BITMAP_OPAQUE;
+ assert(bitmap->compressed);
+
+ /* ensure the width/height is correct */
+ header = (void *)bitmap->compressed;
+ if ((header->width != bitmap->width) ||
+ (header->height != bitmap->height)) {
+ LOG(("Warning: Mismatch between bitmap and compressed sizes"));
+ return;
+ }
+
+ /* create the image memory/header to decompress to */
+ if (!bitmap_initialise(bitmap))
+ return;
+
+ /* decompress the data */
+ output_size = bitmap->width * bitmap->height * 4 +
+ sizeof(struct osspriteop_header);
+ error = _swix(Tinct_Decompress, _IN(0) | _IN(2) | _IN(3) | _IN(7),
+ bitmap->compressed,
+ (char *)(bitmap->sprite_area + 1),
+ output_size,
+ 0);
+ if (error) {
+ LOG(("Decompression error"));
+ free(bitmap->sprite_area);
+ bitmap->sprite_area = NULL;
+ } else {
+ LOG(("Decompressed"));
+ area_size = header->input_size +
+ sizeof(struct bitmap_compressed_header);
+ bitmap_compressed_used -= area_size;
+ free(bitmap->compressed);
+ bitmap->compressed = NULL;
+ area_size = 16 + 44 + bitmap->width * bitmap->height * 4;
+ bitmap_direct_used += area_size;
+ }
}
-/**
- * Tests whether a bitmap has an opaque alpha channel
- *
- * \param bitmap a bitmap, as returned by bitmap_create()
- * \return whether the bitmap is opaque
- */
-bool bitmap_test_opaque(void *vbitmap)
+static void bitmap_compress(struct bitmap *bitmap)
{
- struct bitmap *bitmap = (struct bitmap *) vbitmap;
- unsigned char *sprite;
- unsigned int width, height, size;
- osspriteop_header *sprite_header;
- unsigned *p, *ep;
+ unsigned int area_size;
+ _kernel_oserror *error;
+ char *output;
+ unsigned int output_size, new_size;
+ unsigned int flags = 0;
+ float calc;
- assert(bitmap);
+ /* get the maximum output size (33/32 * size) */
+ output_size = ((bitmap->width * bitmap->height * 4 * 33) >> 5) +
+ sizeof(struct bitmap_compressed_header);
+ output = malloc(output_size);
+ if (!output)
+ return;
- sprite = bitmap_get_buffer(bitmap);
- if (!sprite)
- return false;
+ /* compress the data */
+ if (bitmap->state & BITMAP_OPAQUE)
+ flags |= tinct_OPAQUE_IMAGE;
+ error = _swix(Tinct_Compress, _IN(0) | _IN(2) | _IN(7) | _OUT(0),
+ (char *)(bitmap->sprite_area + 1),
+ output,
+ flags,
+ &new_size);
+ if (error) {
+ LOG(("Compression error"));
+ free(output);
+ } else {
+ bitmap->compressed = realloc(output, new_size);
+ if (!bitmap->compressed) {
+ free(output);
+ } else {
+ bitmap_compressed_used += new_size;
+ if (bitmap->sprite_area) {
+ area_size = 16 + 44 + bitmap->width *
+ bitmap->height * 4;
+ bitmap_direct_used -= area_size;
+ free(bitmap->sprite_area);
+ }
+ bitmap->sprite_area = NULL;
+ calc = (100 / (float)output_size) * new_size;
+ LOG(("Compression: %i->%i, %.3f%%",
+ output_size, new_size, calc));
+ }
+ }
+}
- width = bitmap_get_rowstride(bitmap);
- sprite_header = (osspriteop_header *) (bitmap->sprite_area + 1);
+/**
+ * Initialise the bitmap memory pool.
+ */
- height = (sprite_header->height + 1);
-
- size = width * height;
-
- p = (void *) sprite;
+void bitmap_initialise_memory(void)
+{
+ int available_memory, direct_size, compressed_size;
+ int free_slot;
+ os_error *error;
- ep = (void *) (sprite + (size & ~31));
- while (p < ep) {
- /* \todo prefetch(p, 128)? */
- if (((p[0] & p[1] & p[2] & p[3] & p[4] & p[5] & p[6] & p[7])
- & 0xff000000U) != 0xff000000U)
- return false;
- p += 8;
+ /* calculate how much memory is currently free
+ (Note that the free_slot returned by wimp_slot_size
+ includes the next_slot; the value displayed by the
+ TaskManager has been adjusted to make it more logical
+ for the user).
+ */
+ error = xwimp_slot_size(-1, -1, NULL, NULL, &free_slot);
+ if (error) {
+ LOG(("xwimp_slot_size: 0x%x: %s",
+ error->errnum, error->errmess));
+ warn_user("WimpError", error->errmess);
+ return;
}
+ available_memory = free_slot;
- ep = (void *) (sprite + size);
- while (p < ep) {
- if ((*p & 0xff000000U) != 0xff000000U) return false;
- p++;
+ /* calculate our memory block sizes */
+ if (nsoption_int(image_memory_direct) == -1) {
+ /* claim 25% of free memory - min 256KB, max 32768KB */
+ direct_size = available_memory / 4;
+ if (direct_size < (256 << 10))
+ direct_size = (256 << 10);
+ if (direct_size > (32768 << 10))
+ direct_size = (32768 << 10);
+ } else {
+ direct_size = (nsoption_int(image_memory_direct) << 10);
+ }
+ if (nsoption_int(image_memory_compressed) == -1) {
+ /* claim 10% of free memory - min 256KB, max 4192KB */
+ compressed_size = available_memory / 10;
+ if (compressed_size < (256 << 10))
+ compressed_size = 0;
+ if (compressed_size > (4192 << 10))
+ compressed_size = (4192 << 10);
+ } else {
+ compressed_size = (nsoption_int(image_memory_compressed) << 10);
}
- return true;
+ /* set our values. No fixed buffers here, ho hum. */
+ bitmap_direct_size = direct_size;
+ bitmap_compressed_size = compressed_size;
+ bitmap_maintenance = bitmap_maintenance_priority = true;
}
/**
- * Gets whether a bitmap should be plotted opaque
- *
- * \param bitmap a bitmap, as returned by bitmap_create()
+ * Prepare for the end of a session.
+ */
+
+void bitmap_quit(void)
+{
+ struct bitmap *bitmap;
+
+ for (bitmap = bitmap_head; bitmap; bitmap = bitmap->next)
+ if ((bitmap->state & BITMAP_PERSISTENT) &&
+ ((bitmap->state & BITMAP_MODIFIED) ||
+ (bitmap->filename[0] == '\0')))
+ bitmap_save_file(bitmap);
+}
+
+
+/**
+ * Create a bitmap.
+ *
+ * \param width width of image in pixels
+ * \param height width of image in pixels
+ * \param clear whether to clear the image ready for use
+ * \return an opaque struct bitmap, or NULL on memory exhaustion
+ */
+
+void *bitmap_create(int width, int height, unsigned int state)
+{
+ struct bitmap *bitmap;
+
+ if (width == 0 || height == 0)
+ return NULL;
+
+ bitmap = calloc(1, sizeof(struct bitmap));
+ if (!bitmap)
+ return NULL;
+ bitmap->width = width;
+ bitmap->height = height;
+ bitmap->state = state;
+
+ /* link into our list of bitmaps at the head */
+ if (bitmap_head) {
+ bitmap->next = bitmap_head;
+ bitmap_head->previous = bitmap;
+ }
+ bitmap_head = bitmap;
+ return bitmap;
+}
+
+
+/**
+ * Overlay a sprite onto the given bitmap
+ *
+ * \param bitmap bitmap object
+ * \param s 8bpp sprite to be overlayed onto bitmap
+ */
+
+void bitmap_overlay_sprite(struct bitmap *bitmap, const osspriteop_header *s)
+{
+ const os_colour *palette;
+ const byte *sp, *mp;
+ bool masked = false;
+ bool alpha = false;
+ os_error *error;
+ int dp_offset;
+ int sp_offset;
+ unsigned *dp;
+ int x, y;
+ int w, h;
+
+ assert(sprite_bpp(s) == 8);
+
+ if ((unsigned)s->mode & 0x80000000U)
+ alpha = true;
+
+ error = xosspriteop_read_sprite_info(osspriteop_PTR,
+ (osspriteop_area *)0x100,
+ (osspriteop_id)s,
+ &w, &h, NULL, NULL);
+ if (error) {
+ LOG(("xosspriteop_read_sprite_info: 0x%x:%s",
+ error->errnum, error->errmess));
+ return;
+ }
+ sp_offset = ((s->width + 1) * 4) - w;
+
+ if (w > bitmap->width)
+ w = bitmap->width;
+ if (h > bitmap->height)
+ h = bitmap->height;
+
+ dp_offset = bitmap_get_rowstride(bitmap) / 4;
+
+ dp = (void*)bitmap_get_buffer(bitmap);
+ if (!dp)
+ return;
+ sp = (byte*)s + s->image;
+ mp = (byte*)s + s->mask;
+
+ sp += s->left_bit / 8;
+ mp += s->left_bit / 8;
+
+ if (s->image > (int)sizeof(*s))
+ palette = (os_colour*)(s + 1);
+ else
+ palette = default_palette8;
+
+ if (s->mask != s->image) {
+ masked = true;
+ bitmap_set_opaque(bitmap, false);
+ }
+
+ /* (partially-)transparent pixels in the overlayed sprite retain
+ * their transparency in the output bitmap; opaque sprite pixels
+ * are also propagated to the bitmap, except those which are the
+ * OVERLAY_INDEX colour which allow the original bitmap contents to
+ * show through */
+ for (y = 0; y < h; y++) {
+ unsigned *sdp = dp;
+ for(x = 0; x < w; x++) {
+ os_colour d = ((unsigned)palette[(*sp) << 1]) >> 8;
+ if (*sp++ == OVERLAY_INDEX)
+ d = *dp;
+ if (masked) {
+ if (alpha)
+ d |= ((*mp << 24) ^ 0xff000000U);
+ else if (*mp)
+ d |= 0xff000000U;
+ }
+ *dp++ = d;
+ mp++;
+ }
+ dp = sdp + dp_offset;
+ sp += sp_offset;
+ mp += sp_offset;
+ }
+}
+
+
+/**
+ * Sets whether a bitmap should be plotted opaque
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
+ * \param opaque whether the bitmap should be plotted opaque
+ */
+void bitmap_set_opaque(void *vbitmap, bool opaque)
+{
+ struct bitmap *bitmap = (struct bitmap *) vbitmap;
+ assert(bitmap);
+
+ if (opaque)
+ bitmap->state |= BITMAP_OPAQUE;
+ else
+ bitmap->state &= ~BITMAP_OPAQUE;
+}
+
+
+/**
+ * Tests whether a bitmap has an opaque alpha channel
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
+ * \return whether the bitmap is opaque
+ */
+bool bitmap_test_opaque(void *vbitmap)
+{
+ struct bitmap *bitmap = (struct bitmap *) vbitmap;
+ unsigned char *sprite;
+ unsigned int width, height, size;
+ osspriteop_header *sprite_header;
+ unsigned *p, *ep;
+
+ assert(bitmap);
+
+ sprite = bitmap_get_buffer(bitmap);
+ if (!sprite)
+ return false;
+
+ width = bitmap_get_rowstride(bitmap);
+
+ sprite_header = (osspriteop_header *) (bitmap->sprite_area + 1);
+
+ height = (sprite_header->height + 1);
+
+ size = width * height;
+
+ p = (void *) sprite;
+
+ ep = (void *) (sprite + (size & ~31));
+ while (p < ep) {
+ /* \todo prefetch(p, 128)? */
+ if (((p[0] & p[1] & p[2] & p[3] & p[4] & p[5] & p[6] & p[7])
+ & 0xff000000U) != 0xff000000U)
+ return false;
+ p += 8;
+ }
+
+ ep = (void *) (sprite + size);
+ while (p < ep) {
+ if ((*p & 0xff000000U) != 0xff000000U) return false;
+ p++;
+ }
+
+ return true;
+}
+
+
+/**
+ * Gets whether a bitmap should be plotted opaque
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
*/
bool bitmap_get_opaque(void *vbitmap)
{
@@ -812,268 +1069,6 @@ void bitmap_maintain(void)
}
-void bitmap_decompress(struct bitmap *bitmap)
-{
- unsigned int area_size;
- _kernel_oserror *error;
- int output_size;
- struct bitmap_compressed_header *header;
-
- assert(bitmap->compressed);
-
- /* ensure the width/height is correct */
- header = (void *)bitmap->compressed;
- if ((header->width != bitmap->width) ||
- (header->height != bitmap->height)) {
- LOG(("Warning: Mismatch between bitmap and compressed sizes"));
- return;
- }
-
- /* create the image memory/header to decompress to */
- if (!bitmap_initialise(bitmap))
- return;
-
- /* decompress the data */
- output_size = bitmap->width * bitmap->height * 4 +
- sizeof(struct osspriteop_header);
- error = _swix(Tinct_Decompress, _IN(0) | _IN(2) | _IN(3) | _IN(7),
- bitmap->compressed,
- (char *)(bitmap->sprite_area + 1),
- output_size,
- 0);
- if (error) {
- LOG(("Decompression error"));
- free(bitmap->sprite_area);
- bitmap->sprite_area = NULL;
- } else {
- LOG(("Decompressed"));
- area_size = header->input_size +
- sizeof(struct bitmap_compressed_header);
- bitmap_compressed_used -= area_size;
- free(bitmap->compressed);
- bitmap->compressed = NULL;
- area_size = 16 + 44 + bitmap->width * bitmap->height * 4;
- bitmap_direct_used += area_size;
- }
-}
-
-
-void bitmap_compress(struct bitmap *bitmap)
-{
- unsigned int area_size;
- _kernel_oserror *error;
- char *output;
- unsigned int output_size, new_size;
- unsigned int flags = 0;
- float calc;
-
- /* get the maximum output size (33/32 * size) */
- output_size = ((bitmap->width * bitmap->height * 4 * 33) >> 5) +
- sizeof(struct bitmap_compressed_header);
- output = malloc(output_size);
- if (!output)
- return;
-
- /* compress the data */
- if (bitmap->state & BITMAP_OPAQUE)
- flags |= tinct_OPAQUE_IMAGE;
- error = _swix(Tinct_Compress, _IN(0) | _IN(2) | _IN(7) | _OUT(0),
- (char *)(bitmap->sprite_area + 1),
- output,
- flags,
- &new_size);
- if (error) {
- LOG(("Compression error"));
- free(output);
- } else {
- bitmap->compressed = realloc(output, new_size);
- if (!bitmap->compressed) {
- free(output);
- } else {
- bitmap_compressed_used += new_size;
- if (bitmap->sprite_area) {
- area_size = 16 + 44 + bitmap->width *
- bitmap->height * 4;
- bitmap_direct_used -= area_size;
- free(bitmap->sprite_area);
- }
- bitmap->sprite_area = NULL;
- calc = (100 / (float)output_size) * new_size;
- LOG(("Compression: %i->%i, %.3f%%",
- output_size, new_size, calc));
- }
- }
-}
-
-void bitmap_load_file(struct bitmap *bitmap)
-{
- int len;
- fileswitch_object_type obj_type;
- os_error *error;
- char *r;
- struct bitmap_compressed_header *bitmap_compressed;
- osspriteop_header *bitmap_direct;
- int *data;
-
- assert(bitmap->filename);
-
- sprintf(bitmap_unixname, "%s/%s", TEMP_FILENAME_PREFIX,
- bitmap->filename);
- r = __riscosify(bitmap_unixname, 0, __RISCOSIFY_NO_SUFFIX,
- bitmap_filename, 256, 0);
- if (r == 0) {
- LOG(("__riscosify failed"));
- return;
- }
- error = xosfile_read_stamped_no_path(bitmap_filename,
- &obj_type, 0, 0, &len, 0, 0);
- if ((error) || (obj_type != fileswitch_IS_FILE))
- return;
-
- bitmap->compressed = malloc(len);
- if (!bitmap->compressed)
- return;
-
- error = xosfile_load_stamped_no_path(bitmap_filename,
- (byte *) bitmap->compressed, 0, 0, 0, 0, 0);
- if (error) {
- free(bitmap->compressed);
- bitmap->compressed = NULL;
- return;
- }
-
- data = (void *) bitmap->compressed;
-
- LOG(("Loaded file from disk"));
- /* Sanity check the file we've just loaded:
- * If it's an uncompressed buffer, then it's a raw sprite area,
- * including the total size word at the start. Therefore, we check
- * that:
- * a) The declared total area size == file length
- * b) The offset to the first free word == file length
- * c) There is only 1 sprite in the area
- * d) The name of the sprite in the area is "bitmap"
- *
- * If it's a compressed buffer, then we check that:
- * a) The declared input size + header size == file length
- * b) The name of the buffer is "bitmap"
- *
- * If it's neither of these, we fail.
- */
- if (*data == len && *(data + 3) == len && *(data + 1) == 1 &&
- strncmp(bitmap->compressed + 20, "bitmap", 6) == 0) {
- bitmap->sprite_area = (void *) bitmap->compressed;
- bitmap->compressed = NULL;
- bitmap_direct = (osspriteop_header *)(bitmap->sprite_area + 1);
- bitmap->width = bitmap_direct->width + 1;
- bitmap->height = bitmap_direct->height + 1;
- bitmap_direct_used += 16 + 44 +
- bitmap->width * bitmap->height * 4;
- } else if ((int) (*(data + 6) +
- sizeof(struct bitmap_compressed_header)) == len &&
- strncmp(bitmap->compressed + 8, "bitmap", 6) == 0) {
- bitmap_compressed = (void *) bitmap->compressed;
- bitmap_compressed_used -= bitmap_compressed->input_size +
- sizeof(struct bitmap_compressed_header);
- bitmap->width = bitmap_compressed->width;
- bitmap->height = bitmap_compressed->height;
- } else {
- free(bitmap->compressed);
- bitmap->compressed = NULL;
- return;
- }
- if (bitmap->state & BITMAP_MODIFIED)
- bitmap_delete_file(bitmap);
-}
-
-
-void bitmap_save_file(struct bitmap *bitmap)
-{
- unsigned int area_size;
- const char *filename;
- char *r;
- os_error *error;
- struct bitmap_compressed_header *header;
-
- assert(bitmap);
-
- if (!bitmap->compressed && !bitmap->sprite_area) {
- LOG(("bitmap has no data"));
- return;
- }
-
- /* unmodified bitmaps will still have their file available */
- if ((!(bitmap->state & BITMAP_MODIFIED)) && bitmap->filename[0]) {
- if (bitmap->sprite_area)
- free(bitmap->sprite_area);
- bitmap->sprite_area = NULL;
- if (bitmap->compressed)
- free(bitmap->compressed);
- bitmap->compressed = NULL;
- return;
- }
-
- /* dump the data (compressed or otherwise) to disk */
- filename = filename_request();
- if (!filename) {
- LOG(("filename_request failed"));
- return;
- }
-
- strcpy(bitmap->filename, filename);
- sprintf(bitmap_unixname, "%s/%s", TEMP_FILENAME_PREFIX,
- bitmap->filename);
- r = __riscosify(bitmap_unixname, 0, __RISCOSIFY_NO_SUFFIX,
- bitmap_filename, 256, 0);
- if (r == 0) {
- LOG(("__riscosify failed"));
- return;
- }
- if (bitmap->compressed) {
- header = (void *) bitmap->compressed;
- area_size = header->input_size +
- sizeof(struct bitmap_compressed_header);
- error = xosfile_save_stamped(bitmap_filename, 0xffd,
- (byte *) bitmap->compressed,
- (byte *) bitmap->compressed + area_size);
- } else {
- area_size = bitmap->width * bitmap->height * 4 +
- sizeof(osspriteop_header) +
- sizeof(osspriteop_area);
- error = xosfile_save_stamped(bitmap_filename, 0xffd,
- (byte *) bitmap->sprite_area,
- ((byte *) bitmap->sprite_area) + area_size);
- }
-
- if (error) {
- LOG(("xosfile_save_stamped: 0x%x: %s",
- error->errnum, error->errmess));
- bitmap->filename[0] = 0;
- } else {
- if (bitmap->sprite_area) {
- bitmap_direct_used -= area_size;
- free(bitmap->sprite_area);
- }
- bitmap->sprite_area = NULL;
- if (bitmap->compressed) {
- bitmap_compressed_used -= area_size;
- free(bitmap->compressed);
- }
- bitmap->compressed = NULL;
- bitmap->state &= ~BITMAP_MODIFIED;
- LOG(("Saved file to disk"));
- }
-}
-
-
-void bitmap_delete_file(struct bitmap *bitmap)
-{
- assert(bitmap->filename[0]);
- filename_release(bitmap->filename);
- bitmap->filename[0] = 0;
-}
-
-
int bitmap_get_width(void *vbitmap)
{
struct bitmap *bitmap = (struct bitmap *) vbitmap;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=dba846b5b84533cf940...
commit dba846b5b84533cf940086312db2c596ebe3214e
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove unused function.
diff --git a/riscos/bitmap.c b/riscos/bitmap.c
index 0af01c9..9e808c7 100644
--- a/riscos/bitmap.c
+++ b/riscos/bitmap.c
@@ -208,54 +208,6 @@ void *bitmap_create(int width, int height, unsigned int state)
/**
- * Create a persistent, opaque bitmap from a file reference.
- *
- * \param file the file containing the image data
- * \return an opaque struct bitmap, or NULL on memory exhaustion
- */
-
-struct bitmap *bitmap_create_file(char *file)
-{
- struct bitmap *bitmap;
- char *r;
- fileswitch_object_type obj_type;
- os_error *error;
-
- if (file[0] == '\0')
- return NULL;
-
- /* check the file exists */
- sprintf(bitmap_unixname, "%s/%s", TEMP_FILENAME_PREFIX, file);
- r = __riscosify(bitmap_unixname, 0, __RISCOSIFY_NO_SUFFIX,
- bitmap_filename, 256, 0);
- if (r == 0) {
- LOG(("__riscosify failed"));
- return NULL;
- }
- error = xosfile_read_stamped_no_path(bitmap_filename,
- &obj_type, 0, 0, 0, 0, 0);
- if ((error) || (obj_type != fileswitch_IS_FILE))
- return NULL;
-
- if (!filename_claim(file))
- return NULL;
- bitmap = calloc(1, sizeof(struct bitmap));
- if (!bitmap)
- return NULL;
- bitmap->state = BITMAP_OPAQUE | BITMAP_PERSISTENT | BITMAP_READY;
- strcpy(bitmap->filename, file);
-
- /* link in at the head */
- if (bitmap_head) {
- bitmap->next = bitmap_head;
- bitmap_head->previous = bitmap;
- }
- bitmap_head = bitmap;
- return bitmap;
-}
-
-
-/**
* Overlay a sprite onto the given bitmap
*
* \param bitmap bitmap object
diff --git a/riscos/bitmap.h b/riscos/bitmap.h
index b6fd3ae..1253830 100644
--- a/riscos/bitmap.h
+++ b/riscos/bitmap.h
@@ -42,7 +42,6 @@ struct bitmap {
};
-struct bitmap *bitmap_create_file(char *file);
void bitmap_overlay_sprite(struct bitmap *bitmap, const osspriteop_header *s);
void bitmap_initialise_memory(void);
void bitmap_quit(void);
-----------------------------------------------------------------------
Summary of changes:
resources/FatMessages | 25 +-
riscos/Makefile.target | 2 +-
riscos/bitmap.c | 650 +++--------------------------------------
riscos/bitmap.h | 25 --
riscos/configure.c | 3 -
riscos/configure.h | 66 ++--
riscos/configure/con_memory.c | 145 ---------
riscos/configure/configure.h | 1 -
riscos/dialog.c | 6 +-
riscos/gui.c | 11 +-
riscos/gui.h | 2 +-
riscos/options.h | 2 -
riscos/templates/de | 214 +--------------
riscos/templates/en | 212 +-------------
riscos/templates/fr | 212 +-------------
riscos/templates/nl | 212 +-------------
riscos/wimp.c | 2 -
17 files changed, 89 insertions(+), 1701 deletions(-)
delete mode 100644 riscos/configure/con_memory.c
diff --git a/resources/FatMessages b/resources/FatMessages
index b78b5a7..6a3cbc8 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -4743,21 +4743,16 @@ de.ro.HelpConfigure7:Sprachen einstellen
fr.ro.HelpConfigure7:Outil de configuration de langue
it.ro.HelpConfigure7:Language configuration tool
nl.ro.HelpConfigure7:Language configuration tool
-en.ro.HelpConfigure8:Memory configuration tool
-de.ro.HelpConfigure8:Arbeitsspeicher konfigurieren
-fr.ro.HelpConfigure8:Outil de configuration de la mémoire
-it.ro.HelpConfigure8:Memory configuration tool
-nl.ro.HelpConfigure8:Memory configuration tool
-en.ro.HelpConfigure9:Theme configuration tool
-de.ro.HelpConfigure9:Themenauswahl
-fr.ro.HelpConfigure9:Outil de configuration de thème
-it.ro.HelpConfigure9:Theme configuration tool
-nl.ro.HelpConfigure9:Theme configuration tool
-en.ro.HelpConfigure10:Security and Privacy configuration tool
-de.ro.HelpConfigure10:Sicherheitseinstellungen und Privatsphäre
-fr.ro.HelpConfigure10:Outil de configuration de la sécurité et de la confidentialité
-it.ro.HelpConfigure10:Security and Privacy configuration tool
-nl.ro.HelpConfigure10:Security and Privacy configuration tool
+en.ro.HelpConfigure8:Theme configuration tool
+de.ro.HelpConfigure8:Themenauswahl
+fr.ro.HelpConfigure8:Outil de configuration de thème
+it.ro.HelpConfigure8:Theme configuration tool
+nl.ro.HelpConfigure8:Theme configuration tool
+en.ro.HelpConfigure9:Security and Privacy configuration tool
+de.ro.HelpConfigure9:Sicherheitseinstellungen und Privatsphäre
+fr.ro.HelpConfigure9:Outil de configuration de la sécurité et de la confidentialité
+it.ro.HelpConfigure9:Security and Privacy configuration tool
+nl.ro.HelpConfigure9:Security and Privacy configuration tool
en.ro.HelpCacheConfig:\Tcache configuration \w.
de.ro.HelpCacheConfig:Das ist das Fenster der Cache-Konfiguration.
diff --git a/riscos/Makefile.target b/riscos/Makefile.target
index b32590b..3d64e24 100644
--- a/riscos/Makefile.target
+++ b/riscos/Makefile.target
@@ -83,7 +83,7 @@ S_RISCOS := 401login.c assert.c bitmap.c buffer.c cookies.c configure.c \
throbber.c url_bar.c) \
$(addprefix configure/,con_cache.c con_connect.c con_content.c \
con_fonts.c con_home.c con_image.c con_inter.c con_language.c \
- con_memory.c con_secure.c con_theme.c)
+ con_secure.c con_theme.c)
S_RISCOS := $(addprefix riscos/,$(S_RISCOS))
TPL_RISCOS := de en fr nl # TODO: It'd be nice to auto-detect these
TPL_RISCOS := $(addprefix riscos/templates/,$(TPL_RISCOS))
diff --git a/riscos/bitmap.c b/riscos/bitmap.c
index 0af01c9..60b0345 100644
--- a/riscos/bitmap.c
+++ b/riscos/bitmap.c
@@ -50,127 +50,55 @@
/** Colour in the overlay sprite that allows the bitmap to show through */
#define OVERLAY_INDEX 0xfe
-#define MAINTENANCE_THRESHOLD 32
-
/** Size of buffer used when constructing mask data to be saved */
#define SAVE_CHUNK_SIZE 4096
-/** The head of the bitmap list
-*/
-struct bitmap *bitmap_head = NULL;
-
-/** Whether maintenance of the pool states is needed
-*/
-bool bitmap_maintenance = false;
-
-/** Whether maintenance of the pool is high priority
-*/
-bool bitmap_maintenance_priority = false;
-
-/** Maximum amount of memory for direct images
-*/
-unsigned int bitmap_direct_size;
-
-/** Current amount of memory for direct images
-*/
-unsigned int bitmap_direct_used = 0;
-
-/** Total size of compressed area
-*/
-unsigned int bitmap_compressed_size;
-
-/** Total size of compressed area
-*/
-unsigned int bitmap_compressed_used = 0;
-
-/** Compressed data header
-*/
-struct bitmap_compressed_header {
- int width;
- int height;
- char name[12];
- unsigned int flags;
- unsigned int input_size;
-};
-
-char bitmap_unixname[256];
-char bitmap_filename[256];
-
-static bool bitmap_initialise(struct bitmap *bitmap);
-static void bitmap_decompress(struct bitmap *bitmap);
-static void bitmap_compress(struct bitmap *bitmap);
-static void bitmap_load_file(struct bitmap *bitmap);
-static void bitmap_save_file(struct bitmap *bitmap);
-static void bitmap_delete_file(struct bitmap *bitmap);
-
/**
- * Initialise the bitmap memory pool.
+ * Initialise a bitmaps sprite area.
+ *
+ * \param bitmap the bitmap to initialise
+ * \param clear whether to clear the image ready for use
*/
-void bitmap_initialise_memory(void)
+static bool bitmap_initialise(struct bitmap *bitmap)
{
- int available_memory, direct_size, compressed_size;
- int free_slot;
- os_error *error;
+ unsigned int area_size;
+ osspriteop_area *sprite_area;
+ osspriteop_header *sprite;
- /* calculate how much memory is currently free
- (Note that the free_slot returned by wimp_slot_size
- includes the next_slot; the value displayed by the
- TaskManager has been adjusted to make it more logical
- for the user).
- */
- error = xwimp_slot_size(-1, -1, NULL, NULL, &free_slot);
- if (error) {
- LOG(("xwimp_slot_size: 0x%x: %s",
- error->errnum, error->errmess));
- warn_user("WimpError", error->errmess);
- return;
- }
- available_memory = free_slot;
-
- /* calculate our memory block sizes */
- if (nsoption_int(image_memory_direct) == -1) {
- /* claim 25% of free memory - min 256KB, max 32768KB */
- direct_size = available_memory / 4;
- if (direct_size < (256 << 10))
- direct_size = (256 << 10);
- if (direct_size > (32768 << 10))
- direct_size = (32768 << 10);
- } else {
- direct_size = (nsoption_int(image_memory_direct) << 10);
- }
- if (nsoption_int(image_memory_compressed) == -1) {
- /* claim 10% of free memory - min 256KB, max 4192KB */
- compressed_size = available_memory / 10;
- if (compressed_size < (256 << 10))
- compressed_size = 0;
- if (compressed_size > (4192 << 10))
- compressed_size = (4192 << 10);
- } else {
- compressed_size = (nsoption_int(image_memory_compressed) << 10);
- }
+ assert(!bitmap->sprite_area);
- /* set our values. No fixed buffers here, ho hum. */
- bitmap_direct_size = direct_size;
- bitmap_compressed_size = compressed_size;
- bitmap_maintenance = bitmap_maintenance_priority = true;
-}
+ area_size = 16 + 44 + bitmap->width * bitmap->height * 4;
+ if (bitmap->state & BITMAP_CLEAR_MEMORY)
+ bitmap->sprite_area = calloc(1, area_size);
+ else
+ bitmap->sprite_area = malloc(area_size);
+ if (!bitmap->sprite_area)
+ return false;
+ bitmap->state |= BITMAP_READY;
-/**
- * Prepare for the end of a session.
- */
+ /* area control block */
+ sprite_area = bitmap->sprite_area;
+ sprite_area->size = area_size;
+ sprite_area->sprite_count = 1;
+ sprite_area->first = 16;
+ sprite_area->used = area_size;
-void bitmap_quit(void)
-{
- struct bitmap *bitmap;
+ /* sprite control block */
+ sprite = (osspriteop_header *) (sprite_area + 1);
+ sprite->size = area_size - 16;
+ memset(sprite->name, 0x00, 12);
+ strncpy(sprite->name, "bitmap", 12);
+ sprite->width = bitmap->width - 1;
+ sprite->height = bitmap->height - 1;
+ sprite->left_bit = 0;
+ sprite->right_bit = 31;
+ sprite->image = sprite->mask = 44;
+ sprite->mode = tinct_SPRITE_MODE;
- for (bitmap = bitmap_head; bitmap; bitmap = bitmap->next)
- if ((bitmap->state & BITMAP_PERSISTENT) &&
- ((bitmap->state & BITMAP_MODIFIED) ||
- (bitmap->filename[0] == '\0')))
- bitmap_save_file(bitmap);
+ return true;
}
@@ -197,60 +125,6 @@ void *bitmap_create(int width, int height, unsigned int state)
bitmap->height = height;
bitmap->state = state;
- /* link into our list of bitmaps at the head */
- if (bitmap_head) {
- bitmap->next = bitmap_head;
- bitmap_head->previous = bitmap;
- }
- bitmap_head = bitmap;
- return bitmap;
-}
-
-
-/**
- * Create a persistent, opaque bitmap from a file reference.
- *
- * \param file the file containing the image data
- * \return an opaque struct bitmap, or NULL on memory exhaustion
- */
-
-struct bitmap *bitmap_create_file(char *file)
-{
- struct bitmap *bitmap;
- char *r;
- fileswitch_object_type obj_type;
- os_error *error;
-
- if (file[0] == '\0')
- return NULL;
-
- /* check the file exists */
- sprintf(bitmap_unixname, "%s/%s", TEMP_FILENAME_PREFIX, file);
- r = __riscosify(bitmap_unixname, 0, __RISCOSIFY_NO_SUFFIX,
- bitmap_filename, 256, 0);
- if (r == 0) {
- LOG(("__riscosify failed"));
- return NULL;
- }
- error = xosfile_read_stamped_no_path(bitmap_filename,
- &obj_type, 0, 0, 0, 0, 0);
- if ((error) || (obj_type != fileswitch_IS_FILE))
- return NULL;
-
- if (!filename_claim(file))
- return NULL;
- bitmap = calloc(1, sizeof(struct bitmap));
- if (!bitmap)
- return NULL;
- bitmap->state = BITMAP_OPAQUE | BITMAP_PERSISTENT | BITMAP_READY;
- strcpy(bitmap->filename, file);
-
- /* link in at the head */
- if (bitmap_head) {
- bitmap->next = bitmap_head;
- bitmap_head->previous = bitmap;
- }
- bitmap_head = bitmap;
return bitmap;
}
@@ -345,58 +219,6 @@ void bitmap_overlay_sprite(struct bitmap *bitmap, const osspriteop_header *s)
/**
- * Initialise a bitmaps sprite area.
- *
- * \param bitmap the bitmap to initialise
- * \param clear whether to clear the image ready for use
- */
-
-bool bitmap_initialise(struct bitmap *bitmap)
-{
- unsigned int area_size;
- osspriteop_area *sprite_area;
- osspriteop_header *sprite;
-
- assert(!bitmap->sprite_area);
-
- area_size = 16 + 44 + bitmap->width * bitmap->height * 4;
- if (bitmap->state & BITMAP_CLEAR_MEMORY)
- bitmap->sprite_area = calloc(1, area_size);
- else
- bitmap->sprite_area = malloc(area_size);
-
- if (!bitmap->sprite_area)
- return false;
- bitmap->state |= BITMAP_READY;
- bitmap_direct_used += area_size;
-
- /* area control block */
- sprite_area = bitmap->sprite_area;
- sprite_area->size = area_size;
- sprite_area->sprite_count = 1;
- sprite_area->first = 16;
- sprite_area->used = area_size;
-
- /* sprite control block */
- sprite = (osspriteop_header *) (sprite_area + 1);
- sprite->size = area_size - 16;
- memset(sprite->name, 0x00, 12);
- strncpy(sprite->name, "bitmap", 12);
- sprite->width = bitmap->width - 1;
- sprite->height = bitmap->height - 1;
- sprite->left_bit = 0;
- sprite->right_bit = 31;
- sprite->image = sprite->mask = 44;
- sprite->mode = tinct_SPRITE_MODE;
-
- bitmap_maintenance = true;
- bitmap_maintenance_priority |=
- (bitmap_direct_used > bitmap_direct_size * 0.9);
- return true;
-}
-
-
-/**
* Sets whether a bitmap should be plotted opaque
*
* \param bitmap a bitmap, as returned by bitmap_create()
@@ -491,38 +313,13 @@ unsigned char *bitmap_get_buffer(void *vbitmap)
struct bitmap *bitmap = (struct bitmap *) vbitmap;
assert(bitmap);
- /* move to the head of the list */
- if (bitmap_head != bitmap) {
- if (bitmap->previous)
- bitmap->previous->next = bitmap->next;
- if (bitmap->next)
- bitmap->next->previous = bitmap->previous;
- bitmap->next = bitmap_head;
- bitmap_head->previous = bitmap;
- bitmap->previous = NULL;
- bitmap_head = bitmap;
- }
-
/* dynamically create the buffer */
if (!(bitmap->state & BITMAP_READY)) {
if (!bitmap_initialise(bitmap))
return NULL;
}
- /* image is already decompressed, no change to image states */
- if (bitmap->sprite_area)
- return ((unsigned char *) (bitmap->sprite_area)) + 16 + 44;
-
- /* load and/or decompress the image */
- if (bitmap->filename[0])
- bitmap_load_file(bitmap);
- if (bitmap->compressed)
- bitmap_decompress(bitmap);
-
- bitmap_maintenance = true;
- bitmap_maintenance_priority |=
- (bitmap_direct_used > bitmap_direct_size * 0.9);
-
+ /* image data area should exist */
if (bitmap->sprite_area)
return ((unsigned char *) (bitmap->sprite_area)) + 16 + 44;
@@ -553,34 +350,14 @@ size_t bitmap_get_rowstride(void *vbitmap)
void bitmap_destroy(void *vbitmap)
{
struct bitmap *bitmap = (struct bitmap *) vbitmap;
- struct bitmap_compressed_header *header;
- unsigned int area_size;
assert(bitmap);
- /* delink from list */
- bitmap_maintenance = true;
- if (bitmap_head == bitmap)
- bitmap_head = bitmap->next;
- if (bitmap->previous)
- bitmap->previous->next = bitmap->next;
- if (bitmap->next)
- bitmap->next->previous = bitmap->previous;
-
/* destroy bitmap */
if (bitmap->sprite_area) {
- area_size = 16 + 44 + bitmap->width * bitmap->height * 4;
- bitmap_direct_used -= area_size;
free(bitmap->sprite_area);
}
- if (bitmap->compressed) {
- header = (void *) bitmap->compressed;
- bitmap_compressed_used -= header->input_size +
- sizeof(struct bitmap_compressed_header);
- free(bitmap->compressed);
- }
- if (bitmap->filename[0])
- bitmap_delete_file(bitmap);
+
free(bitmap);
}
@@ -769,359 +546,6 @@ void bitmap_modified(void *vbitmap) {
}
-/**
- * Performs routine maintenance.
- */
-void bitmap_maintain(void)
-{
- unsigned int memory = 0;
- unsigned int compressed_memory = 0;
- struct bitmap *bitmap = bitmap_head;
- struct bitmap_compressed_header *header;
- unsigned int maintain_direct_size;
-
- LOG(("Performing maintenance."));
-
- /* under heavy loads allow an extra 30% to work with */
- maintain_direct_size = bitmap_direct_size;
- if (!bitmap_maintenance_priority)
- maintain_direct_size = maintain_direct_size * 0.7;
-
- if ((!bitmap) || ((bitmap_direct_used < maintain_direct_size) &&
- (bitmap_compressed_used < bitmap_compressed_size))) {
- bitmap_maintenance = bitmap_maintenance_priority;
- bitmap_maintenance_priority = false;
- return;
- }
-
- /* we don't change the first bitmap_MEMORY entries as they
- * will automatically be loaded/decompressed from whatever state
- * they are in when neeeded. */
- for (; bitmap && (memory < maintain_direct_size);
- bitmap = bitmap->next) {
- if (bitmap->sprite_area)
- memory += bitmap->width * bitmap->height * 4;
- else if ((bitmap->compressed) &&
- (!bitmap_maintenance_priority)) {
- header = (void *) bitmap->compressed;
- compressed_memory += header->input_size +
- sizeof(struct bitmap_compressed_header);
- }
- }
-
- if (!bitmap) {
- bitmap_maintenance = bitmap_maintenance_priority;
- bitmap_maintenance_priority = false;
- return;
- }
-
- /* under heavy loads, we ignore compression */
- if (!bitmap_maintenance_priority) {
- /* for the next section, up until bitmap_COMPRESSED we
- * forcibly compress the data if it's currently held directly
- * in memory */
- for (; bitmap && (compressed_memory < bitmap_compressed_size);
- bitmap = bitmap->next) {
- if (bitmap->sprite_area) {
- if ((bitmap->width * bitmap->height) <=
- (512 * 512))
- bitmap_compress(bitmap);
- else
- bitmap_save_file(bitmap);
- return;
- }
- if (bitmap->compressed) {
- header = (void *) bitmap->compressed;
- compressed_memory += header->input_size +
- sizeof(struct bitmap_compressed_header);
- }
- }
- if (!bitmap) {
- bitmap_maintenance = false;
- return;
- }
- }
-
- /* for the remaining entries we dump to disk */
- for (; bitmap; bitmap = bitmap->next) {
- if ((bitmap->sprite_area) || (bitmap->compressed)) {
- if (bitmap_maintenance_priority) {
- if (bitmap->sprite_area)
- bitmap_save_file(bitmap);
-
- } else {
- bitmap_save_file(bitmap);
- return;
- }
- }
- }
- bitmap_maintenance = bitmap_maintenance_priority;
- bitmap_maintenance_priority = false;
-}
-
-
-void bitmap_decompress(struct bitmap *bitmap)
-{
- unsigned int area_size;
- _kernel_oserror *error;
- int output_size;
- struct bitmap_compressed_header *header;
-
- assert(bitmap->compressed);
-
- /* ensure the width/height is correct */
- header = (void *)bitmap->compressed;
- if ((header->width != bitmap->width) ||
- (header->height != bitmap->height)) {
- LOG(("Warning: Mismatch between bitmap and compressed sizes"));
- return;
- }
-
- /* create the image memory/header to decompress to */
- if (!bitmap_initialise(bitmap))
- return;
-
- /* decompress the data */
- output_size = bitmap->width * bitmap->height * 4 +
- sizeof(struct osspriteop_header);
- error = _swix(Tinct_Decompress, _IN(0) | _IN(2) | _IN(3) | _IN(7),
- bitmap->compressed,
- (char *)(bitmap->sprite_area + 1),
- output_size,
- 0);
- if (error) {
- LOG(("Decompression error"));
- free(bitmap->sprite_area);
- bitmap->sprite_area = NULL;
- } else {
- LOG(("Decompressed"));
- area_size = header->input_size +
- sizeof(struct bitmap_compressed_header);
- bitmap_compressed_used -= area_size;
- free(bitmap->compressed);
- bitmap->compressed = NULL;
- area_size = 16 + 44 + bitmap->width * bitmap->height * 4;
- bitmap_direct_used += area_size;
- }
-}
-
-
-void bitmap_compress(struct bitmap *bitmap)
-{
- unsigned int area_size;
- _kernel_oserror *error;
- char *output;
- unsigned int output_size, new_size;
- unsigned int flags = 0;
- float calc;
-
- /* get the maximum output size (33/32 * size) */
- output_size = ((bitmap->width * bitmap->height * 4 * 33) >> 5) +
- sizeof(struct bitmap_compressed_header);
- output = malloc(output_size);
- if (!output)
- return;
-
- /* compress the data */
- if (bitmap->state & BITMAP_OPAQUE)
- flags |= tinct_OPAQUE_IMAGE;
- error = _swix(Tinct_Compress, _IN(0) | _IN(2) | _IN(7) | _OUT(0),
- (char *)(bitmap->sprite_area + 1),
- output,
- flags,
- &new_size);
- if (error) {
- LOG(("Compression error"));
- free(output);
- } else {
- bitmap->compressed = realloc(output, new_size);
- if (!bitmap->compressed) {
- free(output);
- } else {
- bitmap_compressed_used += new_size;
- if (bitmap->sprite_area) {
- area_size = 16 + 44 + bitmap->width *
- bitmap->height * 4;
- bitmap_direct_used -= area_size;
- free(bitmap->sprite_area);
- }
- bitmap->sprite_area = NULL;
- calc = (100 / (float)output_size) * new_size;
- LOG(("Compression: %i->%i, %.3f%%",
- output_size, new_size, calc));
- }
- }
-}
-
-void bitmap_load_file(struct bitmap *bitmap)
-{
- int len;
- fileswitch_object_type obj_type;
- os_error *error;
- char *r;
- struct bitmap_compressed_header *bitmap_compressed;
- osspriteop_header *bitmap_direct;
- int *data;
-
- assert(bitmap->filename);
-
- sprintf(bitmap_unixname, "%s/%s", TEMP_FILENAME_PREFIX,
- bitmap->filename);
- r = __riscosify(bitmap_unixname, 0, __RISCOSIFY_NO_SUFFIX,
- bitmap_filename, 256, 0);
- if (r == 0) {
- LOG(("__riscosify failed"));
- return;
- }
- error = xosfile_read_stamped_no_path(bitmap_filename,
- &obj_type, 0, 0, &len, 0, 0);
- if ((error) || (obj_type != fileswitch_IS_FILE))
- return;
-
- bitmap->compressed = malloc(len);
- if (!bitmap->compressed)
- return;
-
- error = xosfile_load_stamped_no_path(bitmap_filename,
- (byte *) bitmap->compressed, 0, 0, 0, 0, 0);
- if (error) {
- free(bitmap->compressed);
- bitmap->compressed = NULL;
- return;
- }
-
- data = (void *) bitmap->compressed;
-
- LOG(("Loaded file from disk"));
- /* Sanity check the file we've just loaded:
- * If it's an uncompressed buffer, then it's a raw sprite area,
- * including the total size word at the start. Therefore, we check
- * that:
- * a) The declared total area size == file length
- * b) The offset to the first free word == file length
- * c) There is only 1 sprite in the area
- * d) The name of the sprite in the area is "bitmap"
- *
- * If it's a compressed buffer, then we check that:
- * a) The declared input size + header size == file length
- * b) The name of the buffer is "bitmap"
- *
- * If it's neither of these, we fail.
- */
- if (*data == len && *(data + 3) == len && *(data + 1) == 1 &&
- strncmp(bitmap->compressed + 20, "bitmap", 6) == 0) {
- bitmap->sprite_area = (void *) bitmap->compressed;
- bitmap->compressed = NULL;
- bitmap_direct = (osspriteop_header *)(bitmap->sprite_area + 1);
- bitmap->width = bitmap_direct->width + 1;
- bitmap->height = bitmap_direct->height + 1;
- bitmap_direct_used += 16 + 44 +
- bitmap->width * bitmap->height * 4;
- } else if ((int) (*(data + 6) +
- sizeof(struct bitmap_compressed_header)) == len &&
- strncmp(bitmap->compressed + 8, "bitmap", 6) == 0) {
- bitmap_compressed = (void *) bitmap->compressed;
- bitmap_compressed_used -= bitmap_compressed->input_size +
- sizeof(struct bitmap_compressed_header);
- bitmap->width = bitmap_compressed->width;
- bitmap->height = bitmap_compressed->height;
- } else {
- free(bitmap->compressed);
- bitmap->compressed = NULL;
- return;
- }
- if (bitmap->state & BITMAP_MODIFIED)
- bitmap_delete_file(bitmap);
-}
-
-
-void bitmap_save_file(struct bitmap *bitmap)
-{
- unsigned int area_size;
- const char *filename;
- char *r;
- os_error *error;
- struct bitmap_compressed_header *header;
-
- assert(bitmap);
-
- if (!bitmap->compressed && !bitmap->sprite_area) {
- LOG(("bitmap has no data"));
- return;
- }
-
- /* unmodified bitmaps will still have their file available */
- if ((!(bitmap->state & BITMAP_MODIFIED)) && bitmap->filename[0]) {
- if (bitmap->sprite_area)
- free(bitmap->sprite_area);
- bitmap->sprite_area = NULL;
- if (bitmap->compressed)
- free(bitmap->compressed);
- bitmap->compressed = NULL;
- return;
- }
-
- /* dump the data (compressed or otherwise) to disk */
- filename = filename_request();
- if (!filename) {
- LOG(("filename_request failed"));
- return;
- }
-
- strcpy(bitmap->filename, filename);
- sprintf(bitmap_unixname, "%s/%s", TEMP_FILENAME_PREFIX,
- bitmap->filename);
- r = __riscosify(bitmap_unixname, 0, __RISCOSIFY_NO_SUFFIX,
- bitmap_filename, 256, 0);
- if (r == 0) {
- LOG(("__riscosify failed"));
- return;
- }
- if (bitmap->compressed) {
- header = (void *) bitmap->compressed;
- area_size = header->input_size +
- sizeof(struct bitmap_compressed_header);
- error = xosfile_save_stamped(bitmap_filename, 0xffd,
- (byte *) bitmap->compressed,
- (byte *) bitmap->compressed + area_size);
- } else {
- area_size = bitmap->width * bitmap->height * 4 +
- sizeof(osspriteop_header) +
- sizeof(osspriteop_area);
- error = xosfile_save_stamped(bitmap_filename, 0xffd,
- (byte *) bitmap->sprite_area,
- ((byte *) bitmap->sprite_area) + area_size);
- }
-
- if (error) {
- LOG(("xosfile_save_stamped: 0x%x: %s",
- error->errnum, error->errmess));
- bitmap->filename[0] = 0;
- } else {
- if (bitmap->sprite_area) {
- bitmap_direct_used -= area_size;
- free(bitmap->sprite_area);
- }
- bitmap->sprite_area = NULL;
- if (bitmap->compressed) {
- bitmap_compressed_used -= area_size;
- free(bitmap->compressed);
- }
- bitmap->compressed = NULL;
- bitmap->state &= ~BITMAP_MODIFIED;
- LOG(("Saved file to disk"));
- }
-}
-
-
-void bitmap_delete_file(struct bitmap *bitmap)
-{
- assert(bitmap->filename[0]);
- filename_release(bitmap->filename);
- bitmap->filename[0] = 0;
-}
-
-
int bitmap_get_width(void *vbitmap)
{
struct bitmap *bitmap = (struct bitmap *) vbitmap;
diff --git a/riscos/bitmap.h b/riscos/bitmap.h
index b6fd3ae..43a00a5 100644
--- a/riscos/bitmap.h
+++ b/riscos/bitmap.h
@@ -34,34 +34,9 @@ struct bitmap {
void *private_word;
osspriteop_area *sprite_area; /** Uncompressed data, or NULL */
- char *compressed; /** Compressed data, or NULL */
- char filename[12]; /** Data filename, or '/0' */
-
- struct bitmap *previous; /** Previous bitmap */
- struct bitmap *next; /** Next bitmap */
};
-struct bitmap *bitmap_create_file(char *file);
void bitmap_overlay_sprite(struct bitmap *bitmap, const osspriteop_header *s);
-void bitmap_initialise_memory(void);
-void bitmap_quit(void);
-void bitmap_maintain(void);
-
-/** Whether maintenance of the pool states is needed
-*/
-extern bool bitmap_maintenance;
-
-/** Whether maintenance of the pool is high priority
-*/
-extern bool bitmap_maintenance_priority;
-
-/** Maximum amount of memory for direct images
-*/
-extern unsigned int bitmap_direct_size;
-
-/** Total size of compressed area
-*/
-extern unsigned int bitmap_compressed_size;
#endif
diff --git a/riscos/configure.c b/riscos/configure.c
index 99c69e1..0f5ee32 100644
--- a/riscos/configure.c
+++ b/riscos/configure.c
@@ -108,9 +108,6 @@ void ro_gui_configure_initialise(void)
ro_gui_configure_register("con_lang",
ro_gui_options_language_initialise,
ro_gui_wimp_event_finalise);
- ro_gui_configure_register("con_memory",
- ro_gui_options_memory_initialise,
- ro_gui_wimp_event_finalise);
ro_gui_configure_register("con_theme",
ro_gui_options_theme_initialise,
ro_gui_options_theme_finalise);
diff --git a/riscos/configure.h b/riscos/configure.h
index da29d1c..c190a6d 100644
--- a/riscos/configure.h
+++ b/riscos/configure.h
@@ -1,34 +1,34 @@
-/*
- * Copyright 2005 Richard Wilson <info(a)tinct.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/>.
- */
-
-/** \file
- * RISC OS option setting (interface).
- */
-
-
-#ifndef _NETSURF_RISCOS_CONFIGURE_H_
-#define _NETSURF_RISCOS_CONFIGURE_H_
-
-#include <stdbool.h>
-#include "oslib/os.h"
-#include "oslib/wimp.h"
-
-void ro_gui_configure_initialise(void);
-void ro_gui_configure_show(void);
+/*
+ * Copyright 2005 Richard Wilson <info(a)tinct.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/>.
+ */
-#endif
+/** \file
+ * RISC OS option setting (interface).
+ */
+
+
+#ifndef _NETSURF_RISCOS_CONFIGURE_H_
+#define _NETSURF_RISCOS_CONFIGURE_H_
+
+#include <stdbool.h>
+#include "oslib/os.h"
+#include "oslib/wimp.h"
+
+void ro_gui_configure_initialise(void);
+void ro_gui_configure_show(void);
+
+#endif
diff --git a/riscos/configure/con_memory.c b/riscos/configure/con_memory.c
deleted file mode 100644
index 2736849..0000000
--- a/riscos/configure/con_memory.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright 2006 Richard Wilson <info(a)tinct.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 <stdbool.h>
-#include "utils/nsoption.h"
-#include "riscos/bitmap.h"
-#include "riscos/wimp.h"
-#include "riscos/wimp_event.h"
-#include "riscos/dialog.h"
-#include "riscos/configure/configure.h"
-
-
-#define MEMORY_DIRECT_FIELD 3
-#define MEMORY_DIRECT_DEC 4
-#define MEMORY_DIRECT_INC 5
-#define MEMORY_DIRECT_TEXT 6
-#define MEMORY_DIRECT_AUTO 7
-#define MEMORY_COMPRESSED_FIELD 9
-#define MEMORY_COMPRESSED_DEC 10
-#define MEMORY_COMPRESSED_INC 11
-#define MEMORY_COMPRESSED_TEXT 12
-#define MEMORY_COMPRESSED_AUTO 13
-#define MEMORY_DEFAULT_BUTTON 14
-#define MEMORY_CANCEL_BUTTON 15
-#define MEMORY_OK_BUTTON 16
-
-static bool ro_gui_options_memory_click(wimp_pointer *pointer);
-static bool ro_gui_options_memory_ok(wimp_w w);
-static void ro_gui_options_update_shading(wimp_w w);
-
-bool ro_gui_options_memory_initialise(wimp_w w)
-{
- /* set the current values */
- ro_gui_set_icon_decimal(w, MEMORY_DIRECT_FIELD,
- (bitmap_direct_size * 10) >> 20, 1);
- ro_gui_set_icon_decimal(w, MEMORY_COMPRESSED_FIELD,
- (bitmap_compressed_size * 10) >> 20, 1);
- ro_gui_set_icon_selected_state(w, MEMORY_DIRECT_AUTO,
- (nsoption_int(image_memory_direct) == -1));
- ro_gui_set_icon_selected_state(w, MEMORY_COMPRESSED_AUTO,
- (nsoption_int(image_memory_compressed) == -1));
- ro_gui_options_update_shading(w);
-
- /* register icons */
- ro_gui_wimp_event_register_checkbox(w, MEMORY_DIRECT_AUTO);
- ro_gui_wimp_event_register_checkbox(w, MEMORY_COMPRESSED_AUTO);
- ro_gui_wimp_event_register_text_field(w, MEMORY_DIRECT_TEXT);
- ro_gui_wimp_event_register_text_field(w, MEMORY_COMPRESSED_TEXT);
- ro_gui_wimp_event_register_numeric_field(w, MEMORY_DIRECT_FIELD,
- MEMORY_DIRECT_INC, MEMORY_DIRECT_DEC,
- 10, 5120, 10, 1);
- ro_gui_wimp_event_register_numeric_field(w, MEMORY_COMPRESSED_FIELD,
- MEMORY_COMPRESSED_INC, MEMORY_COMPRESSED_DEC,
- 10, 5120, 10, 1);
- ro_gui_wimp_event_register_mouse_click(w,
- ro_gui_options_memory_click);
- ro_gui_wimp_event_register_cancel(w, MEMORY_CANCEL_BUTTON);
- ro_gui_wimp_event_register_ok(w, MEMORY_OK_BUTTON,
- ro_gui_options_memory_ok);
- ro_gui_wimp_event_set_help_prefix(w, "HelpMemoryConfig");
- ro_gui_wimp_event_memorise(w);
- return true;
-
-}
-
-bool ro_gui_options_memory_click(wimp_pointer *pointer)
-{
- switch (pointer->i) {
- case MEMORY_DIRECT_AUTO:
- ro_gui_options_update_shading(pointer->w);
- return false;
- case MEMORY_COMPRESSED_AUTO:
- ro_gui_options_update_shading(pointer->w);
- return false;
- case MEMORY_DEFAULT_BUTTON:
- ro_gui_set_icon_decimal(pointer->w, MEMORY_DIRECT_FIELD,
- (bitmap_direct_size * 10) >> 20, 1);
- ro_gui_set_icon_decimal(pointer->w, MEMORY_COMPRESSED_FIELD,
- (bitmap_compressed_size * 10) >> 20, 1);
- ro_gui_set_icon_selected_state(pointer->w,
- MEMORY_DIRECT_AUTO, true);
- ro_gui_set_icon_selected_state(pointer->w,
- MEMORY_COMPRESSED_AUTO, true);
- ro_gui_options_update_shading(pointer->w);
- return true;
- }
- return false;
-}
-
-void ro_gui_options_update_shading(wimp_w w)
-{
- bool shaded;
-
- shaded = ro_gui_get_icon_selected_state(w, MEMORY_DIRECT_AUTO);
- ro_gui_set_icon_shaded_state(w, MEMORY_DIRECT_FIELD, shaded);
- ro_gui_set_icon_shaded_state(w, MEMORY_DIRECT_INC, shaded);
- ro_gui_set_icon_shaded_state(w, MEMORY_DIRECT_DEC, shaded);
- ro_gui_set_icon_shaded_state(w, MEMORY_DIRECT_TEXT, shaded);
- shaded = ro_gui_get_icon_selected_state(w, MEMORY_COMPRESSED_AUTO);
- ro_gui_set_icon_shaded_state(w, MEMORY_COMPRESSED_FIELD, shaded);
- ro_gui_set_icon_shaded_state(w, MEMORY_COMPRESSED_INC, shaded);
- ro_gui_set_icon_shaded_state(w, MEMORY_COMPRESSED_DEC, shaded);
- ro_gui_set_icon_shaded_state(w, MEMORY_COMPRESSED_TEXT, shaded);
-}
-
-bool ro_gui_options_memory_ok(wimp_w w)
-{
- /* set the option values */
- if (ro_gui_get_icon_selected_state(w, MEMORY_DIRECT_AUTO))
- nsoption_set_int(image_memory_direct, -1);
- else
- nsoption_set_int(image_memory_direct,
- (((ro_gui_get_icon_decimal(w, MEMORY_DIRECT_FIELD, 1)
- << 10) + 1023) / 10));
- if (ro_gui_get_icon_selected_state(w, MEMORY_COMPRESSED_AUTO))
- nsoption_set_int(image_memory_compressed, -1);
- else
- nsoption_set_int(image_memory_compressed,
- (((ro_gui_get_icon_decimal(w, MEMORY_COMPRESSED_FIELD, 1)
- << 10) + 1023) / 10));
- /* update the memory usage */
- bitmap_initialise_memory();
- ro_gui_set_icon_decimal(w, MEMORY_DIRECT_FIELD,
- (bitmap_direct_size * 10) >> 20, 1);
- ro_gui_set_icon_decimal(w, MEMORY_COMPRESSED_FIELD,
- (bitmap_compressed_size * 10) >> 20, 1);
- /* save the options */
- ro_gui_save_options();
- return true;
-}
diff --git a/riscos/configure/configure.h b/riscos/configure/configure.h
index 5350be8..e5cdb39 100644
--- a/riscos/configure/configure.h
+++ b/riscos/configure/configure.h
@@ -36,7 +36,6 @@ bool ro_gui_options_image_initialise(wimp_w w);
void ro_gui_options_image_finalise(wimp_w w);
bool ro_gui_options_interface_initialise(wimp_w w);
bool ro_gui_options_language_initialise(wimp_w w);
-bool ro_gui_options_memory_initialise(wimp_w w);
bool ro_gui_options_security_initialise(wimp_w w);
bool ro_gui_options_theme_initialise(wimp_w w);
void ro_gui_options_theme_finalise(wimp_w w);
diff --git a/riscos/dialog.c b/riscos/dialog.c
index 7a333e6..147dce9 100644
--- a/riscos/dialog.c
+++ b/riscos/dialog.c
@@ -70,7 +70,7 @@
wimp_w dialog_info, dialog_saveas,
dialog_401li,
dialog_zoom, dialog_pageinfo, dialog_objinfo, dialog_tooltip,
- dialog_warning, dialog_debug,
+ dialog_warning,
dialog_folder, dialog_entry, dialog_search, dialog_print,
dialog_url_complete, dialog_openurl;
@@ -121,10 +121,6 @@ void ro_gui_dialog_init(void)
ro_gui_theme_install_apply);
ro_gui_wimp_event_set_help_prefix(dialog_theme_install, "HelpThemeInst");
- /* debug window */
- dialog_debug = ro_gui_dialog_create("debug");
- ro_gui_wimp_event_set_help_prefix(dialog_debug, "HelpDebug");
-
/* search */
ro_gui_search_init();
diff --git a/riscos/gui.c b/riscos/gui.c
index fc857f2..9b3bf4a 100644
--- a/riscos/gui.c
+++ b/riscos/gui.c
@@ -483,9 +483,6 @@ static void gui_init(int argc, char** argv)
/* Initialise save complete functionality */
save_complete_init();
- /* Initialise bitmap memory pool */
- bitmap_initialise_memory();
-
/* Load in visited URLs and Cookies */
urldb_load(nsoption_charp(url_path));
urldb_load_cookies(nsoption_charp(cookie_file));
@@ -921,7 +918,6 @@ int main(int argc, char** argv)
void gui_quit(void)
{
- bitmap_quit();
urldb_save_cookies(nsoption_charp(cookie_jar));
urldb_save(nsoption_charp(url_save));
ro_gui_window_quit();
@@ -1037,8 +1033,8 @@ void gui_poll(bool active)
track_poll_offset = ro_mouse_poll_interval();
if (active) {
event = wimp_poll(mask, &block, 0);
- } else if (sched_active || (track_poll_offset > 0) || browser_reformat_pending ||
- bitmap_maintenance) {
+ } else if (sched_active || (track_poll_offset > 0) ||
+ browser_reformat_pending) {
os_t t = os_read_monotonic_time();
if (track_poll_offset > 0)
@@ -1070,9 +1066,6 @@ void gui_poll(bool active)
if (browser_reformat_pending && event == wimp_NULL_REASON_CODE)
ro_gui_window_process_reformats();
- else if (bitmap_maintenance_priority ||
- (bitmap_maintenance && event == wimp_NULL_REASON_CODE))
- bitmap_maintain();
}
diff --git a/riscos/gui.h b/riscos/gui.h
index 5089315..827af81 100644
--- a/riscos/gui.h
+++ b/riscos/gui.h
@@ -52,7 +52,7 @@ extern wimp_t task_handle; /**< RISC OS wimp task handle. */
extern wimp_w dialog_info, dialog_saveas, dialog_zoom, dialog_pageinfo,
dialog_objinfo, dialog_tooltip, dialog_warning, dialog_openurl,
- dialog_debug, dialog_folder, dialog_entry, dialog_url_complete,
+ dialog_folder, dialog_entry, dialog_url_complete,
dialog_search, dialog_print, dialog_theme_install;
extern wimp_w current_menu_window;
extern bool current_menu_open;
diff --git a/riscos/options.h b/riscos/options.h
index 3d4567f..9ee3592 100644
--- a/riscos/options.h
+++ b/riscos/options.h
@@ -51,8 +51,6 @@ NSOPTION_BOOL(buffer_everything, true)
NSOPTION_BOOL(open_browser_at_startup, false)
NSOPTION_BOOL(no_plugins, false)
NSOPTION_BOOL(block_popups, false)
-NSOPTION_INTEGER(image_memory_direct, -1)
-NSOPTION_INTEGER(image_memory_compressed, -1)
NSOPTION_BOOL(strip_extensions, false)
NSOPTION_BOOL(confirm_overwrite, true)
NSOPTION_STRING(url_path, "NetSurf:URL")
diff --git a/riscos/templates/de b/riscos/templates/de
index b6357f2..905d57e 100644
--- a/riscos/templates/de
+++ b/riscos/templates/de
@@ -966,194 +966,6 @@ wimp_window {
}
wimp_window {
- template_name:"con_memory"
- visible:750,578,1370,982
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_AUTO_REDRAW | wimp_WINDOW_FULL_SIZE | wimp_WINDOW_BACK_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_VERY_LIGHT_GREY
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-404,620,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | 0x27000000
- work_flags:
- sprite_area:&1
- xmin:620
- ymin:404
- text.text:"Arbeitsspeicher"
- text.size:*
- text.validation:""
- wimp_icon {
- extent:16,-292,604,-24
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:""
- text.size:*
- text.validation:"R4"
- }
- wimp_icon {
- extent:32,-52,268,-8
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:" Image memory "
- text_and_sprite.size:*
- text_and_sprite.validation:""
- }
- wimp_icon {
- extent:92,-104,216,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Direkt"
- }
- wimp_icon {
- extent:220,-108,388,-56
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta"
- }
- wimp_icon {
- extent:404,-100,436,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-100,468,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-104,532,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-160,564,-116
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"automatisch"
- text_and_sprite.size:19
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:28,-216,216,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Komprimiert"
- }
- wimp_icon {
- extent:220,-220,388,-168
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta"
- }
- wimp_icon {
- extent:404,-212,436,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-212,468,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-216,532,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-272,564,-228
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"automatisch"
- text_and_sprite.size:19
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:24,-376,188,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Standard"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:240,-376,404,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Abbruch"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:420,-384,604,-316
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"OK"
- text.size:4
- text.validation:"R6,3"
- }
-}
-
-wimp_window {
template_name:"con_theme"
visible:408,370,1316,974
xscroll:0
@@ -1228,30 +1040,6 @@ wimp_window {
}
wimp_window {
- template_name:"debug"
- visible:248,508,1052,972
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_BACK_ICON | wimp_WINDOW_CLOSE_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_TOGGLE_ICON | wimp_WINDOW_VSCROLL | wimp_WINDOW_SIZE_ICON | wimp_WINDOW_HSCROLL | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-880,1236,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
- work_flags:
- sprite_area:&1
- xmin:0
- ymin:0
- text_only:"NetSurf"
-}
-
-wimp_window {
template_name:"download"
visible:384,314,1180,594
xscroll:0
@@ -2642,7 +2430,7 @@ wimp_window {
title_fg:wimp_COLOUR_BLACK
title_bg:wimp_COLOUR_LIGHT_GREY
work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
+ work_bg:wimp_COLOUR_TRANSPARENT
scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
highlight_bg:wimp_COLOUR_CREAM
diff --git a/riscos/templates/en b/riscos/templates/en
index 2edf0dd..a943b1e 100644
--- a/riscos/templates/en
+++ b/riscos/templates/en
@@ -1176,192 +1176,6 @@ wimp_window {
}
wimp_window {
- template_name:"con_memory"
- visible:1706,688,2326,1092
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_AUTO_REDRAW | wimp_WINDOW_BACK_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_VERY_LIGHT_GREY
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-404,620,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED
- work_flags:
- sprite_area:&1
- xmin:620
- ymin:404
- text_only:"Memory"
- wimp_icon {
- extent:16,-292,604,-24
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:""
- text.size:*
- text.validation:"R4"
- }
- wimp_icon {
- extent:32,-52,268,-8
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:" Image memory "
- text_and_sprite.size:*
- text_and_sprite.validation:""
- }
- wimp_icon {
- extent:92,-104,216,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Direct"
- }
- wimp_icon {
- extent:220,-108,388,-56
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta;A0-9."
- }
- wimp_icon {
- extent:404,-100,436,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-100,468,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-104,532,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-160,564,-116
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"Automatic handling"
- text_and_sprite.size:*
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:36,-216,216,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Compressed"
- }
- wimp_icon {
- extent:220,-220,388,-168
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta;A0-9."
- }
- wimp_icon {
- extent:404,-212,436,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-212,468,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-216,532,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-272,564,-228
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"Automatic handling"
- text_and_sprite.size:*
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:24,-376,188,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Default"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:236,-376,400,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Cancel"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:416,-384,600,-316
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Set"
- text.size:*
- text.validation:"R6,3"
- }
-}
-
-wimp_window {
template_name:"con_theme"
visible:410,38,1318,642
xscroll:0
@@ -1436,30 +1250,6 @@ wimp_window {
}
wimp_window {
- template_name:"debug"
- visible:248,508,1052,972
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_BACK_ICON | wimp_WINDOW_CLOSE_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_TOGGLE_ICON | wimp_WINDOW_VSCROLL | wimp_WINDOW_SIZE_ICON | wimp_WINDOW_HSCROLL | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-880,1236,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
- work_flags:
- sprite_area:&1
- xmin:0
- ymin:0
- text_only:"NetSurf"
-}
-
-wimp_window {
template_name:"download"
visible:486,610,1282,890
xscroll:0
@@ -2848,7 +2638,7 @@ wimp_window {
title_fg:wimp_COLOUR_BLACK
title_bg:wimp_COLOUR_LIGHT_GREY
work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
+ work_bg:wimp_COLOUR_TRANSPARENT
scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
highlight_bg:wimp_COLOUR_CREAM
diff --git a/riscos/templates/fr b/riscos/templates/fr
index 3df0a61..30bcbfa 100644
--- a/riscos/templates/fr
+++ b/riscos/templates/fr
@@ -966,192 +966,6 @@ wimp_window {
}
wimp_window {
- template_name:"con_memory"
- visible:422,358,1042,762
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_AUTO_REDRAW | wimp_WINDOW_BACK_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_VERY_LIGHT_GREY
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-404,620,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
- work_flags:
- sprite_area:&1
- xmin:620
- ymin:404
- text_only:"M�moire"
- wimp_icon {
- extent:16,-292,604,-24
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:""
- text.size:*
- text.validation:"R4"
- }
- wimp_icon {
- extent:32,-52,316,-8
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:" M�moire d'image "
- text_and_sprite.size:*
- text_and_sprite.validation:""
- }
- wimp_icon {
- extent:92,-104,216,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Directe"
- }
- wimp_icon {
- extent:220,-108,388,-56
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta"
- }
- wimp_icon {
- extent:404,-100,436,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-100,468,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-104,532,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-160,564,-116
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"Gestion automatique"
- text_and_sprite.size:*
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:36,-216,216,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Compress�e"
- }
- wimp_icon {
- extent:220,-220,388,-168
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta"
- }
- wimp_icon {
- extent:404,-212,436,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-212,468,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-216,532,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-272,564,-228
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"Gestion automatique"
- text_and_sprite.size:*
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:24,-376,188,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Par d�faut"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:240,-376,404,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Annuler"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:420,-384,604,-316
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Valider"
- text.size:*
- text.validation:"R6,3"
- }
-}
-
-wimp_window {
template_name:"con_theme"
visible:408,370,1316,974
xscroll:0
@@ -1226,30 +1040,6 @@ wimp_window {
}
wimp_window {
- template_name:"debug"
- visible:248,508,1052,972
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_BACK_ICON | wimp_WINDOW_CLOSE_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_TOGGLE_ICON | wimp_WINDOW_VSCROLL | wimp_WINDOW_SIZE_ICON | wimp_WINDOW_HSCROLL | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-880,1236,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
- work_flags:
- sprite_area:&1
- xmin:0
- ymin:0
- text_only:"NetSurf"
-}
-
-wimp_window {
template_name:"download"
visible:352,94,1148,374
xscroll:0
@@ -2652,7 +2442,7 @@ wimp_window {
title_fg:wimp_COLOUR_BLACK
title_bg:wimp_COLOUR_LIGHT_GREY
work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
+ work_bg:wimp_COLOUR_TRANSPARENT
scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
highlight_bg:wimp_COLOUR_CREAM
diff --git a/riscos/templates/nl b/riscos/templates/nl
index 53915d3..dcc8af5 100644
--- a/riscos/templates/nl
+++ b/riscos/templates/nl
@@ -1178,192 +1178,6 @@ wimp_window {
}
wimp_window {
- template_name:"con_memory"
- visible:538,540,1158,944
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_AUTO_REDRAW | wimp_WINDOW_BACK_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_VERY_LIGHT_GREY
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-404,620,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED
- work_flags:
- sprite_area:&1
- xmin:620
- ymin:404
- text_only:"Geheugen"
- wimp_icon {
- extent:16,-292,604,-24
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:""
- text.size:*
- text.validation:"R4"
- }
- wimp_icon {
- extent:32,-52,268,-8
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:" Beeldgeheugen "
- text_and_sprite.size:*
- text_and_sprite.validation:""
- }
- wimp_icon {
- extent:92,-104,216,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Direct"
- }
- wimp_icon {
- extent:220,-108,388,-56
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta"
- }
- wimp_icon {
- extent:404,-100,436,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-100,468,-68
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-104,532,-60
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-160,564,-116
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"Automatisch afhandelen"
- text_and_sprite.size:*
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:36,-216,216,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"Comprimeren"
- }
- wimp_icon {
- extent:220,-220,388,-168
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_WRITABLE
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_WHITE
- text.text:"512.0"
- text.size:10
- text.validation:"Pptr_write;Kta"
- }
- wimp_icon {
- extent:404,-212,436,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sdown,pdown"
- }
- wimp_icon {
- extent:436,-212,468,-180
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_REPEAT
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:""
- text_and_sprite.size:*
- text_and_sprite.validation:"r5;sup,pup"
- }
- wimp_icon {
- extent:476,-216,532,-172
- icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_only:"MB"
- }
- wimp_icon {
- extent:220,-272,564,-228
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text_and_sprite.text:"Automatisch afhandelen"
- text_and_sprite.size:*
- text_and_sprite.validation:"Soptoff,opton"
- }
- wimp_icon {
- extent:24,-376,188,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Verstek"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:236,-376,400,-324
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Annuleer"
- text.size:*
- text.validation:"R5,3"
- }
- wimp_icon {
- extent:416,-384,600,-316
- icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK
- icon_esg:0
- icon_fg:wimp_COLOUR_BLACK
- icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Instellen"
- text.size:*
- text.validation:"R6,3"
- }
-}
-
-wimp_window {
template_name:"con_theme"
visible:410,38,1318,642
xscroll:0
@@ -1438,30 +1252,6 @@ wimp_window {
}
wimp_window {
- template_name:"debug"
- visible:248,508,1052,972
- xscroll:0
- yscroll:0
- next:wimp_TOP
- window_flags:wimp_WINDOW_MOVEABLE | wimp_WINDOW_BACK_ICON | wimp_WINDOW_CLOSE_ICON | wimp_WINDOW_TITLE_ICON | wimp_WINDOW_TOGGLE_ICON | wimp_WINDOW_VSCROLL | wimp_WINDOW_SIZE_ICON | wimp_WINDOW_HSCROLL | wimp_WINDOW_NEW_FORMAT
- title_fg:wimp_COLOUR_BLACK
- title_bg:wimp_COLOUR_LIGHT_GREY
- work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
- scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
- scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
- highlight_bg:wimp_COLOUR_CREAM
- extra_flags:
- extent:0,-880,1236,0
- title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | 0x27000000
- work_flags:
- sprite_area:&1
- xmin:0
- ymin:0
- text_only:"NetSurf"
-}
-
-wimp_window {
template_name:"download"
visible:486,610,1282,890
xscroll:0
@@ -2852,7 +2642,7 @@ wimp_window {
title_fg:wimp_COLOUR_BLACK
title_bg:wimp_COLOUR_LIGHT_GREY
work_fg:wimp_COLOUR_BLACK
- work_bg:wimp_COLOUR_WHITE
+ work_bg:wimp_COLOUR_TRANSPARENT
scroll_outer:wimp_COLOUR_MID_LIGHT_GREY
scroll_inner:wimp_COLOUR_VERY_LIGHT_GREY
highlight_bg:wimp_COLOUR_CREAM
diff --git a/riscos/wimp.c b/riscos/wimp.c
index 1f3a452..87860ad 100644
--- a/riscos/wimp.c
+++ b/riscos/wimp.c
@@ -94,8 +94,6 @@ void ro_gui_wimp_cache_furniture_sizes(wimp_w w)
{
os_error *error;
- if (!w)
- w = dialog_debug;
if (furniture_window == w)
return;
furniture_window = w;
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-586-g1e4c733
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/1e4c733fc0d91a032ed2a...
...commit http://git.netsurf-browser.org/netsurf.git/commit/1e4c733fc0d91a032ed2a85...
...tree http://git.netsurf-browser.org/netsurf.git/tree/1e4c733fc0d91a032ed2a8587...
The branch, master has been updated
via 1e4c733fc0d91a032ed2a8587b2f014eab7d0291 (commit)
via a2b4c63fcc4c1b1e0af2c690c1ff3cb20d6fb45e (commit)
from 69e3963dae8dae6ec9c7e3300083d97b2c7b8b2a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=1e4c733fc0d91a032ed...
commit 1e4c733fc0d91a032ed2a8587b2f014eab7d0291
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Appease gtk front end's broken bitmap behaviour.
diff --git a/desktop/treeview.c b/desktop/treeview.c
index b8bd852..d69dae3 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -3691,6 +3691,11 @@ static struct bitmap * treeview_generate_copy_bitmap(
bitmap_modified(b);
+ /* We've not modified the original image, but we called
+ * bitmap_get_buffer(), so we need to pair that with a
+ * bitmap_modified() call to appease certain front ends. */
+ bitmap_modified(orig);
+
return b;
}
@@ -3747,6 +3752,11 @@ static struct bitmap * treeview_generate_rotate_bitmap(
bitmap_modified(b);
+ /* We've not modified the original image, but we called
+ * bitmap_get_buffer(), so we need to pair that with a
+ * bitmap_modified() call to appease certain front ends. */
+ bitmap_modified(orig);
+
return b;
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=a2b4c63fcc4c1b1e0af...
commit a2b4c63fcc4c1b1e0af2c690c1ff3cb20d6fb45e
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Init unused alpha channel to 0, even though we set the bitmaps as opaque.
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 02b31a6..b8bd852 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -3594,21 +3594,21 @@ static struct bitmap * treeview_generate_triangle_bitmap(
*(pos++) = red_from_colour(colour4);
*(pos++) = green_from_colour(colour4);
*(pos++) = blue_from_colour(colour4);
- pos++;
+ *(pos++) = 0;
}
*(pos++) = red_from_colour(colour3);
*(pos++) = green_from_colour(colour3);
*(pos++) = blue_from_colour(colour3);
- pos++;
+ *(pos++) = 0;
*(pos++) = red_from_colour(colour1);
*(pos++) = green_from_colour(colour1);
*(pos++) = blue_from_colour(colour1);
- pos++;
+ *(pos++) = 0;
for (x = y * 2 + 2; x < size ; x++) {
*(pos++) = red_from_colour(colour0);
*(pos++) = green_from_colour(colour0);
*(pos++) = blue_from_colour(colour0);
- pos++;
+ *(pos++) = 0;
}
} else if ((y == size / 2) && (size & 0x1)) {
/* Middle row */
@@ -3616,33 +3616,33 @@ static struct bitmap * treeview_generate_triangle_bitmap(
*(pos++) = red_from_colour(colour4);
*(pos++) = green_from_colour(colour4);
*(pos++) = blue_from_colour(colour4);
- pos++;
+ *(pos++) = 0;
}
*(pos++) = red_from_colour(colour2);
*(pos++) = green_from_colour(colour2);
*(pos++) = blue_from_colour(colour2);
- pos++;
+ *(pos++) = 0;
} else {
/* Bottom half */
for (x = 0; x < (size - y - 1) * 2; x++) {
*(pos++) = red_from_colour(colour4);
*(pos++) = green_from_colour(colour4);
*(pos++) = blue_from_colour(colour4);
- pos++;
+ *(pos++) = 0;
}
*(pos++) = red_from_colour(colour3);
*(pos++) = green_from_colour(colour3);
*(pos++) = blue_from_colour(colour3);
- pos++;
+ *(pos++) = 0;
*(pos++) = red_from_colour(colour1);
*(pos++) = green_from_colour(colour1);
*(pos++) = blue_from_colour(colour1);
- pos++;
+ *(pos++) = 0;
for (x = (size - y) * 2; x < size ; x++) {
*(pos++) = red_from_colour(colour0);
*(pos++) = green_from_colour(colour0);
*(pos++) = blue_from_colour(colour0);
- pos++;
+ *(pos++) = 0;
}
}
@@ -3738,7 +3738,7 @@ static struct bitmap * treeview_generate_rotate_bitmap(
*(pos++) = *(orig_pos++);
*(pos++) = *(orig_pos++);
*(pos++) = *(orig_pos);
- pos++;
+ *(pos++) = 0;
}
-----------------------------------------------------------------------
Summary of changes:
desktop/treeview.c | 32 +++++++++++++++++++++-----------
1 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 02b31a6..d69dae3 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -3594,21 +3594,21 @@ static struct bitmap * treeview_generate_triangle_bitmap(
*(pos++) = red_from_colour(colour4);
*(pos++) = green_from_colour(colour4);
*(pos++) = blue_from_colour(colour4);
- pos++;
+ *(pos++) = 0;
}
*(pos++) = red_from_colour(colour3);
*(pos++) = green_from_colour(colour3);
*(pos++) = blue_from_colour(colour3);
- pos++;
+ *(pos++) = 0;
*(pos++) = red_from_colour(colour1);
*(pos++) = green_from_colour(colour1);
*(pos++) = blue_from_colour(colour1);
- pos++;
+ *(pos++) = 0;
for (x = y * 2 + 2; x < size ; x++) {
*(pos++) = red_from_colour(colour0);
*(pos++) = green_from_colour(colour0);
*(pos++) = blue_from_colour(colour0);
- pos++;
+ *(pos++) = 0;
}
} else if ((y == size / 2) && (size & 0x1)) {
/* Middle row */
@@ -3616,33 +3616,33 @@ static struct bitmap * treeview_generate_triangle_bitmap(
*(pos++) = red_from_colour(colour4);
*(pos++) = green_from_colour(colour4);
*(pos++) = blue_from_colour(colour4);
- pos++;
+ *(pos++) = 0;
}
*(pos++) = red_from_colour(colour2);
*(pos++) = green_from_colour(colour2);
*(pos++) = blue_from_colour(colour2);
- pos++;
+ *(pos++) = 0;
} else {
/* Bottom half */
for (x = 0; x < (size - y - 1) * 2; x++) {
*(pos++) = red_from_colour(colour4);
*(pos++) = green_from_colour(colour4);
*(pos++) = blue_from_colour(colour4);
- pos++;
+ *(pos++) = 0;
}
*(pos++) = red_from_colour(colour3);
*(pos++) = green_from_colour(colour3);
*(pos++) = blue_from_colour(colour3);
- pos++;
+ *(pos++) = 0;
*(pos++) = red_from_colour(colour1);
*(pos++) = green_from_colour(colour1);
*(pos++) = blue_from_colour(colour1);
- pos++;
+ *(pos++) = 0;
for (x = (size - y) * 2; x < size ; x++) {
*(pos++) = red_from_colour(colour0);
*(pos++) = green_from_colour(colour0);
*(pos++) = blue_from_colour(colour0);
- pos++;
+ *(pos++) = 0;
}
}
@@ -3691,6 +3691,11 @@ static struct bitmap * treeview_generate_copy_bitmap(
bitmap_modified(b);
+ /* We've not modified the original image, but we called
+ * bitmap_get_buffer(), so we need to pair that with a
+ * bitmap_modified() call to appease certain front ends. */
+ bitmap_modified(orig);
+
return b;
}
@@ -3738,7 +3743,7 @@ static struct bitmap * treeview_generate_rotate_bitmap(
*(pos++) = *(orig_pos++);
*(pos++) = *(orig_pos++);
*(pos++) = *(orig_pos);
- pos++;
+ *(pos++) = 0;
}
@@ -3747,6 +3752,11 @@ static struct bitmap * treeview_generate_rotate_bitmap(
bitmap_modified(b);
+ /* We've not modified the original image, but we called
+ * bitmap_get_buffer(), so we need to pair that with a
+ * bitmap_modified() call to appease certain front ends. */
+ bitmap_modified(orig);
+
return b;
}
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-584-g69e3963
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/69e3963dae8dae6ec9c7e...
...commit http://git.netsurf-browser.org/netsurf.git/commit/69e3963dae8dae6ec9c7e33...
...tree http://git.netsurf-browser.org/netsurf.git/tree/69e3963dae8dae6ec9c7e3300...
The branch, master has been updated
via 69e3963dae8dae6ec9c7e3300083d97b2c7b8b2a (commit)
from 2a4fb9ecd1b80cefab5999e5401c339c0973d574 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=69e3963dae8dae6ec9c...
commit 69e3963dae8dae6ec9c7e3300083d97b2c7b8b2a
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Avoid NULL deref when deleting a node, causing empty ancestor nodes to be deleted.
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 3bd0f6a..02b31a6 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -1185,13 +1185,14 @@ nserror treeview_delete_node(treeview *tree, treeview_node *n,
{
nserror err;
struct rect r;
- treeview_node *p;
+ bool visible;
assert(tree != NULL);
assert(n != NULL);
assert(n->parent != NULL);
- p = n->parent;
+ visible = n->parent->flags & TREE_NODE_EXPANDED;
+
r.y0 = treeview_node_y(tree, n);
r.y1 = tree->root->height;
@@ -1217,8 +1218,7 @@ nserror treeview_delete_node(treeview *tree, treeview_node *n,
}
/* Redraw */
- if (p->flags & TREE_NODE_EXPANDED &&
- !(flags & TREE_OPTION_SUPPRESS_REDRAW)) {
+ if (visible && !(flags & TREE_OPTION_SUPPRESS_REDRAW)) {
r.x0 = 0;
r.x1 = REDRAW_MAX;
tree->cw_t->redraw_request(tree->cw_h, &r);
-----------------------------------------------------------------------
Summary of changes:
desktop/treeview.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 3bd0f6a..02b31a6 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -1185,13 +1185,14 @@ nserror treeview_delete_node(treeview *tree, treeview_node *n,
{
nserror err;
struct rect r;
- treeview_node *p;
+ bool visible;
assert(tree != NULL);
assert(n != NULL);
assert(n->parent != NULL);
- p = n->parent;
+ visible = n->parent->flags & TREE_NODE_EXPANDED;
+
r.y0 = treeview_node_y(tree, n);
r.y1 = tree->root->height;
@@ -1217,8 +1218,7 @@ nserror treeview_delete_node(treeview *tree, treeview_node *n,
}
/* Redraw */
- if (p->flags & TREE_NODE_EXPANDED &&
- !(flags & TREE_OPTION_SUPPRESS_REDRAW)) {
+ if (visible && !(flags & TREE_OPTION_SUPPRESS_REDRAW)) {
r.x0 = 0;
r.x1 = REDRAW_MAX;
tree->cw_t->redraw_request(tree->cw_h, &r);
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-583-g2a4fb9e
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/2a4fb9ecd1b80cefab599...
...commit http://git.netsurf-browser.org/netsurf.git/commit/2a4fb9ecd1b80cefab5999e...
...tree http://git.netsurf-browser.org/netsurf.git/tree/2a4fb9ecd1b80cefab5999e54...
The branch, master has been updated
via 2a4fb9ecd1b80cefab5999e5401c339c0973d574 (commit)
via 506a0e7d940abb6a95a890caf024743a993c8dcd (commit)
from f19e827983518a65a65aa7ab663c59a921b02fa4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=2a4fb9ecd1b80cefab5...
commit 2a4fb9ecd1b80cefab5999e5401c339c0973d574
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Generate anti-aliased triangles in bitmaps and plot via bitmap plotter. (Without anti-aliasing was too ugly to be endured.)
diff --git a/desktop/treeview.c b/desktop/treeview.c
index b885660..3bd0f6a 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -26,6 +26,7 @@
#include "desktop/plotters.h"
#include "desktop/textarea.h"
#include "desktop/treeview.h"
+#include "image/bitmap.h"
#include "render/font.h"
#include "utils/log.h"
@@ -157,16 +158,27 @@ struct treeview {
};
+enum treeview_furniture_id {
+ TREE_FURN_EXPAND = 0,
+ TREE_FURN_CONTRACT,
+ TREE_FURN_LAST
+};
+struct treeview_furniture {
+ int size;
+ struct bitmap *bmp;
+ struct bitmap *sel;
+};
+
struct treeview_node_style {
plot_style_t bg; /**< Background */
plot_font_style_t text; /**< Text */
plot_font_style_t itext; /**< Entry field text */
- plot_style_t furn; /**< Furniture */
plot_style_t sbg; /**< Selected background */
plot_font_style_t stext; /**< Selected text */
plot_font_style_t sitext; /**< Selected entry field text */
- plot_style_t sfurn; /**< Selected furniture */
+
+ struct treeview_furniture furn[TREE_FURN_LAST];
};
struct treeview_node_style plot_style_odd; /**< Plot style for odd rows */
@@ -193,19 +205,6 @@ static struct treeview_resource treeview_res[TREE_RES_LAST] = {
}; /**< Treeview content resources */
-
-enum treeview_furniture_id {
- TREE_FURN_EXPAND = 0,
- TREE_FURN_CONTRACT,
- TREE_FURN_LAST
-};
-struct treeview_furniture {
- int pts; /* Number of points (max = 8) */
- int c[8]; /* Coordinate array. x-coord, y-coord... */
-};
-static struct treeview_furniture tree_furn[TREE_FURN_LAST];
-
-
/* Find the next node in depth first tree order
*
* \param node Start node
@@ -1669,12 +1668,10 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
plot_style_t *bg_style;
plot_font_style_t *text_style;
plot_font_style_t *infotext_style;
- plot_style_t *furn_style;
+ struct bitmap *furniture;
int height;
int sel_min, sel_max;
bool invert_selection;
- enum treeview_furniture_id furn_id;
- int coords[8];
assert(tree != NULL);
assert(tree->root != NULL);
@@ -1763,12 +1760,16 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
bg_style = &style->sbg;
text_style = &style->stext;
infotext_style = &style->sitext;
- furn_style = &style->sfurn;
+ furniture = (node->flags & TREE_NODE_EXPANDED) ?
+ style->furn[TREE_FURN_CONTRACT].sel :
+ style->furn[TREE_FURN_EXPAND].sel;
} else {
bg_style = &style->bg;
text_style = &style->text;
infotext_style = &style->itext;
- furn_style = &style->furn;
+ furniture = (node->flags & TREE_NODE_EXPANDED) ?
+ style->furn[TREE_FURN_CONTRACT].bmp :
+ style->furn[TREE_FURN_EXPAND].bmp;
}
/* Render background */
@@ -1777,18 +1778,11 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
new_ctx.plot->rectangle(r.x0, y0, r.x1, y1, bg_style);
/* Render toggle */
- if (node->flags & TREE_NODE_EXPANDED) {
- furn_id = TREE_FURN_CONTRACT;
- } else {
- furn_id = TREE_FURN_EXPAND;
- }
-
- for (i = 0; i < tree_furn[furn_id].pts; i += 2) {
- coords[i ] = tree_furn[furn_id].c[i ] + inset;
- coords[i + 1] = tree_furn[furn_id].c[i + 1] + render_y;
- }
- new_ctx.plot->polygon(coords, tree_furn[furn_id].pts / 2,
- furn_style);
+ new_ctx.plot->bitmap(inset, render_y + tree_g.line_height / 4,
+ style->furn[TREE_FURN_EXPAND].size,
+ style->furn[TREE_FURN_EXPAND].size,
+ furniture,
+ bg_style->fill_colour, BITMAPF_NONE);
/* Render icon */
if (node->type == TREE_NODE_ENTRY)
@@ -3481,10 +3475,6 @@ static void treeview_init_plot_styles(int font_pt_size)
plot_style_even.text.foreground,
plot_style_even.text.background, 255 * 10 / 16);
- /* Furniture colour */
- plot_style_even.furn = plot_style_even.bg;
- plot_style_even.furn.fill_colour = plot_style_even.itext.foreground;
-
/* Selected background colour */
plot_style_even.sbg = plot_style_even.bg;
plot_style_even.sbg.fill_colour = gui_system_colour_char("Highlight");
@@ -3501,10 +3491,6 @@ static void treeview_init_plot_styles(int font_pt_size)
plot_style_even.stext.foreground,
plot_style_even.stext.background, 255 * 25 / 32);
- /* Selected furniture colour */
- plot_style_even.sfurn = plot_style_even.bg;
- plot_style_even.sfurn.fill_colour = plot_style_even.sitext.foreground;
-
/* Odd numbered node styles */
plot_style_odd.bg = plot_style_even.bg;
@@ -3517,13 +3503,10 @@ static void treeview_init_plot_styles(int font_pt_size)
plot_style_odd.itext.foreground = mix_colour(
plot_style_odd.text.foreground,
plot_style_odd.text.background, 255 * 10 / 16);
- plot_style_odd.furn = plot_style_odd.bg;
- plot_style_odd.furn.fill_colour = plot_style_odd.itext.foreground;
plot_style_odd.sbg = plot_style_even.sbg;
plot_style_odd.stext = plot_style_even.stext;
plot_style_odd.sitext = plot_style_even.sitext;
- plot_style_odd.sfurn = plot_style_even.sfurn;
}
@@ -3571,91 +3554,258 @@ static void treeview_init_resources(void)
/**
- * Measures width of characters used to represent treeview furniture.
+ * Create a right-pointing anti-aliased triangle bitmap
+ *
+ * bg background colour
+ * fg foreground colour
+ * size required bitmap size
*/
-static void treeview_init_furniture(void)
+static struct bitmap * treeview_generate_triangle_bitmap(
+ colour bg, colour fg, int size)
{
- struct treeview_furniture *f;
- int size = tree_g.line_height / 2;
- int smax = size - 1;
- int i, y;
+ struct bitmap *b = NULL;
+ int x, y;
+ unsigned char *rpos;
+ unsigned char *pos;
+ size_t stride;
+
+ /* Set up required colour graduations. Ignores screen gamma. */
+ colour colour0 = bg;
+ colour colour1 = mix_colour(bg, fg, 255 * 3 / 4);
+ colour colour2 = blend_colour(bg, fg);
+ colour colour3 = mix_colour(bg, fg, 255 * 1 / 4);
+ colour colour4 = fg;
+
+ /* Create the bitmap */
+ b = bitmap_create(size, size, BITMAP_NEW | BITMAP_OPAQUE);
+ if (b == NULL)
+ return NULL;
+
+ rpos = bitmap_get_buffer(b);
+ stride = bitmap_get_rowstride(b);
+
+ /* Draw the triangle */
+ for (y = 0; y < size; y++) {
+ pos = rpos;
+
+ if (y < size / 2) {
+ /* Top half */
+ for (x = 0; x < y * 2; x++) {
+ *(pos++) = red_from_colour(colour4);
+ *(pos++) = green_from_colour(colour4);
+ *(pos++) = blue_from_colour(colour4);
+ pos++;
+ }
+ *(pos++) = red_from_colour(colour3);
+ *(pos++) = green_from_colour(colour3);
+ *(pos++) = blue_from_colour(colour3);
+ pos++;
+ *(pos++) = red_from_colour(colour1);
+ *(pos++) = green_from_colour(colour1);
+ *(pos++) = blue_from_colour(colour1);
+ pos++;
+ for (x = y * 2 + 2; x < size ; x++) {
+ *(pos++) = red_from_colour(colour0);
+ *(pos++) = green_from_colour(colour0);
+ *(pos++) = blue_from_colour(colour0);
+ pos++;
+ }
+ } else if ((y == size / 2) && (size & 0x1)) {
+ /* Middle row */
+ for (x = 0; x < size - 1; x++) {
+ *(pos++) = red_from_colour(colour4);
+ *(pos++) = green_from_colour(colour4);
+ *(pos++) = blue_from_colour(colour4);
+ pos++;
+ }
+ *(pos++) = red_from_colour(colour2);
+ *(pos++) = green_from_colour(colour2);
+ *(pos++) = blue_from_colour(colour2);
+ pos++;
+ } else {
+ /* Bottom half */
+ for (x = 0; x < (size - y - 1) * 2; x++) {
+ *(pos++) = red_from_colour(colour4);
+ *(pos++) = green_from_colour(colour4);
+ *(pos++) = blue_from_colour(colour4);
+ pos++;
+ }
+ *(pos++) = red_from_colour(colour3);
+ *(pos++) = green_from_colour(colour3);
+ *(pos++) = blue_from_colour(colour3);
+ pos++;
+ *(pos++) = red_from_colour(colour1);
+ *(pos++) = green_from_colour(colour1);
+ *(pos++) = blue_from_colour(colour1);
+ pos++;
+ for (x = (size - y) * 2; x < size ; x++) {
+ *(pos++) = red_from_colour(colour0);
+ *(pos++) = green_from_colour(colour0);
+ *(pos++) = blue_from_colour(colour0);
+ pos++;
+ }
+ }
- /* Make TREE_FURN_EXPAND */
- f = &(tree_furn[TREE_FURN_EXPAND]);
+ rpos += stride;
+ }
- if (size & 0x1) {
- /* Size is odd; triangle */
- f->pts = 6;
+ bitmap_modified(b);
- f->c[0] = 0;
- f->c[1] = 0;
+ return b;
+}
- f->c[2] = smax;
- f->c[3] = size / 2;
- f->c[4] = 0;
- f->c[5] = smax;
+/**
+ * Create bitmap copy of another bitmap
+ *
+ * orig bitmap to copy
+ * size required bitmap size
+ */
+static struct bitmap * treeview_generate_copy_bitmap(
+ struct bitmap *orig, int size)
+{
+ struct bitmap *b = NULL;
+ unsigned char *data;
+ unsigned char *orig_data;
+ size_t stride;
- } else {
- /* Size is even; trapezium */
- f->pts = 8;
+ if (orig == NULL)
+ return NULL;
- f->c[0] = 0;
- f->c[1] = 0;
+ assert(size == bitmap_get_width(orig));
+ assert(size == bitmap_get_height(orig));
- f->c[2] = smax;
- f->c[3] = size / 2 - 1;
+ /* Create the bitmap */
+ b = bitmap_create(size, size, BITMAP_NEW | BITMAP_OPAQUE);
+ if (b == NULL)
+ return NULL;
- f->c[4] = smax;
- f->c[5] = size / 2;
+ stride = bitmap_get_rowstride(b);
+ assert(stride == bitmap_get_rowstride(orig));
- f->c[6] = 0;
- f->c[7] = smax;
- }
+ data = bitmap_get_buffer(b);
+ orig_data = bitmap_get_buffer(orig);
- /* Make TREE_FURN_CONTRACT */
- f = &(tree_furn[TREE_FURN_CONTRACT]);
+ /* Copy the bitmap */
+ memcpy(data, orig_data, stride * size);
- if (size & 0x1) {
- /* Size is odd; triangle */
- f->pts = 6;
+ bitmap_modified(b);
- f->c[0] = 0;
- f->c[1] = 0;
+ return b;
+}
- f->c[2] = smax;
- f->c[3] = 0;
- f->c[4] = size / 2;
- f->c[5] = smax;
+/**
+ * Create bitmap from rotation of another bitmap
+ *
+ * orig bitmap to create rotation of
+ * size required bitmap size
+ */
+static struct bitmap * treeview_generate_rotate_bitmap(
+ struct bitmap *orig, int size)
+{
+ struct bitmap *b = NULL;
+ int x, y;
+ unsigned char *rpos;
+ unsigned char *pos;
+ unsigned char *orig_data;
+ unsigned char *orig_pos;
+ size_t stride;
- } else {
- /* Size is even; trapezium */
- f->pts = 8;
+ if (orig == NULL)
+ return NULL;
- f->c[0] = 0;
- f->c[1] = 0;
+ assert(size == bitmap_get_width(orig));
+ assert(size == bitmap_get_height(orig));
- f->c[2] = smax;
- f->c[3] = 0;
+ /* Create the bitmap */
+ b = bitmap_create(size, size, BITMAP_NEW | BITMAP_OPAQUE);
+ if (b == NULL)
+ return NULL;
- f->c[4] = size / 2;
- f->c[5] = smax;
+ stride = bitmap_get_rowstride(b);
+ assert(stride == bitmap_get_rowstride(orig));
- f->c[6] = size / 2 - 1;
- f->c[7] = smax;
- }
+ rpos = bitmap_get_buffer(b);
+ orig_data = bitmap_get_buffer(orig);
- /* Vertically offset for line height */
- for (i = 0; i < TREE_FURN_LAST; i++) {
- f = &(tree_furn[i]);
+ /* Copy the rotated bitmap */
+ for (y = 0; y < size; y++) {
+ pos = rpos;
- for (y = 1; y < f->pts; y += 2) {
- f->c[y] += tree_g.line_height / 4;
+ for (x = 0; x < size; x++) {
+ orig_pos = orig_data + x * stride + y * 4;
+ *(pos++) = *(orig_pos++);
+ *(pos++) = *(orig_pos++);
+ *(pos++) = *(orig_pos);
+ pos++;
+
}
+
+ rpos += stride;
}
+ bitmap_modified(b);
+
+ return b;
+}
+
+
+/**
+ * Measures width of characters used to represent treeview furniture.
+ */
+static nserror treeview_init_furniture(void)
+{
+ int size = tree_g.line_height / 2;
+
+ plot_style_odd.furn[TREE_FURN_EXPAND].size = size;
+ plot_style_odd.furn[TREE_FURN_EXPAND].bmp =
+ treeview_generate_triangle_bitmap(
+ plot_style_odd.bg.fill_colour,
+ plot_style_odd.itext.foreground, size);
+ plot_style_odd.furn[TREE_FURN_EXPAND].sel =
+ treeview_generate_triangle_bitmap(
+ plot_style_odd.sbg.fill_colour,
+ plot_style_odd.sitext.foreground, size);
+
+ plot_style_even.furn[TREE_FURN_EXPAND].size = size;
+ plot_style_even.furn[TREE_FURN_EXPAND].bmp =
+ treeview_generate_triangle_bitmap(
+ plot_style_even.bg.fill_colour,
+ plot_style_even.itext.foreground, size);
+ plot_style_even.furn[TREE_FURN_EXPAND].sel =
+ treeview_generate_copy_bitmap(
+ plot_style_odd.furn[TREE_FURN_EXPAND].sel, size);
+
+ plot_style_odd.furn[TREE_FURN_CONTRACT].size = size;
+ plot_style_odd.furn[TREE_FURN_CONTRACT].bmp =
+ treeview_generate_rotate_bitmap(
+ plot_style_odd.furn[TREE_FURN_EXPAND].bmp, size);
+ plot_style_odd.furn[TREE_FURN_CONTRACT].sel =
+ treeview_generate_rotate_bitmap(
+ plot_style_odd.furn[TREE_FURN_EXPAND].sel, size);
+
+ plot_style_even.furn[TREE_FURN_CONTRACT].size = size;
+ plot_style_even.furn[TREE_FURN_CONTRACT].bmp =
+ treeview_generate_rotate_bitmap(
+ plot_style_even.furn[TREE_FURN_EXPAND].bmp, size);
+ plot_style_even.furn[TREE_FURN_CONTRACT].sel =
+ treeview_generate_rotate_bitmap(
+ plot_style_even.furn[TREE_FURN_EXPAND].sel, size);
+
+ if (plot_style_odd.furn[TREE_FURN_EXPAND].bmp == NULL ||
+ plot_style_odd.furn[TREE_FURN_EXPAND].sel == NULL ||
+ plot_style_even.furn[TREE_FURN_EXPAND].bmp == NULL ||
+ plot_style_even.furn[TREE_FURN_EXPAND].sel == NULL ||
+ plot_style_odd.furn[TREE_FURN_CONTRACT].bmp == NULL ||
+ plot_style_odd.furn[TREE_FURN_CONTRACT].sel == NULL ||
+ plot_style_even.furn[TREE_FURN_CONTRACT].bmp == NULL ||
+ plot_style_even.furn[TREE_FURN_CONTRACT].sel == NULL)
+ return NSERROR_NOMEM;
+
tree_g.furniture_width = size + tree_g.line_height / 4;
+
+ return NSERROR_OK;
}
@@ -3663,6 +3813,7 @@ static void treeview_init_furniture(void)
nserror treeview_init(int font_pt_size)
{
int font_px_size;
+ nserror err;
if (tree_g.initialised == true)
return NSERROR_OK;
@@ -3675,7 +3826,9 @@ nserror treeview_init(int font_pt_size)
treeview_init_plot_styles(font_pt_size);
treeview_init_resources();
- treeview_init_furniture();
+ err = treeview_init_furniture();
+ if (err != NSERROR_OK)
+ return err;
tree_g.step_width = tree_g.furniture_width;
tree_g.window_padding = 6;
@@ -3699,6 +3852,15 @@ nserror treeview_fini(void)
hlcache_handle_release(treeview_res[i].c);
}
+ bitmap_destroy(plot_style_odd.furn[TREE_FURN_EXPAND].bmp);
+ bitmap_destroy(plot_style_odd.furn[TREE_FURN_EXPAND].sel);
+ bitmap_destroy(plot_style_even.furn[TREE_FURN_EXPAND].bmp);
+ bitmap_destroy(plot_style_even.furn[TREE_FURN_EXPAND].sel);
+ bitmap_destroy(plot_style_odd.furn[TREE_FURN_CONTRACT].bmp);
+ bitmap_destroy(plot_style_odd.furn[TREE_FURN_CONTRACT].sel);
+ bitmap_destroy(plot_style_even.furn[TREE_FURN_CONTRACT].bmp);
+ bitmap_destroy(plot_style_even.furn[TREE_FURN_CONTRACT].sel);
+
tree_g.initialised = false;
return NSERROR_OK;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=506a0e7d940abb6a95a...
commit 506a0e7d940abb6a95a890caf024743a993c8dcd
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add accessors for individual colour channels.
diff --git a/desktop/plot_style.h b/desktop/plot_style.h
index 71243a9..45813d4 100644
--- a/desktop/plot_style.h
+++ b/desktop/plot_style.h
@@ -75,9 +75,21 @@
((c0 & 0x00ff00) * ( p)) ) >> 8) & 0x00ff00))
/* get a bitmap pixel (image/bitmap.h) into a plot colour */
-#define pixel_to_colour(b) \
+#define pixel_to_colour(b) \
b[0] | (b[1] << 8) | (b[2] << 16) | (b[3] << 24)
+/* Get the red channel from a colour */
+#define red_from_colour(c) \
+ ((c ) & 0xff)
+
+/* Get the green channel from a colour */
+#define green_from_colour(c) \
+ ((c >> 8) & 0xff)
+
+/* Get the blue channel from a colour */
+#define blue_from_colour(c) \
+ ((c >> 16) & 0xff)
+
/**
* Colour type: XBGR
*/
-----------------------------------------------------------------------
Summary of changes:
desktop/plot_style.h | 14 ++-
desktop/treeview.c | 364 ++++++++++++++++++++++++++++++++++++--------------
2 files changed, 276 insertions(+), 102 deletions(-)
diff --git a/desktop/plot_style.h b/desktop/plot_style.h
index 71243a9..45813d4 100644
--- a/desktop/plot_style.h
+++ b/desktop/plot_style.h
@@ -75,9 +75,21 @@
((c0 & 0x00ff00) * ( p)) ) >> 8) & 0x00ff00))
/* get a bitmap pixel (image/bitmap.h) into a plot colour */
-#define pixel_to_colour(b) \
+#define pixel_to_colour(b) \
b[0] | (b[1] << 8) | (b[2] << 16) | (b[3] << 24)
+/* Get the red channel from a colour */
+#define red_from_colour(c) \
+ ((c ) & 0xff)
+
+/* Get the green channel from a colour */
+#define green_from_colour(c) \
+ ((c >> 8) & 0xff)
+
+/* Get the blue channel from a colour */
+#define blue_from_colour(c) \
+ ((c >> 16) & 0xff)
+
/**
* Colour type: XBGR
*/
diff --git a/desktop/treeview.c b/desktop/treeview.c
index b885660..3bd0f6a 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -26,6 +26,7 @@
#include "desktop/plotters.h"
#include "desktop/textarea.h"
#include "desktop/treeview.h"
+#include "image/bitmap.h"
#include "render/font.h"
#include "utils/log.h"
@@ -157,16 +158,27 @@ struct treeview {
};
+enum treeview_furniture_id {
+ TREE_FURN_EXPAND = 0,
+ TREE_FURN_CONTRACT,
+ TREE_FURN_LAST
+};
+struct treeview_furniture {
+ int size;
+ struct bitmap *bmp;
+ struct bitmap *sel;
+};
+
struct treeview_node_style {
plot_style_t bg; /**< Background */
plot_font_style_t text; /**< Text */
plot_font_style_t itext; /**< Entry field text */
- plot_style_t furn; /**< Furniture */
plot_style_t sbg; /**< Selected background */
plot_font_style_t stext; /**< Selected text */
plot_font_style_t sitext; /**< Selected entry field text */
- plot_style_t sfurn; /**< Selected furniture */
+
+ struct treeview_furniture furn[TREE_FURN_LAST];
};
struct treeview_node_style plot_style_odd; /**< Plot style for odd rows */
@@ -193,19 +205,6 @@ static struct treeview_resource treeview_res[TREE_RES_LAST] = {
}; /**< Treeview content resources */
-
-enum treeview_furniture_id {
- TREE_FURN_EXPAND = 0,
- TREE_FURN_CONTRACT,
- TREE_FURN_LAST
-};
-struct treeview_furniture {
- int pts; /* Number of points (max = 8) */
- int c[8]; /* Coordinate array. x-coord, y-coord... */
-};
-static struct treeview_furniture tree_furn[TREE_FURN_LAST];
-
-
/* Find the next node in depth first tree order
*
* \param node Start node
@@ -1669,12 +1668,10 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
plot_style_t *bg_style;
plot_font_style_t *text_style;
plot_font_style_t *infotext_style;
- plot_style_t *furn_style;
+ struct bitmap *furniture;
int height;
int sel_min, sel_max;
bool invert_selection;
- enum treeview_furniture_id furn_id;
- int coords[8];
assert(tree != NULL);
assert(tree->root != NULL);
@@ -1763,12 +1760,16 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
bg_style = &style->sbg;
text_style = &style->stext;
infotext_style = &style->sitext;
- furn_style = &style->sfurn;
+ furniture = (node->flags & TREE_NODE_EXPANDED) ?
+ style->furn[TREE_FURN_CONTRACT].sel :
+ style->furn[TREE_FURN_EXPAND].sel;
} else {
bg_style = &style->bg;
text_style = &style->text;
infotext_style = &style->itext;
- furn_style = &style->furn;
+ furniture = (node->flags & TREE_NODE_EXPANDED) ?
+ style->furn[TREE_FURN_CONTRACT].bmp :
+ style->furn[TREE_FURN_EXPAND].bmp;
}
/* Render background */
@@ -1777,18 +1778,11 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
new_ctx.plot->rectangle(r.x0, y0, r.x1, y1, bg_style);
/* Render toggle */
- if (node->flags & TREE_NODE_EXPANDED) {
- furn_id = TREE_FURN_CONTRACT;
- } else {
- furn_id = TREE_FURN_EXPAND;
- }
-
- for (i = 0; i < tree_furn[furn_id].pts; i += 2) {
- coords[i ] = tree_furn[furn_id].c[i ] + inset;
- coords[i + 1] = tree_furn[furn_id].c[i + 1] + render_y;
- }
- new_ctx.plot->polygon(coords, tree_furn[furn_id].pts / 2,
- furn_style);
+ new_ctx.plot->bitmap(inset, render_y + tree_g.line_height / 4,
+ style->furn[TREE_FURN_EXPAND].size,
+ style->furn[TREE_FURN_EXPAND].size,
+ furniture,
+ bg_style->fill_colour, BITMAPF_NONE);
/* Render icon */
if (node->type == TREE_NODE_ENTRY)
@@ -3481,10 +3475,6 @@ static void treeview_init_plot_styles(int font_pt_size)
plot_style_even.text.foreground,
plot_style_even.text.background, 255 * 10 / 16);
- /* Furniture colour */
- plot_style_even.furn = plot_style_even.bg;
- plot_style_even.furn.fill_colour = plot_style_even.itext.foreground;
-
/* Selected background colour */
plot_style_even.sbg = plot_style_even.bg;
plot_style_even.sbg.fill_colour = gui_system_colour_char("Highlight");
@@ -3501,10 +3491,6 @@ static void treeview_init_plot_styles(int font_pt_size)
plot_style_even.stext.foreground,
plot_style_even.stext.background, 255 * 25 / 32);
- /* Selected furniture colour */
- plot_style_even.sfurn = plot_style_even.bg;
- plot_style_even.sfurn.fill_colour = plot_style_even.sitext.foreground;
-
/* Odd numbered node styles */
plot_style_odd.bg = plot_style_even.bg;
@@ -3517,13 +3503,10 @@ static void treeview_init_plot_styles(int font_pt_size)
plot_style_odd.itext.foreground = mix_colour(
plot_style_odd.text.foreground,
plot_style_odd.text.background, 255 * 10 / 16);
- plot_style_odd.furn = plot_style_odd.bg;
- plot_style_odd.furn.fill_colour = plot_style_odd.itext.foreground;
plot_style_odd.sbg = plot_style_even.sbg;
plot_style_odd.stext = plot_style_even.stext;
plot_style_odd.sitext = plot_style_even.sitext;
- plot_style_odd.sfurn = plot_style_even.sfurn;
}
@@ -3571,91 +3554,258 @@ static void treeview_init_resources(void)
/**
- * Measures width of characters used to represent treeview furniture.
+ * Create a right-pointing anti-aliased triangle bitmap
+ *
+ * bg background colour
+ * fg foreground colour
+ * size required bitmap size
*/
-static void treeview_init_furniture(void)
+static struct bitmap * treeview_generate_triangle_bitmap(
+ colour bg, colour fg, int size)
{
- struct treeview_furniture *f;
- int size = tree_g.line_height / 2;
- int smax = size - 1;
- int i, y;
+ struct bitmap *b = NULL;
+ int x, y;
+ unsigned char *rpos;
+ unsigned char *pos;
+ size_t stride;
+
+ /* Set up required colour graduations. Ignores screen gamma. */
+ colour colour0 = bg;
+ colour colour1 = mix_colour(bg, fg, 255 * 3 / 4);
+ colour colour2 = blend_colour(bg, fg);
+ colour colour3 = mix_colour(bg, fg, 255 * 1 / 4);
+ colour colour4 = fg;
+
+ /* Create the bitmap */
+ b = bitmap_create(size, size, BITMAP_NEW | BITMAP_OPAQUE);
+ if (b == NULL)
+ return NULL;
+
+ rpos = bitmap_get_buffer(b);
+ stride = bitmap_get_rowstride(b);
+
+ /* Draw the triangle */
+ for (y = 0; y < size; y++) {
+ pos = rpos;
+
+ if (y < size / 2) {
+ /* Top half */
+ for (x = 0; x < y * 2; x++) {
+ *(pos++) = red_from_colour(colour4);
+ *(pos++) = green_from_colour(colour4);
+ *(pos++) = blue_from_colour(colour4);
+ pos++;
+ }
+ *(pos++) = red_from_colour(colour3);
+ *(pos++) = green_from_colour(colour3);
+ *(pos++) = blue_from_colour(colour3);
+ pos++;
+ *(pos++) = red_from_colour(colour1);
+ *(pos++) = green_from_colour(colour1);
+ *(pos++) = blue_from_colour(colour1);
+ pos++;
+ for (x = y * 2 + 2; x < size ; x++) {
+ *(pos++) = red_from_colour(colour0);
+ *(pos++) = green_from_colour(colour0);
+ *(pos++) = blue_from_colour(colour0);
+ pos++;
+ }
+ } else if ((y == size / 2) && (size & 0x1)) {
+ /* Middle row */
+ for (x = 0; x < size - 1; x++) {
+ *(pos++) = red_from_colour(colour4);
+ *(pos++) = green_from_colour(colour4);
+ *(pos++) = blue_from_colour(colour4);
+ pos++;
+ }
+ *(pos++) = red_from_colour(colour2);
+ *(pos++) = green_from_colour(colour2);
+ *(pos++) = blue_from_colour(colour2);
+ pos++;
+ } else {
+ /* Bottom half */
+ for (x = 0; x < (size - y - 1) * 2; x++) {
+ *(pos++) = red_from_colour(colour4);
+ *(pos++) = green_from_colour(colour4);
+ *(pos++) = blue_from_colour(colour4);
+ pos++;
+ }
+ *(pos++) = red_from_colour(colour3);
+ *(pos++) = green_from_colour(colour3);
+ *(pos++) = blue_from_colour(colour3);
+ pos++;
+ *(pos++) = red_from_colour(colour1);
+ *(pos++) = green_from_colour(colour1);
+ *(pos++) = blue_from_colour(colour1);
+ pos++;
+ for (x = (size - y) * 2; x < size ; x++) {
+ *(pos++) = red_from_colour(colour0);
+ *(pos++) = green_from_colour(colour0);
+ *(pos++) = blue_from_colour(colour0);
+ pos++;
+ }
+ }
- /* Make TREE_FURN_EXPAND */
- f = &(tree_furn[TREE_FURN_EXPAND]);
+ rpos += stride;
+ }
- if (size & 0x1) {
- /* Size is odd; triangle */
- f->pts = 6;
+ bitmap_modified(b);
- f->c[0] = 0;
- f->c[1] = 0;
+ return b;
+}
- f->c[2] = smax;
- f->c[3] = size / 2;
- f->c[4] = 0;
- f->c[5] = smax;
+/**
+ * Create bitmap copy of another bitmap
+ *
+ * orig bitmap to copy
+ * size required bitmap size
+ */
+static struct bitmap * treeview_generate_copy_bitmap(
+ struct bitmap *orig, int size)
+{
+ struct bitmap *b = NULL;
+ unsigned char *data;
+ unsigned char *orig_data;
+ size_t stride;
- } else {
- /* Size is even; trapezium */
- f->pts = 8;
+ if (orig == NULL)
+ return NULL;
- f->c[0] = 0;
- f->c[1] = 0;
+ assert(size == bitmap_get_width(orig));
+ assert(size == bitmap_get_height(orig));
- f->c[2] = smax;
- f->c[3] = size / 2 - 1;
+ /* Create the bitmap */
+ b = bitmap_create(size, size, BITMAP_NEW | BITMAP_OPAQUE);
+ if (b == NULL)
+ return NULL;
- f->c[4] = smax;
- f->c[5] = size / 2;
+ stride = bitmap_get_rowstride(b);
+ assert(stride == bitmap_get_rowstride(orig));
- f->c[6] = 0;
- f->c[7] = smax;
- }
+ data = bitmap_get_buffer(b);
+ orig_data = bitmap_get_buffer(orig);
- /* Make TREE_FURN_CONTRACT */
- f = &(tree_furn[TREE_FURN_CONTRACT]);
+ /* Copy the bitmap */
+ memcpy(data, orig_data, stride * size);
- if (size & 0x1) {
- /* Size is odd; triangle */
- f->pts = 6;
+ bitmap_modified(b);
- f->c[0] = 0;
- f->c[1] = 0;
+ return b;
+}
- f->c[2] = smax;
- f->c[3] = 0;
- f->c[4] = size / 2;
- f->c[5] = smax;
+/**
+ * Create bitmap from rotation of another bitmap
+ *
+ * orig bitmap to create rotation of
+ * size required bitmap size
+ */
+static struct bitmap * treeview_generate_rotate_bitmap(
+ struct bitmap *orig, int size)
+{
+ struct bitmap *b = NULL;
+ int x, y;
+ unsigned char *rpos;
+ unsigned char *pos;
+ unsigned char *orig_data;
+ unsigned char *orig_pos;
+ size_t stride;
- } else {
- /* Size is even; trapezium */
- f->pts = 8;
+ if (orig == NULL)
+ return NULL;
- f->c[0] = 0;
- f->c[1] = 0;
+ assert(size == bitmap_get_width(orig));
+ assert(size == bitmap_get_height(orig));
- f->c[2] = smax;
- f->c[3] = 0;
+ /* Create the bitmap */
+ b = bitmap_create(size, size, BITMAP_NEW | BITMAP_OPAQUE);
+ if (b == NULL)
+ return NULL;
- f->c[4] = size / 2;
- f->c[5] = smax;
+ stride = bitmap_get_rowstride(b);
+ assert(stride == bitmap_get_rowstride(orig));
- f->c[6] = size / 2 - 1;
- f->c[7] = smax;
- }
+ rpos = bitmap_get_buffer(b);
+ orig_data = bitmap_get_buffer(orig);
- /* Vertically offset for line height */
- for (i = 0; i < TREE_FURN_LAST; i++) {
- f = &(tree_furn[i]);
+ /* Copy the rotated bitmap */
+ for (y = 0; y < size; y++) {
+ pos = rpos;
- for (y = 1; y < f->pts; y += 2) {
- f->c[y] += tree_g.line_height / 4;
+ for (x = 0; x < size; x++) {
+ orig_pos = orig_data + x * stride + y * 4;
+ *(pos++) = *(orig_pos++);
+ *(pos++) = *(orig_pos++);
+ *(pos++) = *(orig_pos);
+ pos++;
+
}
+
+ rpos += stride;
}
+ bitmap_modified(b);
+
+ return b;
+}
+
+
+/**
+ * Measures width of characters used to represent treeview furniture.
+ */
+static nserror treeview_init_furniture(void)
+{
+ int size = tree_g.line_height / 2;
+
+ plot_style_odd.furn[TREE_FURN_EXPAND].size = size;
+ plot_style_odd.furn[TREE_FURN_EXPAND].bmp =
+ treeview_generate_triangle_bitmap(
+ plot_style_odd.bg.fill_colour,
+ plot_style_odd.itext.foreground, size);
+ plot_style_odd.furn[TREE_FURN_EXPAND].sel =
+ treeview_generate_triangle_bitmap(
+ plot_style_odd.sbg.fill_colour,
+ plot_style_odd.sitext.foreground, size);
+
+ plot_style_even.furn[TREE_FURN_EXPAND].size = size;
+ plot_style_even.furn[TREE_FURN_EXPAND].bmp =
+ treeview_generate_triangle_bitmap(
+ plot_style_even.bg.fill_colour,
+ plot_style_even.itext.foreground, size);
+ plot_style_even.furn[TREE_FURN_EXPAND].sel =
+ treeview_generate_copy_bitmap(
+ plot_style_odd.furn[TREE_FURN_EXPAND].sel, size);
+
+ plot_style_odd.furn[TREE_FURN_CONTRACT].size = size;
+ plot_style_odd.furn[TREE_FURN_CONTRACT].bmp =
+ treeview_generate_rotate_bitmap(
+ plot_style_odd.furn[TREE_FURN_EXPAND].bmp, size);
+ plot_style_odd.furn[TREE_FURN_CONTRACT].sel =
+ treeview_generate_rotate_bitmap(
+ plot_style_odd.furn[TREE_FURN_EXPAND].sel, size);
+
+ plot_style_even.furn[TREE_FURN_CONTRACT].size = size;
+ plot_style_even.furn[TREE_FURN_CONTRACT].bmp =
+ treeview_generate_rotate_bitmap(
+ plot_style_even.furn[TREE_FURN_EXPAND].bmp, size);
+ plot_style_even.furn[TREE_FURN_CONTRACT].sel =
+ treeview_generate_rotate_bitmap(
+ plot_style_even.furn[TREE_FURN_EXPAND].sel, size);
+
+ if (plot_style_odd.furn[TREE_FURN_EXPAND].bmp == NULL ||
+ plot_style_odd.furn[TREE_FURN_EXPAND].sel == NULL ||
+ plot_style_even.furn[TREE_FURN_EXPAND].bmp == NULL ||
+ plot_style_even.furn[TREE_FURN_EXPAND].sel == NULL ||
+ plot_style_odd.furn[TREE_FURN_CONTRACT].bmp == NULL ||
+ plot_style_odd.furn[TREE_FURN_CONTRACT].sel == NULL ||
+ plot_style_even.furn[TREE_FURN_CONTRACT].bmp == NULL ||
+ plot_style_even.furn[TREE_FURN_CONTRACT].sel == NULL)
+ return NSERROR_NOMEM;
+
tree_g.furniture_width = size + tree_g.line_height / 4;
+
+ return NSERROR_OK;
}
@@ -3663,6 +3813,7 @@ static void treeview_init_furniture(void)
nserror treeview_init(int font_pt_size)
{
int font_px_size;
+ nserror err;
if (tree_g.initialised == true)
return NSERROR_OK;
@@ -3675,7 +3826,9 @@ nserror treeview_init(int font_pt_size)
treeview_init_plot_styles(font_pt_size);
treeview_init_resources();
- treeview_init_furniture();
+ err = treeview_init_furniture();
+ if (err != NSERROR_OK)
+ return err;
tree_g.step_width = tree_g.furniture_width;
tree_g.window_padding = 6;
@@ -3699,6 +3852,15 @@ nserror treeview_fini(void)
hlcache_handle_release(treeview_res[i].c);
}
+ bitmap_destroy(plot_style_odd.furn[TREE_FURN_EXPAND].bmp);
+ bitmap_destroy(plot_style_odd.furn[TREE_FURN_EXPAND].sel);
+ bitmap_destroy(plot_style_even.furn[TREE_FURN_EXPAND].bmp);
+ bitmap_destroy(plot_style_even.furn[TREE_FURN_EXPAND].sel);
+ bitmap_destroy(plot_style_odd.furn[TREE_FURN_CONTRACT].bmp);
+ bitmap_destroy(plot_style_odd.furn[TREE_FURN_CONTRACT].sel);
+ bitmap_destroy(plot_style_even.furn[TREE_FURN_CONTRACT].bmp);
+ bitmap_destroy(plot_style_even.furn[TREE_FURN_CONTRACT].sel);
+
tree_g.initialised = false;
return NSERROR_OK;
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-581-gf19e827
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/f19e827983518a65a65aa...
...commit http://git.netsurf-browser.org/netsurf.git/commit/f19e827983518a65a65aa7a...
...tree http://git.netsurf-browser.org/netsurf.git/tree/f19e827983518a65a65aa7ab6...
The branch, master has been updated
via f19e827983518a65a65aa7ab663c59a921b02fa4 (commit)
from bdf76965b4ce27b84f9850e59bde0cc1a3c16845 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=f19e827983518a65a65...
commit f19e827983518a65a65aa7ab663c59a921b02fa4
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Use polygon plotter for treeview furniture (node expansion/contraction triangles), instead of triangle text glyphs.
diff --git a/desktop/treeview.c b/desktop/treeview.c
index af950aa..b885660 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -161,10 +161,12 @@ struct treeview_node_style {
plot_style_t bg; /**< Background */
plot_font_style_t text; /**< Text */
plot_font_style_t itext; /**< Entry field text */
+ plot_style_t furn; /**< Furniture */
plot_style_t sbg; /**< Selected background */
plot_font_style_t stext; /**< Selected text */
plot_font_style_t sitext; /**< Selected entry field text */
+ plot_style_t sfurn; /**< Selected furniture */
};
struct treeview_node_style plot_style_odd; /**< Plot style for odd rows */
@@ -197,10 +199,11 @@ enum treeview_furniture_id {
TREE_FURN_CONTRACT,
TREE_FURN_LAST
};
-static struct treeview_text treeview_furn[TREE_FURN_LAST] = {
- { "\xe2\x96\xb8", 3, 0 }, /* U+25B8: Right-pointing small triangle */
- { "\xe2\x96\xbe", 3, 0 } /* U+25BE: Down-pointing small triangle */
+struct treeview_furniture {
+ int pts; /* Number of points (max = 8) */
+ int c[8]; /* Coordinate array. x-coord, y-coord... */
};
+static struct treeview_furniture tree_furn[TREE_FURN_LAST];
/* Find the next node in depth first tree order
@@ -1666,9 +1669,12 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
plot_style_t *bg_style;
plot_font_style_t *text_style;
plot_font_style_t *infotext_style;
+ plot_style_t *furn_style;
int height;
int sel_min, sel_max;
bool invert_selection;
+ enum treeview_furniture_id furn_id;
+ int coords[8];
assert(tree != NULL);
assert(tree->root != NULL);
@@ -1757,10 +1763,12 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
bg_style = &style->sbg;
text_style = &style->stext;
infotext_style = &style->sitext;
+ furn_style = &style->sfurn;
} else {
bg_style = &style->bg;
text_style = &style->text;
infotext_style = &style->itext;
+ furn_style = &style->furn;
}
/* Render background */
@@ -1770,17 +1778,18 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
/* Render toggle */
if (node->flags & TREE_NODE_EXPANDED) {
- new_ctx.plot->text(inset, render_y + baseline,
- treeview_furn[TREE_FURN_CONTRACT].data,
- treeview_furn[TREE_FURN_CONTRACT].len,
- text_style);
+ furn_id = TREE_FURN_CONTRACT;
} else {
- new_ctx.plot->text(inset, render_y + baseline,
- treeview_furn[TREE_FURN_EXPAND].data,
- treeview_furn[TREE_FURN_EXPAND].len,
- text_style);
+ furn_id = TREE_FURN_EXPAND;
}
+ for (i = 0; i < tree_furn[furn_id].pts; i += 2) {
+ coords[i ] = tree_furn[furn_id].c[i ] + inset;
+ coords[i + 1] = tree_furn[furn_id].c[i + 1] + render_y;
+ }
+ new_ctx.plot->polygon(coords, tree_furn[furn_id].pts / 2,
+ furn_style);
+
/* Render icon */
if (node->type == TREE_NODE_ENTRY)
res = TREE_RES_CONTENT;
@@ -3472,6 +3481,10 @@ static void treeview_init_plot_styles(int font_pt_size)
plot_style_even.text.foreground,
plot_style_even.text.background, 255 * 10 / 16);
+ /* Furniture colour */
+ plot_style_even.furn = plot_style_even.bg;
+ plot_style_even.furn.fill_colour = plot_style_even.itext.foreground;
+
/* Selected background colour */
plot_style_even.sbg = plot_style_even.bg;
plot_style_even.sbg.fill_colour = gui_system_colour_char("Highlight");
@@ -3488,6 +3501,10 @@ static void treeview_init_plot_styles(int font_pt_size)
plot_style_even.stext.foreground,
plot_style_even.stext.background, 255 * 25 / 32);
+ /* Selected furniture colour */
+ plot_style_even.sfurn = plot_style_even.bg;
+ plot_style_even.sfurn.fill_colour = plot_style_even.sitext.foreground;
+
/* Odd numbered node styles */
plot_style_odd.bg = plot_style_even.bg;
@@ -3500,10 +3517,13 @@ static void treeview_init_plot_styles(int font_pt_size)
plot_style_odd.itext.foreground = mix_colour(
plot_style_odd.text.foreground,
plot_style_odd.text.background, 255 * 10 / 16);
+ plot_style_odd.furn = plot_style_odd.bg;
+ plot_style_odd.furn.fill_colour = plot_style_odd.itext.foreground;
plot_style_odd.sbg = plot_style_even.sbg;
plot_style_odd.stext = plot_style_even.stext;
plot_style_odd.sitext = plot_style_even.sitext;
+ plot_style_odd.sfurn = plot_style_even.sfurn;
}
@@ -3555,20 +3575,87 @@ static void treeview_init_resources(void)
*/
static void treeview_init_furniture(void)
{
- int i;
- tree_g.furniture_width = 0;
+ struct treeview_furniture *f;
+ int size = tree_g.line_height / 2;
+ int smax = size - 1;
+ int i, y;
+
+ /* Make TREE_FURN_EXPAND */
+ f = &(tree_furn[TREE_FURN_EXPAND]);
+
+ if (size & 0x1) {
+ /* Size is odd; triangle */
+ f->pts = 6;
+
+ f->c[0] = 0;
+ f->c[1] = 0;
+
+ f->c[2] = smax;
+ f->c[3] = size / 2;
+
+ f->c[4] = 0;
+ f->c[5] = smax;
+
+ } else {
+ /* Size is even; trapezium */
+ f->pts = 8;
+
+ f->c[0] = 0;
+ f->c[1] = 0;
+
+ f->c[2] = smax;
+ f->c[3] = size / 2 - 1;
+
+ f->c[4] = smax;
+ f->c[5] = size / 2;
+
+ f->c[6] = 0;
+ f->c[7] = smax;
+ }
+
+ /* Make TREE_FURN_CONTRACT */
+ f = &(tree_furn[TREE_FURN_CONTRACT]);
+
+ if (size & 0x1) {
+ /* Size is odd; triangle */
+ f->pts = 6;
+ f->c[0] = 0;
+ f->c[1] = 0;
+
+ f->c[2] = smax;
+ f->c[3] = 0;
+
+ f->c[4] = size / 2;
+ f->c[5] = smax;
+
+ } else {
+ /* Size is even; trapezium */
+ f->pts = 8;
+
+ f->c[0] = 0;
+ f->c[1] = 0;
+
+ f->c[2] = smax;
+ f->c[3] = 0;
+
+ f->c[4] = size / 2;
+ f->c[5] = smax;
+
+ f->c[6] = size / 2 - 1;
+ f->c[7] = smax;
+ }
+
+ /* Vertically offset for line height */
for (i = 0; i < TREE_FURN_LAST; i++) {
- nsfont.font_width(&plot_style_odd.text,
- treeview_furn[i].data,
- treeview_furn[i].len,
- &(treeview_furn[i].width));
+ f = &(tree_furn[i]);
- if (treeview_furn[i].width > tree_g.furniture_width)
- tree_g.furniture_width = treeview_furn[i].width;
+ for (y = 1; y < f->pts; y += 2) {
+ f->c[y] += tree_g.line_height / 4;
+ }
}
- tree_g.furniture_width += 5;
+ tree_g.furniture_width = size + tree_g.line_height / 4;
}
@@ -3583,19 +3670,20 @@ nserror treeview_init(int font_pt_size)
if (font_pt_size <= 0)
font_pt_size = 11;
+ font_px_size = (font_pt_size * FIXTOINT(nscss_screen_dpi) + 36) / 72;
+ tree_g.line_height = (font_px_size * 8 + 3) / 6;
+
treeview_init_plot_styles(font_pt_size);
treeview_init_resources();
treeview_init_furniture();
- font_px_size = (font_pt_size * FIXTOINT(nscss_screen_dpi) + 36) / 72;
-
- tree_g.line_height = (font_px_size * 8 + 3) / 6;
tree_g.step_width = tree_g.furniture_width;
tree_g.window_padding = 6;
tree_g.icon_size = 17;
tree_g.icon_step = 23;
tree_g.move_offset = 18;
+
tree_g.initialised = true;
return NSERROR_OK;
-----------------------------------------------------------------------
Summary of changes:
desktop/treeview.c | 134 +++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 111 insertions(+), 23 deletions(-)
diff --git a/desktop/treeview.c b/desktop/treeview.c
index af950aa..b885660 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -161,10 +161,12 @@ struct treeview_node_style {
plot_style_t bg; /**< Background */
plot_font_style_t text; /**< Text */
plot_font_style_t itext; /**< Entry field text */
+ plot_style_t furn; /**< Furniture */
plot_style_t sbg; /**< Selected background */
plot_font_style_t stext; /**< Selected text */
plot_font_style_t sitext; /**< Selected entry field text */
+ plot_style_t sfurn; /**< Selected furniture */
};
struct treeview_node_style plot_style_odd; /**< Plot style for odd rows */
@@ -197,10 +199,11 @@ enum treeview_furniture_id {
TREE_FURN_CONTRACT,
TREE_FURN_LAST
};
-static struct treeview_text treeview_furn[TREE_FURN_LAST] = {
- { "\xe2\x96\xb8", 3, 0 }, /* U+25B8: Right-pointing small triangle */
- { "\xe2\x96\xbe", 3, 0 } /* U+25BE: Down-pointing small triangle */
+struct treeview_furniture {
+ int pts; /* Number of points (max = 8) */
+ int c[8]; /* Coordinate array. x-coord, y-coord... */
};
+static struct treeview_furniture tree_furn[TREE_FURN_LAST];
/* Find the next node in depth first tree order
@@ -1666,9 +1669,12 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
plot_style_t *bg_style;
plot_font_style_t *text_style;
plot_font_style_t *infotext_style;
+ plot_style_t *furn_style;
int height;
int sel_min, sel_max;
bool invert_selection;
+ enum treeview_furniture_id furn_id;
+ int coords[8];
assert(tree != NULL);
assert(tree->root != NULL);
@@ -1757,10 +1763,12 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
bg_style = &style->sbg;
text_style = &style->stext;
infotext_style = &style->sitext;
+ furn_style = &style->sfurn;
} else {
bg_style = &style->bg;
text_style = &style->text;
infotext_style = &style->itext;
+ furn_style = &style->furn;
}
/* Render background */
@@ -1770,17 +1778,18 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
/* Render toggle */
if (node->flags & TREE_NODE_EXPANDED) {
- new_ctx.plot->text(inset, render_y + baseline,
- treeview_furn[TREE_FURN_CONTRACT].data,
- treeview_furn[TREE_FURN_CONTRACT].len,
- text_style);
+ furn_id = TREE_FURN_CONTRACT;
} else {
- new_ctx.plot->text(inset, render_y + baseline,
- treeview_furn[TREE_FURN_EXPAND].data,
- treeview_furn[TREE_FURN_EXPAND].len,
- text_style);
+ furn_id = TREE_FURN_EXPAND;
}
+ for (i = 0; i < tree_furn[furn_id].pts; i += 2) {
+ coords[i ] = tree_furn[furn_id].c[i ] + inset;
+ coords[i + 1] = tree_furn[furn_id].c[i + 1] + render_y;
+ }
+ new_ctx.plot->polygon(coords, tree_furn[furn_id].pts / 2,
+ furn_style);
+
/* Render icon */
if (node->type == TREE_NODE_ENTRY)
res = TREE_RES_CONTENT;
@@ -3472,6 +3481,10 @@ static void treeview_init_plot_styles(int font_pt_size)
plot_style_even.text.foreground,
plot_style_even.text.background, 255 * 10 / 16);
+ /* Furniture colour */
+ plot_style_even.furn = plot_style_even.bg;
+ plot_style_even.furn.fill_colour = plot_style_even.itext.foreground;
+
/* Selected background colour */
plot_style_even.sbg = plot_style_even.bg;
plot_style_even.sbg.fill_colour = gui_system_colour_char("Highlight");
@@ -3488,6 +3501,10 @@ static void treeview_init_plot_styles(int font_pt_size)
plot_style_even.stext.foreground,
plot_style_even.stext.background, 255 * 25 / 32);
+ /* Selected furniture colour */
+ plot_style_even.sfurn = plot_style_even.bg;
+ plot_style_even.sfurn.fill_colour = plot_style_even.sitext.foreground;
+
/* Odd numbered node styles */
plot_style_odd.bg = plot_style_even.bg;
@@ -3500,10 +3517,13 @@ static void treeview_init_plot_styles(int font_pt_size)
plot_style_odd.itext.foreground = mix_colour(
plot_style_odd.text.foreground,
plot_style_odd.text.background, 255 * 10 / 16);
+ plot_style_odd.furn = plot_style_odd.bg;
+ plot_style_odd.furn.fill_colour = plot_style_odd.itext.foreground;
plot_style_odd.sbg = plot_style_even.sbg;
plot_style_odd.stext = plot_style_even.stext;
plot_style_odd.sitext = plot_style_even.sitext;
+ plot_style_odd.sfurn = plot_style_even.sfurn;
}
@@ -3555,20 +3575,87 @@ static void treeview_init_resources(void)
*/
static void treeview_init_furniture(void)
{
- int i;
- tree_g.furniture_width = 0;
+ struct treeview_furniture *f;
+ int size = tree_g.line_height / 2;
+ int smax = size - 1;
+ int i, y;
+
+ /* Make TREE_FURN_EXPAND */
+ f = &(tree_furn[TREE_FURN_EXPAND]);
+
+ if (size & 0x1) {
+ /* Size is odd; triangle */
+ f->pts = 6;
+
+ f->c[0] = 0;
+ f->c[1] = 0;
+
+ f->c[2] = smax;
+ f->c[3] = size / 2;
+
+ f->c[4] = 0;
+ f->c[5] = smax;
+
+ } else {
+ /* Size is even; trapezium */
+ f->pts = 8;
+
+ f->c[0] = 0;
+ f->c[1] = 0;
+
+ f->c[2] = smax;
+ f->c[3] = size / 2 - 1;
+
+ f->c[4] = smax;
+ f->c[5] = size / 2;
+
+ f->c[6] = 0;
+ f->c[7] = smax;
+ }
+
+ /* Make TREE_FURN_CONTRACT */
+ f = &(tree_furn[TREE_FURN_CONTRACT]);
+
+ if (size & 0x1) {
+ /* Size is odd; triangle */
+ f->pts = 6;
+ f->c[0] = 0;
+ f->c[1] = 0;
+
+ f->c[2] = smax;
+ f->c[3] = 0;
+
+ f->c[4] = size / 2;
+ f->c[5] = smax;
+
+ } else {
+ /* Size is even; trapezium */
+ f->pts = 8;
+
+ f->c[0] = 0;
+ f->c[1] = 0;
+
+ f->c[2] = smax;
+ f->c[3] = 0;
+
+ f->c[4] = size / 2;
+ f->c[5] = smax;
+
+ f->c[6] = size / 2 - 1;
+ f->c[7] = smax;
+ }
+
+ /* Vertically offset for line height */
for (i = 0; i < TREE_FURN_LAST; i++) {
- nsfont.font_width(&plot_style_odd.text,
- treeview_furn[i].data,
- treeview_furn[i].len,
- &(treeview_furn[i].width));
+ f = &(tree_furn[i]);
- if (treeview_furn[i].width > tree_g.furniture_width)
- tree_g.furniture_width = treeview_furn[i].width;
+ for (y = 1; y < f->pts; y += 2) {
+ f->c[y] += tree_g.line_height / 4;
+ }
}
- tree_g.furniture_width += 5;
+ tree_g.furniture_width = size + tree_g.line_height / 4;
}
@@ -3583,19 +3670,20 @@ nserror treeview_init(int font_pt_size)
if (font_pt_size <= 0)
font_pt_size = 11;
+ font_px_size = (font_pt_size * FIXTOINT(nscss_screen_dpi) + 36) / 72;
+ tree_g.line_height = (font_px_size * 8 + 3) / 6;
+
treeview_init_plot_styles(font_pt_size);
treeview_init_resources();
treeview_init_furniture();
- font_px_size = (font_pt_size * FIXTOINT(nscss_screen_dpi) + 36) / 72;
-
- tree_g.line_height = (font_px_size * 8 + 3) / 6;
tree_g.step_width = tree_g.furniture_width;
tree_g.window_padding = 6;
tree_g.icon_size = 17;
tree_g.icon_step = 23;
tree_g.move_offset = 18;
+
tree_g.initialised = true;
return NSERROR_OK;
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-580-gbdf7696
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/bdf76965b4ce27b84f985...
...commit http://git.netsurf-browser.org/netsurf.git/commit/bdf76965b4ce27b84f9850e...
...tree http://git.netsurf-browser.org/netsurf.git/tree/bdf76965b4ce27b84f9850e59...
The branch, master has been updated
via bdf76965b4ce27b84f9850e59bde0cc1a3c16845 (commit)
from 0c4f32fb1d04657916d7da9ef94f82bb435a1a5e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=bdf76965b4ce27b84f9...
commit bdf76965b4ce27b84f9850e59bde0cc1a3c16845
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Add Undo/Redo to Amiga version. NB: Clear selection no longer has a shortcut key.
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index 454fe26..03672ef 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -508,7 +508,6 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
PMIA_Title, (ULONG)ctxmenulab[CMID_SELCLEAR],
PMIA_ID,CMID_SELCLEAR,
PMIA_Disabled, disabled_noselection,
- PMIA_CommKey, "Z",
TAG_DONE),
PMA_AddItem,NewObject(POPUPMENU_GetItemClass(), NULL,
PMIA_Title, ~0,
diff --git a/amiga/gui.c b/amiga/gui.c
index b7c5585..acbf841 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -2023,7 +2023,11 @@ void ami_handle_msg(void)
break;
case 'z':
- browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION);
+ browser_window_key_press(gwin->bw, KEY_UNDO);
+ break;
+
+ case 'y':
+ browser_window_key_press(gwin->bw, KEY_REDO);
break;
case 'f':
diff --git a/amiga/menu.c b/amiga/menu.c
index de4d63e..3280bde 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -98,6 +98,8 @@ static void ami_menu_item_edit_copy(struct Hook *hook, APTR window, struct Intui
static void ami_menu_item_edit_paste(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_edit_selectall(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_edit_clearsel(struct Hook *hook, APTR window, struct IntuiMessage *msg);
+static void ami_menu_item_edit_undo(struct Hook *hook, APTR window, struct IntuiMessage *msg);
+static void ami_menu_item_edit_redo(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_browser_find(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_browser_localhistory(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_browser_globalhistory(struct Hook *hook, APTR window, struct IntuiMessage *msg);
@@ -241,8 +243,13 @@ void ami_init_menulabs(struct gui_window_2 *gwin)
ami_menu_alloc_item(gwin, M_BAR_E1, NM_ITEM, NM_BARLABEL, 0, NULL, NULL, NULL);
ami_menu_alloc_item(gwin, M_SELALL, NM_ITEM, "SelectAllNS", 'A', NULL,
ami_menu_item_edit_selectall, NULL);
- ami_menu_alloc_item(gwin, M_CLEAR, NM_ITEM, "ClearNS", 'Z', NULL,
+ ami_menu_alloc_item(gwin, M_CLEAR, NM_ITEM, "ClearNS", 0, NULL,
ami_menu_item_edit_clearsel, NULL);
+ ami_menu_alloc_item(gwin, M_BAR_E2, NM_ITEM, NM_BARLABEL, 0, NULL, NULL, NULL);
+ ami_menu_alloc_item(gwin, M_UNDO, NM_ITEM, "Undo", 'Z', NULL,
+ ami_menu_item_edit_undo, NULL);
+ ami_menu_alloc_item(gwin, M_REDO, NM_ITEM, "Redo", 'Y', NULL,
+ ami_menu_item_edit_redo, NULL);
ami_menu_alloc_item(gwin, M_BROWSER, NM_TITLE, "Browser", 0, NULL, NULL, NULL);
ami_menu_alloc_item(gwin, M_FIND, NM_ITEM, "FindTextNS", 'F', NULL,
@@ -897,6 +904,22 @@ static void ami_menu_item_edit_clearsel(struct Hook *hook, APTR window, struct I
browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION);
}
+static void ami_menu_item_edit_undo(struct Hook *hook, APTR window, struct IntuiMessage *msg)
+{
+ struct gui_window_2 *gwin;
+ GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
+
+ browser_window_key_press(gwin->bw, KEY_UNDO);
+}
+
+static void ami_menu_item_edit_redo(struct Hook *hook, APTR window, struct IntuiMessage *msg)
+{
+ struct gui_window_2 *gwin;
+ GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
+
+ browser_window_key_press(gwin->bw, KEY_REDO);
+}
+
static void ami_menu_item_browser_find(struct Hook *hook, APTR window, struct IntuiMessage *msg)
{
struct gui_window_2 *gwin;
diff --git a/amiga/menu.h b/amiga/menu.h
index 9f13e01..b54e783 100755
--- a/amiga/menu.h
+++ b/amiga/menu.h
@@ -62,6 +62,9 @@ enum {
M_BAR_E1,
M_SELALL,
M_CLEAR,
+ M_BAR_E2,
+ M_UNDO,
+ M_REDO,
/* Browser menu */
M_BROWSER,
M_FIND,
@@ -119,6 +122,8 @@ enum {
#define AMI_MENU_PASTE FULLMENUNUM(1,2,0)
#define AMI_MENU_SELECTALL FULLMENUNUM(1,4,0)
#define AMI_MENU_CLEAR FULLMENUNUM(1,5,0)
+#define AMI_MENU_UNDO FULLMENUNUM(1,8,0)
+#define AMI_MENU_REDO FULLMENUNUM(1,9,0)
#define AMI_MENU_FIND FULLMENUNUM(2,0,0)
#define AMI_MENU_FOREIMG FULLMENUNUM(2,8,0)
#define AMI_MENU_BACKIMG FULLMENUNUM(2,8,1)
diff --git a/resources/FatMessages b/resources/FatMessages
index b27df8d..b78b5a7 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -817,6 +817,16 @@ de.all.ClearNS:Auswahl rückgängig
fr.all.ClearNS:Clear selection
it.all.ClearNS:Annulla selezione
nl.all.ClearNS:Clear selection
+en.ami.Undo:Undo
+de.ami.Undo:Undo
+fr.ami.Undo:Undo
+it.ami.Undo:Undo
+nl.ami.Undo:Undo
+en.ami.Redo:Redo
+de.ami.Redo:Redo
+fr.ami.Redo:Redo
+it.ami.Redo:Redo
+nl.ami.Redo:Redo
# Browser menu
#
-----------------------------------------------------------------------
Summary of changes:
amiga/context_menu.c | 1 -
amiga/gui.c | 6 +++++-
amiga/menu.c | 25 ++++++++++++++++++++++++-
amiga/menu.h | 5 +++++
resources/FatMessages | 10 ++++++++++
5 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index 454fe26..03672ef 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -508,7 +508,6 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
PMIA_Title, (ULONG)ctxmenulab[CMID_SELCLEAR],
PMIA_ID,CMID_SELCLEAR,
PMIA_Disabled, disabled_noselection,
- PMIA_CommKey, "Z",
TAG_DONE),
PMA_AddItem,NewObject(POPUPMENU_GetItemClass(), NULL,
PMIA_Title, ~0,
diff --git a/amiga/gui.c b/amiga/gui.c
index b7c5585..acbf841 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -2023,7 +2023,11 @@ void ami_handle_msg(void)
break;
case 'z':
- browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION);
+ browser_window_key_press(gwin->bw, KEY_UNDO);
+ break;
+
+ case 'y':
+ browser_window_key_press(gwin->bw, KEY_REDO);
break;
case 'f':
diff --git a/amiga/menu.c b/amiga/menu.c
index de4d63e..3280bde 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -98,6 +98,8 @@ static void ami_menu_item_edit_copy(struct Hook *hook, APTR window, struct Intui
static void ami_menu_item_edit_paste(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_edit_selectall(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_edit_clearsel(struct Hook *hook, APTR window, struct IntuiMessage *msg);
+static void ami_menu_item_edit_undo(struct Hook *hook, APTR window, struct IntuiMessage *msg);
+static void ami_menu_item_edit_redo(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_browser_find(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_browser_localhistory(struct Hook *hook, APTR window, struct IntuiMessage *msg);
static void ami_menu_item_browser_globalhistory(struct Hook *hook, APTR window, struct IntuiMessage *msg);
@@ -241,8 +243,13 @@ void ami_init_menulabs(struct gui_window_2 *gwin)
ami_menu_alloc_item(gwin, M_BAR_E1, NM_ITEM, NM_BARLABEL, 0, NULL, NULL, NULL);
ami_menu_alloc_item(gwin, M_SELALL, NM_ITEM, "SelectAllNS", 'A', NULL,
ami_menu_item_edit_selectall, NULL);
- ami_menu_alloc_item(gwin, M_CLEAR, NM_ITEM, "ClearNS", 'Z', NULL,
+ ami_menu_alloc_item(gwin, M_CLEAR, NM_ITEM, "ClearNS", 0, NULL,
ami_menu_item_edit_clearsel, NULL);
+ ami_menu_alloc_item(gwin, M_BAR_E2, NM_ITEM, NM_BARLABEL, 0, NULL, NULL, NULL);
+ ami_menu_alloc_item(gwin, M_UNDO, NM_ITEM, "Undo", 'Z', NULL,
+ ami_menu_item_edit_undo, NULL);
+ ami_menu_alloc_item(gwin, M_REDO, NM_ITEM, "Redo", 'Y', NULL,
+ ami_menu_item_edit_redo, NULL);
ami_menu_alloc_item(gwin, M_BROWSER, NM_TITLE, "Browser", 0, NULL, NULL, NULL);
ami_menu_alloc_item(gwin, M_FIND, NM_ITEM, "FindTextNS", 'F', NULL,
@@ -897,6 +904,22 @@ static void ami_menu_item_edit_clearsel(struct Hook *hook, APTR window, struct I
browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION);
}
+static void ami_menu_item_edit_undo(struct Hook *hook, APTR window, struct IntuiMessage *msg)
+{
+ struct gui_window_2 *gwin;
+ GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
+
+ browser_window_key_press(gwin->bw, KEY_UNDO);
+}
+
+static void ami_menu_item_edit_redo(struct Hook *hook, APTR window, struct IntuiMessage *msg)
+{
+ struct gui_window_2 *gwin;
+ GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
+
+ browser_window_key_press(gwin->bw, KEY_REDO);
+}
+
static void ami_menu_item_browser_find(struct Hook *hook, APTR window, struct IntuiMessage *msg)
{
struct gui_window_2 *gwin;
diff --git a/amiga/menu.h b/amiga/menu.h
index 9f13e01..b54e783 100755
--- a/amiga/menu.h
+++ b/amiga/menu.h
@@ -62,6 +62,9 @@ enum {
M_BAR_E1,
M_SELALL,
M_CLEAR,
+ M_BAR_E2,
+ M_UNDO,
+ M_REDO,
/* Browser menu */
M_BROWSER,
M_FIND,
@@ -119,6 +122,8 @@ enum {
#define AMI_MENU_PASTE FULLMENUNUM(1,2,0)
#define AMI_MENU_SELECTALL FULLMENUNUM(1,4,0)
#define AMI_MENU_CLEAR FULLMENUNUM(1,5,0)
+#define AMI_MENU_UNDO FULLMENUNUM(1,8,0)
+#define AMI_MENU_REDO FULLMENUNUM(1,9,0)
#define AMI_MENU_FIND FULLMENUNUM(2,0,0)
#define AMI_MENU_FOREIMG FULLMENUNUM(2,8,0)
#define AMI_MENU_BACKIMG FULLMENUNUM(2,8,1)
diff --git a/resources/FatMessages b/resources/FatMessages
index b27df8d..b78b5a7 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -817,6 +817,16 @@ de.all.ClearNS:Auswahl rückgängig
fr.all.ClearNS:Clear selection
it.all.ClearNS:Annulla selezione
nl.all.ClearNS:Clear selection
+en.ami.Undo:Undo
+de.ami.Undo:Undo
+fr.ami.Undo:Undo
+it.ami.Undo:Undo
+nl.ami.Undo:Undo
+en.ami.Redo:Redo
+de.ami.Redo:Redo
+fr.ami.Redo:Redo
+it.ami.Redo:Redo
+nl.ami.Redo:Redo
# Browser menu
#
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-579-g0c4f32f
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/0c4f32fb1d04657916d7d...
...commit http://git.netsurf-browser.org/netsurf.git/commit/0c4f32fb1d04657916d7da9...
...tree http://git.netsurf-browser.org/netsurf.git/tree/0c4f32fb1d04657916d7da9ef...
The branch, master has been updated
via 0c4f32fb1d04657916d7da9ef94f82bb435a1a5e (commit)
from 5809bcefa6bcff43a9d2208725105e4469624d28 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=0c4f32fb1d04657916d...
commit 0c4f32fb1d04657916d7da9ef94f82bb435a1a5e
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Make undo and redo share common implementation.
diff --git a/desktop/textarea.c b/desktop/textarea.c
index a1ebe0d..b112a6b 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -1600,14 +1600,15 @@ static bool textarea_replace_text(struct textarea *ta, size_t b_start,
/**
- * Undo previous change.
+ * Undo or redo previous change.
*
* \param ta Textarea widget
+ * \param forward Iff true, redo, else undo
* \param caret Updated to new caret pos in textarea (ta->show)
* \param r Updated to area where redraw is required
- * \return false if nothing to undo, true otherwise
+ * \return false if nothing to undo/redo, true otherwise
*/
-static bool textarea_undo(struct textarea *ta,
+static bool textarea_undo(struct textarea *ta, bool forward,
unsigned int *caret, struct rect *r)
{
unsigned int detail_n;
@@ -1617,84 +1618,32 @@ static bool textarea_undo(struct textarea *ta,
unsigned int b_text_len;
int byte_delta;
- if (ta->flags & TEXTAREA_PASSWORD)
- /* No undo for password fields */
- return false;
-
- if (ta->undo.next_detail == 0)
- /* Nothing to undo */
+ if (ta->flags & TEXTAREA_PASSWORD || ta->flags & TEXTAREA_READONLY)
+ /* No undo/redo for password or readonly fields */
return false;
- detail_n = ta->undo.next_detail - 1;
- detail = &(ta->undo.details[detail_n]);
-
- b_len = detail->b_end - detail->b_start;
- b_text_len = detail->b_text_end - detail->b_text_start;
+ if (forward) {
+ /* Redo */
+ if (ta->undo.next_detail > ta->undo.last_detail)
+ /* Nothing to redo */
+ return false;
- /* Take copy of any current textarea text that undo will remove */
- if (detail->b_text_end > detail->b_text_start) {
- temp = malloc(b_text_len);
- if (temp == NULL) {
- /* TODO */
+ detail_n = ta->undo.next_detail;
+ } else {
+ /* Undo */
+ if (ta->undo.next_detail == 0)
+ /* Nothing to undo */
return false;
- }
- memcpy(temp, ta->text.data + detail->b_text_start, b_text_len);
+ detail_n = ta->undo.next_detail - 1;
}
- /* Replace textarea text with undo buffer text */
- textarea_replace_text_internal(ta,
- detail->b_text_start, detail->b_text_end,
- ta->undo.text.data + detail->b_start, b_len,
- false, &byte_delta, r);
-
- /* Update undo buffer for redo */
- memcpy(ta->undo.text.data + detail->b_start, temp, b_text_len);
- detail->b_text_end = detail->b_text_start + b_len;
- detail->b_end = detail->b_start + b_text_len;
-
- *caret = detail->b_text_end;
- ta->undo.next_detail--;
-
- free(temp);
-
- return true;
-}
-
-
-/**
- * Redo previous undo.
- *
- * \param ta Textarea widget
- * \param caret Updated to new caret pos in textarea (ta->show)
- * \param r Updated to area where redraw is required
- * \return false if nothing to redo, true otherwise
- */
-static bool textarea_redo(struct textarea *ta,
- unsigned int *caret, struct rect *r)
-{
- unsigned int detail_n;
- struct textarea_undo_detail *detail;
- char *temp = NULL;
- unsigned int b_len;
- unsigned int b_text_len;
- int byte_delta;
-
- if (ta->flags & TEXTAREA_PASSWORD)
- /* No redo for password fields */
- return false;
-
- if (ta->undo.next_detail > ta->undo.last_detail)
- /* Nothing to redo */
- return false;
-
- detail_n = ta->undo.next_detail;
detail = &(ta->undo.details[detail_n]);
b_len = detail->b_end - detail->b_start;
b_text_len = detail->b_text_end - detail->b_text_start;
- /* Take copy of any current textarea text that redo will remove */
+ /* Take copy of any current textarea text that undo/redo will remove */
if (detail->b_text_end > detail->b_text_start) {
temp = malloc(b_text_len);
if (temp == NULL) {
@@ -1717,7 +1666,14 @@ static bool textarea_redo(struct textarea *ta,
detail->b_end = detail->b_start + b_text_len;
*caret = detail->b_text_end;
- ta->undo.next_detail++;
+
+ if (forward) {
+ /* Redo */
+ ta->undo.next_detail++;
+ } else {
+ /* Undo */
+ ta->undo.next_detail--;
+ }
free(temp);
@@ -2792,7 +2748,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
caret += byte_delta;
break;
case KEY_UNDO:
- if (!textarea_undo(ta, &caret, &r)) {
+ if (!textarea_undo(ta, false, &caret, &r)) {
/* We consume the UNDO, even if we can't act
* on it. */
return true;
@@ -2803,7 +2759,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
redraw = true;
break;
case KEY_REDO:
- if (!textarea_redo(ta, &caret, &r)) {
+ if (!textarea_undo(ta, true, &caret, &r)) {
/* We consume the REDO, even if we can't act
* on it. */
return true;
-----------------------------------------------------------------------
Summary of changes:
desktop/textarea.c | 100 ++++++++++++++-------------------------------------
1 files changed, 28 insertions(+), 72 deletions(-)
diff --git a/desktop/textarea.c b/desktop/textarea.c
index a1ebe0d..b112a6b 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -1600,14 +1600,15 @@ static bool textarea_replace_text(struct textarea *ta, size_t b_start,
/**
- * Undo previous change.
+ * Undo or redo previous change.
*
* \param ta Textarea widget
+ * \param forward Iff true, redo, else undo
* \param caret Updated to new caret pos in textarea (ta->show)
* \param r Updated to area where redraw is required
- * \return false if nothing to undo, true otherwise
+ * \return false if nothing to undo/redo, true otherwise
*/
-static bool textarea_undo(struct textarea *ta,
+static bool textarea_undo(struct textarea *ta, bool forward,
unsigned int *caret, struct rect *r)
{
unsigned int detail_n;
@@ -1617,84 +1618,32 @@ static bool textarea_undo(struct textarea *ta,
unsigned int b_text_len;
int byte_delta;
- if (ta->flags & TEXTAREA_PASSWORD)
- /* No undo for password fields */
- return false;
-
- if (ta->undo.next_detail == 0)
- /* Nothing to undo */
+ if (ta->flags & TEXTAREA_PASSWORD || ta->flags & TEXTAREA_READONLY)
+ /* No undo/redo for password or readonly fields */
return false;
- detail_n = ta->undo.next_detail - 1;
- detail = &(ta->undo.details[detail_n]);
-
- b_len = detail->b_end - detail->b_start;
- b_text_len = detail->b_text_end - detail->b_text_start;
+ if (forward) {
+ /* Redo */
+ if (ta->undo.next_detail > ta->undo.last_detail)
+ /* Nothing to redo */
+ return false;
- /* Take copy of any current textarea text that undo will remove */
- if (detail->b_text_end > detail->b_text_start) {
- temp = malloc(b_text_len);
- if (temp == NULL) {
- /* TODO */
+ detail_n = ta->undo.next_detail;
+ } else {
+ /* Undo */
+ if (ta->undo.next_detail == 0)
+ /* Nothing to undo */
return false;
- }
- memcpy(temp, ta->text.data + detail->b_text_start, b_text_len);
+ detail_n = ta->undo.next_detail - 1;
}
- /* Replace textarea text with undo buffer text */
- textarea_replace_text_internal(ta,
- detail->b_text_start, detail->b_text_end,
- ta->undo.text.data + detail->b_start, b_len,
- false, &byte_delta, r);
-
- /* Update undo buffer for redo */
- memcpy(ta->undo.text.data + detail->b_start, temp, b_text_len);
- detail->b_text_end = detail->b_text_start + b_len;
- detail->b_end = detail->b_start + b_text_len;
-
- *caret = detail->b_text_end;
- ta->undo.next_detail--;
-
- free(temp);
-
- return true;
-}
-
-
-/**
- * Redo previous undo.
- *
- * \param ta Textarea widget
- * \param caret Updated to new caret pos in textarea (ta->show)
- * \param r Updated to area where redraw is required
- * \return false if nothing to redo, true otherwise
- */
-static bool textarea_redo(struct textarea *ta,
- unsigned int *caret, struct rect *r)
-{
- unsigned int detail_n;
- struct textarea_undo_detail *detail;
- char *temp = NULL;
- unsigned int b_len;
- unsigned int b_text_len;
- int byte_delta;
-
- if (ta->flags & TEXTAREA_PASSWORD)
- /* No redo for password fields */
- return false;
-
- if (ta->undo.next_detail > ta->undo.last_detail)
- /* Nothing to redo */
- return false;
-
- detail_n = ta->undo.next_detail;
detail = &(ta->undo.details[detail_n]);
b_len = detail->b_end - detail->b_start;
b_text_len = detail->b_text_end - detail->b_text_start;
- /* Take copy of any current textarea text that redo will remove */
+ /* Take copy of any current textarea text that undo/redo will remove */
if (detail->b_text_end > detail->b_text_start) {
temp = malloc(b_text_len);
if (temp == NULL) {
@@ -1717,7 +1666,14 @@ static bool textarea_redo(struct textarea *ta,
detail->b_end = detail->b_start + b_text_len;
*caret = detail->b_text_end;
- ta->undo.next_detail++;
+
+ if (forward) {
+ /* Redo */
+ ta->undo.next_detail++;
+ } else {
+ /* Undo */
+ ta->undo.next_detail--;
+ }
free(temp);
@@ -2792,7 +2748,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
caret += byte_delta;
break;
case KEY_UNDO:
- if (!textarea_undo(ta, &caret, &r)) {
+ if (!textarea_undo(ta, false, &caret, &r)) {
/* We consume the UNDO, even if we can't act
* on it. */
return true;
@@ -2803,7 +2759,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
redraw = true;
break;
case KEY_REDO:
- if (!textarea_redo(ta, &caret, &r)) {
+ if (!textarea_undo(ta, true, &caret, &r)) {
/* We consume the REDO, even if we can't act
* on it. */
return true;
--
NetSurf Browser
9 years, 3 months