Commit 16db44a7 authored by Stewart Brodie's avatar Stewart Brodie
Browse files

* Added show-centred capability. Default show position was already doing a shot-at-pointer.

* Module version now maintained by srccommit.

Version 0.18. Tagged as 'ColourDbox-0_18'
parent e1ffed1f
......@@ -97,7 +97,7 @@ RESF=o.msgs
# Rule patterns
#
.c.o:; ${CC} ${CFLAGS} ${ROMFLAGS} -o $@ $<
.cmhg.o:; ${CMHG} -o $@ $<
.cmhg.o:; ${CMHG} -p -o $@ $<
#
# Main rules:
......
/* (0.17)
/* (0.18)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.17
#define Module_MajorVersion_CMHG 0.18
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 29 Jul 1998
#define Module_Date_CMHG 30 Jul 1998
#define Module_MajorVersion "0.17"
#define Module_Version 17
#define Module_MajorVersion "0.18"
#define Module_Version 18
#define Module_MinorVersion ""
#define Module_Date "29 Jul 1998"
#define Module_Date "30 Jul 1998"
......@@ -77,6 +77,7 @@ EventInterest toolbox_events_of_interest[] = {
};
static void aux_update_xy(int *left, int *top);
extern _kernel_oserror *dialogue_completed (ObjectID object_id) {
......@@ -339,6 +340,10 @@ _kernel_oserror *show_actual (void) {
picker.hdr.reserved2 = 0;
picker.hdr.reserved3 = 0;
if (global_next->show_type == Toolbox_ShowObject_Centre) {
aux_update_xy(&picker.hdr.x, &picker.hdr.y);
}
if (global_next->colour_block_extd) {
DEBUG debug_output ("e","ColD: using extended colour block\n");
......@@ -420,3 +425,42 @@ _kernel_oserror *fetch_state (ColourDboxInternal *internal) {
return NULL;
}
*/
static int aux_picker_width, aux_picker_height;
_kernel_oserror *auxiliary_find_size (const char *templatefile)
{
char name[12];
int win_size, ws_size;
_kernel_oserror *e;
aux_picker_width = 816;
aux_picker_height = 508;
e = _swix(Wimp_OpenTemplate, _IN(1), templatefile);
if (e) return e;
strcpy(name, "Picker");
e = _swix(Wimp_LoadTemplate, _INR(1,6)|_OUTR(1,2), 0, 0, 0, -1, name, 0, &win_size, &ws_size);
if (!e) {
char *data = malloc(win_size + ws_size);
if (data) {
e = _swix(Wimp_LoadTemplate, _INR(1,6), data, data+win_size, data+win_size+ws_size, -1, name, 0);
if (!e) {
wimp_Window *w = (wimp_Window *) data;
aux_picker_width = w->ex.xmax - w->ex.xmin;
aux_picker_height = w->ex.ymax - w->ex.ymin;
}
free(data);
}
}
(void) _swix(Wimp_CloseTemplate, 0);
return 0;
}
static void aux_update_xy(int *left, int *top)
{
static const int nums[] = { 4, 5, 11, 12, -1 };
int vars[sizeof(nums)/sizeof(int)];
(void) _swix(OS_ReadVduVariables, _INR(0,1), nums, vars);
*left = (((vars[2] + 1) << vars[0]) - aux_picker_width) >> 1;
*top = (((vars[3] + 1) << vars[1]) + aux_picker_height) >> 1;
}
......@@ -194,6 +194,10 @@ extern _kernel_oserror *ColourDbox_init(char *cmd_tail, int podule_base, void *p
if ((e = _kernel_swi(Toolbox_RegisterObjectModule, &regs, &regs)) != NULL)
return e;
auxiliary_find_size(getenv ("ColourPicker$Path") ?
"ColourPicker:Templates" :
"Resources:Resources.Picker.Templates");
return NULL;
}
......
......@@ -176,6 +176,7 @@ extern _kernel_oserror *show_object (_kernel_swi_regs *r, TaskDescriptor *t)
| ((user_regs->r[0] & 2) ? ColourDboxInternal_SubMenuSemantics : 0)
| ((user_regs->r[2] != 2)
? ColourDboxInternal_ShowAtDefault : 0);
internal->show_type = user_regs->r[2];
DEBUG debug_output ("s","ColD: show type = %d\n",user_regs->r[2]);
if (user_regs->r[2] == 2) {
......
......@@ -18,6 +18,7 @@
; History: 4-Mar-94: TGR: version 1.00
;
#include "VersionNum"
initialisation-code: ColourDbox_init
......@@ -27,7 +28,8 @@ service-call-handler: ColourDbox_services 0x44ec1, 0x44ec2, 0x44ec3
title-string: ColourDbox
help-string: ColourDbox 0.17
help-string: ColourDbox Module_MajorVersion_CMHG Module_MinorVersion_CMHG
command-keyword-table: ColourDbox_commands
ColourDbox_Memory()
......@@ -38,4 +40,4 @@ swi-handler-code: ColourDbox_SWI_handler
swi-decoding-table: ColourDbox, ClassSWI, PostFilter, PreFilter
date-string: 17 Feb 1998
date-string: Module_Date_CMHG
......@@ -18,6 +18,7 @@
; History: 4-Mar-94: TGR: version 1.00
;
#include "VersionNum"
initialisation-code: ColourDbox_init
......@@ -27,7 +28,7 @@ service-call-handler: ColourDbox_services 0x44ec1, 0x44ec2, 0x44ec3
title-string: ColourDbox
help-string: ColourDbox 0.17
help-string: ColourDbox Module_MajorVersion_CMHG Module_MinorVersion_CMHG
swi-chunk-base-number: 0x829c0
......@@ -35,4 +36,4 @@ swi-handler-code: ColourDbox_SWI_handler
swi-decoding-table: ColourDbox, ClassSWI, PostFilter, PreFilter
date-string: 17 Feb 1998
date-string: Module_Date_CMHG
......@@ -68,4 +68,5 @@ extern ColourDboxInternal *find_internal_d (int dialogue_handle, TaskDescriptor
extern ColourDboxInternal *find_internal_w (int window_handle, TaskDescriptor *t);
_kernel_oserror *show_actual (void);
extern _kernel_oserror *auxiliary_find_size (const char *templatefile);
#endif
......@@ -36,6 +36,7 @@ typedef struct _colourdbox_internal
struct _colourdbox_internal *forward;
struct _colourdbox_internal *backward;
ObjectID object_id;
int show_type;
int flags,x,y,
colour;
ColourModelBlock *colour_model_block;
......
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