You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(36) |
Sep
(44) |
Oct
(25) |
Nov
(2) |
Dec
(5) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
(4) |
Aug
(8) |
Sep
(16) |
Oct
|
Nov
(2) |
Dec
(28) |
| 2008 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
(11) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(33) |
Jul
(5) |
Aug
(7) |
Sep
(9) |
Oct
(31) |
Nov
(25) |
Dec
(21) |
| 2011 |
Jan
(2) |
Feb
(12) |
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Mapi B. <ma...@us...> - 2008-09-03 20:25:02
|
Update of /cvsroot/easycalc/PPCport In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv13704 Modified Files: EasyCalcppc.rc result.cpp result.h Log Message: Sync before a new set of updates Index: result.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/result.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** result.cpp 26 May 2008 20:09:53 -0000 1.1 --- result.cpp 3 Sep 2008 20:24:52 -0000 1.2 *************** *** 57,67 **** Coord position; RectangleType resultBounds; ! char *displayedText=NULL; TresultPrefs resultPrefs; ! static void result_print_num(char *text) IFACE; ! static void result_print_pow(char *text) IFACE; ! static void result_print(char *text) IFACE; --- 57,67 ---- Coord position; RectangleType resultBounds; ! TCHAR *displayedText=NULL; TresultPrefs resultPrefs; ! static void result_print_num(TCHAR *text) IFACE; ! static void result_print_pow(TCHAR *text) IFACE; ! static void result_print(TCHAR *text) IFACE; *************** *** 85,89 **** Int16 count=0; resSelection choices[SELECTION_COUNT]; ! char *description[SELECTION_COUNT]; ListPtr list; Tdisp_mode oldmode; --- 85,89 ---- Int16 count=0; resSelection choices[SELECTION_COUNT]; ! TCHAR *description[SELECTION_COUNT]; ListPtr list; Tdisp_mode oldmode; *************** *** 110,114 **** for (i=0;i<count;i++) { ! description[i] = MemPtrNew(MAX_RSCLEN); SysStringByIndex(strMenuDescription,choices[i], description[i],MAX_RSCLEN-1); --- 110,114 ---- for (i=0;i<count;i++) { ! description[i] = (TCHAR *) MemPtrNew(MAX_RSCLEN); SysStringByIndex(strMenuDescription,choices[i], description[i],MAX_RSCLEN-1); *************** *** 199,203 **** result_set(Trpn item) { ! char *text; CError err; Boolean freeitem = false; --- 199,203 ---- result_set(Trpn item) { ! TCHAR *text; CError err; Boolean freeitem = false; *************** *** 233,237 **** if (displayedText) MemPtrFree(displayedText); ! displayedText = MemPtrNew(StrLen(text)+1); StrCopy(displayedText,text); --- 233,237 ---- if (displayedText) MemPtrFree(displayedText); ! displayedText = (TCHAR *) MemPtrNew(StrLen(text)+1); StrCopy(displayedText,text); *************** *** 262,268 **** ***********************************************************************/ void ! result_set_text(char *text,rpntype type) IFACE; void ! result_set_text(char *text,rpntype type) { if (type != notype) --- 262,268 ---- ***********************************************************************/ void ! result_set_text(TCHAR *text,rpntype type) IFACE; void ! result_set_text(TCHAR *text,rpntype type) { if (type != notype) *************** *** 272,276 **** if (displayedText) MemPtrFree(displayedText); ! displayedText = MemPtrNew(StrLen(text)+1); StrCopy(displayedText,text); result_print(displayedText); --- 272,276 ---- if (displayedText) MemPtrFree(displayedText); ! displayedText = (TCHAR *) MemPtrNew(StrLen(text)+1); StrCopy(displayedText,text); result_print(displayedText); *************** *** 290,296 **** ***********************************************************************/ void ! result_set_pow(char *text) IFACE; void ! result_set_pow(char *text) { resultPrefs.formatType = powtext; --- 290,296 ---- ***********************************************************************/ void ! result_set_pow(TCHAR *text) IFACE; void ! result_set_pow(TCHAR *text) { resultPrefs.formatType = powtext; *************** *** 298,302 **** if (displayedText) MemPtrFree(displayedText); ! displayedText = MemPtrNew(StrLen(text)+1); StrCopy(displayedText,text); result_print_pow(displayedText); --- 298,302 ---- if (displayedText) MemPtrFree(displayedText); ! displayedText = (TCHAR *) MemPtrNew(StrLen(text)+1); StrCopy(displayedText,text); result_print_pow(displayedText); *************** *** 358,367 **** if (resultPrefs.formatType == plaintext) ! result_set_text((char *)prefData+sizeof(resultPrefs), resultPrefs.ansType); else if (resultPrefs.formatType == powtext) ! result_set_pow((char *)prefData+sizeof(resultPrefs)); else { ! result_set_text((char *)prefData+sizeof(resultPrefs), resultPrefs.ansType); resultPrefs.formatType = fmtnumber; --- 358,367 ---- if (resultPrefs.formatType == plaintext) ! result_set_text((TCHAR *)prefData+sizeof(resultPrefs), resultPrefs.ansType); else if (resultPrefs.formatType == powtext) ! result_set_pow((TCHAR *)prefData+sizeof(resultPrefs)); else { ! result_set_text((TCHAR *)prefData+sizeof(resultPrefs), resultPrefs.ansType); resultPrefs.formatType = fmtnumber; *************** *** 399,403 **** data = MemPtrNew(sizeof(resultPrefs)+StrLen(displayedText)+1); *(TresultPrefs *)data = resultPrefs; ! StrCopy((char *)data+sizeof(resultPrefs),displayedText); PrefSetAppPreferences(APP_ID,PREF_RESULT,PREF_RES_VERSION, --- 399,403 ---- data = MemPtrNew(sizeof(resultPrefs)+StrLen(displayedText)+1); *(TresultPrefs *)data = resultPrefs; ! StrCopy((TCHAR *)data+sizeof(resultPrefs),displayedText); PrefSetAppPreferences(APP_ID,PREF_RESULT,PREF_RES_VERSION, *************** *** 616,620 **** ***********************************************************************/ static void ! result_print(char *text) { Coord width,chrwidth; --- 616,620 ---- ***********************************************************************/ static void ! result_print(TCHAR *text) { Coord width,chrwidth; *************** *** 663,669 **** ***********************************************************************/ static void ! result_print_pow(char *text) { ! char *base,*expon; Coord textwidth,width; FontID oldfont; --- 663,669 ---- ***********************************************************************/ static void ! result_print_pow(TCHAR *text) { ! TCHAR *base,*expon; Coord textwidth,width; FontID oldfont; *************** *** 798,804 **** ***********************************************************************/ static void ! result_print_num(char *text) { ! char *result; Int16 spacing; Int16 i,j,k; --- 798,804 ---- ***********************************************************************/ static void ! result_print_num(TCHAR *text) { ! TCHAR *result; Int16 spacing; Int16 i,j,k; *************** *** 870,874 **** result_error(CError errcode) { ! char *text; text = print_error(errcode); --- 870,874 ---- result_error(CError errcode) { ! TCHAR *text; text = print_error(errcode); Index: result.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/result.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** result.h 26 May 2008 20:09:54 -0000 1.1 --- result.h 3 Sep 2008 20:24:52 -0000 1.2 *************** *** 26,30 **** #define _RESULT_H_ - #include "display.h" #include "skin.h" --- 26,29 ---- Index: EasyCalcppc.rc =================================================================== RCS file: /cvsroot/easycalc/PPCport/EasyCalcppc.rc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EasyCalcppc.rc 26 May 2008 20:09:53 -0000 1.1 --- EasyCalcppc.rc 3 Sep 2008 20:24:52 -0000 1.2 *************** *** 95,98 **** --- 95,121 ---- END + IDD_OPT_GENERAL DIALOG 0, 0, 139, 181 + STYLE DS_SETFONT | WS_POPUP | WS_CAPTION + CAPTION "General" + FONT 8, "System" + BEGIN + LTEXT "General",IDC_TITLE,4,3,63,8 + CONTROL "Dynamic mouse",IDC_CHECK_MOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,42,83,10 + END + + IDD_OPT_SKINS DIALOG 0, 0, 139, 181 + STYLE DS_SETFONT | WS_POPUP | WS_CAPTION + CAPTION "Skins" + FONT 8, "System" + BEGIN + LTEXT "Skins",IDC_TITLE,4,3,63,8 + COMBOBOX IDC_COMBO_SKIN1,9,40,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO_SKIN2,9,59,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO_SKIN3,9,78,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "Skin 1",IDC_SKIN1,62,42,39,10 + LTEXT "Skin 2",IDC_SKIN2,62,61,39,10 + LTEXT "Skin 3",IDC_SKIN3,62,80,39,10 + END + ///////////////////////////////////////////////////////////////////////////// *************** *** 180,220 **** ///////////////////////////////////////////////////////////////////////////// ! // French (France) resources ! #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) #ifdef _WIN32 ! LANGUAGE LANG_FRENCH, SUBLANG_FRENCH ! #pragma code_page(1252) #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // ! // Dialog // ! IDD_OPT_GENERAL DIALOG 0, 0, 139, 181 ! STYLE DS_SETFONT | WS_POPUP | WS_CAPTION ! CAPTION "General" ! FONT 8, "System" BEGIN ! LTEXT "General",IDC_TITLE,4,3,63,8 ! CONTROL "Dynamic mouse",IDC_CHECK_MOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,42,83,10 END ! IDD_OPT_SKINS DIALOG 0, 0, 139, 181 ! STYLE DS_SETFONT | WS_POPUP | WS_CAPTION ! CAPTION "Skins" ! FONT 8, "System" BEGIN ! LTEXT "Skins",IDC_TITLE,4,3,63,8 ! COMBOBOX IDC_COMBO_SKIN1,9,40,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP ! COMBOBOX IDC_COMBO_SKIN2,9,59,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP ! COMBOBOX IDC_COMBO_SKIN3,9,78,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP ! LTEXT "Skin 1",IDC_SKIN1,62,42,39,10 ! LTEXT "Skin 2",IDC_SKIN2,62,61,39,10 ! LTEXT "Skin 3",IDC_SKIN3,62,80,39,10 END ! #endif // French (France) resources ///////////////////////////////////////////////////////////////////////////// --- 203,233 ---- ///////////////////////////////////////////////////////////////////////////// ! // Farsi resources ! #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FAR) #ifdef _WIN32 ! LANGUAGE LANG_FARSI, SUBLANG_DEFAULT ! #pragma code_page(1256) #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // ! // String Table // ! STRINGTABLE BEGIN ! IDS_APP_TITLE "EasyCalc" ! IDC_EASYCALC "EASYCALC" END ! STRINGTABLE BEGIN ! IDS_FILE "Fichier" ! IDS_HELP "Aide" ! IDS_EDIT "Editer" END ! #endif // Farsi resources ///////////////////////////////////////////////////////////////////////////// |
|
From: Mapi B. <ma...@us...> - 2008-09-03 20:25:01
|
Update of /cvsroot/easycalc/PPCport/include In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv13704/include Modified Files: PalmOS.h display.h Log Message: Sync before a new set of updates Index: display.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/include/display.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** display.h 26 May 2008 20:17:54 -0000 1.1 --- display.h 3 Sep 2008 20:24:53 -0000 1.2 *************** *** 50,58 **** }TdispPrefs; ! char * display_real(double number) MLIB; ! char * display_complex(Complex number) MLIB; ! char * display_integer(UInt32 number,Tbase mode) MLIB; ! char * display_default(Trpn rpn,Boolean complete) MLIB; ! char * display_list(List *list) MLIB; extern TdispPrefs dispPrefs; --- 50,58 ---- }TdispPrefs; ! TCHAR * display_real(double number) MLIB; ! TCHAR * display_complex(Complex number) MLIB; ! TCHAR * display_integer(UInt32 number,Tbase mode) MLIB; ! TCHAR * display_default(Trpn rpn,Boolean complete) MLIB; ! TCHAR * display_list(List *list) MLIB; extern TdispPrefs dispPrefs; Index: PalmOS.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/include/PalmOS.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PalmOS.h 26 May 2008 20:17:55 -0000 1.1 --- PalmOS.h 3 Sep 2008 20:24:53 -0000 1.2 *************** *** 41,47 **** --- 41,59 ---- #define MemPtrFree free typedef void *MemHandle; + typedef void *WinHandle; + typedef void *ListPtr; #define MemHandleLock(a) ((MemHandle) a) #define MemHandleUnlock(a) + typedef struct PointType { + Coord x; + Coord y; + } PointType; + typedef struct RectangleType { + PointType topLeft; + PointType extent; + } RectangleType; + typedef RectangleType *RectanglePtr; + #include "DataManager.h" #include "StateManager.h" |
|
From: Mapi B. <ma...@us...> - 2008-05-26 20:20:12
|
Update of /cvsroot/easycalc/PPCport/skins In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv19070/skins Added Files: EasyCalc.gif EasyCalc.layout Log Message: 1st upload, not compiling. --- NEW FILE: EasyCalc.layout --- # EasyCalc standard skin (PocketPC) Skin: 0,0,240,268 Display: 10,13 0 3 a3b39d 0b2327 Annunciator: 1 8,6,22,7 50,268 -1,-1 # Shift indicator (no selection) Annunciator: 2 34,6,16,7 20,268 20,275 # Degree indicator Annunciator: 3 53,6,16,7 35,268 35,275 # Radian indicator Annunciator: 4 72,6,21,7 30,268 30,275 # Gradian indicator Annunciator: 5 97,6,16,7 71,268 71,275 # Decimal indicator Annunciator: 6 116,6,15,7 86,268 86,275 # Octal indicator Annunciator: 7 134,6,13,7 100,268 100,275 # Binary indicator Annunciator: 8 150,6,16,7 112,268 112,275 # Hexadecimal indicator Annunciator: 9 205,6,6,7 0,268 0,275 # Skin 1 indicator Annunciator: 10 212,6,6,7 5,268 5,275 # Skin 2 indicator Annunciator: 11 219,6,6,7 10,268 10,275 # Skin 3 indicator Annunciator: 12 226,6,6,7 15,268 15,275 # Graph indicator Key: 1 6,70,32,22 11,75,22,12 11,74 Key: 2 45,70,32,22 50,75,22,12 50,74 Key: 3 84,70,32,22 89,75,22,12 89,74 Key: 4 123,70,32,22 128,75,22,12 128,74 Key: 5 162,70,32,22 167,75,22,12 167,74 Key: 6 201,70,32,22 206,75,22,12 206,74 Key: 7 6,97,32,22 11,102,22,12 11,101 Key: 8 45,97,32,22 50,102,22,12 50,101 Key: 9 84,97,32,22 89,102,22,12 89,101 Key: 10 123,97,32,22 128,102,22,12 128,101 Key: 11 162,97,32,22 167,102,22,12 167,101 Key: 12 201,97,32,22 206,102,22,12 206,101 Key: 13 6,127,40,29 11,132,30,19 11,131 Key: 14 53,127,40,29 58,132,30,19 58,131 Key: 15 101,127,40,29 106,132,30,19 106,131 Key: 16 148,127,40,29 153,132,30,19 153,131 Key: 17 196,127,40,29 201,132,30,19 201,131 Key: 18 6,163,40,29 11,168,30,19 11,167 Key: 14 53,163,40,29 58,168,30,19 58,167 Key: 15 101,163,40,29 106,168,30,19 106,167 Key: 16 148,163,40,29 153,168,30,19 153,167 Key: 17 196,163,40,29 201,168,30,19 201,167 Key: 19 6,199,40,29 11,204,30,19 11,203 Key: 20 53,199,40,29 58,204,30,19 58,203 Key: 21 101,199,40,29 106,204,30,19 106,203 Key: 22 148,199,40,29 153,204,30,19 153,203 Key: 23 196,199,40,29 201,204,30,19 201,203 Key: 24 6,236,40,29 11,241,30,19 11,240 Key: 25 53,236,40,29 58,241,30,19 58,240 Key: 26 101,236,40,29 106,241,30,19 106,240 Key: 27 148,236,40,29 153,241,30,19 153,240 Key: 28 196,236,40,29 201,241,30,19 201,240 --- NEW FILE: EasyCalc.gif --- (This appears to be a binary file; contents omitted.) |
|
From: Mapi B. <ma...@us...> - 2008-05-26 20:19:06
|
Update of /cvsroot/easycalc/PPCport/mlib In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv18620/mlib Added Files: history.cpp konvert.cpp stack.cpp Log Message: 1st upload, not compiling. --- NEW FILE: stack.cpp --- /* * $Id: stack.cpp,v 1.1 2008/05/26 20:19:03 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, [...977 lines suppressed...] * FUNCTION: stack_delete * * DESCRIPTION: Deletes existing stack and frees all associated memory * * PARAMETERS: stack * * RETURN: Nothing * ***********************************************************************/ void stack_delete(CodeStack *stack) { while (stack->size) { stack->size--; rpn_delete(stack->stack[stack->size]); } MemPtrFree(stack->stack); MemPtrFree(stack); } --- NEW FILE: history.cpp --- /* * $Id: history.cpp,v 1.1 2008/05/26 20:19:03 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #include "StdAfx.h" #include <PalmOS.h> #include <string.h> #include "calcDB.h" #include "stack.h" #include "defuns.h" #include "history.h" #include "display.h" #include "dbutil.h" static DmOpenRef dbRef; UInt16 history_total(void) MLIB; UInt16 history_total(void) { return DmNumRecords(dbRef); } void history_add_line(TCHAR *line) { tHistory *item,*newitem; UInt16 size; MemHandle newHandle; UInt16 recordNumber; size = sizeof(*item) + StrLen(line) + 1; item = (tHistory *) MemPtrNew(size); item->isrpn = false; StrCopy(item->u.text,line); recordNumber = 0; newHandle = DmNewRecord(dbRef,&recordNumber,size); newitem = (tHistory *) MemHandleLock(newHandle); DmWrite(newitem,0,item,size); MemHandleUnlock(newHandle); DmReleaseRecord(dbRef,recordNumber,true); MemPtrFree(item); } /*********************************************************************** * * FUNCTION: history_add * * DESCRIPTION: Add a record in a records database * * PARAMETERS: item - the record that should be added * * RETURN: None * ***********************************************************************/ void history_add_item(Trpn item) { dbStackItem *packitem; UInt16 size,psize; MemHandle newHandle; UInt16 recordNumber; tHistory *histitem,*newitem; packitem = rpn_pack_record(item); if (!packitem) return; size = sizeof(*histitem) + packitem->datasize; psize = sizeof(*packitem) + packitem->datasize; histitem = (tHistory *) MemPtrNew(size); if (!histitem) { MemPtrFree(packitem); return; } histitem->isrpn = true; memcpy((void *)&histitem->u.item,(void *)packitem,psize); recordNumber = 0; newHandle = DmNewRecord(dbRef,&recordNumber,size); if (!newHandle) { MemPtrFree(packitem); MemPtrFree(histitem); return; } newitem = (tHistory *) MemHandleLock(newHandle); DmWrite(newitem,0,histitem,size); MemHandleUnlock(newHandle); DmReleaseRecord(dbRef,recordNumber,true); MemPtrFree(packitem); MemPtrFree(histitem); } /*********************************************************************** * * FUNCTION: history_shrink * * DESCRIPTION: Shrink the history detabase to a defined * number of records * * PARAMETERS: How many records leave in database * * RETURN: None * ***********************************************************************/ void history_shrink(Int16 count) { Int16 i; if (DmNumRecords(dbRef)==0) return; i = DmNumRecords(dbRef)-1; while (i>=count) { DmRemoveRecord(dbRef,i--); } } /*********************************************************************** * * FUNCTION: history_get * * DESCRIPTION: Return a history record * * PARAMETERS: num - how old the item is * * RETURN: item * ***********************************************************************/ Trpn history_get_item(UInt16 num) { MemHandle recordHandle; tHistory *historyitem; Trpn result; recordHandle = DmQueryRecord(dbRef,num); historyitem = (tHistory *) MemHandleLock(recordHandle); result = rpn_unpack_record(&historyitem->u.item); MemHandleUnlock(recordHandle); return result; } TCHAR * history_get_line(UInt16 num) { MemHandle recordHandle; tHistory *historyitem; TCHAR *result; recordHandle = DmQueryRecord(dbRef,num); historyitem = (tHistory *) MemHandleLock(recordHandle); result = (TCHAR *) MemPtrNew(StrLen(historyitem->u.text) + 1); StrCopy(result,historyitem->u.text); MemHandleUnlock(recordHandle); return result; } Boolean history_isrpn(UInt16 num) { MemHandle recordHandle; tHistory *historyitem; Boolean result; recordHandle = DmQueryRecord(dbRef,num); historyitem = (tHistory *) MemHandleLock(recordHandle); result = historyitem->isrpn; MemHandleUnlock(recordHandle); return result; } /*********************************************************************** * * FUNCTION: history_command * * DESCRIPTION: This function is evaluated directly from a normal * mathematical equation * * PARAMETERS: On stack - 1 number convertible to integer * * RETURN: On stack - value from history database * ***********************************************************************/ CError history_command(Functype *func,CodeStack *stack) { CError err; UInt32 arg; if ((err=stack_get_val(stack,&arg,integer))) return err; if (arg > DmNumRecords(dbRef)) return c_badarg; if (!history_isrpn(arg)) return c_badarg; stack_push(stack,history_get_item(arg)); return c_noerror; } /*********************************************************************** * * FUNCTION: history_open * * DESCRIPTION: Open a history database * * PARAMETERS: None * * RETURN: 0 on success * ***********************************************************************/ Int16 history_open(void) { return open_db(HISTORYDBNAME, HIST_DB_VERSION, LIB_ID, DBTYPE, &dbRef); } /*********************************************************************** * * FUNCTION: history_close * * DESCRIPTION: Close a history database * * PARAMETERS: None * * RETURN: 0 on success * ***********************************************************************/ Int16 history_close(void) { history_shrink(HISTORY_RECORDS); return DmCloseDatabase(dbRef); } --- NEW FILE: konvert.cpp --- /* * $Id: konvert.cpp,v 1.1 2008/05/26 20:19:03 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000,2001,2002 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, [...1179 lines suppressed...] if (IS_FUNC_1LETTER(defined_funcs[i].name[0])) (*count)++; names = (TCHAR **) MemPtrNew(*count * sizeof(*names)); for (i=0,j=0;defined_funcs[i].name[0];i++) if (IS_FUNC_1LETTER(defined_funcs[i].name[0])) names[j++]=(TCHAR *)defined_funcs[i].name; /* Shell sort the array */ for (gap = *count/2;gap > 0; gap/=2) for (i = gap;i < *count;i++) for (j=i-gap;j>=0 && StrCompare(names[j],names[j+gap])>0; j-=gap) { temp = names[j]; names[j] = names[j+gap]; names[j+gap] = temp; } return names; } |
Update of /cvsroot/easycalc/PPCport/include In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv18192/include Added Files: calcDB.h cmatrix.h complex.h dbutil.h defuns.h display.h fp.h funcs.h history.h integ.h konvert.h mathem.h MathLib.h matrix.h meqstack.h PalmOS.h segment.h slist.h specfun.h stack.h txtask.h Log Message: 1st upload, not compiling. --- NEW FILE: dbutil.h --- /* * $Id: dbutil.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000,2007 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _DBUTIL_H_ #define _DBUTIL_H_ //#include <PalmOS.h> Int16 open_db(const Char *name, UInt16 dbversion, UInt32 crid, UInt32 dbtype, DmOpenRef *dbref); #endif --- NEW FILE: history.h --- /* * $Id: history.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _HISTORY_H_ #define _HISTORY_H_ #define HISTORY_RECORDS 30 typedef struct { Boolean isrpn; Int16 xxxpad; union { dbStackItem item; TCHAR *text; }u; }tHistory; CError history_command(Functype *func,CodeStack *stack) MLIB; Int16 history_close(void) MLIB; Int16 history_open(void) MLIB; void history_shrink(Int16 count) MLIB; void history_add_line(TCHAR *line) MLIB; void history_add_item(Trpn item) MLIB; Boolean history_isrpn(UInt16 num) MLIB; UInt16 history_total(void) MLIB; TCHAR * history_get_line(UInt16 num) MLIB; Trpn history_get_item(UInt16 num) MLIB; #endif --- NEW FILE: integ.h --- /* * $Id: integ.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _INTEG_H_ #define _INTEG_H_ /* Precision for solving functions */ #define DEFAULT_ERROR (1E-8) #define DEFAULT_ROMBERG 6 #define MAX_ITER 2000 CError integ_fsolve(Functype *func,CodeStack *stack) NEWFUNC; CError integ_fsimps(Functype *func,CodeStack *stack) NEWFUNC; CError integ_fdydx(Functype *func,CodeStack *stack) NEWFUNC; double integ_simps(double min, double max,CodeStack *fcstack, double error,CodeStack *argarr) NEWFUNC; double integ_zero(double min, double max, double value, CodeStack *fcstack, double error,Int16 funcnum,CodeStack *argarr) NEWFUNC; double integ_derive1(double x,CodeStack *fcstack,double error, CodeStack *argarr) NEWFUNC; double integ_derive2(double x,CodeStack *fcstack,double error, CodeStack *argarr) NEWFUNC; double integ_romberg(double min,double max,CodeStack *fcstack,Int16 n, CodeStack *argarr) NEWFUNC; CError integ_fromberg(Functype *func,CodeStack *stack) NEWFUNC; double integ_intersect(double min,double max, CodeStack *f1, CodeStack *f2, double error,CodeStack *argarr) NEWFUNC; CError integ_fintersect(Functype *func,CodeStack *stack) NEWFUNC; #endif --- NEW FILE: txtask.h --- /* * $Id: txtask.h,v 1.1 2008/05/26 20:17:55 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _TXTASK_H_ #define _TXTASK_H_ #define TXTASK_ASK 1200 CError txtask_ask(Functype *func, CodeStack *stack); #endif --- NEW FILE: display.h --- /* * $Id: display.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _DISPLAY_H_ #define _DISPLAY_H_ #include "konvert.h" typedef enum { disp_decimal=10, disp_hexa=16, disp_octal=8, disp_binary=2 }Tbase; typedef enum { disp_normal, disp_sci, disp_eng }Tdisp_mode; typedef struct { Int8 decPoints; Boolean stripZeros; Tdisp_mode mode; Tbase base; Boolean forceInteger; Boolean cvtUnits; }TdispPrefs; char * display_real(double number) MLIB; char * display_complex(Complex number) MLIB; char * display_integer(UInt32 number,Tbase mode) MLIB; char * display_default(Trpn rpn,Boolean complete) MLIB; char * display_list(List *list) MLIB; extern TdispPrefs dispPrefs; #endif --- NEW FILE: MathLib.h --- /* MathLib: Pilot shared library of IEEE-754 double math functions * * Library function prototypes for the calling application. This is * the file that the calling application should include in order to * get access to the routines in the library; it serves the same * function as the file "math.h" normally used on systems with * standard math libraries. Each function in the library has two * prototypes listed; the first is for the programmer-friendly * wrapper function in MathLib.c, the second is for the raw SYS_TRAP() * invocation that actually calls the library routine. * * Copyright (C) 1997 Rick Huebner * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library 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 Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this program; see file COPYING.LIB. If not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA * * Version 1.01, 23 August 1997, Rick Huebner */ #ifndef __MATHLIB_H__ #define __MATHLIB_H__ #include "segment.h" // Library name for use with SysLibFind() #define MathLibName "MathLib" // Values for use with SysLibLoad() #define LibType 'libr' #define MathLibCreator 'MthL' // This is the major version number of the library. If new functions // are added to this library, this version number must be incremented // to protect programs which are compiled with this header from trying // to invoke the new functions in an old version of MathLib.prc, // which would be fatal. Do NOT delete any functions from this list, // or any older programs which try to use them will die. Any changes // other than adding new functions should be reflected in the minor // part of the version number, e.g. 1.1 if a bug fix, 2.0 if new // functions added. #define MathLibVersion 1 // Possible Err values from MathLib functions typedef enum MathLibErrorCode { mlErrNone = 0, mlErrOldVersion, // library is older than version passed to open() mlErrNotOpen, // close() without having called open() first mlErrNoMemory // can't allocate global data block } MathLibErrorCode; // Library reference returned by SysLibFind() or SysLibLoad() extern UInt16 MathLibRef; /***************************** * Library control functions * *****************************/ Err MathLibOpen(UInt16 refnum, UInt16 version) // Initialize library for use SYS_TRAP(sysLibTrapOpen); Err MathLibClose(UInt16 refnum, UInt16 *usecountP)// Free library resources when finished SYS_TRAP(sysLibTrapClose); Err MathLibSleep(UInt16 refnum) // Called by OS when Pilot sleeps SYS_TRAP(sysLibTrapSleep); Err MathLibWake(UInt16 refnum) // Called by OS when Pilot wakes SYS_TRAP(sysLibTrapWake); /*************************** * Trigonometric functions * ***************************/ double acos(double x) MLIB; // Arc cosine of x double asin(double x) MLIB; // Arc sine of x double atan(double x) MLIB; // Arc tangent of x double atan2(double y, double x) MLIB; // Arc tangent of y/x double cos(double x) MLIB; // Cosine of x double sin(double x) MLIB; // Sine of x double tan(double x) MLIB; // Tangent of x void sincos(double x, double *sinx, double *cosx) MLIB; // Sine and cosine of x /************************ * Hyperbolic functions * ************************/ double cosh(double x) MLIB; // Hyperbolic cosine of x double sinh(double x) MLIB; // Hyperbolic sine of x double tanh(double x) MLIB; // Hyperbolic tangent of x double acosh(double x) MLIB; // Hyperbolic arc cosine of x double asinh(double x) MLIB; // Hyperbolic arc sine of x double atanh(double x) MLIB; // Hyperbolic arc tangent of x /***************************************** * Exponential and logarithmic functions * *****************************************/ double exp(double x) MLIB; // Exponential function of x [pow(e,x)] double frexp(double x, Int16 *exponent) MLIB; // Break x into normalized fraction and an integral power of 2 double ldexp(double x, Int16 exponent) MLIB; // x * pow(2,exponent) double log(double x) MLIB; // Natural logarithm of x double log10(double x) MLIB; // Base 10 logarithm of x double modf(double x, double *intpart) MLIB; // Break x into integral and fractional parts double expm1(double x) MLIB; // exp(x) - 1 double log1p(double x) MLIB; // log(1+x) double logb(double x) MLIB; // Base 2 signed integral exponent of x double log2(double x) MLIB; // Base 2 logarithm of x /******************* * Power functions * *******************/ double pow(double x, double y) MLIB; // x to the y power [x**y] double sqrt(double x) MLIB; // Square root of x [x**0.5] double hypot(double x, double y) MLIB; // sqrt(x*x + y*y) [hypotenuse of right triangle] double cbrt(double x) MLIB; // Cube root of x [x**(1/3)] /************************************************************ * Nearest integer, absolute value, and remainder functions * ************************************************************/ double ceil(double x) MLIB; // Smallest integral value not less than x double fabs(double x) MLIB; // Absolute value of x double floor(double x) MLIB; // Largest integral value not greater than x double fmod(double x, double y) MLIB; // Modulo remainder of x/y /*************************** * Miscellaneous functions * ***************************/ Int16 isinf(double x) MLIB; // Return 0 if x is finite or NaN, +1 if +Infinity, or -1 if -Infinity Int16 finite(double x) MLIB; // Return nonzero if x is finite and not NaN double scalbn(double x, Int16 exponent) MLIB; // x * pow(2,exponent) double drem(double x, double y) MLIB; // Remainder of x/y double significand(double x) MLIB; // Fractional part of x after dividing out ilogb(x) double copysign(double x, double y) MLIB; // Return x with its sign changed to match y's Int16 isnan(double x) MLIB; // Return nonzero if x is NaN (Not a Number) Int16 ilogb(double x) MLIB; // Binary exponent of non-zero x double rint(double x) MLIB; // Integral value nearest x in direction of prevailing rounding mode double nextafter(double x, double y) MLIB; // Next machine double value after x in the direction towards y double remainder(double x, double y) MLIB; // Remainder of integer division x/y with infinite precision double scalb(double x, double exponent) MLIB;// x * pow(2,exponent) double round(double x) MLIB; // Round x to nearest integral value away from zero double trunc(double x) MLIB; // Round x to nearest integral value not larger than x UInt32 signbit(double x) MLIB; // Return signbit of x's machine representation /**************************************** * Prototypes for the system traps that * * actually perform the library calls, * * in the format mandated by the OS. * ****************************************/ Err MathLibACos(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom); Err MathLibASin(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+1); Err MathLibATan(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+2); Err MathLibATan2(UInt16 refnum, double y, double x, double *result) SYS_TRAP(sysLibTrapCustom+3); Err MathLibCos(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+4); Err MathLibSin(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+5); Err MathLibTan(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+6); Err MathLibSinCos(UInt16 refnum, double x, double *sinx, double *cosx) SYS_TRAP(sysLibTrapCustom+7); Err MathLibCosH(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+8); Err MathLibSinH(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+9); Err MathLibTanH(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+10); Err MathLibACosH(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+11); Err MathLibASinH(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+12); Err MathLibATanH(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+13); Err MathLibExp(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+14); Err MathLibFrExp(UInt16 refnum, double x, double *fraction, Int16 *exponent) SYS_TRAP(sysLibTrapCustom+15); Err MathLibLdExp(UInt16 refnum, double x, Int16 exponent, double *result) SYS_TRAP(sysLibTrapCustom+16); Err MathLibLog(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+17); Err MathLibLog10(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+18); Err MathLibModF(UInt16 refnum, double x, double *intpart, double *fracpart) SYS_TRAP(sysLibTrapCustom+19); Err MathLibExpM1(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+20); Err MathLibLog1P(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+21); Err MathLibLogB(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+22); Err MathLibLog2(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+23); Err MathLibPow(UInt16 refnum, double x, double y, double *result) SYS_TRAP(sysLibTrapCustom+24); Err MathLibSqrt(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+25); Err MathLibHypot(UInt16 refnum, double x, double y, double *result) SYS_TRAP(sysLibTrapCustom+26); Err MathLibCbrt(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+27); Err MathLibCeil(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+28); Err MathLibFAbs(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+29); Err MathLibFloor(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+30); Err MathLibFMod(UInt16 refnum, double x, double y, double *result) SYS_TRAP(sysLibTrapCustom+31); Err MathLibIsInf(UInt16 refnum, double x, Int16 *result) SYS_TRAP(sysLibTrapCustom+32); Err MathLibFinite(UInt16 refnum, double x, Int16 *result) SYS_TRAP(sysLibTrapCustom+33); Err MathLibScalBN(UInt16 refnum, double x, Int16 exponent, double *result) SYS_TRAP(sysLibTrapCustom+34); Err MathLibDRem(UInt16 refnum, double x, double y, double *result) SYS_TRAP(sysLibTrapCustom+35); Err MathLibSignificand(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+36); Err MathLibCopySign(UInt16 refnum, double x, double y, double *result) SYS_TRAP(sysLibTrapCustom+37); Err MathLibIsNaN(UInt16 refnum, double x, Int16 *result) SYS_TRAP(sysLibTrapCustom+38); Err MathLibILogB(UInt16 refnum, double x, Int16 *result) SYS_TRAP(sysLibTrapCustom+39); Err MathLibRInt16(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+40); Err MathLibNextAfter(UInt16 refnum, double x, double y, double *result) SYS_TRAP(sysLibTrapCustom+41); Err MathLibRemainder(UInt16 refnum, double x, double y, double *result) SYS_TRAP(sysLibTrapCustom+42); Err MathLibScalB(UInt16 refnum, double x, double exponent, double *result) SYS_TRAP(sysLibTrapCustom+43); Err MathLibRound(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+44); Err MathLibTrunc(UInt16 refnum, double x, double *result) SYS_TRAP(sysLibTrapCustom+45); Err MathLibSignBit(UInt16 refnum, double x, UInt32 *result) SYS_TRAP(sysLibTrapCustom+46); #endif // __MATHLIB_H__ --- NEW FILE: funcs.h --- /* * $Id: funcs.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _FUNCS_H_ #define _FUNCS_H_ #define FUNC_IF 0 /* Constants as indices to funcInterDef table */ #define FUNC_COV 0 #define FUNC_CORR 1 #define FUNC_QBINOM 2 #define FUNC_QBETA 3 #define FUNC_QCHISQ 4 #define FUNC_QF 5 #define FUNC_QPOISSON 6 #define FUNC_QSTUDENTT 7 #define FUNC_QWEIBULL 8 #define FUNC_QNORMAL 9 /* Maximal depth in user functions */ #define MAX_RECURS 10 /* When the 'real' argument is zero */ #define IS_ZERO(x) (fabs(x)<1E-6) #define FUNC_EMPTY 0 #define FUNC_PLUS 1 #define FUNC_MINUS 2 #define FUNC_MULTIPLY 3 #define FUNC_DIVIDE 4 #define FUNC_POWER 5 #define FUNC_EQUAL 6 #define FUNC_NEGATE 7 #define FUNC_DISCARD 8 #define FUNC_AND 9 #define FUNC_OR 10 #define FUNC_SHL 11 #define FUNC_SHR 12 #define FUNC_X 13 #define FUNC_MOD 14 #define FUNC_XOR 15 #define FUNC_ISEQUAL 16 #define FUNC_GRTHEN 17 #define FUNC_LETHEN 18 #define FUNC_GREQ 19 #define FUNC_LEEQ 20 #define FUNC_CONJ 21 #define FUNC_ITEM 22 #define FUNC_DEGREE 1 #define FUNC_RADIAN 2 #define FUNC_GONIO 3 #define FUNC_TOCIS 4 #define FUNC_DEGREE2 5 #define RAND_NUM ((double) SysRandom(0) / (double)sysRandomMax) CError convert_real_to_string(Functype *func,CodeStack *stack) PARSER; CError convert_cplx_to_string(Functype *func,CodeStack *stack) PARSER; CError define_func(Functype *func,CodeStack *stack) PARSER; CError change_param_name(Functype *func,CodeStack *stack) PARSER; CError unset_variable(Functype *func,CodeStack *stack) PARSER; CError discard_arg(Functype *func,CodeStack *stack) PARSER; CError empty_arg(Functype *func,CodeStack *stack) PARSER; CError rpn_eval_variable(Trpn *dest,Trpn source) PARSER; CError set_ans_var(Trpn ans) PARSER; CError eval_x(Functype *func,CodeStack *stack) PARSER; CError text_function(TCHAR *name,Int16 paramcount,CodeStack *stack) PARSER; void set_func_argument(Trpn *arg,UInt16 argcount) PARSER; void decr_func_argument(void) PARSER; Boolean varfunc_name_ok(TCHAR *name,rpntype type) PARSER; CError func_get_value(CodeStack *origstack,double param, double *result, CodeStack *addparms) PARSER; CError func_get_value_cplx(CodeStack *origstack,Complex* params, UInt16 paramcount, Complex *result) PARSER; CError exec_function(CodeStack *funcstack,CodeStack *varstack, Int16 paramcount) PARSER; CError func_interdef(Functype *func,CodeStack *stack) PARSER; CError func_if(Functype *func,CodeStack *stack) PARSER; CError func_item(Functype *func, CodeStack *stack) PARSER; Boolean is_constant(TCHAR *name) PARSER; extern Boolean DisableInput; #endif --- NEW FILE: cmatrix.h --- /* * $Id: cmatrix.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000,2001,2002 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _CMATRIX_H_ #define _CMATRIX_H_ #define CMATRIX_INPUT 2101 #define CMATRIX_DET 2102 #define CMATRIX_ECHELON 2103 #define CMATRIX_IDENTITY 2104 #define CMATRIX_QRQ 2105 #define CMATRIX_QRR 2106 #define CMATRIX_QRS 2107 CError cmatrix_input(Functype *func,CodeStack *stack) MATFUNC; CMatrix * cmatrix_new(Int16 rows,Int16 cols) MATFUNC; CMatrix * cmatrix_dup(CMatrix *m) MATFUNC; void cmatrix_delete(CMatrix *m) MATFUNC; Matrix * cmatrix_to_matrix(CMatrix *cm) MATFUNC; CError cmatrix_oper(Functype *func,CodeStack *stack) MATFUNC; CMatrix * matrix_to_cmatrix(Matrix *m) MATFUNC; CError cmatrix_oper_cplx(Functype *func,CodeStack *stack) MATFUNC; CError cmatrix_func2(Functype *func,CodeStack *stack) MATFUNC; CError cmatrix_func(Functype *func,CodeStack *stack) MATFUNC; CError cmatrix_dim(Functype *func, CodeStack *stack) MATFUNC; CError cmatrix_item(Functype *func, CodeStack *stack) MATFUNC; #endif --- NEW FILE: PalmOS.h --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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 PALM_OS_H #define PALM_OS_H 1 #define Int8 INT8 #define UInt8 UINT8 #define Int16 INT16 #define UInt16 UINT16 #define Int32 INT32 #define UInt32 UINT32 #define Char TCHAR #define Boolean bool #define Coord int #define Err int #define FieldPtr int #define IndexedColorType int #define StrCopy wcscpy #define StrLen wcslen #define StrNCompare wcsncmp #define StrCompare wcscmp #define MemPtrNew malloc #define MemPtrFree free typedef void *MemHandle; #define MemHandleLock(a) ((MemHandle) a) #define MemHandleUnlock(a) #include "DataManager.h" #include "StateManager.h" #define ErrFatalDisplayIf(a,b) #define SYS_TRAP(a) #endif --- NEW FILE: defuns.h --- /* * $Id: defuns.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _DEFUNS_H_ #define _DEFUNS_H_ #include "segment.h" #include "konvert.h" #define MAX_FP_NUMBER 64 /* Application specific things */ #define APP_ID 'OpCl' #define LIB_ID 'OpCl' #define DBNAME _T("CalcDB-OpCl") #define HISTORYDBNAME _T("CalcDB-H-OpCl") #define SOLVERDBNAME _T("CalcDB-S-OpCl") #define DBTYPE 'Data' #define SOLVERDBTYPE 'Slvr' #define CARDNO 0 #define DBVERSION 5 #define HIST_DB_VERSION 6 #define SOLVER_DB_VERSION 1 #define PREF_DEFAULT 0 #define PREF_RESULT 1 #define PREF_GRAPH 3 #define PREF_LSTEDIT 4 #define PREF_MTXEDIT 5 #define PREF_DIA 6 /* Change this if you are changing contents of the preferences structure */ #define PREF_VERSION 44 #define PREF_RES_VERSION 2 #define PREF_GRAPH_VERSION 5 #define PREF_LSTEDIT_VERSION 1 #define PREF_MTXEDIT_VERSION 1 #define PREF_DIA_VERSION 1 /* Maximum length of normal strings copied from tSTR */ #define MAX_RSCLEN 30 #define MAX_RESULT 17 /* Rounding offset for reduce precision */ #define ROUND_OFFSET 13 #define PRECISION_TO_ZERO 1E-12 /* konvert.c constants */ #define MAX_RPNSIZE 105 #define MAX_OSTACK 45 #define NaN ((double)(3-3)/(3-3)) TCHAR * guess(Trpn item) MLIB; TCHAR * print_error(CError err); #endif --- NEW FILE: meqstack.h --- /* * $Id: meqstack.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _MEQSTACK_H_ #define _MEQSTACK_H_ #include "konvert.h" typedef struct { Int16 allocated; Int16 count; Tmeq *array; }Tdynmeq; Int16 meq_push(Tdynmeq *array,Tmeq item); void meq_free(Tdynmeq *array); void meq_update_t_pcount(Tdynmeq *array,Int16 position,Int16 pcount); void meq_update_f_pcount(Tdynmeq *array,Int16 position,Int16 pcount); Tmeq meq_pop(Tdynmeq *array); Tmeq meq_last(Tdynmeq *array); Tmeq meq_fetch(Tdynmeq *array); Int16 meq_count(Tdynmeq *array); Tdynmeq *meq_new(void); #endif --- NEW FILE: specfun.h --- /* * $Id: specfun.h,v 1.1 2008/05/26 20:17:55 mapibid Exp $ * * Scientific Calculator for Palms. * This file Copyright (C) 2000 Rafael Sevilla * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'di...@pa...'. * */ #ifndef _SPECFUN_H #define _SPECFUN_H #include "segment.h" CError math_gambeta(Functype *func, CodeStack *stack) SPECFUN; CError math_bessels(Functype *func, CodeStack *stack) SPECFUN; CError math_elliptic(Functype *func, CodeStack *stack) SPECFUN; CError math_hypergeo(Functype *func, CodeStack *stack) SPECFUN; CError math_orthpol(Functype *func, CodeStack *stack) SPECFUN; double polevl(double x, double *coef, int N ) SPECFUN; #define EPSILON 1e-10 #endif --- NEW FILE: fp.h --- /* * $Id: fp.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _FP_H_ #define _FP_H_ void fp_setup_flpoint(void) PARSER; void fp_print_double(char *strP, double value) PARSER; void fp_print_g_double(char *s, double value, Int16 prec) PARSER; void fp_set_base(Tbase base) PARSER; TdispPrefs fp_set_prefs(TdispPrefs prefs) PARSER; Tdisp_mode fp_set_dispmode(Tdisp_mode newmode) PARSER; extern char flSpaceChar, flPointChar; #endif --- NEW FILE: matrix.h --- /* * $Id: matrix.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000,2001 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _MATRIX_H_ #define _MATRIX_H_ #define MATRIX_MAX 50 #define MATRIX_INPUT 2001 #define MATRIX_DET 2002 #define MATRIX_ECHELON 2003 #define MATRIX_IDENTITY 2004 #define MATRIX_QRQ 2005 #define MATRIX_QRR 2006 #define MATRIX_QRS 2007 CError matrix_input(Functype *func,CodeStack *stack) MATFUNC; void matrix_delete(Matrix *m) MATFUNC; Matrix * matrix_new(Int16 rows,Int16 cols) MATFUNC; Matrix * matrix_dup(Matrix *m) MATFUNC; CError matrix_oper(Functype *func,CodeStack *stack) MATFUNC; CError matrix_oper_real(Functype *func,CodeStack *stack) MATFUNC; CError matrix_func(Functype *func,CodeStack *stack) MATFUNC; CError matrix_func2(Functype *func,CodeStack *stack) MATFUNC; CError matrix_item(Functype *func, CodeStack *stack) MATFUNC; CError matrix_dim(Functype *func, CodeStack *stack) MATFUNC; CError matrix_func3(Functype *func,CodeStack *stack) MATFUNC; #endif --- NEW FILE: complex.h --- /* * $Id: complex.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _COMPLEX_H_ #define _COMPLEX_H_ #define cplx_abs(x) (hypot((x).real,(x).imag)) Complex_gon cplx_to_gon(Complex x) MLIB; CError cplx_oper(Functype *func,CodeStack *stack) MLIB; CError cplx_math(Functype *func,CodeStack *stack) MLIB; CError cplx_round(Functype *func,CodeStack *stack) MLIB; Complex cplx_add(Complex arg1,Complex arg2) MLIB; Complex cplx_multiply(Complex arg1,Complex arg2) MLIB; Complex cplx_sub(Complex arg1,Complex arg2) MLIB; Complex cplx_div(Complex arg1,Complex arg2) MLIB; Complex cplx_sqrt(Complex arg) MLIB; Complex cplx_exp(Complex carg) MLIB; #endif --- NEW FILE: konvert.h --- /* * $Id: konvert.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _konvert_h_ #define _konvert_h_ #include "segment.h" #define MAX_FUNCNAME 10 #define MAX_VARNAME 10 /* First function/variable character */ #define IS_FUNC_1LETTER(x) (((x)>='a' && (x)<='z') || (x)=='_' || (x)==(TCHAR)181 || \ ((x)>='G' && (x)<='Z')) /* Other characters, inside varname can be numbers */ #define IS_FUNC_LETTER(x) (IS_FUNC_1LETTER(x) || ((x)>='0' && (x)<='9') || \ ((x)>='A' && (x)<='Z')) typedef enum { degree, radian, grad }Ttrigo_mode; typedef enum { notype=0, integer, real, function, functext, funcempty, variable, string, /* These 2 next shouldn't be in rpn, it's temporary */ oper, discard, complex, list, matrix, litem, cmatrix }rpntype; typedef enum { c_noerror=0, c_syntax, c_badfunc, c_noarg, c_badarg, c_internal, c_badmode, c_noresult, c_divbyzero, c_notvar, c_badresult, c_deeprec, c_compimp, c_range, c_badargcount, c_baddim, c_singular, c_interrupted, c_memory, c_stacklow }CError; typedef struct { double real; double imag; }Complex; typedef struct { double r; double angle; }Complex_gon; typedef struct { Int16 offs; Int16 num; Int16 paramcount; }Functype; typedef struct { Int16 paramcount; TCHAR name[MAX_FUNCNAME+1]; }TextFunctype; typedef struct { Int16 row; Int16 col; TCHAR name[MAX_FUNCNAME+1]; }LitemType; typedef struct { UInt16 size; Complex *item; }List; #define MATRIX(m,r,c) m->item[m->cols * (r) + (c)] typedef struct { Int16 rows,cols; double *item; }Matrix; typedef struct { Int16 rows,cols; Complex *item; }CMatrix; /* item on the RPN stack */ typedef struct { rpntype type; UInt16 allocsize; /* If we should free the item or not */ union { UInt32 intval; double realval; Functype funcval; /* Internal function call */ TextFunctype textfunc; /* User defined function call */ LitemType litemval; TCHAR funcname[MAX_FUNCNAME+1]; /* Empty function */ TCHAR varname[MAX_FUNCNAME+1]; TCHAR *stringval; Complex *cplxval; TCHAR *data; List *listval; Matrix *matrixval; CMatrix *cmatrixval; }u; }Trpn; typedef struct { Boolean evalRight; Int16 priority; Int16 operpri; Trpn rpn; }Tmeq; /* stack */ typedef struct { UInt16 size; UInt16 allocated; Trpn *stack; }CodeStack; struct Tdefined_funcs { const TCHAR name[MAX_FUNCNAME+1]; Int16 funcnum; CError (*function)(Functype *func,CodeStack *stack); Int16 paramcount; Boolean listsimul; Boolean matrixsimul; }; CodeStack *text_to_stack(TCHAR *buf, CError *error); Err mlib_init_mathlib(void) MLIB; void mlib_close_mathlib(void) MLIB; TCHAR ** konvert_get_sorted_fn_list(Int16 *count); extern const struct Tdefined_funcs defined_funcs[]; extern Ttrigo_mode trigo_mode; extern TCHAR parameter_name[MAX_FUNCNAME+1]; #endif --- NEW FILE: calcDB.h --- /* * $Id: calcDB.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _CALCDB_H_ #define _CALCDB_H_ //#include <PalmOS.h> #include "konvert.h" typedef struct { Int16 size; rpntype *type; TCHAR **list; /* Do not add anything here, it gets overwritten */ }dbList; typedef struct { Int16 count; Int16 orig_offset; TCHAR param_name[MAX_FUNCNAME+1]; }dbStackHeader; typedef struct { Trpn rpn; UInt16 datasize; /* size of additional packed data */ TCHAR *data; }dbStackItem; typedef struct { dbStackHeader header; TCHAR *data; }dbPackedStack; typedef struct { rpntype type; /* This can be ONLY variable/function, nothing else can be * stored in databases */ TCHAR name[MAX_FUNCNAME+1]; union { dbStackItem data[1]; /* Variable */ dbPackedStack stack; }u; }dbPackedRecord; CError db_write_function(const TCHAR *name,CodeStack *stack,TCHAR *origtext) MLIB; CodeStack * db_read_function(const TCHAR *name,CError *err) MLIB; CError db_write_variable(const TCHAR *name,Trpn contents) MLIB; Trpn db_read_variable(const TCHAR *name,CError *err) MLIB; CError db_func_description(const TCHAR *funcname,TCHAR **dest,TCHAR *param) MLIB; dbPackedRecord * db_read_record(const TCHAR *name) MLIB; Int16 db_delete_record(const TCHAR *name) MLIB; void db_recompile_all(void) MLIB; Int16 db_open() MLIB; Int16 db_close() MLIB; Boolean db_record_exists(const TCHAR *name) MLIB; void db_delete_list(dbList *list) MLIB; dbList * db_get_list(rpntype type) MLIB; void db_save_real(const TCHAR *name, double number) MLIB; #endif --- NEW FILE: segment.h --- /* * $Id: segment.h,v 1.1 2008/05/26 20:17:55 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _SEGMENT_H_ #define _SEGMENT_H_ #define MLIB_SECTION #define MLIB MLIB_SECTION #define BASEFUNC_SECTION #define BASEFUNC BASEFUNC_SECTION #define IFACE_SECTION #define IFACE IFACE_SECTION #define SPECFUN_SECTION #define SPECFUN SPECFUN_SECTION #define GRAPH_SECTION #define GRAPH GRAPH_SECTION #define NEWFUNC_SECTION #define NEWFUNC NEWFUNC_SECTION #define PARSER_SECTION #define PARSER PARSER_SECTION #define MATFUNC_SECTION #define MATFUNC MATFUNC_SECTION #endif --- NEW FILE: stack.h --- /* * $Id: stack.h,v 1.1 2008/05/26 20:17:55 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _STACK_H_ #define _STACK_H_ #include "calcDB.h" #include "segment.h" dbPackedStack * stack_pack(CodeStack *stack,Int16 *size) MLIB; CodeStack * stack_unpack(dbPackedStack *packed) MLIB; dbStackItem * rpn_pack_record(Trpn item) MLIB; Trpn rpn_unpack_record(dbStackItem *record) MLIB; void rpn_delete(Trpn item) MLIB; void rpn_duplicate(Trpn *dest,Trpn source) MLIB; CError stack_get_val(CodeStack *stack,void *arg1,rpntype reqtype) MLIB; CError stack_get_val2(CodeStack *stack,void *arg1,void *arg2,rpntype reqtype) MLIB; CError stack_add_val(CodeStack *stack,void *arg,rpntype reqtype) MLIB; CError stack_item_type(CodeStack *stack,rpntype *type,Int16 itnum) MLIB; CError stack_compute(CodeStack *instack) MLIB; Trpn stack_pop(CodeStack *stack) MLIB; void stack_push(CodeStack *stack,Trpn rpn) MLIB; CodeStack * stack_new(Int16 count) MLIB; void stack_delete(CodeStack *stack) MLIB; void stack_copy(CodeStack *dest,CodeStack *orig) MLIB; CError stack_item_type_nr(CodeStack *stack,rpntype *type,Int16 itnum) MLIB; void stack_reverse(CodeStack *stack) MLIB; double reduce_precision(double value) MLIB; void stack_fix_variables(CodeStack *stack) MLIB; #endif --- NEW FILE: slist.h --- /* * $Id: slist.h,v 1.1 2008/05/26 20:17:55 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000,2001 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _LIST_H_ #define _LIST_H_ #define LIST_INPUT 1000 #define LIST_MIN 1001 #define LIST_MAX 1002 #define LIST_MEAN 1003 #define LIST_SUM 1004 #define LIST_MEDIAN 1005 #define LIST_SORTA 1006 #define LIST_SORTD 1007 #define LIST_GMEAN 1008 #define LIST_PROD 1009 #define LIST_VARIANCE 1010 #define LIST_STDDEV 1011 #define LIST_LINREG 1012 #define LIST_DIM 1013 #define LIST_CUMSUM 1014 #define LIST_MODE 1015 #define LIST_MOMENT 1016 #define LIST_SKEWNESS 1017 #define LIST_KURTOSIS 1018 #define LIST_VARCOEF 1019 #define LIST_RAND 1020 #define LIST_RNORM 1021 #define LIST_RANGE 1022 #define LIST_RTOP 1023 #define LIST_PTOR 1024 #define LIST_CONV 1025 #define LIST_CONCAT 1026 #define LIST_KRON 1027 #define LIST_SAMPLE 1028 #define LIST_FFT 1029 #define LIST_IFFT 1030 #define LIST_DFT 1031 #define LIST_IDFT 1032 #define LIST_DFTSHIFT 1033 #define LIST_FIND 1034 List * list_new(Int16 size) NEWFUNC; List * list_dup(List *oldlist) NEWFUNC; CError list_input(Functype *func,CodeStack *stack) NEWFUNC; void list_delete(List *lst) NEWFUNC; CError list_func(Functype *func,CodeStack *stack) NEWFUNC; CError list_func2(Functype *func,CodeStack *stack) NEWFUNC; CError list_func3(Functype *func,CodeStack *stack) NEWFUNC; CError list_concat(Functype *func,CodeStack *stack) NEWFUNC; CError list_stat(Functype *func,CodeStack *stack) NEWFUNC; CError list_regr(Functype *func,CodeStack *stack) NEWFUNC; CError list_rand(Functype *func,CodeStack *stack) NEWFUNC; CError list_item(Functype *func, CodeStack *stack) NEWFUNC; CError list_range(Functype *func, CodeStack *stack) NEWFUNC; CError list_mathem(Functype *func, CodeStack *stack) NEWFUNC; CError list_filter(Functype *func,CodeStack *stack) NEWFUNC; CError list_factor(Functype *func,CodeStack *stack) NEWFUNC; CError list_gcdex(Functype *func,CodeStack *stack) NEWFUNC; CError list_sift(Functype *func,CodeStack *stack) NEWFUNC; CError list_map(Functype *func,CodeStack *stack) NEWFUNC; CError list_zip(Functype *func,CodeStack *stack) NEWFUNC; CError list_repeat(Functype *func,CodeStack *stack) NEWFUNC; CError list_fourier(Functype *func,CodeStack *stack) NEWFUNC; #endif --- NEW FILE: mathem.h --- /* * $Id: mathem.h,v 1.1 2008/05/26 20:17:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _INTOPS_H #define _INTOPS_H #include "segment.h" /* These are helper constants to allow one function serve * more types of operation. They needn't be unique, but must * be unique inside the function, that operates this type of * operation. */ /* The following about 20 constants are pointers to an array, * be sure you know what you do if you change them */ #define MATH_SIN 0 #define MATH_COS 1 #define MATH_TAN 2 #define MATH_SINH 3 #define MATH_COSH 4 #define MATH_TANH 5 /* */ #define MATH_ASIN 6 #define MATH_ACOS 7 #define MATH_ATAN 8 #define MATH_ASINH 9 #define MATH_ACOSH 10 #define MATH_ATANH 11 /* */ #define MATH_EXP 12 #define MATH_LN 13 #define MATH_LOG 14 #define MATH_SQRT 15 #define MATH_CBRT 16 #define MATH_ABS 17 #define MATH_LOG2 18 #define MATH_FPART 19 #define MATH_FLOOR 20 #define MATH_SIGN 21 #define MATH_CEIL 22 /* */ /****************/ #define MATH_REAL 3029 #define MATH_IMAG 3030 /* */ #define MATH_TRUNC 3031 #define MATH_ROUND 3032 /* */ #define MATH_FACT 3033 #define MATH_GAMMA 3034 /* Combinatorics */ #define MATH_PERM 3035 #define MATH_COMB 3036 /* */ #define MATH_FZERO 3037 /* */ #define MATH_HYPOT 3039 #define MATH_PTORX 3040 #define MATH_PTORY 3041 #define MATH_ATAN2 3042 #define MATH_RTOPD 3043 /* */ #define MATH_FSIMPS 3044 #define MATH_FDYDX1 3046 #define MATH_FMIN 3047 #define MATH_FMAX 3048 #define MATH_FVALUE 3049 #define MATH_ANGLE 3050 #define MATH_FDYDX2 3051 #define MATH_FROMBERG 3052 #define MATH_FINTERSECT 3053 /* */ #define MATH_SEED 3060 /* */ #define MATH_FINPV 3070 #define MATH_FINPMT 3071 #define MATH_FINFV 3072 #define MATH_FINN 3073 #ifdef SPECFUN_ENABLED /* We'll reserve values 100 and up for other special functions */ #define MATH_BETA 100 /* Beta function */ #define MATH_IGAMMA 101 /* incomplete Gamma function */ #define MATH_IBETA 102 /* incomplete Beta function */ #define MATH_ERF 103 /* error function */ #define MATH_ERFC 104 /* complementary error function */ #define MATH_BESSELJ 110 /* Bessel functions of the first kind */ #define MATH_BESSELY 111 /* Bessel functions of the second kind */ #define MATH_BESSELI 112 /* Modified Bessel functions, first kind */ #define MATH_BESSELK 113 /* Modified Bessel functions, second kind */ #define MATH_AIRY 114 /* Airy function, Ai */ #define MATH_BIRY 115 /* Airy function, Bi */ #define MATH_ELLC1 120 /* Complete Elliptic Integral, 1st kind */ #define MATH_ELLC2 121 /* Complete Elliptic Integral, 2nd kind */ #define MATH_ELLI1 122 /* Incomplete Elliptic Integral, 1st kind */ #define MATH_ELLI2 123 /* Incomplete Elliptic Integral, 1st kind */ #define MATH_SN 124 /* Jacobian elliptic function sn */ #define MATH_CN 125 /* Jacobian elliptic function cn */ #define MATH_DN 126 /* Jacobian elliptic function dn */ #define MATH_HYPGG 130 /* Gaussian hypergeometric function F */ #define MATH_HYPGC 131 /* Confluent hypergeometric function M */ #define MATH_ALGNDRF 140 /* associated Legendre functions */ #define MATH_SPHHARM 141 /* spherical harmonics */ #endif #define MATH_GCD 142 #define MATH_LCM 143 #define MATH_MODINV 144 #define MATH_MODPOW 145 #define MATH_CHINESE 146 #define MATH_PHI 147 #define MATH_ISPRIME 148 #define MATH_NEXTPRIME 149 #define MATH_PREVPRIME 150 /* Mathematical declarations */ #ifndef M_PIl #define M_PIl 3.14159265358979323846 #endif #define M_PI_SQRT 1.77245385091 CError math_cmpeq(Functype *func,CodeStack *stack) BASEFUNC; CError math_cmp(Functype *func,CodeStack *stack) BASEFUNC; CError math_oper(Functype *func,CodeStack *stack) BASEFUNC; CError math_neg(Functype *func,CodeStack *stack) BASEFUNC; CError math_trigo(Functype *func,CodeStack *stack) BASEFUNC; CError math_arctrigo(Functype *func,CodeStack *stack) BASEFUNC; CError math_math(Functype *func,CodeStack *stack) BASEFUNC; CError math_bin(Functype *func,CodeStack *stack) BASEFUNC; CError math_fact(Functype *func,CodeStack *stack) BASEFUNC; CError math_gamma(Functype *func,CodeStack *stack) BASEFUNC; CError math_int(Functype *func,CodeStack *stack) BASEFUNC; CError math_comb(Functype *func,CodeStack *stack) BASEFUNC; CError math_convcoord(Functype *func,CodeStack *stack) BASEFUNC; CError math_round(Functype *func,CodeStack *stack) BASEFUNC; CError math_apostrophe(Functype *func,CodeStack *stack) BASEFUNC; CError math_seed(Functype *func,CodeStack *stack) BASEFUNC; CError math_financial(Functype *func,CodeStack *stack) BASEFUNC; CError math_gcd(Functype *func,CodeStack *stack) BASEFUNC; CError math_modinv(Functype *func,CodeStack *stack) BASEFUNC; CError math_modpow(Functype *func,CodeStack *stack) BASEFUNC; CError math_chinese(Functype *func,CodeStack *stack) BASEFUNC; CError math_phi(Functype *func,CodeStack *stack) BASEFUNC; CError math_primes(Functype *func,CodeStack *stack) BASEFUNC; double math_rad_to_user(double angle) BASEFUNC; double math_user_to_rad(double angle) BASEFUNC; UInt8 factorize(Int32 value, Int32* dest) BASEFUNC; UInt32 gcd(UInt32 a, UInt32 b) BASEFUNC; UInt32 gcdex(UInt32 a, UInt32 b, Int32* coA, Int32* coB) BASEFUNC; double sgn(double x) MLIB; #endif |
|
From: Mapi B. <ma...@us...> - 2008-05-26 20:17:51
|
Update of /cvsroot/easycalc/PPCport/skins In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv17754/skins Log Message: Directory /cvsroot/easycalc/PPCport/skins added to the repository |
|
From: Mapi B. <ma...@us...> - 2008-05-26 20:17:08
|
Update of /cvsroot/easycalc/PPCport/mlib In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv17742/mlib Log Message: Directory /cvsroot/easycalc/PPCport/mlib added to the repository |
|
From: Mapi B. <ma...@us...> - 2008-05-26 20:16:20
|
Update of /cvsroot/easycalc/PPCport/include In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv17728/include Log Message: Directory /cvsroot/easycalc/PPCport/include added to the repository |
|
From: Mapi B. <ma...@us...> - 2008-05-26 20:12:19
|
Update of /cvsroot/easycalc/PPCport In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv16061 Added Files: varmgr.h Log Message: 1st upload, not compiling. --- NEW FILE: varmgr.h --- /* * $Id: varmgr.h,v 1.1 2008/05/26 20:12:16 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _VARMGR_H_ #define _VARMGR_H_ #define MAX_LIST_LENGTH 13 #define MAX_EDIT_TITLE 30 char * history_popup(void) IFACE; char * varmgr_popup(rpntype type) IFACE; char * varmgr_popup_builtin(void) IFACE; //Boolean VarmgrEntryHandleEvent(EventPtr event) IFACE; Boolean varmgr_edit(const char *varname,char *title,rpntype type, Boolean editname,const char *parameter) IFACE; Boolean varmgr_get_double(double *value,char *title) IFACE; Boolean varmgr_get_complex(Complex *value,char *title) IFACE; Boolean varmgr_get_varstring(char *varname,char *title) IFACE; #endif |
Update of /cvsroot/easycalc/PPCport In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv14792 Added Files: EasyCalc.vcproj EasyCalcppc.rc EasyCalcppc.rc2 grprefs.h Main.cpp Main.h prefs.h ReadMe.txt resourceppc.h result.cpp result.h shell_loadimage.cpp shell_loadimage.h Skin.cpp Skin.h StateManager.cpp StateManager.h stdafx.cpp stdafx.h Log Message: 1st upload, not compiling. --- NEW FILE: EasyCalcppc.rc2 --- // // EasyCalcPPC.RC2 - resources Microsoft Visual C++ does not edit directly // #ifdef APSTUDIO_INVOKED #error this file is not editable by Microsoft Visual C++ #endif //APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // Add manually edited resources here... ///////////////////////////////////////////////////////////////////////////// HI_RES_AWARE CEUX {1} // turn off the emulation layer // Remove this resource to enable pixel- // doubling on platforms that support it ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // // SHMENUBAR // IDR_MENU SHMENUBAR DISCARDABLE BEGIN IDR_MENU, 3, I_IMAGENONE, IDM_FILE, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_FILE, 0, 0, I_IMAGENONE, IDM_EDIT, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_EDIT, 0, 1, I_IMAGENONE, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_HELP, 0, 2, END --- NEW FILE: Main.cpp --- /* * $Id: Main.cpp,v 1.1 2008/05/26 20:09:53 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000,2001 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, [...1167 lines suppressed...] if(k) goto exit; else{ FldSetSelection(field,j,j+1); calc_nil_timeout(40); BrH=1; } } else if(BrH==1) { FldSetSelection(GetObjectPtr(tdInput),start,start); exit: calc_nil_timeout(evtWaitForever); BrH=0; } handled=true; break; } return handled; } --- NEW FILE: grprefs.h --- /* * $Id: grprefs.h,v 1.1 2008/05/26 20:09:53 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _GRPREFS_H_ #define _GRPREFS_H_ #include "segment.h" #include "defuns.h" #define MAX_GRFUNCS 6 #define MIN_LOG_VAL 1E-5 typedef enum { graph_func, graph_polar, graph_param }Tfunctype; typedef struct { double xmin,ymin; double xmax,ymax; double xscale,yscale; double fimin,fimax,fistep; double tmin,tmax,tstep; Tfunctype functype; char funcFunc[MAX_GRFUNCS][MAX_FUNCNAME+1]; char funcPol[MAX_GRFUNCS][MAX_FUNCNAME+1]; char funcPar[MAX_GRFUNCS][2][MAX_FUNCNAME+1]; Boolean logx,logy; Int16 speed; IndexedColorType colors[9]; Boolean grEnable[9]; Int8 grType[6]; }TgrPrefs; /* Screen preferences in pixels */ /* Please note, the ymax is de facto smaller then ymin on the screen */ typedef struct { /* The Y screen max is the smallest value */ /*0,0 1,0 */ /*0,1 */ /*0,2[beginning of graph */ Coord xmin,ymax; Coord xmax,ymin; /* Cached coeficients for graph2screen computations */ /* CacheTrans MUST be called when any of the ScrPrefs * and graphPrefs attributes is changed */ double xtrans,ytrans; /* cached logaritms, it is quite slow to calculate */ double logxtrans,logytrans; double logxmin,logymin; }TscrPrefs; //Boolean GraphPrefsHandleEvent(EventPtr event) IFACE; void grpref_init(void) IFACE; void grpref_close(void) IFACE; extern TgrPrefs graphPrefs; extern TscrPrefs ScrPrefs; extern IndexedColorType graphColors[]; CError set_axis(Functype *func,CodeStack *stack) GRAPH; #endif --- NEW FILE: result.h --- /* * $Id: result.h,v 1.1 2008/05/26 20:09:54 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _RESULT_H_ #define _RESULT_H_ #include "display.h" #include "skin.h" typedef enum { COPYRESULT=0, VARSAVEAS, DEFMGR, GUESSIT, TODEGREE, TORADIAN, TOGONIO, TOCIS, ENGDISPLAY, TODEGREE2 }resSelection; #define SELECTION_COUNT 9 typedef enum { plaintext, powtext, fmtnumber }printType; typedef struct { rpntype ansType; printType formatType; Tbase dispBase; }TresultPrefs; void result_copy(void) IFACE; void result_init(Int16 id) IFACE; void result_destroy(void) IFACE; void result_clear_arrowflags(void) IFACE; void result_draw(void) IFACE; Boolean result_track(Coord x,Coord y) IFACE; void result_set(Trpn item) IFACE; void result_set_text(char *text,rpntype type) IFACE; void result_set_pow(char *text) IFACE; void result_popup(void) IFACE; void result_error(CError errcode) IFACE; #endif --- NEW FILE: shell_loadimage.cpp --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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 *****************************************************************************/ /* shell_loadimage.cpp : load a GIF file. *****************************************************************************/ #include "stdafx.h" #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "Skin.h" typedef struct { unsigned char *pixels; SkinColor *cmap; int depth; int width, height, bytesperline; } SkinPixmap; static SkinPixmap pixmap; static Skin *skin; static int read_byte(int *n) { int c = skin->getchar(); if (c == EOF) return (0); *n = c; return (1); } static int read_short(int *n) { int c1, c2; c1 = skin->getchar(); if (c1 == EOF) return (0); c2 = skin->getchar(); if (c2 == EOF) return (0); *n = c1 + (c2 << 8); return (1); } int shell_loadimage(Skin *pskin) { SkinPixmap *pm = &pixmap; SkinColor *lcmap = NULL; int sig; int info; int background; int zero; int has_global_cmap; int bpp; int ncolors; int size; int mono; int invert; int i, j, type, res; unsigned char *ptr; skin = pskin; if (!read_byte(&sig) || (sig != 'G') || !read_byte(&sig) || (sig != 'I') || !read_byte(&sig) || (sig != 'F') || !read_byte(&sig) || (sig != '8') || !read_byte(&sig) || ((sig != '7') && (sig != '9')) || !read_byte(&sig) || (sig != 'a') ) { fprintf(stderr, "GIF signature not found.\n"); return (0); } if (!read_short(&pm->width) || !read_short(&pm->height) || !read_byte(&info) || !read_byte(&background) || !read_byte(&zero) || (zero != 0) ) { fprintf(stderr, "Fatally premature EOF.\n"); return (0); } has_global_cmap = (info & 128) != 0; bpp = (info & 7) + 1; ncolors = 1 << bpp; size = 0; /* Bits 6..4 of info contain one less than the "color resolution", * defined as the number of significant bits per RGB component in * the source image's color palette. If the source image (from * which the GIF was generated) was 24-bit true color, the color * resolution is 8, so the value in bits 6..4 is 7. If the source * image had an EGA color cube (2x2x2), the color resolution would * be 2, etc. * Bit 3 of info must be zero in GIF87a; in GIF89a, if it is set, * it indicates that the global colormap is sorted, the most * important entries being first. In PseudoColor environments this * can be used to make sure to get the most important colors from * the X server first, to optimize the image's appearance in the * event that not all the colors from the colormap can actually be * obtained at the same time. * The 'zero' field is always 0 in GIF87a; in GIF89a, it indicates * the pixel aspect ratio, as (PAR + 15) : 64. If PAR is zero, * this means no aspect ratio information is given, PAR = 1 means * 1:4 (narrow), PAR = 49 means 1:1 (square), PAR = 255 means * slightly over 4:1 (wide), etc. */ pm->cmap = (SkinColor *) malloc(256 * sizeof(SkinColor)); // TODO - handle memory allocation failure if (has_global_cmap) { for (i=0 ; i<ncolors ; i++) { int r, g, b; if (!read_byte(&r) || !read_byte(&g) || !read_byte(&b) ) { fprintf(stderr, "Fatally premature EOF.\n"); goto failed; } pm->cmap[i].r = r; pm->cmap[i].g = g; pm->cmap[i].b = b; } } else { for (i=0 ; i<ncolors ; i++) { int k = (i * 255) / (ncolors - 1); pm->cmap[i].r = k; pm->cmap[i].g = k; pm->cmap[i].b = k; } } /* Set unused colormap entries to 'black' */ for (i=ncolors ; i<256 ; i++) { pm->cmap[i].r = 0; pm->cmap[i].g = 0; pm->cmap[i].b = 0; } if (ncolors == 2) { /* Test for true black & white */ if ((pm->cmap[0].r == 0) && (pm->cmap[0].g == 0) && (pm->cmap[0].b == 0) && (pm->cmap[1].r == 255) && (pm->cmap[1].g == 255) && (pm->cmap[1].b == 255) ) { mono = 1; invert = 0; } else if ((pm->cmap[0].r == 255) && (pm->cmap[0].g == 255) && (pm->cmap[0].b == 255) && (pm->cmap[1].r == 0) && (pm->cmap[1].g == 0) && (pm->cmap[1].b == 0) ) { mono = 1; invert = 1; } else mono = 0; } else mono = 0; if (mono) { pm->depth = 1; pm->bytesperline = ((pm->width + 31) >> 3) & ~3; } else { pm->depth = 8; pm->bytesperline = (pm->width + 3) & ~3; } size = pm->bytesperline * pm->height; pm->pixels = (unsigned char *) malloc(size); // TODO - handle memory allocation failure memset(pm->pixels, pm->depth == 1 ? background * 255 : background, size); while (1) { int whatnext; if (!read_byte(&whatnext)) goto unexp_eof; if (whatnext == ',') { /* Image */ int ileft, itop, iwidth, iheight; int info; int lbpp; int lncolors; int interlaced; int h; int v; int codesize; int bytecount; short prefix_table[4096]; short code_table[4096]; int maxcode; int clear_code; int end_code; int curr_code_size; int curr_code; int old_code; int bits_needed; int end_code_seen; if (!read_short(&ileft) || !read_short(&itop) || !read_short(&iwidth) || !read_short(&iheight) || !read_byte(&info) ) { goto unexp_eof; } if (itop + iheight > pm->height || ileft + iwidth > pm->width) { fprintf(stderr, "Image position and size not contained within screen size!\n"); goto failed; } /* Bit 3 of info must be zero in GIF87a; in GIF89a, if it * is set, it indicates that the local colormap is sorted, * the most important entries being first. In PseudoColor * environments this can be used to make sure to get the * most important colors from the X server first, to * optimize the image's appearance in the event that not * all the colors from the colormap can actually be * obtained at the same time. */ if ((info & 128) == 0) { /* Using global color map */ lcmap = pm->cmap; lbpp = bpp; lncolors = ncolors; } else { /* Using local color map */ lbpp = (info & 7) + 1; lncolors = 1 << lbpp; lcmap = (SkinColor *) malloc(256 * sizeof(SkinColor)); // TODO - handle memory allocation failure for (i=0 ; i<lncolors ; i++) { int r, g, b; if (!read_byte(&r) || !read_byte(&g) || !read_byte(&b) ) goto unexp_eof; lcmap[i].r = r; lcmap[i].g = g; lcmap[i].b = b; } if (pm->depth != 24) { int newbytesperline = pm->width * 4; int v, h; unsigned char *newpixels = (unsigned char *) malloc(newbytesperline * pm->height); // TODO - handle memory allocation failure for (v=0 ; v<pm->height ; v++) for (h=0 ; h<pm->width ; h++) { unsigned char pixel, *newpixel; if (pm->depth == 1) pixel = (pm->pixels[pm->bytesperline * v + (h >> 3)] >> (h & 7)) & 1; else pixel = pm->pixels[pm->bytesperline * v + h]; newpixel = newpixels + (newbytesperline * v + 4 * h); newpixel[0] = 0; newpixel[1] = pm->cmap[pixel].r; newpixel[2] = pm->cmap[pixel].g; newpixel[3] = pm->cmap[pixel].b; } free(pm->pixels); pm->pixels = newpixels; pm->bytesperline = newbytesperline; pm->depth = 24; } } interlaced = (info & 64) != 0; h = 0; v = 0; if (!read_byte(&codesize) || !read_byte(&bytecount)) goto unexp_eof; maxcode = 1 << codesize; for (i=0 ; i<maxcode+2 ; i++) { prefix_table[i] = -1; code_table[i] = i; } clear_code = maxcode++; end_code = maxcode++; curr_code_size = codesize + 1; curr_code = 0; old_code = -1; bits_needed = curr_code_size; end_code_seen = 0; while (bytecount != 0) { for (i=0 ; i<bytecount ; i++) { int currbyte; int bits_available; if (!read_byte(&currbyte)) goto unexp_eof; if (end_code_seen) continue; bits_available = 8; while (bits_available != 0) { int bits_copied = (bits_needed < bits_available) ? bits_needed : bits_available; int bits = currbyte >> (8 - bits_available); bits &= 255 >> (8 - bits_copied); curr_code |= bits << (curr_code_size - bits_needed); bits_available -= bits_copied; bits_needed -= bits_copied; if (bits_needed == 0) { if (curr_code == end_code) { end_code_seen = 1; } else if (curr_code == clear_code) { maxcode = (1 << codesize) + 2; curr_code_size = codesize + 1; old_code = -1; } else { unsigned char expanded[4096]; int explen; if (curr_code < maxcode) { if (maxcode < 4096 && old_code != -1) { int c = curr_code; while (prefix_table[c] != -1) c = prefix_table[c]; c = code_table[c]; prefix_table[maxcode] = old_code; code_table[maxcode] = c; maxcode++; if ((maxcode == (1 << curr_code_size)) && (curr_code_size < 12)) curr_code_size++; } } else if (curr_code == maxcode) { /* Once maxcode == 4096, we can't get here * any more, because we refuse to raise * curr_code_size above 12 -- so we can * never read a bigger code than 4095. */ int c; if (old_code == -1) { fprintf(stderr, "Out-of-sequence code in compressed data.\n"); goto done; } c = old_code; while (prefix_table[c] != -1) c = prefix_table[c]; c = code_table[c]; prefix_table[maxcode] = old_code; code_table[maxcode] = c; maxcode++; if ((maxcode == (1 << curr_code_size)) && (curr_code_size < 12)) curr_code_size++; } else { fprintf(stderr, "Out-of-sequence code in compressed data.\n"); goto done; } old_code = curr_code; /* Output curr_code! */ explen = 0; while (curr_code != -1) { expanded[explen++] = (unsigned char) code_table[curr_code]; curr_code = prefix_table[curr_code]; } for (j=explen-1 ; j>=0 ; j--) { int pixel = expanded[j]; if (pm->depth == 8) pm->pixels[pm->bytesperline * (itop + v) + ileft + h] = pixel; else if (pm->depth == 24) { unsigned char *rgb = pm->pixels + (pm->bytesperline * (itop + v) + 4 * (ileft + h)); rgb[0] = 0; rgb[1] = lcmap[pixel].r; rgb[2] = lcmap[pixel].g; rgb[3] = lcmap[pixel].b; } else { /* VERY inefficient. 16 memory accesses * to write one byte. Then again, 1-bit * images never consume very many bytes * and I'm in a hurry. Maybe TODO. */ int x = ileft + h; int index = pm->bytesperline * (itop + v) + (x >> 3); unsigned char mask = 1 << (x & 7); if (pixel) pm->pixels[index] |= mask; else pm->pixels[index] &= ~mask; } if (++h == iwidth) { h = 0; if (interlaced) { switch (v & 7) { case 0: v += 8; if (v < iheight) break; /* Some GIF en/decoders go * straight from the '0' * pass to the '4' pass * without checking the * height, and blow up on * 2/3/4 pixel high * interlaced images. */ if (iheight > 4) v = 4; else if (iheight > 2) v = 2; else if (iheight > 1) v = 1; else end_code_seen = 1; break; case 4: v += 8; if (v >= iheight) v = 2; break; case 2: case 6: v += 4; if (v >= iheight) v = 1; break; case 1: case 3: case 5: case 7: v += 2; if (v >= iheight) end_code_seen = 1; break; } if (end_code_seen) break; } else { if (++v == iheight) { end_code_seen = 1; break; } } } } } curr_code = 0; bits_needed = curr_code_size; } } } if (!read_byte(&bytecount)) goto unexp_eof; } if (lcmap != pm->cmap) free(lcmap); lcmap = NULL; } else if (whatnext == '!') { /* Extension block */ int function_code, byte_count; if (!read_byte(&function_code)) goto unexp_eof; if (!read_byte(&byte_count)) goto unexp_eof; while (byte_count != 0) { for (i=0 ; i<byte_count ; i++) { int dummy; if (!read_byte(&dummy)) goto unexp_eof; } if (!read_byte(&byte_count)) goto unexp_eof; } } else if (whatnext == ';') { /* Terminator */ break; } else { fprintf(stderr, "Unrecognized tag '%c' (0x%02x).\n", whatnext, whatnext); goto failed; } } done: if (lcmap != NULL && lcmap != pm->cmap) free(lcmap); if (pm->depth == 24) { free(pm->cmap); pm->cmap = NULL; } if (pm->depth == 1) { free(pm->cmap); pm->cmap = NULL; if (invert) for (i=0 ; i<size ; i++) pm->pixels[i] = ~pm->pixels[i]; } /* Successfully read the image. Now, write it out: */ if (pm->depth == 1) type = IMGTYPE_MONO; else if (pm->depth == 8) type = IMGTYPE_COLORMAPPED; else /* pm->depth == 24 */ type = IMGTYPE_TRUECOLOR; res = skin->init_image(type, 256, pm->cmap, pm->width, pm->height); if (res) { ptr = pm->pixels; for (i=0 ; i<pm->height ; i++) { skin->put_pixels(ptr); ptr += pm->bytesperline; } skin->finish_image(); } /* Done writing; delete the image and return. */ if (pm->cmap != NULL) free(pm->cmap); free(pm->pixels); return (res); unexp_eof: fprintf(stderr, "Unexpected EOF.\n"); goto done; failed: if (lcmap != NULL && lcmap != pm->cmap) free(lcmap); if (pm->cmap != NULL) { free(pm->cmap); pm->cmap = NULL; } if (pm->pixels != NULL) { free(pm->pixels); pm->pixels = NULL; } return (0); } --- NEW FILE: Skin.h --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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 *****************************************************************************/ /* skin.h : Skin object for handling the skins of the calculator. *****************************************************************************/ #ifndef SKIN_H #define SKIN_H 1 #include <windows.h> #include "core_globals.h" typedef struct { int x, y; } SkinPoint; typedef struct { int x, y, width, height; } SkinRect; typedef struct { int code, shifted_code; SkinRect sens_rect; SkinRect disp_rect; SkinPoint src; } SkinKey; typedef struct { unsigned char r, g, b, pad; } SkinColor; #define IMGTYPE_MONO 1 #define IMGTYPE_GRAY 2 #define IMGTYPE_COLORMAPPED 3 #define IMGTYPE_TRUECOLOR 4 #define KEYMAP_MAX_MACRO_LENGTH 31 typedef struct { bool ctrl; bool alt; bool shift; bool cshift; int keycode; unsigned char macro[KEYMAP_MAX_MACRO_LENGTH + 1]; } keymap_entry; #define SKIN_MAX_MACRO_LENGTH 31 typedef struct _SkinMacro { int code; unsigned char macro[SKIN_MAX_MACRO_LENGTH + 1]; struct _SkinMacro *next; } SkinMacro; typedef struct { SkinRect disp_rect; SkinPoint src; SkinPoint sel; } SkinAnnunciator; #define RESULTAREA_SIZE 128 #define INPUTAREA_SIZE 2048 class Skin { protected: SkinRect skin; // Description of the skin on screen // Used while loading a skin; specifies how much to enlarge it. // This is necessary to force low-res skins to fill high-res screens. int magnification; SkinPoint display_loc; // Description of the display in the skin int display_w, display_h; SkinPoint display_scale; COLORREF display_bg, display_fg; SkinKey *keylist; // Array of keys in the skin int nkeys; // Number of keys in the skin int keys_cap; // Number of allocated keys from memory SkinMacro *macrolist; // Array of macros specified in the layout file SkinAnnunciator annunciators[NB_ANNUN]; // Array of annunciators FILE *external_file; // Handle for external file, if not an internal file // NULL if internal file. const unsigned char *builtin_file; // Handle for the internal file long builtin_length; // Length of internal file long builtin_pos; // Cur pos in the internal file int skin_type; int skin_width, skin_height; int skin_ncolors; const SkinColor *skin_colors; int skin_y; unsigned char *skin_bitmap; // Contains the bitmap of the skin int skin_bytesperline; BITMAPINFOHEADER *skin_header; HBITMAP skin_dib; unsigned char *disp_bitmap; int disp_bytesperline; TCHAR dispResult[RESULTAREA_SIZE]; // Contains the result area string TCHAR inputText[INPUTAREA_SIZE]; // Used to get the input area string HWND hwndE; // The handle to the edit control input area bool landscape; keymap_entry *keymap; int keymap_length; bool display_enabled; // Enable or disable screen repaints. keymap_entry *parse_keymap_entry(char *line, int lineno); int open(const TCHAR *skinname, const TCHAR *basedir, int open_layout); void close(); int gets(char *buf, int buflen); int make_dib(HDC hdc); public: Skin(); // Constructor void load(TCHAR *skinname, const TCHAR *basedir, int width, int height); int getchar(); void rewind(); int init_image(int type, int ncolors, const SkinColor *colors, int width, int height); void put_pixels(unsigned const char *data); void finish_image(); void repaint(HDC hdc, HDC memdc); void repaint_annunciator(HDC hdc, HDC memdc, int which, int state); void find_key(int x, int y, bool cshift, int *skey, int *ckey); int find_skey(int ckey); unsigned char *find_macro(int ckey); unsigned char *keymap_lookup(int keycode, bool ctrl, bool alt, bool shift, bool cshift, bool *exact); void repaint_key(HDC hdc, HDC memdc, int key, int state); void display_blitter(HDC hdc, const char *bits, int bytesperline, int x, int y, int width, int height); void repaint_display(HDC hdc, HDC memdc); COLORREF getDisplayFgColor(); COLORREF getDisplayBgColor(); void create_input_area(HWND hwnd, HINSTANCE hinst); void insert_input_text(TCHAR *text); void set_input_text(TCHAR *text); TCHAR *get_input_text(); void print_result(HDC hdc, TCHAR *res_text); void print_result(HDC hdc); void display_set_enabled(bool enable); }; #endif --- NEW FILE: StateManager.cpp --- #include "StdAfx.h" #include "StateManager.h" StateManager::StateManager(void) { // Set interface and calculator options to their defaults stateFile = NULL; state.skinName[0][0] = 0; state.skinName[1][0] = 0; state.skinName[2][0] = 0; state.cur_skin_nb = 0; state.mouse_cont = true; historyDB.in_state = false; } StateManager::~StateManager(void) { } t_state *StateManager::init(TCHAR *fn) { stateFilename = fn; stateFile = _tfopen(fn, _T("rb")); if (stateFile != NULL) { if (read_shell_state(&version)) init_mode = 1; else { // Incorrect version/contents, create the state contents init_shell_state(-1); init_mode = 2; } } else { // No state file, create the state contents init_shell_state(-1); init_mode = 0; } // Close the file if was open if (stateFile != NULL) { fclose(stateFile); stateFile = NULL; } return (&state); } /******************************************************************************** * FUNCTION: init_shell_state(int4) * * Initialize the state module structure * ********************************************************************************/ /* private */ void StateManager::init_shell_state(int4 version) { switch (version) { case -1: // Set interface and calculator options to their defaults // fall through case 0: // current version, // so nothing to do here since everything // was initialized from the state file. ; } } /******************************************************************************** * FUNCTION: shell_read_saved_state(*void, int4) * * Read a piece from the state file. * * Returns the number of read bytes. * ********************************************************************************/ /* private */ int4 StateManager::shell_read_saved_state(void *buf, int4 bufsize) { if (stateFile == NULL) return (-1); else { int4 n = fread(buf, 1, bufsize, stateFile); if (n != bufsize && ferror(stateFile)) { // On error, close the file fclose(stateFile); stateFile = NULL; return (-1); } else return (n); } } /******************************************************************************** * FUNCTION: shell_write_saved_state(*void, int4) * * Write a piece to the state file. * ********************************************************************************/ /* private */ bool StateManager::shell_write_saved_state(const void *buf, int4 nbytes) { if (stateFile == NULL) return (false); else { int4 n = fwrite(buf, 1, nbytes, stateFile); if (n != nbytes) { // On error, close the file, and remove whatever we have written so far. fclose(stateFile); DeleteFile(stateFilename); stateFile = NULL; return (false); } else { return (true); } } } /******************************************************************************** * FUNCTION: read_shell_state(*int4) * * Read the state module structure from file * ********************************************************************************/ /* private */ bool StateManager::read_shell_state(int4 *ver) { int4 magic; int4 version; int4 state_size; int4 state_version; if (shell_read_saved_state(&magic, sizeof(int4)) != sizeof(int4)) return (false); if (magic != EASYCALC_MAGIC) return (false); if (shell_read_saved_state(&version, sizeof(int4)) != sizeof(int4)) return (false); if (version < 0 || version > EASYCALC_VERSION) /* Unknown state file version */ return (false); if (version > 0) { if (shell_read_saved_state(&state_size, sizeof(int4)) != sizeof(int4)) return (false); if (shell_read_saved_state(&state_version, sizeof(int4)) != sizeof(int4)) return (false); if ((state_version < 0) || (state_version > SHELL_VERSION)) /* Unknown shell state version */ return (false); if (shell_read_saved_state(&state, state_size) != state_size) return (false); // Initialize the parts of the shell state // that were NOT read from the state file init_shell_state(state_version); } else { // Version 0 init_shell_state(-1); } *ver = version; return (true); } /******************************************************************************** * FUNCTION: write_shell_state() * * Saves the state module structure to file for the next run. * ********************************************************************************/ /* private */ bool StateManager::write_shell_state() { int4 magic = EASYCALC_MAGIC; int4 version = EASYCALC_VERSION; int4 state_size = sizeof(t_state); int4 state_version = SHELL_VERSION; if (!shell_write_saved_state(&magic, sizeof(int4))) return (false); if (!shell_write_saved_state(&version, sizeof(int4))) return (false); if (!shell_write_saved_state(&state_size, sizeof(int4))) return (false); if (!shell_write_saved_state(&state_version, sizeof(int4))) return (false); if (!shell_write_saved_state(&state, sizeof(t_state))) return (false); return (true); } --- NEW FILE: EasyCalc.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="9,00" Name="EasyCalc" ProjectGUID="{7CA1BE77-23EF-4061-B55D-227874102059}" RootNamespace="EasyCalc" Keyword="Win32Proj" TargetFrameworkVersion="131072" > <Platforms> <Platform Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" /> <Platform Name="Windows Mobile 6 Professional SDK (ARMV4I)" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" OutputDirectory="$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="1" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" AdditionalIncludeDirectories="E:\AppsDev\EasyCalc\EasyCalc;E:\AppsDev\EasyCalc\EasyCalc\include" PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;POCKETPC2003_UI_MODEL;SPECFUN_ENABLED;GRAPHS_ENABLED" MinimalRebuild="true" RuntimeLibrary="1" UsePrecompiledHeader="2" WarningLevel="3" DebugInformationFormat="3" ShowIncludes="true" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)" Culture="1033" AdditionalIncludeDirectories=""$(IntDir)"" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalOptions=" /subsystem:windowsce,5.01" OutputFile="$(OutDir)/EasyCalc.exe" LinkIncremental="2" DelayLoadDLLs="$(NOINHERIT)" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/EasyCalc.pdb" SubSystem="0" StackReserveSize="65536" StackCommitSize="4096" RandomizedBaseAddress="1" DataExecutionPrevention="0" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> <DeploymentTool ForceDirty="-1" RemoteDirectory="" RegisterOutput="0" AdditionalFiles="" /> <DebuggerTool /> </Configuration> <Configuration Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" OutputDirectory="$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="1" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;POCKETPC2003_UI_MODEL" MinimalRebuild="true" RuntimeLibrary="1" UsePrecompiledHeader="2" WarningLevel="3" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)" Culture="1033" AdditionalIncludeDirectories="$(IntDir)" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalOptions=" /subsystem:windowsce,5.02" OutputFile="$(OutDir)/EasyCalc.exe" LinkIncremental="2" DelayLoadDLLs="$(NOINHERIT)" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/EasyCalc.pdb" SubSystem="0" StackReserveSize="65536" StackCommitSize="4096" RandomizedBaseAddress="1" DataExecutionPrevention="0" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> <DeploymentTool ForceDirty="-1" RemoteDirectory="" RegisterOutput="0" AdditionalFiles="" /> <DebuggerTool /> </Configuration> <Configuration Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" OutputDirectory="$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="1" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="2" FavorSizeOrSpeed="2" PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;POCKETPC2003_UI_MODEL" RuntimeLibrary="0" UsePrecompiledHeader="2" WarningLevel="3" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)" Culture="1033" AdditionalIncludeDirectories="$(IntDir)" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalOptions=" /subsystem:windowsce,5.01" OutputFile="$(OutDir)/EasyCalc.exe" LinkIncremental="1" DelayLoadDLLs="$(NOINHERIT)" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/EasyCalc.pdb" SubSystem="0" StackReserveSize="65536" StackCommitSize="4096" OptimizeReferences="2" EnableCOMDATFolding="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> <DeploymentTool ForceDirty="-1" RemoteDirectory="" RegisterOutput="0" AdditionalFiles="" /> <DebuggerTool /> </Configuration> <Configuration Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" OutputDirectory="$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="1" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="2" FavorSizeOrSpeed="2" PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;POCKETPC2003_UI_MODEL" RuntimeLibrary="0" UsePrecompiledHeader="2" WarningLevel="3" DebugInformationFormat="3" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)" Culture="1033" AdditionalIncludeDirectories="$(IntDir)" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalOptions=" /subsystem:windowsce,5.02" OutputFile="$(OutDir)/EasyCalc.exe" LinkIncremental="1" DelayLoadDLLs="$(NOINHERIT)" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/EasyCalc.pdb" SubSystem="0" StackReserveSize="65536" StackCommitSize="4096" OptimizeReferences="2" EnableCOMDATFolding="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> <DeploymentTool ForceDirty="-1" RemoteDirectory="" RegisterOutput="0" AdditionalFiles="" /> <DebuggerTool /> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > <File RelativePath=".\core_display.cpp" > </File> <File RelativePath=".\core_globals.cpp" > </File> <File RelativePath=".\core_main.cpp" > </File> <File RelativePath=".\DataManager.cpp" > </File> <File RelativePath=".\dbutil.cpp" > </File> <File RelativePath=".\EasyCalc.cpp" > </File> <File RelativePath=".\Main.cpp" > </File> <File RelativePath=".\result.cpp" > </File> <File RelativePath=".\shell_loadimage.cpp" > </File> <File RelativePath=".\Skin.cpp" > </File> <File RelativePath=".\StateManager.cpp" > </File> <File RelativePath=".\stdafx.cpp" > <FileConfiguration Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" > <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1" /> </FileConfiguration> <FileConfiguration Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" > <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1" /> </FileConfiguration> <FileConfiguration Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" > <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1" /> </FileConfiguration> <FileConfiguration Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" > <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1" /> </FileConfiguration> </File> <Filter Name="mlib" > <File RelativePath=".\mlib\history.cpp" > </File> <File RelativePath=".\mlib\konvert.cpp" > </File> <File RelativePath=".\mlib\stack.cpp" > </File> </Filter> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > <File RelativePath=".\ansops.h" > </File> <File RelativePath=".\chkstack.h" > </File> <File RelativePath=".\core_display.h" > </File> <File RelativePath=".\core_globals.h" > </File> <File RelativePath=".\core_main.h" > </File> <File RelativePath=".\core_tables.h" > </File> <File RelativePath=".\EasyCalc.h" > </File> <File RelativePath=".\grprefs.h" > </File> <File RelativePath=".\Main.h" > </File> <File RelativePath=".\prefs.h" > </File> <File RelativePath=".\resourceppc.h" > </File> <File RelativePath=".\result.h" > </File> <File RelativePath=".\shell_loadimage.h" > </File> <File RelativePath=".\Skin.h" > </File> <File RelativePath=".\StateManager.h" > </File> <File RelativePath=".\stdafx.h" > </File> <File RelativePath=".\varmgr.h" > </File> <Filter Name="include" > <File RelativePath=".\include\calcDB.h" > </File> <File RelativePath=".\include\cmatrix.h" > </File> <File RelativePath=".\include\complex.h" > </File> <File RelativePath=".\DataManager.h" > </File> <File RelativePath=".\include\dbutil.h" > </File> <File RelativePath=".\include\defuns.h" > </File> <File RelativePath=".\include\display.h" > </File> <File RelativePath=".\include\fp.h" > </File> <File RelativePath=".\include\funcs.h" > </File> <File RelativePath=".\include\history.h" > </File> <File RelativePath=".\include\integ.h" > </File> <File RelativePath=".\include\konvert.h" > </File> <File RelativePath=".\include\mathem.h" > </File> <File RelativePath=".\include\MathLib.h" > </File> <File RelativePath=".\include\matrix.h" > </File> <File RelativePath=".\include\meqstack.h" > </File> <File RelativePath=".\include\PalmOS.h" > </File> <File RelativePath=".\include\segment.h" > </File> <File RelativePath=".\include\slist.h" > </File> <File RelativePath=".\include\specfun.h" > </File> <File RelativePath=".\include\stack.h" > </File> <File RelativePath=".\include\txtask.h" > </File> </Filter> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" > <File RelativePath=".\EasyCalc.ico" > </File> <File RelativePath=".\EasyCalcppc.rc" > </File> <File RelativePath=".\EasyCalcppc.rc2" > </File> </Filter> <File RelativePath=".\ReadMe.txt" > </File> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: EasyCalcppc.rc --- // Microsoft Visual C++ generated resource script. // #include "resourceppc.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #define APSTUDIO_HIDDEN_SYMBOLS #include "windows.h" #include "resdefce.h" #undef APSTUDIO_HIDDEN_SYMBOLS ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Icon // // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_EASYCALC ICON "EasyCalc.ico" ///////////////////////////////////////////////////////////////////////////// // // Menu // IDR_MENU MENU BEGIN POPUP "File" BEGIN MENUITEM "Exit", IDM_FILE_EXIT END POPUP "Edit" BEGIN MENUITEM "Options", IDM_EDIT_OPTIONS END POPUP "Help" BEGIN MENUITEM "About EasyCalc...", IDM_HELP_ABOUT END END ///////////////////////////////////////////////////////////////////////////// // // Accelerator // IDC_EASYCALC ACCELERATORS BEGIN "Q", IDM_FILE_EXIT, VIRTKEY, CONTROL, NOINVERT "A", IDM_HELP_ABOUT, VIRTKEY, CONTROL, NOINVERT END ///////////////////////////////////////////////////////////////////////////// // // Dialog // IDD_ABOUTBOX DIALOG 8, 18, 120, 101 STYLE DS_SETFONT | WS_POPUP | WS_CAPTION EXSTYLE 0x80000000L CAPTION "About EasyCalc" FONT 8, "MS Sans Serif" BEGIN ICON IDI_EASYCALC,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE LTEXT "EasyCalc Version 1.25",IDC_STATIC_2,12,36,78,8,SS_NOPREFIX LTEXT "Copyright (C) 2008",IDC_STATIC_3,12,48,66,8 END IDD_ABOUTBOX_WIDE DIALOG 18, 8, 138, 84 STYLE DS_SETFONT | WS_POPUP | WS_CAPTION EXSTYLE 0x80000000L CAPTION "About EasyCalc" FONT 8, "MS Sans Serif" BEGIN ICON IDI_EASYCALC,IDC_STATIC_1,9,12,21,20,SS_REALSIZEIMAGE LTEXT "EasyCalc Version 1.25",IDC_STATIC_2,49,12,76,8,SS_NOPREFIX LTEXT "Copyright (C) 2008",IDC_STATIC_3,49,24,66,8 END ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO // #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO BEGIN IDD_ABOUTBOX, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 112 TOPMARGIN, 4 BOTTOMMARGIN, 95 END IDD_ABOUTBOX_WIDE, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 131 TOPMARGIN, 7 BOTTOMMARGIN, 77 END END #endif // APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resourceppc.h\0" END 2 TEXTINCLUDE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" "#include ""resdefce.h""\r\n" "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" "LANGUAGE 9, 1\r\n" "#pragma code_page(1252)\r\n" "#include ""EasyCalcppc.rc2"" // non-Microsoft Visual C++ edited resources\r\n" "#endif\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // String Table // STRINGTABLE BEGIN IDS_APP_TITLE "EasyCalc" IDC_EASYCALC "EASYCALC" END STRINGTABLE BEGIN IDS_FILE "File" IDS_HELP "Help" IDS_EDIT "Edit" END #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // French (France) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) #ifdef _WIN32 LANGUAGE LANG_FRENCH, SUBLANG_FRENCH #pragma code_page(1252) #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Dialog // IDD_OPT_GENERAL DIALOG 0, 0, 139, 181 STYLE DS_SETFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "System" BEGIN LTEXT "General",IDC_TITLE,4,3,63,8 CONTROL "Dynamic mouse",IDC_CHECK_MOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,42,83,10 END IDD_OPT_SKINS DIALOG 0, 0, 139, 181 STYLE DS_SETFONT | WS_POPUP | WS_CAPTION CAPTION "Skins" FONT 8, "System" BEGIN LTEXT "Skins",IDC_TITLE,4,3,63,8 COMBOBOX IDC_COMBO_SKIN1,9,40,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_COMBO_SKIN2,9,59,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_COMBO_SKIN3,9,78,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Skin 1",IDC_SKIN1,62,42,39,10 LTEXT "Skin 2",IDC_SKIN2,62,61,39,10 LTEXT "Skin 3",IDC_SKIN3,62,80,39,10 END #endif // French (France) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) LANGUAGE 9, 1 #pragma code_page(1252) #include "EasyCalcppc.rc2" // non-Microsoft Visual C++ edited resources #endif ///////////////////////... [truncated message content] |
|
From: Mapi B. <ma...@us...> - 2008-05-26 20:08:17
|
Update of /cvsroot/easycalc/PPCport In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv13982 Added Files: ansops.h calcrsc.h chkstack.h core_display.cpp core_display.h core_globals.cpp core_globals.h core_main.cpp core_main.h core_tables.h DataManager.cpp DataManager.h dbutil.cpp EasyCalc.cpp EasyCalc.h Log Message: 1st upload, not compiling. --- NEW FILE: core_globals.h --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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 CORE_GLOBALS_H #define CORE_GLOBALS_H 1 //#include "EasyCalc.h" /**********/ /* Errors */ /**********/ #define ERR_NONE 0 #define ERR_ALPHA_DATA_IS_INVALID 1 #define ERR_INSUFFICIENT_MEMORY 2 #define ERR_NOT_YET_IMPLEMENTED 3 #define ERR_OUT_OF_RANGE 4 #define ERR_DIVIDE_BY_0 5 #define ERR_INVALID_TYPE 6 #define ERR_INVALID_DATA 7 #define ERR_DIMENSION_ERROR 8 #define ERR_SIZE_ERROR 9 #define ERR_INTERNAL_ERROR 10 #define ERR_NONEXISTENT 11 #define ERR_RESTRICTED_OPERATION 12 #define ERR_YES 13 #define ERR_NO 14 #define ERR_STOP 15 #define ERR_LABEL_NOT_FOUND 16 #define ERR_NO_REAL_VARIABLES 17 #define ERR_NO_COMPLEX_VARIABLES 18 #define ERR_NO_MATRIX_VARIABLES 19 #define ERR_NO_MENU_VARIABLES 20 #define ERR_STAT_MATH_ERROR 21 #define ERR_INVALID_FORECAST_MODEL 22 #define ERR_SOLVE_INTEG_RTN_LOST 23 #define ERR_SINGULAR_MATRIX 24 #define ERR_SOLVE_SOLVE 25 #define ERR_INTEG_INTEG 26 #define ERR_RUN 27 #define ERR_INTERRUPTED 28 #define ERR_PRINTING_IS_DISABLED 29 #define ERR_INTERRUPTIBLE 30 #define ERR_NO_VARIABLES 31 /*************/ /* Key codes */ /*************/ #define NB_KEYS 37 #define KEY_SIGMA 1 #define KEY_INV 2 #define KEY_SQRT 3 #define KEY_LOG 4 #define KEY_LN 5 #define KEY_XEQ 6 #define KEY_STO 7 #define KEY_RCL 8 #define KEY_RDN 9 #define KEY_SIN 10 #define KEY_COS 11 #define KEY_TAN 12 #define KEY_ENTER 13 #define KEY_SWAP 14 #define KEY_CHS 15 #define KEY_E 16 #define KEY_BSP 17 #define KEY_UP 18 #define KEY_7 19 #define KEY_8 20 #define KEY_9 21 #define KEY_DIV 22 #define KEY_DOWN 23 #define KEY_4 24 #define KEY_5 25 #define KEY_6 26 #define KEY_MUL 27 #define KEY_SHIFT 28 #define KEY_1 29 #define KEY_2 30 #define KEY_3 31 #define KEY_SUB 32 #define KEY_EXIT 33 #define KEY_0 34 #define KEY_DOT 35 #define KEY_RUN 36 #define KEY_ADD 37 /*********************/ /* Annunciator codes */ /*********************/ #define NB_ANNUN 12 #define ANN_SHIFT 0 #define ANN_DEG 1 #define ANN_RAD 2 #define ANN_GRAD 3 #define ANN_DEC 4 #define ANN_OCT 5 #define ANN_BIN 6 #define ANN_HEX 7 #define ANN_S1 8 #define ANN_S2 9 #define ANN_S3 10 #define ANN_SG 11 /*********************/ /* Annunciator value */ /*********************/ #define ANNVAL_UNCH -1 #define ANNVAL_DEG 0 #define ANNVAL_RAD 1 #define ANNVAL_GRAD 2 #define ANNVAL_DEC 0 #define ANNVAL_OCT 1 #define ANNVAL_BIN 2 #define ANNVAL_HEX 3 #define ANNVAL_S1 0 #define ANNVAL_S2 1 #define ANNVAL_S3 2 #define ANNVAL_SG 3 /*********/ /* Menus */ /*********/ #define MENU_NONE -1 #define MENU_SHORTCUT -2 #define MENU_ALPHA1 0 #define MENU_ALPHA2 1 #define MENU_ALPHA_ABCDE1 2 #define MENU_ALPHA_ABCDE2 3 #define MENU_ALPHA_FGHI 4 #define MENU_ALPHA_JKLM 5 #define MENU_ALPHA_NOPQ1 6 #define MENU_ALPHA_NOPQ2 7 #define MENU_ALPHA_RSTUV1 8 #define MENU_ALPHA_RSTUV2 9 #define MENU_ALPHA_WXYZ 10 #define MENU_ALPHA_PAREN 11 #define MENU_ALPHA_ARROW 12 #define MENU_ALPHA_COMP 13 #define MENU_ALPHA_MATH 14 #define MENU_ALPHA_PUNC1 15 #define MENU_ALPHA_PUNC2 16 #define MENU_ALPHA_MISC1 17 #define MENU_ALPHA_MISC2 18 #define MENU_ST 19 #define MENU_IND_ST 20 #define MENU_IND 21 #define MENU_MODES1 22 #define MENU_MODES2 23 #define MENU_DISP 24 #define MENU_CLEAR1 25 #define MENU_CLEAR2 26 #define MENU_CONVERT1 27 #define MENU_CONVERT2 28 #define MENU_FLAGS 29 #define MENU_PROB 30 #define MENU_CUSTOM1 31 #define MENU_CUSTOM2 32 #define MENU_CUSTOM3 33 #define MENU_PGM_FCN1 34 #define MENU_PGM_FCN2 35 #define MENU_PGM_FCN3 36 #define MENU_PGM_FCN4 37 #define MENU_PGM_XCOMP0 38 #define MENU_PGM_XCOMPY 39 #define MENU_PRINT1 40 #define MENU_PRINT2 41 #define MENU_PRINT3 42 #define MENU_TOP_FCN 43 #define MENU_CATALOG 44 #define MENU_BLANK 45 #define MENU_PROGRAMMABLE 46 #define MENU_VARMENU 47 #define MENU_STAT1 48 #define MENU_STAT2 49 #define MENU_STAT_CFIT 50 #define MENU_STAT_MODL 51 #define MENU_MATRIX1 52 #define MENU_MATRIX2 53 #define MENU_MATRIX3 54 #define MENU_MATRIX_SIMQ 55 #define MENU_MATRIX_EDIT1 56 #define MENU_MATRIX_EDIT2 57 #define MENU_BASE 58 #define MENU_BASE_A_THRU_F 59 #define MENU_BASE_LOGIC 60 #define MENU_SOLVE 61 #define MENU_INTEG 62 #define MENU_INTEG_PARAMS 63 /***********************/ /* Variable data types */ /***********************/ /******************/ /* Emulator state */ /******************/ /* FLAGS * Note: flags whose names start with VIRTUAL_ are named here for reference * only; they are actually handled by virtual_flag_handler(). Setting or * clearing them in 'flags' has no effect. * Flags whose names are the letter 'f' followed by two digits have no * specified meaning according to the HP-42S manual; they are either user flags * or reserved. */ typedef union { char farray[100]; struct { char audio_enable; } f; } flags_struct; extern flags_struct flags; /****************/ /* More globals */ /****************/ extern int pending_command; extern bool mode_shift; extern bool mode_running; extern int (*mode_interruptible)(int); extern bool mode_stoppable; extern bool mode_getkey; extern int remove_program_catalog; extern int mode_plainmenu; extern int mode_transientmenu; /* Keystroke buffer - holds keystrokes received while * there is a program running. */ extern int keybuf_head; extern int keybuf_tail; extern int keybuf[16]; /*********************/ /* Utility functions */ /*********************/ #endif --- NEW FILE: ansops.h --- /* * $Id: ansops.h,v 1.1 2008/05/26 20:08:14 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _ANSOPS_H_ #define _ANSOPS_H_ void ans_guess() IFACE; void ans_redisplay(char *text) IFACE; #endif --- NEW FILE: core_tables.h --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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 CORE_TABLES_H #define CORE_TABLES_H 1 /************/ /* Commands */ /************/ /* These are indices into the cmdlist array, * declared below (except the negative ones!) */ #define CMD_NONE -1 #define CMD_CANCELLED -2 #define CMD_LINGER1 -3 #define CMD_LINGER2 -4 #define CMD_CLX 0 #define CMD_ENTER 1 #define CMD_SWAP 2 #define CMD_RDN 3 #define CMD_CHS 4 #define CMD_DIV 5 #define CMD_MUL 6 #define CMD_SUB 7 #define CMD_ADD 8 #define CMD_LASTX 9 #define CMD_SILENT_OFF 10 #define CMD_SILENT_ON 11 #define CMD_SIN 12 #define CMD_COS 13 #define CMD_TAN 14 #define CMD_ASIN 15 #define CMD_ACOS 16 #define CMD_ATAN 17 #define CMD_LOG 18 #define CMD_10_POW_X 19 #define CMD_LN 20 #define CMD_E_POW_X 21 #define CMD_SQRT 22 #define CMD_SQUARE 23 #define CMD_INV 24 #define CMD_Y_POW_X 25 #define CMD_PERCENT 26 #define CMD_PI 27 #define CMD_COMPLEX 28 #define CMD_STO 29 #define CMD_STO_DIV 30 #define CMD_STO_MUL 31 #define CMD_STO_SUB 32 #define CMD_STO_ADD 33 #define CMD_RCL 34 #define CMD_RCL_DIV 35 #define CMD_RCL_MUL 36 #define CMD_RCL_SUB 37 #define CMD_RCL_ADD 38 #define CMD_FIX 39 #define CMD_SCI 40 #define CMD_ENG 41 #define CMD_ALL 42 #define CMD_NULL 43 #define CMD_ASTO 44 #define CMD_ARCL 45 #define CMD_CLA 46 #define CMD_DEG 47 #define CMD_RAD 48 #define CMD_GRAD 49 #define CMD_RECT 50 #define CMD_POLAR 51 #define CMD_SIZE 52 #define CMD_QUIET 53 #define CMD_CPXRES 54 #define CMD_REALRES 55 #define CMD_KEYASN 56 #define CMD_LCLBL 57 #define CMD_RDXDOT 58 #define CMD_RDXCOMMA 59 #define CMD_CLSIGMA 60 #define CMD_CLP 61 #define CMD_CLV 62 #define CMD_CLST 63 #define CMD_CLRG 64 #define CMD_DEL 65 #define CMD_CLKEYS 66 #define CMD_CLLCD 67 #define CMD_CLMENU 68 #define CMD_CLALLa 69 #define CMD_TO_DEG 70 #define CMD_TO_RAD 71 #define CMD_TO_HR 72 #define CMD_TO_HMS 73 #define CMD_TO_REC 74 #define CMD_TO_POL 75 #define CMD_IP 76 #define CMD_FP 77 #define CMD_RND 78 #define CMD_ABS 79 #define CMD_SIGN 80 #define CMD_MOD 81 #define CMD_SF 82 #define CMD_CF 83 #define CMD_FS_T 84 #define CMD_FC_T 85 #define CMD_FSC_T 86 #define CMD_FCC_T 87 #define CMD_COMB 88 #define CMD_PERM 89 #define CMD_FACT 90 #define CMD_GAMMA 91 #define CMD_RAN 92 #define CMD_SEED 93 #define CMD_LBL 94 #define CMD_RTN 95 #define CMD_INPUT 96 #define CMD_VIEW 97 #define CMD_AVIEW 98 #define CMD_XEQ 99 #define CMD_PROMPT 100 #define CMD_PSE 101 #define CMD_ISG 102 #define CMD_DSE 103 #define CMD_AIP 104 #define CMD_XTOA 105 #define CMD_AGRAPH 106 #define CMD_PIXEL 107 #define CMD_BEEP 108 #define CMD_TONE 109 #define CMD_MVAR 110 #define CMD_VARMENU 111 #define CMD_GETKEY 112 #define CMD_MENU 113 #define CMD_KEYG 114 #define CMD_KEYX 115 #define CMD_X_EQ_0 116 #define CMD_X_NE_0 117 #define CMD_X_LT_0 118 #define CMD_X_GT_0 119 #define CMD_X_LE_0 120 #define CMD_X_GE_0 121 #define CMD_X_EQ_Y 122 #define CMD_X_NE_Y 123 #define CMD_X_LT_Y 124 #define CMD_X_GT_Y 125 #define CMD_X_LE_Y 126 #define CMD_X_GE_Y 127 #define CMD_PRSIGMA 128 #define CMD_PRP 129 #define CMD_PRV 130 #define CMD_PRSTK 131 #define CMD_PRA 132 #define CMD_PRX 133 #define CMD_PRUSR 134 #define CMD_LIST 135 #define CMD_ADV 136 #define CMD_PRLCD 137 #define CMD_DELAY 138 #define CMD_PON 139 #define CMD_POFF 140 #define CMD_MAN 141 #define CMD_NORM 142 #define CMD_TRACE 143 #define CMD_SIGMAADD 144 #define CMD_SIGMASUB 145 #define CMD_GTO 146 #define CMD_END 147 #define CMD_NUMBER 148 #define CMD_STRING 149 #define CMD_RUN 150 #define CMD_SST 151 #define CMD_GTODOT 152 #define CMD_GTODOTDOT 153 #define CMD_STOP 154 #define CMD_NEWMAT 155 #define CMD_RUP 156 #define CMD_REAL_T 157 #define CMD_CPX_T 158 #define CMD_STR_T 159 #define CMD_MAT_T 160 #define CMD_DIM_T 161 #define CMD_ASSIGNa 162 #define CMD_ASSIGNb 163 #define CMD_ASGN01 164 #define CMD_ASGN02 165 #define CMD_ASGN03 166 #define CMD_ASGN04 167 #define CMD_ASGN05 168 #define CMD_ASGN06 169 #define CMD_ASGN07 170 #define CMD_ASGN08 171 #define CMD_ASGN09 172 #define CMD_ASGN10 173 #define CMD_ASGN11 174 #define CMD_ASGN12 175 #define CMD_ASGN13 176 #define CMD_ASGN14 177 #define CMD_ASGN15 178 #define CMD_ASGN16 179 #define CMD_ASGN17 180 #define CMD_ASGN18 181 #define CMD_ON 182 #define CMD_OFF 183 #define CMD_KEY1G 184 #define CMD_KEY2G 185 #define CMD_KEY3G 186 #define CMD_KEY4G 187 #define CMD_KEY5G 188 #define CMD_KEY6G 189 #define CMD_KEY7G 190 #define CMD_KEY8G 191 #define CMD_KEY9G 192 #define CMD_KEY1X 193 #define CMD_KEY2X 194 #define CMD_KEY3X 195 #define CMD_KEY4X 196 #define CMD_KEY5X 197 #define CMD_KEY6X 198 #define CMD_KEY7X 199 #define CMD_KEY8X 200 #define CMD_KEY9X 201 #define CMD_VMEXEC 202 #define CMD_VMSTO 203 #define CMD_SIGMAREG 204 #define CMD_SIGMAREG_T 205 #define CMD_CLD 206 #define CMD_ACOSH 207 #define CMD_ALENG 208 #define CMD_ALLSIGMA 209 #define CMD_AND 210 #define CMD_AOFF 211 #define CMD_AON 212 #define CMD_AROT 213 #define CMD_ASHF 214 #define CMD_ASINH 215 #define CMD_ATANH 216 #define CMD_ATOX 217 #define CMD_BASEADD 218 #define CMD_BASESUB 219 #define CMD_BASEMUL 220 #define CMD_BASEDIV 221 #define CMD_BASECHS 222 #define CMD_BEST 223 #define CMD_BINM 224 #define CMD_BIT_T 225 #define CMD_BST 226 #define CMD_CORR 227 #define CMD_COSH 228 #define CMD_CROSS 229 #define CMD_CUSTOM 230 #define CMD_DECM 231 #define CMD_DELR 232 #define CMD_DET 233 #define CMD_DIM 234 #define CMD_DOT 235 #define CMD_EDIT 236 #define CMD_EDITN 237 #define CMD_EXITALL 238 #define CMD_EXPF 239 #define CMD_E_POW_X_1 240 #define CMD_FCSTX 241 #define CMD_FCSTY 242 #define CMD_FNRM 243 #define CMD_GETM 244 #define CMD_GROW 245 #define CMD_HEXM 246 #define CMD_HMSADD 247 #define CMD_HMSSUB 248 #define CMD_I_ADD 249 #define CMD_I_SUB 250 #define CMD_INDEX 251 #define CMD_INSR 252 #define CMD_INTEG 253 #define CMD_INVRT 254 #define CMD_J_ADD 255 #define CMD_J_SUB 256 #define CMD_LINF 257 #define CMD_LINSIGMA 258 #define CMD_LN_1_X 259 #define CMD_LOGF 260 #define CMD_MEAN 261 #define CMD_NOT 262 #define CMD_OCTM 263 #define CMD_OLD 264 #define CMD_OR 265 #define CMD_PGMSLV 266 #define CMD_PGMINT 267 #define CMD_POSA 268 #define CMD_PUTM 269 #define CMD_PWRF 270 #define CMD_RCLEL 271 #define CMD_RCLIJ 272 #define CMD_RNRM 273 #define CMD_ROTXY 274 #define CMD_RSUM 275 #define CMD_SWAP_R 276 #define CMD_SDEV 277 #define CMD_SINH 278 #define CMD_SLOPE 279 #define CMD_SOLVE 280 #define CMD_STOEL 281 #define CMD_STOIJ 282 #define CMD_SUM 283 #define CMD_TANH 284 #define CMD_TRANS 285 #define CMD_UVEC 286 #define CMD_WMEAN 287 #define CMD_WRAP 288 #define CMD_X_SWAP 289 #define CMD_XOR 290 #define CMD_YINT 291 #define CMD_TO_DEC 292 #define CMD_TO_OCT 293 #define CMD_LEFT 294 #define CMD_UP 295 #define CMD_DOWN 296 #define CMD_RIGHT 297 #define CMD_PERCENT_CH 298 #define CMD_SIMQ 299 #define CMD_MATA 300 #define CMD_MATB 301 #define CMD_MATX 302 #define CMD_GOTOROW 303 #define CMD_GOTOCOLUMN 304 #define CMD_A_THRU_F 305 #define CMD_CLALLb 306 #define CMD_PGMSLVi 307 #define CMD_PGMINTi 308 #define CMD_VMSTO2 309 #define CMD_VMSOLVE 310 #define CMD_MAX 311 #define CMD_MIN 312 #define CMD_FIND 313 #define CMD_XROM 314 #define CMD_SENTINEL 315 /* command_spec.argtype */ #define ARG_NONE 0 /* No argument */ #define ARG_VAR 1 /* Variable: num, stk, var, ind */ #define ARG_REAL 2 /* Variable: num, stk, var, ind; real scalars only */ #define ARG_NAMED 3 /* Variable: var, ind */ #define ARG_NUM9 4 /* num (0..9), ind */ #define ARG_NUM11 5 /* num (0..11), ind */ #define ARG_NUM99 6 /* num (0..99), ind */ #define ARG_COUNT 7 /* numeric-only (SIMQ, DEL, SIZE, LIST) */ #define ARG_LBL 8 /* Label: num, lclbl, global, ind */ #define ARG_CKEY 9 /* Key in custom menu */ #define ARG_MKEY 10 /* Key in programmable menu (KEYG/KEYX) */ #define ARG_PRGM 11 /* Alpha label (CATSECT_PGM) */ #define ARG_RVAR 12 /* Variable (real only) (MVAR, INTEG, SOLVE) */ #define ARG_MAT 13 /* Variable (matrix only) (EDITN, INDEX) */ #define ARG_OTHER 14 /* Weirdos */ /* command_spec.flags */ #define FLAG_NONE 0 /* Boring! */ #define FLAG_PRGM_ONLY 1 /* Only allowed in program mode (LBL, DEL, ...) */ #define FLAG_IMMED 2 /* Executes in program mode (DEL, GTO.nnn, ...) */ #define FLAG_HIDDEN 4 /* Cannot be activated using XEQ "NAME" (SIMQ, ...) */ #define FLAG_NO_PRGM 8 /* Cannot be programmed (SIMQ, MATA, ...) */ #define FLAG_NO_SHOW 16 /* Do not show after keytimeout1 */ /* Builtin cmd arg types */ /* These represent data types used when a command * is executing. Compare the ARG_ macros; those * represent the data types that a command is *capable* * of accepting, and are used during command entry. */ #define ARGTYPE_NONE 0 #define ARGTYPE_NUM 1 #define ARGTYPE_NEG_NUM 2 /* Used internally */ #define ARGTYPE_STK 3 #define ARGTYPE_STR 4 #define ARGTYPE_IND_NUM 5 #define ARGTYPE_IND_STK 6 #define ARGTYPE_IND_STR 7 #define ARGTYPE_COMMAND 8 /* For backward compatibility only! */ #define ARGTYPE_LCLBL 9 #define ARGTYPE_DOUBLE 10 #define ARGTYPE_LBLINDEX 11 #define phloat float typedef struct { unsigned char type; unsigned char length; int4 target; union { int4 num; char text[15]; char stk; int cmd; /* For backward compatibility only! */ char lclbl; } val; // This used to be a member of the 'val' union, but once I changed it // from 'double' to 'phloat', that was no longer possible. phloat val_d; } arg_struct; typedef struct { char name[12]; int name_length; int (*handler)(arg_struct *arg); uint4 hp42s_code; int argtype; int flags; } command_spec; const command_spec *cmdlist(int index) TABLES_SECT; #endif --- NEW FILE: EasyCalc.h --- #pragma once #ifdef POCKETPC2003_UI_MODEL #include "resourceppc.h" #endif /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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 EASYCALC_H #define EASYCALC_H 1 #ifndef BCD_MATH #include <math.h> #endif #define SHELL1_SECT #define SHELL2_SECT #define FILESYS_SECT #define MAIN_SECT #define COMMANDS1_SECT #define COMMANDS2_SECT #define COMMANDS3_SECT #define COMMANDS4_SECT #define COMMANDS5_SECT #define COMMANDS6_SECT #define DISPLAY_SECT #define GLOBALS_SECT #define HELPERS_SECT #define KEYDOWN_SECT #define LINALG1_SECT #define LINALG2_SECT #define MATH1_SECT #define MATH2_SECT #define PHLOAT_SECT #define STO_RCL_SECT #define TABLES_SECT #define VARIABLES_SECT #define BCD_SECT #define int2 short #define uint2 unsigned short #define int4 int #define uint4 unsigned int #define uint unsigned int #if defined(WINDOWS) && !defined(__GNUC__) #define int8 __int64 #define uint8 unsigned __int64 #define LL(x) x /* MSVC++ 6.0 lacks a few math functions that Free42 needs. * I've defined workarounds in mathfudge.c. NOTE: my versions * of isnan(), finite(), and isinf() are a bit lame -- I *think* * they handle infinities properly, but definitely not NaNs * (although NaNs shouldn't be much of a problem because the Free42 * code mostly tries to avoid them, rather than detect them after * the fact). */ #ifdef __cplusplus extern "C" { #endif int isnan(double x); int finite(double x); int isinf(double x); void sincos(double x, double *sinx, double *cosx); double asinh(double x); double acosh(double x); double atanh(double x); double expm1(double x); double log1p(double x); #ifdef _WIN32_WCE double hypot(double x, double y); #endif #ifdef __cplusplus } #endif #else #define int8 long long #define uint8 unsigned long long #define LL(x) x##LL /* NOTE: In my Linux build, all I have to do is DECLARE sincos(); glibc 2.3.3 * has it (for C99, I suppose) so I don't have to DEFINE it. On other Unixes * (e.g. MacOS X), it may not be provided by the standard libraries; in this * case, define the NO_SINCOS symbol, here or in the Makefile. * For the Palm build, we don't even need the declaration, since sincos() is * provided by MathLib. */ #ifndef PALMOS extern "C" void sincos(double x, double *sinx, double *cosx) HELPERS_SECT; #endif //#define NO_SINCOS 1 #endif // Filename, including path, max size. #define FILENAMELEN 256 // Version of the shell file #define SHELL_VERSION 1 /* Magic number and version number for the state file. * State file versions correspond to application versions as follows: * Version 1: 1.25 first release */ #define EASYCALC_MAGIC 0x4543414C #define EASYCALC_VERSION 1 void shell_beeper(int frequency, int duration); void shell_annunciators(int skin, int shf, int angle_mode, int int_mode, int run) SHELL1_SECT; void shell_powerdown() SHELL1_SECT; #endif --- NEW FILE: DataManager.cpp --- #include "StdAfx.h" #include "PalmOS.h" #include "DataManager.h" #include "defuns.h" DataManager::DataManager(void) { in_state = false; attr = 0; type = 0; creator = 0; numRecords = 0; head = NULL; } DataManager::~DataManager(void) { } extern StateManager stateMgr; // This one comes from EasyCalc.cpp LocalID DmFindDatabase (UINT16 cardNo, const TCHAR *nameP) { return ((LocalID) &stateMgr); } int DmDatabaseInfo ( UINT16 cardNo, LocalID dbID, TCHAR *nameP, UINT16 *attributesP, UINT16 *versionP, UINT32 *crDateP, UINT32 *modDateP, UINT32 *bckUpDateP, UINT32 *modNumP, LocalID *appInfoIDP, LocalID *sortInfoIDP, UINT32 *typeP, UINT32 *creatorP) { if (dbID == (LocalID) &stateMgr) { *attributesP = stateMgr.historyDB.attr; *versionP = (UINT16) (stateMgr.version); *typeP = stateMgr.historyDB.type; *creatorP = stateMgr.historyDB.creator; } return (0); } int DmSetDatabaseInfo ( UINT16 cardNo, LocalID dbID, const TCHAR *nameP, UINT16 *attributesP, UINT16 *versionP, UINT32 *crDateP, UINT32 *modDateP, UINT32 *bckUpDateP, UINT32 *modNumP, LocalID appInfoIDP, LocalID sortInfoIDP, UINT32 *typeP, UINT32 *creatorP) { if (dbID == &stateMgr) { stateMgr.historyDB.attr = *attributesP; } return (0); } DmOpenRef DmOpenDatabase (UINT cardNo, LocalID dbID, UINT16 mode) { if (dbID == (LocalID) &stateMgr) { return (&(stateMgr.historyDB)); } return (NULL); } int DmGetLastErr (void) { return (0); } int DmCreateDatabase ( UINT16 cardNo, const TCHAR *nameP, UINT32 creator, UINT32 type, bool resDB) { if (wcscmp (nameP, HISTORYDBNAME) == 0) { stateMgr.historyDB.creator = creator; stateMgr.historyDB.type = type; } return (0); } Err DmCloseDatabase (DmOpenRef dbP) { return (0); } int DmDeleteDatabase (UINT16 cardNo, LocalID dbID) { return (0); } UINT16 DmNumRecords (DmOpenRef dbP) { return (dbP->numRecords); } MemHandle DmNewRecord (DmOpenRef dbP, UInt16 *atP, UInt32 size) { if (dbP == &(stateMgr.historyDB)) { char *p = (char *) malloc ((size+8) & 0xFFFFFFFC); // Add 4 bytes, round up to next 4 bytes limit if (p == NULL) return (NULL); DataRecord *prec = NULL; DataRecord *temp = stateMgr.historyDB.head; if (*atP > stateMgr.historyDB.numRecords) *atP = stateMgr.historyDB.numRecords; for (int i=0 ; (i<*atP) && (temp != NULL) ; i++) temp = (prec = temp)->next; stateMgr.historyDB.numRecords++; if (prec == NULL) { // Insert at head temp = stateMgr.historyDB.head = new DataRecord(size, p, stateMgr.historyDB.head); } else { temp = prec->next = new DataRecord(size, p, temp); } // Put the father record address at beginning of the allocated space *((UInt32 *) p) = (UInt32) temp; return (p+4); } return (NULL); } Err DmRemoveRecord (DmOpenRef dbP, UInt16 index) { if (dbP == &(stateMgr.historyDB)) { DataRecord *prec = NULL; DataRecord *temp = stateMgr.historyDB.head; if (index >= stateMgr.historyDB.numRecords) return (-1); for (int i=0 ; (i<index) && (temp != NULL) ; i++) temp = (prec = temp)->next; stateMgr.historyDB.numRecords--; if (prec == NULL) { // Delete at head stateMgr.historyDB.head = stateMgr.historyDB.head->next; } else { prec->next = temp->next; } free (temp->ptr); delete temp; return (0); } return (-1); } Err DmWrite ( void *recordP, UInt32 offset, const void *srcP, UInt32 bytes) { char *p = (char *) recordP; // Find the record to which this data belongs DataRecord *r = (DataRecord *) (* ((UInt32 *) (((UInt32) recordP) - 4))); if (r->magic != RECORD_MAGIC) return (-1); if (offset + bytes > r->size) return (-2); memcpy (p+offset, srcP, bytes); return (0); } MemHandle DmQueryRecord (DmOpenRef dbP, UInt16 index) { if (dbP == &(stateMgr.historyDB)) { DataRecord *temp = stateMgr.historyDB.head; if (index >= stateMgr.historyDB.numRecords) return (NULL); for (int i=0 ; (i<index) && (temp != NULL) ; i++) temp = temp->next; return (temp->ptr+4); } return (NULL); } //Err DmReleaseRecord (DmOpenRef dbP, UInt16 index, Boolean dirty) { // return (0); //} DataRecord::DataRecord(void) { magic = RECORD_MAGIC; size = 0; ptr = NULL; next = NULL; } DataRecord::DataRecord(UINT32 s, void *p, DataRecord *n) { size = s; ptr = (char *) p; next = n; } DataRecord::~DataRecord(void) { } --- NEW FILE: EasyCalc.cpp --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * The name and many features come from * - EasyCalc on Palm: * * It also is reusing elements from * - Free42: Thomas Okken * for its adaptation to the PocketPC world. * * 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. [...1152 lines suppressed...] * Call handler for when the repeater timer passes the first 1/4 second. * ********************************************************************************/ static VOID CALLBACK timeout1(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime) { KillTimer(NULL, timer); if (ckey != 0) { core_keytimeout1(); timer = SetTimer(NULL, 0, 1750, timeout2); } else timer = 0; } /******************************************************************************** * FUNCTION: timeout2(HWND, UINT, UINT, DWORD) * * Call handler for when the repeater timer goes beyond 2 seconds. * ********************************************************************************/ static VOID CALLBACK timeout2(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime) { KillTimer(NULL, timer); if (ckey != 0) core_keytimeout2(); timer = 0; } --- NEW FILE: chkstack.h --- /* * $Id: chkstack.h,v 1.1 2008/05/26 20:08:14 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000,2001 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. * */ void initChkStack(void); Boolean chkStack(void); --- NEW FILE: core_main.h --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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 CORE_MAIN_H #define CORE_MAIN_H 1 #include "EasyCalc.h" /*******************/ /* Keyboard repeat */ /*******************/ extern int repeating; extern int repeating_shift; extern int repeating_key; /**********************************/ /* Shell/Core interface functions */ /**********************************/ int core_repeat() MAIN_SECT; void core_keytimeout1() MAIN_SECT; void core_keytimeout2() MAIN_SECT; void core_timeout3(int repaint) MAIN_SECT; int core_alpha_menu() MAIN_SECT; int core_hex_menu() MAIN_SECT; int core_keydown(int key, int *enqueued, int *repeat) MAIN_SECT; int core_keyup() MAIN_SECT; /*******************/ /* Other functions */ /*******************/ void set_running(bool state) MAIN_SECT; void continue_running() MAIN_SECT; #endif --- NEW FILE: DataManager.h --- #pragma once #ifndef DATA_MANAGER_H #define DATA_MANAGER_H 1 #include "PalmOS.h" #define dmModeReadWrite 1 #define dmHdrAttrBackup 2 #define RECORD_MAGIC 0x52454344 class DataRecord { public: UInt32 magic; UInt32 size; char *ptr; DataRecord *next; DataRecord(void); DataRecord(UINT32 s, void *p, DataRecord *n); ~DataRecord(void); }; class DataManager { public: bool in_state; UInt16 attr; UInt32 type; UInt32 creator; UInt16 numRecords; DataRecord *head; DataManager(void); ~DataManager(void); }; typedef DataManager *DmOpenRef; typedef void *LocalID; LocalID DmFindDatabase (UINT16 cardNo, const TCHAR *nameP); Err DmDatabaseInfo ( UInt16 cardNo, LocalID dbID, Char *nameP, UInt16 *attributesP, UInt16 *versionP, UInt32 *crDateP, UInt32 *modDateP, UInt32 *bckUpDateP, UInt32 *modNumP, LocalID appInfoIDP, LocalID sortInfoIDP, UInt32 *typeP, UInt32 *creatorP ); Err DmSetDatabaseInfo ( UInt16 cardNo, LocalID dbID, const Char *nameP, UInt16 *attributesP, UInt16 *versionP, UInt32 *crDateP, UInt32 *modDateP, UInt32 *bckUpDateP, UInt32 *modNumP, LocalID appInfoIDP, LocalID sortInfoIDP, UInt32 *typeP, UInt32 *creatorP ); DmOpenRef DmOpenDatabase (UInt16 cardNo, LocalID dbID, UInt16 mode); Err DmGetLastErr (void); Err DmCreateDatabase ( UInt16 cardNo, const Char *nameP, UInt32 creator, UInt32 type, Boolean resDB); Err DmCloseDatabase (DmOpenRef dbP); Err DmDeleteDatabase (UInt16 cardNo, LocalID dbID); UInt16 DmNumRecords (DmOpenRef dbP); MemHandle DmNewRecord (DmOpenRef dbP, UInt16 *atP, UInt32 size); Err DmWrite ( void *recordP, UInt32 offset, const void *srcP, UInt32 bytes ); Err DmRemoveRecord (DmOpenRef dbP, UInt16 index); MemHandle DmQueryRecord (DmOpenRef dbP, UInt16 index); //Err DmReleaseRecord (DmOpenRef dbP, UInt16 index, Boolean dirty); #define DmReleaseRecord(a,b,c) #endif --- NEW FILE: dbutil.cpp --- /* * $Id: dbutil.cpp,v 1.1 2008/05/26 20:08:14 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000,2007 Ondrej Palkovsky * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #include "StdAfx.h" #include <PalmOS.h> #include "defuns.h" static Err db_open_byid(LocalID dbid, DmOpenRef *dbref) { *dbref = DmOpenDatabase(CARDNO, dbid, dmModeReadWrite); if (*dbref) return DmGetLastErr(); return 0; } /*********************************************************************** * * FUNCTION: open_db * * DESCRIPTION: Open a database for EasyCalc. Creates a new one, * if the database does not exist or if the old database * has the wrong version * * PARAMETERS: * * RETURN: 0 - on success * other - on error * ***********************************************************************/ Int16 open_db(const Char *name, UInt16 dbversion, UInt32 crid, UInt32 dbtype, DmOpenRef *dbref) { Err err; LocalID dbid; UInt16 version; UInt32 creator; UInt32 type; UInt16 attr = 0; dbid = DmFindDatabase(CARDNO, name); if (dbid) { /* Database exists */ DmDatabaseInfo(CARDNO, dbid, NULL, /* name */ &attr, /* attrib */ &version, /* version */ NULL, /* crDate */ NULL, /* modDate */ NULL, /* bckUpDate */ NULL, /* modNum */ NULL, /* appinfoID */ NULL, /* sortInfoID */ &type, /* Type */ &creator); /* Creator */ if (version == dbversion && creator == crid && type == dbtype) { if ((attr & dmHdrAttrBackup) == 0) { attr |= dmHdrAttrBackup; DmSetDatabaseInfo(CARDNO, dbid, NULL, /* name */ &attr, /* attrib */ NULL, /* version */ NULL, /* crDate */ NULL, /* modDate */ NULL, /* bckupDate */ NULL, /* modNum */ NULL, /* appinfoID */ NULL, /* sortInfoID */ NULL, /* Type */ NULL); /* Creator */ } return db_open_byid(dbid, dbref); } /* Database exists, but with incorrect version */ err = DmDeleteDatabase(CARDNO, dbid); if (err) return err; } /* Database doesn't exist or old version */ err = DmCreateDatabase(CARDNO, name, crid, dbtype, false); if (err) return err; dbid = DmFindDatabase(CARDNO, name); version = dbversion; attr |= dmHdrAttrBackup; DmSetDatabaseInfo(CARDNO, dbid, NULL, /* name */ &attr, /* attrib */ &version, /* version */ NULL, /* crDate */ NULL, /* modDate */ NULL, /* bckUpDate */ NULL, /* modNum */ NULL, /* appinfoID */ NULL, /* sortInfoID */ NULL, /* Type */ NULL); /* Creator */ return db_open_byid(dbid, dbref); } --- NEW FILE: calcrsc.h --- // $Id: calcrsc.h,v 1.1 2008/05/26 20:08:14 mapibid Exp $ // // Resource constants for EasyCalc // Copyright (C) 2000 Ondrej Palkovsky // // 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., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. #define MAX_INPUT_LENGTH 1000 #define MAX_WORKSHEET_TITLE 32 #define MAX_WORKSHEET_NOTE 300 #define MAX_WORKSHEET_HELP 39 #define resize_index 1 #define frmBasic 1001 #define frmScientific 1002 #define frmInteger 1003 #define frmGraph 1004 #define finForm 1005 #define frmAbout 1006 #define altCompute 1007 #define altMathlib 1008 #define frmHelp 1009 #define altGuessNotFound 1010 #define altGraphBadVal 1011 #define altErrorMsg 1012 #define altAnsProblem 1013 #define altBadParameter 1015 #define frmListEdit 1016 #define frmMatrix 1017 #define frmBasicS 1018 #define slvForm 1019 #define slvTitleForm 1020 #define slvOptionsForm 1021 #define slvNoteForm 1022 #define slvExportOK 1023 #define slvExportError 1024 #define tdMenu 1000 #define resultGadget 1001 #define tdInput 1002 #define tdDoit 1003 #define btnBasic 1008 #define btnScientific 1009 #define btnInteger 1010 #define btnGraph 1011 #define tdBFin 1016 #define tdBPref 1017 #define btnHistory 1018 #define hlpMain1 1100 #define hlpMain2 1101 #define hlpMain2T 1102 #define hlpPref 1103 #define hlpFin 1104 #define hlpMemo 1105 #define hlpFunc 1106 #define hlpFuncT 1107 #define hlpGrPref 1108 #define hlpGrSetup 1109 #define hlpSolver 1110 #define btnMain0 2000 #define btnMain1 2001 #define btnMain2 2002 #define btnMain3 2003 #define btnMain4 2004 #define btnMain5 2005 #define btnMain6 2006 #define btnMain7 2007 #define btnMain8 2008 #define btnMain9 2009 #define btnMainBksp 2010 #define btnMainFwsp 2011 #define btnMainDel 2012 #define btnMainPlus 2015 #define btnMainMinus 2016 #define btnMainMult 2017 #define btnMainDivide 2018 #define btnMainNeg 2019 #define btnMainA 2071 #define btnMainB 2072 #define btnMainC 2073 #define btnMainD 2074 #define btnMainE 2075 #define btnMainF 2076 #define btnMainAnd 2077 #define btnMainOr 2078 #define btnMainShl 2079 #define btnMainShr 2080 #define btnMainClear 2081 #define btnMainAns 2082 #define btnMainOpBr 2083 #define btnMainPow 2084 #define btnMainLog 2085 #define btnMainSq1 2086 #define btnMainSqr 2087 #define btnMainSqrt 2088 #define btnMainClBr 2089 #define btnMainEE 2090 #define btnMainDot 2091 #define btnMainXor 2092 #define btnMainSel 2093 #define lstMainBtnRow 2094 #define popMainBtnRow 2095 #define btnMainInv 2096 #define btnMainLn 2097 #define btnMainSin 2098 #define btnMainCos 2099 #define btnMainTan 2101 #define btnMainExp 2102 #define btnMainPi 2103 #define btnMainDeg 2104 #define btnMainMin 2105 #define btnMainFact 2106 #define btnMainColn 2107 #define btnMainMagn 2108 #define btnMainAngl 2109 #define btnMain_i 2110 #define btnPrefMode 2111 #define btnRadixMode 2112 #define btnMatrixDone 2200 #define tblMatrix 2201 #define lstMatrix 2202 #define popMatrix 2203 #define popMatrixRows 2204 #define popMatrixCols 2205 #define lstMatrixDim 2206 #define sclMatrix 2207 #define btnMatrixLeft 2208 #define btnMatrixRight 2209 #define btnMainS1 3301 #define btnMainS2 3302 #define btnMainS3 3303 #define btnMainS4 3304 #define btnMainS5 3305 #define btnMainS6 3306 #define btnMainS7 3307 #define btnMainS8 3308 #define btnMainS9 3309 #define btnMainS10 3310 #define btnMainS11 3311 #define btnMainS12 3312 #define btnMainS13 3313 #define btnMainS14 3314 #define btnMainS15 3315 #define btnMainW1 3316 #define btnMainW2 3317 #define btnMainW3 3319 #define btnMainW4 3320 #define btnMainW5 3322 #define btnMainW6 3323 #define btnMainW7 3325 #define btnMainW8 3326 #define btnMainW9 3328 #define btnMainW10 3329 #define finFVButton 3000 #define finPVButton 3001 #define finPMTButton 3002 #define finNButton 3003 #define finIButton 3004 #define finBeginButton 3005 #define finEndButton 3006 #define finPYRButton 3007 #define finDoneButton 3010 #define finISet 3100 #define finILabel 3101 #define finPVSet 3102 #define finPVLabel 3103 #define finPMTSet 3104 #define finPMTLabel 3105 #define finNSet 3106 #define finNLabel 3107 #define finFVSet 3108 #define finFVLabel 3109 #define finPYRSet 3110 #define finPYRLabel 3111 #define varEditForm 3200 #define varEditField 3201 #define varEditOK 3202 #define varEditCancel 3203 #define varEditNameField 3204 #define altConfirmOverwrite 3205 #define varEditParam 3206 #define varEditParamLabel 3207 #define varFuncModTitle 3208 #define varVarModTitle 3209 #define varFuncNewTitle 3210 #define varVarNewTitle 3211 #define varStrVariable 3212 #define varStrFunction 3213 #define calcResPopupBut 3250 #define calcResList 3251 #define calcResPopup 3252 #define tdIntBin 3400 #define tdIntOct 3401 #define tdIntDec 3402 #define tdIntHex 3403 #define frmGrcSel 3500 #define btnGrcSelOK 3501 #define btnGrcSelCancel 3502 #define lstGrcSel 3503 #define altGrcSelectLeft 3504 #define altGrcSelectRight 3505 #define altGrcSelectValue 3506 #define altComputeResult 3507 #define altComputeCofirm 3508 #define altGrcBoundsErr 3509 #define altGrcFuncErr 3510 #define altOctalMode 3511 #define altSolverResult 3512 #define slvEquation 3601 #define slvUpdate 3602 #define slvVarList 3603 #define slvDone 3604 #define slvModify 3605 #define slvSolve 3606 #define slvCalculate 3608 #define slvWorksheet 3609 #define slvWorksheetList 3610 #define slvTitle 3611 #define slvTitleOK 3612 #define slvTitleCancel 3613 #define slvDelete 3615 #define slvOptions 3616 #define slvOptionsMin 3617 #define slvOptionsMax 3618 #define slvOptionsPrec 3619 #define slvOptionsOK 3620 #define slvOptionsCancel 3621 #define slvOptionsTitle 3622 #define slvNote 3623 #define slvNoteField 3624 #define slvNoteDone 3625 #define slvHelp 3626 #define slvMenu 3627 #define slvExport 3628 #define prefForm 4000 #define prefOK 4001 #define prefCancel 4002 #define prefNormal 4003 #define prefSci 4004 #define prefEng 4005 #define prefPrecPopup 4013 #define prefPrecList 4014 #define prefReducePrecision 4015 #define prefStrip 4016 #define prefParenth 4017 #define prefRadian 4018 #define prefDegree 4019 #define prefGrad 4020 #define prefDecimal 4022 #define prefBinary 4023 #define prefOctal 4024 #define prefHexa 4025 #define prefIntInput 4027 #define prefCvtUnits 4028 #define prefInsertHelp 4029 #define prefAcceptPref 4030 #define prefDispScien 4031 #define graphGadget 4100 #define btnGraphZoomIn 4101 #define btnGraphZoomOut 4102 #define btnGraphTrack 4103 #define graphTrackList 4104 #define graphTrackPopup 4105 #define btnGraphTrackGoto 4106 #define lstGraphCalcFunc 4107 #define btnGraphCalc 4108 #define lstGraphCalcParam 4109 #define strGrcDescription 4110 #define lstGraphCalcPolar 4111 #define btnGraphSpeed 4112 #define lstGraphSpeed 4113 #define graphMenu 4200 #define btnGraphPref 4201 #define btnGraphSetup 4202 #define btnGraphTable 4203 #define grPrefForm 4200 #define grPrefXmin 4202 #define grPrefXmax 4203 #define grPrefYmin 4204 #define grPrefYmax 4205 #define grPrefLabel1 4206 #define grPrefLabel2 4207 #define grPrefLabel3 4208 #define grPrefField1 4209 #define grPrefField2 4210 #define grPrefField3 4211 #define grPrefFunc 4212 #define grPrefPol 4213 #define grPrefPar 4214 #define grPrefDefault 4215 #define grPrefTrig 4216 #define grPrefXscale 4217 #define grPrefYscale 4218 #define ckbGrPrefLogX 4219 #define ckbGrPrefLogY 4220 #define grPrefLabel1u 4222 #define grPrefLabel2u 4223 #define grPrefLabel3u 4224 #define varList 4300 #define varListButton 4301 #define varListPopup 4302 #define varFuncListButton 4303 #define varBuiltinList 4304 #define varBuiltinListButton 4305 #define varBuiltinListPopup 4306 #define varEntryForm 4305 #define varEntryOK 4306 #define varEntryCancel 4307 #define varEntryField 4308 #define varEntryListBut 4309 #define varEntryList 4310 #define varEntryListPopup 4311 #define altBadVariableName 4312 #define histList 4400 #define histListPopup 4402 #define grSetupForm 4500 #define grSetupDone 4501 #define grSetupTable 4502 #define grSetupUp 4503 #define grSetupDown 4504 #define grSetupList 4505 #define grSetupPopup 4506 #define grSetupStrFunc 4508 #define grSetupNone 4509 #define grSetupUser 4510 #define ckbGrfun1 4511 #define ckbGrfun2 4512 #define ckbGrfun3 4513 #define ckbGrfun4 4514 #define ckbGrfun5 4515 #define ckbGrfun6 4516 #define ckbGrAxes 4517 #define ckbGrGrid 4518 #define grType1 4519 #define grType2 4520 #define grType3 4521 #define grType4 4522 #define grType5 4523 #define grType6 4524 #define grColor1 4525 #define grColor2 4526 #define grColor3 4527 #define grColor4 4528 #define grColor5 4529 #define grColor6 4530 #define grAxes 4531 #define grGrid 4532 #define grBgnd 4533 #define grBgndLbl 4534 #define grColorElem 4535 #define ckbGrAxesLabels 4536 #define grTableForm 4600 #define grTableTable 4601 #define grTableLeft 4602 #define grTableRight 4603 #define grTableDone 4604 #define grTableGoto 4605 #define grTableStep 4606 #define dinputForm 4700 #define dinputOK 4701 #define dinputCancel 4702 #define dinputField 4703 #define memoImportForm 4800 #define memoImportOK 4801 #define memoImportCancel 4802 #define memoImportList 4803 #define altMemoImportError 4804 #define memoExportQuestionForm 4805 #define memoExportOK 4806 #define memoExportCancel 4807 #define memoExportAll 4808 #define memoExportFunc 4809 #define memoExportVars 4810 #define btnListDone 4900 #define tblList 4901 #define popList1 4902 #define popList2 4903 #define popList3 4904 #define lstList 4905 #define btnListLong 4906 #define btnListInsert 4907 #define btnListDelete 4908 #define lblListLong 4909 #define sclList 4910 #define defForm 5000 #define defDone 5001 #define defList 5002 #define defNew 5003 #define defModify 5004 #define defDelete 5005 #define altConfirmDelete 5006 #define defPopupList 5007 #define defPopup 5008 #define abtLogo 6001 #define abtTitle 6002 #define abtVersion 6003 #define abtVerdate 6004 #define abthlpText 6005 #define abthlpOk 6006 #define abthlpUp 6007 #define abthlpDn 6008 #define bmpLArrow 7001 #define bmpRArrow 7002 #define bmpRootX 7003 #define bmpSquare 7004 #define bmpSquareRoot 7005 #define bmpExpon 7006 #define bmpInverse 7007 #define bmpPower 7008 #define bmpLdel 7009 #define bmpExe 7010 #define bmpIsPrime 7011 #define bmpPrevPrime 7012 #define bmpNextPrime 7013 #define frmUpdateVars 8000 #define frmUpdateResult 8001 #define frmUpdateWorksheet 8002 #define strErrCodes 8001 #define strMenuDescription 8002 #define strLocalNew 8003 #define strLocalDelete 8004 #define strLocalSaveAs 8005 #define strCredits 8006 #define strCreditsT 8007 #define strWorksheet 8008 #define strNewWorksheet 8009 #define strDescriptionVar 8010 #define strUndefined 8011 #define mitAbout 8500 #define mitListEdit 8501 #define mitMatrixEdit 8502 #define mitMemoExport 8503 #define mitMemoImport 8504 #define mitFinCalc 8505 #define mitDefMgr 8506 #define mitClearHistory 8507 #define mitCredits 8508 #define mitSolver 8509 #define sysEditMenuID 10000 #define sysEditMenuUndoCmd 10000 #define sysEditMenuCutCmd 10001 #define sysEditMenuCopyCmd 10002 #define sysEditMenuPasteCmd 10003 #define sysEditMenuSelectAllCmd 10004 #define sysEditMenuSeparator 10005 #define sysEditMenuKeyboardCmd 10006 #define sysEditMenuGraffitiCmd 10007 --- NEW FILE: core_display.h --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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 CORE_DISPLAY_H #define CORE_DISPLAY_H 1 //#include "EasyCalc.h" #define MENULEVEL_COMMAND 0 #define MENULEVEL_ALPHA 1 #define MENULEVEL_TRANSIENT 2 #define MENULEVEL_PLAIN 3 #define MENULEVEL_APP 4 void squeak() DISPLAY_SECT; void redisplay() DISPLAY_SECT; void set_menu(int level, int menuid) DISPLAY_SECT; #endif --- NEW FILE: core_main.cpp --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * The name and many features come from * - EasyCalc on Palm: * * It also is reusing elements from * - Free42: Thomas Okken * for its adaptation to the PocketPC world. * * 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 *****************************************************************************/ /* core_main.cpp : core functions which are not dependent on the running OS. *****************************************************************************/ #include "stdafx.h" #include "core_main.h" #include "core_globals.h" #include "core_tables.h" #include "core_display.h" #include <stdlib.h> /*------------------------------------------------------------------------------- - Constants. - -------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------- - Type declarations. - -------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------- - Global variables. - -------------------------------------------------------------------------------*/ int repeating = 0; int repeating_shift; int repeating_key; /*------------------------------------------------------------------------------- - Module variables. - -------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------- - Forward declarations. - -------------------------------------------------------------------------------*/ static void stop_interruptible() MAIN_SECT; static int handle_error(int error) MAIN_SECT; /*------------------------------------------------------------------------------- - Procedures. - -------------------------------------------------------------------------------*/ /******************************************************************************** * FUNCTION: set_shift() * * Set the shift state. * ********************************************************************************/ static void set_shift(bool state) { if (mode_shift != state) { mode_shift = state; shell_annunciators(ANNVAL_UNCH, state, ANNVAL_UNCH, ANNVAL_UNCH, ANNVAL_UNCH); } } /******************************************************************************** * FUNCTION: core_repeat() * * This function is called by the shell to signal auto-repeating key events. * * It is the core's responsibility to keep track of *which* key is repeating. * * The function can return 0, to request repeating to stop; 1, which requests * * a slow repeat rate, for SST/BST; or 2, which requests a fast repeat rate, * * for number/alpha entry. * ********************************************************************************/ int core_repeat() { // For EasyCalc, no repeat. // keydown(repeating_shift, repeating_key); // int rpt = repeating; int rpt = 0; repeating = 0; return (rpt); } /******************************************************************************** * FUNCTION: core_keytimeout1() * * This function informs the emulator core that the currently pressed key has * * been held down for 1/4 of a second. (If the key is released less than 1/4 * * second after being pressed, this function is not called.) * * For keys that do not execute immediately, this marks the moment when the * * calculator displays the key's function name. * ********************************************************************************/ void core_keytimeout1() { // Function not used by EasyCalc // if ((pending_command == CMD_LINGER1) || (pending_command == CMD_LINGER2)) // return; // if ((pending_command == CMD_RUN) || (pending_command == CMD_SST)) { // int saved_pending_command = pending_command; // if (pc == -1) // pc = 0; // prgm_highlight_row = 1; // flags.f.prgm_mode = 2; /* HACK - magic value to tell redisplay() */ // /* not to suppress option menu highlights */ // pending_command = CMD_NONE; // redisplay(); // flags.f.prgm_m... [truncated message content] |
|
From: Mapi B. <ma...@us...> - 2008-05-26 20:07:31
|
Update of /cvsroot/easycalc/PPCport In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv13944 Added Files: EasyCalc.ico Log Message: 1st upload, not compiling. --- NEW FILE: EasyCalc.ico --- (This appears to be a binary file; contents omitted.) |
|
From: Mapi B. <ma...@us...> - 2008-05-23 21:44:40
|
Update of /cvsroot/easycalc/PPCport In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv16216 Added Files: test.txt Log Message: Checking in test.txt --- NEW FILE: test.txt --- Test of CVS import. No other interest in this file. |
|
From: Jorge G. <cl...@us...> - 2008-02-25 12:44:22
|
Update of /cvsroot/easycalc/easycalc/mlib In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv25627/mlib Modified Files: stack.c Log Message: fixed bug Index: stack.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/mlib/stack.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** stack.c 22 Aug 2007 19:38:54 -0000 1.40 --- stack.c 25 Feb 2008 12:44:13 -0000 1.41 *************** *** 376,380 **** realarg = tmpitem.u.realval; if (-2147483648.0 <= realarg && realarg <= 2147483647.0) { ! *((Int32 *)arg1) = tmpitem.u.realval; } else --- 376,383 ---- realarg = tmpitem.u.realval; if (-2147483648.0 <= realarg && realarg <= 2147483647.0) { ! if (IS_ZERO(round(realarg)-realarg)) ! *((Int32 *)arg1) = tmpitem.u.realval; ! else ! err = c_badarg; } else |
|
From: Jorge G. <cl...@us...> - 2008-02-08 13:04:17
|
Update of /cvsroot/easycalc/easycalc In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv24762 Modified Files: result.c Log Message: evaluate litem before setting the anstype to show correctly the result_popup Index: result.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/result.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** result.c 18 Dec 2007 09:12:31 -0000 1.33 --- result.c 8 Feb 2008 13:04:10 -0000 1.34 *************** *** 202,206 **** Boolean freeitem = false; ! if (item.type==variable) { err = rpn_eval_variable(&item,item); if (err) { --- 202,206 ---- Boolean freeitem = false; ! if (item.type==variable || item.type == litem) { err = rpn_eval_variable(&item,item); if (err) { |
|
From: Jorge G. <cl...@us...> - 2007-12-24 10:45:13
|
Update of /cvsroot/easycalc/easycalc In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv28494 Modified Files: main.c Log Message: fixed bug: ans[i] did not work Index: main.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/main.c,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** main.c 7 Nov 2007 01:48:59 -0000 1.72 --- main.c 24 Dec 2007 10:45:10 -0000 1.73 *************** *** 371,377 **** if (!err) { result = stack_pop(stack); err=set_ans_var(result); - if (!err) - result_set(result); rpn_delete(result); } --- 371,376 ---- if (!err) { result = stack_pop(stack); + result_set(result); err=set_ans_var(result); rpn_delete(result); } |
|
From: Jorge G. <cl...@us...> - 2007-12-24 10:42:11
|
Update of /cvsroot/easycalc/easycalc In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv23234 Modified Files: main.c Log Message: fixed bug: ans[i] didn't work. now the result is first showed and then saved to ans. Index: main.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/main.c,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** main.c 7 Nov 2007 01:48:59 -0000 1.72 --- main.c 24 Dec 2007 10:32:19 -0000 1.73 *************** *** 371,377 **** if (!err) { result = stack_pop(stack); err=set_ans_var(result); - if (!err) - result_set(result); rpn_delete(result); } --- 371,376 ---- if (!err) { result = stack_pop(stack); + result_set(result); err=set_ans_var(result); rpn_delete(result); } |
|
From: Jorge G. <cl...@us...> - 2007-12-24 01:09:05
|
Update of /cvsroot/easycalc/easycalc/mlib In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv8587/mlib Modified Files: display.c funcs.c integ.c stack.c Log Message: debugged and simplified _item functions. LitemType removed Index: integ.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/mlib/integ.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** integ.c 28 Sep 2006 13:24:20 -0000 1.23 --- integ.c 24 Dec 2007 01:08:59 -0000 1.24 *************** *** 126,130 **** for (i = 0;i < argnum;i++) { item = stack_pop(stack); ! if (item.type==variable || item.type==litem) { err=rpn_eval_variable(&item,item); if (err) { --- 126,130 ---- for (i = 0;i < argnum;i++) { item = stack_pop(stack); ! if (item.type==variable) { err=rpn_eval_variable(&item,item); if (err) { Index: display.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/mlib/display.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** display.c 19 Dec 2007 15:47:26 -0000 1.13 --- display.c 24 Dec 2007 01:08:59 -0000 1.14 *************** *** 243,251 **** char *result; CError err; - Boolean deleterpn = false; ! if (rpn.type==variable || rpn.type == litem) { ! if (rpn.type == litem) ! deleterpn = true; err=rpn_eval_variable(&rpn,rpn); if (err) { --- 243,248 ---- char *result; CError err; ! if (rpn.type==variable ) { err=rpn_eval_variable(&rpn,rpn); if (err) { *************** *** 306,311 **** break; } ! if (deleterpn) ! rpn_delete(rpn); return result; } --- 303,307 ---- break; } ! return result; } Index: stack.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/mlib/stack.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** stack.c 22 Aug 2007 19:38:54 -0000 1.40 --- stack.c 24 Dec 2007 01:08:59 -0000 1.41 *************** *** 240,244 **** tmpitem = stack_pop(stack); ! if (tmpitem.type == variable || tmpitem.type == litem) { err = rpn_eval_variable(&tmpitem,tmpitem); if (err) --- 240,244 ---- tmpitem = stack_pop(stack); ! if (tmpitem.type == variable) { err = rpn_eval_variable(&tmpitem,tmpitem); if (err) *************** *** 546,550 **** tmp = stack->stack[stack->size - itnum -1]; ! if (tmp.type!=variable && tmp.type!=litem) { *type = tmp.type; return c_noerror; --- 546,550 ---- tmp = stack->stack[stack->size - itnum -1]; ! if (tmp.type!=variable) { *type = tmp.type; return c_noerror; *************** *** 595,599 **** for (i=0;i < funcval->paramcount;i++) { item = stack_pop(varstack); ! if (item.type == variable || item.type == litem) { err = rpn_eval_variable(&item,item); if (err) { --- 595,599 ---- for (i=0;i < funcval->paramcount;i++) { item = stack_pop(varstack); ! if (item.type == variable) { err = rpn_eval_variable(&item,item); if (err) { *************** *** 694,698 **** for (i=0;i < funcval->paramcount;i++) { item = stack_pop(varstack); ! if (item.type == variable || item.type == litem) { err = rpn_eval_variable(&item,item); if (err) { --- 694,698 ---- for (i=0;i < funcval->paramcount;i++) { item = stack_pop(varstack); ! if (item.type == variable) { err = rpn_eval_variable(&item,item); if (err) { *************** *** 830,834 **** item.type==string || item.type == complex || item.type == list || item.type == matrix || ! item.type == litem || item.type == cmatrix) { stack_push(varstack,item); } else if (item.type==function) { --- 830,834 ---- item.type==string || item.type == complex || item.type == list || item.type == matrix || ! item.type == cmatrix) { stack_push(varstack,item); } else if (item.type==function) { Index: funcs.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/mlib/funcs.c,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** funcs.c 7 Sep 2007 18:15:18 -0000 1.53 --- funcs.c 24 Dec 2007 01:08:59 -0000 1.54 *************** *** 205,209 **** { Int16 i; - Trpn tmp; CError err; --- 205,208 ---- *************** *** 214,265 **** return ConstTable[i].func(dest,ConstTable[i].param); ! tmp = db_read_variable(source.u.varname,&err); ! if (err) ! return err; ! ! *dest=tmp; ! return c_noerror; ! } else if (source.type == litem) { ! CodeStack *tstack; ! Functype *func=MemPtrNew(sizeof(*func)); ! UInt32 row=source.u.litemval.row; ! UInt32 col=source.u.litemval.col; ! ! tmp = db_read_variable(source.u.litemval.name,&err); if (err) return err; - - func->paramcount=3; - tstack = stack_new(3); - - if(tmp.type==list) - err = stack_add_val(tstack,&tmp.u.listval,list); - else if(tmp.type==matrix) - err = stack_add_val(tstack,&tmp.u.matrixval,matrix); - else if(tmp.type==cmatrix) - err = stack_add_val(tstack,&tmp.u.cmatrixval,cmatrix); - else - err = c_badarg; - - if(!err) - err = stack_add_val(tstack,&row,integer); - err = stack_add_val(tstack,&col,integer); - #ifdef SPECFUN_ENABLED - if(!err){ - if(tmp.type==list) - err = list_item(func,tstack); - else if(tmp.type==matrix) - err = matrix_item(func,tstack); - else - err = cmatrix_item(func,tstack); - } - #endif - if(!err) - *dest = stack_pop(tstack); ! MemPtrFree(func); ! stack_delete(tstack); ! rpn_delete(tmp); ! return err; } return c_internal; --- 213,221 ---- return ConstTable[i].func(dest,ConstTable[i].param); ! *dest = db_read_variable(source.u.varname,&err); if (err) return err; ! return c_noerror; } return c_internal; *************** *** 272,276 **** Boolean freeitem = false; ! if (ans.type==variable || ans.type==litem) { err=rpn_eval_variable(&ans,ans); if (err) --- 228,232 ---- Boolean freeitem = false; ! if (ans.type==variable) { err=rpn_eval_variable(&ans,ans); if (err) *************** *** 397,401 **** /* Evaluate variable, if it is var... */ ! if (item1.type==variable || item1.type==litem) { err=rpn_eval_variable(&item1,item1); if (err) { --- 353,357 ---- /* Evaluate variable, if it is var... */ ! if (item1.type==variable) { err=rpn_eval_variable(&item1,item1); if (err) { *************** *** 457,572 **** StrCopy(item1.u.funcname,item2.u.funcname); item1.allocsize=0; - } else if (item2.type == litem) { - /* In place modification of list/matrix (a[1]=5) */ - Trpn tmp; - Int16 row = item2.u.litemval.row; - Int16 col = item2.u.litemval.col; - CodeStack *tstack; - - tstack = stack_new(1); - stack_push(tstack,item1); - - tmp = db_read_variable(item2.u.litemval.name,&err); - if (!err) { - if (tmp.type == list) { - List *lst = tmp.u.listval; - if ( row==0 || col == 0 || row > lst->size || col > lst->size) - err = c_baddim; - else if(row==col){ - err = stack_get_val(tstack,&lst->item[col-1],complex); - } - #ifdef SPECFUN_ENABLED - else{ - List *lst2; - err = stack_get_val(tstack,&lst2,list); - if(!err){ - Int16 i,dif=col-row; - if(lst2->size != abs(dif)+1) - err = c_baddim; - else for(i=0;i<lst2->size;i++){ - lst->item[row-1]=lst2->item[i]; - row+=sgn(dif); - } - list_delete(lst2); - } - } - #endif - if (!err) - db_write_variable(item2.u.litemval.name,tmp); - } else if (tmp.type == matrix) { - Matrix *m = tmp.u.matrixval; - if ( row > m->rows || col > m->cols || (col == 0 && row==0)) - err = c_baddim; - else if(col && row) - err = stack_get_val(tstack,&MATRIX(m,row-1,col-1),real); - #ifdef SPECFUN_ENABLED - else{ - List *lst; - err = stack_get_val(tstack,&lst,list); - if(!err){ - Int16 i; - if(row==0){ - if(lst->size != m->rows) - err = c_baddim; - for(i=0;(!err && i<m->rows);i++){ - if(!IS_ZERO(lst->item[i].imag)) - err = c_badarg; - MATRIX(m,i,col-1)=lst->item[i].real; - } - }else{ - if(lst->size != m->cols) - err = c_baddim; - for(i=0;(!err && i<m->cols);i++){ - if(!IS_ZERO(lst->item[i].imag)) - err = c_badarg; - MATRIX(m,row-1,i)=lst->item[i].real; - } - } - list_delete(lst); - } - } - #endif - if (!err) - db_write_variable(item2.u.litemval.name,tmp); - } else if (tmp.type == cmatrix) { - CMatrix *m = tmp.u.cmatrixval; - if ( row > m->rows || col > m->cols || (col == 0 && row==0)) - err = c_baddim; - else if(col && row) - err = stack_get_val(tstack,&MATRIX(m,row-1,col-1),complex); - #ifdef SPECFUN_ENABLED - else{ - List *lst; - err = stack_get_val(tstack,&lst,list); - if(!err){ - Int16 i; - if(row==0){ - if(lst->size != m->rows) - err = c_baddim; - else for(i=0;i<m->rows;i++) - MATRIX(m,i,col-1)=lst->item[i]; - }else{ - if(lst->size != m->cols) - err = c_baddim; - else for(i=0;i<m->cols;i++) - MATRIX(m,row-1,i)=lst->item[i]; - } - list_delete(lst); - } - } - #endif - if (!err) - db_write_variable(item2.u.litemval.name,tmp); - } else - err = c_badarg; - if(!err) - /* Return all the list/matrix, not only the element(s) */ - stack_push(stack,tmp); - else - rpn_delete(tmp); - } - stack_delete(tstack); - rpn_delete(item2); - return err; } else if (item2.type == variable) { /* Definition of a variable */ --- 413,416 ---- *************** *** 615,619 **** for (i=0;i<paramcount;i++) { argarr[i] = stack_pop(varstack); ! if (argarr[i].type==variable || argarr[i].type==litem) { err=rpn_eval_variable(&argarr[i],argarr[i]); if (err) { --- 459,463 ---- for (i=0;i<paramcount;i++) { argarr[i] = stack_pop(varstack); ! if (argarr[i].type==variable) { err=rpn_eval_variable(&argarr[i],argarr[i]); if (err) { *************** *** 1107,1111 **** if (type1 == variable) { UInt32 arg1=0,arg2=0; ! Trpn item,ritem; err = stack_get_val(stack,&arg2,integer); --- 951,955 ---- if (type1 == variable) { UInt32 arg1=0,arg2=0; ! Trpn item; err = stack_get_val(stack,&arg2,integer); *************** *** 1116,1131 **** if (err) return err; ! }else ! arg1=arg2; item = stack_pop(stack); ! ritem.allocsize = 0; ! ritem.type = litem; ! StrCopy(ritem.u.litemval.name,item.u.varname); ! ritem.u.litemval.row = arg1; ! ritem.u.litemval.col = arg2; ! stack_push(stack,ritem); ! rpn_delete(item); ! } else switch (type2){ case list: return list_item(func,stack); --- 960,980 ---- if (err) return err; ! } item = stack_pop(stack); ! err = rpn_eval_variable(&item,item); ! if (err) ! return err; ! stack_push(stack,item); ! if (func->paramcount == 3){ ! err=stack_add_val(stack,&arg1,integer); ! if (err) ! return err; ! } ! err=stack_add_val(stack,&arg2,integer); ! if (err) ! return err; ! } ! switch (type2){ case list: return list_item(func,stack); |
|
From: Jorge G. <cl...@us...> - 2007-12-24 01:09:03
|
Update of /cvsroot/easycalc/easycalc In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv8587 Modified Files: result.c solver.c Log Message: debugged and simplified _item functions. LitemType removed Index: solver.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/solver.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** solver.c 28 Sep 2007 01:23:25 -0000 1.15 --- solver.c 24 Dec 2007 01:08:58 -0000 1.16 *************** *** 308,313 **** varcount = 0; for (i=0;i<stack->size;i++) { ! if (stack->stack[i].type == variable || ! stack->stack[i].type == litem) varcount++; } --- 308,312 ---- varcount = 0; for (i=0;i<stack->size;i++) { ! if (stack->stack[i].type == variable) varcount++; } *************** *** 318,323 **** if (stack->stack[i].type == variable) slv_add_variable(stack->stack[i].u.varname); - else if (stack->stack[i].type == litem) - slv_add_variable(stack->stack[i].u.litemval.name); } --- 317,320 ---- Index: result.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/result.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** result.c 18 Dec 2007 09:12:31 -0000 1.33 --- result.c 24 Dec 2007 01:08:58 -0000 1.34 *************** *** 199,232 **** { char *text; - CError err; - Boolean freeitem = false; ! if (item.type==variable) { ! err = rpn_eval_variable(&item,item); ! if (err) { ! result_error(err); ! return; ! } ! /* Do not display complete matrices */ ! if (((item.type == matrix || item.type == cmatrix) ! && item.u.matrixval->cols * item.u.matrixval->rows > 9) ! || (item.type == list && item.u.listval->size > 6)) ! text = display_default(item,false); ! else ! text = display_default(item,true); ! resultPrefs.ansType = item.type; ! resultPrefs.dispBase = dispPrefs.base; ! freeitem = true; ! } ! else { ! resultPrefs.ansType = item.type; ! resultPrefs.dispBase = dispPrefs.base; ! if (((item.type == matrix || item.type == cmatrix ) ! && item.u.matrixval->cols * item.u.matrixval->rows > 9) ! || (item.type == list && item.u.listval->size > 6)) ! text = display_default(item,false); ! else ! text = display_default(item,true); ! } /* Save the text for later use or Copy&Paste */ if (displayedText) --- 199,212 ---- { char *text; ! resultPrefs.ansType = item.type; ! resultPrefs.dispBase = dispPrefs.base; ! if (((item.type == matrix || item.type == cmatrix ) ! && item.u.matrixval->cols * item.u.matrixval->rows > 9) ! || (item.type == list && item.u.listval->size > 6)) ! text = display_default(item,false); ! else ! text = display_default(item,true); ! /* Save the text for later use or Copy&Paste */ if (displayedText) *************** *** 244,249 **** MemPtrFree(text); - if (freeitem) - rpn_delete(item); } --- 224,227 ---- |
|
From: Jorge G. <cl...@us...> - 2007-12-24 01:09:03
|
Update of /cvsroot/easycalc/easycalc/include In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv8587/include Modified Files: konvert.h Log Message: debugged and simplified _item functions. LitemType removed Index: konvert.h =================================================================== RCS file: /cvsroot/easycalc/easycalc/include/konvert.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** konvert.h 1 Oct 2006 22:43:36 -0000 1.22 --- konvert.h 24 Dec 2007 01:08:59 -0000 1.23 *************** *** 60,64 **** list, matrix, - litem, cmatrix }rpntype; --- 60,63 ---- *************** *** 109,118 **** typedef struct { - Int16 row; - Int16 col; - char name[MAX_FUNCNAME+1]; - }LitemType; - - typedef struct { UInt16 size; Complex item[0]; --- 108,111 ---- *************** *** 139,143 **** Functype funcval; /* Internal function call */ TextFunctype textfunc; /* User defined function call */ - LitemType litemval; char funcname[MAX_FUNCNAME+1]; /* Empty function */ char varname[MAX_FUNCNAME+1]; --- 132,135 ---- |
|
From: Jorge G. <cl...@us...> - 2007-12-23 13:53:11
|
Update of /cvsroot/easycalc/easycalc/mlib In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv23523/mlib Modified Files: guess.c Log Message: guess 'NaN' Index: guess.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/mlib/guess.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** guess.c 12 Sep 2006 19:40:56 -0000 1.7 --- guess.c 23 Dec 2007 13:53:06 -0000 1.8 *************** *** 229,232 **** --- 229,236 ---- if (!finite(t1)){ + if (isnan(t1)){ + StrPrintF(result,"NaN"); + return true; + } if(t1<0.0) StrCopy(result++,"-"); else StrCopy(result++,"+"); StrPrintF(result,"Inf"); |
|
From: Jorge G. <cl...@us...> - 2007-12-19 15:47:33
|
Update of /cvsroot/easycalc/easycalc/mlib In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv24783 Modified Files: display.c Log Message: improved the use of NaN & Inf Index: display.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/mlib/display.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** display.c 22 Aug 2007 19:24:03 -0000 1.12 --- display.c 19 Dec 2007 15:47:26 -0000 1.13 *************** *** 34,37 **** --- 34,38 ---- #include "fp.h" #include "stack.h" + #include "MathLib.h" TdispPrefs dispPrefs; *************** *** 61,68 **** if (number.real != 0.0 || number.imag==0.0) { fp_print_double(result,number.real); ! if (number.imag > 0.0) StrCat(result,"+"); } ! if (number.imag != 0.0) { fp_print_double(result+StrLen(result),number.imag); StrCat(result,"i"); --- 62,69 ---- if (number.real != 0.0 || number.imag==0.0) { fp_print_double(result,number.real); ! if (number.imag > 0.0 && finite(number.imag)) StrCat(result,"+"); } ! if (number.imag != 0.0 && !isnan(number.imag)) { fp_print_double(result+StrLen(result),number.imag); StrCat(result,"i"); |
|
From: Jorge G. <cl...@us...> - 2007-12-19 15:39:40
|
Update of /cvsroot/easycalc/easycalc/mlib In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv21643/mlib Modified Files: complex.c display.c mathem.c Log Message: improved the use of NaN & Inf Index: display.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/mlib/display.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** display.c 22 Aug 2007 19:24:03 -0000 1.12 --- display.c 19 Dec 2007 15:39:21 -0000 1.13 *************** *** 34,37 **** --- 34,38 ---- #include "fp.h" #include "stack.h" + #include "MathLib.h" TdispPrefs dispPrefs; *************** *** 61,68 **** if (number.real != 0.0 || number.imag==0.0) { fp_print_double(result,number.real); ! if (number.imag > 0.0) StrCat(result,"+"); } ! if (number.imag != 0.0) { fp_print_double(result+StrLen(result),number.imag); StrCat(result,"i"); --- 62,70 ---- if (number.real != 0.0 || number.imag==0.0) { fp_print_double(result,number.real); ! if (number.imag > 0.0 && finite(number.imag)) StrCat(result,"+"); } ! if (number.imag != 0.0 && !isnan(number.imag)) { ! if(number fp_print_double(result+StrLen(result),number.imag); StrCat(result,"i"); Index: complex.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/mlib/complex.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** complex.c 27 May 2007 01:34:09 -0000 1.23 --- complex.c 19 Dec 2007 15:39:21 -0000 1.24 *************** *** 573,578 **** break; case FUNC_DIVIDE: ! if (arg2.real==0.0 && arg2.imag==0.0) ! return c_divbyzero; result = cplx_div(arg1,arg2); break; --- 573,578 ---- break; case FUNC_DIVIDE: ! //if (arg2.real==0.0 && arg2.imag==0.0) ! //return c_divbyzero; result = cplx_div(arg1,arg2); break; *************** *** 594,598 **** } ! if (calcPrefs.reducePrecision) { if (fabs(result.real) < PRECISION_TO_ZERO) --- 594,598 ---- } ! if (calcPrefs.reducePrecision && finite(result.imag)) { if (fabs(result.real) < PRECISION_TO_ZERO) *************** *** 747,751 **** } ! if (calcPrefs.reducePrecision) { if (fabs(result.real) < PRECISION_TO_ZERO) result.real= 0.0; --- 747,751 ---- } ! if (calcPrefs.reducePrecision && finite(result.imag)) { if (fabs(result.real) < PRECISION_TO_ZERO) result.real= 0.0; Index: mathem.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/mlib/mathem.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** mathem.c 22 Aug 2007 19:24:03 -0000 1.37 --- mathem.c 19 Dec 2007 15:39:21 -0000 1.38 *************** *** 329,334 **** case FUNC_DIVIDE: if (arg2==0) ! return c_divbyzero; ! result=arg1/arg2; break; case FUNC_MOD: --- 329,336 ---- case FUNC_DIVIDE: if (arg2==0) ! //return c_divbyzero; ! result=!isnan(arg1)*sgn(arg1)/arg2; ! else ! result=arg1/arg2; break; case FUNC_MOD: *************** *** 723,727 **** /* Avoid the sin(pi) = 1E-15 problem */ ! if (calcPrefs.reducePrecision && fabs(res) < PRECISION_TO_ZERO) res = 0.0; --- 725,729 ---- /* Avoid the sin(pi) = 1E-15 problem */ ! if (calcPrefs.reducePrecision && finite(res) && fabs(res) < PRECISION_TO_ZERO) res = 0.0; |
|
From: Jorge G. <cl...@us...> - 2007-12-19 13:49:20
|
Update of /cvsroot/easycalc/easycalc In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv9149 Modified Files: graph.c grcalc.c grtaps.c grtaps.h Log Message: bold font for tracking some bugfixes/changes in graph mode when tracking a function, if "C" is pressed, the function is automatically selected for the calcs Index: graph.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/graph.c,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** graph.c 18 Dec 2007 09:06:37 -0000 1.62 --- graph.c 19 Dec 2007 13:49:13 -0000 1.63 *************** *** 1046,1050 **** break; case btnGraphCalc: ! grcalc_control(); break; case btnGraphZoomOut: --- 1046,1051 ---- break; case btnGraphCalc: ! /*if(graphState.funcnum>=MAX_GRFUNCS) //avoid tracking while drawing */ ! grcalc_control(); break; case btnGraphZoomOut: *************** *** 1058,1061 **** --- 1059,1066 ---- break; case btnGraphTrack: + /*if(graphState.funcnum<MAX_GRFUNCS){ //avoid tracking while drawing + grtaps_track_pause(); + break; + }*/ if (CtlGetValue(GetObjectPtr(btnGraphTrack))) { if (!grtaps_track_but()) *************** *** 1065,1071 **** } else { /* User unchecked the button */ ! FrmUpdateForm(frmGraph, frmUpdateVars); } - graph_draw_resume(); break; case btnGraphTrackGoto: --- 1070,1076 ---- } else { /* User unchecked the button */ ! grtaps_track_manual(grtaps_track_last_value(),track_redraw); ! grtaps_track_pause(); } break; case btnGraphTrackGoto: *************** *** 1087,1091 **** graph_draw_start(); if (CtlGetValue(GetObjectPtr(btnGraphTrack))) ! grtaps_track_manual(0.0, track_redraw); handled = true; } --- 1092,1098 ---- graph_draw_start(); if (CtlGetValue(GetObjectPtr(btnGraphTrack))) ! grtaps_track_pause(); ! /* Cancel the numeric input, if there was any*/ ! grcalc_init(); handled = true; } Index: grtaps.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/grtaps.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** grtaps.c 30 Sep 2007 00:35:42 -0000 1.33 --- grtaps.c 19 Dec 2007 13:49:13 -0000 1.34 *************** *** 31,34 **** --- 31,35 ---- #else #define HanderaCoord( x ) ( x ) + #define HanderaAdjustFont( font ) ( font ) #endif *************** *** 46,49 **** --- 47,52 ---- #include "funcs.h" + #define BOLDRES 1 + static Int16 trackSelected = 0; static double lastParam = 0.0; *************** *** 399,403 **** StrCopy(text,name); numtxt = text + StrLen(text); ! if (finite(value)) { fp_print_g_double(numtxt, value, 4); txtwidth = FntCharsWidth(text, StrLen(text)); --- 402,406 ---- StrCopy(text,name); numtxt = text + StrLen(text); ! //if (finite(value)) { fp_print_g_double(numtxt, value, 4); txtwidth = FntCharsWidth(text, StrLen(text)); *************** *** 415,419 **** WinPaintChars(text, StrLen(text), x, y); WinSetDrawMode(oldmode); ! } } --- 418,422 ---- WinPaintChars(text, StrLen(text), x, y); WinSetDrawMode(oldmode); ! //} } *************** *** 531,534 **** --- 534,544 ---- } else { + FontID oldfont; + #ifdef SONY_SDK + if (gHrMode == hrSony) + oldfont = HRFntSetFont(gHrLibRefNum, hrStdFont+BOLDRES); + else + #endif + oldfont = FntSetFont(HanderaAdjustFont(stdFont+BOLDRES)); gadget_bounds(FrmGetActiveForm(), graphGadget, &natbounds, &stdbounds); *************** *** 572,575 **** --- 582,591 ---- oldangle = math_rad_to_user(lastParam); } + #ifdef SONY_SDK + if(gHrMode == hrSony) + HRFntSetFont(gHrLibRefNum, oldfont); + else + #endif + FntSetFont(oldfont); } } *************** *** 833,836 **** --- 849,859 ---- /* Is tracking checked? */ else if (CtlGetValue(GetObjectPtr(btnGraphTrack))) { + FontID oldfont; + #ifdef SONY_SDK + if (gHrMode == hrSony) + oldfont = HRFntSetFont(gHrLibRefNum, hrStdFont+BOLDRES); + else + #endif + oldfont = FntSetFont(HanderaAdjustFont(stdFont+BOLDRES)); if (graphPrefs.functype == graph_func) grtaps_track_func(x, y, &natbounds, &stdbounds); *************** *** 839,842 **** --- 862,871 ---- else if (graphPrefs.functype == graph_param) grtaps_track_param(x, y, &natbounds, &stdbounds); + #ifdef SONY_SDK + if(gHrMode == hrSony) + HRFntSetFont(gHrLibRefNum, oldfont); + else + #endif + FntSetFont(oldfont); } else /* Move the graph */ *************** *** 864,868 **** FormPtr frm = FrmGetActiveForm(); ! grtaps_track_manual(0, track_add); FrmShowObject(frm, FrmGetObjectIndex(frm, btnGraphTrackGoto)); } --- 893,897 ---- FormPtr frm = FrmGetActiveForm(); ! grtaps_track_manual(0, track_redraw); FrmShowObject(frm, FrmGetObjectIndex(frm, btnGraphTrackGoto)); } *************** *** 947,948 **** --- 976,992 ---- return lastParam; } + + /*********************************************************************** + * + * FUNCTION: grtaps_trackSelected + * + * PARAMETERS: Nothing + * + * RETURN: The index of the function selected for tracking + * + ***********************************************************************/ + Int16 + grtaps_trackSelected(void) + { + return trackSelected; + } Index: grcalc.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/grcalc.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** grcalc.c 25 Aug 2007 17:58:14 -0000 1.20 --- grcalc.c 19 Dec 2007 13:49:13 -0000 1.21 *************** *** 160,166 **** grFuncType = ccs[i]; ! grSelFunction = grcalc_select_funcname(); ! if (grSelFunction == -1) ! return false; switch (grFuncType) { --- 160,171 ---- grFuncType = ccs[i]; ! if (CtlGetValue(GetObjectPtr(btnGraphTrack))) ! grSelFunction=grtaps_trackSelected(); ! else{ ! grSelFunction = grcalc_select_funcname(); ! if (grSelFunction == -1) ! return false; ! grtaps_track_track(grSelFunction); ! } switch (grFuncType) { *************** *** 188,192 **** break; } - grtaps_track_track(grSelFunction); return true; } --- 193,196 ---- *************** *** 366,370 **** else { grState = cl_none; ! grtaps_track_pause(); } break; --- 370,374 ---- else { grState = cl_none; ! //grtaps_track_pause(); } break; *************** *** 373,377 **** grcalc_calculate(); grState = cl_none; ! grtaps_track_pause(); break; case cl_value: --- 377,381 ---- grcalc_calculate(); grState = cl_none; ! //grtaps_track_pause(); break; case cl_value: *************** *** 379,383 **** grcalc_calculate(); grState = cl_none; ! grtaps_track_pause(); break; } --- 383,387 ---- grcalc_calculate(); grState = cl_none; ! //grtaps_track_pause(); break; } Index: grtaps.h =================================================================== RCS file: /cvsroot/easycalc/easycalc/grtaps.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** grtaps.h 30 Sep 2007 00:35:42 -0000 1.9 --- grtaps.h 19 Dec 2007 13:49:13 -0000 1.10 *************** *** 50,53 **** --- 50,54 ---- void grtaps_track_track(Int16 track) GRAPH; double grtaps_track_last_value(void) GRAPH; + Int16 grtaps_trackSelected(void) GRAPH; #endif |
|
From: Jorge G. <cl...@us...> - 2007-12-19 13:20:26
|
Update of /cvsroot/easycalc/easycalc In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv29004 Modified Files: graph.c grcalc.c grtaps.c grtaps.h Log Message: bold font for tracking.\nsome bugfixes in graph mode\nwhen tracking a function, if C is pressed, the function is automatically selected for the calcs Index: graph.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/graph.c,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** graph.c 18 Dec 2007 09:06:37 -0000 1.62 --- graph.c 19 Dec 2007 13:20:14 -0000 1.63 *************** *** 1046,1050 **** break; case btnGraphCalc: ! grcalc_control(); break; case btnGraphZoomOut: --- 1046,1051 ---- break; case btnGraphCalc: ! /*if(graphState.funcnum>=MAX_GRFUNCS) //avoid tracking while drawing */ ! grcalc_control(); break; case btnGraphZoomOut: *************** *** 1058,1061 **** --- 1059,1066 ---- break; case btnGraphTrack: + /*if(graphState.funcnum<MAX_GRFUNCS){ //avoid tracking while drawing + grtaps_track_pause(); + break; + }*/ if (CtlGetValue(GetObjectPtr(btnGraphTrack))) { if (!grtaps_track_but()) *************** *** 1065,1071 **** } else { /* User unchecked the button */ ! FrmUpdateForm(frmGraph, frmUpdateVars); } - graph_draw_resume(); break; case btnGraphTrackGoto: --- 1070,1076 ---- } else { /* User unchecked the button */ ! grtaps_track_manual(grtaps_track_last_value(),track_redraw); ! grtaps_track_pause(); } break; case btnGraphTrackGoto: *************** *** 1087,1091 **** graph_draw_start(); if (CtlGetValue(GetObjectPtr(btnGraphTrack))) ! grtaps_track_manual(0.0, track_redraw); handled = true; } --- 1092,1098 ---- graph_draw_start(); if (CtlGetValue(GetObjectPtr(btnGraphTrack))) ! grtaps_track_pause(); ! /* Cancel the numeric input, if there was any*/ ! grcalc_init(); handled = true; } Index: grtaps.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/grtaps.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** grtaps.c 30 Sep 2007 00:35:42 -0000 1.33 --- grtaps.c 19 Dec 2007 13:20:15 -0000 1.34 *************** *** 31,34 **** --- 31,35 ---- #else #define HanderaCoord( x ) ( x ) + #define HanderaAdjustFont( font ) ( font ) #endif *************** *** 46,49 **** --- 47,52 ---- #include "funcs.h" + #define BOLDRES 1 + static Int16 trackSelected = 0; static double lastParam = 0.0; *************** *** 399,403 **** StrCopy(text,name); numtxt = text + StrLen(text); ! if (finite(value)) { fp_print_g_double(numtxt, value, 4); txtwidth = FntCharsWidth(text, StrLen(text)); --- 402,406 ---- StrCopy(text,name); numtxt = text + StrLen(text); ! //if (finite(value)) { fp_print_g_double(numtxt, value, 4); txtwidth = FntCharsWidth(text, StrLen(text)); *************** *** 415,419 **** WinPaintChars(text, StrLen(text), x, y); WinSetDrawMode(oldmode); ! } } --- 418,422 ---- WinPaintChars(text, StrLen(text), x, y); WinSetDrawMode(oldmode); ! //} } *************** *** 531,534 **** --- 534,544 ---- } else { + FontID oldfont; + #ifdef SONY_SDK + if (gHrMode == hrSony) + oldfont = HRFntSetFont(gHrLibRefNum, hrStdFont+BOLDRES); + else + #endif + oldfont = FntSetFont(HanderaAdjustFont(stdFont+BOLDRES)); gadget_bounds(FrmGetActiveForm(), graphGadget, &natbounds, &stdbounds); *************** *** 572,575 **** --- 582,591 ---- oldangle = math_rad_to_user(lastParam); } + #ifdef SONY_SDK + if(gHrMode == hrSony) + HRFntSetFont(gHrLibRefNum, oldfont); + else + #endif + FntSetFont(oldfont); } } *************** *** 833,836 **** --- 849,859 ---- /* Is tracking checked? */ else if (CtlGetValue(GetObjectPtr(btnGraphTrack))) { + FontID oldfont; + #ifdef SONY_SDK + if (gHrMode == hrSony) + oldfont = HRFntSetFont(gHrLibRefNum, hrStdFont+BOLDRES); + else + #endif + oldfont = FntSetFont(HanderaAdjustFont(stdFont+BOLDRES)); if (graphPrefs.functype == graph_func) grtaps_track_func(x, y, &natbounds, &stdbounds); *************** *** 839,842 **** --- 862,871 ---- else if (graphPrefs.functype == graph_param) grtaps_track_param(x, y, &natbounds, &stdbounds); + #ifdef SONY_SDK + if(gHrMode == hrSony) + HRFntSetFont(gHrLibRefNum, oldfont); + else + #endif + FntSetFont(oldfont); } else /* Move the graph */ *************** *** 864,868 **** FormPtr frm = FrmGetActiveForm(); ! grtaps_track_manual(0, track_add); FrmShowObject(frm, FrmGetObjectIndex(frm, btnGraphTrackGoto)); } --- 893,897 ---- FormPtr frm = FrmGetActiveForm(); ! grtaps_track_manual(0, track_redraw); FrmShowObject(frm, FrmGetObjectIndex(frm, btnGraphTrackGoto)); } *************** *** 947,948 **** --- 976,992 ---- return lastParam; } + + /*********************************************************************** + * + * FUNCTION: grtaps_trackSelected + * + * PARAMETERS: Nothing + * + * RETURN: The index of the function selected for tracking + * + ***********************************************************************/ + Int16 + grtaps_trackSelected(void) + { + return trackSelected; + } Index: grcalc.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/grcalc.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** grcalc.c 25 Aug 2007 17:58:14 -0000 1.20 --- grcalc.c 19 Dec 2007 13:20:15 -0000 1.21 *************** *** 160,166 **** grFuncType = ccs[i]; ! grSelFunction = grcalc_select_funcname(); ! if (grSelFunction == -1) ! return false; switch (grFuncType) { --- 160,171 ---- grFuncType = ccs[i]; ! if (CtlGetValue(GetObjectPtr(btnGraphTrack))) ! grSelFunction=grtaps_trackSelected(); ! else{ ! grSelFunction = grcalc_select_funcname(); ! if (grSelFunction == -1) ! return false; ! grtaps_track_track(grSelFunction); ! } switch (grFuncType) { *************** *** 188,192 **** break; } - grtaps_track_track(grSelFunction); return true; } --- 193,196 ---- *************** *** 366,370 **** else { grState = cl_none; ! grtaps_track_pause(); } break; --- 370,374 ---- else { grState = cl_none; ! //grtaps_track_pause(); } break; *************** *** 373,377 **** grcalc_calculate(); grState = cl_none; ! grtaps_track_pause(); break; case cl_value: --- 377,381 ---- grcalc_calculate(); grState = cl_none; ! //grtaps_track_pause(); break; case cl_value: *************** *** 379,383 **** grcalc_calculate(); grState = cl_none; ! grtaps_track_pause(); break; } --- 383,387 ---- grcalc_calculate(); grState = cl_none; ! //grtaps_track_pause(); break; } Index: grtaps.h =================================================================== RCS file: /cvsroot/easycalc/easycalc/grtaps.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** grtaps.h 30 Sep 2007 00:35:42 -0000 1.9 --- grtaps.h 19 Dec 2007 13:20:15 -0000 1.10 *************** *** 50,53 **** --- 50,54 ---- void grtaps_track_track(Int16 track) GRAPH; double grtaps_track_last_value(void) GRAPH; + Int16 grtaps_trackSelected(void) GRAPH; #endif |