Gadget changes
Tom Hughes
tom at compton.nu
Sat Mar 4 22:40:48 GMT 2000
The attached patch changes all the toolbox gadgets to use the
new DefMod features to include an _Object structure that includes
the gadget header as well as the body.
Note that if you use this you will also need to make sure that
you rebuild gadget.h using the new DefMod. In fact it's probably
a good idea to rebuild all the C header files with the DefMod.
Tom
--
Tom Hughes (tom at compton.nu)
http://www.compton.nu/
...Live in the past and future only.
-------------- next part --------------
Index: ActionButton
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/ActionButton,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 ActionButton
*** ActionButton 2000/02/14 22:36:51 1.1.1.2
--- ActionButton 2000/03/04 21:13:06
***************
*** 12,17 ****
--- 12,23 ----
.Int: text_limit,
Toolbox_StringReference: click_show,
.Bits: action
+ ),
+ ActionButton_Object = .Struct: Gadget_Object
+ ( Toolbox_MsgReference: text,
+ .Int: text_limit,
+ Toolbox_StringReference: click_show,
+ .Bits: action
);
CONST
Index: Adjuster
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/Adjuster,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Adjuster
*** Adjuster 2000/02/14 22:36:10 1.1.1.1
--- Adjuster 2000/03/04 21:18:34
***************
*** 8,13 ****
--- 8,16 ----
TYPE
Adjuster_Gadget = .Struct
( .Int: reserved
+ ),
+ Adjuster_Object = .Struct: Gadget_Object
+ ( .Int: reserved
);
CONST
Index: Button
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/Button,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 Button
*** Button 2000/02/14 22:36:51 1.1.1.2
--- Button 2000/03/04 21:20:50
***************
*** 5,13 ****
CONST Class_Button = Toolbox_Class: 960;
! TYPE Button_Gadget = .Struct (.Bits: flags, Toolbox_MsgReference: value,
! .Int: value_limit, Toolbox_StringReference: validation,
! .Int: validation_limit);
CONST
Button_TaskSpriteArea = .Bits: 1,
--- 5,25 ----
CONST Class_Button = Toolbox_Class: 960;
! TYPE
! Button_Gadget = .Struct
! ( .Bits: flags,
! Toolbox_MsgReference: value,
! .Int: value_limit,
! Toolbox_StringReference: validation,
! .Int: validation_limit
! ),
! Button_Object = .Struct: Gadget_Object
! ( .Bits: flags,
! Toolbox_MsgReference: value,
! .Int: value_limit,
! Toolbox_StringReference: validation,
! .Int: validation_limit
! );
CONST
Button_TaskSpriteArea = .Bits: 1,
Index: DisplayField
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/DisplayField,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 DisplayField
*** DisplayField 2000/02/14 22:36:10 1.1.1.1
--- DisplayField 2000/03/04 21:15:57
***************
*** 10,15 ****
--- 10,20 ----
.Struct
( Toolbox_MsgReference: text,
.Int: text_limit
+ ),
+ DisplayField_Object =
+ .Struct: Gadget_Object
+ ( Toolbox_MsgReference: text,
+ .Int: text_limit
);
CONST
Index: Draggable
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/Draggable,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Draggable
*** Draggable 2000/02/14 22:36:10 1.1.1.1
--- Draggable 2000/03/04 21:21:56
***************
*** 1,13 ****
TITLE Draggable;
AUTHOR "Jonathan Coxhead, jonathan at doves.demon.co.uk, 5 Sept 1995";
! NEEDS Toolbox, Window;
CONST Class_Draggable = Toolbox_Class: 640;
TYPE
Draggable_Gadget =
.Struct
( Toolbox_MsgReference: text,
.Int: text_limit,
Toolbox_StringReference: sprite_name,
--- 1,20 ----
TITLE Draggable;
AUTHOR "Jonathan Coxhead, jonathan at doves.demon.co.uk, 5 Sept 1995";
! NEEDS Toolbox, Gadget, Window;
CONST Class_Draggable = Toolbox_Class: 640;
TYPE
Draggable_Gadget =
.Struct
+ ( Toolbox_MsgReference: text,
+ .Int: text_limit,
+ Toolbox_StringReference: sprite_name,
+ .Int: sprite_limit
+ ),
+ Draggable_Object =
+ .Struct: Gadget_Object
( Toolbox_MsgReference: text,
.Int: text_limit,
Toolbox_StringReference: sprite_name,
Index: Label
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/Label,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Label
*** Label 2000/02/14 22:36:10 1.1.1.1
--- Label 2000/03/04 21:24:15
***************
*** 8,13 ****
--- 8,16 ----
TYPE
Label_Gadget = .Struct
( Toolbox_MsgReference: label
+ ),
+ Label_Object = .Struct: Gadget_Object
+ ( Toolbox_MsgReference: label
);
CONST
Index: LabelledBox
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/LabelledBox,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 LabelledBox
*** LabelledBox 2000/02/14 22:36:10 1.1.1.1
--- LabelledBox 2000/03/04 21:16:26
***************
*** 8,13 ****
--- 8,16 ----
TYPE
LabelledBox_Gadget = .Struct
( Toolbox_MsgReference: label
+ ),
+ LabelledBox_Object = .Struct: Gadget_Object
+ ( Toolbox_MsgReference: label
);
CONST
Index: NumberRange
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/NumberRange,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 NumberRange
*** NumberRange 2000/02/14 22:36:10 1.1.1.1
--- NumberRange 2000/03/04 21:23:14
***************
*** 5,13 ****
CONST Class_NumberRange = Toolbox_Class: 832;
! TYPE NumberRange_Gadget = .Struct (.Int: lower_bound, .Int: upper_bound,
! .Int: step_size, .Int: initial_value, .Int: precision,
! Toolbox_C: prev, Toolbox_C: next, .Int: display_length);
CONST
NumberRange_GenerateValueChanged = Gadget_Flags: 0x00000001,
--- 5,31 ----
CONST Class_NumberRange = Toolbox_Class: 832;
! TYPE
! NumberRange_Gadget = .Struct
! ( .Int: lower_bound,
! .Int: upper_bound,
! .Int: step_size,
! .Int: initial_value,
! .Int: precision,
! Toolbox_C: prev,
! Toolbox_C: next,
! .Int: display_length
! ),
! NumberRange_Object = .Struct: Gadget_Object
! ( .Int: lower_bound,
! .Int: upper_bound,
! .Int: step_size,
! .Int: initial_value,
! .Int: precision,
! Toolbox_C: prev,
! Toolbox_C: next,
! .Int: display_length
! );
CONST
NumberRange_GenerateValueChanged = Gadget_Flags: 0x00000001,
Index: OptionButton
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/OptionButton,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 OptionButton
*** OptionButton 2000/02/14 22:36:10 1.1.1.1
--- OptionButton 2000/03/04 21:24:37
***************
*** 11,16 ****
--- 11,21 ----
( Toolbox_MsgReference: label,
.Int: label_limit,
.Bits: action
+ ),
+ OptionButton_Object = .Struct: Gadget_Object
+ ( Toolbox_MsgReference: label,
+ .Int: label_limit,
+ .Bits: action
);
SWI
Index: PopUp
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/PopUp,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 PopUp
*** PopUp 2000/02/14 22:36:10 1.1.1.1
--- PopUp 2000/03/04 21:16:56
***************
*** 8,13 ****
--- 8,16 ----
TYPE
PopUp_Gadget = .Struct
( Toolbox_StringReference: menu_name
+ ),
+ PopUp_Object = .Struct: Gadget_Object
+ ( Toolbox_StringReference: menu_name
);
CONST
Index: RadioButton
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/RadioButton,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 RadioButton
*** RadioButton 2000/02/14 22:36:10 1.1.1.1
--- RadioButton 2000/03/04 21:17:20
***************
*** 12,17 ****
--- 12,23 ----
Toolbox_MsgReference: label,
.Int: label_limit,
.Bits: action
+ ),
+ RadioButton_Object = .Struct: Gadget_Object
+ ( .Int: group,
+ Toolbox_MsgReference: label,
+ .Int: label_limit,
+ .Bits: action
);
CONST
Index: ScrollList
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/ScrollList,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 ScrollList
*** ScrollList 2000/02/14 22:37:36 1.1.1.2
--- ScrollList 2000/03/04 22:37:20
***************
*** 17,22 ****
--- 17,28 ----
( .Int: event,
OS_Colour: foreground,
OS_Colour: background
+ ),
+ ScrollList_Object =
+ .Struct: Gadget_Object
+ ( .Int: event,
+ OS_Colour: foreground,
+ OS_Colour: background
);
CONST
Index: Scrollbar
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/Scrollbar,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 Scrollbar
*** Scrollbar 2000/02/14 22:37:36 1.1.1.2
--- Scrollbar 2000/03/04 21:17:53
***************
*** 20,25 ****
--- 20,36 ----
.Int: visible_length,
.Int: line_increment,
.Int: page_increment
+ ),
+ Scrollbar_Object =
+ .Struct: Gadget_Object
+ ( .Int: type,
+ .Int: event,
+ .Int: lower_bound,
+ .Int: upper_bound,
+ .Int: value,
+ .Int: visible_length,
+ .Int: line_increment,
+ .Int: page_increment
);
CONST
Index: Slider
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/Slider,v
retrieving revision 1.2
diff -c -r1.2 Slider
*** Slider 2000/03/04 16:45:42 1.2
--- Slider 2000/03/04 21:23:44
***************
*** 12,17 ****
--- 12,24 ----
.Int: upper_bound,
.Int: step_size,
.Int: initial_value
+ ),
+ Slider_Object =
+ .Struct: Gadget_Object
+ ( .Int: lower_bound,
+ .Int: upper_bound,
+ .Int: step_size,
+ .Int: initial_value
);
CONST
Index: StringSet
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/StringSet,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 StringSet
*** StringSet 2000/02/14 22:36:10 1.1.1.1
--- StringSet 2000/03/04 22:32:54
***************
*** 5,15 ****
CONST Class_StringSet = Toolbox_Class: 896;
! TYPE StringSet_Gadget = .Struct (Toolbox_MsgReference: string_set,
Toolbox_MsgReference: title,
Toolbox_MsgReference: initial_selected_string,
! .Int: selected_string_limit, Toolbox_MsgReference: allowable,
! .Int: allowable_limit, Toolbox_C: prev, Toolbox_C: next);
CONST
StringSet_GenerateUserValueChanged = Gadget_Flags: 0x00000001,
--- 5,31 ----
CONST Class_StringSet = Toolbox_Class: 896;
! TYPE
! StringSet_Gadget = .Struct
! ( Toolbox_MsgReference: string_set,
Toolbox_MsgReference: title,
Toolbox_MsgReference: initial_selected_string,
! .Int: selected_string_limit,
! Toolbox_MsgReference: allowable,
! .Int: allowable_limit,
! Toolbox_C: prev,
! Toolbox_C: next
! ),
! StringSet_Object = .Struct: Gadget_Object
! ( Toolbox_MsgReference: string_set,
! Toolbox_MsgReference: title,
! Toolbox_MsgReference: initial_selected_string,
! .Int: selected_string_limit,
! Toolbox_MsgReference: allowable,
! .Int: allowable_limit,
! Toolbox_C: prev,
! Toolbox_C: next
! );
CONST
StringSet_GenerateUserValueChanged = Gadget_Flags: 0x00000001,
Index: TextArea
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/TextArea,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 TextArea
*** TextArea 2000/02/14 22:37:15 1.1.1.1
--- TextArea 2000/03/04 21:18:16
***************
*** 17,22 ****
--- 17,30 ----
.Ref .String: text,
OS_Colour: foreground,
OS_Colour: background
+ ),
+ TextArea_Object =
+ .Struct: Gadget_Object
+ ( .Int: type,
+ .Int: event,
+ .Ref .String: text,
+ OS_Colour: foreground,
+ OS_Colour: background
);
TYPE
Index: WritableField
===================================================================
RCS file: /home/cvs/riscos/oslib/Source/Toolbox/WritableField,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 WritableField
*** WritableField 2000/02/14 22:36:10 1.1.1.1
--- WritableField 2000/03/04 22:33:46
***************
*** 5,13 ****
CONST Class_WritableField = Toolbox_Class: 0x200;
! TYPE WritableField_Gadget = .Struct (Toolbox_MsgReference: text,
! .Int: text_limit, Toolbox_MsgReference: allowable, .Int: allowable_limit,
! Toolbox_C: prev, Toolbox_C: next);
CONST
WritableField_GenerateUserValueChanged = .Bits: 0x1,
--- 5,27 ----
CONST Class_WritableField = Toolbox_Class: 0x200;
! TYPE
! WritableField_Gadget = .Struct
! ( Toolbox_MsgReference: text,
! .Int: text_limit,
! Toolbox_MsgReference: allowable,
! .Int: allowable_limit,
! Toolbox_C: prev,
! Toolbox_C: next
! ),
! WritableField_Object = .Struct: Gadget_Object
! ( Toolbox_MsgReference: text,
! .Int: text_limit,
! Toolbox_MsgReference: allowable,
! .Int: allowable_limit,
! Toolbox_C: prev,
! Toolbox_C: next
! );
CONST
WritableField_GenerateUserValueChanged = .Bits: 0x1,
More information about the oslib-team
mailing list