2003-11-16 20:37:12 +01:00
|
|
|
// -*-mode: C; fill-column: 78; c-basic-offset: 4; -*-
|
|
|
|
/****************************************************************************
|
|
|
|
* *
|
2006-01-08 02:25:02 +01:00
|
|
|
* Copyright 1998-1999, 2001 by Eric House (xwords@eehouse.org). All rights reserved. *
|
2003-11-16 20:37:12 +01:00
|
|
|
* *
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _PALMUTIL_H_
|
|
|
|
#define _PALMUTIL_H_
|
|
|
|
|
|
|
|
#include <PalmTypes.h>
|
|
|
|
#include <List.h>
|
|
|
|
/* #include <Window.h> */
|
|
|
|
/* #include <FeatureMgr.h> */
|
|
|
|
/* #include <CharAttr.h> */
|
|
|
|
/* #include <DLServer.h> */
|
|
|
|
/* #include "xwdefines.h" */
|
|
|
|
/* #include "xwords.h" */
|
|
|
|
/* #include "xwdebug.h" */
|
|
|
|
|
|
|
|
#include "palmmain.h"
|
|
|
|
|
|
|
|
/* short myMemCmp( unsigned char* src1, unsigned char* src2, short size ); */
|
|
|
|
/* void userError( CharPtr* str ); */
|
|
|
|
/* void userErrorRes( short resId ); */
|
|
|
|
/* void userErrorResS( short resId, CharPtr data ); */
|
|
|
|
void beep( void );
|
|
|
|
|
|
|
|
MemPtr getActiveObjectPtr( UInt16 objectID );
|
|
|
|
void getObjectBounds( UInt16 objectID, RectangleType* rectP );
|
|
|
|
void setObjectBounds( UInt16 objectID, RectangleType* rectP );
|
|
|
|
|
|
|
|
void disOrEnable( FormPtr form, UInt16 id, Boolean enable );
|
|
|
|
void disOrEnableSet( FormPtr form, const UInt16* id, Boolean enable );
|
|
|
|
|
2006-10-28 16:48:08 +02:00
|
|
|
void disOrEnableTri( FormPtr form, UInt16 id, XP_TriEnable enable );
|
|
|
|
|
2007-12-11 05:36:50 +01:00
|
|
|
void centerControls( FormPtr form, const UInt16* id, XP_U16 nIds );
|
2003-11-16 20:37:12 +01:00
|
|
|
|
|
|
|
void setBooleanCtrl( UInt16 objectID, Boolean isSet );
|
|
|
|
Boolean getBooleanCtrl( UInt16 objectID );
|
|
|
|
|
2006-06-22 06:57:08 +02:00
|
|
|
void setFieldStr( XP_U16 id, const XP_UCHAR* buf );
|
2007-12-08 19:11:42 +01:00
|
|
|
#ifdef XWFEATURE_RELAY
|
|
|
|
void getFieldStr( XP_U16 id, XP_UCHAR* buf, XP_U16 max );
|
|
|
|
#endif
|
2006-06-22 06:57:08 +02:00
|
|
|
void setFieldEditable( UInt16 objectID, Boolean editable );
|
2003-11-16 20:37:12 +01:00
|
|
|
|
2007-12-09 02:59:15 +01:00
|
|
|
void postEmptyEvent( eventsEnum typ );
|
|
|
|
|
2003-11-16 20:37:12 +01:00
|
|
|
/* list item stuff */
|
|
|
|
void initListData( MPFORMAL ListData* ld, XP_U16 nItems );
|
2007-12-08 19:11:42 +01:00
|
|
|
void addListTextItem( MPFORMAL ListData* ld, const XP_UCHAR* txt );
|
2003-11-16 20:37:12 +01:00
|
|
|
void setListChoices( ListData* ld, ListPtr list, void* closure );
|
2007-12-08 19:11:42 +01:00
|
|
|
void setListSelection( ListData* ld, const char* selName );
|
2003-11-16 20:37:12 +01:00
|
|
|
void sortList( ListData* ld );
|
|
|
|
void freeListData( MPFORMAL ListData* ld );
|
|
|
|
|
|
|
|
/* this should work on either trigger or selector */
|
|
|
|
void setSelectorFromList( UInt16 selectorID, ListPtr list,
|
2005-06-27 07:45:28 +02:00
|
|
|
short listSelIndex );
|
2003-11-16 20:37:12 +01:00
|
|
|
|
|
|
|
void sizeGadgetsForStrings( FormPtr form, ListPtr list, XP_U16 firstGadgetID );
|
2006-10-28 16:48:08 +02:00
|
|
|
void drawGadgetsFromList( ListPtr list, XP_U16 idLow, XP_U16 idHigh,
|
|
|
|
XP_U16 hiliteItem );
|
|
|
|
|
|
|
|
XP_Bool penInGadget( const EventType* event, UInt16* whichGadget );
|
|
|
|
void drawOneGadget( UInt16 id, const char* text, Boolean hilite );
|
|
|
|
# ifdef XWFEATURE_FIVEWAY
|
2006-10-29 18:41:14 +01:00
|
|
|
XP_S16 getFocusOwner( void );
|
2007-02-24 04:35:51 +01:00
|
|
|
void setFormFocus( FormPtr form, XP_U16 objectID );
|
2007-12-08 22:04:44 +01:00
|
|
|
XP_Bool isFormObject( FormPtr form, XP_U16 objectID );
|
2007-04-23 05:20:37 +02:00
|
|
|
void drawFocusRingOnGadget( PalmAppGlobals* globals, XP_U16 idLow,
|
|
|
|
XP_U16 idHigh );
|
|
|
|
XP_Bool considerGadgetFocus( PalmAppGlobals* globals, const EventType* event,
|
|
|
|
XP_U16 idLow, XP_U16 idHigh );
|
2006-10-28 16:48:08 +02:00
|
|
|
|
|
|
|
XP_Bool tryRockerKey( XP_U16 key, XP_U16 selGadget,
|
|
|
|
XP_U16 idLow, XP_U16 idHigh );
|
|
|
|
# endif
|
2003-11-16 20:37:12 +01:00
|
|
|
|
|
|
|
void setFormRefcon( void* refcon );
|
2007-04-14 18:27:19 +02:00
|
|
|
void* getFormRefcon(void);
|
2004-11-05 15:40:37 +01:00
|
|
|
void fitButtonToString( XP_U16 id );
|
|
|
|
|
2003-11-16 20:37:12 +01:00
|
|
|
|
2004-08-31 15:19:28 +02:00
|
|
|
#ifdef DEBUG
|
2006-09-14 03:46:41 +02:00
|
|
|
void PalmClearLogs( void );
|
2004-08-31 15:19:28 +02:00
|
|
|
#endif
|
|
|
|
|
2003-11-16 20:37:12 +01:00
|
|
|
#endif
|