
Hello community, here is the log from the commit of package sffview checked in at Mon Oct 30 22:34:25 CET 2006. -------- --- sffview/sffview.changes 2006-10-16 09:08:17.000000000 +0200 +++ /mounts/work_src_done/STABLE/sffview/sffview.changes 2006-10-30 18:06:58.000000000 +0100 @@ -1,0 +2,7 @@ +Mon Oct 30 18:05:43 CET 2006 - kkeil@suse.de + +- update to 0.4 + * include all our fixes + * print support + +------------------------------------------------------------------- Old: ---- sffview-0.3-gcc4.diff sffview-0.3-types.diff sffview-0.3-utf.diff sffview-0.3.diff sffview-0.3.tar.bz2 New: ---- sffview-0.4.diff sffview-0.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sffview.spec ++++++ --- /var/tmp/diff_new_pack.lXwtWB/_old 2006-10-30 22:34:11.000000000 +0100 +++ /var/tmp/diff_new_pack.lXwtWB/_new 2006-10-30 22:34:11.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package sffview (Version 0.3) +# spec file for package sffview (Version 0.4) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -15,16 +15,13 @@ License: X11/MIT Group: Hardware/ISDN Autoreqprov: on -Version: 0.3 -Release: 34 +Version: 0.4 +Release: 1 Summary: Simple viewer for Structured Fax Files (.sff) used by ISDN applications Source: %{name}-%{version}.tar.bz2 URL: http://sfftools.sourceforge.net/ BuildRoot: %{_tmppath}/%{name}-%{version}-build Patch0: %{name}-%{version}.diff -Patch1: %{name}-%{version}-types.diff -Patch2: %{name}-%{version}-gcc4.diff -Patch3: %{name}-%{version}-utf.diff %description The CAPI interface for programming ISDN hardware expects and gives you @@ -44,9 +41,6 @@ %prep %setup %patch -p1 -%patch -P 1 -p1 -%patch -P 2 -p1 -%patch -P 3 -p1 %build make @@ -66,6 +60,10 @@ %doc %{_defaultdocdir}/sffview %changelog -n sffview +* Mon Oct 30 2006 - kkeil@suse.de +- update to 0.4 + * include all our fixes + * print support * Mon Oct 16 2006 - kkeil@suse.de - compile with RPM_OPT_FLAGS - compile with unicode support (Thanks Andreas Hanke, #212502) ++++++ sffview-0.3-gcc4.diff -> sffview-0.4.diff ++++++ --- sffview/sffview-0.3-gcc4.diff 2005-11-02 22:15:24.000000000 +0100 +++ /mounts/work_src_done/STABLE/sffview/sffview-0.4.diff 2006-10-30 18:04:40.000000000 +0100 @@ -1,10 +1,24 @@ ---- sffview-0.3/common.cpp.orig 2005-04-09 21:29:42.572872818 +0000 -+++ sffview-0.3/common.cpp 2005-04-09 21:24:46.369945271 +0000 -@@ -45,6 +45,7 @@ - - #include <cassert> - #include <iostream> -+#include <errno.h> +--- sffview-0.4/Makefile.org 2006-10-30 17:41:52.000000000 +0100 ++++ sffview-0.4/Makefile 2006-10-30 17:41:52.000000000 +0100 +@@ -19,10 +19,10 @@ + OBJECTS = $(PROGRAM).o common.o codes.o decoder.o sfffile.o sffapp.o sffdoc.o - using namespace std; + #WXCONFIG_CPP = `wxgtk2-2.5-config --cflags` +-WXCONFIG_CPP = `wx-config --cflags` ++WXCONFIG_CPP = `wx-config --unicode=yes --cflags` + + #WXCONFIG_LD = `wxgtk2-2.5-config --libs --static` +-WXCONFIG_LD = `wx-config --libs` ++WXCONFIG_LD = `wx-config --unicode=yes --libs` + + # /usr/lib/libglib-2.0.a \ + # /usr/lib/libgobject-2.0.a \ +@@ -53,7 +53,7 @@ + .SUFFIXES: .o .cpp + + .cpp.o : +- $(CC) -g -march=i686 -Os -c $(WXCONFIG_CPP) -o $@ $< ++ $(CC) -g $(RPM_OPT_FLAGS) -c $(WXCONFIG_CPP) -o $@ $< + + all: $(PROGRAM) ++++++ sffview-0.3.tar.bz2 -> sffview-0.4.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/Makefile new/sffview-0.4/Makefile --- old/sffview-0.3/Makefile 2004-03-05 22:42:32.000000000 +0100 +++ new/sffview-0.4/Makefile 2005-05-20 23:27:29.000000000 +0200 @@ -18,18 +18,42 @@ PROGRAM = sffview OBJECTS = $(PROGRAM).o common.o codes.o decoder.o sfffile.o sffapp.o sffdoc.o -WXCONFIG_CPP = `wxgtk2-2.5-config --cflags` -#WXCONFIG_CPP = `wx-config --cflags` +#WXCONFIG_CPP = `wxgtk2-2.5-config --cflags` +WXCONFIG_CPP = `wx-config --cflags` -WXCONFIG_LD = `wxgtk2-2.5-config --libs` -#WXCONFIG_LD = `wx-config --libs` +#WXCONFIG_LD = `wxgtk2-2.5-config --libs --static` +WXCONFIG_LD = `wx-config --libs` +# /usr/lib/libglib-2.0.a \ +# /usr/lib/libgobject-2.0.a \ +# /usr/lib/libgmodule-2.0.a \ +# /usr/lib/libgthread-2.0.a \ + +WXCONFIG_LD_STATIC = -L/usr/X11R6/lib \ + /usr/local/lib/libwx_gtk2_html-2.5.a \ + /usr/local/lib/libwx_gtk2_adv-2.5.a \ + /usr/local/lib/libwx_gtk2_core-2.5.a \ + /usr/local/lib/libwx_base_xml-2.5.a \ + /usr/local/lib/libwx_base_net-2.5.a \ + /usr/local/lib/libwx_base-2.5.a \ + -Wl,-Bstatic -pthread \ + -lpangoxft-1.0 -lpangox-1.0 -lpangoft2-1.0 -lpango-1.0 -lgtk-x11-2.0 -lpangoxft-1.0 -lpangox-1.0 -lgdk-x11-2.0 -latk-1.0 -lpangoxft-1.0 -lpangox-1.0 -lgdk_pixbuf-2.0 \ + -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lfontconfig -lexpat -ltiff -lpng -ljpeg -lz -lXft -lfreetype \ + -Wl,-Bdynamic \ + -lXi -lXrandr -lX11 -lXext -lXcursor -lXrender -lXinerama \ + -lm -lpthread -ldl + +#LDADD = -L/usr/X11R6/lib \ +# -Wl,-Bstatic -lgtk -lgdk -rdynamic -lgmodule -lglib -Wl,-Bdynamic \ +# -lXi -lXext -lX11 -lXpm -lSM -lICE \ +# -Wl,-Bstatic -ltiff -ljpeg -lz -Wl,-Bdynamic \ +# -lm -lpthread -ldl # implementation .SUFFIXES: .o .cpp .cpp.o : - $(CC) -g -march=athlon -mcpu=athlon-xp -c $(WXCONFIG_CPP) -o $@ $< + $(CC) -g -march=i686 -Os -c $(WXCONFIG_CPP) -o $@ $< all: $(PROGRAM) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/codes.cpp new/sffview-0.4/codes.cpp --- old/sffview-0.3/codes.cpp 2004-02-29 23:27:25.000000000 +0100 +++ new/sffview-0.4/codes.cpp 2005-05-20 23:27:29.000000000 +0200 @@ -27,7 +27,7 @@ // /*-RCS-Info---------------------------------------------------- - $Id: codes.cpp,v 1.1 2003/02/03 21:20:41 pschaefer Exp $ + $Id: codes.cpp,v 1.1.1.1 2005/05/20 21:27:29 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/codes.h new/sffview-0.4/codes.h --- old/sffview-0.3/codes.h 2004-02-29 23:27:46.000000000 +0100 +++ new/sffview-0.4/codes.h 2005-05-20 23:27:29.000000000 +0200 @@ -29,7 +29,7 @@ // /*-RCS-Info---------------------------------------------------- - $Id: codes.h,v 1.1 2003/02/03 21:20:42 pschaefer Exp $ + $Id: codes.h,v 1.1.1.1 2005/05/20 21:27:29 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/common.cpp new/sffview-0.4/common.cpp --- old/sffview-0.3/common.cpp 2004-02-29 23:27:56.000000000 +0100 +++ new/sffview-0.4/common.cpp 2006-10-29 17:45:44.000000000 +0100 @@ -27,12 +27,13 @@ // /*-RCS-Info---------------------------------------------------- - $Id: util.cpp,v 1.5 2003/03/26 10:04:24 pschaefer Exp $ + $Id: common.cpp,v 1.2 2006/10/29 16:42:27 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ #include "sfftypes.h" #include "common.h" +#include "errno.h" #include <time.h> #if defined(_MSC_VER) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/common.h new/sffview-0.4/common.h --- old/sffview-0.3/common.h 2004-02-29 23:28:06.000000000 +0100 +++ new/sffview-0.4/common.h 2005-05-20 23:27:29.000000000 +0200 @@ -29,11 +29,11 @@ // /*-RCS-Info---------------------------------------------------- - $Id: util.h,v 1.4 2003/03/26 10:04:24 pschaefer Exp $ + $Id: common.h,v 1.1.1.1 2005/05/20 21:27:29 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ -#include <boost/filesystem/path.hpp> +#include <string> class CSimpleException { diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/decoder.cpp new/sffview-0.4/decoder.cpp --- old/sffview-0.3/decoder.cpp 2004-02-29 23:28:12.000000000 +0100 +++ new/sffview-0.4/decoder.cpp 2005-05-20 23:27:29.000000000 +0200 @@ -27,7 +27,7 @@ // /*-RCS-Info---------------------------------------------------- - $Id: sfftobmp.cpp,v 1.9 2000/08/12 17:46:33 peter Exp peter $ + $Id: decoder.cpp,v 1.1.1.1 2005/05/20 21:27:29 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/decoder.h new/sffview-0.4/decoder.h --- old/sffview-0.3/decoder.h 2004-02-29 23:28:19.000000000 +0100 +++ new/sffview-0.4/decoder.h 2005-05-20 23:27:29.000000000 +0200 @@ -29,7 +29,7 @@ // /*-RCS-Info---------------------------------------------------- - $Id: sfftobmp.cpp,v 1.9 2000/08/12 17:46:33 peter Exp peter $ + $Id: decoder.h,v 1.1.1.1 2005/05/20 21:27:29 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/doc/changes new/sffview-0.4/doc/changes --- old/sffview-0.3/doc/changes 1970-01-01 01:00:00.000000000 +0100 +++ new/sffview-0.4/doc/changes 2006-10-29 20:33:57.000000000 +0100 @@ -0,0 +1,9 @@ +CHANGES +------- + +V0.4 : me: + added printing support (BETA) + added MRU list + remember window position and size +-- +$Id: changes,v 1.2 2006/10/29 19:33:57 pschaefer Exp $ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/doc/copying new/sffview-0.4/doc/copying --- old/sffview-0.3/doc/copying 2004-04-20 21:57:08.000000000 +0200 +++ new/sffview-0.4/doc/copying 2006-10-29 17:45:44.000000000 +0100 @@ -1,6 +1,6 @@ This is sffview, a program to view structured fax files (sff). -Copyright (c) 2000-2004 Peter Schaefer-Hutter ("THE AUTHOR") +Copyright (c) 2000-2006 Peter Schaefer-Hutter ("THE AUTHOR") Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee. @@ -17,4 +17,4 @@ You can contact the original author by email at peter.schaefer@gmx.de. -$Id: copying,v 1.3 2003/02/03 21:32:48 pschaefer Exp $ +$Id: copying,v 1.2 2006/10/29 16:42:27 pschaefer Exp $ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/doc/readme new/sffview-0.4/doc/readme --- old/sffview-0.3/doc/readme 2004-04-20 22:03:04.000000000 +0200 +++ new/sffview-0.4/doc/readme 2006-10-29 17:45:44.000000000 +0100 @@ -1,5 +1,5 @@ ----------- -SFFVIEW 0.3 +SFFVIEW 0.4 ----------- Tool to view "structured fax files" in X11. @@ -21,11 +21,6 @@ wxGTK, version 2.5.1 or newer and all libraries that wxGTK needs itself. -Note that wxGTK version 2.5.x is the current development tree! -However, only this contains a performance fix for black&white -bitmaps that is really needed for SffView because otherwise -the fit-to-window scaling algorithm is too slow to be useful! - Contact: -------- peter.schaefer@gmx.net @@ -34,6 +29,11 @@ Suggestions, extensions and patches welcome, flames will go to /dev/null. +If you *really* like sffview or depend on it, please look +into my wishlist: + +http://www.amazon.de/gp/registry/wishlist/OVQ6LSYS4E4D/028-1843567-9543743 + I'm always pleased to hear that somebody is actually using my software. If you can manage it, e-mail me a quick notice. Thanks! diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/sffapp.cpp new/sffview-0.4/sffapp.cpp --- old/sffview-0.3/sffapp.cpp 2004-04-20 21:53:40.000000000 +0200 +++ new/sffview-0.4/sffapp.cpp 2006-10-29 20:33:57.000000000 +0100 @@ -27,7 +27,7 @@ // /*-RCS-Info---------------------------------------------------- - $Id: sfftobmp.h,v 1.6 1999/12/19 07:47:53 peter Exp peter $ + $Id: sffapp.cpp,v 1.3 2006/10/29 19:33:57 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ @@ -38,6 +38,8 @@ #endif #include <wx/docview.h> +#include <wx/config.h> +#include <wx/printdlg.h> #include "sfftypes.h" #include "common.h" @@ -107,20 +109,27 @@ bool SffApp::OnInit(void) { - SetAppName("SFF Viewer"); + SetAppName(wxT("SFF Viewer")); //// Create a document manager m_docManager = new wxDocManager(); + m_config = new wxConfig(wxT("sffview")); //// Create a template relating drawing documents to their views - (void) new wxDocTemplate(m_docManager, "SFF File", "*.sff;*.SFF", "", "sff", - "SFF Doc", "SFF View", CLASSINFO(SffDocument), CLASSINFO(SffView)); + (void) new wxDocTemplate(m_docManager, wxT("SFF File"), wxT("*.sff;*.SFF"), + wxT(""), wxT("sff"), wxT("SFF Doc"), wxT("SFF View"), + CLASSINFO(SffDocument), CLASSINFO(SffView)); m_docManager->SetMaxDocsOpen(2); //// Create the main frame window - frame = new SffFrame(m_docManager, (wxFrame *) NULL, -1, - GetAppName(), wxPoint(0, 0), wxSize(500, 400), + int x = m_config->Read(_T("/Window/x"), 1); + int y = m_config->Read(_T("/Window/y"), 1); + int w = m_config->Read(_T("/Window/w"), 750); + int h = m_config->Read(_T("/Window/h"), 600); + + frame = new SffFrame(m_docManager, (wxFrame *) NULL, m_config, -1, + GetAppName(), wxPoint(x,y), wxSize(w,h), wxDEFAULT_FRAME_STYLE); //// Give it an icon (this is ignored in MDI mode: uses resources) @@ -132,35 +141,39 @@ wxMenu *file_menu = new wxMenu; file_menu->Append(new wxMenuItem(file_menu, wxID_OPEN, - "&Open...", "Opens a SFF fax file")); + wxT("&Open..."), wxT("Opens a SFF fax file"))); file_menu->Append(new wxMenuItem(file_menu, wxID_CLOSE, - "&Close", "Closes currently loaded file")); + wxT("&Close"), wxT("Closes currently loaded file"))); + file_menu->AppendSeparator(); + file_menu->Append(new wxMenuItem(file_menu, wxID_PRINT, + wxT("&Print..."), wxT("Prints the currently loaded file"))); + /* + file_menu->Append(new wxMenuItem(file_menu, wxID_PRINT_SETUP, + wxT("Print &Setup..."), wxT("Let you choose a printer to print to"))); + file_menu->Append(new wxMenuItem(file_menu, wxID_PREVIEW, + wxT("&Print Pre&view..."), wxT("Displays the file as it would be printed"))); + */ file_menu->AppendSeparator(); -// file_menu->Append(new wxMenuItem(file_menu, wxID_PRINT, -// "&Print...", "Prints the currently loaded file")); -// file_menu->Append(new wxMenuItem(file_menu, wxID_PRINT_SETUP, -// "Print &Setup...", "Let you choose a printer to print to")); -// file_menu->Append(new wxMenuItem(file_menu, wxID_PREVIEW, -// "&Print Pre&view...", "Displays the file as it would be printed")); -// file_menu->AppendSeparator(); file_menu->Append(new wxMenuItem(file_menu, wxID_EXIT, - "E&xit", "Quits the application")); + wxT("E&xit"), wxT("Quits the application"))); // A nice touch: a history of files visited. Use this menu. + m_docManager->FileHistoryLoad(*m_config); m_docManager->FileHistoryUseMenu(file_menu); + m_docManager->FileHistoryAddFilesToMenu(); wxMenu *view_menu = new wxMenu; view_menu->Append(new wxMenuItem(view_menu, ID_PREVPAGE, - "&Previous Page", "Displays the previous page of a multipage document")); + wxT("&Previous Page"), wxT("Displays the previous page of a multipage document"))); view_menu->Append(new wxMenuItem(view_menu, ID_NEXTPAGE, - "&Next Page", "Displays the next page of a multipage document")); + wxT("&Next Page"), wxT("Displays the next page of a multipage document"))); view_menu->AppendSeparator(); view_menu->Append(new wxMenuItem(view_menu, ID_ZOOMNORMAL, - "&Actual size", "Displays the page at normal scale")); + wxT("&Actual size"), wxT("Displays the page at normal scale"))); view_menu->Append(new wxMenuItem(view_menu, ID_ZOOMWIDTH, - "Fit &width", "Fit page width in window")); + wxT("Fit &width"), wxT("Fit page width in window"))); view_menu->Append(new wxMenuItem(view_menu, ID_ZOOMHEIGHT, - "&Fit in window", "Fit whole page in window")); + wxT("&Fit in window"), wxT("Fit whole page in window"))); /* view_menu->AppendSeparator(); view_menu->Append(new wxMenuItem(view_menu, ID_FLIPX, @@ -170,12 +183,12 @@ */ wxMenu *help_menu = new wxMenu; help_menu->Append(new wxMenuItem(view_menu, ID_ABOUT, - "&About", "Shows information about the application")); + wxT("&About"), wxT("Shows information about the application"))); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); - menu_bar->Append(view_menu, "&View"); - menu_bar->Append(help_menu, "&Help"); + menu_bar->Append(file_menu, wxT("&File")); + menu_bar->Append(view_menu, wxT("&View")); + menu_bar->Append(help_menu, wxT("&Help")); frame->canvas = frame->CreateCanvas((wxView *) NULL, frame); @@ -186,8 +199,6 @@ frame->CreateStatusBar(2); int widths[] = { -1, 100 }; frame->SetStatusWidths( 2, widths ); - - frame->Centre(wxBOTH); frame->Show(TRUE); SetTopWindow(frame); @@ -201,7 +212,9 @@ int SffApp::OnExit(void) { + m_docManager->FileHistorySave(*m_config); delete m_docManager; + delete m_config; return 0; } @@ -223,29 +236,32 @@ EVT_MENU(ID_ZOOMHEIGHT, SffFrame::OnFitHeight) EVT_UPDATE_UI_RANGE(ID_FILELOADED1, ID_FILELOADED2, SffFrame::OnUpdateFileOps) EVT_UPDATE_UI_RANGE(ID_MULTIPAGE1, ID_MULTIPAGE2, SffFrame::OnUpdateMultipage) + EVT_MENU_RANGE(wxID_FILE1, wxID_FILE9, SffFrame::OnMRUFile) EVT_SIZE(SffFrame::OnSize) + EVT_CLOSE(SffFrame::OnCloseWindow) END_EVENT_TABLE() -/* -*/ -SffFrame::SffFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, + +SffFrame::SffFrame(wxDocManager *manager, wxFrame *frame, wxConfig *config, + wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long type) : wxDocParentFrame(manager, frame, id, title, pos, size, type) { canvas = (SffCanvas *) NULL; + m_config = config; } void SffFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { (void)wxMessageBox( - "This is SffView 0.3, a program to view structured fax files (sff)\n\n" + wxT("This is SffView 0.4, a program to view structured fax files (sff)\n\n" "This software and its documentation is\n" - "Copyright (C) 2000-2004 Peter Schaefer-Hutter\n\n" + "Copyright (C) 2000-2006 Peter Schaefer-Hutter\n\n" "Permission to use, copy, modify, and distribute this software and its " "documentation for any purpose and without fee is hereby granted, provided " "that the above copyright notice appear in all copies. This software " "is provided 'as is' without expressed or implied warranty.\n\n" - "You can contact the author by email at peter.schaefer@gmx.de", - "About...", wxICON_INFORMATION | wxOK ); + "You can contact the author by email at peter.schaefer@gmx.de"), + wxT("About..."), wxICON_INFORMATION | wxOK ); } void SffFrame::RecreateToolbar() @@ -284,19 +300,25 @@ int currentX = 5; - toolBar->AddTool(wxID_OPEN, toolBarBitmaps[0], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Open File"); + toolBar->AddTool(wxID_OPEN, toolBarBitmaps[0], wxNullBitmap, FALSE, + currentX, -1, (wxObject *) NULL, wxT("Open File")); currentX += width + 5; toolBar->AddSeparator(); - toolBar->AddTool(ID_PREVPAGE, toolBarBitmaps[1], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Previous Page"); + toolBar->AddTool(ID_PREVPAGE, toolBarBitmaps[1], wxNullBitmap, FALSE, + currentX, -1, (wxObject *) NULL, wxT("Previous Page")); currentX += width + 5; - toolBar->AddTool(ID_NEXTPAGE, toolBarBitmaps[2], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Next Page"); + toolBar->AddTool(ID_NEXTPAGE, toolBarBitmaps[2], wxNullBitmap, FALSE, + currentX, -1, (wxObject *) NULL, wxT("Next Page")); currentX += width + 5; toolBar->AddSeparator(); - toolBar->AddTool(ID_ZOOMNORMAL, toolBarBitmaps[10], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Actual Size"); + toolBar->AddTool(ID_ZOOMNORMAL, toolBarBitmaps[10], wxNullBitmap, FALSE, + currentX, -1, (wxObject *) NULL, wxT("Actual Size")); currentX += width + 5; - toolBar->AddTool(ID_ZOOMWIDTH, toolBarBitmaps[9], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Fit Width"); + toolBar->AddTool(ID_ZOOMWIDTH, toolBarBitmaps[9], wxNullBitmap, FALSE, + currentX, -1, (wxObject *) NULL, wxT("Fit Width")); currentX += width + 5; - toolBar->AddTool(ID_ZOOMHEIGHT, toolBarBitmaps[8], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Fit In Window"); + toolBar->AddTool(ID_ZOOMHEIGHT, toolBarBitmaps[8], wxNullBitmap, FALSE, + currentX, -1, (wxObject *) NULL, wxT("Fit In Window")); currentX += width + 5; /* toolBar->AddTool(ID_ZOOMIN, toolBarBitmaps[4], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Zoom +"); @@ -309,7 +331,8 @@ currentX += width + 5; */ toolBar->AddSeparator(); - toolBar->AddTool(ID_ABOUT, toolBarBitmaps[3], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Open About Dialog"); + toolBar->AddTool(ID_ABOUT, toolBarBitmaps[3], wxNullBitmap, FALSE, + currentX, -1, (wxObject *) NULL, wxT("Open About Dialog")); toolBar->Realize(); @@ -329,6 +352,7 @@ void SffFrame::OnUpdateMultipage(wxUpdateUIEvent& event) { + event.Enable(false); SffDocument *pDoc = (SffDocument *) m_docManager->GetCurrentDocument(); if ((pDoc != NULL) && (pDoc->GetPageCount() > 1)) { @@ -436,6 +460,24 @@ } } +void SffFrame::OnMRUFile(wxCommandEvent& event) +{ + wxString f(m_docManager->GetHistoryFile(event.GetId() - wxID_FILE1)); + if (!f.IsEmpty()) + (void)m_docManager->CreateDocument(f, wxDOC_SILENT); +} + +void SffFrame::OnCloseWindow(wxCloseEvent& event) +{ + int x, y, w, h; + GetPosition(&x, &y); GetSize(&w, &h); + m_config->Write(_T("/Window/x"), (long)x); + m_config->Write(_T("/Window/y"), (long)y); + m_config->Write(_T("/Window/w"), (long)w); + m_config->Write(_T("/Window/h"), (long)h); + wxDocParentFrame::OnCloseWindow(event); +} + // --------------------------------------------------- SffFrame *GetMainFrame(void) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/sffapp.h new/sffview-0.4/sffapp.h --- old/sffview-0.3/sffapp.h 2004-02-29 23:28:34.000000000 +0100 +++ new/sffview-0.4/sffapp.h 2006-10-29 20:33:57.000000000 +0100 @@ -29,7 +29,7 @@ // /*-RCS-Info---------------------------------------------------- -$Id: sfftobmp.h,v 1.6 1999/12/19 07:47:53 peter Exp peter $ +$Id: sffapp.h,v 1.3 2006/10/29 19:33:57 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ @@ -40,11 +40,12 @@ // forwards class wxDocManager; +class wxConfig; class SffCanvas; // Main application class -class SffApp: public wxApp +class SffApp : public wxApp { public: SffApp(void); @@ -54,20 +55,22 @@ protected: wxDocManager* m_docManager; + wxConfig * m_config; }; DECLARE_APP(SffApp) // Main frame class -class SffFrame: public wxDocParentFrame +class SffFrame : public wxDocParentFrame { DECLARE_CLASS(SffFrame) public: SffCanvas *canvas; - SffFrame(wxDocManager *manager, wxFrame *frame, + SffFrame(wxDocManager *manager, wxFrame *frame, + wxConfig *config, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long type); @@ -88,11 +91,15 @@ void OnZoomNormal(wxCommandEvent& event); void OnFitWidth(wxCommandEvent& event); void OnFitHeight(wxCommandEvent& event); - + + void OnMRUFile(wxCommandEvent& event); void OnSize(wxSizeEvent& event); + void OnCloseWindow(wxCloseEvent& event); - DECLARE_EVENT_TABLE() + +protected: + wxConfig *m_config; }; extern SffFrame *GetMainFrame(void); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/sffdoc.cpp new/sffview-0.4/sffdoc.cpp --- old/sffview-0.3/sffdoc.cpp 2004-04-20 21:54:31.000000000 +0200 +++ new/sffview-0.4/sffdoc.cpp 2006-10-29 17:45:44.000000000 +0100 @@ -27,7 +27,7 @@ // /*-RCS-Info---------------------------------------------------- - $Id: sfftobmp.h,v 1.6 1999/12/19 07:47:53 peter Exp peter $ + $Id: sffdoc.cpp,v 1.2 2006/10/29 16:42:26 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ @@ -45,6 +45,9 @@ #include "sffdoc.h" #include "sffview.h" +#include <iostream> +using namespace std; + // --------------------------------------------------------------------- CBitmapDecoder::CBitmapDecoder(wxUint32 aWidth, wxUint32 aHeight) : @@ -129,7 +132,8 @@ try { wxBusyCursor wait; m_nPageIdx = 0; - m_pSffFile = new CSffFile(filename.c_str()); + std::string strFN(filename.fn_str()); + m_pSffFile = new CSffFile(strFN); m_pDecoder = new CBitmapDecoder(GetWidth(), GetHeight()); SetFilename(filename, TRUE); Modify(FALSE); @@ -137,7 +141,7 @@ rc = true; } catch (CSimpleException e) { - wxLogError( e.what().c_str() ); + wxLogError( (wxChar *) e.what().c_str() ); } return rc; } @@ -212,8 +216,70 @@ } } catch (CSimpleException e) { - wxLogError( e.what().c_str() ); + wxLogError( (wxChar *)e.what().c_str() ); + } +} + +wxBitmap *SffDocument::GetPageBitmap(int nPage) +{ + int i; + int lines, cols; + bool bLowRes; + + + if (m_pSffFile == NULL) + return NULL; + + wxBitmap *pBmp = NULL; + + try + { + TSFFRecord rec; + // CDCFile outfile; + m_pSffFile->SeekPage(nPage-1); + bLowRes = m_pSffFile->IsLowRes(nPage-1); + lines = GetHeight(); + cols = GetWidth(); + // Decode SFF Records ... + m_pDecoder->Reset(); + while ((lines > 0) && m_pSffFile->GetRecord(rec)) { + switch(rec.type) { + case NORMAL : + m_pDecoder->BlankLine(); + m_pSffFile->DecodeRecord(rec, m_pDecoder->GetBitSink()); + m_pDecoder->WriteLine(); --lines; + if (bLowRes) { // double line if low-res + m_pDecoder->WriteLine(); --lines; + } + if (rec.pData != 0) free(rec.pData); + break; + case USERINFO : + // not supported + if (rec.pData != 0) free(rec.pData); + break; + case BADLINE : + case WHITESKIP : + // a white skip is, ah, skipped ;) + m_pDecoder->BlankLine(); + for (i=0; i < rec.cb; ++i) { + m_pDecoder->WriteLine(); --lines; + if (bLowRes) { // double line if low-res + m_pDecoder->WriteLine(); --lines; + } + } + break; + default : + break; + } + } + pBmp = new wxBitmap((const char*)m_pDecoder->GetBitmap(), + GetWidth(), GetHeight()); + } + catch (CSimpleException e) { + wxLogError( (wxChar *)e.what().c_str() ); } + + return pBmp; } wxUint32 SffDocument::GetHeight() @@ -277,8 +343,15 @@ bool SffPrintout::OnPrintPage(int page) { + wxBitmap *pBmp = m_Doc->GetPageBitmap(page); + int nBitmapHeight = pBmp->GetHeight(); + int nBitmapWidth = pBmp->GetWidth(); + wxDC *dc = GetDC(); + wxMemoryDC mem_dc; + mem_dc.SelectObject(*pBmp); + // Get the logical pixels per inch of screen and printer int ppiScreenX, ppiScreenY; GetPPIScreen(&ppiScreenX, &ppiScreenY); @@ -305,8 +378,17 @@ // If printer pageWidth == current DC width, then this doesn't // change. But we might be the preview bitmap width, so scale down. float overallScale = scale * (float)(w/(float)pageWidth); - dc->SetUserScale(overallScale, overallScale); - + float zoomW = w; zoomW = zoomW/(nBitmapWidth*overallScale); + float zoomH = h; zoomH = zoomH/(nBitmapHeight*overallScale); + dc->SetUserScale(overallScale * zoomW, overallScale * zoomH); + dc->SetBackground(*wxWHITE_BRUSH); + if (pageWidth != w) { + // Strange misbehaviour of wxGTK -> if we blit zoomed, the colours + // get inversed ??!? Workaround: wxSRC_INVERT + dc->Blit(0,0,nBitmapWidth,nBitmapHeight,&mem_dc,0,0,wxSRC_INVERT); + } else { + dc->Blit(0,0,nBitmapWidth,nBitmapHeight,&mem_dc,0,0,wxCOPY); + } return TRUE; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/sffdoc.h new/sffview-0.4/sffdoc.h --- old/sffview-0.3/sffdoc.h 2004-03-11 21:22:41.000000000 +0100 +++ new/sffview-0.4/sffdoc.h 2006-10-29 17:45:44.000000000 +0100 @@ -29,7 +29,7 @@ // /*-RCS-Info---------------------------------------------------- -$Id: sfftobmp.h,v 1.6 1999/12/19 07:47:53 peter Exp peter $ +$Id: sffdoc.h,v 1.2 2006/10/29 16:42:26 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ @@ -88,6 +88,7 @@ wxUint32 GetWidth(); wxBitmap *GetPageBitmap() { return m_pPageBmp; }; + wxBitmap *GetPageBitmap(int nPage); virtual bool OnOpenDocument(const wxString& filename); }; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/sfffile.cpp new/sffview-0.4/sfffile.cpp --- old/sffview-0.3/sfffile.cpp 2004-02-29 23:28:52.000000000 +0100 +++ new/sffview-0.4/sfffile.cpp 2006-10-29 17:45:44.000000000 +0100 @@ -27,7 +27,7 @@ // /*-RCS-Info---------------------------------------------------- - $Id: input.cpp,v 1.3 2003/03/26 10:04:23 pschaefer Exp $ + $Id: sfffile.cpp,v 1.2 2006/10/29 16:42:26 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ @@ -79,6 +79,7 @@ sff_byte b1 = 0, b2 = 0; sff_word w; int nLineCount = 0; + int fuzz = 0; TSFFPage *pPage; if (Eof()) @@ -88,13 +89,21 @@ do { switch (state) { case NEED_MAGIC : - Read(&dh, sizeof(dh)); - if (Eof()) - throw CSimpleException(CSimpleException::err_invalidfile); + for (fuzz = 0; fuzz < 2048; ++fuzz) { + Seek(fuzz, CFile::sk_from_start); + Read(&dh, sizeof(dh)); + if (Eof()) + throw CSimpleException(CSimpleException::err_invalidfile); + if (::memcmp(&dh.sff_id, &m_SFFID, sizeof(m_SFFID)) == 0) + break; + } if (::memcmp(&dh.sff_id, &m_SFFID, sizeof(m_SFFID)) != 0) throw CSimpleException(CSimpleException::err_invalidfile); if (dh.version > 1) throw CSimpleException(CSimpleException::err_invalidversion); + if (fuzz>0) { + dh.first_page += fuzz; + } Seek(dh.first_page, CFile::sk_from_start); state = NEED_PAGESTART; break; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/sfffile.h new/sffview-0.4/sfffile.h --- old/sffview-0.3/sfffile.h 2004-02-29 23:28:58.000000000 +0100 +++ new/sffview-0.4/sfffile.h 2005-05-20 23:27:30.000000000 +0200 @@ -29,7 +29,7 @@ // /*-RCS-Info---------------------------------------------------- - $Id: input.h,v 1.3 2003/03/26 10:04:25 pschaefer Exp $ + $Id: sfffile.h,v 1.1.1.1 2005/05/20 21:27:30 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/sfftypes.h new/sffview-0.4/sfftypes.h --- old/sffview-0.3/sfftypes.h 2004-02-29 23:29:04.000000000 +0100 +++ new/sffview-0.4/sfftypes.h 2005-05-20 23:27:30.000000000 +0200 @@ -29,7 +29,7 @@ // /*-RCS-Info---------------------------------------------------- - $Id: sfftypes.h,v 1.2 2003/03/26 10:04:24 pschaefer Exp $ + $Id: sfftypes.h,v 1.1.1.1 2005/05/20 21:27:30 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ @@ -52,7 +52,7 @@ typedef unsigned char sff_byte; typedef unsigned short sff_word; -typedef unsigned long sff_dword; +typedef unsigned int sff_dword; #ifndef _MAX_PATH #define _MAX_PATH 256 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/sffview.cpp new/sffview-0.4/sffview.cpp --- old/sffview-0.3/sffview.cpp 2004-03-11 21:21:15.000000000 +0100 +++ new/sffview-0.4/sffview.cpp 2006-10-29 20:18:52.000000000 +0100 @@ -110,24 +110,27 @@ void SffView::CalcScale() { - int w, h; - switch (m_nScaleType) - { - case FULLSCALE: - m_nZoom=1; - canvas->SetScrollbars( 1, 1, m_nBitmapWidth, m_nBitmapHeight); - break; - case FITWIDTH: - frame->GetClientSize(&w, &h); - m_nZoom=w; m_nZoom = m_nZoom/m_nBitmapWidth; - canvas->SetScrollbars( 1, 1, 1, m_nBitmapHeight*m_nZoom); - break; - case FULLPAGE: - frame->GetClientSize(&w, &h); - m_nZoom=h; m_nZoom /= m_nBitmapHeight; - canvas->SetScrollbars( 1, 1, m_nBitmapWidth*m_nZoom, 1); - break; - } + int w, h; + switch (m_nScaleType) + { + case FULLSCALE: + m_nZoom=1; + canvas->SetScrollbars( 1, 1, m_nBitmapWidth, m_nBitmapHeight); + canvas->Refresh(); + break; + case FITWIDTH: + frame->GetClientSize(&w, &h); + m_nZoom=w; m_nZoom = m_nZoom/m_nBitmapWidth; + canvas->SetScrollbars( 1, 1, 1, (int)(m_nBitmapHeight*m_nZoom)); + canvas->Refresh(); + break; + case FULLPAGE: + frame->GetClientSize(&w, &h); + m_nZoom=h; m_nZoom /= m_nBitmapHeight; + canvas->SetScrollbars( 1, 1, (int)(m_nBitmapWidth*m_nZoom), 1); + canvas->Refresh(); + break; + } } void SffView::OnDraw(wxDC *dc) @@ -180,7 +183,7 @@ SetFrame((wxFrame *) NULL); Activate(FALSE); - + return TRUE; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/sffview.h new/sffview-0.4/sffview.h --- old/sffview-0.3/sffview.h 2004-03-11 21:20:58.000000000 +0100 +++ new/sffview-0.4/sffview.h 2005-05-20 23:27:30.000000000 +0200 @@ -29,7 +29,7 @@ // /*-RCS-Info---------------------------------------------------- -$Id: sfftobmp.h,v 1.6 1999/12/19 07:47:53 peter Exp peter $ +$Id: sffview.h,v 1.1.1.1 2005/05/20 21:27:30 pschaefer Exp $ ---RCS-Info--------------------------------------------------*/ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/sffview-0.3/sffview.kateproject new/sffview-0.4/sffview.kateproject --- old/sffview-0.3/sffview.kateproject 2004-02-29 17:33:49.000000000 +0100 +++ new/sffview-0.4/sffview.kateproject 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ -[Dir inc] -Dirs= -Files=sffapp.h/sffdoc.h/sfftobmp.h/sffview.h - -[Project Dir] -Dirs= -Files=Makefile/sffapp.cpp/sffdoc.cpp/sffview.cpp/codes.h/decoder.h/sffapp.h/sffdoc.h/sffview.h/codes.cpp/decoder.cpp/sfftypes.h/common.cpp/common.h/sfffile.cpp/sfffile.h - -[Project File] -Name=sffview -Type=Default ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@suse.de