Commit 00e649c3 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Makefile recreated from fragments

Get version number from messages file.
Use NoMem global message to say there isn't enough memory.
Swap key shortcut to match ResEd.

Version 1.10. Tagged as 'WinEdit-1_10'
parent a7963441
......@@ -14,79 +14,17 @@
#
# Makefile for WinEdit
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 13-Nov-03 BJGA Recreated
#
COMPONENT = WinEdit
TARGET = !RunImage
INSTAPP = ${INSTDIR}.!${COMPONENT}
include StdTools
include StdRules
include AppLibs
CINCLUDES = -IC:
LIBS =
OBJS = main.o \
message.o \
error.o \
o.registry \
document.o \
wimp.o \
interactor.o \
debug.o \
menu.o \
selection.o \
dragdrop.o \
template.o \
grid.o \
data.o \
resize.o \
dbox.o \
winflags.o \
extent.o \
props.o \
justify.o \
genheader.o \
sort.o \
saveas.o \
dbmalloc.o \
align.o \
colours.o \
version.o
DIRS = o._dirs
all: ${TARGET}
@${ECHO} ${COMPONENT}: built
install: ${TARGET}
${MKDIR} ${INSTAPP}
${CP} Resources.!Boot ${INSTAPP}.!Boot ${CPFLAGS}
${CP} Resources.!Run ${INSTAPP}.!Run ${CPFLAGS}
${CP} !RunImage ${INSTAPP}.!RunImage ${CPFLAGS}
${CP} Resources.!Sprites ${INSTAPP}.!Sprites ${CPFLAGS}
${CP} LocalRes:Messages ${INSTAPP}.Messages ${CPFLAGS}
${CP} LocalRes:Palette ${INSTAPP}.Palette ${CPFLAGS}
${CP} Resources.Sprites ${INSTAPP}.Sprites ${CPFLAGS}
${CP} LocalRes:Templates ${INSTAPP}.Templates ${CPFLAGS}
@${ECHO} ${COMPONENT}: installed
clean:
${XWIPE} o ${WFLAGS}
${RM} ${TARGET}
@${ECHO} ${COMPONENT}: cleaned
${TARGET}: ${OBJS} ${LIBS} ${DIRS}
${LD} ${LDFLAGS} -o $@ ${OBJS} ${LIBS} ${CLIB}
${SQZ} $@
${DIRS}:
${MKDIR} o
${TOUCH} $@
COMPONENT = WinEdit
TARGET = !RunImage
INSTTYPE = app
APP_OBJS = main message error registry document wimp interactor debug menu \
selection dragdrop template grid data resize dbox winflags \
extent props justify genheader sort saveas dbmalloc align colours
CINCLUDES = -IC:
INSTAPP_FILES = !Boot !Run !Sprites !RunImage Palette Sprites Templates
INSTAPP_VERSION = Messages
include CApp
# Dynamic dependencies:
TaskName:WinEdit
IconMenu:WinEdit
_Version:From build system
Info:Info
Palette:Palette...
Quit:Quit
......@@ -59,9 +60,9 @@ KeyDFM_Save:387
#
# Document->Selection Menu
DSM_Name:Selection
DSM_Dele:Delete ^X
DSM_Dele:Delete ^K
DSM_Save:Save
KeyDSM_Dele:24
KeyDSM_Dele:11
#
# Document->New Menu
DNM_Name:Window name
......@@ -94,11 +95,11 @@ KeyTWM_Clse:418
#
# Template->Selection Menu
TSM_Name:Selection
TSM_Dele:Delete ^X
TSM_Dele:Delete ^K
TSM_Algn:Align
TSM_Sort:Sort ^S
TSM_Prop:Properties... ^P
KeyTSM_Dele:24
KeyTSM_Dele:11
KeyTSM_Sort:19
KeyTSM_Prop:16
#
......
/* (1.09)
/* (1.10)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.09
#define Module_MajorVersion_CMHG 1.10
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 30 May 2012
#define Module_Date_CMHG 24 Jul 2014
#define Module_MajorVersion "1.09"
#define Module_Version 109
#define Module_MajorVersion "1.10"
#define Module_Version 110
#define Module_MinorVersion ""
#define Module_Date "30 May 2012"
#define Module_Date "24 Jul 2014"
#define Module_ApplicationDate "30-May-12"
#define Module_ApplicationDate "24-Jul-14"
#define Module_ComponentName "WinEdit"
#define Module_ComponentPath "castle/RiscOS/Utilities/WinEdit"
#define Module_FullVersion "1.09"
#define Module_HelpVersion "1.09 (30 May 2012)"
#define Module_LibraryVersionInfo "1:9"
#define Module_FullVersion "1.10"
#define Module_HelpVersion "1.10 (24 Jul 2014)"
#define Module_LibraryVersionInfo "1:10"
......@@ -21,7 +21,6 @@
#include "resed.h"
static error myerror = {299, "Could not allocate memory for messages"};
/*
* The 'longest' parameter is used to allocate the buffer for storing
......@@ -33,25 +32,25 @@ static error myerror = {299, "Could not allocate memory for messages"};
error *message_openfile (MsgPtr msgs, char *filename, int longest)
{
error *err;
err = _swix(MessageTrans_FileInfo, _IN(1) | _OUT(2),
filename,
&(msgs->size));
if (err)
return err;
static const _kernel_oserror nomem = { 299, "NoMem" };
_kernel_oserror *err;
msgs->buffersize = longest;
err = _swix(MessageTrans_FileInfo, _IN(1) | _OUT(2), filename, &(msgs->size));
if (err != NULL) return err;
msgs->buffersize = longest;
msgs->data = malloc(msgs->size);
if (!msgs->data)
return &myerror;
msgs->buffer = malloc(msgs->buffersize);
if (!msgs->buffer)
return &myerror;
if ((msgs->data == NULL) || (msgs->buffer == NULL))
{
err = _swix(MessageTrans_ErrorLookup, _INR(0,3), &nomem, NULL, NULL, 0);
}
else
{
err = _swix(MessageTrans_OpenFile, _INR(0,2), &(msgs->opaque), filename, msgs->data);
}
err = _swix(MessageTrans_OpenFile, _INR(0,2),
&(msgs->opaque), filename, msgs->data);
if (err)
if (err != NULL)
{
free(msgs->data);
free(msgs->buffer);
......@@ -59,8 +58,9 @@ error *message_openfile (MsgPtr msgs, char *filename, int longest)
msgs->size = msgs->buffersize = 0;
return err;
}
else
return NULL;
return NULL;
}
......
......@@ -785,7 +785,7 @@ static error * load_prototypes (void)
ER ( _swix(Wimp_CreateWindow, _IN(1) | _OUT(0),
&infowin->visarea,
&infowin->handle) );
ER ( dbox_setstring (infowin, I_INFO_VERSION, version_string() ) );
ER ( dbox_setstring (infowin, I_INFO_VERSION, message_lookup (&msgs, "_Version") ) );
ER ( registry_register_window (infowin->handle, Info, (void *) infowin) );
ER ( document_load_prototypes() );
......
/* Copyright 2003 Castle Technology 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.
*/
/*-*-C-*-
*
* Generates version string for Info box
*/
#if 1
#include "VersionNum"
#include "version.h"
char * version_string (void)
{
return Module_MajorVersion " (" Module_ApplicationDate ")";
}
#else
#include "resed.h"
/*
* Returns version string for Info box
*/
char * version_string (void)
{
char *vrsn = "d.dd (dd-mmm-dd)";
char *date = __DATE__; /* "mmm dd 19dd" */
memcpy(vrsn, VERSION_NUMBER, 4);
memcpy(vrsn+6, date+4, 2);
if (vrsn[6] == ' ') vrsn[6] = '0'; /* 6th is " 6" */
memcpy(vrsn+9, date, 3);
memcpy(vrsn+13, date+9, 2);
return vrsn;
}
#endif
......@@ -56,7 +56,6 @@ typedef int Bool;
#include "dbmalloc.h"
#include "align.h"
#include "colours.h"
#include "version.h"
#include "icons.h"
#define block /* keep emacs happy */
......
/* Copyright 2003 Castle Technology 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.
*/
/*-*-C-*-
*
* Generates version string for Info box
*/
extern char * version_string (void);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment