COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	Copyright (c) Geoworks 1994 -- All Rights Reserved

PROJECT:	Interface Gadgets
MODULE:		Gadgets
FILE:		gadgets.def

AUTHOR:		Skarpi Hedinsson, Jun 24, 1994

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	SH	6/24/94   	Initial revision
   	PB	9/29/94		Added BatteryIndicatorClass definitions


DESCRIPTION:
	This file contains the definition of the Gadgets library.
		
	$Id: gadgets.def,v 1.1 97/04/04 14:20:01 newdeal Exp $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@

SetDef __GADGETS

StartLibrary	gadgets

include localize.def

;-----------------------------------------------------------------------------
;		Structures
;-----------------------------------------------------------------------------

DateTimeBuffer		type	 DATE_TIME_BUFFER_SIZE dup (char)

DateStruct	struct
	DT_year		word
	DT_month	byte			; month (1..12)
	DT_day		byte			; day of month (1..31)
	DT_weekday	byte			; day of week (0..6)
	DT_week		byte			; week of year (0..52)
DateStruct	ends

TimeStruct	struct
	T_hours		byte
	T_minutes	byte
	T_seconds	byte
TimeStruct	ends

StopwatchStruct	struct
	SW_hours	byte
	SW_minutes	byte
	SW_seconds	byte
	SW_tenths	byte			; tenths of seconds
StopwatchStruct	ends

DSYearTextFormat	etype	word, 0
DSYTF_APPEND	enum	DSYearTextFormat
DSYTF_PREPEND	enum	DSYearTextFormat

;******************************************************************************
;		DateSelectorClass
;******************************************************************************

DateSelectorClass	class	GenControlClass

;-----------------------------------------------------------------------------
;		Messages
;-----------------------------------------------------------------------------

MSG_DATE_SELECTOR_GET_DATE	message
;
; Get the current date from the DateSelector.  The date you get back depends
; on what type (DSI_dateType) the DateSelector is.
;
; PASS:		nothing
; RETURN:	cx	= year
;       	dl	= month
;       	dh	= day of month
;       	bp	= day of week
; DESTROYED:	dl
;	

MSG_DATE_SELECTOR_SET_DATE	message
;
; Set the current date of the DateSelector.  The day of week is calculated from
; the given date. Sending this message will result in the action
; message being sent out after the new date is set.
;
; PASS:		cx	= year
;		dl	= month
;		dh	= day of month
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_DATE_SELECTOR_SET_WEEKDAY	message
;
; Sets the day of week of the selector.  Only valid in DST_WEEK or
; DST_SHORT_WEEK mode.
;
; PASS:		cl	= day of week (0 = Sunday .. 6 = Saturday)
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_DATE_SELECTOR_GET_WEEKDAY		message
;
; Gets the day of week of the selector.  Only valid in DST_WEEKDAY or
; DST_SHORT_WEEKDAY mode.
;
; PASS:		nothing
; RETURN:	cl	= day of week (0 = Sunday .. 6 = Saturday)
; DESTROYED:	nothing
;

MSG_DATE_SELECTOR_SET_YEAR_TEXT		message
;
; This message is sent as a response to MSG_DATE_SELECTOR_REPLACE_YEAR_TEXT.
; Using this message you can format a text string to be included with the
; year when DSI_dateType is DST_YEAR_TEXT.
;
; The DSYearTextFormat indicates if the text should be appended or prepended
; to the year.  Remember you can set the width of the text field with
; GSI_textWidth.  The text is centered in the text field.
;	
; For example:
;		1994 - The Year of the Dragon	(appended)
;		Calendar for 1994		(prepended)
;
; PASS:		cx	= DSYearTextFormat
;		dx:bp	= fptr to a null-terminated string containing the text
;		          to append or prepend to the year.
;		  	  (size of dx:bp plus year (1994, 94) should not exceed
;		  	  size DateTimeBuffer.)
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_DATE_SELECTOR_SET_DATE_TYPE		message
;
; Changes the format of the displayed date.  Forces object to redraw itself.
;
; PASS:		cx	= new DateSelectorType
; RETURN:	nothing
; DESTROYED:	nothing
;

;-----------------------------------------------------------------------------
;		INTERNAL messages
;-----------------------------------------------------------------------------

MSG_DS_DATE_INC			message
;
; Tells the controller that the date has been incremented.
;
; PASS:		nothing
; RETURN:	nothing
;

MSG_DS_DATE_DEC			message
;
; Tells the controller that the date has been decremented.
;
; PASS:		nothing
; RETURN:	nothing
;

;-----------------------------------------------------------------------------
;		Messages sent out
;-----------------------------------------------------------------------------

MSG_DATE_SELECTOR_REPLACE_YEAR_TEXT	message MetaApplicationMessages
;
; Sent out by the date selector (to DSI_destination) if the DateSelectorType
; is DST_YEAR_TEXT.  The response to the this message is to send a
; MSG_DATE_SELECTOR_SET_YEAR_TEXT to the DateSelector.
;
; PASS:		^lcx:dx	= DateSelectorClass object
;		bp	= year
; RETURN:	nothing
; DESTORYED:	nothing
;

;-----------------------------------------------------------------------------
;		Hints
;-----------------------------------------------------------------------------

HINT_DATE_SELECTOR_DRAW_FRAME			vardata
	;
	; Draw a frame around the text, if possible.
	; This is done by setting HINT_TEXT_FRAME on the GenText object.
	; 

protominor NewFocusProtocol

HINT_DATE_SELECTOR_NOT_FOCUSABLE		vardata
	;
	; If present, then hotkeys and keyboard navigation will never
	; put the focus on this object
	;

TEMP_DATE_SELECTOR_HAS_FOCUS			vardata
	;
	; This is put on the object when it has the system
	; focus.  It prevents having to query for the system focus
	; and compare it against itself.
	;

protoreset

;-----------------------------------------------------------------------------
;		Constants & Structures
;-----------------------------------------------------------------------------

; Features flags (used with ATTR_GEN_CONTROL_REQUIRE_UI and
; ATTR_GEN_CONTROL_PROHIBIT_UI)

DSFeatures	record
    DSF_DATE:1
DSFeatures	end

DS_DEFAULT_FEATURES		equ	mask DSFeatures

;-----------------------------------------------------------------------------
;		Instance Data Structures
;-----------------------------------------------------------------------------

DateSelectorType	etype	word, 0
DST_LONG_CONDENSED_DATE	enum	DateSelectorType	; Fri, 22 Apr, 1994
DST_LONG_DATE		enum	DateSelectorType	; Friday, 22 April, 19
DST_SHORT_DATE		enum	DateSelectorType	; 4/22/94
DST_ZPADDED_SHORT_DATE	enum	DateSelectorType	; 04/06/94
DST_WEEK		enum	DateSelectorType	; Week 16
DST_WEEK_YEAR		enum	DateSelectorType	; Week 16, 1994
DST_MONTH		enum	DateSelectorType	; April
DST_SHORT_MONTH		enum	DateSelectorType	; Apr
DST_MONTH_YEAR		enum	DateSelectorType	; April 1994
DST_SHORT_MONTH_YEAR	enum	DateSelectorType	; Apr 1994
DST_SHORT_MONTH_SHORT_YEAR enum DateSelectorType	; Apr 94
DST_YEAR		enum	DateSelectorType	; 1994
DST_YEAR_TEXT		enum	DateSelectorType	; 1994 Your_text_here
DST_WEEKDAY		enum	DateSelectorType	; Saturday
DST_SHORT_WEEKDAY	enum	DateSelectorType	; Sat

;-----------------------------------------------------------------------------
;		Instance Data
;-----------------------------------------------------------------------------

	DSI_date		DateStruct		<1995,1,1,0,0>
		; Holds the current date of the DateSelector
		
	DSI_dateType		DateSelectorType	DST_LONG_CONDENSED_DATE
		; Allows you to specify what type of date to display.
		; See DateSelectorType for the various options.

	DSI_textWidth		word			0
		; The width of the GenText containing the date.  This is
		; measured in standard character widths.  Default is 0 in
		; which case the size is predefined.

if 0
	NOTE: Use GCI_Output instead.
	DSI_destination		optr
		; The destination for messages sent out by this object.
