[evince] questions on code modifications



I had tried to post before but apparently that was before
subscribing to list, not sure if prior post made it.

I wanted to hack up evince with the possibility of contributing back
the code at some point and just wanted to see if the approach
sounds sane. Comments welcome.
 Essentially the new "feature"  I want to add allows users
to make document sections ( in dvi only right now, no indication it
already exists although not sure what is in pdf etc. )  invisble and 
be replaced with an inline "icon"
or iconify ( I guess I could say " iconify sections of the document").
I wrote some latex macro's to generate dvi that looks right. 
I tested this first with ncurses and plain text, later with xdvik
and thought it was a useful way to navigate versus just scrolling
and jumping- clutter reduction and logical organization seem to help
a lot.  The xdvik version uses a hacked up DVI interpretter -
in the case of evince I would probably  move the top part of

backend/dvi/mdvi-lib/dviread.c into dviread.h and put some hooks
in the mdvi_dopage  loop, 

        /* execute all the commands in the page */
        while((op = duget1(dvi)) != DVI_EOP) {
                if(dvi_commands[op](dvi, op) < 0)
                        break;
        }

to call a callback pointer on each opcode along with its location in the file
( I think I saw somekind of "tell" accounting for buffer pos so it should be easy).
And then have multiple opcode LUT's depending on the viewing status of current block.
The callback pointer call could be implemented in each opcode handler but that could be a nuisance
although I guess with a macro of the kind you have for the fwd declares it may be
ok there too.  

I then have definitions for a variety of specials. Right now the block view status
is handled in the c++ code that also makes the command console ( I have a frontend
I use for all my console apps that uses readline ). It looks like there is some facility
to register special handlers that I can just use  and add some c or c++ files to the
project.  


For console integration, it sounds like it may be easier to not integrate and
just open a socket. Does evince support any socket based command stuff right now?
Commands in this case would change display status of groups of document blocks.
Although then scrolling and printing of copy would be wasy too. 


Thanks. 


-- 

mike marchywka
306 charles cox
canton GA 30115
USA, Earth 
marchywka hotmail com
404-788-1216
ORCID: 0000-0001-9237-455X


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]