Source
...
Target
This diff is collapsed.
......@@ -14,9 +14,9 @@
*/
#include "PaintLib.h"
os_error* PaintLib_get_wind_info(wimp_winfo* winfo)
{
return wimp_get_wind_info((wimp_winfo*)(1 | (int)winfo));
os_error *paintlib_get_wind_info (wimp_winfo *winfo)
{ return wimp_get_wind_info ((wimp_winfo *)(1 | (int)winfo));
}
......@@ -24,6 +24,7 @@
*/
#include <swis.h>
#include "Global/FileTypes.h"
#include "akbd.h"
#include "bbc.h"
......@@ -43,9 +44,6 @@
#include "Colours.h"
#include "PaintLib.h"
#define MIN(a, b) ((a) < (b)? (a): (b))
#define MAX(a, b) ((a) > (b)? (a): (b))
/**************************************************************************
* *
* Static variables. *
......@@ -67,10 +65,10 @@ static wimp_w lastnullholder = -1;
* *
***************************************/
/* The open parameter avoid getting two open requests in some circumstances */
void sprwindow_set_work_extent (main_window *window, BOOL open)
{ wimp_wstate currinfo;
{ /* The open parameter avoid getting two open requests in some circumstances */
wimp_wstate currinfo;
wimp_redrawstr newext;
sprite_info sinfo;
......@@ -82,8 +80,8 @@ void sprwindow_set_work_extent (main_window *window, BOOL open)
sinfo.width = sinfo.width * window->data->sprite.blobsize.scale_xmul /
window->data->sprite.blobsize.scale_xdiv;
sinfo.height= sinfo.height* window->data->sprite.blobsize.scale_ymul /
window->data->sprite.blobsize.scale_ydiv;
sinfo.height= sinfo.height * window->data->sprite.blobsize.scale_ymul /
window->data->sprite.blobsize.scale_ydiv;
sinfo.width &= ~((1 << bbc_modevar (-1, bbc_XEigFactor)) - 1);
sinfo.height &= ~((1 << bbc_modevar (-1, bbc_YEigFactor)) - 1);
......@@ -190,8 +188,8 @@ int sprwindow_swap_output_to_mask (main_sprite *sprite, int statesaved)
state->r[2] = (int) psprite_address (sprite);
state->r[3] = 0;
wimpt_complain (os_swix (OS_SpriteOp, state));
os_swix1 (OS_ChangedBox+os_X, 2);
os_swix1 (OS_ChangedBox+os_X, 1); /* enable changed box calcs */
os_swix1 (OS_ChangedBox, 2);
os_swix1 (OS_ChangedBox, 1); /* enable changed box calcs */
return 1;
}
else return 0;
......@@ -205,8 +203,7 @@ int sprwindow_swap_output_to_mask (main_sprite *sprite, int statesaved)
void sprwindow_swap_output_to_screen (void)
{
ftracef0 ("sprwindow_swap_output_to_screen\n");
{ ftracef0 ("sprwindow_swap_output_to_screen\n");
wimpt_complain (os_swix (OS_SpriteOp, &savedVDUstate));
}
......@@ -226,7 +223,7 @@ void sprwindow_redisplay (main_sprite *sprite, wimp_box *area)
ftracef0 ("sprwindow_redisplay\n");
for (window = sprite->windows; window != NULL; window = window->link)
{ curr.w = window->window->handle;
wimpt_noerr (PaintLib_get_wind_info (&curr));
wimpt_noerr (paintlib_get_wind_info (&curr));
if (area != NULL)
{ redraw.box.x0 = area->x0*window->blobsize.scale_xmul/
......@@ -251,7 +248,7 @@ void sprwindow_redisplay (main_sprite *sprite, wimp_box *area)
/* now invalidate area in filer window */
curr.w = sprite->file->window->handle;
wimpt_noerr (PaintLib_get_wind_info (&curr));
wimpt_noerr (paintlib_get_wind_info (&curr));
if (sprite->file->fullinfo)
{ redraw.box.x0 = 0; redraw.box.x1 = 3*main_FILER_TextHeight;
......@@ -324,7 +321,7 @@ void sprwindow_release_idle_events (main_sprite *sprite)
}
}
static BOOL cant_extend_stack_buffer (char** b, int* s)
static BOOL cant_extend_stack_buffer (char **b, int *s)
{ ftracef0 ("cant_extend_stack_buffer\n");
b = b; s = s;
......@@ -332,14 +329,14 @@ static BOOL cant_extend_stack_buffer (char** b, int* s)
return 0;
}
static BOOL Check_Palette_Type (int type, char *name)
static BOOL check_palette_type (int type, char *name)
{ ftracef0 ("Check_Palette_Type\n");
if (type != 0xFED && type != -1)
{ ftracef0 ("check_palette_type\n");
if (type != FileType_Palette && type != -1)
{ werr (FALSE, msgs_lookup (name == NULL? "PntE2": "PntE3"), name);
return FALSE;
}
return type == 0xFED;
return type == FileType_Palette;
}
void sprwindow_event_handler (wimp_eventstr *e, void *handle)
......@@ -377,14 +374,14 @@ void sprwindow_event_handler (wimp_eventstr *e, void *handle)
psprite_read_size (sprite, &sinfo);
sinfo.width = sinfo.width* scale->scale_xmul/scale->scale_xdiv;
sinfo.height = sinfo.height*scale->scale_ymul/scale->scale_ydiv;
sinfo.width = sinfo.width * scale->scale_xmul/scale->scale_xdiv;
sinfo.height = sinfo.height * scale->scale_ymul/scale->scale_ydiv;
rds.w = e->data.o.w;
wimpt_noerr (wimp_redraw_wind (&rds, &more));
curr.w = e->data.o.w;
wimpt_noerr (PaintLib_get_wind_info (&curr));
wimpt_noerr (paintlib_get_wind_info (&curr));
/*Screen coords of work area origin*/
x = rds.box.x0 - rds.scx;
......@@ -514,7 +511,7 @@ void sprwindow_event_handler (wimp_eventstr *e, void *handle)
mode = psprite_address (window->data->sprite.sprite)->mode;
if (Check_Palette_Type (xferrecv_checkinsert (&name), name))
if (check_palette_type (xferrecv_checkinsert (&name), name))
{ /*Load the file if it's not too big.*/
os_filestr file_str;
......@@ -545,7 +542,7 @@ void sprwindow_event_handler (wimp_eventstr *e, void *handle)
ftracef0 ("Read palette\n");
}
else if (Check_Palette_Type (xferrecv_checkimport (&size), NULL))
else if (check_palette_type (xferrecv_checkimport (&size), NULL))
{ size = xferrecv_doimport (palfile, 6*256 + 1,
&cant_extend_stack_buffer);
ftracef1 ("Imported %d byte palette\n", size);
......@@ -609,7 +606,7 @@ void sprwindow_event_handler (wimp_eventstr *e, void *handle)
break;
default:
ftracef1 ("Sprite window event %d\n",e->e);
ftracef1 ("Sprite window event %d\n", e->e);
break;
}
......
......@@ -49,10 +49,10 @@ wimp_w toolwindow_handle;
toolwindow_block *toolwindow_current_tool;
int toolwindow_current_mode = 0;
#ifdef ModuleVersion
static toolwindow_block *toolarray [tools_COUNT];
static void init_toolarray (void)
{ toolarray [0] = NULL;
{ /* Required to generate relocatable code */
toolarray [0] = NULL;
toolarray [1] = &tools_pixelpaint;
toolarray [2] = &tools_spraycanpaint;
toolarray [3] = &tools_floodfillpaint;
......@@ -75,32 +75,6 @@ static void init_toolarray (void)
toolarray [20] = &tools_parallelogramoutlinepaint;
toolarray [21] = &tools_brushpaint;
}
#else
static toolwindow_block *toolarray [tools_COUNT] =
{ NULL, /* zeroth icon n'existe pas */
&pixelpaint, /* 1 */
&spraycanpaint, /* 2 */
&floodfillpaint, /* 3 */
&linepaint, /* 4 */
&ellipseoutlinepaint, /* 5 */
&ellipsepaint, /* 6 */
&circleoutlinepaint, /* 7 */
&circlepaint, /* 8 */
&trianglepaint, /* 9 */
&arcpaint, /* 10 */
&segmentpaint, /* 11 */
&sectorpaint, /* 12 */
&camerapaint, /* 13 */
&scissorpaint, /* 14 */
&textpaint, /* 15 */
&grabberpaint, /* 16 */
&rectanglepaint, /* 17 */
&rectangleoutlinepaint, /* 18 */
&parallelogrampaint, /* 19 */
&parallelogramoutlinepaint, /* 20 */
&brushpaint /* 21 */
};
#endif
static char
*onlydigits = "A0-9";
......@@ -438,7 +412,8 @@ static void sprite_tool_event_handler (wimp_eventstr *e, void *handle)
tools_brush_use_gcol = (i.flags & wimp_ISELECTED) != 0;
performbrushGOaction ();
} }
}
}
else if (toolwindow_current_tool == &tools_floodfillpaint)
{ wimp_icon i;
wimpt_noerr (wimp_get_icon_info (toolwindow_handle,
......@@ -621,7 +596,5 @@ void toolwindow_init (void)
{ toolwindow_handle = 0;
toolwindow_current_tool = &tools_pixelpaint;
#ifdef ModuleVersion
init_toolarray ();
#endif
}
This diff is collapsed.
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Set Alias$@RunType_FF9 /<Obey$Dir>
Set Alias$@PrintType_FF9 /<Obey$Dir> -print
The Paint application allows you to create and edit
sprite files. A sprite file contains one or more
graphic images, each stored as a bitmap.
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
RMEnsure UtilityModule 3.50 Error This version of Paint requires RISC OS 3.50
RMEnsure SpriteExtend 0.80 Error This version of Paint requires Sprite Extend 0.80
If "<Wimp$ScrapDir>"="" then Error Paint requires a scrap directory: open a directory that contains the Scrap application
Set Paint$Dir <Obey$Dir>
Set Paint$Path <Obey$Dir>.,Resources:$.Resources.Paint.
/<Paint$Dir>.!Boot
WIMPSlot -min 384K
WIMPSlot -max 352K
/<Paint$Dir>.!RunImage %*0
No preview for this file type
File deleted
File deleted
......@@ -18,8 +18,8 @@
#include "main.h"
#include "wimp.h"
void AltRename_start(main_window*, main_sprite*);
void AltRename_delete(void);
BOOL AltRename_claim_event(wimp_eventstr *e,main_window* window);
void altrename_start(main_window *, main_sprite *);
void altrename_delete(void);
BOOL altrename_claim_event(wimp_eventstr *, main_window *);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -17,13 +17,13 @@
#include "wimp.h"
/* ptr is a wimp_openstr* , wimp_wstate* or a wimp_redrawstr* */
#define SCREEN_TO_WORKAREA_X(ptr,cx) ((cx)-(((wimp_openstr*)(ptr))->box.x0-((wimp_openstr*)(ptr))->x))
#define SCREEN_TO_WORKAREA_Y(ptr,cy) ((cy)-(((wimp_openstr*)(ptr))->box.y1-((wimp_openstr*)(ptr))->y))
#define WORKAREA_TO_SCREEN_X(ptr,cx) ((cx)+(((wimp_openstr*)(ptr))->box.x0-((wimp_openstr*)(ptr))->x))
#define WORKAREA_TO_SCREEN_Y(ptr,cy) ((cy)+(((wimp_openstr*)(ptr))->box.y1-((wimp_openstr*)(ptr))->y))
/* ptr is a wimp_openstr, wimp_wstate or a wimp_redrawstr */
#define SCREEN_TO_WORKAREA_X(ptr,cx) ((cx)-(((wimp_openstr *)(ptr))->box.x0-((wimp_openstr *)(ptr))->x))
#define SCREEN_TO_WORKAREA_Y(ptr,cy) ((cy)-(((wimp_openstr *)(ptr))->box.y1-((wimp_openstr *)(ptr))->y))
#define WORKAREA_TO_SCREEN_X(ptr,cx) ((cx)+(((wimp_openstr *)(ptr))->box.x0-((wimp_openstr *)(ptr))->x))
#define WORKAREA_TO_SCREEN_Y(ptr,cy) ((cy)+(((wimp_openstr *)(ptr))->box.y1-((wimp_openstr *)(ptr))->y))
/* doesn't fetch sprites */
os_error* PaintLib_get_wind_info(wimp_winfo* winfo);
os_error *paintlib_get_wind_info (wimp_winfo *);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.