endif

	DSI_actionMsg		word
		; The message to be sent out (to GCI_output) when the date 
		; has changed.  This happens if the users presses the 
		; increment/decrement triggers or a 
		; MSG_DATE_SELECTOR_SET_DATE is received.
		;
		; PASS:		cx	= year
		;		dl	= month (1 .. 12)
		;		dh	= day of month (1 .. 31)
		;		bp	= day of week (0 .. 6)
		; RETURN:	nothing
		; MAY DESTROY:	ax, cx, dx, bp
				
DateSelectorClass	endc

;******************************************************************************
;		DateInputClass
;******************************************************************************

DateInputClass	class	GenControlClass

;-----------------------------------------------------------------------------
;		Messages
;-----------------------------------------------------------------------------

MSG_DATE_INPUT_GET_DATE	message
;
; Get the current date from the DateInput.
;
; PASS:		nothing
; RETURN:	cx	= year
;       	dl	= month
;       	dh	= day of month
;       	bp	= day of week
; DESTROYED:	nothing
;	

MSG_DATE_INPUT_SET_DATE	message
;
; Set the current date of the DateInput.  This will result in the action
; message be sent out after the new date is set.  The day of the week will
; be calculated.
;
; PASS:		cx	= year
;       	dl	= month
;		dh	= day of month
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_DATE_INPUT_SET_CURRENT_DATE	message
;
; Set the date of the DateInput to the current system date.  This will result 
; in the action message be sent out after the new date is set.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_DATE_INPUT_REDISPLAY_DATE		message
;
; Forces the date to be redisplayed in the current format.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

;-----------------------------------------------------------------------------
;		Internal messages
;-----------------------------------------------------------------------------

MSG_DI_DATE_INC			message
;
; Tells the controller that the date has been incremented.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_DI_DATE_DEC			message
;
; Tells the controller that the date has been decremented.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_DI_PARSE_DATE_STRING	message
;
; Parses the date string in the GenText and stores the values in DII_date.
;
; PASS:		nothing
; RETURN:	carry set if string not valid
; DESTROYED:	nothing
;

MSG_DI_TEXT_APPLY	message
;
; Handle apply msg from interal text object.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
; 

;-----------------------------------------------------------------------------
;		Constants & Structures
;-----------------------------------------------------------------------------

; Features flags (used with ATTR_GEN_CONTROL_REQUIRE_UI and
; ATTR_GEN_CONTROL_PROHIBIT_UI).

DIFeatures	record
    DIF_DATE:1
DIFeatures	end

DI_DEFAULT_FEATURES		equ	mask DIFeatures

;-----------------------------------------------------------------------------
;		Instance Data
;-----------------------------------------------------------------------------
	DII_date		DateStruct	<1995, 1, 1, 0, 0>
		; Holds the current date of the DateSelector

	DII_actionMsg		word
		; The message to be sent out (to GCI_output) when the date 
		; has changed.  This happens if the users presses the 
		; increment/decrement triggers or a 
		; MSG_DATE_INPUT_SET_DATE is received.
		;
		; PASS:		cx	= year
		;		dl	= month
		;		dh	= day of month
		;		bp	= day of week
		; RETURN:	nothing
		; MAY DESTROY:	ax, cx, dx, bp
		;

;------------------------------------------------------------------------------
;		Hints
;------------------------------------------------------------------------------

ATTR_DATE_INPUT_TARGETABLE	vardata
;
; Make the text part of the object targetable. 

				
DateInputClass	endc

;******************************************************************************
;		TimeInputClass
;******************************************************************************

TimeInputClass	class	GenControlClass

;-----------------------------------------------------------------------------
;		Messages
;-----------------------------------------------------------------------------

MSG_TIME_INPUT_GET_TIME	message
;
; Get the current time from the TimeInput.
;
; PASS:		nothing
; RETURN:	ch	= hours (0 .. 23)
;       	dl	= minutes (0 .. 59)
;       	dh	= seconds (0 .. 59)
; DESTROYED:	cl
;	

MSG_TIME_INPUT_SET_TIME	message
;
; Set the current time of the TimeInput.  This will result in the action
; message be sent out after the new time is set.
;
; PASS:		ch	= hours (0 through 23)
;		dl	= minutes (0 through 59)
;		dh	= seconds (0 through 59)
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_TIME_INPUT_SET_CURRENT_TIME	message
;
; Set the time of the TimeInput to the current system time.  This will result 
; in the action message be sent out after the new time is set.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_TIME_INPUT_GET_INCREMENT_VALUE	message
;
; Returns the TII_incrementValue used when incrementing or decrementing the
; time.
;
; PASS:		nothing
; RETURN:	cx	= increment value
; DESTROYED:	nothing
;

