Commit 2729d7af authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Change to link against tboxlibint

For some reason this toolbox module was unique in linking against the public toolboxlib rather than the internal one, this meant having to carefully tippy toe around not mixing header files (as they contain similar but differently named definitions).
A massive search and replace job.
Tested briefly using ResEd/ResTest and a textarea and scrolllist in a ROM build.
Requires Common-0_21.

Version 0.36. Tagged as 'Gadgets-0_36'
parent 25c43974
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all COMPONENT=TextGadget
amu_machine all COMPONENT=TextGadget THROWBACK=-throwback
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine rom COMPONENT=TextGadget
amu_machine rom COMPONENT=TextGadget THROWBACK=-throwback
......@@ -22,7 +22,7 @@ RAMBOTH =
COMMON_OBJ = o.ModHdr o.glib o.glib3 o.MemMan o.riscos_uti o.Scrollbar \
o.ScrollList o.Sizes o.TextArea o.TextMan \
o.Font o.riscos_gra o.ScrollLisS o.TAsel_ven o.Text o.Utils
o.Font o.riscos_gra o.ScrollLisS o.TAsel_ven o.Text o.Utils ${WIMPLIB}
ROM_OBJS = o.mainROM ${COMMON_OBJ}
......@@ -30,11 +30,7 @@ RAM_OBJS = o.main ${RAMBOTH} ${COMMON_OBJ}
DBG_OBJS = od.main ${RAMBOTH} od.ModHdr od.glib od.glib3 od.MemMan od.riscos_uti od.Scrollbar \
od.ScrollList od.Sizes od.TextArea od.TextMan \
od.Font od.riscos_gra od.ScrollLisS od.TAsel_ven od.Text od.Utils
EXTRARAMLIBS = c:tboxlibs.o.wimplib c:tboxlibs.o.toolboxlib
EXTRAROMLIBS = c:tboxlibs.o.wimplib c:tboxlibs.o.toolboxlib
od.Font od.riscos_gra od.ScrollLisS od.TAsel_ven od.Text od.Utils ${WIMPLIB}
#
# Get main rules
......
/* (0.35)
/* (0.36)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.35
#define Module_MajorVersion_CMHG 0.36
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 16 Mar 2013
#define Module_Date_CMHG 30 Aug 2013
#define Module_MajorVersion "0.35"
#define Module_Version 35
#define Module_MajorVersion "0.36"
#define Module_Version 36
#define Module_MinorVersion ""
#define Module_Date "16 Mar 2013"
#define Module_Date "30 Aug 2013"
#define Module_ApplicationDate "16-Mar-13"
#define Module_ApplicationDate "30-Aug-13"
#define Module_ComponentName "Gadgets"
#define Module_ComponentPath "castle/RiscOS/Sources/Toolbox/Gadgets"
#define Module_FullVersion "0.35"
#define Module_HelpVersion "0.35 (16 Mar 2013)"
#define Module_LibraryVersionInfo "0:35"
#define Module_FullVersion "0.36"
#define Module_HelpVersion "0.36 (30 Aug 2013)"
#define Module_LibraryVersionInfo "0:36"
......@@ -30,13 +30,8 @@
#include "kernel.h"
#include "swis.h"
#include "toolbox.h"
#include "window.h"
#include "objects/gadgets.h"
#include "wimplib.h"
#include "TextGadget.h"
#include "MemMan.h"
#include "Text.h"
#ifdef MemCheck_MEMCHECK
#include "MemCheck:MemCheck.h"
......
This diff is collapsed.
......@@ -31,34 +31,27 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "kernel.h"
#include "swis.h"
#include "toolbox.h"
#include "window.h"
#include "wimplib.h"
#include "macros.h"
#include "twimp.h"
#include "objects/gadgets.h"
#include "glib.h"
#include "string32.h"
#include "riscos_uti.h"
#include "TextGadget.h"
#include "Scrollbar.h"
#include "ScrollbarP.h"
#include "Text.h"
#include "Utils.h"
#ifdef MemCheck_MEMCHECK
#include "MemCheck:MemCheck.h"
#endif
#define IGNORE(a) (a)=(a)
typedef struct
{
unsigned int flags;
BBox box;
wimp_Bbox box;
unsigned int min;
unsigned int max;
unsigned int value;
......@@ -149,8 +142,8 @@ static _kernel_oserror *remove_redraw_handler(const PrivateScrollbar *tb)
static _kernel_oserror *scrollbar_show(PrivateScrollbar *sdata)
{
WimpOpenWindowBlock open_win;
BBox extent = {0, 0, 0, 0};
wimp_OpenWindow open_win;
wimp_Bbox extent = {0, 0, 0, 0};
open_win.window_handle = sdata->scrollbar_window;
work_to_screen_handle(&open_win.visible_area, &sdata->box,
......@@ -171,9 +164,9 @@ static _kernel_oserror *scrollbar_show(PrivateScrollbar *sdata)
extent.xmax = -0xffff;
if (sdata->value - sdata->min == 0)
open_win.xscroll = 0;
open_win.scx = 0;
else
open_win.xscroll = (extent.xmax) /
open_win.scx = (extent.xmax) /
(int)(sdata->max - sdata->min) * (sdata->value - sdata->min);
}
else
......@@ -192,9 +185,9 @@ static _kernel_oserror *scrollbar_show(PrivateScrollbar *sdata)
extent.ymin = -0xffff;
if (sdata->value - sdata->min == 0)
open_win.yscroll = 0;
open_win.scy = 0;
else
open_win.yscroll = (extent.ymin) /
open_win.scy = (extent.ymin) /
(int)(sdata->max - sdata->min) * (sdata->value - sdata->min);
}
......@@ -233,12 +226,12 @@ _kernel_oserror *scrollbar_die(void)
/* scrollbar_add ----------------------------------------------------------
*/
_kernel_oserror *
scrollbar_add(Scrollbar *sdata, int wimpw, ObjectId object_id,
scrollbar_add(Scrollbar *sdata, int wimpw, ObjectID object_id,
int **icons, int **data)
{
PrivateScrollbar *sb;
WimpWindow win;
WimpGetWindowStateBlock open_win;
wimp_Window win;
wimp_GetWindowState open_win;
sb = (PrivateScrollbar *) mem_allocate(sizeof(PrivateScrollbar));
if (!sb)
......@@ -257,7 +250,10 @@ scrollbar_add(Scrollbar *sdata, int wimpw, ObjectId object_id,
sb->faded = 0; // PJG (18/6/99) scrollbar is not faded
sb->parent_window = wimpw;
sb->box = sdata->hdr.box;
sb->box.xmin = sdata->hdr.xmin;
sb->box.ymin = sdata->hdr.ymin;
sb->box.xmax = sdata->hdr.xmax;
sb->box.ymax = sdata->hdr.ymax;
sb->min = sdata->min;
if ((sb->max = sdata->max) < sb->min)
sb->max = sb->min;
......@@ -270,39 +266,39 @@ scrollbar_add(Scrollbar *sdata, int wimpw, ObjectId object_id,
sb->line_inc = sdata->line_inc;
sb->page_inc = sdata->page_inc;
win.visible_area.xmin = 0;
win.visible_area.ymin = 0;
win.visible_area.xmax = 0;
win.visible_area.ymax = 0;
win.xscroll = 0;
win.yscroll = 0;
win.box.xmin = 0;
win.box.ymin = 0;
win.box.xmax = 0;
win.box.ymax = 0;
win.scx = 0;
win.scy = 0;
win.behind = -1;
win.flags = WimpWindow_AutoRedraw | WimpWindow_Pane |
WimpWindow_NoBounds | WimpWindow_ScrollRepeat |
WimpWindow_NewFormat;
win.flags = wimp_WINDOWFLAGS_AUTOREDRAW | wimp_WINDOWFLAGS_PANE |
wimp_WINDOWFLAGS_ALLOW_OFF_SCREEN | wimp_WINDOWFLAGS_CLICK_SCROLL_REQUEST |
(int)wimp_WINDOWFLAGS_USE_NEW_FLAGS;
if (sb->state & Scrollbar_Horizontal)
win.flags |= WimpWindow_HScroll;
win.flags |= wimp_WINDOWFLAGS_HAS_HSCROLLBAR;
else
win.flags |= WimpWindow_VScroll;
win.title_fg = 0xff;
win.title_bg = 2;
win.scroll_outer = 3;
win.scroll_inner = 1;
win.extent.xmin = 0;
win.extent.ymin = -0xffff;
win.extent.xmax = 0xffff;
win.extent.ymax = 0;
win.flags |= wimp_WINDOWFLAGS_HAS_VSCROLLBAR;
win.colours[0] = 0xff;
win.colours[1] = 2;
win.colours[4] = 3;
win.colours[5] = 1;
win.ex.xmin = 0;
win.ex.ymin = -0xffff;
win.ex.xmax = 0xffff;
win.ex.ymax = 0;
win.title_flags = 0;
win.work_flags = 0;
win.work_area_flags = 0;
win.sprite_area = NULL;
win.min_width = win.min_height = 1;
win.title_data.it.buffer = NULL;
win.title_data.it.validation = NULL;
win.title_data.it.buffer_size = 0;
win.min_size = 0x00010001;
win.title.indirect_text.buffer = NULL;
win.title.indirect_text.valid_string = NULL;
win.title.indirect_text.buff_len = 0;
win.nicons = 0;
// Display scrollbar if parent is showing
open_win.window_handle = sb->parent_window;
open_win.open.window_handle = sb->parent_window;
wimp_get_window_state(&open_win);
wimp_create_window(&win, &sb->scrollbar_window);
......@@ -466,9 +462,9 @@ _kernel_oserror *scrollbar_fade(PrivateScrollbar *handle, int fade)
_kernel_oserror *scrollbar_plot(Scrollbar *sdata)
{
WimpGetWindowStateBlock state;
wimp_GetWindowState state;
if ((state.window_handle = redrawing_window) == 0)
if ((state.open.window_handle = redrawing_window) == 0)
return NULL;
sdata = sdata;
......@@ -476,12 +472,12 @@ sdata = sdata;
return NULL;
}
static _kernel_oserror *_do_drag_scroll(WimpOpenWindowRequestEvent *event)
static _kernel_oserror *_do_drag_scroll(wimp_OpenWindowRequest *event)
{
int old_position, i;
for (i = 0; scrollbar_list[i] != NULL; i++)
if (scrollbar_list[i]->scrollbar_window == event->window_handle)
if (scrollbar_list[i]->scrollbar_window == event->open_block.window_handle)
{
PrivateScrollbar *sdata = scrollbar_list[i];
ScrollbarPositionChangedEvent changed;
......@@ -499,7 +495,7 @@ static _kernel_oserror *_do_drag_scroll(WimpOpenWindowRequestEvent *event)
if (extent == 0)
sdata->value = sdata->max;
else
sdata->value = (event->xscroll *
sdata->value = (event->open_block.scx *
(sdata->max - sdata->min) *
sdata->visible / extent) + sdata->min;
}
......@@ -511,7 +507,7 @@ static _kernel_oserror *_do_drag_scroll(WimpOpenWindowRequestEvent *event)
if (extent == 0)
sdata->value = sdata->max;
else
sdata->value = (-event->yscroll *
sdata->value = (-event->open_block.scy *
(sdata->max - sdata->min) *
sdata->visible / extent) + sdata->min;
}
......@@ -526,8 +522,8 @@ static _kernel_oserror *_do_drag_scroll(WimpOpenWindowRequestEvent *event)
changed.new_position = sdata->value;
toolbox_raise_toolbox_event(0, sdata->object_id,
sdata->component_id, (ToolboxEvent *) &changed);
_swix(Toolbox_RaiseToolboxEvent, _INR(0,3),
0, sdata->object_id, sdata->component_id, (ToolboxEvent *)&changed);
scrollbar_show(sdata);
}
......@@ -537,13 +533,13 @@ static _kernel_oserror *_do_drag_scroll(WimpOpenWindowRequestEvent *event)
return NULL;
}
static _kernel_oserror *_do_scroll(WimpScrollRequestEvent *event)
static _kernel_oserror *_do_scroll(wimp_ScrollRequest *event)
{
PrivateScrollbar *sdata;
int i;
for (i = 0; scrollbar_list[i] != NULL; i++)
if (scrollbar_list[i]->scrollbar_window == event->open.window_handle)
if (scrollbar_list[i]->scrollbar_window == event->open_block.window_handle)
{
// Found it!
ScrollbarPositionChangedEvent changed;
......@@ -560,9 +556,9 @@ static _kernel_oserror *_do_scroll(WimpScrollRequestEvent *event)
changed.hdr.flags = 0;
if (sdata->state & Scrollbar_Horizontal)
changed.direction = event->xscroll;
changed.direction = event->x_scroll_direction;
else
changed.direction = -event->yscroll;
changed.direction = -event->y_scroll_direction;
switch (changed.direction)
{
......@@ -596,8 +592,8 @@ static _kernel_oserror *_do_scroll(WimpScrollRequestEvent *event)
if (old_position != sdata->value)
{
toolbox_raise_toolbox_event(0, sdata->object_id,
sdata->component_id, (ToolboxEvent *) &changed);
_swix(Toolbox_RaiseToolboxEvent, _INR(0,3),
0, sdata->object_id, sdata->component_id, (ToolboxEvent *)&changed);
scrollbar_show(sdata);
}
......@@ -613,24 +609,24 @@ _kernel_oserror *scrollbar_filter(_kernel_swi_regs *regs)
#endif
{
ToolboxEvent *event = (ToolboxEvent *)regs->r[1];
IdBlock *id_block = (IdBlock *)regs->r[3];
IDBlock *id_block = (IDBlock *)regs->r[3];
int event_code = regs->r[0];
unsigned int i;
if (scrollbar_list == NULL)
return NULL;
if (event_code == Wimp_EScrollRequest)
if (event_code == wimp_ESCROLL)
{
_do_scroll((WimpScrollRequestEvent *)regs->r[1]);
_do_scroll((wimp_ScrollRequest *)regs->r[1]);
}
else if (event_code == Wimp_EOpenWindow)
else if (event_code == wimp_EOPEN)
{
_do_drag_scroll((WimpOpenWindowRequestEvent *)regs->r[1]);
_do_drag_scroll((wimp_OpenWindowRequest *)regs->r[1]);
}
// All checks after here should assume event is a toolbox event
if (event_code != Wimp_EToolboxEvent)
if (event_code != wimp_ETOOLBOX_EVENT)
return NULL;
if (event->hdr.event_code == Toolbox_ObjectDeleted)
......@@ -647,7 +643,7 @@ _kernel_oserror *scrollbar_filter(_kernel_swi_regs *regs)
// Found one!
int j;
wimp_delete_window( (WimpDeleteWindowBlock *)
wimp_delete_window( (wimp_DeleteWindow *)
&(scrollbar_list[i]->scrollbar_window));
for (j = i; scrollbar_list[j] != NULL; j++)
......@@ -693,13 +689,13 @@ _kernel_oserror *scrollbar_filter(_kernel_swi_regs *regs)
}
#endif
_kernel_oserror *scrollbar_move(PrivateScrollbar *sdata, BBox *box)
_kernel_oserror *scrollbar_move(PrivateScrollbar *sdata, wimp_Bbox *box)
{
WimpGetWindowStateBlock state;
wimp_GetWindowState state;
sdata->box = *box;
state.window_handle = sdata->scrollbar_window;
state.open.window_handle = sdata->scrollbar_window;
wimp_get_window_state(&state);
return scrollbar_show(sdata);
......
......@@ -24,13 +24,10 @@
#include <stdlib.h>
#include <stdio.h>
#include "swis.h"
#include "kernel.h"
#include "toolbox.h"
#include "wimplib.h"
#include "twimp.h"
#include "Sizes.h"
/* Mode variables, as used by OS_ReadModeVariable */
......@@ -64,17 +61,18 @@ typedef enum
* from ScrollList.c
*/
static const WimpWindow window_template =
static const wimp_Window window_template =
{
{0, -100, 100, 0}, /* visible_area */
0, /* xscroll */
0, /* yscroll */
-1, /* behind */
WimpWindow_NewFormat | WimpWindow_AutoRedraw |
WimpWindow_NoBounds | WimpWindow_BackIcon |
WimpWindow_CloseIcon | WimpWindow_TitleIcon | /* flags */
WimpWindow_ToggleIcon | WimpWindow_SizeIcon |
WimpWindow_VScroll | WimpWindow_HScroll,
(int)wimp_WINDOWFLAGS_USE_NEW_FLAGS | wimp_WINDOWFLAGS_AUTOREDRAW |
wimp_WINDOWFLAGS_ALLOW_OFF_SCREEN | wimp_WINDOWFLAGS_HAS_BACK_ICON |
wimp_WINDOWFLAGS_HAS_CLOSE_ICON | wimp_WINDOWFLAGS_HAS_TITLE_BAR |
wimp_WINDOWFLAGS_HAS_TOGGLE_ICON | wimp_WINDOWFLAGS_HAS_ADJUST_SIZE_ICON |
wimp_WINDOWFLAGS_HAS_VSCROLLBAR |
wimp_WINDOWFLAGS_HAS_HSCROLLBAR, /* flags */
7, /* title_fg */
2, /* title_bg */
7, /* work_fg */
......@@ -85,10 +83,9 @@ static const WimpWindow window_template =
0, /* reserved */
{0, -256, 256, 0}, /* extent */
0, /* title_flags */
10 * WimpIcon_ButtonType, /* work_flags */
10 * wimp_ICONFLAGS_BUTTON_TYPE, /* work_flags */
NULL, /* sprite_area */
1, /* min_width */
1, /* min_height */
0x00010001, /* min_width/min_height */
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* WimpIconData */
0 /* nicons */
};
......@@ -156,19 +153,19 @@ void sizes_tool_sizes(unsigned int * title, unsigned int * vscroll, unsigned int
* i.e. behind even the Wimp's back window
*/
if (!wimp_create_window((WimpWindow *) &window_template, &handle))
if (!wimp_create_window((wimp_Window *) &window_template, &handle))
{
WimpOpenWindowBlock open;
WimpGetWindowStateBlock state;
WimpGetWindowOutlineBlock outline;
outline.window_handle = handle;
state.window_handle = handle;
open.window_handle = handle;
open.visible_area = window_template.visible_area;
open.xscroll = 0;
open.yscroll = 0;
open.behind = -3;
wimp_OpenWindow open;
wimp_GetWindowState state;
wimp_GetWindowOutline outline;
outline.window_handle = handle;
state.open.window_handle = handle;
open.window_handle = handle;
open.visible_area = window_template.box;
open.scx = 0;
open.scy = 0;
open.behind = -3;
if (
!wimp_open_window(&open) &&
......@@ -178,9 +175,9 @@ void sizes_tool_sizes(unsigned int * title, unsigned int * vscroll, unsigned int
{
/* Work out the sizes */
ti = outline.outline.ymax - state.visible_area.ymax;
hs = state.visible_area.ymin - outline.outline.ymin;
vs = outline.outline.xmax - state.visible_area.xmax;
ti = outline.box.ymax - state.open.visible_area.ymax;
hs = state.open.visible_area.ymin - outline.box.ymin;
vs = outline.box.xmax - state.open.visible_area.xmax;
}
wimp_close_window(&handle);
......
This diff is collapsed.
......@@ -28,12 +28,12 @@
#include "kernel.h"
#include "swis.h"
#include "toolbox.h"
#include "window.h"
#include "macros.h"
#include "objects/gadgets.h"
#include "wimplib.h"
#include "TextGadget.h"
#include "twimp.h"
#include "MemMan.h"
#include "Text.h"
#include "TextMan.h"
typedef struct {
......
......@@ -12,16 +12,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdio.h>
#include <stdlib.h>
#include "kernel.h"
#include "swis.h"
#include "glib.h"
#include "glibP.h"
#include "toolbox.h"
#include "window.h"
#include "wimplib.h"
#include "twimp.h"
#include "objects/toolbox.h"
#include "objects/window.h"
#include "glib.h"
extern _kernel_oserror *register_gadget_types(unsigned int flags, GadgetExtensionRecord *rec,int SWIno)
{
......@@ -62,7 +63,7 @@ void mem_free(void *tag)
_swix(Window_SupportExternal, _INR(0,2), 0, 5, tag);
}
int glib_create_icon(WimpCreateIconBlock *i)
int glib_create_icon(wimp_IconCreate *i)
{
_kernel_swi_regs regs;
......@@ -73,7 +74,7 @@ int glib_create_icon(WimpCreateIconBlock *i)
return regs.r[0];
}
int glib_create_gadget(ObjectId o,Gadget *i,int f)
int glib_create_gadget(ObjectID o,Gadget *i,int f)
{
_kernel_swi_regs regs;
......@@ -85,7 +86,7 @@ int glib_create_gadget(ObjectId o,Gadget *i,int f)
return regs.r[0];
}
void glib_move_gadget(int type,ObjectId obj,ComponentId id,BBox *box)
void glib_move_gadget(int type,ObjectID obj,ComponentID id,wimp_Bbox *box)
{
_kernel_swi_regs regs;
FeatureMask features;
......@@ -107,7 +108,7 @@ void glib_move_gadget(int type,ObjectId obj,ComponentId id,BBox *box)
}
void graphics_window(BBox *area)
void graphics_window(wimp_Bbox *area)
{
_swix(OS_WriteI+5,0);
_swix(OS_WriteI+24,0);
......@@ -122,12 +123,12 @@ void graphics_window(BBox *area)
}
static BBox intersect;
static wimp_Bbox intersect;
#define min(a,b) ((a>b) ? b:a)
#define max(a,b) ((a>b) ? a:b)
BBox *intersection(BBox *a, BBox *b)
wimp_Bbox *intersection(wimp_Bbox *a, wimp_Bbox *b)
{
if ((a->xmin >= b->xmax) || (a->xmax <= b->xmin) || (a->ymin >= b->ymax) || (a->ymax <= b->ymin)) return 0;
intersect.xmin = max(a->xmin,b->xmin);
......
......@@ -12,17 +12,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdio.h>
#include <stdlib.h>
#include "kernel.h"
#include "swis.h"
#include "glib.h"
#include "glibP.h"
#include "toolbox.h"
#include "window.h"
#include "wimplib.h"
#include "twimp.h"
#include "objects/toolbox.h"
#include "objects/window.h"
#include "glib.h"
typedef struct _tasks {
struct _tasks *next;
......
......@@ -29,29 +29,24 @@
#include "kernel.h"
#include "swis.h"
#include "toolbox.h"
#include "window.h"
#include "macros.h"
#include "rmensure.h"
#include "twimp.h"
#include "objects/gadgets.h"
#include "wimplib.h"
#include "TextGadget.h"
#include "glib.h"
#include "rmensure.h"
#include "TextArea.h"
#include "MemMan.h"
#include "TextMan.h"
#include "TextAreaP.h"
#include "ScrollList.h"
#include "ScrollLisP.h"
#include "Scrollbar.h"
#include "ScrollbarP.h"
#include "riscos_uti.h"
#include "modmem.h"
#include "Text.h"
#ifdef MemCheck_MEMCHECK
#include "MemCheck:MemCheck.h"
#endif
#define IGNORE(a) a=a
unsigned int redrawing_window = 0;
int filter_toolbox_events[] =
......@@ -64,36 +59,36 @@ int filter_toolbox_events[] =
int filter_wimp_events[] =
{
Wimp_ENull, 0,
Wimp_EOpenWindow, 0,
Wimp_ERedrawWindow, 0,
Wimp_EMouseClick, 0,
Wimp_EUserDrag, 0,
Wimp_EScrollRequest, 0,
Wimp_EKeyPressed, 0,
wimp_ENULL, 0,
wimp_EOPEN, 0,
wimp_EREDRAW, 0,
wimp_EBUT, 0,
wimp_EUSER_DRAG, 0,
wimp_ESCROLL, 0,
wimp_EKEY, 0,
-1
};
/* convert work area coords to screen coords */
void work_to_screen(BBox *wa, WimpGetWindowStateBlock *state)
void work_to_screen(wimp_Bbox *wa, wimp_GetWindowState *state)
{
wa->xmin += state->visible_area.xmin - state->xscroll;
wa->xmax += state->visible_area.xmin - state->xscroll;
wa->xmin += state->open.visible_area.xmin - state->open.scx;
wa->xmax += state->open.visible_area.xmin - state->open.scx;
wa->ymin += state->visible_area.ymax - state->yscroll;
wa->ymax += state->visible_area.ymax - state->yscroll;
wa->ymin += state->open.visible_area.ymax - state->open.scy;
wa->ymax += state->open.visible_area.ymax - state->open.scy;
}
/* convert screen coords to work area */
void screen_to_work(BBox *wa, WimpGetWindowStateBlock *state)
void screen_to_work(wimp_Bbox *wa, wimp_GetWindowState *state)
{
wa->xmin -= state->visible_area.xmin - state->xscroll;
wa->xmax -= state->visible_area.xmin - state->xscroll;
wa->xmin -= state->open.visible_area.xmin - state->open.scx;
wa->xmax -= state->open.visible_area.xmin - state->open.scx;
wa->ymin -= state->visible_area.ymax - state->yscroll;
wa->ymax -= state->visible_area.ymax - state->yscroll;
wa->ymin -= state->open.visible_area.ymax - state->open.scy;
wa->ymax -= state->open.visible_area.ymax - state->open.scy;
}
static void register_gadgets(void)
......@@ -253,7 +248,7 @@ _kernel_oserror *TextGadgets_SWI_handler(int swi_no, _kernel_swi_regs *r,
break;
case GADGET_MOVE:
e = textarea_move((int) r->r[1], (PrivateTextArea *) r->r[3],
(BBox *) r->r[5]);
(wimp_Bbox *) r->r[5]);
break;
default:
break;
......@@ -289,7 +284,7 @@ _kernel_oserror *TextGadgets_SWI_handler(int swi_no, _kernel_swi_regs *r,
case GADGET_MOVE:
e = scrolllist_move((int) r->r[1],
(PrivateScrollList *) r->r[3],
(BBox *) r->r[5]);
(wimp_Bbox *) r->r[5]);
break;
default:
break;
......@@ -324,7 +319,7 @@ _kernel_oserror *TextGadgets_SWI_handler(int swi_no, _kernel_swi_regs *r,
break;
case GADGET_MOVE:
e = scrollbar_move((PrivateScrollbar*)r->r[3],
(BBox *)r->r[5]);
(wimp_Bbox *)r->r[5]);
break;
default:
break;
......@@ -358,7 +353,7 @@ _kernel_oserror *TextGadgets_SWI_handler(int swi_no, _kernel_swi_regs *r,
*/
//_kernel_oserror *redraw_gadget(int window_handle, GadgetHeader *hdr)
//{
// WimpGetWindowStateBlock state;
// wimp_GetWindowState state;
// _kernel_oserror *e;
//
// state.window_handle = window_handle;
......
......@@ -16,16 +16,11 @@
#include <stdio.h>
#include <stdlib.h>
#include "string.h"
#include <string.h>
#include "kernel.h"
#include "swis.h"
#include "wimp.h"
#include "wimplib.h"
#include "toolbox.h"
#include "window.h"
#include "twimp.h"
#include "riscos_uti.h"
MessagesFD messages;
......@@ -36,17 +31,20 @@ static _kernel_oserror err;
static char obj__name[16];
char *object_name(ObjectId id)
char *object_name(ObjectID id)
{
if(toolbox_get_template_name(0,id,obj__name,16,0)) return NULL;
if (_swix(Toolbox_GetTemplateName, _INR(0,3),
0, id, obj__name, sizeof(obj__name)) != NULL) return NULL;
return obj__name;
}
int is_object(ObjectId id,char *name)
int is_object(ObjectID id,char *name)
{
if(toolbox_get_template_name(0,id,obj__name,16,0)) return 1;
return ((int) strcmp(obj__name,name));
if (_swix(Toolbox_GetTemplateName, _INR(0,3),
0, id, obj__name, sizeof(obj__name)) != NULL) return 1;
return strcmp(obj__name, name);
}
char * lookup_token(const char *tag)
......@@ -66,5 +64,5 @@ char * lookup_token(const char *tag)
void warn_about_memory(void)
{
strcpy(err.errmess,lookup_token("NoMem"));
wimp_report_error(&err,0,0);
wimp_report_error(&err, 0, NULL, NULL, NULL, NULL);
}
......@@ -25,7 +25,7 @@ typedef struct
coords space;
coords letter;
int split_char;
BBox bounds;
wimp_Bbox bounds;
} FontScanStringCoordsBlock;
extern _kernel_oserror *font_find_font(const char *font,
......
......@@ -19,7 +19,6 @@
#define __SCROLLLISTP_H
#include "modmem.h"
#include "ScrollList.h"
#define FLAGS_SPRITE_AREA (1u<<0)
#define FLAGS_SPRITE_NAME (1u<<1)
......@@ -35,11 +34,11 @@ struct _entries
};
typedef struct {
ObjectId parent_id;
ObjectId object_id;
ComponentId component_id;
ObjectID parent_id;
ObjectID object_id;
ComponentID component_id;
int parent_window; // 12 bytes
BBox box;
wimp_Bbox box;
int event;
int state;
unsigned int icon;
......@@ -51,18 +50,23 @@ typedef struct {
unsigned int visible;
} PrivateScrollList;
// Used in ScrollLisS.s
/* Used in ScrollLisS.s */
_kernel_oserror *_scrolllist_redraw(const PrivateScrollList *sdata,
WimpGetRectangleBlock *block, BBox *box,
WindowRedraw *block, wimp_Bbox *box,
unsigned int max_sprite_width,
unsigned int max_height,
int base_line);
/* Implemented in ScrollLisS.s */
_kernel_oserror *scrolllist_update(PrivateScrollList *sdata,
int xmin, int ymin, int xmax, int ymax);
/* Others */
int scrolllist_active(void);
_kernel_oserror *scrolllist_init(void);
_kernel_oserror *scrolllist_die(void);
_kernel_oserror *scrolllist_add(ScrollList *, int wimpw,
ObjectId obj_id,
ObjectID obj_id,
int **icons, int **data);
_kernel_oserror *scrolllist_method(PrivateScrollList *handle,
_kernel_swi_regs *regs);
......@@ -71,7 +75,7 @@ _kernel_oserror *scrolllist_fade(PrivateScrollList *handle, int fade);
_kernel_oserror *scrolllist_plot(ScrollList *);
_kernel_oserror *scrolllist_move(int type, PrivateScrollList *sdata,
BBox *box);
wimp_Bbox *box);
_kernel_oserror *scrolllist_filter(_kernel_swi_regs *regs);
......
/* Copyright 1997 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.
*/
/* ScrollLisS.h
*/
#ifndef __SCROLLLISTS_H
#define __SCROLLLISTS_H
#include "modmem.h"
#include "ScrollList.h"
_kernel_oserror *scrolllist_update(PrivateScrollList *sdata,
int xmin, int ymin, int xmax, int ymax);
#endif
/* Copyright 1997 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.
*/
/****************************************************************************
* This source file was written by Acorn Computers Limited. It is part of *
* the toolbox library for writing desktop applications in C. It may be *
* used freely in the creation of programs for Archimedes or Risc PC. It *
* should be used with Acorn's C Compiler Release 5 or later. *
* *
* *
* Copyright Acorn Computers Ltd, 1994 *
* *
***************************************************************************/
/*
* Name : scrolllist.h
* Description : C veneers to the Methods provided by the ScrollList gadget
*/
#ifndef __scrolllist_h
#define __scrolllist_h
#ifndef __kernel_h
#include "kernel.h"
#endif
#ifndef __toolbox_h
#include "toolbox.h"
#endif
#ifndef __window_h
#include "window.h"
#endif
/****************************************************************************
* ScrollList Templates *
****************************************************************************/
/*-- gadget flags --*/
#define ScrollList_SingleSelections 0x00000000
#define ScrollList_MultipleSelections 0x00000001
#define ScrollListValidFlags 0xC0000001
/*-- templates --*/
typedef struct
{
GadgetHeader hdr;
int event;
unsigned int foreground;
unsigned int background;
} ScrollList;
/*-- ScrollList methods --*/
#define ScrollList_Base 0x401A
#define ScrollList_Type (sizeof(ScrollList)) << 16 | ScrollList_Base
#define ScrollList_SWIBase 0x140182
#define ScrollList_GetState (ScrollList_Base + 0)
#define ScrollList_SetState (ScrollList_Base + 1)
#define ScrollList_AddItem (ScrollList_Base + 2)
#define ScrollList_DeleteItems (ScrollList_Base + 3)
#define ScrollList_SelectItem (ScrollList_Base + 4)
#define ScrollList_DeselectItem (ScrollList_Base + 5)
#define ScrollList_GetSelected (ScrollList_Base + 6)
#define ScrollList_MakeVisible (ScrollList_Base + 7)
#define ScrollList_SetColour (ScrollList_Base + 8)
#define ScrollList_GetColour (ScrollList_Base + 9)
#define ScrollList_SetFont (ScrollList_Base + 10)
#define ScrollList_GetItemText (ScrollList_Base + 11)
#define ScrollList_CountItems (ScrollList_Base + 12)
#define ScrollList_SetItemText (ScrollList_Base + 13)
/*-- ScrollList button events --*/
#define ScrollList_Selection (0x140180 + 1)
#define ScrollList_Selection_Flags_Set (1<<0)
#define ScrollList_Selection_Flags_DoubleClick (1<<1)
#define ScrollList_Selection_Flags_AdjustClick (1<<2)
typedef struct
{
ToolboxEventHeader hdr;
unsigned int flags;
int item;
} ScrollListSelectionEvent;
/*-- ScrollList SWI method constants --*/
#define ScrollList_DesktopColours (1<<0)
/*-- method flags for select_item, deselect_item, delete_items --*/
#define ScrollList_SelectionChangingMethod_SendEvent (1u<<0)
#define ScrollList_SelectionChangingMethod_OnAll (1u<<1)
/*-- method flags for add_item and delete_items --*/
#define ScrollList_AddItem_MakeVisible (1u<<3)
#define ScrollList_DeleteItems_DoNotJumpToTop (1u<<1)
/****************************************************************************
* The following functions provide veneers to the methods that are *
* associated with this particular class. Please read the C Release 5 *
* user guide for more detailed information on their functionality. *
****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Name : scrolllist_select_item
* Description : Selects the given item from the specified scrolllist
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* int index
* Out : None
* Returns : pointer to error block
*
* To receive a ScrollList_Selection event indicating the item that
* was selected with any mouse button related flags cleared, set the
* ScrollList_SelectionChangingMethod_SendEvent bit of the flags.
* This will be sent even if the item you specify was already
* selected before the function call was made.
*
* To select all items, call with the flags bit
* ScrollList_SelectionChangingMethod_OnAll set. In this case, the
* value set in 'index' is irrelevant. If using the flags to get a
* ScrollList_Selection event as well (see above), the item number
* in the event will be zero.
*/
extern _kernel_oserror *scrolllist_select_item ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
int index
);
/*
* Name : scrolllist_set_font
* Description : Set the font for the specified scrolllist.
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* const char *font_name
* unsigned int width
* unsigned int height
* Out : None
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_set_font ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
const char *font_name,
unsigned int width,
unsigned int height
);
/*
* Name : scrolllist_get_colour
* Description : Gets the colours currently being used for the specified scrolllist.
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* Out : unsigned int *foreground
* unsigned int *background
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_get_colour ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
unsigned int *foreground,
unsigned int *background
);
/*
* Name : scrolllist_set_colour
* Description : Sets the colours for the specified scrolllist.
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* unsigned int foreground
* unsigned int background
* Out : None
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_set_colour ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
unsigned int foreground,
unsigned int background
);
/*
* Name : scrolllist_get_item_text
* Description : Gets the text of the specified scrolllist item.
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* char *buffer
* int size
* int index
* Out : int *nbytes
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_get_item_text ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
char *buffer,
int size,
int index,
int *nbytes
);
/*
* Name : scrolllist_set_item_text
* Description : Sets the text of the specified scrolllist item.
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* char *new_text
* int index
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_set_item_text ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
char *new_text,
int index
);
/*
* Name : scrolllist_set_state
* Description : Sets the state of the specified scrolllist.
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* unsigned int state
* Out : None
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_set_state ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
unsigned int state
);
/*
* Name : scrolllist_get_state
* Description : Gets the state of the specified scrolllist.
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* Out : unsigned int *state
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_get_state ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
unsigned int *state
);
/*
* Name : scrolllist_add_item
* Description : Adds an item to the specified scrolllist
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* const char *text
* const void *sprite_area
* const char *sprite_name
* int index
* Out : None
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_add_item ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
const char *text,
const void *sprite_area,
const char *sprite_name,
int index
);
/*
* Name : scrolllist_delete_items
* Description : Deletes the items from the specified scrolllist
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* int start
* int end
* Out : None
* Returns : pointer to error block
*
* To be sent a ScrollList_Selection event after the function completes,
* set the ScrollList_SelectionChangingMethod_SendEvent bit of the flags.
* The event you receive merely notifies you of completion; the actual
* selection may not have changed. Note that an item number of '-1' will
* be present in the event received.
*/
extern _kernel_oserror *scrolllist_delete_items ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
int start,
int end
);
/*
* Name : scrolllist_get_selected
* Description : Gets the selected items from the specified scrolllist.
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* int offset
* Out : int *new_offset
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_get_selected ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
int offset,
int *new_offset
);
/*
* Name : scrolllist_make_visible
* Description : Forces the given item of the specified scrolllist to be visible.
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* int index
* Out : None
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_make_visible ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
int index
);
/*
* Name : scrolllist_deselect_item
* Description : Deselects the specified item from the specified scrolllist
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* int index
* Out : None
* Returns : pointer to error block
*
* To receive a ScrollList_Selection event indicating the item that
* was deselected with any mouse button related flags cleared, set the
* ScrollList_SelectionChangingMethod_SendEvent bit of the flags. This
* will be sent even if the item you specify was already deselected
* before the function call was made.
*
* To deselect all items, call with the flags bit
* ScrollList_SelectionChangingMethod_OnAll set. In this case, the value
* given in 'index' is irrelevant.
*/
extern _kernel_oserror *scrolllist_deselect_item ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
int index
);
/*
* Name : scrolllist_count_items
* Description : Returns the number of items in the scrolllist
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* unsigned int *items
* Out : None
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_count_items ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
unsigned int *items
);
#ifdef __cplusplus
}
#endif
#endif
/* Copyright 1997 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.
*/
/****************************************************************************
* This source file was written by Acorn Computers Limited. It is part of *
* the toolbox library for writing desktop applications in C. It may be *
* used freely in the creation of programs for Archimedes or Risc PC. It *
* should be used with Acorn's C Compiler Release 5 or later. *
* *
* *
* Copyright Acorn Computers Ltd, 1994 *
* *
***************************************************************************/
/*
* Name : scrollbar.h
* Description : C veneers to the Methods provided by the scrollbar gadget
*/
#ifndef __scrollbar_h
#define __scrollbar_h
#ifndef __kernel_h
#include "kernel.h"
#endif
#ifndef __toolbox_h
#include "toolbox.h"
#endif
#ifndef __window_h
#include "window.h"
#endif
/****************************************************************************
* ScrollBar Templates *
****************************************************************************/
/*-- flags --*/
#define Scrollbar_Vertical 0x00000000
#define Scrollbar_Horizontal 0x00000001
#define ScrollbarValidFlags 0xC0000001
/*-- templates --*/
typedef struct
{
GadgetHeader hdr;
int type;
int event;
unsigned int min;
unsigned int max;
unsigned int value;
unsigned int visible;
unsigned int line_inc;
unsigned int page_inc;
} Scrollbar;
/*-- ScrollBar methods --*/
#define Scrollbar_Base 0x401B
#define Scrollbar_Type (sizeof(Scrollbar)) << 16 | Scrollbar_Base
#define Scrollbar_SWIBase 0x140183
#define Scrollbar_GetState (Scrollbar_Base + 0)
#define Scrollbar_SetState (Scrollbar_Base + 1)
#define Scrollbar_SetBounds (Scrollbar_Base + 2)
#define Scrollbar_GetBounds (Scrollbar_Base + 3)
#define Scrollbar_SetValue (Scrollbar_Base + 4)
#define Scrollbar_GetValue (Scrollbar_Base + 5)
#define Scrollbar_SetIncrements (Scrollbar_Base + 6)
#define Scrollbar_GetIncrements (Scrollbar_Base + 7)
#define Scrollbar_SetEvent (Scrollbar_Base + 8)
#define Scrollbar_GetEvent (Scrollbar_Base + 9)
/*-- ScrollBar events --*/
#define Scrollbar_PositionChanged (Scrollbar_SWIBase)
typedef struct
{
ToolboxEventHeader hdr;
unsigned int new_position;
int direction;
} ScrollbarPositionChangedEvent;
/*-- Scrollbar SWI method constants --*/
#define Scrollbar_Lower_Bound (1<<0)
#define Scrollbar_Upper_Bound (1<<1)
#define Scrollbar_Visible_Len (1<<2)
#define Scrollbar_Line_Inc (1<<0)
#define Scrollbar_Page_Inc (1<<1)
/****************************************************************************
* The following functions provide veneers to the methods that are *
* associated with this particular class. Please read the C Release 5 *
* user guide for more detailed information on their functionality. *
****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Name : scrollbar_get_state
* Description : Gets the state of the specified scrollbar.
* In : unsigned int flags
* ObjectId window
* ComponentId scrollbar
* Out : unsigned int *state
* Returns : pointer to error block
*/
extern _kernel_oserror *scrollbar_get_state ( unsigned int flags,
ObjectId window,
ComponentId scrollbar,
unsigned int *state
);
/*
* Name : scrollbar_get_increments
* Description : Gets the increments for the specified scrollbar.
* In : unsigned int flags
* ObjectId window
* ComponentId scrollbar
* Out : unsigned int *line_inc
* unsigned int *page_inc
* Returns : pointer to error block
*/
extern _kernel_oserror *scrollbar_get_increments ( unsigned int flags,
ObjectId window,
ComponentId scrollbar,
unsigned int *line_inc,
unsigned int *page_inc
);
/*
* Name : scrollbar_set_increments
* Description : Sets the increments for the specified scrollbar.
* In : unsigned int flags
* ObjectId window
* ComponentId scrollbar
* unsigned int line_inc
* unsigned int page_inc
* Out : None
* Returns : pointer to error block
*/
extern _kernel_oserror *scrollbar_set_increments ( unsigned int flags,
ObjectId window,
ComponentId scrollbar,
unsigned int line_inc,
unsigned int page_inc
);
/*
* Name : scrollbar_get_bounds
* Description : Gets the bounds for the specified scrollbar.
* In : unsigned int flags
* ObjectId window
* ComponentId scrollbar
* Out : unsigned int *lower_bound
* unsigned int *upper_bound
* unsigned int *visible_len
* Returns : pointer to error block
*/
extern _kernel_oserror *scrollbar_get_bounds ( unsigned int flags,
ObjectId window,
ComponentId scrollbar,
unsigned int *lower_bound,
unsigned int *upper_bound,
unsigned int *visible_len
);
/*
* Name : scrollbar_set_bounds
* Description : Sets the bounds for the specified scrollbar.
* In : unsigned int flags
* ObjectId window
* ComponentId scrollbar
* unsigned int lower_bound
* unsigned int upper_bound
* unsigned int visible_len
* Out : None
* Returns : pointer to error block
*/
extern _kernel_oserror *scrollbar_set_bounds ( unsigned int flags,
ObjectId window,
ComponentId scrollbar,
unsigned int lower_bound,
unsigned int upper_bound,
unsigned int visible_len
);
/*
* Name : scrollbar_get_event
* Description : Gets the event returned by the specified scrollbar.
* In : unsigned int flags
* ObjectId window
* ComponentId scrollbar
* Out : unsigned int *event
* Returns : pointer to error block
*/
extern _kernel_oserror *scrollbar_get_event ( unsigned int flags,
ObjectId window,
ComponentId scrollbar,
unsigned int *event
);
/*
* Name : scrollbar_get_value
* Description : Gets the position of the specified scrollbar.
* In : unsigned int flags
* ObjectId window
* ComponentId scrollbar
* Out : unsigned int *value
* Returns : pointer to error block
*/
extern _kernel_oserror *scrollbar_get_value ( unsigned int flags,
ObjectId window,
ComponentId scrollbar,
unsigned int *value
);
/*
* Name : scrollbar_set_event
* Description : Sets the event generated by the specified scrollbar.
* In : unsigned int flags
* ObjectId window
* ComponentId scrollbar
* unsigned int event
* Out : None
* Returns : pointer to error block
*/
extern _kernel_oserror *scrollbar_set_event ( unsigned int flags,
ObjectId window,
ComponentId scrollbar,
unsigned int event
);
/*
* Name : scrollbar_set_value
* Description : Sets the scroll offset for the specified scrollbar.
* In : unsigned int flags
* ObjectId window
* ComponentId scrollbar
* unsigned int new_value
* Out : None
* Returns : pointer to error block
*/
extern _kernel_oserror *scrollbar_set_value ( unsigned int flags,
ObjectId window,
ComponentId scrollbar,
unsigned int new_value
);
/*
* Name : scrollbar_set_state
* Description : Sets the state of the specified scrollbar.
* In : unsigned int flags
* ObjectId window
* ComponentId scrollbar
* unsigned int state
* Out : None
* Returns : pointer to error block
*/
extern _kernel_oserror *scrollbar_set_state ( unsigned int flags,
ObjectId window,
ComponentId scrollbar,
unsigned int state
);
#ifdef __cplusplus
}
#endif
#endif
......@@ -18,14 +18,11 @@
#ifndef __SCROLLBARP_H
#define __SCROLLBARP_H
#include "modmem.h"
#include "Scrollbar.h"
typedef struct {
ObjectId object_id;
ComponentId component_id;
ObjectID object_id;
ComponentID component_id;
int parent_window; // 8 bytes
BBox box; // 12 bytes
wimp_Bbox box; // 12 bytes
int scrollbar_window;
int event;
int state;
......@@ -44,7 +41,7 @@ int scrollbar_active(void);
_kernel_oserror *scrollbar_die(void);
_kernel_oserror *_scrollbar_redraw(const PrivateScrollbar *sdata);
_kernel_oserror *scrollbar_add(Scrollbar *, int wimpw, ObjectId obj_id,
_kernel_oserror *scrollbar_add(Scrollbar *, int wimpw, ObjectID obj_id,
int **icons, int **data);
_kernel_oserror *scrollbar_method(PrivateScrollbar *handle, _kernel_swi_regs *regs);
_kernel_oserror *scrollbar_remove(PrivateScrollbar *handle);
......@@ -54,6 +51,6 @@ _kernel_oserror *scrollbar_plot(Scrollbar *);
_kernel_oserror *scrollbar_filter(_kernel_swi_regs *regs);
_kernel_oserror *scrollbar_move(PrivateScrollbar *sdata, BBox *box);
_kernel_oserror *scrollbar_move(PrivateScrollbar *sdata, wimp_Bbox *box);
#endif
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