summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--Makefile.defaults6
-rw-r--r--riscos/menus.c4
-rw-r--r--riscos/save.c2
-rw-r--r--riscos/save_draw.c4
-rw-r--r--riscos/save_draw.h4
-rw-r--r--riscos/sprite.c9
-rw-r--r--riscos/window.c1
8 files changed, 28 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index e407d1135..6d214ce1b 100644
--- a/Makefile
+++ b/Makefile
@@ -260,10 +260,11 @@ ifeq ($(TARGET),riscos)
endif
$(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG rendering))
- $(eval $(call feature_enabled,DRAW,-DWITH_DRAW,-lpencil,Drawfile export))
+ $(eval $(call feature_enabled,DRAW,-DWITH_DRAW,,RISC OS Draw rendering))
$(eval $(call feature_enabled,SPRITE,-DWITH_SPRITE,,RISC OS sprite rendering))
$(eval $(call feature_enabled,ARTWORKS,-DWITH_ARTWORKS,,ArtWorks rendering))
$(eval $(call feature_enabled,PLUGINS,-DWITH_PLUGIN,,Plugin protocol support))
+ $(eval $(call feature_enabled,DRAW_EXPORT,-DWITH_DRAW_EXPORT,-lpencil,Drawfile export))
ifeq ($(HOST),riscos)
$(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,NetSurf BMP decoder))
$(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,NetSurf GIF decoder))
diff --git a/Makefile.defaults b/Makefile.defaults
index ae922c26e..9862916c5 100644
--- a/Makefile.defaults
+++ b/Makefile.defaults
@@ -85,7 +85,7 @@ ifeq ($(TARGET),riscos)
# Valid options: YES, NO
NETSURF_USE_NSSVG := YES
- # Enable NetSurf's use of pencil for Drawfile export
+ # Enable NetSurf's support for displaying RISC OS Draw files
# Valid options: YES, NO
NETSURF_USE_DRAW := YES
@@ -101,6 +101,10 @@ ifeq ($(TARGET),riscos)
# Valid options: YES, NO
NETSURF_USE_PLUGINS := NO
+ # Enable NetSurf's use of pencil for Drawfile export
+ # Valid options: YES, NO
+ NETSURF_USE_DRAW_EXPORT := YES
+
# Optimisation levels
CFLAGS += -O2 -Wuninitialized
diff --git a/riscos/menus.c b/riscos/menus.c
index 1f12feb98..ab286a1c9 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -181,7 +181,9 @@ void ro_gui_menu_init(void)
{ "Page.Save", BROWSER_SAVE, &dialog_saveas },
{ "Page.SaveComp", BROWSER_SAVE_COMPLETE, &dialog_saveas },
{ "Page.Export", NO_ACTION, 0 },
+#ifdef WITH_DRAW_EXPORT
{ "Page.Export.Draw", BROWSER_EXPORT_DRAW, &dialog_saveas },
+#endif
#ifdef WITH_PDF_EXPORT
{ "Page.Export.PDF", BROWSER_EXPORT_PDF, &dialog_saveas },
#endif
@@ -200,7 +202,9 @@ void ro_gui_menu_init(void)
{ "Object.Object.ObjSave", BROWSER_OBJECT_SAVE, &dialog_saveas },
{ "Object.Object.Export", BROWSER_OBJECT_EXPORT, 0 },
{ "Object.Object.Export.Sprite", BROWSER_OBJECT_EXPORT_SPRITE, &dialog_saveas },
+#ifdef WITH_DRAW_EXPORT
{ "Object.Object.Export.ObjDraw", BROWSER_OBJECT_EXPORT_DRAW, &dialog_saveas },
+#endif
{ "Object.Object.SaveURL", NO_ACTION, 0 },
{ "Object.Object.SaveURL.URI", BROWSER_OBJECT_SAVE_URL_URI, &dialog_saveas },
{ "Object.Object.SaveURL.URL", BROWSER_OBJECT_SAVE_URL_URL, &dialog_saveas },
diff --git a/riscos/save.c b/riscos/save.c
index 43b12a4f5..e49ce319d 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -833,8 +833,10 @@ bool ro_gui_save_content(struct content *c, char *path, bool force_overwrite)
}
switch (gui_save_current_type) {
+#ifdef WITH_DRAW_EXPORT
case GUI_SAVE_DRAW:
return save_as_draw(c, path);
+#endif
#ifdef WITH_PDF_EXPORT
case GUI_SAVE_PDF:
return save_as_pdf(c, path);
diff --git a/riscos/save_draw.c b/riscos/save_draw.c
index a5dbb8df2..812b9409a 100644
--- a/riscos/save_draw.c
+++ b/riscos/save_draw.c
@@ -22,6 +22,8 @@
* Export a content as a DrawFile (implementation).
*/
+#ifdef WITH_DRAW_EXPORT
+
#include <assert.h>
#include <limits.h>
#include "oslib/draw.h"
@@ -460,3 +462,5 @@ bool ro_save_draw_error(pencil_code code)
return false;
}
+
+#endif
diff --git a/riscos/save_draw.h b/riscos/save_draw.h
index 90d81c980..43861c484 100644
--- a/riscos/save_draw.h
+++ b/riscos/save_draw.h
@@ -19,9 +19,13 @@
#ifndef _NETSURF_RISCOS_SAVE_DRAW_H_
#define _NETSURF_RISCOS_SAVE_DRAW_H_
+#ifdef WITH_DRAW_EXPORT
+
#include <stdbool.h>
struct content;
bool save_as_draw(struct content *c, const char *path);
#endif
+
+#endif
diff --git a/riscos/sprite.c b/riscos/sprite.c
index 899aef324..305a4f6f0 100644
--- a/riscos/sprite.c
+++ b/riscos/sprite.c
@@ -139,7 +139,8 @@ bool sprite_redraw(struct content *c, int x, int y,
byte sprite_bpp(const osspriteop_header *s)
{
- /* bit 31 indicates the presence of a full alpha channel rather than a binary mask */
+ /* bit 31 indicates the presence of a full alpha channel
+ * rather than a binary mask */
int type = ((unsigned)s->mode >> osspriteop_TYPE_SHIFT) & 15;
byte bpp = 0;
@@ -148,8 +149,10 @@ byte sprite_bpp(const osspriteop_header *s)
{
bits psr;
int val;
- if (!xos_read_mode_variable(s->mode, os_MODEVAR_LOG2_BPP, &val, &psr) &&
- !(psr & _C)) bpp = 1 << val;
+ if (!xos_read_mode_variable(s->mode,
+ os_MODEVAR_LOG2_BPP, &val, &psr) &&
+ !(psr & _C))
+ bpp = 1 << val;
}
break;
case osspriteop_TYPE1BPP: bpp = 1; break;
diff --git a/riscos/window.c b/riscos/window.c
index 3427cd989..8e0a8b8d6 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -61,6 +61,7 @@
#include "riscos/options.h"
#include "riscos/oslib_pre7.h"
#include "riscos/save.h"
+#include "riscos/sprite.h"
#include "riscos/theme.h"
#include "riscos/thumbnail.h"
#include "riscos/url_complete.h"