MSG_TIME_INPUT_SET_INCREMENT_VALUE	message
;
; Sets the TII_incrementValue used when incrementing or decrementing the
; time.
;
; PASS:		cx	= increment value
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_TIME_INPUT_REDISPLAY_TIME		message
;
; Forces the time to be redisplayed in the current format.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

;-----------------------------------------------------------------------------
;		Internal messages
;-----------------------------------------------------------------------------

MSG_TI_TIME_INC			message
;
; Tells the controller that the time has been incremented.  Uses
; TII_incrementValue.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_TI_TIME_DEC			message
;
; Tells the controller that the time has been decremented. Uses
; TII_incrementValue.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_TI_TIME_ALT_INC			message
;
; Tells the controller that the time has been incremented.  Uses
; TII_incrementAltValue.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_TI_TIME_ALT_DEC			message
;
; Tells the controller that the time has been decremented. Uses
; TII_incrementAltValue.
;
; PASS:		nothing
; RETURN:	nothing
; DESTORYED:	nothing
;

MSG_TI_PARSE_TIME_STRING	message
;
; Parses the time string in TIText and stores the time in TII_time.
;
; PASS:		nothing
; RETURN:	carry set if string not valid
; DESTROYED:	nothing
;

MSG_TI_TEXT_APPLY	message
;
; Respond to internal text object's apply message.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

;-----------------------------------------------------------------------------
;		Constants & Structures
;-----------------------------------------------------------------------------

; Features flags (used with ATTR_GEN_CONTROL_REQUIRE_UI and
; ATTR_GEN_CONTROL_PROHIBIT_UI)

TIFeatures	record
    TIF_DATE:1
TIFeatures	end

TI_DEFAULT_FEATURES		equ	mask TIFeatures

;-----------------------------------------------------------------------------
;		Instance Data Structures
;-----------------------------------------------------------------------------

TimeInputType		etype		word, 0
TIT_TIME_OF_DAY	  	enum		TimeInputType
; To input time of day (0-9,.:;ampAMP).

TIT_TIME_INTERVAL	enum		TimeInputType
; To input time intervals (0-9,.:;).

TIT_TIME_OFFSET		enum		TimeInputType
; To input time offsets, such as gmt offset. (-,0-9,.:;).

;-----------------------------------------------------------------------------
;		Instance Data
;-----------------------------------------------------------------------------

	TII_time		TimeStruct	<0, 0, 0>
		; Holds the current time of the TimeInput

	TII_incrementValue	word		5
		; Holds the number of minutes to increment or decrement when
		; using MSG_TI_TIME_DEC/INC.

	TII_incrementAltValue	word		1
		; Holds the number of minutes to increment or decrement when
		; using MSG_TI_TIME_ALT_DEC/INC.
	
	TII_timeType		TimeInputType	TIT_TIME_OF_DAY
		; What type of input gadget is this.  The default is
		; TIT_timeOfDay which allows AM/PM.

	TII_actionMsg		word		0
		; The message to be sent out (to GCI_output) when the time 
		; has changed.  This happens if the users presses the 
		; increment/decrement triggers, a MSG_TIME_INPUT_SET_TIME 
		; is received or the user inputed a new time using keyboard
		; or ink.
		;
		; Pass:		ch - hours
		;		dl - minutes
		;		dh - seconds
		; Return:	nothing
		;		ax, cx, dx, bp -- destroyed

	TII_ampmMode		BooleanWord	BB_FALSE
		; INTERNAL: set to non-zero if we're in AM/PM mode.

;------------------------------------------------------------------------------
;		Hints
;------------------------------------------------------------------------------

ATTR_TIME_INPUT_DISPLAY_STRING_WHEN_EMPTY	vardata		optr
;
; Draws string whenever the text part of the object becomes empty.
;
; ATTR_TIME_INPUT_DISPLAY_STRING_WHEN_EMPTY {
;	word	offset MyString
;	word	handle MyString
; }

