From 81397a61945f43a08965a904447fe4a32580c43c Mon Sep 17 00:00:00 2001 From: ehouse Date: Thu, 23 Sep 2004 02:19:04 +0000 Subject: [PATCH] use Ftr for globals rather than gadget --- palm/palmutil.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/palm/palmutil.c b/palm/palmutil.c index 4e5b6f745..10e676adc 100644 --- a/palm/palmutil.c +++ b/palm/palmutil.c @@ -337,27 +337,22 @@ penInGadget( EventPtr event, UInt16* whichGadget ) return result; } /* penInGadget */ +#define GLOBALS_FEATURE 10 void setFormRefcon( void* refcon ) { - UInt16 index; - FormPtr form = FrmGetFormPtr( XW_MAIN_FORM ); - XP_ASSERT( !!form ); - index = FrmGetObjectIndex( form, REFCON_GADGET_ID ); - FrmSetGadgetData( form, index, refcon ); + Err err = FtrSet( APPID, GLOBALS_FEATURE, refcon ); + XP_ASSERT( err == errNone ); } /* setFormRefcon */ void* getFormRefcon() { - void* result = NULL; - FormPtr form = FrmGetFormPtr( XW_MAIN_FORM ); - - if ( !!form ) { - UInt16 index = FrmGetObjectIndex( form, REFCON_GADGET_ID ); - result = FrmGetGadgetData( form, index ); - } - return result; + UInt32 ptr; + Err err = FtrGet( APPID, GLOBALS_FEATURE, &ptr ); + XP_ASSERT( err == errNone ); + XP_ASSERT( ptr != 0L ); + return (void*)ptr; } /* getFormRefcon */ #endif