Binary files gv-3.6.2/doc/gv.info and gv-3.6.2-savepos/doc/gv.info differ diff -u -r gv-3.6.2/src/actions.c gv-3.6.2-savepos/src/actions.c --- gv-3.6.2/src/actions.c 2005-08-10 20:46:20.000000000 +0530 +++ gv-3.6.2-savepos/src/actions.c 2008-01-09 09:14:43.000000000 +0530 @@ -793,6 +793,23 @@ } /*##################################################################*/ +/* action_savepos */ +/*##################################################################*/ + +void +action_savepos(w, event, params, num_params) + Widget w; + XEvent *event; + String *params; + Cardinal *num_params; +{ + BEGINMESSAGE(action_savepos) + if (!XtIsSensitive(saveposEntry)) {INFMESSAGE(insensitive) ENDMESSAGE(action_savepos) return; } + cb_savepos((Widget)NULL,(XtPointer)NULL,(XtPointer)NULL); + ENDMESSAGE(action_savepos) +} + +/*##################################################################*/ /* action_save */ /* Popup the save file dialog box. */ /*##################################################################*/ diff -u -r gv-3.6.2/src/actions.h gv-3.6.2-savepos/src/actions.h --- gv-3.6.2/src/actions.h 2004-11-11 17:51:04.000000000 +0530 +++ gv-3.6.2-savepos/src/actions.h 2008-01-08 22:57:35.000000000 +0530 @@ -150,6 +150,15 @@ #endif ); +extern void action_savepos ( +#if NeedFunctionPrototypes + Widget, + XEvent *, + String *, + Cardinal * +#endif +); + extern void action_save ( #if NeedFunctionPrototypes Widget, diff -u -r gv-3.6.2/src/callbacks.c gv-3.6.2-savepos/src/callbacks.c --- gv-3.6.2/src/callbacks.c 2005-08-10 17:03:21.000000000 +0530 +++ gv-3.6.2-savepos/src/callbacks.c 2008-01-13 22:46:05.000000000 +0530 @@ -90,6 +90,9 @@ static char* save_directory = NULL; static char* open_directory = NULL; +static int last_psx; +static int last_psy; + /*############################################################*/ /* cb_showTitle */ /*############################################################*/ @@ -826,6 +829,28 @@ } /*##################################################################*/ +/* cb_savepos */ +/*##################################################################*/ + +void +cb_savepos(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; +{ + FILE* posfile = fopen("gv.savepos", "a"); + + BEGINMESSAGE(cb_savepos) + if (posfile == NULL) { + INFMESSAGE(cannot open file for writting) + ENDMESSAGE(cb_savepos) + return; + } + fprintf(posfile, "%i %i\n", last_psx, last_psy); + fclose(posfile); + ENDMESSAGE(cb_savepos) +} + +/*##################################################################*/ /* cb_redisplay */ /*##################################################################*/ @@ -1134,6 +1159,8 @@ } x=p->psx; y=p->psy; } + last_psx = p->psx; + last_psy = p->psy; ENDMESSAGE1(cb_track) return; } @@ -1374,5 +1401,3 @@ XtDestroyWidget(toplevel); ENDMESSAGE(cb_doQuit) } - - diff -u -r gv-3.6.2/src/callbacks.h gv-3.6.2-savepos/src/callbacks.h --- gv-3.6.2/src/callbacks.h 2004-11-11 17:51:04.000000000 +0530 +++ gv-3.6.2-savepos/src/callbacks.h 2008-01-09 09:15:12.000000000 +0530 @@ -193,6 +193,14 @@ #endif ); +extern void cb_savepos ( +#if NeedFunctionPrototypes + Widget, + XtPointer, + XtPointer +#endif +); + extern void cb_redisplay ( #if NeedFunctionPrototypes Widget, @@ -313,4 +321,5 @@ #endif ); + #endif /* _GV_CALLBACKS_H_ */ diff -u -r gv-3.6.2/src/gv_misc_res.dat gv-3.6.2-savepos/src/gv_misc_res.dat --- gv-3.6.2/src/gv_misc_res.dat 2005-04-01 02:44:27.000000000 +0530 +++ gv-3.6.2-savepos/src/gv_misc_res.dat 2008-01-09 09:25:28.000000000 +0530 @@ -401,6 +401,7 @@ p: GV_Print(all) \n\ ~c ~s period: GV_Page(redisplay) \n\ period: GV_Reopen() \n\ + Z: GV_SavePos() \n\ c L: GV_Page(redisplay) \n\ M: GV_SetPageMark(current,mark)\n\ N: GV_SetPageMark(current,unmark)\n\ diff -u -r gv-3.6.2/src/main.c gv-3.6.2-savepos/src/main.c --- gv-3.6.2/src/main.c 2006-09-15 00:26:08.000000000 +0530 +++ gv-3.6.2-savepos/src/main.c 2008-01-09 09:14:43.000000000 +0530 @@ -236,6 +236,7 @@ { "GV_Print" , action_print }, { "GV_Quit" , action_quit }, { "GV_Reopen" , action_reopen }, + { "GV_SavePos" , action_savepos }, { "GV_Resizing" , action_autoResize }, { "GV_Save" , action_save }, { "GV_SetScale" , action_setScale }, @@ -780,6 +781,7 @@ { &fileMenu, "menu", NULL ,NULL}, { &openEntry, "open", cb_openFile, NULL}, { &reopenEntry, "reopen", cb_reopen, NULL}, + { &saveposEntry, "savepos", cb_savepos, NULL}, { &updateEntry, "update", cb_checkFile, (XtPointer)CHECK_FILE_VERSION }, { NULL, "line", NULL, NULL }, { &printAllEntry, "printAllPages", cb_print, (XtPointer)PAGE_MODE_ALL}, diff -u -r gv-3.6.2/src/main_globals.h gv-3.6.2-savepos/src/main_globals.h --- gv-3.6.2/src/main_globals.h 2005-03-31 17:44:09.000000000 +0530 +++ gv-3.6.2-savepos/src/main_globals.h 2008-01-09 09:18:00.000000000 +0530 @@ -171,6 +171,7 @@ EXTERN Widget fileMenu; EXTERN Widget openEntry; EXTERN Widget reopenEntry; +EXTERN Widget saveposEntry; EXTERN Widget updateEntry; EXTERN Widget printAllEntry; EXTERN Widget printMarkedEntry; diff -u -r gv-3.6.2/src/misc.c gv-3.6.2-savepos/src/misc.c --- gv-3.6.2/src/misc.c 2005-08-10 17:03:21.000000000 +0530 +++ gv-3.6.2-savepos/src/misc.c 2008-01-09 09:18:00.000000000 +0530 @@ -1084,6 +1084,7 @@ misc_setSensitive(w_unmarkAllPages , show_unmarkAllPages , (toc_text != NULL)); XtSetSensitive(reopenEntry, (gv_psfile != NULL)); + XtSetSensitive(saveposEntry, (gv_psfile != NULL)); XtSetSensitive(printAllEntry, (gv_psfile != NULL)); XtSetSensitive(printMarkedEntry, (toc_text != NULL)); XtSetSensitive(saveAllEntry, (gv_psfile != NULL));