ATTR_TIME_INPUT_TARGETABLE	vardata
;
; Make the text part of the object targetable. 

ATTR_DONT_SEND_APPLY_MSG_ON_TEXT_LOST_FOCUS	vardata
;
; The default behavior in TimeInputClass is to send TII_actionMsg when it
; receives MSG_META_TEXT_LOST_FOCUS (ie. when the text object in the child
; block loses focus).  With this hint, the action message is not sent on
; losing focus.  This hint is useful when we want the apply message to be
; sent only when we receive MSG_GEN_APPLY, e.g. when the controller appears
; as a dialog with an OK button.
;
				
TimeInputClass	endc

;******************************************************************************
;		TimerClass
;******************************************************************************

TimerClass	class	GenControlClass

;-----------------------------------------------------------------------------
;		Messages
;-----------------------------------------------------------------------------

MSG_TIMER_GET_TIME		message
;
; Get the current time from the TimerClass object.
;
; PASS:		nothing
; RETURN:	ch	= hours (0 through 23)
;		dl	= minutes (0 through 59)
;		dh	= seconds (0 through 59)
;		bp	= 1/10 sec.
; DESTROYED:	nothing
;	

MSG_TIMER_SET_TIME		message
;
; Set the time that the object currently displays.  If the timer is
; running when the message is received, the timer will start
; counting from the passed value.  1/10 seconds are always set to
; zero by this method.
;
; PASS:		ch	= hours (0 .. 23)
;		dl	= minutes (0 .. 59)
;		dh	= seconds (0 .. 59)
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_TIMER_SET_COUNTDOWN_TIME	message
;
; Set the countdown time of the timer.
; 
; PASS:		ch	= hours (0 through 23)
;		dl	= minutes (0 through 59)
;		dh	= seconds (0 through 59)
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_TIMER_GET_COUNTDOWN_TIME	message
;
; Get the countdown time of the timer.
; 
; PASS:		nothing
; RETURN:	ch	= hours (0 through 23)
;		dl	= minutes (0 through 59)
;		dh	= seconds (0 through 59)
; DESTROYED:	nothing
;

MSG_TIMER_RESET			message
;
; Tells the controller to reset the timer to 0.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_TIMER_START_STOP		message
;
; Tells the controller to toggle the timer on/off.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

;-----------------------------------------------------------------------------
;		Internal messages
;-----------------------------------------------------------------------------

MSG_TIMER_UPDATE		message
;
; Sent every 1/10 sec. to update the timer.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	nothing
;

;-----------------------------------------------------------------------------
;		Constants & Structures
;-----------------------------------------------------------------------------

; Features flags (used with ATTR_GEN_CONTROL_REQUIRE_UI and
; ATTR_GEN_CONTROL_PROHIBIT_UI).

TMFeatures	record
    TMF_TIME:1
TMFeatures	end

TM_DEFAULT_FEATURES		equ	mask TMFeatures

TimerStyle	etype	word, 0

TS_COUNTDOWN	enum	TimerStyle
; This sort of timer counts down from the countdown value.

TS_STOPWATCH	enum	TimerStyle
; This sort of timer counts upwards.

;-----------------------------------------------------------------------------
;		Instance Data Structures
;-----------------------------------------------------------------------------

TimerActionType	etype	word, 0

TAT_START	enum	TimerActionType
; When timer started

TAT_STOP	enum	TimerActionType
; When timer stopped

TAT_RESET	enum	TimerActionType
; When timer reset

TAT_ZERO	enum	TimerActionType
; ONLY SENT TO TS_COUNTDOWN objects (when timer reaches zero)

TAT_NO_TIME	enum	TimerActionType
; ONLY SENT TO TS_COUNTDOWN objects (timer started w/countdown == 0)


;-----------------------------------------------------------------------------
;		Instance Data
;-----------------------------------------------------------------------------
	TI_timerHandle		hptr
		; INTERNAL
		; Holds the handle of the stopwatch timer.

	TI_time			StopwatchStruct
		; Holds the current time of the timer.

	TI_countdownTime	StopwatchStruct
		; Holds the countdown value of the timer.

	TI_actionMsg		word
		; The message to be sent out (to GCI_output) when the watch 
		; started/stopped, reset or reaches zero.
		;
		; PASS:		cx	= TimerActionType
		; RETURN:	nothing
		; MAY DESTROY:	ax, cx, dx, bp

	TI_style		TimerStyle	TS_COUNTDOWN
		; This determines whether the timer counts up or down.

	TI_startCount		dword
		; system counter the last time we checked it 

	TI_remainder		word
		; = remainder ((count1-count2)/6)
					
