SGI: Development

Comix 0.3 - a CBZ/CBR viewer for IRIX. - Page 1

Hi All,

New project is underway. Still very early days, but we gotta start someplace.

What does it do?

Comix unpacks a cbr/cbz file and then displays it page by page via OpenGL.

Where is it?

http://sillypages.org/sgi/comix/

How do I make it?

0. Build and install my VkNew library
1. Unpack comix and modify the Compiler flags at the top of the Makefile to suit your setup.
2. Build comix.

Both VkNew and comix should compile cleanly with MIPSpro and GNU make.

If you want to have a looksey at the code, run the 'resume' script. It will load the relevant files into nedit for you. As ever, I disclaim being any good at writing C++, all I can say is that the code compiles for me on redbox.

How do I use it?

0. File->Open to open a cbz/cbr file.

1. [right arrow] or [down arrow] to go to next page.
2. [left arrow] or [up arrow] to go previous page.
3. [PgUp] to jump to the beginning of the 'comic'.
4. [PgDn] to jump to the end of the 'comic'.

5. Resize the window to force comix to display the whole page.

Major Caveat: the filename handling in Comix is fragile. In particular, jpeg filenames inside the cbz/cbr files with CR/LF stuck to their names, wont display properly. Fixing this is on the TODO list.

Dassit for now.

J.
:Fuel: redbox 800Mhz 4Gb V12
jimmer wrote: New project is underway.

I hate you. My /usr/local was a read-only empty file ... anyway, good chance I am doing this wrong but

Code: Select all

fool 29# gmake
CC -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c Globals.C
CC -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c App.C
CC -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c Main.C
CC -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c UI.C
CC -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c Viewer.C
CC -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c Reader.C
CC -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c VkOpenGL.C
cc-3970 CC: WARNING File = VkOpenGL.C, Line = 75
conversion from pointer to same-sized integral type (potential portability
problem)

XtSetArg(args[0], GLwNvisualInfo, (XtArgVal) visInfo);
^

CC Globals.o App.o Main.o UI.o Viewer.o Reader.o VkOpenGL.o -L/usr/local/lib -lifl -lvk -lvknew -lGLw -lGLU -lGL -lSgm -lXm  -lXt -lX11 -lPW  -lC -lCio -lm -woff 15,84 -o comix

--- C++ prelinker: Globals.o ---
CC -DEFAULT:abi=n32:isa=mips4:proc=r10k -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c -n32 Globals.C

--- C++ prelinker: App.o ---
CC -DEFAULT:abi=n32:isa=mips4:proc=r10k -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c -n32 App.C

--- C++ prelinker: Reader.o ---
CC -DEFAULT:abi=n32:isa=mips4:proc=r10k -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c -n32 Reader.C

--- C++ prelinker: Globals.o ---
CC -DEFAULT:abi=n32:isa=mips4:proc=r10k -DEFAULT:abi=n32:isa=mips4:proc=r10k -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c -n32 Globals.C

--- C++ prelinker: App.o ---
CC -DEFAULT:abi=n32:isa=mips4:proc=r10k -DEFAULT:abi=n32:isa=mips4:proc=r10k -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c -n32 App.C

--- C++ prelinker: Reader.o ---
CC -DEFAULT:abi=n32:isa=mips4:proc=r10k -DEFAULT:abi=n32:isa=mips4:proc=r10k -O3 -r16000 -LANG:std -DDEBUG -I. -I/usr/local/include -c -n32 Reader.C
ld32: ERROR   33 : Unresolved text symbol "getAppFileSelectionDialog(VkComponent*)" -- 1st referenced by UI.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR   33 : Unresolved text symbol "getAppProgressDialog(VkComponent*)" -- 1st referenced by Reader.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR   33 : Unresolved text symbol "VkApp::getGlobalData(void)" -- 1st referenced by App.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR   33 : Unresolved text symbol "VkApp::newDisplay(char*,char*,int*,char**,void*)" -- 1st referenced by App.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR   33 : Unresolved text symbol "VkApp::newScreen(char*,VkDisplay*,Arg*,unsigned int,void (*)(_WidgetRec*),void*)" -- 1st referenced by App.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR   33 : Unresolved text symbol "VkComponent::getGlobalData(void)" -- 1st referenced by UI.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR   33 : Unresolved text symbol "VkComponent::getScreen(void)" -- 1st referenced by Viewer.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: INFO    152: Output file removed because of error.
gmake: *** [comix] Error 2
fool 30# cd /usr/local/include
fool 31# ls
VkNew
fool 32# cd VKNew
VKNew - No such file or directory
fool 33# ls
VkNew
fool 34# cd VkNew
fool 35# ls
VkConfig.h      VkEntry.h        VkProgress.h  VkTimer.h
VkConfigItem.h  VkEntryFinder.h  VkSplash.h

