Commit f666e2ed authored by openbsd98324 openbsd98324's avatar openbsd98324 openbsd98324
Browse files

added

parent de230c69
......@@ -959,6 +959,7 @@ int main(int argc, char **argv)
FILE *fpout ;
char charo[2500];
int fpout_lastpage = -1;
while (!closing)
{
......@@ -993,8 +994,53 @@ int main(int argc, char **argv)
len = XLookupString(&xevt.xkey, buf, sizeof buf, &keysym, NULL);
if (!gapp.issearching)
switch (keysym)
{
switch (keysym)
{
case XK_F4:
printf( "F4\n" );
system( " screen -d -m xterm -fa 15 -fs 15 -bg black -fg yellow -e vim review.mrk ");
break;
case XK_F5:
printf( "F5\n" );
system( " screen -d -m fledit review.mrk ");
break;
case XK_F8:
printf( "F8\n" );
fpout = fopen( "review.mrk" , "ab" );
snprintf( charo , sizeof( charo ), "\\includepdf[pages=%d]{source.pdf}\n", gapp.pageno );
fputs( charo , fpout );
fputs( "\n" , fpout );
fclose( fpout );
fpout_lastpage = gapp.pageno;
break;
case XK_F9:
printf( "F9\n" );
printf( "Current Page : %d\n", gapp.pageno );
break;
case XK_F10:
printf( "F10\n" );
exit( 0 );
break;
case XK_F11:
printf( "F11\n" );
system( " screen -d -m mupdf ~/doc.pdf " );
break;
case XK_F12:
printf( "F12\n" );
//system( " screen -d -m sh compile-pdf.sh " );
system( " screen -d -m unidoc review.mrk " );
break;
case XK_Escape:
len = 1; buf[0] = '\033';
break;
......@@ -1003,6 +1049,7 @@ int main(int argc, char **argv)
case XK_KP_Up:
len = 1; buf[0] = 'k';
break;
case XK_Down:
case XK_KP_Down:
len = 1; buf[0] = 'j';
......@@ -1012,6 +1059,7 @@ int main(int argc, char **argv)
case XK_KP_Left:
len = 1; buf[0] = 'h';
break;
case XK_Right:
case XK_KP_Right:
len = 1; buf[0] = 'l';
......@@ -1052,7 +1100,6 @@ int main(int argc, char **argv)
case ButtonPress:
onmouse(xevt.xbutton.x, xevt.xbutton.y, xevt.xbutton.button, xevt.xbutton.state, 1);
printf( "Button press size x: %d \n ", xevt.xbutton.x );
printf( "Button press size y: %d \n ", xevt.xbutton.y );
printf( "Button press size button: %d \n ", xevt.xbutton.button );
......@@ -1068,19 +1115,44 @@ int main(int argc, char **argv)
//printf( "Button rel size calc-2 y: %g \n ", xevt.xbutton.y / 1.325071225071225 );
printf( "Button rel size button: %d \n ", xevt.xbutton.button );
printf( "Current Page : %d\n", gapp.pageno );
// ** rel create review file
fpout = fopen( "/tmp/review.dat" , "ab" );
snprintf( charo , sizeof( charo ), "!mycom{450}{%g}{[OK]}\n", xevt.xbutton.y / 1.325071225071225 );
fputs( charo , fpout );
snprintf( charo , sizeof( charo ), "\\includepdf[pages=%d]{source.pdf}\n", gapp.pageno );
fpout = fopen( "review.mrk" , "ab" );
if ( fpout_lastpage == gapp.pageno )
{
}
else
{
fputs( "\n" , fpout );
fputs( "\\clearpage\n" , fpout );
fputs( "\\BgThispage\n" , fpout );
}
snprintf( charo , sizeof( charo ), "!mycom{450}{%g}{[OK]}\n", xevt.xbutton.y / 1.325071225071225 -10 );
fputs( charo , fpout );
if ( fpout_lastpage == gapp.pageno )
{
snprintf( charo , sizeof( charo ), "\%\%\\includepdf[pages=%d]{source.pdf}\n", gapp.pageno );
fputs( charo , fpout );
fputs( "\n" , fpout );
}
else
{
//snprintf( charo , sizeof( charo ), "\\includepdf[pages=%d]{source.pdf}\n", gapp.pageno );
//fputs( charo , fpout );
//fputs( "\n" , fpout );
}
fclose( fpout );
fpout_lastpage = gapp.pageno;
// ** rel end
break;
case SelectionRequest:
onselreq(xevt.xselectionrequest.requestor,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment