diff --git a/Makefile b/Makefile index 31f183390d14df1eaf09e8136ee8d3b19f3be805..7ee4a51050bc17a9b9c5ba04b038a72a0df2afb2 100644 --- a/Makefile +++ b/Makefile @@ -14,119 +14,34 @@ # # Makefile for MousSetup # -# *********************************** -# *** C h a n g e L i s t *** -# *********************************** -# Date Name Description -# ---- ---- ----------- -# 17-Oct-97 BJGA Derived from InetSetup makefiles -# 28-Oct-97 BJGA No longer uses OSLib -# 10-Nov-97 BJGA Modified to use shared Common directory -# 09-Dec-97 BJGA Split Main.c, and modified to use shared Common library -# 17-Dec-97 BJGA Tidied up -# 11-May-98 BJGA Replaced Common directory with ConfigLib -# -# -# Program specific options: -# COMPONENT = MousSetup APP = !${COMPONENT} -RDIR = Resources -LDIR = ${RDIR}.${LOCALE} +TARGET = !RunImage INSTAPP = ${INSTDIR}.${APP} +INSTTYPE = app +MSGVERSION = ${AWK} -f Build:AwkVers +LDIR = Resources.${LOCALE} +APP_OBJS = Main.o MouseType.o Settings.o ToolboxE.o WimpE.o WimpM.o +LIBS = ${CONLIB} ${EVENTLIB} ${TBOXLIB} ${WIMPLIB} +CINCLUDES = -Itbox:,C:,<Lib$Dir>.ConfigLib. +INSTALLAPPFILES = !Boot !Help !Run !RunImage Res \ + !Sprites !Sprites11 !Sprites22 CoSprite CoSprite11 CoSprite22 +INSTALLAPP_DEPEND = GenMessage -# -# Generic options: -# -MKDIR = do mkdir -p -CC = cc -ATTR = -attr -CP = copy -LD = link -RM = remove -SQUEEZE = squeeze -WIPE = x wipe +include CApp -CFLAGS = -c -depend !Depend -ffa -gflv ${INCLUDES} -throwback -CPFLAGS = ~cfr~v -WFLAGS = ~c~v +C_WARNINGS = -fa # -# Libraries +# Patch the messages files with the version # -CLIB = C:o.stubs -ELIB = Tbox:o.eventlib -TLIB = Tbox:o.toolboxlib -WLIB = Tbox:o.wimplib -CONLIB = <Lib$Dir>.ConfigLib.o.ConfigLib - -# -# Include files -# -INCLUDES = -ITbox:,C:,<Lib$Dir>.ConfigLib. - -FILES=\ - ${LDIR}.!Help\ - ${RDIR}.!Boot\ - ${LDIR}.!Run\ - ${RDIR}.!RunImage\ - ${RDIR}.!Sprites\ - ${RDIR}.!Sprites11\ - ${RDIR}.!Sprites22\ - ${RDIR}.CoSprite\ - ${RDIR}.CoSprite11\ - ${RDIR}.CoSprite22\ - ${LDIR}.Messages\ - ${LDIR}.Res\ - -OBJS = Main.o MouseType.o Settings.o ToolboxE.o WimpE.o WimpM.o - -# -# Rule patterns -# -.c.o:; ${CC} ${CFLAGS} -o $@ $< - -# -# Main rules: -# -# Application -# -all: ${FILES} - @echo ${COMPONENT}: All built (Disc) - -install: ${FILES} +GenMessage: ${LDIR}.Messages VersionNum + ${MSGVERSION} ${LDIR}.Messages > GenMessage ${MKDIR} ${INSTAPP} - | - ${CP} ${RDIR}.!Boot ${INSTAPP}.!Boot ${CPFLAGS} - ${CP} ${LDIR}.!Help ${INSTAPP}.!Help ${CPFLAGS} - ${CP} ${LDIR}.!Run ${INSTAPP}.!Run ${CPFLAGS} - ${CP} ${RDIR}.!RunImage ${INSTAPP}.!RunImage ${CPFLAGS} - ${CP} ${RDIR}.!Sprites ${INSTAPP}.!Sprites ${CPFLAGS} - ${CP} ${RDIR}.!Sprites11 ${INSTAPP}.!Sprites11 ${CPFLAGS} - ${CP} ${RDIR}.!Sprites22 ${INSTAPP}.!Sprites22 ${CPFLAGS} - ${CP} ${RDIR}.CoSprite ${INSTAPP}.CoSprite ${CPFLAGS} - ${CP} ${RDIR}.CoSprite11 ${INSTAPP}.CoSprite11 ${CPFLAGS} - ${CP} ${RDIR}.CoSprite22 ${INSTAPP}.CoSprite22 ${CPFLAGS} - ${CP} ${LDIR}.Messages ${INSTAPP}.Messages ${CPFLAGS} - ${CP} ${LDIR}.Res ${INSTAPP}.Res ${CPFLAGS} - | - ${ATTR} -directories +wr -ww ${INSTAPP} - ${ATTR} -files +or +ow +wr -ww ${INSTAPP} - | - @echo ${COMPONENT}: All installed (Disc) - -clean: - ${WIPE} o.* ${WFLAGS} - ${RM} ${RDIR}.!RunImage - @echo ${COMPONENT}: cleaned + ${CP} GenMessage ${INSTAPP}.Messages ${CPFLAGS} -# -# Static dependencies: -# -${RDIR}.!RunImage: ${OBJS} ${CONLIB} ${ELIB} ${TLIB} ${WLIB} ${CLIB} - ${LD} ${LDFLAGS} -o $@ ${OBJS} ${CONLIB} ${ELIB} ${TLIB} ${WLIB} ${CLIB} - ${SQUEEZE} $@ +clean:: + ${RM} GenMessage -#--------------------------------------------------------------------------- # Dynamic dependencies: diff --git a/Resources/UK/Messages b/Resources/UK/Messages index 3b0daed8b989966ffe81e151e4d6b31d3484d887..be37cd1eac1807a853081695081e9445da08b0e3 100644 --- a/Resources/UK/Messages +++ b/Resources/UK/Messages @@ -1,7 +1,7 @@ _TaskName:Mouse Setup _Purpose:Configuring the mouse _Author:© Acorn Computers Ltd, 1998 -_Version:0.10 (19-Dec-02) +_Version:Fill by awk at build time _ConfigText:Mouse _ConfigHelp:Click SELECT to open the mouse configuration window. _ConfigSprite:co_mouse @@ -9,3 +9,4 @@ Mystery:Unrecognised NoneAvail:No mouse drivers are available NewType:You are about to change the mouse type to '%s'. If you do not have this sort of mouse connected the pointer will stop working. Do you want to continue with the reconfiguration? Err_NoDefCMOS:Cannot find default CMOS file +Err_BadClass:Resource file is corrupt diff --git a/Resources/UK/Res,fae b/Resources/UK/Res,fae index a841e070f9f23307f63b024d252a003a91420ace..8862745bdb0f60e27a7e50d486eb66302347b5c0 100644 Binary files a/Resources/UK/Res,fae and b/Resources/UK/Res,fae differ diff --git a/VersionNum b/VersionNum index bcee9d9f8443546bf2949e98ea4126fbd40cf0b9..2564b811000afa346d9761ba48b956ba3a56a252 100644 --- a/VersionNum +++ b/VersionNum @@ -1,23 +1,23 @@ -/* (0.13) +/* (0.14) * * This file is automatically maintained by srccommit, do not edit manually. * Last processed by srccommit version: 1.1. * */ -#define Module_MajorVersion_CMHG 0.13 +#define Module_MajorVersion_CMHG 0.14 #define Module_MinorVersion_CMHG -#define Module_Date_CMHG 06 Oct 2012 +#define Module_Date_CMHG 17 Jan 2013 -#define Module_MajorVersion "0.13" -#define Module_Version 13 +#define Module_MajorVersion "0.14" +#define Module_Version 14 #define Module_MinorVersion "" -#define Module_Date "06 Oct 2012" +#define Module_Date "17 Jan 2013" -#define Module_ApplicationDate "06-Oct-12" +#define Module_ApplicationDate "17-Jan-13" #define Module_ComponentName "MousSetup" #define Module_ComponentPath "castle/RiscOS/Sources/SystemRes/Configure2/PlugIns/MousSetup" -#define Module_FullVersion "0.13" -#define Module_HelpVersion "0.13 (06 Oct 2012)" -#define Module_LibraryVersionInfo "0:13" +#define Module_FullVersion "0.14" +#define Module_HelpVersion "0.14 (17 Jan 2013)" +#define Module_LibraryVersionInfo "0:14" diff --git a/c/Main b/c/Main index fa196c112ff739e93e08439ffa30acd96b5b7674..6507bc21da169c64c5cad5f78e0cc91a8c887c9e 100644 --- a/c/Main +++ b/c/Main @@ -28,13 +28,18 @@ Date Who Change /* CLib */ #include <stdlib.h> +#include <string.h> +#include "swis.h" /* Toolbox */ #include "event.h" #include "toolbox.h" +#include "window.h" /* Common */ #include "error.h" #include "misc.h" +#include "message.h" /* Local headers */ +#include "Settings.h" #include "Main.h" /* includes prototypes for this file */ #include "ToolboxE.h" #include "WimpE.h" @@ -63,17 +68,50 @@ In: Command line option: int main (int argc, char *argv[]) { + int screeny; + ObjectTemplateHeader *objtemplate; + WindowTemplate *wintemplate; + WimpWindow *windef; + error_initialise (); throw (toolbox_initialise (0, WimpVersion, wimpm_messages, toolboxe_events, "<MousSetup$Dir>", &messages, &id_block, NULL, NULL, NULL)); misc_parsearguments (argc, argv); throw (event_initialise (&id_block)); throw (event_set_mask (wimpe_mask)); -// + + /* Register for messages and events */ wimpm_register (); wimpe_register (); toolboxe_register (); -// + + /* Read the window object in by hand */ + throw (toolbox_template_lookup (0, "Mouse", (void **)&objtemplate)); + if (objtemplate->object_class != Window_ObjectClass) { + _kernel_oserror e = { 0, "" }; + + strcpy (e.errmess, message_lookup_direct (messages,"Err_BadClass")); + _swi (OS_GenerateError, _IN(0), &e); + } + wintemplate = objtemplate->body; + windef = &wintemplate->window; + screeny = _swi (OS_ReadModeVariable, _INR(0,1) | _RETURN(2), -1, 12) << + _swi (OS_ReadModeVariable, _INR(0,1) | _RETURN(2), -1, 5); + + /* Calculate the window height compared with the screen and + * turn the vertical scrollbar on if it doesn't fit + */ + if ((windef->visible_area.ymax - windef->visible_area.ymin) >= screeny) { + windef->flags |= WimpWindow_VScroll; + } + else { + windef->flags &= ~WimpWindow_VScroll; + } + throw (toolbox_create_object (Toolbox_CreateObject_InCore, objtemplate, &mainwindow_id)); + misc_openwindow (mainwindow_id, TRUE); + settings_read (cmos_read); + + /* Go */ error_recover_point(); while (!quit) { throw (event_poll (NULL, &poll_block, NULL)); diff --git a/c/MouseType b/c/MouseType index c21152be3ec5246b56cdb7d9f4229d44a2eefd13..4c1bbbd046ab975ec739be54e35bb0ed765e7d2c 100644 --- a/c/MouseType +++ b/c/MouseType @@ -29,6 +29,8 @@ Date Who Change #include <stdio.h> #include <string.h> #include "swis.h" +#include "Global/ModHand.h" +#include "Global/RISCOS.h" /* Toolbox */ #include "wimplib.h" /* Common */ @@ -62,7 +64,7 @@ Out: Pointer to most recently-added record static pointerv_record *get_pointer_list (void) { if (pointer_list != NULL) free_pointer_list (); - return pointer_list = (pointerv_record *) _swi (OS_CallAVector, _INR(0,1)|_IN(9)|_RETURN(1), 1, 0, 0x26); + return pointer_list = (pointerv_record *) _swi (OS_CallAVector, _INR(0,1)|_IN(9)|_RETURN(1), 1, 0, PointerV); } /****** free_pointer_list() ***********************************************\ @@ -75,7 +77,7 @@ static void free_pointer_list (void) { while (pointer_list != NULL) { pointerv_record *next = pointer_list->next; - _swi (OS_Module, _IN(0)|_IN(2), 7, (int) pointer_list); + _swi (OS_Module, _IN(0)|_IN(2), ModHandReason_Free, (int) pointer_list); pointer_list = next; } } diff --git a/c/Settings b/c/Settings index 72520643500364b0dfd36353f0bd59cd8e7d1cfc..4b03f1429389163925bb9738cab6734f4b28c65d 100644 --- a/c/Settings +++ b/c/Settings @@ -33,6 +33,7 @@ Date Who Change /* CLib */ #include <string.h> #include "swis.h" +#include "Global/OsWords.h" /* Toolbox */ #include "toolbox.h" #include "window.h" @@ -148,10 +149,10 @@ BOOL settings_write (void) // throw (slider_get_value (0, mainwindow_id, mainwindow_mousespeed, &value)); cmos_write (MouseMultiplier, value); - step[0] = 0x2u; + step[0] = OWPointerAndMouse_SetMouseFactors; step[1] = (unsigned char) value; step[2] = (unsigned char) value; - _swi (OS_Word, _INR(0,1), 21, step); + _swi (OS_Word, _INR(0,1), OsWord_DefinePointerAndMouse, step); // throw (numberrange_get_value (0, mainwindow_id, mainwindow_dragdelay, &value)); sprintf (string, "Configure WimpDragDelay %i", value); diff --git a/c/ToolboxE b/c/ToolboxE index 85c80f7fbbd9171348bcd1f565abeabc92c81769..6766a6bf492b6c7d2edb0114fb71a8350954e229 100644 --- a/c/ToolboxE +++ b/c/ToolboxE @@ -41,12 +41,10 @@ Date Who Change #include "ToolboxE.h" /* includes prototypes for this file */ static int toolboxe_actionbuttonselected (int event_code, ToolboxEvent *event, IdBlock *id_block, void *handle); -static int toolboxe_objectautocreated (int event_code, ToolboxEvent *event, IdBlock *id_block, void *handle); static int toolboxe_optionbuttonstatechanged (int event_code, ToolboxEvent *event, IdBlock *id_block, void *handle); static int toolboxe_stringsetabouttobeshown (int event_code, ToolboxEvent *event, IdBlock *id_block, void *handle); int toolboxe_events [5] = { ActionButton_Selected, - Toolbox_ObjectAutoCreated, OptionButton_StateChanged, StringSet_AboutToBeShown, 0 }; @@ -54,7 +52,6 @@ int toolboxe_events [5] = { ActionButton_Selected, void toolboxe_register (void) { throw (event_register_toolbox_handler (-1, ActionButton_Selected, toolboxe_actionbuttonselected, NULL)); - throw (event_register_toolbox_handler (-1, Toolbox_ObjectAutoCreated, toolboxe_objectautocreated, NULL)); throw (event_register_toolbox_handler (-1, OptionButton_StateChanged, toolboxe_optionbuttonstatechanged, NULL)); throw (event_register_toolbox_handler (-1, StringSet_AboutToBeShown, toolboxe_stringsetabouttobeshown, NULL)); } @@ -82,20 +79,6 @@ static int toolboxe_actionbuttonselected (int event_code, ToolboxEvent *event, I return 1; } -/****** toolboxe_objectautocreated() **************************************\ - -Purpose: Handles Toolbox_ObjectAutoCreated event - -\**************************************************************************/ - -static int toolboxe_objectautocreated (int event_code, ToolboxEvent *event, IdBlock *id_block, void *handle) -{ - mainwindow_id = id_block->self_id; - misc_openwindow (mainwindow_id, TRUE); - settings_read (cmos_read); - return 1; -} - /****** toolboxe_optionbuttonstatechanged() *******************************\ Purpose: Handles OptionButton_StateChanged event