TimerClass	endc


;******************************************************************************
;		RepeatTriggerClass
;******************************************************************************

RepeatTriggerClass	class	GenTriggerClass

;-----------------------------------------------------------------------------
;		Messages
;-----------------------------------------------------------------------------

MSG_REPEAT_TRIGGER_GET_REPEAT_RATE	message
;
; The repeat trigger sends this to itself to get the repeat rate to use when
; the user holds down the increment/decrement button.  You can subclass this
; to get the repeat rate you want for your trigger. Faster rates are desireable
; for large ranges.  The number of repeats is passed and may be useful.
;
; PASS:		cx	= number of repeats so far
; RETURN:	cx	= repeat rate
; DESTROYED:	ax, dx, bp
;

;-----------------------------------------------------------------------------
;		Internal messages
;-----------------------------------------------------------------------------

MSG_RT_REPEAT_ACTION	message
;
; Send a MSG_GEN_TRIGGER_SEND_ACTION on a timer click.
;
; PASS:		nothing
; RETURN:	nothing
; DESTROYED:	cx, dx, bp
;

;-----------------------------------------------------------------------------
;		Instance Data
;-----------------------------------------------------------------------------

	RTI_timerHandle		hptr		0
		; INTERNAL
		; Holds the handle of the trigger timer.

	RTI_timerID		word		0
		; INTERNAL
		; Holds the ID of the trigger timer.

	RTI_repeatCount		word		0
		; INTERNAL
		; Holds the repeat count 
	
	RTI_repeatRate		word		10
		; Holds the time interval the trigger is repeated by. 

	RTI_accelerate		byte		1
		; If TRUE then the repeat rate will accelerate as the
		; trigger is held down.  This is the default.

;--------------------------------
;	Vardata
;--------------------------------

	HINT_REPEAT_TRIGGER_NOT_FOCUSABLE vardata
	;
	; Don't allow keyboard focus to reach this object.
	;
				
RepeatTriggerClass	endc


;******************************************************************************
BatteryIndicatorClass	class	GenGlyphClass
;******************************************************************************

;
; This object appears as a small alkaline battery.  It reflects the state
; of the computer's internal battery by filling in the drawn battery with
; black.
;

;********************************
;	Messages
;********************************

MSG_BATTERY_SET_LIFE				message
;
; INTERNAL USE ONLY.
;
; Set a new value for the battery life.  Do a visual update of our
; battery indicator moniker if the new value is different from the old
; one.
;
; PASS:		cx	= new battery life (0..100)
; RETURN:	nothing
; DESTROYED:	nothing
;

MSG_BATTERY_FIND_SET_LIFE			message
;
; INTERNAL USE ONLY.
;
; Call the power driver to get the current battery life and set ourselves
; to this value.
;
; PASS:		nothing
; RETURN:	nothing
; DESTORYED:	nothing
;

;********************************
;	Exported Types
;********************************

;----------------------------------------------------------------
	BatteryOrientationType		etype	word, 0, 2
;----------------------------------------------------------------

;
; Describes how the battery glpyh should be drawn.
;

BOT_VERTICAL		enum	BatteryOrientationType
BOT_HORIZONTAL		enum	BatteryOrientationType
BOT_LONG_HORIZONTAL	enum	BatteryOrientationType

;********************************
;	Instance Data
;********************************

BII_orientation			BatteryOrientationType	BOT_HORIZONTAL
; How the battery should be drawn.

;****************************************************************
;	Instance Data for INTERNAL USE ONLY
;****************************************************************

BII_life			word		-1
; Percentage of battery life left (0..100).  This will be set in
; MSG_VIS_OPEN.

BII_timerHan			word		
BII_timerID			word
BII_mixModeClear		MixMode		MM_CLEAR

BatteryIndicatorClass	endc

EndLibrary	gadgets
