summaryrefslogtreecommitdiff
path: root/app/bin/misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'app/bin/misc.h')
-rw-r--r--app/bin/misc.h109
1 files changed, 56 insertions, 53 deletions
diff --git a/app/bin/misc.h b/app/bin/misc.h
index 2be0be2..509f2d8 100644
--- a/app/bin/misc.h
+++ b/app/bin/misc.h
@@ -25,20 +25,11 @@
#define EXPORT
-#include <stdio.h>
-
#include "acclkeys.h"
#include "common.h"
-#include "draw.h"
-#include "wlib.h"
typedef void (*addButtonCallBack_t)(void*);
-#ifdef WINDOWS
-/* suppress warning from *.bmp about conversion of int to char */
-#pragma warning( disable : 4305)
-#endif
-
#define COUNT(A) (sizeof(A)/sizeof(A[0]))
#define STR_SIZE (256)
@@ -54,6 +45,8 @@ typedef void (*addButtonCallBack_t)(void*);
* Globals
*/
+extern int iconSize;
+
extern long adjTimer;
typedef int SCALEINX_T;
@@ -78,6 +71,7 @@ extern ANGLE_T connectAngle;
extern long twoRailScale;
extern long mapScale;
extern long constrainMain;
+extern long dontHideCursor;
extern long checkPtInterval;
extern long autosaveChkPoints;
extern long liveMap;
@@ -178,20 +172,20 @@ typedef STATUS_T (*procCommand_t) (wAction_t, coOrd);
/*
* Windows and buttons
*/
-extern wPos_t DlgSepLeft;
-extern wPos_t DlgSepMid;
-extern wPos_t DlgSepRight;
-extern wPos_t DlgSepTop;
-extern wPos_t DlgSepBottom;
-extern wPos_t DlgSepNarrow;
-extern wPos_t DlgSepWide;
-extern wPos_t DlgSepFrmLeft;
-extern wPos_t DlgSepFrmRight;
-extern wPos_t DlgSepFrmTop;
-extern wPos_t DlgSepFrmBottom;
+extern wWinPix_t DlgSepLeft;
+extern wWinPix_t DlgSepMid;
+extern wWinPix_t DlgSepRight;
+extern wWinPix_t DlgSepTop;
+extern wWinPix_t DlgSepBottom;
+extern wWinPix_t DlgSepNarrow;
+extern wWinPix_t DlgSepWide;
+extern wWinPix_t DlgSepFrmLeft;
+extern wWinPix_t DlgSepFrmRight;
+extern wWinPix_t DlgSepFrmTop;
+extern wWinPix_t DlgSepFrmBottom;
extern wWin_p mainW;
-extern wPos_t toolbarHeight;
+extern wWinPix_t toolbarHeight;
extern wIndex_t changed;
extern char message[STR_HUGE_SIZE];
extern REGION_T curRegion;
@@ -212,30 +206,30 @@ extern wMenu_p popup1M, popup2M;
#define wControlBeside( B ) (wControlGetPosX((wControl_p)(B))+wControlGetWidth((wControl_p)(B)))
typedef void (*rotateDialogCallBack_t) ( void * );
+typedef void (*indexDialogCallBack_t) (void * );
typedef void (*moveDialogCallBack_t) (void *);
extern void AddRotateMenu( wMenu_p, rotateDialogCallBack_t );
extern void AddMoveMenu( wMenu_p, moveDialogCallBack_t );
-extern void StartRotateDialog( rotateDialogCallBack_t );
-extern void StartMoveDialog(moveDialogCallBack_t );
+extern void AddIndexMenu(wMenu_p m, indexDialogCallBack_t func);
/*
* Safe Memory etc
*/
-void * MyMalloc( long );
-void * MyRealloc( void *, long );
+void * MyMalloc( size_t );
+void * MyRealloc( void *, size_t );
void MyFree( void * );
void * memdup( void *, size_t );
char * MyStrdup( const char * );
-void AbortProg( char *, ... );
+void AbortProg( const char *, ... );
#define ASSERT( X ) if ( !(X) ) AbortProg( "%s: %s:%d", #X, __FILE__, __LINE__ )
-char * Strcpytrimed( char *, char *, BOOL_T );
-char * BuildTrimedTitle( char *, char *, char *, char *, char * );
-void ErrorMessage( char *, ... );
-void InfoMessage( char *, ... );
-int NoticeMessage( char *, char*, char *, ... );
-int NoticeMessage2( int, char *, char*, char *, ... );
-void DoQuit( void );
-
-void FileIsChanged(void);
+char * Strcpytrimed( char *, const char *, BOOL_T );
+char * BuildTrimedTitle( char *, const char *, const char *, const char *, const char * );
+void ErrorMessage( const char *, ... );
+void InfoMessage( const char *, ... );
+int NoticeMessage( const char *, const char*, const char *, ... );
+int NoticeMessage2( int, const char *, const char*, const char *, ... );
+void DoQuit( void * unused );
+
+void SetFileChanged(void);
char * ConvertFromEscapedText(const char * text);
char * ConvertToEscapedText(const char * text);
@@ -244,18 +238,19 @@ void wShow( wWin_p );
void wHide( wWin_p );
void CloseDemoWindows( void );
void DefaultProc( wWin_p, winProcEvent, void * );
-void SelectFont();
+void SelectFont( void * unused );
void CheckRoomSize( BOOL_T );
-const char * GetBalloonHelpStr( char* );
+const char * GetBalloonHelpStr( const char* );
const char * GetCurCommandName( void );
void EnableCommands( void );
void Reset( void );
+void TryCheckPoint( void );
wIndex_t GetCurrentCommand(void);
BOOL_T IsCurCommandSticky(void);
void ResetIfNotSticky( void );
wBool_t DoCurCommand( wAction_t, coOrd );
-void ConfirmReset( BOOL_T );
+int ConfirmReset( BOOL_T );
void LayoutToolBar( void * );
#define IC_STICKY (1<<0)
#define IC_INITNOTSTICKY (1<<1)
@@ -276,24 +271,24 @@ void LayoutToolBar( void * );
#define IC_PLAYBACK_PUSH (1<<16)
#define IC_WANT_MODKEYS (1<<17)
#define IC_POPUP3 (1<<18)
-wIndex_t InitCommand( wMenu_p, procCommand_t, char *, char *, int, long, long );
+wIndex_t InitCommand( wMenu_p, procCommand_t, const char *, const char *, int, long, long );
void AddToolbarControl( wControl_p, long );
BOOL_T CommandEnabled( wIndex_t );
-wButton_p AddToolbarButton( char*, wIcon_p, long, wButtonCallBack_p, void * context );
-wIndex_t AddCommandButton( procCommand_t, char*, char*, wIcon_p, int, long, long, void* );
-wIndex_t AddMenuButton( wMenu_p, procCommand_t, char*, char*, wIcon_p, int, long, long, void* );
+wButton_p AddToolbarButton( const char*, wIcon_p, long, wButtonCallBack_p, void * context );
+// RWS not found: wIndex_t AddCommandButton( procCommand_t, char*, char*, wIcon_p, int, long, long, void* );
+wIndex_t AddMenuButton( wMenu_p, procCommand_t, const char*, const char*, wIcon_p, int, long, long, void* );
void PlaybackButtonMouse( wIndex_t );
-void ButtonGroupBegin( char *, char *, char * );
+void ButtonGroupBegin( const char *, const char *, const char * );
void ButtonGroupEnd( void );
void SaveState( void );
-void PlaybackCommand( char *, wIndex_t );
-wMenu_p MenuRegister( char * label );
+void PlaybackCommand( const char *, wIndex_t );
+wMenu_p MenuRegister( const char * label );
void DoCommandB( void * );
-extern void EnumerateTracks( void );
-void InitDebug( char *, long * );
+extern void EnumerateTracks( void * unused );
+void InitDebug( const char *, long * );
#define CHANGE_SCALE (1<<0)
#define CHANGE_PARAMS (1<<1)
@@ -305,6 +300,7 @@ void InitDebug( char *, long * );
#define CHANGE_TOOLBAR (1<<8)
#define CHANGE_CMDOPT (1<<9)
#define CHANGE_LIMITS (1<<10)
+#define CHANGE_ICONSIZE (1<<11)
#define CHANGE_ALL (CHANGE_SCALE|CHANGE_PARAMS|CHANGE_MAIN|CHANGE_MAP|CHANGE_UNITS|CHANGE_TOOLBAR|CHANGE_CMDOPT|CHANGE_BACKGROUND)
typedef void (*changeNotificationCallBack_t)( long );
void RegisterChangeNotification( changeNotificationCallBack_t );
@@ -313,7 +309,6 @@ void DoChangeNotification( long );
wBool_t CheckHelpTopicExists(const char * topic);
/* foreign externs */
-extern drawCmd_t mapD;
extern STATUS_T CmdEnumerate( wAction_t, coOrd );
extern wIndex_t modifyCmdInx;
@@ -326,9 +321,15 @@ void InitNewTurn( wMenu_p m );
/* cnote.c */
void ClearNote( void );
+/* cprintc.c */
+coOrd GetPrintOrig();
+ANGLE_T GetPrintAngle();
+
+
/* cruler.c */
void RulerRedraw( BOOL_T );
STATUS_T ModifyRuler( wAction_t, coOrd );
+STATUS_T ModifyProtractor( wAction_t, coOrd );
/* dialogs */
void OutputBitMap( void );
@@ -336,6 +337,7 @@ void OutputBitMap( void );
extern wDrawColor snapGridColor;
addButtonCallBack_t ColorInit( void );
+addButtonCallBack_t SettingsInit( void );
addButtonCallBack_t PrefInit( void );
addButtonCallBack_t LayoutInit( void );
addButtonCallBack_t DisplayInit( void );
@@ -348,23 +350,23 @@ addButtonCallBack_t ControlMgrInit ( void );
wIndex_t InitGrid( wMenu_p menu );
-void SnapPos( coOrd * );
+BOOL_T SnapPos( coOrd * );
void DrawSnapGrid( drawCmd_p, coOrd, BOOL_T );
BOOL_T GridIsVisible( void );
void InitSnapGridButtons( void );
-void SnapGridEnable( void );
-void SnapGridShow( void );
+void SnapGridEnable( void * unused );
+void SnapGridShow( void * unused );
void MapWindowShow( int state );
extern wMenuToggle_p snapGridEnableMI;
extern wMenuToggle_p snapGridShowMI;
void ScaleLengthEnd( void );
-void EnumerateList( long, FLOAT_T, char * );
+void EnumerateList( long, FLOAT_T, char * , char * );
void EnumerateStart(void);
void EnumerateEnd(void);
/* cnote.c */
-void DoNote( void );
+void DoNote( void * unused );
BOOL_T WriteMainNote( FILE * );
BOOL_T ReadMainNote(char * line);
@@ -448,5 +450,6 @@ void InitCmdSensor ( wMenu_p menu );
/* cmodify.c */
STATUS_T CmdModify(wAction_t action,coOrd pos );
+#include "misc2.h"
#endif