Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

palm/palmutils.c File Reference

Contains the implementation of various palm functions. More...

#include <PalmTypes.h>
#include <FeatureMgr.h>
#include <ErrorBase.h>
#include <ErrorMgr.h>
#include <SystemMgr.h>
#include <SysUtils.h>
#include <StringMgr.h>
#include <Form.h>
#include <resCompat.h>
#include <simcity_resconsts.h>
#include <simcity.h>
#include <palmutils.h>
#include <logging.h>
#include <mem_compat.h>

Go to the source code of this file.

Functions

void RearrangeObjectOnly (FormPtr form, UInt16 oID, Int16 offsetX, Int16 offsetY, Int16 resizeX, Int16 resizeY)
 rearrange/move/resize an object on the screen

void RearrangeBitmap (FormPtr form, UInt16 oID, Int16 offsetX, Int16 offsetY)
 rearrange the location of a bitmap on screen

Boolean isHandEra (void)
 is this device a HandEra machine

Boolean isZireOld (void)
 is the device an old Zire (palmos 4)

UInt32 getDepth (void)
 Return the depth in bits per pixel.

UInt32 hibit (UInt32 x)
 get the highest numbered bit that is set in the 32 bit value passed

Err changeDepthRes (UInt32 ndepth, Boolean tryHigh)
 Change the depth.

Err restoreDepthRes (void)
 restore the screen to the original depth and resolution

Boolean canColor (UInt16 nbits)
 can this device perform color operations at the depth requested

UInt32 GetCreatorID (void)
 get the applications' creator ID

Char ** FillStringList (UInt16 resID, UInt16 *length)
 build a string list from all the string list items from resID

void FreeStringList (Char **list)
 free the contents of a string list

void * GetObjectPtr (FormType *form, UInt16 index)
 get an object pointer from an item index

void compatBmpGetDimensions (BitmapPtr pBmp, Coord *pWidth, Coord *pHeight, UInt16 *pRowBytes)
 get a bitmap's dimensions


Detailed Description

Contains the implementation of various palm functions.

Definition in file palmutils.c.


Function Documentation

Boolean canColor (  UInt16    nbits ) 
 

can this device perform color operations at the depth requested

Parameters:
nbits  the number of bits (1, 2, 4, 8, 16)
Returns:
true if this depth is available

Definition at line 202 of file palmutils.c.

References UInt16, and UInt32.

Err changeDepthRes (  UInt32    ncolors,
Boolean    tryHigh
) 
 

Change the depth.

This will consequently set the resolution of the screen

Parameters:
ncolors  the depth to try to set the screen resolution to
tryHigh  try to put the screen in high resolution mode.
Returns:
errNone if nothing untoward happens, otherwise an error

Definition at line 123 of file palmutils.c.

References hibit(), isHandEra(), and UInt32.

void compatBmpGetDimensions (  BitmapPtr    pBmp,
Coord *    pWidth,
Coord *    pHeight,
UInt16 *    pRowBytes
) 
 

get a bitmap's dimensions

It's for compatibly with pre-PalmOS4 machines.

Parameters:
pBmp  pointer to the bitmap
pWidth  pointer to the width
pHeight  pointer to the height
pRowBytes  pointer to # of bytes in a row

Definition at line 305 of file palmutils.c.

References UInt16.

Char** FillStringList (  UInt16    resID,
UInt16 *    length
) 
 

build a string list from all the string list items from resID

Parameters:
resID  the resource to get the strings from
length  (out) the # of items in the list
Returns:
the char array containing all the strings

Definition at line 256 of file palmutils.c.

References Char, Int16, UInt16, and UInt32.

Referenced by setupButtonConfig().

void FreeStringList (  Char **    list ) 
 

free the contents of a string list

The list wil have been obtained from the FillStringList function

Parameters:
list  the list to free

Definition at line 291 of file palmutils.c.

References Char.

Referenced by clearButtonConfig().

UInt32 GetCreatorID (  void    ) 
 

get the applications' creator ID

Returns:
the creatorID. Machine will crash otherwise

Definition at line 238 of file palmutils.c.

Referenced by BeamRegister(), BeamSend(), and OpenMyDB().

UInt32 getDepth (  void    ) 
 

Return the depth in bits per pixel.

Returns:
the screen depth.

Definition at line 89 of file palmutils.c.

References UInt32.

Referenced by RenderMaps().

void* GetObjectPtr (  FormType *    form,
UInt16    index
) 
 

get an object pointer from an item index

Parameters:
form  the form to obtain the pointer from
index  the index of the item on the form
Returns:
the pointer

Definition at line 298 of file palmutils.c.

References UInt16.

Referenced by budgetSetup(), cityNewSetup(), CleanSaveGameList(), cnCreateButtonPressed(), DeleteFromList(), LoadFromList(), processRepeater(), queryCleanup(), querySetup(), saveButtonConfig(), saveOptions(), setupButtonConfig(), setupOptions(), and UpdateSaveGameList().

UInt32 hibit (  UInt32    x )  [static]
 

get the highest numbered bit that is set in the 32 bit value passed

Parameters:
x  the value to find the highest bit set from
Returns:
the highest bit set.

Definition at line 111 of file palmutils.c.

References UInt32.

Referenced by changeDepthRes().

Boolean isHandEra (  void    ) 
 

is this device a HandEra machine

Returns:
true of this is a handera machine.

Definition at line 60 of file palmutils.c.

References UInt32.

Referenced by changeDepthRes().

Boolean isZireOld (  void    ) 
 

is the device an old Zire (palmos 4)

Returns:
true if the item is an original zire.

Definition at line 70 of file palmutils.c.

References UInt16, and UInt32.

Referenced by buildSilkList().

void RearrangeBitmap (  FormPtr    form,
UInt16    oID,
Int16    offsetX,
Int16    offsetY
) 
 

rearrange the location of a bitmap on screen

Parameters:
form  the form that the bitmap resides on
oID  the id of the bitmap item on the form
offsetX  the offset to move the bitmap by on the X axis
offsetY  the offset to move the bitmap on the y axis.

Definition at line 49 of file palmutils.c.

References Int16, and UInt16.

void RearrangeObjectOnly (  FormPtr    form,
UInt16    oID,
Int16    offsetX,
Int16    offsetY,
Int16    resizeX,
Int16    resizeY
) 
 

rearrange/move/resize an object on the screen

Parameters:
form  the form who's item we wish to rearrange is on.
oID  object's ientifier
offsetX  x offset to move object by
offsetY  y offset to move object by
resizeX  amount to resize X axis by
resizeY  amount to resize Y axis by

Definition at line 31 of file palmutils.c.

References Int16, and UInt16.

Err restoreDepthRes (  void    ) 
 

restore the screen to the original depth and resolution

Returns:
error if it can't restore the depth and resolution

Definition at line 189 of file palmutils.c.


Generated on Mon Aug 30 19:44:17 2004 for pocketcity by doxygen1.2.18