It looks like we were looking in /usr/local/include but the VkNew headers are all in /usr/local/include/VkNew ?
the bourgeousie is ultimately a repressive institution, and I hate it ...
overhauled the makefiles a bit. give them a try, worked for me.

vknew:

Code: Select all

LIB_NAME   = vknew
LIB_NAME_DIR   = VkNew
LIB_MAJOR   = 0
LIB_MINOR   = 7
LIB_TARGET   = /usr/local/jimmer

LIB_DIR    = lib
INC_DIR    = include
MAN_DIR    = man

INCDIRS    = -I. -I/usr/include
LIBDIRS    = -L/usr/lib32

STDLIBS      = -lm
STDCPPLIBS    = -LC -lCio
X11LIBS    = -lXpm -lXt -lX11 -lPW
MOTIFLIBS    = -lSgm -lXm
VKLIBS       = -lvk

LIBS       = $(VKLIBS) $(MOTIFLIBS) $(X11LIBS) $(STDCPPLIBS) $(STDLIBS)
CXX      = CC
CXXOPTS    = -O3 -LANG:std -LANG:exceptions=off -OPT:Olimit=0

LIB_OBJS =    VkEntry.o      \
VkEntryFinder.o   \
VkConfig.o      \
VkConfigItem.o   \
VkSplash.o      \
VkTimer.o      \
VkProgress.o

all : lib
lib : $(LIB_OBJS)
$(CXX) -shared -o ../$(LIB_DIR)/lib$(LIB_NAME).so $(LIB_OBJS)
cp *.h ../$(INC_DIR)
install:
mkdir -p $(LIB_TARGET)/$(LIB_DIR) $(LIB_TARGET)/$(INC_DIR)/$(LIB_NAME_DIR) $(LIB_TARGET)/$(MAN_DIR)/man3
cp ../$(LIB_DIR)/* $(LIB_TARGET)/$(LIB_DIR)
ln -sf $(LIB_TARGET)/$(LIB_DIR)/lib$(LIB_NAME).so $(LIB_TARGET)/$(LIB_DIR)/lib$(LIB_NAME).$(LIB_MAJOR).$(LIB_MINOR).so

if test -d $(LIB_TARGET)/$(INC_DIR)/$(LIB_NAME_DIR); then echo "$(LIB_TARGET)/$(INC_DIR)/$(LIB_NAME_DIR) exists."; else mkdir $(LIB_TARGET)/$(INC_DIR)/$(LIB_NAME_DIR); fi

cp ../$(INC_DIR)/* $(LIB_TARGET)/$(INC_DIR)/$(LIB_NAME_DIR)
cp ../$(MAN_DIR)/* $(LIB_TARGET)/$(MAN_DIR)/man3
%.o : %.C
${CXX} ${CXXOPTS} ${INCDIRS} -c $<
clean :
rm -rf $(LIB_DIR)/*
rm -rf $(INC_DIR)/*
rm -rf *.o core *~ ii_*


comix:

Code: Select all

CXXC      = CC
CXXC_OPTS    = -O3 -LANG:std -LANG:exceptions=off -OPT:Olimit=0
APP_NAME    = comix

APP_OBJS    = \
Globals.o   \
App.o      \
Main.o       \
UI.o      \
Viewer.o   \
Reader.o   \
VkOpenGL.o

DIRS_INC    = -I. -I/usr/local/jimmer/include
DIRS_LIB   = -L/usr/local/jimmer/lib

LIBS_STD_C   = -lm
LIBS_STD_CXX= -lC -lCio
LIBS_X11   = -lXt -lX11 -lPW
LIBS_MOTIF   = -lSgm -lXm
LIBS_OPENGL   = -lGLw -lGLU -lGL
LIBS_VK    = -lvk -lvknew
LIBS_EXTRA    = -lifl

LIBS      = $(LIBS_EXTRA)    \
$(LIBS_VK)       \
$(LIBS_OPENGL)    \
$(LIBS_MOTIF)      \
$(LIBS_X11)      \
$(LIBS_STD_CXX)   \
$(LIBS_STD_C)

# Suppress MIPSpro compiler warnings:
# 15 - Multiply defined
# 84 - libxxx not used for resolving any symbol
LINK_OPTS   = -woff 15,84

all : $(APP_NAME)

$(APP_NAME): ${APP_OBJS}
${CXXC} ${APP_OBJS} ${DIRS_LIB} ${LIBS} ${LINK_OPTS} -o ${APP_NAME}
%.o : %.C
${CXXC} ${CXXC_OPTS} ${DIRS_INC} -c $<
clean :
rm -rf ${APP_NAME} *.o core *~ ii_* dir.txt


just in case i attached the finished package. just add its lib dir to the LD_LIBRARYN32_PATH.
in case of a dso that's only used for one program a static build usually is better. jimmer might consider that.
Thanks, j & f. My excuse is, I only had about ten minutes to play with it, otherwise the dog would pee on the floor ...

It opens, it runs, kind of interesting. I had no problems with file handliing. Some things :

The splash screen is nice, could you replace the Help -> Product Information with that or is that something we are stuck with ? I've always thought that the About screens in Irix were awful. $10,000 application and the About looks like some spastic kindergartener created it.

Grabbed a comic for test, whoo boy. Spears into flaming eye sockets, hunh ? :P

Display is excellent, sharp as a tack. However, at high resolution, I can't see an entire page. And there's no sliders ... not that I'd want sliders, resizing the page would be better.

foetz has a good point, for most people a single executable would be more convenient. It's not very big.

This could become the quick-n-dirty graphics application for Irix. I can see where it could do everything that Pho and the other thingy I found do. In fact, it could be SGI's Answer to Irfanview .... nice, J. Real nice.

Where's all the guys who want to open source Irix ? Time to step up to the plate and make yourselves useful ...

edit : ah. I see what happens with the size. In the vertical direction, if you expand the window, the display grows until it hits the horizontal width of the window. Then it adds a grey area above the size of the jpg. In the horizontal direction, if you widen the display window it grows right out the top of the screen without adding a slider bar or hitting a limit and adding an empty area. Easy to work around for the moment, but I would think that eventually the slider bars would be necessary, in case you want to zoom in on one area.

Are these comics all pornography without the sex, or just the one I grabbed ? It's kind of ... interesting :shock:

edit_2 : ah_again ... Made a comic book by zipping up a bunch of jpegs. We scooted right through the stack nicely. Lots of interesting possibilities. Now if I can just talk the Assistant into doing a little posing ... "It's for a comic book ! really !" :P
the bourgeousie is ultimately a repressive institution, and I hate it ...
foetz wrote: just in case i attached the finished package.


Thank your for the compiled version! It works on my O2 (IRIX 6.5.27).
:O2: :1600SW: :Indy: :Indy: :Indigo:
jimmer wrote: Hi All,

Comix unpacks a cbr/cbz file and then displays it page by page via OpenGL.

J.


Thanks! It is quite fast on my O2 (R10k/250).
:O2: :1600SW: :Indy: :Indy: :Indigo:
foetz wrote: in case of a dso that's only used for one program a static build usually is better. jimmer might consider that.

Fair point. I have removed the dependency on VkNew. For extra Hamei Happiness this means there's also nothing going on in /usr/local anymore. Downside is that there's no pretty splash screen for the moment.

hamei wrote: The splash screen is nice, could you replace the Help -> Product Information with that or is that something we are stuck with ? I've always thought that the About screens in Irix were awful. $10,000 application and the About looks like some spastic kindergartener created it.

ViewKit giveth, ViewKit taketh away. I'm using the stock viewkit 'about' stuff. That said, it is possible to override the default ViewKit help menu. Issue added to the very bottomest bottom of the TODO list.

hamei wrote: However, at high resolution, I can't see an entire page. And there's no sliders ... not that I'd want sliders, resizing the page would be better.

I've changed the scaling and centering in 0.3.1. Please report back if this issue is solved.

Changes in 0.3.1:

- removed dependency on VkNew
- better image scaling and centering in the viewing window
- added a little statusbar thingy
:Fuel: redbox 800Mhz 4Gb V12
jimmer wrote:
foetz wrote: in case of a dso that's only used for one program a static build usually is better. jimmer might consider that.

Fair point. I have removed the dependency on VkNew. For extra Hamei Happiness this means there's also nothing going on in /usr/local anymore. Downside is that there's no pretty splash screen for the moment.

oh i didn't mean ditching it but rather having a static build.

anyway binary attached ...
Don't hate me ...
jimmer wrote: Fair point. I have removed the dependency on VkNew.

I can't actually tell the difference but thought the same as foetz, VkNew is good, just static that hummer. It's small, we don' need no steenking dso's :D

For extra Hamei Happiness this means there's also nothing going on in /usr/local anymore.

<does ecstatic but tasteful dance of joy in living room. Dog looks up bemused, 'Hope it's not something in the water. They just refilled my bowl. Did I drink out of that yet ?">

Issue added to the very bottomest bottom of the TODO list.

Well, I never ! I'm going to have a word with your agent, young man ...

jimmer wrote: I've changed the scaling and centering in 0.3.1. Please report back if this issue is solved.

- better image scaling and centering in the viewing window


It's ... different. Keep in mind that these are extreme numbers, so if it works here you probably won't have a problem with smaller sizes.

The image auto-centers now, that's nice.

As you drag the lower edge of the window down and down, the image gets larger and larger until ... poof ! it disappears. Drag the bottom edge back up and it reappears. Drag the side of the window frame and the image continuously self-centers (appropriate for today's society) until it reaches a certain point, then smallens in vertical height.

I dunno. For reading a comic book, this way is good. For zooming in on the gratuitous panty shots, the other way was better. Not sure what to say here ... but maybe I preferred the other method, since it was a little more versatile.

- added a little statusbar thingy

Little is the operative word :D Not a bad idea, tells you where you are in the series of jpegs.

Code: Select all

Reader::navigate() - page: 2
Reader::navigate() - page: 3
Reader::navigate() - page: 4
Reader::navigate() - page: 5
Reader::navigate() - page: 6
Reader::navigate() - page: 7
...
Reader::navigate() - page: 24

However, don't think I saw the following before ? No idea what it means ?

Code: Select all

RGB, unsigned char
RGB, unsigned char
...
RGB, unsigned char
RGB, unsigned char
RGB, unsigned char

Is it a little faster, or is that just because I'm looking at a smaller version ?
the bourgeousie is ultimately a repressive institution, and I hate it ...
hamei wrote: Is it a little faster, or is that just because I'm looking at a smaller version ?

i used 2 more compiler options but i'm not sure if it'd have a noticeable impact
Comix version 0.3.2:

- Core: improved filename handling
- Core: rewritten unpack/load routines
- Core: opens CBZ/CBR file where you left off
- UI: filename now shown in window title bar
- UI: page numbers centered under image
- Makefile: a little more quiet

The opens-where-you-left-off thing is a little slow at the moment when you restart comix after having loaded a large comic. This will improve when the 'load each image from disk' option is implemented.

Also there's a buglet with the pagination on the first and last images; the usual off by 1 thing. Hopefully fixed in 0.3.3.

J.
:Fuel: redbox 800Mhz 4Gb V12
jimmer wrote: Comix version 0.3.2:

I guess this is no worse than self-criticism, but I'm having a linking problem :(

Code: Select all

ld32: ERROR   33 : Unresolved text symbol "getAppFileSelectionDialog(VkComponent*)" -- 1st referenced by UI.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR   33 : Unresolved text symbol "getAppProgressDialog(VkComponent*)" -- 1st referenced by Reader.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR   33 : Unresolved text symbol "VkApp::getGlobalData(void)" -- 1st referenced by App.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR   33 : Unresolved text symbol "VkApp::newDisplay(char*,char*,int*,char**,void*)" -- 1st referenced by App.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR   33 : Unresolved text symbol "VkApp::newScreen(char*,VkDisplay*,Arg*,unsigned int,void (*)(_WidgetRec*),void*)" -- 1st referenced by App.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR   33 : Unresolved text symbol "VkComponent::getGlobalData(void)" -- 1st referenced by UI.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR   33 : Unresolved text symbol "VkComponent::getScreen(void)" -- 1st referenced by Viewer.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: INFO    152: Output file removed because of error.
gmake: *** [comix] Error 2


What can I say ? I'm stoopid :(
the bourgeousie is ultimately a repressive institution, and I hate it ...
jimmer, any reason why you don't attach a build with the source?
Not really. I'll move up the FTR+packaging bullet on the TODO list so the next 'progress drop' will be a full tardist.
hamei wrote: I guess this is no worse than self-criticism, but I'm having a linking problem :(

Code: Select all

ld32: ERROR   33 : Unresolved text symbol "getAppFileSelectionDialog(VkComponent*)" -- 1st referenced by UI.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
[...]

Sounds like you're not linking to the Viewkit library, which IIRC is libiVk.so - no idea why there's an "i" between the lib part and the Vk part but then again who knows why sgi did anything the way they did... :lol:
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2:
jimmer is a mean man :(

But I finally figured out that I never installed the debug Viewkit libaries ... oops. So, drop the -DEBUG directive and change the libraries from /usr/local/lib (you really have your ViewKit there, jimmer ?) to /usr/Motif-2.1/lib32 and awaaaay she goes !

The centered "page 1 of 32" thing looks nice. The progress bar looks very Irix-native. File handling looks very Irix-native, maybe needs a filtration option ? Image scaling still needs some work ... full-screening is interesting :)

Looks pretty good tho ... lots of potential. Don't waste your time on tardists, j. You keep banging on useful code, someone else can knock out binaries ...

Now let's make it view jpegs :D

comix-0.32.zip
(91.36 KiB) Downloaded 35 times
suddenly she asked for my sweater, and said that she was very very cold ...
hamei wrote: I never installed the debug Viewkit libaries ... oops

there was a reason why i provided the edited makefiles (which you didn't try it seems :P ). among other things they had no debug flag
foetz wrote: there was a reason why i provided the edited makefiles (which you didn't try it seems :P ).

I did ! I did ! And thank you !

But I'm a stubborn old bastard who wants to understand why things don't work, so I went back and struggled with it a little, too.
suddenly she asked for my sweater, and said that she was very very cold ...
oh hehe okay then
Hello All,

Apologies for the delay in dropping a new tarball, blame Real Life(tm) and all that jazz.

Comix can now load an entire CBR/CBZ file into memory or be told to load each page from disk one at a time. The obvious advantage is that Comix might run a little better on low-memory machines. The less obvious advantage is that this code can now be used as a base for a generic image viewer. The downside is that page display will be slightly slower in the 'load from disk' case as each time you flip a page the image data needs to be loaded from sloooow disk rather than fst memory.

Next release will be mostly UI related things.

J.

Comix 0.3.3

- Reworked memory handling
- Preferences dialog
- Code clear-up
:Fuel: redbox 800Mhz 4Gb V12