Thread: [Amis-vcs] SF.net SVN: amis: [2387] branches/amis3 (Page 4)
Brought to you by:
julienq,
marisademeglio
|
From: <mar...@us...> - 2008-03-03 06:30:40
|
Revision: 2387
http://amis.svn.sourceforge.net/amis/?rev=2387&view=rev
Author: marisademeglio
Date: 2008-03-02 22:30:45 -0800 (Sun, 02 Mar 2008)
Log Message:
-----------
First alpha of AMIS 3
Modified Paths:
--------------
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp
branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp
branches/amis3/DefaultLangpack/amisAccessibleUi.xml
branches/amis3/bin/settings/amisPrefs.xml.default
branches/amis3/bin/settings/lang/releasedate.mp3
branches/amis3/bin/settings/lang/version.mp3
branches/amis3/installer/main/setup-amis3.nsi
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
===================================================================
(Binary files differ)
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-03 05:54:57 UTC (rev 2386)
+++ branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-03 06:30:45 UTC (rev 2387)
@@ -374,15 +374,17 @@
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Use self-voicing",IDC_ISSELFVOICING,"Button",
- BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,7,7,241,10
- LTEXT "Select TTS voice:",IDC_SELTTSLABEL,7,22,242,8
+ BS_AUTOCHECKBOX | BS_NOTIFY | WS_DISABLED | WS_TABSTOP,7,
+ 7,241,10
+ LTEXT "Select TTS voice:",IDC_SELTTSLABEL,7,22,242,8,
+ WS_DISABLED
COMBOBOX IDC_TTSVOICES,7,35,108,88,CBS_DROPDOWNLIST | CBS_SORT |
- WS_VSCROLL | WS_TABSTOP
+ WS_DISABLED | WS_VSCROLL | WS_TABSTOP
CONTROL "Highlight text as it is read aloud",IDC_HIGHLIGHTTEXT,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,59,242,10
CONTROL "Load the most recently read book on startup",
- IDC_LOADLASTBOOK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,
- 76,242,10
+ IDC_LOADLASTBOOK,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
+ WS_TABSTOP,7,76,242,10
CONTROL "Start in basic view mode",IDC_STARTINBASICVIEW,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,94,242,10
CONTROL "Pause audio when switching applications",
Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-03 05:54:57 UTC (rev 2386)
+++ branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-03 06:30:45 UTC (rev 2387)
@@ -863,7 +863,7 @@
double rate = ambulantX::gui::dx::audio_playerX::Instance()->get_rate();
//TODO: unhardcode the max rate
- double max = 4.0;
+ double max = 2.0;
bool can_increase = true;
bool can_decrease = true;
if (rate == 1)
Modified: branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp 2008-03-03 05:54:57 UTC (rev 2386)
+++ branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp 2008-03-03 06:30:45 UTC (rev 2387)
@@ -92,6 +92,8 @@
ON_UPDATE_COMMAND_UI_RANGE(AMIS_PAGE_STYLE_BASE_ID, AMIS_PAGE_STYLE_BASE_ID + AMIS_MAX_ANYTHING, OnUpdateCmdUiPageStyle)
ON_UPDATE_COMMAND_UI(ID_AMIS_SMALLER_FONT, OnUpdateCmdUiSmallerFont)
ON_UPDATE_COMMAND_UI(ID_AMIS_BIGGER_FONT, OnUpdateCmdUiBiggerFont)
+ ON_UPDATE_COMMAND_UI(ID_AMIS_INCREASE_VOLUME, OnUpdateCmdUiGeneral)
+ ON_UPDATE_COMMAND_UI(ID_AMIS_DECREASE_VOLUME, OnUpdateCmdUiGeneral)
//}}AFX_MSG_MAP
ON_WM_SIZE()
END_MESSAGE_MAP()
@@ -482,7 +484,7 @@
void CMainFrame::OnUpdateCmdUiPlayFaster(CCmdUI* pCmdUi)
{
//TODO: unhardcode the max rate
- if (theApp.isBookOpen() && ambulantX::gui::dx::audio_playerX::Instance()->get_rate() < 4.0)
+ if (theApp.isBookOpen() && ambulantX::gui::dx::audio_playerX::Instance()->get_rate() < 2.0)
updateUiCommandState(pCmdUi, true);
else
updateUiCommandState(pCmdUi, false);
@@ -617,4 +619,6 @@
pToolbar->enable(ID_AMIS_NEXT_PAGE_STYLE, theApp.isBookOpen());
pToolbar->enable(ID_AMIS_INCREASE_SECTION_DEPTH, theApp.isBookOpen());
pToolbar->enable(ID_AMIS_DECREASE_SECTION_DEPTH, theApp.isBookOpen());
+ pToolbar->enable(ID_AMIS_INCREASE_VOLUME, theApp.isBookOpen());
+ pToolbar->enable(ID_AMIS_DECREASE_VOLUME, theApp.isBookOpen());
}
\ No newline at end of file
Modified: branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp 2008-03-03 05:54:57 UTC (rev 2386)
+++ branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp 2008-03-03 06:30:45 UTC (rev 2387)
@@ -29,7 +29,8 @@
#include "util/Color.h"
#include "util/Log.h"
#include <algorithm>
-
+#include "DtbWithHooks.h"
+#include "dtb\Dtb.h"
#include <fstream>
#include "resource.h"
@@ -135,6 +136,10 @@
mpUserCss = MainWndParts::Instance()->mpHtmlView->applyStylesheet
(Preferences::Instance()->getAmisCssFile());
scanStylesheetForAdditionalData(mpUserCss);
+ //TODO: does this ever work? need to test more books.
+ if (amis::dtb::DtbWithHooks::Instance()->getDaisyVersion() == amis::dtb::DAISY_2005)
+ MainWndParts::Instance()->mpHtmlView->applyStylesheet(Preferences::Instance()->getZed2005CssFile());
+
MainWndParts::Instance()->mpHtmlView->RedrawWindow();
mbWaitForDocumentLoad = false;
Modified: branches/amis3/DefaultLangpack/amisAccessibleUi.xml
===================================================================
--- branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-03 05:54:57 UTC (rev 2386)
+++ branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-03 06:30:45 UTC (rev 2387)
@@ -34,19 +34,19 @@
<icon src="./open.png" type="smallIcon"/>
<caption>
<text id="xx">Open URL...</text>
- <audio src=""/>
+ <audio src="./audio/openurl.mp3"/>
</caption>
<description>
<text id="xx">Open a DAISY publication from a URL</text>
- <audio src=""/>
+ <audio src="./audio/openurl_desc.mp3"/>
</description>
<accelerator>
<text id="xx">Ctrl+U</text>
- <audio src=""/>
+ <audio src="./audio/openurl_ctrlu.mp3"/>
</accelerator>
<mnemonic>
<text id="xx">U</text>
- <audio src=""/>
+ <audio src="./audio/openurl_u.mp3"/>
</mnemonic>
</action>
<!--new action-->
@@ -55,15 +55,15 @@
<icon src="./close.png" type="smallIcon"/>
<caption>
<text id="xx">Close</text>
- <audio src=""/>
+ <audio src="./audio/close.mp3"/>
</caption>
<description>
<text id="xx">Close the DAISY publication.</text>
- <audio src=""/>
+ <audio src="./audio/close_desc.mp3"/>
</description>
<mnemonic>
<text id="xx">C</text>
- <audio src=""/>
+ <audio src="./audio/close_c.mp3"/>
</mnemonic>
</action>
<action mfcid="ID_AMIS_LOAD_CD" widget="menuItem toolbarItem">
Modified: branches/amis3/bin/settings/amisPrefs.xml.default
===================================================================
--- branches/amis3/bin/settings/amisPrefs.xml.default 2008-03-03 05:54:57 UTC (rev 2386)
+++ branches/amis3/bin/settings/amisPrefs.xml.default 2008-03-03 06:30:45 UTC (rev 2387)
@@ -4,8 +4,8 @@
<section name="general">
<entry id="ui-lang-id" value="eng-US"/>
<entry id="start-in-basic-view" value="no"/>
-<entry id="load-last-book" value="yes"/>
-<entry id="is-self-voicing" value="yes"/>
+<entry id="load-last-book" value="no"/>
+<entry id="is-self-voicing" value="no"/>
<entry id="tts-voice-index" value="0"/>
<entry id="pause-on-lost-focus" value="no"/>
<entry id="use-tts-not-audio" value="no"/>
Modified: branches/amis3/bin/settings/lang/releasedate.mp3
===================================================================
(Binary files differ)
Modified: branches/amis3/bin/settings/lang/version.mp3
===================================================================
(Binary files differ)
Modified: branches/amis3/installer/main/setup-amis3.nsi
===================================================================
--- branches/amis3/installer/main/setup-amis3.nsi 2008-03-03 05:54:57 UTC (rev 2386)
+++ branches/amis3/installer/main/setup-amis3.nsi 2008-03-03 06:30:45 UTC (rev 2387)
@@ -86,7 +86,6 @@
;copy the DLLs
File "${BIN_DIR}\libambulant_shwin32.dll"
- File "${BIN_DIR}\AmisAudio.dll"
File "${BIN_DIR}\xerces-c_2_7.dll"
File "${BIN_DIR}\libamplugin_pdtb.dll"
File "${BIN_DIR}\PdtbIePlugin.dll"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-04 05:15:00
|
Revision: 2388
http://amis.svn.sourceforge.net/amis/?rev=2388&view=rev
Author: marisademeglio
Date: 2008-03-03 21:15:06 -0800 (Mon, 03 Mar 2008)
Log Message:
-----------
Added support for opening local books from the command line.
Added reopening of the last-read book (although it is still off by default in the preferences)
Removed audiere and fftw DLLs since they shouldn't be needed anymore.
Modified Paths:
--------------
branches/amis3/AmisCore/src/util/Log.cpp
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.vcproj
branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/AmisGuiMFC2/src/gui/MmDoc.cpp
Removed Paths:
-------------
branches/amis3/bin/audiere.dll
branches/amis3/bin/fftw3.dll
Modified: branches/amis3/AmisCore/src/util/Log.cpp
===================================================================
--- branches/amis3/AmisCore/src/util/Log.cpp 2008-03-03 06:30:45 UTC (rev 2387)
+++ branches/amis3/AmisCore/src/util/Log.cpp 2008-03-04 05:15:06 UTC (rev 2388)
@@ -66,6 +66,16 @@
void amis::util::Log::endLog()
{
+#ifdef AMIS_PLATFORM_WINDOWS
+ char datestr[10];
+ char timestr[10];
+ _strdate(datestr);
+ _strtime(timestr);
+ mFile<<"End of log\n"<<datestr<<"\n"<<timestr<<endl;
+#else
+ mFile<<"End of log"<<endl;
+ //TODO: timestamp for other platforms
+#endif
mFile.close();
mbIsFileOpen = false;
}
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
===================================================================
(Binary files differ)
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-03 06:30:45 UTC (rev 2387)
+++ branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-04 05:15:06 UTC (rev 2388)
@@ -383,8 +383,8 @@
CONTROL "Highlight text as it is read aloud",IDC_HIGHLIGHTTEXT,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,59,242,10
CONTROL "Load the most recently read book on startup",
- IDC_LOADLASTBOOK,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
- WS_TABSTOP,7,76,242,10
+ IDC_LOADLASTBOOK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,
+ 76,242,10
CONTROL "Start in basic view mode",IDC_STARTINBASICVIEW,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,94,242,10
CONTROL "Pause audio when switching applications",
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.vcproj
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisGuiMFC2.vcproj 2008-03-03 06:30:45 UTC (rev 2387)
+++ branches/amis3/AmisGuiMFC2/AmisGuiMFC2.vcproj 2008-03-04 05:15:06 UTC (rev 2388)
@@ -36,7 +36,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="AmisCoreD.lib xerces-c_2D.lib libambulant_shwin32_D.lib strmiids.lib uuid.lib"
- OutputFile="$(OutDir)/AMIS.exe"
+ OutputFile="$(OutDir)/AMISD.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../lib;../../../../ambulant/lib/win32;"$(VSInstallDir)\..\Microsoft Speech SDK 5.1\Lib\i386";"$(VSInstallDir)\..\Visual Leak Detector""
IgnoreDefaultLibraryNames="uafxcwd.lib"
Modified: branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h 2008-03-03 06:30:45 UTC (rev 2387)
+++ branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h 2008-03-04 05:15:06 UTC (rev 2388)
@@ -64,6 +64,7 @@
amis::RecentBooks* getRecentBooks();
bool isBookOpen();
void setPauseState(bool play);
+ bool shouldIgnoreOpenDocEvent();
//Menu handlers
afx_msg void OnFileOpen();
@@ -118,6 +119,9 @@
ambulant::net::url mURL;
amis::RecentBooks* mpRecentBooks;
bool mbBookIsOpen;
+ bool mbShouldIgnoreOpenDocEvent;
+ bool mbWasLastExitClean;
+
public:
//afx_msg void OnAppAbout();
DECLARE_MESSAGE_MAP()
Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-03 06:30:45 UTC (rev 2387)
+++ branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-04 05:15:06 UTC (rev 2388)
@@ -124,6 +124,7 @@
BOOL CAmisApp::InitInstance()
{
+ USES_CONVERSION;
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
if (hr == S_FALSE) CoUninitialize();
@@ -173,14 +174,12 @@
// To create the main window, this code creates a new frame window
// object and then sets it as the application's main window object
CMDIFrameWnd* pFrame = new CMainFrame;
-
if (!pFrame->LoadFrame(IDR_AMISTYPE))
{
amis::util::Log::Instance()->writeError("Could not load MFC frame IDR_AMISTYPE", "CMainFrame::InitInstance",
"AmisGuiMFC2");
return FALSE;
}
-
m_pMainWnd = pFrame;
// Parse command line for standard shell commands, DDE, file open
@@ -190,11 +189,29 @@
// Dispatch commands specified on the command line
//it turns out that this step is rather important even if you're not really interested in
//the command line because mfc processes dynamic view creation somewhere in here.
+ //also:
+ //this will stupidly invoke seemingly any available OnOpenDocument handler if it thinks your
+ //command parameters want to open a document.
+ //our workaround is the mbShouldIgnoreOpenDoc event flag
+ mbShouldIgnoreOpenDocEvent = true;
if (!ProcessShellCommand(cmdInfo))
{
amis::util::Log::Instance()->writeError("Error processing shell command info", "CAmisApp::InitInstance", "AmisGuiMFC2");
return FALSE;
}
+ mbShouldIgnoreOpenDocEvent = false;
+ bool b_open_from_cmdline = false;
+ ambulant::net::url book_to_open;
+ if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileOpen)
+ {
+ //we have to assume that command line parameters are local files
+ //TODO: introduce a command line parameter to identify URLs
+ //if we get the two mixed up, then the path gets mangled
+ b_open_from_cmdline = true;
+ book_to_open = ambulant::net::url::from_filename(T2A(cmdInfo.m_strFileName));
+ amis::util::Log::Instance()->writeMessage("Command line parameter: ", &book_to_open, "CAmisApp::InitInstance", "AmisGuiMFC2");
+ }
+
// try to load shared MDI menus and accelerator table
HINSTANCE hInst = AfxGetResourceHandle();
@@ -213,11 +230,24 @@
//set the callback function to handle book key registration
amis::dtb::DtbWithHooks::Instance()->setCallbackForPreprocessingBookKey(registerBookKeyFile);
+ //if we're not opening from the command line, try loading the last-read book
+ if (b_open_from_cmdline == false
+ && Preferences::Instance()->getLoadLastBook() == true
+ && mbWasLastExitClean == true)
+ book_to_open = mpRecentBooks->getLastRead()->mPath;
+
+ //open a book if we decided to either open the command line parameter or last-read book
+ if (!book_to_open.is_empty_path()) openBook(&book_to_open);
+
return TRUE;
}
int CAmisApp::ExitInstance()
{
+ Preferences::Instance()->setWasExitClean(true);
+ PreferencesFileIO prefs_io;
+ prefs_io.writeToFile(Preferences::Instance()->getSourceUrl()->get_file(), Preferences::Instance());
+
amis::util::Log::Instance()->writeMessage("Exiting", "CAmisApp::ExitInstance", "AmisGuiMFC2");
if (m_hMDIMenu != NULL) FreeResource(m_hMDIMenu);
if (m_hMDIAccel != NULL)FreeResource(m_hMDIAccel);
@@ -235,8 +265,7 @@
DataTree::Instance()->DestroyInstance();
- if (mpRecentBooks)
- delete mpRecentBooks;
+ if (mpRecentBooks != NULL) delete mpRecentBooks;
amis::util::Log::Instance()->endLog();
amis::util::Log::Instance()->DestroyInstance();
@@ -264,11 +293,15 @@
void CAmisApp::initializePathsAndFiles()
{
- //read the preferences
+ //read the preferences and mark the was-exit-clean flag as false
amis::io::PreferencesFileIO prefs_io;
string prefs_path = "./settings/amisPrefs.xml";
prefs_path = amis::util::FilePathTools::goRelativePath(theApp.getAppPath(), prefs_path);
prefs_io.readFromFile(prefs_path);
+ mbWasLastExitClean = Preferences::Instance()->getWasExitClean();
+ Preferences::Instance()->setWasExitClean(false);
+ prefs_io.writeToFile(prefs_path, Preferences::Instance());
+
//read the recent books list
string recent_books_path = "./settings/amisRecentBooks.xml";
recent_books_path = amis::util::FilePathTools::goRelativePath(theApp.getAppPath(), recent_books_path);
@@ -328,6 +361,10 @@
{
return mbBookIsOpen;
}
+bool CAmisApp::shouldIgnoreOpenDocEvent()
+{
+ return mbShouldIgnoreOpenDocEvent;
+}
//this function is used by all functions here that lead to a book being opened
void CAmisApp::openBook(const ambulant::net::url* filename)
{
@@ -337,7 +374,6 @@
MainWndParts::Instance()->updateTitleSelfVoicing(Preferences::Instance()->getIsSelfVoicing());
bool b_a_book_was_open = false;
-
//close the open book
if (mbBookIsOpen == true)
{
Modified: branches/amis3/AmisGuiMFC2/src/gui/MmDoc.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/MmDoc.cpp 2008-03-03 06:30:45 UTC (rev 2387)
+++ branches/amis3/AmisGuiMFC2/src/gui/MmDoc.cpp 2008-03-04 05:15:06 UTC (rev 2388)
@@ -53,8 +53,8 @@
#include "gui/MmDoc.h"
#include "gui/MmView.h"
-
#include "gui/MainWndParts.h"
+#include "gui/AmisApp.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -126,6 +126,11 @@
BOOL MmDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
+ //med 21 June 07
+ //this is a hack to get around the fact that windows will automatically invoke this
+ //OnOpenDocument handler when it does command line processing (even though I wish it wouldn't)
+ if (theApp.shouldIgnoreOpenDocEvent() == true) return TRUE;
+
POSITION pos = GetFirstViewPosition();
if(pos != NULL)
{
Deleted: branches/amis3/bin/audiere.dll
===================================================================
(Binary files differ)
Deleted: branches/amis3/bin/fftw3.dll
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-05 22:20:42
|
Revision: 2392
http://amis.svn.sourceforge.net/amis/?rev=2392&view=rev
Author: marisademeglio
Date: 2008-03-05 14:20:43 -0800 (Wed, 05 Mar 2008)
Log Message:
-----------
added features and issues files
Added Paths:
-----------
branches/amis3/amis_features.txt
branches/amis3/amis_issues.txt
Added: branches/amis3/amis_features.txt
===================================================================
--- branches/amis3/amis_features.txt (rev 0)
+++ branches/amis3/amis_features.txt 2008-03-05 22:20:43 UTC (rev 2392)
@@ -0,0 +1,79 @@
+AMIS
+====
+ABOUT
+ Open source DAISY player
+ Free of charge
+ Actively developed and supported
+ Can be localized
+ Previous versions already in-use worldwide
+
+BOOKS SUPPORTED
+ DAISY 2.02 full text + full audio
+ DAISY 2.02 ncc + audio
+
+ DAISY/NISO 2005 full text + full audio
+ DAISY/NISO 2005 ncx + audio
+
+ Experimental books with Ncc/Ncx + full SMIL 2.0 (e.g. video + captions)
+
+REQUIREMENTS
+ Windows XP
+ Windows 2000
+ Windows Vista
+ DirectX 9
+ SAPI 5.1
+
+FEATURES
+--------
+Navigation shortcuts
+ Previous/Next phrase
+ Previous/Next page
+ Previous/Next section
+ Go to page
+
+Browsing the structure in the navigation sidebar
+ Hierarchical view of sections
+ List of pages
+ Lists for each special type of item in the book
+
+Bookmarking
+ Add bookmark (named automatically based on what you are bookmarking)
+ Go to bookmark
+ Bookmarks for a particular book automatically load when you open that book
+
+Open a recently-read book
+Automatically open your last-read book on startup
+Open a local book from the command line
+Open the contents of a CD-ROM containing a single book or containing multiple books
+Open a book from your local file system
+Open a book from a remote URL
+
+Speed-up audio playback X times
+Play and pause the book
+
+See publication summary information for the book
+Find out basic information about AMIS
+
+Use basic or default view mode
+Show/hide the navigation sidebar
+Move the navigation sidebar around the screen
+Change the style of the page
+Make the font bigger up to X times (and go back and forth between sizes)
+
+Customization
+ Toolbars
+ - defined externally in settings\defaultToolbar.xml and settings\basicToolbar.xml
+ - try making one, following the existing format
+ - icons go in the img directory
+
+ Fontsize
+ - font size is defined using css files in settings\css\font\*.css
+ - You can put anything in here up to X files.
+
+ Page styles
+ - page styles are defined using css files in settings\css\customStyles\*.css
+ - You can put anything in here and it will show up in the Page Styles submenu.
+ - Each will be applied in turn when the user presses the Page Style button.
+
+ AMIS own highlight settings are defined in settings\css\amis.css . See the notes there about how the file is set up.
+
\ No newline at end of file
Added: branches/amis3/amis_issues.txt
===================================================================
--- branches/amis3/amis_issues.txt (rev 0)
+++ branches/amis3/amis_issues.txt 2008-03-05 22:20:43 UTC (rev 2392)
@@ -0,0 +1,99 @@
+ALPHA 2 (MARCH 17)
+==========
+CODE ORGANIZATION
+---
+* code cleanup to follow conventions/style of existing code regarding folder locations, indentation, variables
+* use meaningful trace messages and delete old ones
+* review TODOs, remove if resolved, address if needed
+* remove commented-out code
+
+NEW FEATURES
+---
+* finish self-voicing for all dialogs
+* add navlists to view menu
+* re-add tooltips
+* next/previous page/phrase/section should be enabled or disabled according to the book state
+* suport unlimited font sizes
+* add dialog to adjust highlight colors and font type
+* fontsize in the sidebar
+* highlight current section (in sidebar) in same color as page highlight
+* bookmarking for non-ascii dc:identifiers
+* opening URLs from the command line
+
+ISSUES
+---
+* stabilize self-voicing for menus
+* new audio backend makes reading options dialog crash
+* zed books need a stylesheet
+* make highight colors override the book's built-in colors
+* Listviews have more than one column, cutting off text
+* Sidebar intercepts shift+arrow even when I tell it not to.
+* publication summary dialog not getting current section for zed books
+* window resizing problems with HTML view
+* "previous section" command results not previous enough
+
+AMBULANT ISSUES
+--
+* How to stop ambulant when closing a book
+* review skippability across document boundaries (need reading options dialog to work)
+
+
+BETA (APRIL 1)
+=================
+NEW FEATURES
+---
+* Parse CSS for font info, contrast info
+* Don't start reading when browsing the TOC - just announce the label for the item
+* AmisCore's "Find in text" needs a faster algorithm
+* find in text dialog
+* AMIS should remember its last window size and reuse it on startup
+* implement (these commands are always available)
+ ID_AMIS_FOCUS_ON_SIDEBAR
+ ID_AMIS_TOGGLE_AUDIO_SELFVOICING_PLAYBACK
+* implement (available when a book is open)
+ ID_AMIS_FOCUS_ON_TEXT
+ ID_AMIS_RESET_HIGHLIGHT_COLORS
+ ID_AMIS_TOGGLE_AUDIO_CONTENT_PLAYBACK
+* add commands to increase/decrease specific volumes
+
+ISSUES
+---
+* disable IE7 right-click menu
+
+OTHER
+---
+* select TTS based on language of book/UI. or take an educated guess.
+* Right/left arrow means something different (conceptually) in nav window
+* how do we count pages? does the page number appear at the bottom or top of the page?
+* resource.h.ini needs to be kept in-sync with a post-build batch process
+* memory leaks in ambulant::logger, UrlInputSource, plugin_engine
+* installer prompts about Thai encoding support
+
+LANGUAGE PACKS
+---
+* update RC template
+* Re-add Language pack support
+* review widget types in AmisAccessibleUI (we can't say which will be toolbar items)
+* harmonize icon refs with toolbar xml
+
+
+POSTPONED FOR CANDIDATE RELEASE (MAY 1)
+===============================
+* One installer per language
+* update web scripts to reflect new or changed items
+* Update help contents
+
+
+POSTPONED TO BEYOND AMIS 3's FIRST STABLE RELEASE
+=================================================
+* Dist/disc info
+* Handle multiple volumes
+* audio slow-down
+* Support DAISY resource files (need an example!)
+* Bookshare books are slow and don't load if a bookmark file exists for them; eventually this error appears 12:35:27 TRACE dx_html_renderer: programmer error: attempt to start() again.
+
+
+ADDED AFTER ALPHA 1
+===================
+* Loads last book on startup
+* Loads from command line
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-07 05:55:25
|
Revision: 2395
http://amis.svn.sourceforge.net/amis/?rev=2395&view=rev
Author: marisademeglio
Date: 2008-03-06 21:55:29 -0800 (Thu, 06 Mar 2008)
Log Message:
-----------
No longer crashes if the book has no UID and bookmarking is unavailable.
Bookmarking commands disabled if bookmarking not available.
Modified Paths:
--------------
branches/amis3/AmisCore/src/dtb/Dtb.cpp
branches/amis3/AmisCore/src/dtb/DtbFileSet.cpp
branches/amis3/AmisCore/src/dtb/nav/NavVisitor.cpp
branches/amis3/AmisGuiMFC2/include/gui/MainFrm.h
branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp
branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp
branches/amis3/bin/settings/makeLocalCopiesOfDefaults.bat
Modified: branches/amis3/AmisCore/src/dtb/Dtb.cpp
===================================================================
--- branches/amis3/AmisCore/src/dtb/Dtb.cpp 2008-03-06 00:12:19 UTC (rev 2394)
+++ branches/amis3/AmisCore/src/dtb/Dtb.cpp 2008-03-07 05:55:29 UTC (rev 2395)
@@ -436,7 +436,7 @@
//--------------------------------------------------
void amis::dtb::Dtb::loadBookmarks(const ambulant::net::url* filepath)
{
- if (filepath == NULL)
+ if (filepath == NULL || filepath->is_empty_path())
{
mpBookmarks = NULL;
return;
@@ -553,6 +553,8 @@
//it turns out that this method signature is friendlier for ambulant than the other setNewLastmark function
void amis::dtb::Dtb::setNewLastmark(ambulant::net::url positionUri)
{
+ if (mpBookmarks == NULL) return;
+
amis::dtb::PositionData* p_pos_data = new amis::dtb::PositionData();
p_pos_data->mUri = positionUri;
Modified: branches/amis3/AmisCore/src/dtb/DtbFileSet.cpp
===================================================================
--- branches/amis3/AmisCore/src/dtb/DtbFileSet.cpp 2008-03-06 00:12:19 UTC (rev 2394)
+++ branches/amis3/AmisCore/src/dtb/DtbFileSet.cpp 2008-03-07 05:55:29 UTC (rev 2395)
@@ -35,6 +35,7 @@
#include "dtb/DtbFileSet.h"
#include "util/FilePathTools.h"
#include "util/findfilecontainer.h"
+#include "util/Log.h"
//DTB fileset utility class
amis::dtb::DtbFileSet::DtbFileSet()
@@ -80,7 +81,10 @@
mBookmarksFilepath = ambulant::net::url::from_filename(thefilename);//calculateSafeBookmarksFilename(uid));
mBookmarksFilepath = mBookmarksFilepath.join_to_base(mBookmarksDirectory);
}
-
+ else
+ {
+ amis::util::Log::Instance()->writeError("No UID found. Bookmarking unavailable.", "DtbFileSet::setAdditionalDataAfterInitialParse", "AmisCore");
+ }
if (navfile != NULL)
{
mNavFilepath = navfile->join_to_base(mBookDirectory);
Modified: branches/amis3/AmisCore/src/dtb/nav/NavVisitor.cpp
===================================================================
--- branches/amis3/AmisCore/src/dtb/nav/NavVisitor.cpp 2008-03-06 00:12:19 UTC (rev 2394)
+++ branches/amis3/AmisCore/src/dtb/nav/NavVisitor.cpp 2008-03-07 05:55:29 UTC (rev 2395)
@@ -130,7 +130,7 @@
pModel->setSmilIdNodeMap(mpMap);
-// printMap(true);
+ printMap(true);
}
//then assign each NavNode a list of file#id values
Modified: branches/amis3/AmisGuiMFC2/include/gui/MainFrm.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/MainFrm.h 2008-03-06 00:12:19 UTC (rev 2394)
+++ branches/amis3/AmisGuiMFC2/include/gui/MainFrm.h 2008-03-07 05:55:29 UTC (rev 2395)
@@ -83,6 +83,7 @@
afx_msg void OnUpdateCmdUiPageStyle(CCmdUI*);
afx_msg void OnUpdateCmdUiBiggerFont(CCmdUI*);
afx_msg void OnUpdateCmdUiSmallerFont(CCmdUI*);
+ afx_msg void OnUpdateCmdUiBookmarks(CCmdUI*);
DECLARE_MESSAGE_MAP()
public:
void updateToolbarState(toolbar::Toolbar*);
Modified: branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp 2008-03-06 00:12:19 UTC (rev 2394)
+++ branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp 2008-03-07 05:55:29 UTC (rev 2395)
@@ -67,7 +67,7 @@
ON_UPDATE_COMMAND_UI(ID_AMIS_NEXT_PAGE, OnUpdateCmdUiPageCommands)
ON_UPDATE_COMMAND_UI(ID_AMIS_PREVIOUS_PAGE, OnUpdateCmdUiPageCommands)
ON_UPDATE_COMMAND_UI(ID_AMIS_GOTO_PAGE, OnUpdateCmdUiPageCommands)
- ON_UPDATE_COMMAND_UI(ID_AMIS_ADD_BOOKMARK, OnUpdateCmdUiGeneral)
+ ON_UPDATE_COMMAND_UI(ID_AMIS_ADD_BOOKMARK, OnUpdateCmdUiBookmarks)
ON_UPDATE_COMMAND_UI(ID_AMIS_FASTER, OnUpdateCmdUiPlayFaster)
ON_UPDATE_COMMAND_UI(ID_AMIS_CLOSE_BOOK, OnUpdateCmdUiGeneral)
ON_UPDATE_COMMAND_UI(ID_AMIS_SHOW_READING_OPTIONS, OnUpdateCmdUiInfoSkip)
@@ -557,6 +557,13 @@
else
updateUiCommandState(pCmdUi, false);
}
+void amis::gui::CMainFrame::OnUpdateCmdUiBookmarks(CCmdUI* pCmdUi)
+{
+ if (theApp.isBookOpen() && amis::dtb::DtbWithHooks::Instance()->getBookmarks() != NULL)
+ updateUiCommandState(pCmdUi, true);
+ else
+ updateUiCommandState(pCmdUi, false);
+}
//the ON_UPDATE_COMMAND_UI messages end up here because it takes care of the toolbars too
void amis::gui::CMainFrame::updateUiCommandState(CCmdUI* pCmdUi, bool value)
@@ -617,8 +624,12 @@
else
pToolbar->enable(ID_AMIS_SHOW_READING_OPTIONS, false);
+ if (b_is_book_open && amis::dtb::DtbWithHooks::Instance()->getBookmarks() != NULL)
+ pToolbar->enable(ID_AMIS_ADD_BOOKMARK, true);
+ else
+ pToolbar->enable(ID_AMIS_ADD_BOOKMARK, false);
+
//general stuff
- pToolbar->enable(ID_AMIS_ADD_BOOKMARK, b_is_book_open);
pToolbar->enable(ID_AMIS_CLOSE_BOOK, b_is_book_open);
pToolbar->enable(ID_AMIS_FOCUS_ON_TEXT, b_is_book_open);
pToolbar->enable(ID_AMIS_TOGGLE_AUDIO_CONTENT_PLAYBACK, b_is_book_open);
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp 2008-03-06 00:12:19 UTC (rev 2394)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp 2008-03-07 05:55:29 UTC (rev 2395)
@@ -139,18 +139,22 @@
mNarrator = p_meta->getMetadataContent("dc:Narrator");
}
- //TODO: get the full mutimedia data (should be available directly from the nav data model)
- mNavigableItems = p_nav->getNavMap()->getLabel()->getText()->getTextString();
- if (p_nav->hasPages())
- {
- mNavigableItems.append(L", ");
- mNavigableItems.append(p_nav->getPageList()->getLabel()->getText()->getTextString());
+ //TODO: get the full multimedia data (should be available directly from the nav data model)
+ if (p_nav->getNavMap()->getLabel() != NULL)
+ {
+ mNavigableItems = p_nav->getNavMap()->getLabel()->getText()->getTextString();
+ if (p_nav->hasPages())
+ {
+ mNavigableItems.append(L", ");
+ mNavigableItems.append(p_nav->getPageList()->getLabel()->getText()->getTextString());
+ }
}
int sz = p_nav->getNumberOfNavLists();
for (int i=0; i<sz; i++)
{
mNavigableItems.append(L", ");
- mNavigableItems.append(p_nav->getNavList(i)->getLabel()->getText()->getTextString());
+ if (p_nav->getNavList(i)->getLabel() != NULL)
+ mNavigableItems.append(p_nav->getNavList(i)->getLabel()->getText()->getTextString());
}
mPublisher = p_meta->getMetadataContent("dc:Publisher");
mDescription = p_meta->getMetadataContent("dc:Description");
Modified: branches/amis3/bin/settings/makeLocalCopiesOfDefaults.bat
===================================================================
--- branches/amis3/bin/settings/makeLocalCopiesOfDefaults.bat 2008-03-06 00:12:19 UTC (rev 2394)
+++ branches/amis3/bin/settings/makeLocalCopiesOfDefaults.bat 2008-03-07 05:55:29 UTC (rev 2395)
@@ -1,4 +1,5 @@
rem this batch file copies two default config files and renames them so they work with amis
-copy amisRecentBooks.xml.default amisRecentBooks.xml
-copy amisPrefs.xml.default amisPrefs.xml
\ No newline at end of file
+copy amisRecentBooks.xml.default amisRecentBooks.xml /y
+copy amisPrefs.xml.default amisPrefs.xml /y
+copy bmk\amisExtraBookmarksInfo.xml.default bmk\amisExtraBookmarksInfo.xml /y
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-11 01:58:17
|
Revision: 2399
http://amis.svn.sourceforge.net/amis/?rev=2399&view=rev
Author: marisademeglio
Date: 2008-03-10 18:58:12 -0700 (Mon, 10 Mar 2008)
Log Message:
-----------
changing recentbooks format to something more generic
Modified Paths:
--------------
branches/amis3/AmisCore/include/AmisCore.h
branches/amis3/AmisCore/include/RecentBooks.h
branches/amis3/AmisCore/include/io/RecentBooksFileIO.h
branches/amis3/AmisCore/src/RecentBooks.cpp
branches/amis3/AmisCore/src/io/RecentBooksFileIO.cpp
branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h
branches/amis3/AmisGuiMFC2/src/DtbWithHooks.cpp
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/MenuVoicing.cpp
branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp
branches/amis3/bin/settings/amisRecentBooks.xml.default
Modified: branches/amis3/AmisCore/include/AmisCore.h
===================================================================
--- branches/amis3/AmisCore/include/AmisCore.h 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/AmisCore/include/AmisCore.h 2008-03-11 01:58:12 UTC (rev 2399)
@@ -57,8 +57,8 @@
class AudioNode;
class MediaGroup;
class Error;
- class RecentBookEntry;
- class RecentBooks;
+ class BookEntry;
+ class BookList;
class ModuleDescData;
class SearchDTBText;
class SearchDTBParser;
@@ -125,16 +125,18 @@
}
namespace io
{
- class RecentBooksFileIO;
+ class BookListFileIO;
+ class BookmarksFileIO;
class ModuleDescReader;
- class BookmarksFileIO;
class NccFileReader;
class NavFileReader;
class NcxFileReader;
+ class OpfFileReader;
class QuickDataSmilFileReader;
class SmilFileReader;
class TextSearch;
class XercesSaxParseBase;
+ class UrlInputSource;
}
namespace util
{
Modified: branches/amis3/AmisCore/include/RecentBooks.h
===================================================================
--- branches/amis3/AmisCore/include/RecentBooks.h 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/AmisCore/include/RecentBooks.h 2008-03-11 01:58:12 UTC (rev 2399)
@@ -19,8 +19,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef RECENTBOOKS_H
-#define RECENTBOOKS_H
+#ifndef BOOKLIST_H
+#define BOOKLIST_H
#include <string>
#include <vector>
@@ -30,40 +30,39 @@
namespace amis
{
-//!RecentBookEntry class
-class RecentBookEntry
+class BookEntry
{
- public:
- RecentBookEntry();
- ~RecentBookEntry();
-
- ambulant::net::url mPath;
- ambulant::net::url mBmkPath;
- bool mbIsLastRead;
+public:
+ BookEntry();
+ ~BookEntry();
+
+ std::wstring mUid;
+ ambulant::net::url mPath;
+ ambulant::net::url mBmkPath;
+ bool mbIsLastRead;
};
-
-//!RecentBooks class
-class RecentBooks
+class BookList
{
-
public:
- RecentBooks();
- ~RecentBooks();
+ BookList();
+ ~BookList();
int getNumberOfEntries();
- amis::RecentBookEntry* getEntry(unsigned int);
- void addEntry(amis::RecentBookEntry*);
+ amis::BookEntry* getEntry(unsigned int);
+ void addEntry(amis::BookEntry*);
void deleteEntry(unsigned int);
int getMaxItemsAllowed();
void setMaxItemsAllowed(unsigned int);
- amis::RecentBookEntry* getLastRead();
+ amis::BookEntry* getLastRead();
const ambulant::net::url* getFilepath();
void setFilepath(const ambulant::net::url*);
+ void setName(std::wstring);
+ std::wstring getName();
private:
void cleanUpVector();
unsigned int mMax;
ambulant::net::url mFilepath;
- vector<amis::RecentBookEntry*> mItems;
+ vector<amis::BookEntry*> mItems;
+ std::wstring mName;
};
-
}
#endif
Modified: branches/amis3/AmisCore/include/io/RecentBooksFileIO.h
===================================================================
--- branches/amis3/AmisCore/include/io/RecentBooksFileIO.h 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/AmisCore/include/io/RecentBooksFileIO.h 2008-03-11 01:58:12 UTC (rev 2399)
@@ -19,8 +19,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef RECENTBOOKSFILEIO_H
-#define RECENTBOOKSFILEIO_H
+#ifndef BOOKLISTFILEIO_H
+#define BOOKLISTFILEIO_H
#include "RecentBooks.h"
#include "io/XercesSaxParseBase.h"
@@ -42,44 +42,34 @@
{
namespace io
{
-class RecentBooksFileIO : public XercesSaxParseBase
+class BookListFileIO : public XercesSaxParseBase
{
public:
- RecentBooksFileIO();
- ~RecentBooksFileIO();
+ BookListFileIO();
+ ~BookListFileIO();
bool readFromFile(const ambulant::net::url*);
- amis::RecentBooks* getRecentBooks();
+ amis::BookList* getBookList();
//write the file to disk
- bool writeToFile(const ambulant::net::url*, amis::RecentBooks*);
+ bool writeToFile(const ambulant::net::url*, amis::BookList*);
- //SAX METHODS
void startElement(const XMLCh* const uri,
const XMLCh* const localname,
const XMLCh* const qname,
const Attributes& attributes);
void endElement(const XMLCh* const uri,
const XMLCh* const localname,
- const XMLCh* const qname);
- void characters(const XMLCh *const, const unsigned int);
- /*end of sax methods*/
+ const XMLCh* const qname)
+ {/*we don't need this method*/}
+ void characters(const XMLCh *const, const unsigned int)
+ {/*we don't need this method*/}
private:
- void writeRecentBookEntry(amis::RecentBookEntry*);
-
+ void writeBookEntry(amis::BookEntry*);
ambulant::net::url mFilePath;
-
- //!retrieve character data
- bool mb_flagGetChars;
-
- //!temp char data
- std::string mTempChars;
-
- //the recent books file object model
- amis::RecentBooks* mpRecentBooks;
-
- amis::RecentBookEntry* mpCurrentEntry;
-
+ //the books list file object model
+ amis::BookList* mpBookList;
+ amis::BookEntry* mpCurrentEntry;
//The DOM document pointer
xercesc_2_7::DOMDocument* mpDoc;
};
Modified: branches/amis3/AmisCore/src/RecentBooks.cpp
===================================================================
--- branches/amis3/AmisCore/src/RecentBooks.cpp 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/AmisCore/src/RecentBooks.cpp 2008-03-11 01:58:12 UTC (rev 2399)
@@ -24,31 +24,28 @@
#include <iostream>
using namespace std;
-amis::RecentBookEntry::RecentBookEntry()
+amis::BookEntry::BookEntry()
{
this->mbIsLastRead= false;
}
-amis::RecentBookEntry::~RecentBookEntry()
+amis::BookEntry::~BookEntry()
{
}
-amis::RecentBooks::RecentBooks()
+amis::BookList::BookList()
{
- mMax = 5;
+ mMax = 0;
mItems.clear();
}
-amis::RecentBooks::~RecentBooks()
+amis::BookList::~BookList()
{
cleanUpVector();
}
-
-//TODO: this doesn't seem to be cleaning things up very well .. I think that's why
-//RecentBooksFileIO (where objects are created) has memory leaks
-void amis::RecentBooks::cleanUpVector()
+void amis::BookList::cleanUpVector()
{
int sz = mItems.size();
- amis::RecentBookEntry* p_tmp;
+ amis::BookEntry* p_tmp;
for (int i = sz-1; i>=0; i--)
{
p_tmp = mItems[i];
@@ -57,47 +54,46 @@
}
}
-void amis::RecentBooks::setMaxItemsAllowed(unsigned int max)
+void amis::BookList::setMaxItemsAllowed(unsigned int max)
{
mMax = max;
}
-int amis::RecentBooks::getMaxItemsAllowed()
+int amis::BookList::getMaxItemsAllowed()
{
return mMax;
}
-int amis::RecentBooks::getNumberOfEntries()
+int amis::BookList::getNumberOfEntries()
{
return mItems.size();
}
-
-amis::RecentBookEntry* amis::RecentBooks::getEntry(unsigned int idx)
+void amis::BookList::setName(std::wstring name)
{
+ mName = name;
+}
+std::wstring amis::BookList::getName()
+{
+ return mName;
+}
+amis::BookEntry* amis::BookList::getEntry(unsigned int idx)
+{
if (idx >= 0 && idx < mItems.size())
- {
return mItems[idx];
- }
else
- {
return NULL;
- }
}
-void amis::RecentBooks::addEntry(amis::RecentBookEntry* pEntry)
+//TODO: check for duplicates via UID; replace old with new
+void amis::BookList::addEntry(amis::BookEntry* pEntry)
{
- amis::RecentBookEntry* p_tmp;
int n_duplicate = -1;
-
//first check for duplicates
if (mItems.size() > 0)
{
for (int i=0; i<mItems.size(); i++)
{
- p_tmp = mItems[i];
-
- if (p_tmp->mPath.same_document(pEntry->mPath) &&
- p_tmp->mBmkPath.same_document(pEntry->mBmkPath))
+ if (mItems[i]->mUid.compare(pEntry->mUid) == 0)
{
n_duplicate = i;
break;
@@ -107,9 +103,7 @@
//if we found a duplicate, delete it from its original position
//and add our new (identical) entry at the end of the list
if (n_duplicate > -1)
- {
deleteEntry(n_duplicate);
- }
}
//add the new entry
@@ -117,68 +111,48 @@
//make sure we are not over the max
//if so, remove the first (presumably oldest) entry
- if (mItems.size() > mMax)
- {
+ if (mItems.size() > mMax && mMax != 0)
deleteEntry(0);
- }
//only one book can be the last read book!
if (pEntry->mbIsLastRead == true)
{
- amis::RecentBookEntry* p_tmp = NULL;
-
+ amis::BookEntry* p_tmp = NULL;
for (unsigned int i = 0; i<mItems.size() - 1; i++)
{
p_tmp = mItems[i];
p_tmp->mbIsLastRead = false;
}
}
-
}
-void amis::RecentBooks::deleteEntry(unsigned int idx)
+void amis::BookList::deleteEntry(unsigned int idx)
{
- std::vector<amis::RecentBookEntry*>::iterator it;
+ std::vector<amis::BookEntry*>::iterator it;
if (idx < mItems.size() && idx >= 0)
{
it = mItems.begin() + idx;
-
mItems.erase(it);
}
}
-amis::RecentBookEntry* amis::RecentBooks::getLastRead()
+amis::BookEntry* amis::BookList::getLastRead()
{
- amis::RecentBookEntry* p_tmp = NULL;
-
+ amis::BookEntry* p_tmp = NULL;
for (unsigned int i = 0; i<mItems.size(); i++)
{
p_tmp = mItems[i];
- if (p_tmp->mbIsLastRead == true)
- {
- break;
- }
+ if (p_tmp->mbIsLastRead == true) break;
}
-
- //if for some reason no book matched the criteria, just return the last one in the list
- if (p_tmp == NULL)
- {
- if (mItems.size() > 0)
- {
- p_tmp = mItems[mItems.size() - 1];
- }
- }
-
return p_tmp;
-
}
-void amis::RecentBooks::setFilepath(const ambulant::net::url* pFilepath)
+void amis::BookList::setFilepath(const ambulant::net::url* pFilepath)
{
mFilepath = *pFilepath;
}
-const ambulant::net::url* amis::RecentBooks::getFilepath()
+const ambulant::net::url* amis::BookList::getFilepath()
{
return &mFilepath;
}
Modified: branches/amis3/AmisCore/src/io/RecentBooksFileIO.cpp
===================================================================
--- branches/amis3/AmisCore/src/io/RecentBooksFileIO.cpp 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/AmisCore/src/io/RecentBooksFileIO.cpp 2008-03-11 01:58:12 UTC (rev 2399)
@@ -54,40 +54,33 @@
using namespace std;
-amis::io::RecentBooksFileIO::RecentBooksFileIO()
+amis::io::BookListFileIO::BookListFileIO()
{
- mpRecentBooks = NULL;
+ mpBookList = NULL;
}
-amis::io::RecentBooksFileIO::~RecentBooksFileIO()
+amis::io::BookListFileIO::~BookListFileIO()
{
}
-amis::RecentBooks* amis::io::RecentBooksFileIO::getRecentBooks()
+amis::BookList* amis::io::BookListFileIO::getBookList()
{
- return mpRecentBooks;
+ return mpBookList;
}
-bool amis::io::RecentBooksFileIO::readFromFile(const ambulant::net::url* filepath)
+bool amis::io::BookListFileIO::readFromFile(const ambulant::net::url* filepath)
{
mpCurrentEntry = NULL;
- mpRecentBooks = new amis::RecentBooks();
- mb_flagGetChars = false;
- mpRecentBooks->setFilepath(filepath);
+ mpBookList->setFilepath(filepath);
if (!this->parseFile(filepath))
{
- delete mpRecentBooks;
+ delete mpBookList;
return false;
}
-
return true;
}
-
-//--------------------------------------------------
-//xerces start element event
-//--------------------------------------------------
-void amis::io::RecentBooksFileIO::startElement(const XMLCh* const uri,
+void amis::io::BookListFileIO::startElement(const XMLCh* const uri,
const XMLCh* const localname,
const XMLCh* const qname,
const Attributes& attributes)
@@ -95,74 +88,48 @@
char* element_name;
element_name = XMLString::transcode(qname);
- if (strcmp(element_name, "book") == 0)
+ if (strcmp(element_name, "bookList") == 0)
{
- //this gets reported as a leak, but recent book objects get deleted in RecentBooks::~RecentBooks
- //the caller (AmisApp.cpp in our case) is responsible for this
- mpCurrentEntry = new amis::RecentBookEntry();
+ mpBookList = new amis::BookList();
+ wstring tmp_wstr;
+ tmp_wstr.assign(SimpleAttrs::getw("name", &attributes));
+ mpBookList->setName(tmp_wstr);
+ int max;
string tmpstr;
+ tmpstr.assign(SimpleAttrs::get("maxLength", &attributes));
+ if (tmpstr.size() > 0) max = atoi(tmpstr.c_str());
+ else max = 0;
+ mpBookList->setMaxItemsAllowed(max);
+ }
+ else if (strcmp(element_name, "book") == 0)
+ {
+ mpCurrentEntry = new amis::BookEntry();
+ mpBookList->addEntry(mpCurrentEntry);
+
+ string tmpstr;
tmpstr.assign(SimpleAttrs::get("isLastRead", &attributes));
if (tmpstr.compare("yes") == 0)
mpCurrentEntry->mbIsLastRead = true;
else
mpCurrentEntry->mbIsLastRead = false;
- }
- else if(strcmp(element_name, "path") == 0)
- mb_flagGetChars = true;
- else if(strcmp(element_name, "bmkPath") == 0)
- mb_flagGetChars = true;
- XMLString::release(&element_name);
-}
+ wstring tmp_wstr;
+ tmp_wstr.assign(SimpleAttrs::getw("uid", &attributes));
+ mpCurrentEntry->mUid = tmp_wstr;
-//--------------------------------------------------
-//(SAX Event) close this element
-//--------------------------------------------------
-void amis::io::RecentBooksFileIO::endElement( const XMLCh* const uri,
- const XMLCh* const localname,
- const XMLCh* const qname)
-{
- char* element_name = XMLString::transcode(qname);
-
- if (strcmp(element_name, "book") == 0)
- {
- mpRecentBooks->addEntry(mpCurrentEntry);
+ tmpstr.assign(SimpleAttrs::get("href", &attributes));
+ mpCurrentEntry->mPath = ambulant::net::url::from_url(tmpstr);
}
- else if (strcmp(element_name, "path") == 0)
+ else if(strcmp(element_name, "bookmarks") == 0)
{
- //TODO: this gets reported as a leak -- unresolved
- mpCurrentEntry->mPath = ambulant::net::url::from_url(mTempChars);
- mb_flagGetChars = false;
+ string tmpstr;
+ tmpstr.assign(SimpleAttrs::get("href", &attributes));
+ mpCurrentEntry->mBmkPath = ambulant::net::url::from_url(tmpstr);
}
- else if(strcmp(element_name, "bmkPath") == 0)
- {
- //TODO: this gets reported as a leak -- unresolved
- mpCurrentEntry->mBmkPath = ambulant::net::url::from_url(mTempChars);
- mb_flagGetChars = false;
- }
-
- mTempChars.erase();
XMLString::release(&element_name);
}
-
-//--------------------------------------------------
-//xerces character data event
-//--------------------------------------------------
-void amis::io::RecentBooksFileIO::characters(const XMLCh *const chars, const unsigned int length)
+bool amis::io::BookListFileIO::writeToFile(const ambulant::net::url* filepath, amis::BookList* pFile)
{
- if (mb_flagGetChars == true)
- {
- if (mTempChars == "")
- {
- char* chardata = XMLString::transcode(chars);
- mTempChars.assign(chardata);
- XMLString::release(&chardata);
- }
- }
-}
-
-bool amis::io::RecentBooksFileIO::writeToFile(const ambulant::net::url* filepath, amis::RecentBooks* pFile)
-{
if (filepath != NULL && filepath->is_local_file() == false) return false;
// Initialize the XML4C2 system.
@@ -185,7 +152,7 @@
else
local_file_name = amis::util::FilePathTools::getAsLocalFilePath(pFile->getFilepath()->get_file());
- mpRecentBooks = pFile;
+ mpBookList = pFile;
int i;
//the DOM implementation pointer (this is part of how Xerces does things)
@@ -205,17 +172,25 @@
//Now create a document using the DOM implementation's createDocument method
mpDoc = pImpl->createDocument(
0, // root element namespace URI.
- X("recentBooks"), // root element name
+ X("bookList"), // root element name
0); // document type object (DTD).
+ DOMElement* p_root = mpDoc->getDocumentElement();
+ //add the root element attributes
+ if (mpBookList->getName().size() > 0)
+ p_root->setAttribute(X("name"), mpBookList->getName().c_str());
+ int max = mpBookList->getMaxItemsAllowed();
+ char temp[5];
+ itoa(max, temp, 5);
+ p_root->setAttribute(X("maxLength"), X(temp));
+
//start adding data to the DOM
- amis::RecentBookEntry* p_entry;
-
- for (i=0; i<mpRecentBooks->getNumberOfEntries(); i++)
+ amis::BookEntry* p_entry;
+ for (i=0; i<mpBookList->getNumberOfEntries(); i++)
{
- p_entry = mpRecentBooks->getEntry(i);
- writeRecentBookEntry(p_entry);
+ p_entry = mpBookList->getEntry(i);
+ writeBookEntry(p_entry);
}
@@ -271,30 +246,26 @@
return true;
}
-void amis::io::RecentBooksFileIO::writeRecentBookEntry(amis::RecentBookEntry* pEntry)
+void amis::io::BookListFileIO::writeBookEntry(amis::BookEntry* pEntry)
{
- if (pEntry == NULL)
- return;
+ if (pEntry == NULL) return;
//create the title
- DOMElement* p_book_elm = mpDoc->createElement(X("book"));
- DOMElement* p_book_path_elm = mpDoc->createElement(X("path"));
- DOMElement* p_bmk_path_elm = mpDoc->createElement(X("bmkPath"));
-
- DOMText* p_path_text = mpDoc->createTextNode(X(pEntry->mPath.get_url().c_str()));
- DOMText* p_bmk_path_text = mpDoc->createTextNode(X(pEntry->mBmkPath.get_url().c_str()));
-
+ DOMElement* p_book_elm = mpDoc->createElement(X("bookEntry"));
+ DOMElement* p_bmk_elm = NULL;
+ if (pEntry->mBmkPath.is_empty_path() == false)
+ {
+ p_bmk_elm = mpDoc->createElement(X("bookmarks"));
+ p_bmk_elm->setAttribute(X("href"), X(pEntry->mBmkPath.get_url().c_str()));
+ }
if (pEntry->mbIsLastRead == true)
p_book_elm->setAttribute(X("isLastRead"), X("yes"));
- else
- p_book_elm->setAttribute(X("isLastRead"), X("no"));
+
+ p_book_elm->setAttribute(X("uid"), pEntry->mUid.c_str());
+ p_book_elm->setAttribute(X("href"), X(pEntry->mPath.get_url().c_str()));
- p_book_path_elm->appendChild(p_path_text);
- p_bmk_path_elm->appendChild(p_bmk_path_text);
+ if (p_bmk_elm != NULL) p_book_elm->appendChild(p_bmk_elm);
- p_book_elm->appendChild(p_book_path_elm);
- p_book_elm->appendChild(p_bmk_path_elm);
-
DOMElement* p_root = mpDoc->getDocumentElement();
p_root->appendChild(p_book_elm);
}
Modified: branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h 2008-03-11 01:58:12 UTC (rev 2399)
@@ -62,7 +62,7 @@
virtual int ExitInstance();
const ambulant::net::url& getBookURL() const;
std::string getAppPath();
- amis::RecentBooks* getRecentBooks();
+ amis::BookList* getRecentBooks();
bool isBookOpen();
void setPauseState(bool play);
bool shouldIgnoreOpenDocEvent();
@@ -119,7 +119,7 @@
std::string mAppPath;
std::string mLocalizationDll;
ambulant::net::url mURL;
- amis::RecentBooks* mpRecentBooks;
+ amis::BookList* mpRecentBooks;
bool mbBookIsOpen;
bool mbShouldIgnoreOpenDocEvent;
bool mbWasLastExitClean;
Modified: branches/amis3/AmisGuiMFC2/src/DtbWithHooks.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/DtbWithHooks.cpp 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/AmisGuiMFC2/src/DtbWithHooks.cpp 2008-03-11 01:58:12 UTC (rev 2399)
@@ -196,12 +196,12 @@
void DtbWithHooks::addToRecentBooks()
{
- amis::RecentBooks* p_recent_books = NULL;
+ amis::BookList* p_recent_books = NULL;
p_recent_books = theApp.getRecentBooks();
if (p_recent_books != NULL)
{
- amis::RecentBookEntry* p_entry = new amis::RecentBookEntry();
+ amis::BookEntry* p_entry = new amis::BookEntry();
p_entry->mbIsLastRead = true;
p_entry->mBmkPath = *this->getFileSet()->getBookmarksFilepath();
@@ -212,7 +212,7 @@
p_recent_books->addEntry(p_entry);
- amis::io::RecentBooksFileIO io;
+ amis::io::BookListFileIO io;
io.writeToFile(p_recent_books->getFilepath(), p_recent_books);
amis::gui::MenuManip::Instance()->refreshRecentBooksListMenu();
Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-11 01:58:12 UTC (rev 2399)
@@ -304,8 +304,8 @@
string recent_books_path = "./settings/amisRecentBooks.xml";
recent_books_path = amis::util::FilePathTools::goRelativePath(theApp.getAppPath(), recent_books_path);
ambulant::net::url the_book_path = ambulant::net::url::from_filename(recent_books_path);
- amis::io::RecentBooksFileIO recent_books_io;
- if (recent_books_io.readFromFile(&the_book_path)) mpRecentBooks = recent_books_io.getRecentBooks();
+ amis::io::BookListFileIO recent_books_io;
+ if (recent_books_io.readFromFile(&the_book_path)) mpRecentBooks = recent_books_io.getBookList();
else mpRecentBooks = NULL;
}
@@ -355,7 +355,7 @@
return this->mURL;
}
-amis::RecentBooks* CAmisApp::getRecentBooks()
+amis::BookList* CAmisApp::getRecentBooks()
{
return mpRecentBooks;
}
@@ -497,7 +497,7 @@
UINT selection = id - AMIS_RECENT_BOOK_BASE_ID;
string filename = "";
- amis::RecentBookEntry* p_book = NULL;
+ amis::BookEntry* p_book = NULL;
p_book = mpRecentBooks->getEntry(selection);
string log_msg = "Loading recent book " + p_book->mPath.get_url();
amis::util::Log::Instance()->writeMessage("Loading recent book", &p_book->mPath, "CAmisApp::OnFileRecentBook", "AmisGuiMFC2");
@@ -541,11 +541,11 @@
amis::util::Log::Instance()->writeMessage("Closing book", "CAmisApp::OnFileClose", "AmisGuiMFC2");
if (mbBookIsOpen)
{
+ mbBookIsOpen = false;
//the order matters here
amis::dtb::DtbWithHooks::Instance()->DestroyInstance();
MainWndParts::Instance()->mpMmView->OnDestroy();
amis::gui::MainWndParts::Instance()->mpSidebar->m_wndDlg.clearAll();
- mbBookIsOpen = false;
}
}
Modified: branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp 2008-03-11 01:58:12 UTC (rev 2399)
@@ -86,7 +86,7 @@
for (int i=num_menu_items-1; i>=0; i--) p_menu->RemoveMenu(i, MF_BYPOSITION);
//re-add all entries
- amis::RecentBookEntry* p_entry = NULL;
+ amis::BookEntry* p_entry = NULL;
for (i=0; i<num_entries; i++)
{
p_entry = theApp.getRecentBooks()->getEntry(i);
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp 2008-03-11 01:58:12 UTC (rev 2399)
@@ -823,7 +823,7 @@
seq = new AudioSequence;
}
- amis::RecentBooks* books = theApp.getRecentBooks();
+ amis::BookList* books = theApp.getRecentBooks();
int nRecentBooks = (books ? books->getNumberOfEntries() : 0);
string strCondition;
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/MenuVoicing.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/MenuVoicing.cpp 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/MenuVoicing.cpp 2008-03-11 01:58:12 UTC (rev 2399)
@@ -322,7 +322,7 @@
TRACE(s);
- amis::RecentBooks* books = theApp.getRecentBooks();
+ amis::BookList* books = theApp.getRecentBooks();
int nRecentBooks = (books ? books->getNumberOfEntries() : 0);
if (nRecentBooks > 0 && (nItemID >= AMIS_RECENT_BOOK_BASE_ID &&
@@ -330,7 +330,7 @@
{
int idx = nItemID - AMIS_RECENT_BOOK_BASE_ID;
- amis::RecentBookEntry* p_entry = theApp.getRecentBooks()->getEntry(idx);
+ amis::BookEntry* p_entry = theApp.getRecentBooks()->getEntry(idx);
//DanTodo: surely, there must be a way to get a title instead of rendering the URL with TTS ??! (see bookmark methd commented below)
string str = p_entry->mPath.get_url();
Modified: branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp 2008-03-11 01:58:12 UTC (rev 2399)
@@ -116,6 +116,7 @@
void CAmisSidebar::OnSelchangeTree(NMHDR* pNMHDR, LRESULT* pResult)
{
+ if (theApp.isBookOpen() == false) return;
amis::dtb::nav::NavPoint* p_nav = NULL;
HTREEITEM item;
item = m_wndTree.GetSelectedItem();
@@ -127,11 +128,13 @@
//this function is triggered by CNavListControl objects
void CAmisSidebar::OnNavListSelect(NMHDR* pNMHDR, LRESULT* pResult, amis::dtb::nav::NavTarget* pData)
{
+ if (theApp.isBookOpen() == false) return;
if (pData != NULL) amis::dtb::DtbWithHooks::Instance()->loadNavNode(pData);
}
void CAmisSidebar::OnPageListClick(NMHDR* pNMHDR, LRESULT* pResult)
{
+ if (theApp.isBookOpen() == false) return;
amis::dtb::nav::PageTarget* p_page = NULL;
int curr_sel;
curr_sel = m_wndPageList.GetSelectionMark();
Modified: branches/amis3/bin/settings/amisRecentBooks.xml.default
===================================================================
--- branches/amis3/bin/settings/amisRecentBooks.xml.default 2008-03-10 18:44:53 UTC (rev 2398)
+++ branches/amis3/bin/settings/amisRecentBooks.xml.default 2008-03-11 01:58:12 UTC (rev 2399)
@@ -1 +1 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no" ?><recentBooks xmlns="http://amisproject.org"></recentBooks>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?><bookList xmlns="http://amisproject.org" name="Recent Books"></bookList>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-11 05:32:09
|
Revision: 2401
http://amis.svn.sourceforge.net/amis/?rev=2401&view=rev
Author: marisademeglio
Date: 2008-03-10 22:32:16 -0700 (Mon, 10 Mar 2008)
Log Message:
-----------
bookmarking now supported for books with non-ascii dc:identifier values
the recent books list has changed and is now a general history list. it keeps track of the book path, the uid, and the bookmark file path. this way, a bookmark file can be found by matching the uid of the book. this is also faster than searching the bookmark directory for a filename that looks like a match.
bookmark files are mangled programatically and so they should be consistently found even if the history list gets corrupted or disappears.
Modified Paths:
--------------
branches/amis3/AmisCore/AmisCore.vcproj
branches/amis3/AmisCore/include/dtb/Dtb.h
branches/amis3/AmisCore/include/dtb/DtbFileSet.h
branches/amis3/AmisCore/src/dtb/Dtb.cpp
branches/amis3/AmisCore/src/dtb/DtbFileSet.cpp
branches/amis3/AmisCore/src/io/BookmarksFileIO.cpp
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
branches/amis3/AmisGuiMFC2/include/DtbWithHooks.h
branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h
branches/amis3/AmisGuiMFC2/src/DtbWithHooks.cpp
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/MenuVoicing.cpp
branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp
branches/amis3/bin/settings/amisRecentBooks.xml.default
branches/amis3/bin/settings/makeLocalCopiesOfDefaults.bat
Added Paths:
-----------
branches/amis3/AmisCore/include/BookList.h
branches/amis3/AmisCore/include/io/BookListFileIO.h
branches/amis3/AmisCore/src/BookList.cpp
branches/amis3/AmisCore/src/io/BookListFileIO.cpp
Removed Paths:
-------------
branches/amis3/AmisCore/include/RecentBooks.h
branches/amis3/AmisCore/include/io/RecentBooksFileIO.h
branches/amis3/AmisCore/src/RecentBooks.cpp
branches/amis3/AmisCore/src/io/RecentBooksFileIO.cpp
Modified: branches/amis3/AmisCore/AmisCore.vcproj
===================================================================
--- branches/amis3/AmisCore/AmisCore.vcproj 2008-03-11 04:47:18 UTC (rev 2400)
+++ branches/amis3/AmisCore/AmisCore.vcproj 2008-03-11 05:32:16 UTC (rev 2401)
@@ -112,6 +112,9 @@
</FileConfiguration>
</File>
<File
+ RelativePath=".\src\BookList.cpp">
+ </File>
+ <File
RelativePath=".\src\Error.cpp">
<FileConfiguration
Name="Debug|Win32">
@@ -138,19 +141,13 @@
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
- <File
- RelativePath=".\src\RecentBooks.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
- </FileConfiguration>
- </File>
<Filter
Name="io"
Filter="">
<File
+ RelativePath=".\src\io\BookListFileIO.cpp">
+ </File>
+ <File
RelativePath=".\src\io\BookmarksFileIO.cpp">
<FileConfiguration
Name="Debug|Win32">
@@ -196,15 +193,6 @@
RelativePath=".\src\io\QuickDataSmilFileReader.cpp">
</File>
<File
- RelativePath=".\src\io\RecentBooksFileIO.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
- </FileConfiguration>
- </File>
- <File
RelativePath=".\src\io\SmilFileReader.cpp">
<FileConfiguration
Name="Debug|Win32">
@@ -493,6 +481,9 @@
RelativePath=".\include\AmisCore.h">
</File>
<File
+ RelativePath=".\include\BookList.h">
+ </File>
+ <File
RelativePath=".\include\Error.h">
</File>
<File
@@ -501,13 +492,13 @@
<File
RelativePath=".\include\ModuleDescData.h">
</File>
- <File
- RelativePath=".\include\RecentBooks.h">
- </File>
<Filter
Name="io"
Filter="">
<File
+ RelativePath=".\include\io\BookListFileIO.h">
+ </File>
+ <File
RelativePath=".\include\io\BookmarksFileIO.h">
</File>
<File
@@ -529,9 +520,6 @@
RelativePath=".\include\io\QuickDataSmilFileReader.h">
</File>
<File
- RelativePath=".\include\io\RecentBooksFileIO.h">
- </File>
- <File
RelativePath=".\include\io\SmilFileReader.h">
</File>
<File
Copied: branches/amis3/AmisCore/include/BookList.h (from rev 2399, branches/amis3/AmisCore/include/RecentBooks.h)
===================================================================
--- branches/amis3/AmisCore/include/BookList.h (rev 0)
+++ branches/amis3/AmisCore/include/BookList.h 2008-03-11 05:32:16 UTC (rev 2401)
@@ -0,0 +1,66 @@
+/*
+AMIS: Adaptive Multimedia Information System
+Software for playing DAISY books
+Homepage: http://amis.sf.net
+
+Copyright (C) 2004-2007 DAISY for All Project
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+#ifndef BOOKLIST_H
+#define BOOKLIST_H
+
+#include <string>
+#include <vector>
+#include "ambulant/net/url.h"
+
+using namespace std;
+
+namespace amis
+{
+class BookEntry
+{
+public:
+ BookEntry();
+ ~BookEntry();
+
+ std::wstring mUid;
+ ambulant::net::url mPath;
+ ambulant::net::url mBmkPath;
+ bool mbIsLastRead;
+};
+class BookList
+{
+public:
+ BookList();
+ ~BookList();
+ int getNumberOfEntries();
+ amis::BookEntry* getEntry(unsigned int);
+ void addEntry(amis::BookEntry*);
+ void deleteEntry(unsigned int);
+ amis::BookEntry* getLastRead();
+ const ambulant::net::url* getFilepath();
+ void setFilepath(const ambulant::net::url*);
+ void setName(std::wstring);
+ std::wstring getName();
+ amis::BookEntry* findByUid(wstring);
+private:
+ void cleanUpVector();
+ ambulant::net::url mFilepath;
+ vector<amis::BookEntry*> mItems;
+ std::wstring mName;
+};
+}
+#endif
Deleted: branches/amis3/AmisCore/include/RecentBooks.h
===================================================================
--- branches/amis3/AmisCore/include/RecentBooks.h 2008-03-11 04:47:18 UTC (rev 2400)
+++ branches/amis3/AmisCore/include/RecentBooks.h 2008-03-11 05:32:16 UTC (rev 2401)
@@ -1,68 +0,0 @@
-/*
-AMIS: Adaptive Multimedia Information System
-Software for playing DAISY books
-Homepage: http://amis.sf.net
-
-Copyright (C) 2004-2007 DAISY for All Project
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-#ifndef BOOKLIST_H
-#define BOOKLIST_H
-
-#include <string>
-#include <vector>
-#include "ambulant/net/url.h"
-
-using namespace std;
-
-namespace amis
-{
-class BookEntry
-{
-public:
- BookEntry();
- ~BookEntry();
-
- std::wstring mUid;
- ambulant::net::url mPath;
- ambulant::net::url mBmkPath;
- bool mbIsLastRead;
-};
-class BookList
-{
-public:
- BookList();
- ~BookList();
- int getNumberOfEntries();
- amis::BookEntry* getEntry(unsigned int);
- void addEntry(amis::BookEntry*);
- void deleteEntry(unsigned int);
- int getMaxItemsAllowed();
- void setMaxItemsAllowed(unsigned int);
- amis::BookEntry* getLastRead();
- const ambulant::net::url* getFilepath();
- void setFilepath(const ambulant::net::url*);
- void setName(std::wstring);
- std::wstring getName();
-private:
- void cleanUpVector();
- unsigned int mMax;
- ambulant::net::url mFilepath;
- vector<amis::BookEntry*> mItems;
- std::wstring mName;
-};
-}
-#endif
Modified: branches/amis3/AmisCore/include/dtb/Dtb.h
===================================================================
--- branches/amis3/AmisCore/include/dtb/Dtb.h 2008-03-11 04:47:18 UTC (rev 2400)
+++ branches/amis3/AmisCore/include/dtb/Dtb.h 2008-03-11 05:32:16 UTC (rev 2401)
@@ -45,8 +45,8 @@
Dtb();
~Dtb();
- bool open(const ambulant::net::url*, const ambulant::net::url*);
- bool open(string, string);
+ bool open(const ambulant::net::url*, const ambulant::net::url*, amis::BookList*);
+ bool open(string, string, amis::BookList*);
amis::dtb::smil::SmilMediaGroup* startReading(bool);
amis::dtb::smil::SmilMediaGroup* nextPhrase();
amis::dtb::smil::SmilMediaGroup* previousPhrase();
@@ -96,6 +96,7 @@
amis::dtb::BookmarkSet* mpBookmarks;
amis::dtb::CustomTestSet* mpCustomTests;
DtbFileSet* mpFiles;
+ amis::BookList* mpHistory;
std::wstring mUid;
amis::StringMap* mpTextSmilMap;
wstring mLastSearchString;
Modified: branches/amis3/AmisCore/include/dtb/DtbFileSet.h
===================================================================
--- branches/amis3/AmisCore/include/dtb/DtbFileSet.h 2008-03-11 04:47:18 UTC (rev 2400)
+++ branches/amis3/AmisCore/include/dtb/DtbFileSet.h 2008-03-11 05:32:16 UTC (rev 2401)
@@ -27,6 +27,7 @@
#include "AmisCore.h"
#include "ambulant/net/url.h"
#include "util/SearchForFiles.h"
+#include "BookList.h"
using namespace std;
@@ -46,7 +47,10 @@
static bool isOpfFile(const ambulant::net::url*);
//set additional information
void setBookmarksDirectory(const ambulant::net::url*);
- void setAdditionalDataAfterInitialParse(wstring, const ambulant::net::url*, const ambulant::net::url*);
+ void setAdditionalDataAfterInitialParse(wstring,
+ const ambulant::net::url*,
+ const ambulant::net::url*,
+ amis::BookList*);
//get data
const ambulant::net::url* getBookDirectory();
const ambulant::net::url* getNavFilepath();
Copied: branches/amis3/AmisCore/include/io/BookListFileIO.h (from rev 2399, branches/amis3/AmisCore/include/io/RecentBooksFileIO.h)
===================================================================
--- branches/amis3/AmisCore/include/io/BookListFileIO.h (rev 0)
+++ branches/amis3/AmisCore/include/io/BookListFileIO.h 2008-03-11 05:32:16 UTC (rev 2401)
@@ -0,0 +1,79 @@
+/*
+AMIS: Adaptive Multimedia Information System
+Software for playing DAISY books
+Homepage: http://amis.sf.net
+
+Copyright (C) 2004-2007 DAISY for All Project
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+#ifndef BOOKLISTFILEIO_H
+#define BOOKLISTFILEIO_H
+
+#include "BookList.h"
+#include "io/XercesSaxParseBase.h"
+
+#include <string>
+#include <vector>
+
+#include <xercesc/sax2/DefaultHandler.hpp>
+#include <xercesc/dom/DOM.hpp>
+#include <xercesc/parsers/XercesDOMParser.hpp>
+
+XERCES_CPP_NAMESPACE_USE
+
+XERCES_CPP_NAMESPACE_BEGIN
+class Attributes;
+XERCES_CPP_NAMESPACE_END
+
+namespace amis
+{
+namespace io
+{
+class BookListFileIO : public XercesSaxParseBase
+{
+public:
+ BookListFileIO();
+ ~BookListFileIO();
+
+ bool readFromFile(const ambulant::net::url*);
+ amis::BookList* getBookList();
+ //write the file to disk
+ bool writeToFile(const ambulant::net::url*, amis::BookList*);
+
+ void startElement(const XMLCh* const uri,
+ const XMLCh* const localname,
+ const XMLCh* const qname,
+ const Attributes& attributes);
+ void endElement(const XMLCh* const uri,
+ const XMLCh* const localname,
+ const XMLCh* const qname)
+ {/*we don't need this method*/}
+ void characters(const XMLCh *const, const unsigned int)
+ {/*we don't need this method*/}
+
+private:
+ void writeBookEntry(amis::BookEntry*);
+ ambulant::net::url mFilePath;
+ //the books list file object model
+ amis::BookList* mpBookList;
+ amis::BookEntry* mpCurrentEntry;
+ //The DOM document pointer
+ xercesc_2_7::DOMDocument* mpDoc;
+};
+}
+}
+
+#endif
Deleted: branches/amis3/AmisCore/include/io/RecentBooksFileIO.h
===================================================================
--- branches/amis3/AmisCore/include/io/RecentBooksFileIO.h 2008-03-11 04:47:18 UTC (rev 2400)
+++ branches/amis3/AmisCore/include/io/RecentBooksFileIO.h 2008-03-11 05:32:16 UTC (rev 2401)
@@ -1,79 +0,0 @@
-/*
-AMIS: Adaptive Multimedia Information System
-Software for playing DAISY books
-Homepage: http://amis.sf.net
-
-Copyright (C) 2004-2007 DAISY for All Project
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-#ifndef BOOKLISTFILEIO_H
-#define BOOKLISTFILEIO_H
-
-#include "RecentBooks.h"
-#include "io/XercesSaxParseBase.h"
-
-#include <string>
-#include <vector>
-
-#include <xercesc/sax2/DefaultHandler.hpp>
-#include <xercesc/dom/DOM.hpp>
-#include <xercesc/parsers/XercesDOMParser.hpp>
-
-XERCES_CPP_NAMESPACE_USE
-
-XERCES_CPP_NAMESPACE_BEGIN
-class Attributes;
-XERCES_CPP_NAMESPACE_END
-
-namespace amis
-{
-namespace io
-{
-class BookListFileIO : public XercesSaxParseBase
-{
-public:
- BookListFileIO();
- ~BookListFileIO();
-
- bool readFromFile(const ambulant::net::url*);
- amis::BookList* getBookList();
- //write the file to disk
- bool writeToFile(const ambulant::net::url*, amis::BookList*);
-
- void startElement(const XMLCh* const uri,
- const XMLCh* const localname,
- const XMLCh* const qname,
- const Attributes& attributes);
- void endElement(const XMLCh* const uri,
- const XMLCh* const localname,
- const XMLCh* const qname)
- {/*we don't need this method*/}
- void characters(const XMLCh *const, const unsigned int)
- {/*we don't need this method*/}
-
-private:
- void writeBookEntry(amis::BookEntry*);
- ambulant::net::url mFilePath;
- //the books list file object model
- amis::BookList* mpBookList;
- amis::BookEntry* mpCurrentEntry;
- //The DOM document pointer
- xercesc_2_7::DOMDocument* mpDoc;
-};
-}
-}
-
-#endif
Copied: branches/amis3/AmisCore/src/BookList.cpp (from rev 2399, branches/amis3/AmisCore/src/RecentBooks.cpp)
===================================================================
--- branches/amis3/AmisCore/src/BookList.cpp (rev 0)
+++ branches/amis3/AmisCore/src/BookList.cpp 2008-03-11 05:32:16 UTC (rev 2401)
@@ -0,0 +1,152 @@
+/*
+AMIS: Adaptive Multimedia Information System
+Software for playing DAISY books
+Homepage: http://amis.sf.net
+
+Copyright (C) 2004-2007 DAISY for All Project
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+#include "BookList.h"
+#include "util/FilePathTools.h"
+#include <iostream>
+using namespace std;
+
+amis::BookEntry::BookEntry()
+{
+ this->mbIsLastRead= false;
+}
+
+amis::BookEntry::~BookEntry()
+{
+}
+amis::BookList::BookList()
+{
+ mItems.clear();
+}
+
+amis::BookList::~BookList()
+{
+ cleanUpVector();
+}
+void amis::BookList::cleanUpVector()
+{
+ int sz = mItems.size();
+ amis::BookEntry* p_tmp;
+ for (int i = sz-1; i>=0; i--)
+ {
+ p_tmp = mItems[i];
+ mItems.pop_back();
+ if (p_tmp != NULL) delete p_tmp;
+ }
+}
+int amis::BookList::getNumberOfEntries()
+{
+ return mItems.size();
+}
+void amis::BookList::setName(std::wstring name)
+{
+ mName = name;
+}
+std::wstring amis::BookList::getName()
+{
+ return mName;
+}
+amis::BookEntry* amis::BookList::getEntry(unsigned int idx)
+{
+ if (idx >= 0 && idx < mItems.size())
+ return mItems[idx];
+ else
+ return NULL;
+}
+
+void amis::BookList::addEntry(amis::BookEntry* pEntry)
+{
+ int n_duplicate = -1;
+ //first check for duplicates
+ if (mItems.size() > 0)
+ {
+ for (int i=0; i<mItems.size(); i++)
+ {
+ if (mItems[i]->mUid.compare(pEntry->mUid) == 0 && mItems[i]->mUid.size() > 0)
+ {
+ n_duplicate = i;
+ break;
+ }
+ }
+
+ //if we found a duplicate, delete it from its original position
+ //and add our new (identical) entry at the end of the list
+ if (n_duplicate > -1)
+ deleteEntry(n_duplicate);
+ }
+
+ //add the new entry
+ mItems.push_back(pEntry);
+
+ //only one book can be the last read book!
+ if (pEntry->mbIsLastRead == true)
+ {
+ amis::BookEntry* p_tmp = NULL;
+ for (unsigned int i = 0; i<mItems.size() - 1; i++)
+ {
+ p_tmp = mItems[i];
+ p_tmp->mbIsLastRead = false;
+ }
+ }
+}
+void amis::BookList::deleteEntry(unsigned int idx)
+{
+ std::vector<amis::BookEntry*>::iterator it;
+
+ if (idx < mItems.size() && idx >= 0)
+ {
+ it = mItems.begin() + idx;
+ mItems.erase(it);
+ }
+}
+
+amis::BookEntry* amis::BookList::getLastRead()
+{
+ amis::BookEntry* p_tmp = NULL;
+ for (unsigned int i = 0; i<mItems.size(); i++)
+ {
+ p_tmp = mItems[i];
+ if (p_tmp->mbIsLastRead == true) break;
+ }
+ return p_tmp;
+}
+
+void amis::BookList::setFilepath(const ambulant::net::url* pFilepath)
+{
+ mFilepath = *pFilepath;
+}
+
+const ambulant::net::url* amis::BookList::getFilepath()
+{
+ return &mFilepath;
+}
+
+amis::BookEntry* amis::BookList::findByUid(wstring uid)
+{
+ for (int i=0; i<mItems.size(); i++)
+ {
+ if (mItems[i]->mUid.compare(uid) == 0 && uid.size() > 0)
+ {
+ return mItems[i];
+ }
+ }
+ return NULL;
+}
\ No newline at end of file
Deleted: branches/amis3/AmisCore/src/RecentBooks.cpp
===================================================================
--- branches/amis3/AmisCore/src/RecentBooks.cpp 2008-03-11 04:47:18 UTC (rev 2400)
+++ branches/amis3/AmisCore/src/RecentBooks.cpp 2008-03-11 05:32:16 UTC (rev 2401)
@@ -1,158 +0,0 @@
-/*
-AMIS: Adaptive Multimedia Information System
-Software for playing DAISY books
-Homepage: http://amis.sf.net
-
-Copyright (C) 2004-2007 DAISY for All Project
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-#include "RecentBooks.h"
-#include "util/FilePathTools.h"
-#include <iostream>
-using namespace std;
-
-amis::BookEntry::BookEntry()
-{
- this->mbIsLastRead= false;
-}
-
-amis::BookEntry::~BookEntry()
-{
-}
-amis::BookList::BookList()
-{
- mMax = 0;
- mItems.clear();
-}
-
-amis::BookList::~BookList()
-{
- cleanUpVector();
-}
-void amis::BookList::cleanUpVector()
-{
- int sz = mItems.size();
- amis::BookEntry* p_tmp;
- for (int i = sz-1; i>=0; i--)
- {
- p_tmp = mItems[i];
- mItems.pop_back();
- if (p_tmp != NULL) delete p_tmp;
- }
-}
-
-void amis::BookList::setMaxItemsAllowed(unsigned int max)
-{
- mMax = max;
-}
-
-int amis::BookList::getMaxItemsAllowed()
-{
- return mMax;
-}
-
-int amis::BookList::getNumberOfEntries()
-{
- return mItems.size();
-}
-void amis::BookList::setName(std::wstring name)
-{
- mName = name;
-}
-std::wstring amis::BookList::getName()
-{
- return mName;
-}
-amis::BookEntry* amis::BookList::getEntry(unsigned int idx)
-{
- if (idx >= 0 && idx < mItems.size())
- return mItems[idx];
- else
- return NULL;
-}
-
-//TODO: check for duplicates via UID; replace old with new
-void amis::BookList::addEntry(amis::BookEntry* pEntry)
-{
- int n_duplicate = -1;
- //first check for duplicates
- if (mItems.size() > 0)
- {
- for (int i=0; i<mItems.size(); i++)
- {
- if (mItems[i]->mUid.compare(pEntry->mUid) == 0)
- {
- n_duplicate = i;
- break;
- }
- }
-
- //if we found a duplicate, delete it from its original position
- //and add our new (identical) entry at the end of the list
- if (n_duplicate > -1)
- deleteEntry(n_duplicate);
- }
-
- //add the new entry
- mItems.push_back(pEntry);
-
- //make sure we are not over the max
- //if so, remove the first (presumably oldest) entry
- if (mItems.size() > mMax && mMax != 0)
- deleteEntry(0);
-
- //only one book can be the last read book!
- if (pEntry->mbIsLastRead == true)
- {
- amis::BookEntry* p_tmp = NULL;
- for (unsigned int i = 0; i<mItems.size() - 1; i++)
- {
- p_tmp = mItems[i];
- p_tmp->mbIsLastRead = false;
- }
- }
-}
-void amis::BookList::deleteEntry(unsigned int idx)
-{
- std::vector<amis::BookEntry*>::iterator it;
-
- if (idx < mItems.size() && idx >= 0)
- {
- it = mItems.begin() + idx;
- mItems.erase(it);
- }
-}
-
-amis::BookEntry* amis::BookList::getLastRead()
-{
- amis::BookEntry* p_tmp = NULL;
- for (unsigned int i = 0; i<mItems.size(); i++)
- {
- p_tmp = mItems[i];
- if (p_tmp->mbIsLastRead == true) break;
- }
- return p_tmp;
-}
-
-void amis::BookList::setFilepath(const ambulant::net::url* pFilepath)
-{
- mFilepath = *pFilepath;
-}
-
-const ambulant::net::url* amis::BookList::getFilepath()
-{
- return &mFilepath;
-}
Modified: branches/amis3/AmisCore/src/dtb/Dtb.cpp
===================================================================
--- branches/amis3/AmisCore/src/dtb/Dtb.cpp 2008-03-11 04:47:18 UTC (rev 2400)
+++ branches/amis3/AmisCore/src/dtb/Dtb.cpp 2008-03-11 05:32:16 UTC (rev 2401)
@@ -105,6 +105,7 @@
mpTitle = NULL;
mpTextSmilMap = NULL;
mpCustomTests = NULL;
+ mpHistory = NULL;
mUid.erase();
mDaisyVersion = UNSUPPORTED;
@@ -153,19 +154,21 @@
//--------------------------------------------------
//wrapper for opening files
//--------------------------------------------------
-bool amis::dtb::Dtb::open(string filepath, string bookmarksDirectory)
+bool amis::dtb::Dtb::open(string filepath, string bookmarksDirectory, amis::BookList* history)
{
ambulant::net::url fileUrl = ambulant::net::url::from_url(filepath);
ambulant::net::url bookmarksDirUrl = ambulant::net::url::from_url(bookmarksDirectory);
-
- return open(&fileUrl, &bookmarksDirUrl);
+ return open(&fileUrl, &bookmarksDirUrl, history);
}
//--------------------------------------------------
//open an NCC or OPF file
//--------------------------------------------------
-bool amis::dtb::Dtb::open(const ambulant::net::url* fileUrl, const ambulant::net::url* bookmarksDirectory)
+bool amis::dtb::Dtb::open(const ambulant::net::url* fileUrl,
+ const ambulant::net::url* bookmarksDirectory,
+ amis::BookList* history)
{
cleanUpObjects();
+ mpHistory = history;
string log_msg = "Opening book: " + fileUrl->get_url();
amis::util::Log::Instance()->writeMessage(log_msg, "Dtb::open", "AmisCore");
@@ -314,7 +317,7 @@
//TODO: get the audio for the title (author audio not available in Daisy 202)
- mpFiles->setAdditionalDataAfterInitialParse(this->mUid, NULL, NULL);
+ mpFiles->setAdditionalDataAfterInitialParse(mUid, NULL, NULL, mpHistory);
amis::dtb::nav::ResolveSmilDataVisitor resolve_smil_visitor;
resolve_smil_visitor.resolve(mpNavModel, mpSpine, true);
this->mpTextSmilMap = resolve_smil_visitor.getSmilTextMap();
@@ -392,7 +395,7 @@
const ambulant::net::url* txtfile = opf_file_reader.getTextFilename();
mUid = getUid();
- mpFiles->setAdditionalDataAfterInitialParse(mUid, navfile, resfile);
+ mpFiles->setAdditionalDataAfterInitialParse(mUid, navfile, resfile, mpHistory);
mpFiles->setTextFile(txtfile);
return true;
}
Modified: branches/amis3/AmisCore/src/dtb/DtbFileSet.cpp
===================================================================
--- branches/amis3/AmisCore/src/dtb/DtbFileSet.cpp 2008-03-11 04:47:18 UTC (rev 2400)
+++ branches/amis3/AmisCore/src/dtb/DtbFileSet.cpp 2008-03-11 05:32:16 UTC (rev 2401)
@@ -73,13 +73,29 @@
}
//after the caller has parsed the ncc or opf file, additional data is available
-void amis::dtb::DtbFileSet::setAdditionalDataAfterInitialParse(wstring uid, const ambulant::net::url* navfile, const ambulant::net::url* resourcefile)
+void amis::dtb::DtbFileSet::setAdditionalDataAfterInitialParse(wstring uid,
+ const ambulant::net::url* navfile,
+ const ambulant::net::url* resourcefile,
+ amis::BookList* bookmarkHistory)
{
if (uid.size() > 0)
{
- std::string thefilename = calculateSafeBookmarksFilename(uid);
- mBookmarksFilepath = ambulant::net::url::from_filename(thefilename);//calculateSafeBookmarksFilename(uid));
- mBookmarksFilepath = mBookmarksFilepath.join_to_base(mBookmarksDirectory);
+ amis::BookEntry* p_entry = NULL;
+ //try to find the book in the history and grab its bookmarks filepath
+ if (bookmarkHistory != NULL)
+ {
+ p_entry = bookmarkHistory->findByUid(uid);
+ if (p_entry != NULL && p_entry->mBmkPath.is_empty_path() == false)
+ mBookmarksFilepath = p_entry->mBmkPath;
+ }
+ //if the bookmarks filepath wasn't found, then calculate it
+ //it will be recorded in the history list by the main application
+ if (mBookmarksFilepath.is_empty_path() == true)
+ {
+ std::string thefilename = calculateSafeBookmarksFilename(uid);
+ mBookmarksFilepath = ambulant::net::url::from_filename(thefilename);
+ mBookmarksFilepath = mBookmarksFilepath.join_to_base(mBookmarksDirectory);
+ }
}
else
{
@@ -170,44 +186,51 @@
return false;
}
-//TODO: make up a safe name if the book has no UID
string amis::dtb::DtbFileSet::calculateSafeBookmarksFilename(wstring uid)
{
#if defined(AMIS_COMPILER_MSVC)
//windows utility for converting wstring to string
USES_CONVERSION;
#endif
- string safe_filename;
+ string proposed_filename;
#if defined(AMIS_COMPILER_MSVC)
- safe_filename.assign(T2A(uid.c_str()));
+ proposed_filename.assign(T2A(uid.c_str()));
#elif defined(AMIS_COMPILER_GCC)
-//medtest safe_filename.assign(uid.c_str());
-safe_filename.assign("the_bookmark_filename");
+ //TODO: something for other platforms
+ proposed_filename.assign("the_bookmark_file");
#endif
-
- //replace all / \ , ; : (special chars) with '__' (double underscore)
- for (unsigned int i=0; i<safe_filename.length(); i++)
+
+ string safe_filename;
+ //make sure the bookmark filename contains only ASCII A-Z, 1-9 characters and hyphens
+ for (unsigned int i=0; i<proposed_filename.length(); i++)
{
- if (safe_filename[i] == '\\')
- safe_filename.replace(i, 1, "__");
-
- else if(safe_filename[i] == '/')
- safe_filename.replace(i, 1, "__");
+ int c = proposed_filename[i];
+ /*the safe values of ASCII characters are:
+ 32 (space)
+ 45 (hyphen)
+ 46 (period)
+ 95 (underscore)
+ 48 through 57 (0 through 9)
+ 65 through 90 (A through Z)
+ 97 through 122 (a through z)
+ */
+ if (c == 32 || c == 45 || c == 46 || c == 95
+ || (c >= 48 && c <= 57)
+ || (c >= 65 && c <= 90)
+ || (c >=97 && c<=122))
+ {
+ safe_filename += proposed_filename[i];
+ }
+ else
+ {
+ //use the character code directly (or an underscore)
+ char ch[3];
+ itoa(c, ch, 10);
+ safe_filename.append(ch);
+ }
+ }
- else if(safe_filename[i] == ',')
- safe_filename.replace(i, 1, "__");
-
- else if(safe_filename[i] == ';')
- safe_filename.replace(i, 1, "__");
-
- else if(safe_filename[i] == ':')
- safe_filename.replace(i, 1, "__");
- else if(safe_filename[i] == ' ')
- safe_filename.replace(i, 1, "__");
- }
-
safe_filename.append(".bmk");
-
return safe_filename;
}
Copied: branches/amis3/AmisCore/src/io/BookListFileIO.cpp (from rev 2399, branches/amis3/AmisCore/src/io/RecentBooksFileIO.cpp)
===================================================================
--- branches/amis3/AmisCore/src/io/BookListFileIO.cpp (rev 0)
+++ branches/amis3/AmisCore/src/io/BookListFileIO.cpp 2008-03-11 05:32:16 UTC (rev 2401)
@@ -0,0 +1,264 @@
+/*
+AMIS: Adaptive Multimedia Information System
+Software for playing DAISY books
+Homepage: http://amis.sf.net
+
+Copyright (C) 2004-2007 DAISY...
[truncated message content] |
|
From: <mar...@us...> - 2008-03-13 23:44:12
|
Revision: 2405
http://amis.svn.sourceforge.net/amis/?rev=2405&view=rev
Author: marisademeglio
Date: 2008-03-13 16:44:17 -0700 (Thu, 13 Mar 2008)
Log Message:
-----------
Updates to text style dialog. It's almost working.
Modified Paths:
--------------
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h
branches/amis3/AmisGuiMFC2/include/gui/TextRenderBrain.h
branches/amis3/AmisGuiMFC2/include/gui/dialogs/TextStyleDialog.h
branches/amis3/AmisGuiMFC2/include/util/Color.h
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp
branches/amis3/AmisGuiMFC2/src/gui/dialogs/TextStyleDialog.cpp
branches/amis3/AmisGuiMFC2/src/util/Color.cpp
branches/amis3/bin/settings/css/amis.css
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
===================================================================
(Binary files differ)
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-12 03:45:11 UTC (rev 2404)
+++ branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-13 23:44:17 UTC (rev 2405)
@@ -418,17 +418,18 @@
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Font:",IDC_FONTLABEL,7,7,155,12
- COMBOBOX IDC_FONT,7,20,155,30,CBS_DROPDOWN | CBS_SORT |
+ COMBOBOX IDC_FONT,7,20,155,63,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
LTEXT "Highlighted text color:",IDC_HIGHLIGHTFOREGROUNDLABEL,7,
45,155,11
- COMBOBOX IDC_HIGHLIGHTFOREGROUND,7,57,155,30,CBS_DROPDOWN |
- CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_HIGHLIGHTFOREGROUND,7,57,155,63,CBS_DROPDOWN |
+ WS_VSCROLL | WS_TABSTOP
LTEXT "Highlight background color:",
IDC_HIGHLIGHTBACKGROUNDLABEL,7,83,156,8
- COMBOBOX IDC_HIGHLIGHTBACKGROUND,7,98,156,12,CBS_DROPDOWN |
- CBS_SORT | WS_VSCROLL | WS_TABSTOP
- EDITTEXT IDC_TEXTSTYLEPREVIEW,211,7,175,135,ES_AUTOHSCROLL
+ COMBOBOX IDC_HIGHLIGHTBACKGROUND,7,98,156,52,CBS_DROPDOWN |
+ WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDC_TEXTSTYLEPREVIEW,211,7,175,135,ES_MULTILINE |
+ ES_AUTOHSCROLL
DEFPUSHBUTTON "OK",IDOK,39,128,50,14
PUSHBUTTON "Cancel",IDCANCEL,101,128,50,14
END
Modified: branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h 2008-03-12 03:45:11 UTC (rev 2404)
+++ branches/amis3/AmisGuiMFC2/include/gui/AmisApp.h 2008-03-13 23:44:17 UTC (rev 2405)
@@ -106,6 +106,7 @@
afx_msg void OnClearPageStyle();
afx_msg void OnApplyPageStyle(UINT);
afx_msg void OnNextPageStyle();
+ afx_msg void OnShowTextStyle();
protected:
HMENU m_hMDIMenu;
HACCEL m_hMDIAccel;
Modified: branches/amis3/AmisGuiMFC2/include/gui/TextRenderBrain.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/TextRenderBrain.h 2008-03-12 03:45:11 UTC (rev 2404)
+++ branches/amis3/AmisGuiMFC2/include/gui/TextRenderBrain.h 2008-03-13 23:44:17 UTC (rev 2405)
@@ -56,6 +56,7 @@
void gotoUriTarget(amis::TextNode*);
void gotoUriTarget(std::string url);
+ void saveDefaultCss();
void applyPageStyle(int);
void clearPageStyle();
void applyNextPageStyle();
Modified: branches/amis3/AmisGuiMFC2/include/gui/dialogs/TextStyleDialog.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/dialogs/TextStyleDialog.h 2008-03-12 03:45:11 UTC (rev 2404)
+++ branches/amis3/AmisGuiMFC2/include/gui/dialogs/TextStyleDialog.h 2008-03-13 23:44:17 UTC (rev 2405)
@@ -24,6 +24,7 @@
#include "gui/dialogs/AmisDialogBase.h"
#include "../resource.h"
+#include "util/Color.h"
BOOL CALLBACK EnumFontCallback (LPLOGFONT, LPTEXTMETRIC, DWORD, LPARAM);
@@ -33,14 +34,15 @@
{
namespace dialogs
{
-
class TextStyleDialog : public AmisDialogBase
{
public:
TextStyleDialog(CWnd* pParent = NULL);
~TextStyleDialog();
enum { IDD = IDD_TEXTSTYLE };
-
+ amis::util::Color getHighlightForegroundColor();
+ amis::util::Color getHighlightBackgroundColor();
+ std::string getFontName();
protected:
void initializeCombos();
virtual BOOL OnInitDialog();
@@ -54,6 +56,10 @@
protected:
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
+private:
+ amis::util::Color mHighlightBG;
+ amis::util::Color mHighlightFG;
+ std::string mFontName;
};
}
}
Modified: branches/amis3/AmisGuiMFC2/include/util/Color.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/util/Color.h 2008-03-12 03:45:11 UTC (rev 2404)
+++ branches/amis3/AmisGuiMFC2/include/util/Color.h 2008-03-13 23:44:17 UTC (rev 2405)
@@ -41,6 +41,7 @@
Color(COLORREF);
void set(std::string);
void set(COLORREF);
+ void setWithHtmlName(std::string);
COLORREF getAsColorRef();
std::string getAsHtmlHexColor();
std::string getHexValueForNamedColor(std::string);
Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-12 03:45:11 UTC (rev 2404)
+++ branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-13 23:44:17 UTC (rev 2405)
@@ -54,6 +54,7 @@
#include "gui/dialogs/MultipleBooksOnVolumeDialog.h"
#include "gui/dialogs/PreferencesDialog.h"
#include "gui/dialogs/PublicationSummaryDialog.h"
+#include "gui/dialogs/TextStyleDialog.h"
#include "gui/self-voicing/directshow/dx_audio_player.h"
@@ -113,6 +114,7 @@
ON_COMMAND(ID_AMIS_NO_PAGE_STYLES, OnClearPageStyle)
ON_COMMAND_RANGE(AMIS_PAGE_STYLE_BASE_ID, AMIS_PAGE_STYLE_BASE_ID + AMIS_MAX_ANYTHING, OnApplyPageStyle)
ON_COMMAND(ID_AMIS_NEXT_PAGE_STYLE, OnNextPageStyle)
+ ON_COMMAND(ID_AMIS_SHOW_TEXTSTYLE, OnShowTextStyle)
END_MESSAGE_MAP()
CAmisApp::CAmisApp()
@@ -809,6 +811,19 @@
{
TextRenderBrain::Instance()->applyNextPageStyle();
}
+void CAmisApp::OnShowTextStyle()
+{
+ amis::gui::dialogs::TextStyleDialog dlg;
+ if (dlg.DoModal() == IDOK)
+ {
+ Preferences::Instance()->mHighlightBG = dlg.getHighlightBackgroundColor();
+ Preferences::Instance()->mHighlightFG = dlg.getHighlightForegroundColor();
+ Preferences::Instance()->mFontName = dlg.getFontName();
+ TextRenderBrain::Instance()->saveDefaultCss();
+ TextRenderBrain::Instance()->redoPageColors();
+ }
+}
+
/***************************************************
* (MED) I moved these functions out of the menu handler area
*****************************************************/
Modified: branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp 2008-03-12 03:45:11 UTC (rev 2404)
+++ branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp 2008-03-13 23:44:17 UTC (rev 2405)
@@ -288,6 +288,22 @@
{
return mCurrentStyleIdx;
}
+//take the values in Preferences and write them to file
+void TextRenderBrain::saveDefaultCss()
+{
+ string fg = Preferences::Instance()->mHighlightFG.getAsHtmlHexColor();
+ string bg = Preferences::Instance()->mHighlightBG.getAsHtmlHexColor();
+ string font = Preferences::Instance()->mFontName;
+ ofstream cssfile;
+ cssfile.open(Preferences::Instance()->getAmisCssFile()->get_file().c_str(), ios::out);
+ cssfile<<"/*default CSS sheet*/"<<endl;
+ cssfile<<"/*DO NOT EDIT! YOUR CHANGES WILL BE LOST!*/"<<endl;
+ cssfile<<"/*\"amis-highlight\" is a reserved word that AMIS will look for to find the highlight colors*/"<<endl;
+ cssfile<<"/*use the body element selector to specify what font you want, etc. AMIS will pick up the font family for the body element and use it in the sidebar*/"<<endl;
+ cssfile<<".amis-highlight {color: "<<fg<<"; background-color: "<<bg<<";}"<<endl;
+ cssfile<<"body {font-family: "<<font<<";}"<<endl;
+ cssfile.close();
+}
void TextRenderBrain::applyPageStyle(int idx)
{
clearPageStyle();
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/TextStyleDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/TextStyleDialog.cpp 2008-03-12 03:45:11 UTC (rev 2404)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/TextStyleDialog.cpp 2008-03-13 23:44:17 UTC (rev 2405)
@@ -26,6 +26,7 @@
#include "AmisCore.h"
#include "util/Color.h"
#include "Preferences.h"
+#include "..\..\..\include\gui\dialogs\textstyledialog.h"
using namespace amis::gui::dialogs;
@@ -38,7 +39,7 @@
ON_CBN_SETFOCUS(IDC_HIGHLIGHTFOREGROUND, OnCbnSetfocusHighlightForeground)
ON_CBN_SELCHANGE(IDC_HIGHLIGHTBACKGROUND, OnCbnSelchangeHighlightBackground)
ON_CBN_SETFOCUS(IDC_HIGHLIGHTBACKGROUND, OnCbnSetfocusHighlightBackground)
- ON_WM_PAINT()
+ ON_WM_PAINT()
END_MESSAGE_MAP()
BOOL CALLBACK EnumFontCallback (LPLOGFONT lplf, LPTEXTMETRIC lptm, DWORD dwType, LPARAM lpData)
@@ -57,6 +58,9 @@
}
BOOL TextStyleDialog::OnInitDialog()
{
+ mFontName = Preferences::Instance()->mFontName;
+ mHighlightBG = Preferences::Instance()->mHighlightBG;
+ mHighlightFG = Preferences::Instance()->mHighlightFG;
initializeCombos();
return CDialog::OnInitDialog();
}
@@ -77,14 +81,16 @@
int background_sel = -1;
int i = 0;
amis::StringMap::iterator it = p_all_colors->begin();
+ std::string highlight_bg = Preferences::Instance()->mHighlightBG.getAsHtmlHexColor();
+ std::string highlight_fg = Preferences::Instance()->mHighlightFG.getAsHtmlHexColor();
while (it != p_all_colors->end())
{
CString label = A2T(it->first.c_str());
p_foreground_list->AddString(label);
p_background_list->AddString(label);
- if (it->second == Preferences::Instance()->mHighlightBG.getAsHtmlHexColor())
+ if (it->second == highlight_bg)
background_sel = i;
- if (it->second == Preferences::Instance()->mHighlightFG.getAsHtmlHexColor())
+ if (it->second == highlight_fg)
foreground_sel = i;
i++;
it++;
@@ -93,7 +99,7 @@
p_background_list->SetCurSel(background_sel);
CClientDC dc(this);
- EnumFonts (dc, 0,(FONTENUMPROC)EnumFontCallback,(LPARAM)this);
+ EnumFonts (dc, 0,(FONTENUMPROC)EnumFontCallback,(LPARAM)this->GetDlgItem(IDC_FONT));
}
void TextStyleDialog::OnPaint()
{
@@ -124,22 +130,55 @@
return AmisDialogBase::PreTranslateMessage(pMsg);
}
+amis::util::Color TextStyleDialog::getHighlightForegroundColor()
+{
+ return mHighlightFG;
+}
+
+amis::util::Color TextStyleDialog::getHighlightBackgroundColor()
+{
+ return mHighlightBG;
+}
+
+std::string TextStyleDialog::getFontName()
+{
+ return mFontName;
+}
+
//widget event handlers
void TextStyleDialog::OnCbnSelchangeFont()
{
+ USES_CONVERSION;
+ CString tmp;
+ CComboBox* p_font_list = (CComboBox*)GetDlgItem(IDC_FONT);
+ p_font_list->GetWindowText(tmp);
+ mFontName = T2A(tmp);
}
void TextStyleDialog::OnCbnSetfocusFont()
{
}
void TextStyleDialog::OnCbnSelchangeHighlightForeground()
{
+ USES_CONVERSION;
+ CString tmp;
+ CComboBox* p_foreground_list = (CComboBox*)GetDlgItem(IDC_HIGHLIGHTFOREGROUND);
+
+ p_foreground_list->GetWindowText(tmp);
+ if (tmp == "") tmp = "black";
+ mHighlightFG.setWithHtmlName(T2A(tmp));
}
void TextStyleDialog::OnCbnSetfocusHighlightForeground()
{
}
void TextStyleDialog::OnCbnSelchangeHighlightBackground()
{
+ USES_CONVERSION;
+ CString tmp;
+ CComboBox* p_background_list = (CComboBox*)GetDlgItem(IDC_HIGHLIGHTBACKGROUND);
+ p_background_list->GetWindowText(tmp);
+ if (tmp == "") tmp = "yellow";
+ mHighlightBG.setWithHtmlName(T2A(tmp));
}
void TextStyleDialog::OnCbnSetfocusHighlightBackground()
{
-}
\ No newline at end of file
+}
Modified: branches/amis3/AmisGuiMFC2/src/util/Color.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/util/Color.cpp 2008-03-12 03:45:11 UTC (rev 2404)
+++ branches/amis3/AmisGuiMFC2/src/util/Color.cpp 2008-03-13 23:44:17 UTC (rev 2405)
@@ -192,6 +192,11 @@
mColor = htmlToRgb(value);
}
+void Color::setWithHtmlName(std::string value)
+{
+ mColorHtml = mColorHexMap[value];
+ mColor = htmlToRgb(value);
+}
void Color::set(COLORREF value)
{
mColor = value;
Modified: branches/amis3/bin/settings/css/amis.css
===================================================================
--- branches/amis3/bin/settings/css/amis.css 2008-03-12 03:45:11 UTC (rev 2404)
+++ branches/amis3/bin/settings/css/amis.css 2008-03-13 23:44:17 UTC (rev 2405)
@@ -1,5 +1,6 @@
/*default CSS sheet*/
+/*DO NOT EDIT! YOUR CHANGES WILL BE LOST!*/
/*"amis-highlight" is a reserved word that AMIS will look for to find the highlight colors*/
/*use the body element selector to specify what font you want, etc. AMIS will pick up the font family for the body element and use it in the sidebar*/
-.amis-highlight {color: black; background-color: yellow}
-body {font-family: arial, verdana, sans-serif;}
\ No newline at end of file
+.amis-highlight {color: #000000; background-color: #FFFF00;}
+body {font-family: verdana;}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-15 18:39:53
|
Revision: 2406
http://amis.svn.sourceforge.net/amis/?rev=2406&view=rev
Author: marisademeglio
Date: 2008-03-15 11:39:57 -0700 (Sat, 15 Mar 2008)
Log Message:
-----------
ultimately decided to do something simple for the text style dialog
Modified Paths:
--------------
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
branches/amis3/AmisGuiMFC2/include/Preferences.h
branches/amis3/AmisGuiMFC2/include/gui/TextRenderBrain.h
branches/amis3/AmisGuiMFC2/include/gui/dialogs/TextStyleDialog.h
branches/amis3/AmisGuiMFC2/include/util/Color.h
branches/amis3/AmisGuiMFC2/resource.h
branches/amis3/AmisGuiMFC2/src/Preferences.cpp
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp
branches/amis3/AmisGuiMFC2/src/gui/dialogs/TextStyleDialog.cpp
branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp
branches/amis3/AmisGuiMFC2/src/util/Color.cpp
branches/amis3/bin/settings/amisPrefs.xml.default
branches/amis3/bin/settings/css/amis.css
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
===================================================================
(Binary files differ)
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-15 18:39:57 UTC (rev 2406)
@@ -147,7 +147,7 @@
IDD_TEXTSTYLE, DIALOG
BEGIN
LEFTMARGIN, 7
- RIGHTMARGIN, 386
+ RIGHTMARGIN, 165
TOPMARGIN, 7
BOTTOMMARGIN, 142
END
@@ -411,13 +411,13 @@
PUSHBUTTON "Cancel",IDCANCEL,112,202,50,14
END
-IDD_TEXTSTYLE DIALOGEX 0, 0, 393, 149
+IDD_TEXTSTYLE DIALOGEX 0, 0, 172, 149
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "Text Style"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- LTEXT "Font:",IDC_FONTLABEL,7,7,155,12
+ LTEXT "Sidebar font:",IDC_FONTLABEL,7,7,155,12
COMBOBOX IDC_FONT,7,20,155,63,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
LTEXT "Highlighted text color:",IDC_HIGHLIGHTFOREGROUNDLABEL,7,
@@ -428,10 +428,8 @@
IDC_HIGHLIGHTBACKGROUNDLABEL,7,83,156,8
COMBOBOX IDC_HIGHLIGHTBACKGROUND,7,98,156,52,CBS_DROPDOWN |
WS_VSCROLL | WS_TABSTOP
- EDITTEXT IDC_TEXTSTYLEPREVIEW,211,7,175,135,ES_MULTILINE |
- ES_AUTOHSCROLL
- DEFPUSHBUTTON "OK",IDOK,39,128,50,14
- PUSHBUTTON "Cancel",IDCANCEL,101,128,50,14
+ DEFPUSHBUTTON "OK",IDOK,30,128,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,94,128,50,14
END
Modified: branches/amis3/AmisGuiMFC2/include/Preferences.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/Preferences.h 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/AmisGuiMFC2/include/Preferences.h 2008-03-15 18:39:57 UTC (rev 2406)
@@ -35,18 +35,8 @@
{
protected:
Preferences();
-
+
public:
- //these should be private some day
- //these values come from TextRenderBrain after it parses amis.css
- util::Color mHighlightFG;
- util::Color mHighlightBG;
- std::string mFontName;
- util::Color mPageFG;
- util::Color mPageBG;
- int mFontSize;
-
-public:
static Preferences* Instance();
void DestroyInstance();
~Preferences();
@@ -54,6 +44,7 @@
void scanAll();
void logAllPreferences();
void logUserControllablePreferences();
+
//ACCESSORS
void setUiLangId(string);
string getUiLangId();
@@ -106,6 +97,13 @@
void setSourceUrl(const ambulant::net::url*);
const ambulant::net::url* getSourceUrl();
+ void setHighlightBGColor(amis::util::Color);
+ amis::util::Color getHighlightBGColor();
+ void setHighlightFGColor(amis::util::Color);
+ amis::util::Color getHighlightFGColor();
+ void setSidebarFontName(std::string);
+ std::string getSidebarFontName();
+
amis::UrlList* getFontsizeCssFiles();
amis::UrlList* getCustomCssFiles();
amis::StringModuleMap* getInstalledLanguages();
@@ -115,7 +113,7 @@
void scanDirectoriesForCssFiles();
void scanDirectoriesForLanguagePackFiles();
void processLanguagePackModuleDescData(amis::ModuleDescData*);
-
+
string mUiLangId;
bool mbStartInBasicView;
bool mbLoadLastBook;
@@ -126,6 +124,9 @@
bool mbWasExitClean;
bool mbHighlightText;
bool mbDisableScreensaver;
+ util::Color mHighlightFG;
+ util::Color mHighlightBG;
+ std::string mSidebarFontName;
ambulant::net::url mUserBmkDir;
ambulant::net::url mLangpacksDir;
ambulant::net::url mFontsizeCssDir;
Modified: branches/amis3/AmisGuiMFC2/include/gui/TextRenderBrain.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/TextRenderBrain.h 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/AmisGuiMFC2/include/gui/TextRenderBrain.h 2008-03-15 18:39:57 UTC (rev 2406)
@@ -56,7 +56,6 @@
void gotoUriTarget(amis::TextNode*);
void gotoUriTarget(std::string url);
- void saveDefaultCss();
void applyPageStyle(int);
void clearPageStyle();
void applyNextPageStyle();
@@ -74,7 +73,6 @@
void setHighlightColors(IHTMLElement*);
void redoHighlightColors();
bool isElementInView(IHTMLElement*);
- void scanStylesheetForAdditionalData(IHTMLStyleSheet*);
IHTMLElement* GetElementFromId(string id, const GUID *iid);
IHTMLDocument2* GetDoc();
@@ -88,7 +86,7 @@
VARIANT mUnhighlightedFG;
IHTMLStyleSheet* mpFontCss;
IHTMLStyleSheet* mpStyleCss;
- IHTMLStyleSheet* mpUserCss;
+ IHTMLStyleSheet* mpAmisCss;
int mCurrentStyleIdx;
bool mbStyleOn;
private:
Modified: branches/amis3/AmisGuiMFC2/include/gui/dialogs/TextStyleDialog.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/dialogs/TextStyleDialog.h 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/AmisGuiMFC2/include/gui/dialogs/TextStyleDialog.h 2008-03-15 18:39:57 UTC (rev 2406)
@@ -40,9 +40,6 @@
TextStyleDialog(CWnd* pParent = NULL);
~TextStyleDialog();
enum { IDD = IDD_TEXTSTYLE };
- amis::util::Color getHighlightForegroundColor();
- amis::util::Color getHighlightBackgroundColor();
- std::string getFontName();
protected:
void initializeCombos();
virtual BOOL OnInitDialog();
@@ -56,10 +53,8 @@
protected:
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
-private:
- amis::util::Color mHighlightBG;
- amis::util::Color mHighlightFG;
- std::string mFontName;
+protected:
+ virtual void OnOK();
};
}
}
Modified: branches/amis3/AmisGuiMFC2/include/util/Color.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/util/Color.h 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/AmisGuiMFC2/include/util/Color.h 2008-03-15 18:39:57 UTC (rev 2406)
@@ -37,6 +37,7 @@
std::string mColorHtml;
public:
Color();
+ //needs a hex value
Color(std::string);
Color(COLORREF);
void set(std::string);
Modified: branches/amis3/AmisGuiMFC2/resource.h
===================================================================
--- branches/amis3/AmisGuiMFC2/resource.h 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/AmisGuiMFC2/resource.h 2008-03-15 18:39:57 UTC (rev 2406)
@@ -79,6 +79,8 @@
#define IDC_HIGHLIGHTFOREGROUNDLABEL 1110
#define IDC_HIGHLIGHTBACKGROUNDLABEL 1111
#define IDC_TEXTSTYLEPREVIEW 1112
+#define IDC_TEXTPREVIEW 1113
+#define IDC_EDIT1 1114
#define SELF_VOICING_PLAY_NEXT 6969
#define IDC_CURRLANG 9002
#define IDC_VERSION 9006
@@ -132,7 +134,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 193
#define _APS_NEXT_COMMAND_VALUE 32954
-#define _APS_NEXT_CONTROL_VALUE 1113
+#define _APS_NEXT_CONTROL_VALUE 1115
#define _APS_NEXT_SYMED_VALUE 143
#endif
#endif
Modified: branches/amis3/AmisGuiMFC2/src/Preferences.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/Preferences.cpp 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/AmisGuiMFC2/src/Preferences.cpp 2008-03-15 18:39:57 UTC (rev 2406)
@@ -63,7 +63,7 @@
mCustomCssDir = ambulant::net::url::from_filename("./settings/css/contrast/");
mLangpacksDir = ambulant::net::url::from_filename("./settings/lang/");
mUserBmkDir = ambulant::net::url::from_filename("./settings/bmk/");
- mAmisCssFile = ambulant::net::url::from_filename("./settings/css/default.css");
+ mAmisCssFile = ambulant::net::url::from_filename("./settings/css/amis.css");
mZed2005CssFile = ambulant::net::url::from_filename("./settings/css/dtbook.2005.basic.css");
ambulant::net::url app_path = ambulant::net::url::from_filename(theApp.getAppPath());
@@ -74,9 +74,9 @@
mAmisCssFile = mAmisCssFile.join_to_base(app_path);
mZed2005CssFile = mZed2005CssFile.join_to_base(app_path);
- mHighlightFG.set("000000");
- mHighlightBG.set("FFFF00");
- mFontName = "Arial";
+ mHighlightFG.set("#000000");
+ mHighlightBG.set("#FFFF00");
+ mSidebarFontName = "Arial";
}
//this function should be called after the preferences XML file has been parsed
@@ -86,7 +86,6 @@
scanDirectoriesForLanguagePackFiles();
}
-
void Preferences::scanDirectoriesForCssFiles()
{
amis::util::SearchForFilesMFC searcher;
@@ -368,7 +367,30 @@
amis::ModuleDescData* p_data = mInstalledLanguages[mUiLangId];
return p_data;
}
-
+void Preferences::setHighlightBGColor(amis::util::Color value)
+{
+ mHighlightBG = value;
+}
+amis::util::Color Preferences::getHighlightBGColor()
+{
+ return mHighlightBG;
+}
+void Preferences::setHighlightFGColor(amis::util::Color value)
+{
+ mHighlightFG = value;
+}
+amis::util::Color Preferences::getHighlightFGColor()
+{
+ return mHighlightFG;
+}
+void Preferences::setSidebarFontName(std::string value)
+{
+ mSidebarFontName = value;
+}
+std::string Preferences::getSidebarFontName()
+{
+ return mSidebarFontName;
+}
void Preferences::logAllPreferences()
{
amis::util::Log* p_log = amis::util::Log::Instance();
Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-15 18:39:57 UTC (rev 2406)
@@ -816,10 +816,6 @@
amis::gui::dialogs::TextStyleDialog dlg;
if (dlg.DoModal() == IDOK)
{
- Preferences::Instance()->mHighlightBG = dlg.getHighlightBackgroundColor();
- Preferences::Instance()->mHighlightFG = dlg.getHighlightForegroundColor();
- Preferences::Instance()->mFontName = dlg.getFontName();
- TextRenderBrain::Instance()->saveDefaultCss();
TextRenderBrain::Instance()->redoPageColors();
}
}
Modified: branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp 2008-03-15 18:39:57 UTC (rev 2406)
@@ -63,7 +63,7 @@
mpFontCss = NULL;
mpStyleCss = NULL;
- mpUserCss = NULL;
+ mpAmisCss = NULL;
}
TextRenderBrain::~TextRenderBrain()
@@ -133,9 +133,8 @@
{
if (mbWaitForDocumentLoad)
{
- mpUserCss = MainWndParts::Instance()->mpHtmlView->applyStylesheet
+ mpAmisCss = MainWndParts::Instance()->mpHtmlView->applyStylesheet
(Preferences::Instance()->getAmisCssFile());
- scanStylesheetForAdditionalData(mpUserCss);
//TODO: does this ever work? need to test more books.
if (amis::dtb::DtbWithHooks::Instance()->getDaisyVersion() == amis::dtb::DAISY_2005)
MainWndParts::Instance()->mpHtmlView->applyStylesheet(Preferences::Instance()->getZed2005CssFile());
@@ -266,8 +265,8 @@
VariantInit(&var_fg);
//get as strings from the preferences for highlight values
- str_text_fg = amis::Preferences::Instance()->mHighlightFG.getAsHtmlHexColor();
- str_text_bg = amis::Preferences::Instance()->mHighlightBG.getAsHtmlHexColor();
+ str_text_fg = amis::Preferences::Instance()->getHighlightFGColor().getAsHtmlHexColor();
+ str_text_bg = amis::Preferences::Instance()->getHighlightBGColor().getAsHtmlHexColor();
//convert to chars
const char* textfg_color = str_text_fg.c_str();
@@ -288,22 +287,6 @@
{
return mCurrentStyleIdx;
}
-//take the values in Preferences and write them to file
-void TextRenderBrain::saveDefaultCss()
-{
- string fg = Preferences::Instance()->mHighlightFG.getAsHtmlHexColor();
- string bg = Preferences::Instance()->mHighlightBG.getAsHtmlHexColor();
- string font = Preferences::Instance()->mFontName;
- ofstream cssfile;
- cssfile.open(Preferences::Instance()->getAmisCssFile()->get_file().c_str(), ios::out);
- cssfile<<"/*default CSS sheet*/"<<endl;
- cssfile<<"/*DO NOT EDIT! YOUR CHANGES WILL BE LOST!*/"<<endl;
- cssfile<<"/*\"amis-highlight\" is a reserved word that AMIS will look for to find the highlight colors*/"<<endl;
- cssfile<<"/*use the body element selector to specify what font you want, etc. AMIS will pick up the font family for the body element and use it in the sidebar*/"<<endl;
- cssfile<<".amis-highlight {color: "<<fg<<"; background-color: "<<bg<<";}"<<endl;
- cssfile<<"body {font-family: "<<font<<";}"<<endl;
- cssfile.close();
-}
void TextRenderBrain::applyPageStyle(int idx)
{
clearPageStyle();
@@ -313,7 +296,6 @@
ambulant::net::url url = (*list)[idx];
mCurrentStyleIdx = idx;
mpStyleCss = MainWndParts::Instance()->mpHtmlView->applyStylesheet(&url);
- scanStylesheetForAdditionalData(mpStyleCss);
}
void TextRenderBrain::applyNextPageStyle()
@@ -394,7 +376,6 @@
{
css_url = &(*Preferences::Instance()->getFontsizeCssFiles())[fontsz - 1];
mpFontCss = MainWndParts::Instance()->mpHtmlView->applyStylesheet(css_url);
- scanStylesheetForAdditionalData(mpFontCss);
}
else
{
@@ -509,8 +490,8 @@
VariantInit(&var_fg);
//get as strings
- str_text_fg = amis::Preferences::Instance()->mHighlightFG.getAsHtmlHexColor();
- str_text_bg = amis::Preferences::Instance()->mHighlightBG.getAsHtmlHexColor();
+ str_text_fg = amis::Preferences::Instance()->getHighlightFGColor().getAsHtmlHexColor();
+ str_text_bg = amis::Preferences::Instance()->getHighlightBGColor().getAsHtmlHexColor();
//convert to chars
const char* textfg_color = str_text_fg.c_str();
@@ -631,91 +612,3 @@
//otherwise we assume it's in view
return true;
}
-
-//use the COM interface to get at the details of this stylesheet and apply them to the sidebar too
-//it also gets the highlight colors for the main window from a selector called .amis-highlight
-void TextRenderBrain::scanStylesheetForAdditionalData(IHTMLStyleSheet* pStylesheet)
-{
- USES_CONVERSION;
- //all the stupid COM objects...
- IHTMLStyleSheetRulesCollection* p_rules;
- long len;
- IHTMLStyleSheetRule* p_rule;
-
- if (!SUCCEEDED(pStylesheet->get_rules(&p_rules))) return;
- if (!SUCCEEDED(p_rules->get_length(&len)))
- {
- p_rules->Release();
- return;
- }
-
- for (long i = 0; i<len; i++)
- {
- //get a single style rule
- if (!SUCCEEDED(p_rules->item(i, &p_rule))) continue;
-
- //get the rule's selector
- BSTR selector_text;
- if (!SUCCEEDED(p_rule->get_selectorText(&selector_text))) continue;
- string str_selector_text = OLE2A(selector_text);
-
- //this gives the highlight colors
- if (!str_selector_text.compare(".amis-highlight"))
- {
- IHTMLRuleStyle* p_rule_style;
- if (SUCCEEDED(p_rule->get_style(&p_rule_style)))
- {
- VARIANT highlight_bg, highlight_fg;
- VariantInit(&highlight_bg);
- VariantInit(&highlight_fg);
- p_rule_style->get_backgroundColor(&highlight_bg);
- p_rule_style->get_color(&highlight_fg);
- util::Color dummy_color;
- string fg_color = dummy_color.getHexValueForNamedColor(OLE2A(highlight_fg.bstrVal));
- string bg_color = dummy_color.getHexValueForNamedColor(OLE2A(highlight_bg.bstrVal));
- Preferences::Instance()->mHighlightBG.set(bg_color);
- Preferences::Instance()->mHighlightFG.set(fg_color);
- p_rule_style->Release();
- }
- }
- else if (!str_selector_text.compare("body"))
- {
- IHTMLRuleStyle* p_rule_style;
- if (SUCCEEDED(p_rule->get_style(&p_rule_style)))
- {
- VARIANT page_bg, page_fg, font_size;
- BSTR font_family;
- VariantInit(&page_bg);
- VariantInit(&page_fg);
- VariantInit(&font_size);
- p_rule_style->get_backgroundColor(&page_bg);
- p_rule_style->get_color(&page_fg);
- p_rule_style->get_fontFamily(&font_family);
- p_rule_style->get_fontSize(&font_size);
-
- util::Color dummy_color;
- string fg_color = dummy_color.getHexValueForNamedColor(OLE2A(page_fg.bstrVal));
- string bg_color = dummy_color.getHexValueForNamedColor(OLE2A(page_bg.bstrVal));
- string font_name = OLE2A(font_family);
- //font names could look like "arial, verdana, sans-serif;"
- //just grab the first one
- if (font_name.find(",") != std::string::npos)
- {
- int pos = font_name.find(",");
- font_name = font_name.substr(0, pos);
- }
- //int pct_font_size = amis::util::CssUtil::getAsPercentValue(OLE2A(font_size.bstrVal));
-
- Preferences::Instance()->mPageBG.set(bg_color);
- Preferences::Instance()->mPageFG.set(fg_color);
- Preferences::Instance()->mFontName = font_name;
- //Preferences::Instance()->mFontSize = pct_font_size;
- p_rule_style->Release();
- }
- }
- p_rule->Release();
-
- } //end for-loop through the rules collection
- p_rules->Release();
-}
-
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/TextStyleDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/TextStyleDialog.cpp 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/TextStyleDialog.cpp 2008-03-15 18:39:57 UTC (rev 2406)
@@ -44,8 +44,14 @@
BOOL CALLBACK EnumFontCallback (LPLOGFONT lplf, LPTEXTMETRIC lptm, DWORD dwType, LPARAM lpData)
{
+ USES_CONVERSION;
CComboBox* p_font_list = (CComboBox*)lpData;
int index = p_font_list->AddString(lplf->lfFaceName);
+ std::string font = T2A(lplf->lfFaceName);
+ if (font.compare(amis::Preferences::Instance()->getSidebarFontName()) == 0)
+ {
+ p_font_list->SetCurSel(index);
+ }
return TRUE;
}
@@ -58,9 +64,6 @@
}
BOOL TextStyleDialog::OnInitDialog()
{
- mFontName = Preferences::Instance()->mFontName;
- mHighlightBG = Preferences::Instance()->mHighlightBG;
- mHighlightFG = Preferences::Instance()->mHighlightFG;
initializeCombos();
return CDialog::OnInitDialog();
}
@@ -76,13 +79,12 @@
amis::StringMap* p_all_colors = dummy_color.getColorHexMap();
//the current values all come from Preferences
- //TODO: save them to file
int foreground_sel = -1;
int background_sel = -1;
int i = 0;
amis::StringMap::iterator it = p_all_colors->begin();
- std::string highlight_bg = Preferences::Instance()->mHighlightBG.getAsHtmlHexColor();
- std::string highlight_fg = Preferences::Instance()->mHighlightFG.getAsHtmlHexColor();
+ std::string highlight_bg = Preferences::Instance()->getHighlightBGColor().getAsHtmlHexColor();
+ std::string highlight_fg = Preferences::Instance()->getHighlightFGColor().getAsHtmlHexColor();
while (it != p_all_colors->end())
{
CString label = A2T(it->first.c_str());
@@ -130,55 +132,47 @@
return AmisDialogBase::PreTranslateMessage(pMsg);
}
-amis::util::Color TextStyleDialog::getHighlightForegroundColor()
-{
- return mHighlightFG;
-}
-
-amis::util::Color TextStyleDialog::getHighlightBackgroundColor()
-{
- return mHighlightBG;
-}
-
-std::string TextStyleDialog::getFontName()
-{
- return mFontName;
-}
-
//widget event handlers
void TextStyleDialog::OnCbnSelchangeFont()
{
- USES_CONVERSION;
- CString tmp;
- CComboBox* p_font_list = (CComboBox*)GetDlgItem(IDC_FONT);
- p_font_list->GetWindowText(tmp);
- mFontName = T2A(tmp);
}
void TextStyleDialog::OnCbnSetfocusFont()
{
}
void TextStyleDialog::OnCbnSelchangeHighlightForeground()
{
- USES_CONVERSION;
- CString tmp;
- CComboBox* p_foreground_list = (CComboBox*)GetDlgItem(IDC_HIGHLIGHTFOREGROUND);
-
- p_foreground_list->GetWindowText(tmp);
- if (tmp == "") tmp = "black";
- mHighlightFG.setWithHtmlName(T2A(tmp));
}
void TextStyleDialog::OnCbnSetfocusHighlightForeground()
{
}
void TextStyleDialog::OnCbnSelchangeHighlightBackground()
{
+}
+void TextStyleDialog::OnCbnSetfocusHighlightBackground()
+{
+
+}
+void amis::gui::dialogs::TextStyleDialog::OnOK()
+{
USES_CONVERSION;
CString tmp;
+ CComboBox* p_font_list = (CComboBox*)GetDlgItem(IDC_FONT);
+ p_font_list->GetWindowText(tmp);
+ Preferences::Instance()->setSidebarFontName(T2A(tmp));
+
CComboBox* p_background_list = (CComboBox*)GetDlgItem(IDC_HIGHLIGHTBACKGROUND);
p_background_list->GetWindowText(tmp);
if (tmp == "") tmp = "yellow";
- mHighlightBG.setWithHtmlName(T2A(tmp));
+ amis::util::Color bg_clr;
+ bg_clr.setWithHtmlName(T2A(tmp));
+ Preferences::Instance()->setHighlightBGColor(bg_clr);
+
+ CComboBox* p_foreground_list = (CComboBox*)GetDlgItem(IDC_HIGHLIGHTFOREGROUND);
+ p_foreground_list->GetWindowText(tmp);
+ if (tmp == "") tmp = "black";
+ amis::util::Color fg_clr;
+ fg_clr.setWithHtmlName(T2A(tmp));
+ Preferences::Instance()->setHighlightFGColor(fg_clr);
+
+ AmisDialogBase::OnOK();
}
-void TextStyleDialog::OnCbnSetfocusHighlightBackground()
-{
-}
Modified: branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp 2008-03-15 18:39:57 UTC (rev 2406)
@@ -202,6 +202,20 @@
file = file.join_to_base(source_url);
mpPrefs->setUserBmkDir(&file);
}
+ else if (id.compare("highlight-fg-color") == 0)
+ {
+ amis::util::Color c(value);
+ mpPrefs->setHighlightFGColor(c);
+ }
+ else if (id.compare("highlight-bg-color") == 0)
+ {
+ amis::util::Color c(value);
+ mpPrefs->setHighlightBGColor(c);
+ }
+ else if (id.compare("sidebar-font-name") == 0)
+ {
+ mpPrefs->setSidebarFontName(value);
+ }
}
@@ -324,6 +338,15 @@
pEntry = createEntry("custom-css-dir", mpPrefs->getCustomCssDir()->get_file());
pGeneralSection->appendChild((DOMNode*)pEntry);
+ pEntry = createEntry("highlight-fg-color", mpPrefs->getHighlightFGColor().getAsHtmlHexColor());
+ pGeneralSection->appendChild((DOMNode*)pEntry);
+
+ pEntry = createEntry("highlight-bg-color", mpPrefs->getHighlightBGColor().getAsHtmlHexColor());
+ pGeneralSection->appendChild((DOMNode*)pEntry);
+
+ pEntry = createEntry("sidebar-font-name", mpPrefs->getSidebarFontName());
+ pGeneralSection->appendChild((DOMNode*)pEntry);
+
//get a pointer to the root element
DOMElement* pRootElem = mpDoc->getDocumentElement();
//append the general section element
Modified: branches/amis3/AmisGuiMFC2/src/util/Color.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/util/Color.cpp 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/AmisGuiMFC2/src/util/Color.cpp 2008-03-15 18:39:57 UTC (rev 2406)
@@ -235,12 +235,11 @@
wblue = A2CW(clr.substr(4, 2).c_str());
- int iRed = _httoi(wred.c_str());//_httoi((LPCTSTR)red.c_str());
+ int iRed = _httoi(wred.c_str());
int iGreen = _httoi(wgreen.c_str());
int iBlue = _httoi(wblue.c_str());
return RGB(iRed, iGreen, iBlue);
-
}
//function taken from http://www.codeproject.com/string/hexstrtoint.asp
Modified: branches/amis3/bin/settings/amisPrefs.xml.default
===================================================================
--- branches/amis3/bin/settings/amisPrefs.xml.default 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/bin/settings/amisPrefs.xml.default 2008-03-15 18:39:57 UTC (rev 2406)
@@ -18,5 +18,8 @@
<entry id="custom-css-dir" value="./css/customStyles/"/>
<entry id="amis-css-file" value="./css/amis.css"/>
<entry id="zed-2005-css-file" value="./css/dtbook.2005.basic.css"/>
+<entry id="highlight-fg-color"value="#FFFFFF"/>
+<entry id="highlight-bg-color" value="#FFFF00"/>
+<entry id="sidebar-font-name" value="Verdana"/>
</section>
</preferences>
Modified: branches/amis3/bin/settings/css/amis.css
===================================================================
--- branches/amis3/bin/settings/css/amis.css 2008-03-13 23:44:17 UTC (rev 2405)
+++ branches/amis3/bin/settings/css/amis.css 2008-03-15 18:39:57 UTC (rev 2406)
@@ -1,6 +1 @@
-/*default CSS sheet*/
-/*DO NOT EDIT! YOUR CHANGES WILL BE LOST!*/
-/*"amis-highlight" is a reserved word that AMIS will look for to find the highlight colors*/
-/*use the body element selector to specify what font you want, etc. AMIS will pick up the font family for the body element and use it in the sidebar*/
-.amis-highlight {color: #000000; background-color: #FFFF00;}
-body {font-family: verdana;}
+/*put default style preferences here*/
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-16 06:13:14
|
Revision: 2407
http://amis.svn.sourceforge.net/amis/?rev=2407&view=rev
Author: marisademeglio
Date: 2008-03-15 23:13:20 -0700 (Sat, 15 Mar 2008)
Log Message:
-----------
text style dialog finished (also in amisAccessibleUi.xml)
highlight colors and sidebar font can be controlled via the TextStyleDialog
Modified Paths:
--------------
branches/amis3/AmisGuiMFC2/include/gui/sidebar/AmisSidebar.h
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp
branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp
branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebarLoader.cpp
branches/amis3/DefaultLangpack/amisAccessibleUi.xml
Modified: branches/amis3/AmisGuiMFC2/include/gui/sidebar/AmisSidebar.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/sidebar/AmisSidebar.h 2008-03-15 18:39:57 UTC (rev 2406)
+++ branches/amis3/AmisGuiMFC2/include/gui/sidebar/AmisSidebar.h 2008-03-16 06:13:20 UTC (rev 2407)
@@ -30,10 +30,13 @@
#include "gui/sidebar/cdxCDynamicBar.h"
#include "gui/sidebar/NavListControl.h"
#include "dtb/nav/NavTarget.h"
+#include "util/Color.h"
#include <vector>
#include <string>
+#define AMIS_SIDEBAR_SMALLEST_FONT_SIZE 100
+#define AMIS_SIDEBAR_BIGGEST_FONT_SIZE 400
namespace amis
{
namespace gui
@@ -43,42 +46,39 @@
class CAmisSidebar: public cdxCDynamicBarDlg
{
public:
- CAmisSidebar(CWnd* pParent = NULL); // standard constructor
+ CAmisSidebar(CWnd* pParent = NULL);
~CAmisSidebar();
CNavListControl* addNavListWidget();
void addTab(std::wstring);
- //void nextSection();
- //void previousSection();
void expandAllSections();
void expandSections(int level);
int getExposedDepth();
void clearAll();
-
- //{{AFX_DATA(CAmisSidebar)
+ void setHighlightBGColor(amis::util::Color);
+ void setHighlightFGColor(amis::util::Color);
+ void setPageBGColor(amis::util::Color);
+ void setPageFGColor(amis::util::Color);
+ void setFontName(std::string);
+ void setFontSize(double);
+
enum { IDD = IDD_SIDEBAR };
- CTabCtrl m_wndTab;
- CTreeCtrl m_wndTree;
+ CTabCtrl m_wndTab;
+ CTreeCtrl m_wndTree;
CListCtrl m_wndPageList;
- int m_iSel;
- //}}AFX_DATA
+ int m_iSel;
- //{{AFX_MSG(CAmisSidebar)
afx_msg void OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchangeTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnNavListSelect(NMHDR* pNMHDR, LRESULT* pResult, amis::dtb::nav::NavTarget* pData);
afx_msg void OnPageListClick(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnPageListKeyDown(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnLvnItemchangedListPage(NMHDR *pNMHDR, LRESULT *pResult);
- //}}AFX_MSG
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CAmisSidebar)
- protected:
+
+protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL PreTranslateMessage(MSG* pMsg);
- //}}AFX_VIRTUAL
-
+ virtual BOOL OnInitDialog();
+
private:
void showPageList();
void showNavList(unsigned int);
@@ -93,17 +93,13 @@
int mNumTabs;
int mExposedDepth;
bool mIsShiftDown;
- bool mIsControlDown;
+ bool mIsControlDown;
+ CFont mDefaultFont;
+ CFont* mpAlteredFont;
+ int mFontSizeInPoints;
-
-// Implementation
-protected:
- // Generated message map functions
- //{{AFX_MSG(CAmisSidebar)
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
DECLARE_MESSAGE_MAP();
-
+
friend class AmisSidebarLoader;
};
}
Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-15 18:39:57 UTC (rev 2406)
+++ branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-16 06:13:20 UTC (rev 2407)
@@ -817,6 +817,7 @@
if (dlg.DoModal() == IDOK)
{
TextRenderBrain::Instance()->redoPageColors();
+ MainWndParts::Instance()->mpSidebar->m_wndDlg.setFontName(Preferences::Instance()->getSidebarFontName());
}
}
Modified: branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp 2008-03-15 18:39:57 UTC (rev 2406)
+++ branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp 2008-03-16 06:13:20 UTC (rev 2407)
@@ -371,6 +371,12 @@
//remove the old stylesheet
MainWndParts::Instance()->mpHtmlView->removeStylesheet(mpFontCss);
+ //apply the size change to the sidebar
+ double d_fontsz = fontsz;
+ double d_max = Preferences::Instance()->getFontsizeCssFiles()->size();
+ double pct = d_fontsz/d_max;
+ MainWndParts::Instance()->mpSidebar->m_wndDlg.setFontSize(pct);
+
ambulant::net::url* css_url = NULL;
if (fontsz > 0 && fontsz <= Preferences::Instance()->getFontsizeCssFiles()->size())
{
Modified: branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp 2008-03-15 18:39:57 UTC (rev 2406)
+++ branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp 2008-03-16 06:13:20 UTC (rev 2407)
@@ -29,6 +29,7 @@
#include "gui/AmisApp.h"
#include "../../../resource.h"
#include "util/Log.h"
+#include "Preferences.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -49,12 +50,14 @@
: cdxCDynamicBarDlg(CAmisSidebar::IDD, pParent)
{
m_iSel = 0;
+ mFontSizeInPoints = AMIS_SIDEBAR_SMALLEST_FONT_SIZE;
}
CAmisSidebar::~CAmisSidebar()
{
clearAll();
mImagesForTab.DeleteImageList();
+ mDefaultFont.DeleteObject();
}
void CAmisSidebar::DoDataExchange(CDataExchange* pDX)
@@ -94,12 +97,85 @@
}
mNumTabs = 0;
}
+void CAmisSidebar::setHighlightBGColor(amis::util::Color clr)
+{
+ //TODO: implement sidebar highlight control
+}
+void CAmisSidebar::setHighlightFGColor(amis::util::Color clr)
+{
+ //TODO: implement sidebar highlight control
+ //this foreground color feature is easy but meaningless until the BG color can also be changed
+}
+void CAmisSidebar::setPageBGColor(amis::util::Color clr)
+{
+ m_wndTree.SetBkColor(clr.getAsColorRef());
+ m_wndPageList.SetBkColor(clr.getAsColorRef());
+ for (int i = 0; i<mNavLists.size(); i++)
+ {
+ mNavLists[i]->SetBkColor(clr.getAsColorRef());
+ }
+}
+void CAmisSidebar::setPageFGColor(amis::util::Color clr)
+{
+ m_wndTree.SetTextColor(clr.getAsColorRef());
+ m_wndPageList.SetTextColor(clr.getAsColorRef());
+ for (int i = 0; i<mNavLists.size(); i++)
+ {
+ mNavLists[i]->SetTextColor(clr.getAsColorRef());
+ }
+}
+void CAmisSidebar::setFontName(std::string fontName)
+{
+ USES_CONVERSION;
+ CFont* p_font = NULL;
+ p_font=m_wndTree.GetFont();
+ LOGFONT lf;
+ p_font->GetLogFont(&lf);
+ CString font_name;
+ font_name = A2T(amis::Preferences::Instance()->getSidebarFontName().c_str());
+ lstrcpy(lf.lfFaceName, font_name);
+ //font default size and boldness values
+ lf.lfHeight = mFontSizeInPoints;
+ lf.lfWeight = 600;
+ mDefaultFont.DeleteObject();
+ mDefaultFont.CreatePointFontIndirect(&lf);
+ m_wndTree.SetFont(&mDefaultFont);
+ m_wndPageList.SetFont(&mDefaultFont);
+ for (int i = 0; i < mNavLists.size(); i++)
+ {
+ mNavLists[i]->SetFont(&mDefaultFont);
+ }
+}
+//pct should give some idea of the total possible gradients
+void CAmisSidebar::setFontSize(double pct)
+{
+ LOGFONT lf;
+ mDefaultFont.GetLogFont(&lf);
+ int diff = AMIS_SIDEBAR_BIGGEST_FONT_SIZE - AMIS_SIDEBAR_SMALLEST_FONT_SIZE;
+ if (pct <= 0.0)
+ mFontSizeInPoints = AMIS_SIDEBAR_SMALLEST_FONT_SIZE;
+ else if (pct >= 1.0)
+ mFontSizeInPoints = AMIS_SIDEBAR_BIGGEST_FONT_SIZE;
+ else
+ mFontSizeInPoints = AMIS_SIDEBAR_SMALLEST_FONT_SIZE + (pct * diff);
+
+ lf.lfHeight = mFontSizeInPoints;
+ mDefaultFont.DeleteObject();
+ mDefaultFont.CreatePointFontIndirect(&lf);
+ m_wndTree.SetFont(&mDefaultFont);
+ m_wndPageList.SetFont(&mDefaultFont);
+ for (int i = 0; i < mNavLists.size(); i++)
+ {
+ mNavLists[i]->SetFont(&mDefaultFont);
+ }
+}
void CAmisSidebar::OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult)
{
m_iSel = m_wndTab.GetCurSel();
-
- if (m_iSel == 0) showNavMap();
-
+ if (m_iSel == 0)
+ {
+ showNavMap();
+ }
else if(m_iSel == 1)
{
if (amis::dtb::DtbWithHooks::Instance()->getNavModel()->hasPages() == true) showPageList();
@@ -121,7 +197,6 @@
HTREEITEM item;
item = m_wndTree.GetSelectedItem();
p_nav = (amis::dtb::nav::NavPoint*)m_wndTree.GetItemData(item);
-
if (p_nav != NULL) amis::dtb::DtbWithHooks::Instance()->loadNavNode(p_nav);
}
@@ -329,7 +404,7 @@
m_wndPageList.SetFocus();
this->RedrawWindow();
- //then amis should play an audio prompt "pages"
+ //TODO: then amis should play an audio prompt "pages"
}
void CAmisSidebar::showNavList(unsigned int idx)
@@ -407,36 +482,7 @@
mNumTabs++;
}
-/*
-void CAmisSidebar::nextSection()
-{
- HTREEITEM h_curr = NULL;
- h_curr = m_wndTree.GetSelectedItem();
- if (h_curr != NULL)
- {
- h_curr = m_wndTree.GetNextItem(h_curr, TVGN_NEXTVISIBLE);
- m_wndTree.SelectItem(h_curr);
- amis::dtb::nav::NavPoint* p_nav = NULL;
- p_nav = (amis::dtb::nav::NavPoint*)m_wndTree.GetItemData(h_curr);
- amis::dtb::DtbWithHooks::Instance()->loadNavNode(p_nav);
- }
-}
-
-void CAmisSidebar::previousSection()
-{
- HTREEITEM h_curr = NULL;
- h_curr = m_wndTree.GetSelectedItem();
- if (h_curr != NULL)
- {
- h_curr = m_wndTree.GetPrevVisibleItem(h_curr);
- m_wndTree.SelectItem(h_curr);
- amis::dtb::nav::NavPoint* p_nav = NULL;
- p_nav = (amis::dtb::nav::NavPoint*)m_wndTree.GetItemData(h_curr);
- amis::dtb::DtbWithHooks::Instance()->loadNavNode(p_nav);
- }
-}
-*/
//*******************
//tree view expand and collapse
//*******************
Modified: branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebarLoader.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebarLoader.cpp 2008-03-15 18:39:57 UTC (rev 2406)
+++ branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebarLoader.cpp 2008-03-16 06:13:20 UTC (rev 2407)
@@ -21,6 +21,7 @@
*/
#include "gui/sidebar/AmisSidebarLoader.h"
#include "util/Log.h"
+#include "Preferences.h"
using namespace amis::gui::sidebar;
@@ -90,6 +91,7 @@
//expand all sections
mpSidebar->expandAllSections();
+ mpSidebar->setFontName(Preferences::Instance()->getSidebarFontName());
amis::util::Log::Instance()->writeMessage("Data loaded into sidebar");
}
Modified: branches/amis3/DefaultLangpack/amisAccessibleUi.xml
===================================================================
--- branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-15 18:39:57 UTC (rev 2406)
+++ branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-16 06:13:20 UTC (rev 2407)
@@ -281,6 +281,22 @@
<audio src=""/>
</mnemonic>
</action>
+ <!--new item-->
+ <action mfcid="ID_AMIS_SHOW_TEXTSTYLE" widget="menuItem">
+ <note>This is going to be a menu item</note>
+ <caption>
+ <text id="xx">Text style...</text>
+ <audio src=""/>
+ </caption>
+ <description>
+ <text id="xx">Change the text style properties.</text>
+ <audio src=""/>
+ </description>
+ <mnemonic>
+ <text id="xx">T</text>
+ <audio src=""/>
+ </mnemonic>
+ </action>
<action mfcid="AMIS_NAVLIST_BASE_ID" widget="menuItem">
<note>This is going to be a menu item</note>
<caption>
@@ -1288,6 +1304,26 @@
</caption>
</list>
</control>
+ <control mfcid="IDOK" widget="button">
+ <caption>
+ <promptItem refid="ok_button_caption"/>
+ </caption>
+ <description>
+ <promptItem refid="ok_button_description"/>
+ </description>
+ </control>
+ <control mfcid="IDCANCEL" widget="button">
+ <caption>
+ <promptItem refid="cancel_button_caption"/>
+ </caption>
+ <description>
+ <promptItem refid="cancel_button_description"/>
+ </description>
+ <mnemonic>
+ <text id="xx">C</text>
+ <audio src=""/>
+ </mnemonic>
+ </control>
</dialog>
<dialog mfcid="IDD_GOTOPAGE">
<note>This dialog lets the user jump to a certain page</note>
@@ -1538,6 +1574,88 @@
</list>
</control>
</dialog>
+ <dialog>
+ <note>This dialog lets the user set text style properties.</note>
+ <caption>
+ <text id="xx">Text Style</text>
+ <audio src=""/>
+ </caption>
+ <description>
+ <text id="xx">Here you can change text style properties.</text>
+ <audio src=""/>
+ </description>
+ <prompt type="instructions">
+ <promptItem refid="tabAround"/>
+ <promptItem refid="altC_to_cancel"/>
+ <promptItem refid="repeatLastPromptInstr"/>
+ <promptItem refid="hearDlgInstructions"/>
+ </prompt>
+ <control mfcid="IDC_FONT" widget="list">
+ <caption mfcid="IDC_FONTLABEL">
+ <text id="xx">Sidebar font:</text>
+ <audio src=""/>
+ </caption>
+ <description>
+ <text id="xx">Use the arrow keys to move around this list of font names.</text>
+ <audio src=""/>
+ </description>
+ <list repeat="yes">
+ <caption>
+ <promptVar name="FONT_NAME"/>
+ </caption>
+ </list>
+ </control>
+ <control mfcid="IDC_HIGHLIGHTFOREGROUND" widget="list">
+ <caption mfcid="IDC_HIGHLIGHTFOREGROUNDLABEL">
+ <text id="xx">Highlighted text color:</text>
+ <audio src=""/>
+ </caption>
+ <description>
+ <text id="xx">Use the arrow keys to move around this list of colors.</text>
+ <audio src=""/>
+ </description>
+ <list repeat="yes">
+ <caption>
+ <promptVar name="COLOR_NAME"/>
+ </caption>
+ </list>
+ </control>
+ <control mfcid="IDC_HIGHLIGHTBACKGROUND" widget="list">
+ <caption mfcid="IDC_HIGHLIGHTBACKGROUNDLABEL">
+ <text id="xx">Highlight background color:</text>
+ <audio src=""/>
+ </caption>
+ <description>
+ <text id="xx">Use the arrow keys to move around this list of colors.</text>
+ <audio src=""/>
+ </description>
+ <list repeat="yes">
+ <caption>
+ <promptVar name="COLOR_NAME"/>
+ </caption>
+ </list>
+ </control>
+ <control mfcid="IDOK" widget="button">
+ <caption>
+ <promptItem refid="ok_button_caption"/>
+ </caption>
+ <description>
+ <promptItem refid="ok_button_description"/>
+ </description>
+ </control>
+ <control mfcid="IDCANCEL" widget="button">
+ <caption>
+ <promptItem refid="cancel_button_caption"/>
+ </caption>
+ <description>
+ <promptItem refid="cancel_button_description"/>
+ </description>
+ <mnemonic>
+ <text id="xx">C</text>
+ <audio src=""/>
+ </mnemonic>
+ </control>
+ </dialog>
</dialogs>
<prompts>
<promptItemRefs>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-16 23:09:30
|
Revision: 2410
http://amis.svn.sourceforge.net/amis/?rev=2410&view=rev
Author: marisademeglio
Date: 2008-03-16 16:09:37 -0700 (Sun, 16 Mar 2008)
Log Message:
-----------
fixed page navigation bug
Modified Paths:
--------------
branches/amis3/AmisCore/include/dtb/nav/NavModel.h
branches/amis3/AmisCore/src/dtb/Dtb.cpp
branches/amis3/AmisCore/src/dtb/nav/NavModel.cpp
branches/amis3/AmisCore/src/dtb/nav/NavVisitor.cpp
branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp
Modified: branches/amis3/AmisCore/include/dtb/nav/NavModel.h
===================================================================
--- branches/amis3/AmisCore/include/dtb/nav/NavModel.h 2008-03-16 23:09:11 UTC (rev 2409)
+++ branches/amis3/AmisCore/include/dtb/nav/NavModel.h 2008-03-16 23:09:37 UTC (rev 2410)
@@ -63,13 +63,13 @@
PageTarget* nextPage(int);
//add a node to the big ordered list. the node will not necessarily be next in sequence.
void addToPlayOrderList(NavNode*);
- vector<amis::dtb::nav::NavNode*> getPlayOrderList();
+ NavNodeList* getPlayOrderList();
private:
NavMap* mpNavMap;
PageList* mpPageList;
NodeRefMap* mpSmilIdNodeMap;
NavListList mNavLists;
- std::vector<NavNode*> mPlayOrderList;
+ NavNodeList mPlayOrderList;
};
}
}
Modified: branches/amis3/AmisCore/src/dtb/Dtb.cpp
===================================================================
--- branches/amis3/AmisCore/src/dtb/Dtb.cpp 2008-03-16 23:09:11 UTC (rev 2409)
+++ branches/amis3/AmisCore/src/dtb/Dtb.cpp 2008-03-16 23:09:37 UTC (rev 2410)
@@ -207,6 +207,33 @@
return false;
}
+ //testing only!
+ // print the play order list
+ //********************************
+ // Save the original stdout buffer.
+ std::streambuf * sobuf = cout.rdbuf();
+ std::ofstream fileout;
+ fileout.open("c:\\devel\\amis\\branches\\amis3\\bin\\playorder_printout.txt");
+ std::streambuf * filebuf = fileout.rdbuf();
+ cout.rdbuf(filebuf);
+ amis::dtb::nav::NavNodeList* p_list = this->getNavModel()->getPlayOrderList();
+ for (int i = 0; i<p_list->size(); i++)
+ {
+ cout<<"# "<<i<<" = "<<endl;
+ if ((*p_list)[i]->getTypeOfNode() == amis::dtb::nav::NavNode::NAV_POINT)
+ cout<<"Nav Point ";
+ else if ((*p_list)[i]->getTypeOfNode() == amis::dtb::nav::NavNode::PAGE_TARGET)
+ cout<<"Page Target ";
+ else if ((*p_list)[i]->getTypeOfNode() == amis::dtb::nav::NavNode::NAV_TARGET)
+ cout<<"Nav Target ";
+
+ cout<<(*p_list)[i]->getId()<<endl;
+ }
+
+ fileout.close();
+ cout.rdbuf(sobuf);
+ //***********************end test
+
loadBookmarks(mpFiles->getBookmarksFilepath());
amis::util::Log::Instance()->writeMessage("Opened book successfully", "Dtb::open", "AmisCore");
return true;
@@ -578,9 +605,9 @@
}
//the current nav node could be a page target or nav point, depending on which has the greater
//play order value. default to nav point.
- if (mpNavModel->hasPages() == true)
+ if (mpNavModel->hasPages() == true)
{
- p_node = mpNavModel->getNodeForSmilId(uri_ref, mpNavModel->getPageList());
+ p_node = mpNavModel->getNodeForSmilId(smil_file_name, mpNavModel->getPageList());
if (p_node != NULL && mpCurrentNavNode->getPlayOrder() < p_node->getPlayOrder())
mpCurrentNavNode = p_node;
}
Modified: branches/amis3/AmisCore/src/dtb/nav/NavModel.cpp
===================================================================
--- branches/amis3/AmisCore/src/dtb/nav/NavModel.cpp 2008-03-16 23:09:11 UTC (rev 2409)
+++ branches/amis3/AmisCore/src/dtb/nav/NavModel.cpp 2008-03-16 23:09:37 UTC (rev 2410)
@@ -292,7 +292,7 @@
}
amis::dtb::nav::NavPoint* amis::dtb::nav::NavModel::nextSection(int currentPlayOrder)
{
- int idx = currentPlayOrder + 1;
+ int idx = currentPlayOrder;
if (idx >= mPlayOrderList.size() || idx <= 0) return NULL;
for (int i = idx; i < mPlayOrderList.size(); i++)
@@ -307,7 +307,7 @@
}
amis::dtb::nav::PageTarget* amis::dtb::nav::NavModel::previousPage(int currentPlayOrder)
{
- int idx = currentPlayOrder - 1;
+ int idx = currentPlayOrder - 2;
if (idx >= mPlayOrderList.size() || idx <= 0) return NULL;
for (int i = idx; i >=0; i--)
@@ -322,7 +322,8 @@
}
amis::dtb::nav::PageTarget* amis::dtb::nav::NavModel::nextPage(int currentPlayOrder)
{
- int idx = currentPlayOrder + 1;
+ //play order is 1-based; the array is 0-based
+ int idx = currentPlayOrder;
if (idx >= mPlayOrderList.size() || idx <= 0) return NULL;
for (int i = idx; i < mPlayOrderList.size(); i++)
@@ -335,7 +336,7 @@
}
return NULL;
}
-vector<amis::dtb::nav::NavNode*> amis::dtb::nav::NavModel::getPlayOrderList()
+amis::dtb::nav::NavNodeList* amis::dtb::nav::NavModel::getPlayOrderList()
{
- return mPlayOrderList;
+ return &mPlayOrderList;
}
\ No newline at end of file
Modified: branches/amis3/AmisCore/src/dtb/nav/NavVisitor.cpp
===================================================================
--- branches/amis3/AmisCore/src/dtb/nav/NavVisitor.cpp 2008-03-16 23:09:11 UTC (rev 2409)
+++ branches/amis3/AmisCore/src/dtb/nav/NavVisitor.cpp 2008-03-16 23:09:37 UTC (rev 2410)
@@ -241,7 +241,6 @@
std::ofstream fileout;
if (toFile == true)
{
- //TODO: take the path out
fileout.open("map_printout.txt");
std::streambuf * filebuf = fileout.rdbuf();
cout.rdbuf(filebuf);
Modified: branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp 2008-03-16 23:09:11 UTC (rev 2409)
+++ branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp 2008-03-16 23:09:37 UTC (rev 2410)
@@ -329,9 +329,7 @@
if (pMsg->message == WM_KEYDOWN)
{
//let the arrow keys operate the tree view
- if ((pMsg->wParam == VK_LEFT ||
- pMsg->wParam == VK_RIGHT ||
- pMsg->wParam == VK_UP ||
+ if ((pMsg->wParam == VK_UP ||
pMsg->wParam == VK_DOWN ||
pMsg->wParam == VK_RETURN)&&
mIsControlDown == false &&
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-17 03:46:00
|
Revision: 2414
http://amis.svn.sourceforge.net/amis/?rev=2414&view=rev
Author: marisademeglio
Date: 2008-03-16 20:44:41 -0700 (Sun, 16 Mar 2008)
Log Message:
-----------
Navigation highlight works
Modified Paths:
--------------
branches/amis3/AmisCore/src/dtb/Dtb.cpp
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
branches/amis3/AmisGuiMFC2/include/gui/sidebar/AmisSidebar.h
branches/amis3/AmisGuiMFC2/src/gui/MmView.cpp
branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp
branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp
branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebarLoader.cpp
Modified: branches/amis3/AmisCore/src/dtb/Dtb.cpp
===================================================================
--- branches/amis3/AmisCore/src/dtb/Dtb.cpp 2008-03-17 03:41:55 UTC (rev 2413)
+++ branches/amis3/AmisCore/src/dtb/Dtb.cpp 2008-03-17 03:44:41 UTC (rev 2414)
@@ -206,34 +206,6 @@
"Dtb::open", "AmisCore");
return false;
}
-
- //testing only!
- // print the play order list
- //********************************
- // Save the original stdout buffer.
- std::streambuf * sobuf = cout.rdbuf();
- std::ofstream fileout;
- fileout.open("c:\\devel\\amis\\branches\\amis3\\bin\\playorder_printout.txt");
- std::streambuf * filebuf = fileout.rdbuf();
- cout.rdbuf(filebuf);
- amis::dtb::nav::NavNodeList* p_list = this->getNavModel()->getPlayOrderList();
- for (int i = 0; i<p_list->size(); i++)
- {
- cout<<"# "<<i<<" = "<<endl;
- if ((*p_list)[i]->getTypeOfNode() == amis::dtb::nav::NavNode::NAV_POINT)
- cout<<"Nav Point ";
- else if ((*p_list)[i]->getTypeOfNode() == amis::dtb::nav::NavNode::PAGE_TARGET)
- cout<<"Page Target ";
- else if ((*p_list)[i]->getTypeOfNode() == amis::dtb::nav::NavNode::NAV_TARGET)
- cout<<"Nav Target ";
-
- cout<<(*p_list)[i]->getId()<<endl;
- }
-
- fileout.close();
- cout.rdbuf(sobuf);
- //***********************end test
-
loadBookmarks(mpFiles->getBookmarksFilepath());
amis::util::Log::Instance()->writeMessage("Opened book successfully", "Dtb::open", "AmisCore");
return true;
@@ -580,6 +552,7 @@
setNewLastmark(data_uri);
}
+//this function does more than it seems .. it needs a better name
//it turns out that this method signature is friendlier for ambulant than the other setNewLastmark function
void amis::dtb::Dtb::setNewLastmark(ambulant::net::url positionUri)
{
@@ -609,13 +582,14 @@
{
p_node = mpNavModel->getNodeForSmilId(smil_file_name, mpNavModel->getPageList());
if (p_node != NULL && mpCurrentNavNode->getPlayOrder() < p_node->getPlayOrder())
+ {
mpCurrentNavNode = p_node;
+ }
}
}
}
mpBookmarks->setLastmark(p_pos_data);
-
amis::io::BookmarksFileIO bmk_file_io;
bmk_file_io.writeToFile(mpFiles->getBookmarksFilepath(), mpBookmarks);
}
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
===================================================================
(Binary files differ)
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-17 03:41:55 UTC (rev 2413)
+++ branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-17 03:44:41 UTC (rev 2414)
@@ -270,7 +270,7 @@
BEGIN
CONTROL "Tab1",IDC_TAB,"SysTabControl32",TCS_BOTTOM,0,163,175,18
CONTROL "Tree1",IDC_TREE,"SysTreeView32",TVS_HASLINES |
- WS_BORDER | WS_TABSTOP,0,0,175,164
+ TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,0,0,175,164
CONTROL "List1",IDC_LIST_PAGE,"SysListView32",LVS_LIST |
LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS |
LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER |
Modified: branches/amis3/AmisGuiMFC2/include/gui/sidebar/AmisSidebar.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/sidebar/AmisSidebar.h 2008-03-17 03:41:55 UTC (rev 2413)
+++ branches/amis3/AmisGuiMFC2/include/gui/sidebar/AmisSidebar.h 2008-03-17 03:44:41 UTC (rev 2414)
@@ -60,12 +60,13 @@
void setPageFGColor(amis::util::Color);
void setFontName(std::string);
void setFontSize(double);
-
+ void setSelectedNode(amis::dtb::nav::NavPoint*);
+ void setSelectedNode(amis::dtb::nav::PageTarget*);
enum { IDD = IDD_SIDEBAR };
- CTabCtrl m_wndTab;
- CTreeCtrl m_wndTree;
- CListCtrl m_wndPageList;
- int m_iSel;
+ CTabCtrl mTabStrip;
+ CTreeCtrl mTree;
+ CListCtrl mPageList;
+ int mTabSel;
afx_msg void OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchangeTree(NMHDR* pNMHDR, LRESULT* pResult);
@@ -97,7 +98,8 @@
CFont mDefaultFont;
CFont* mpAlteredFont;
int mFontSizeInPoints;
-
+ bool mbIgnoreTreeSelect;
+ bool mbIgnorePageListSelect;
DECLARE_MESSAGE_MAP();
friend class AmisSidebarLoader;
Modified: branches/amis3/AmisGuiMFC2/src/gui/MmView.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/MmView.cpp 2008-03-17 03:41:55 UTC (rev 2413)
+++ branches/amis3/AmisGuiMFC2/src/gui/MmView.cpp 2008-03-17 03:44:41 UTC (rev 2414)
@@ -937,6 +937,9 @@
//set the lastmark
amis::dtb::DtbWithHooks::Instance()->setNewLastmark(m_current_url);
+ //highlight the sidebar
+ amis::dtb::nav::NavNode* p_node = amis::dtb::DtbWithHooks::Instance()->getCurrentNavNode();
+ amis::gui::MainWndParts::Instance()->mpSidebar->m_wndDlg.setSelectedNode((amis::dtb::nav::NavPoint*)p_node);
}
void MmView::node_stopped(const ambulant::lib::node *n)
Modified: branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp 2008-03-17 03:41:55 UTC (rev 2413)
+++ branches/amis3/AmisGuiMFC2/src/gui/TextRenderBrain.cpp 2008-03-17 03:44:41 UTC (rev 2414)
@@ -133,8 +133,8 @@
{
if (mbWaitForDocumentLoad)
{
- mpAmisCss = MainWndParts::Instance()->mpHtmlView->applyStylesheet
- (Preferences::Instance()->getAmisCssFile());
+ //mpAmisCss = MainWndParts::Instance()->mpHtmlView->applyStylesheet
+ // (Preferences::Instance()->getAmisCssFile());
//TODO: does this ever work? need to test more books.
if (amis::dtb::DtbWithHooks::Instance()->getDaisyVersion() == amis::dtb::DAISY_2005)
MainWndParts::Instance()->mpHtmlView->applyStylesheet(Preferences::Instance()->getZed2005CssFile());
Modified: branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp 2008-03-17 03:41:55 UTC (rev 2413)
+++ branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebar.cpp 2008-03-17 03:44:41 UTC (rev 2414)
@@ -49,7 +49,7 @@
CAmisSidebar::CAmisSidebar(CWnd* pParent /*=NULL*/)
: cdxCDynamicBarDlg(CAmisSidebar::IDD, pParent)
{
- m_iSel = 0;
+ mTabSel = 0;
mFontSizeInPoints = AMIS_SIDEBAR_SMALLEST_FONT_SIZE;
}
@@ -63,9 +63,9 @@
void CAmisSidebar::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_TAB, m_wndTab);
- DDX_Control(pDX, IDC_TREE, m_wndTree);
- DDX_Control(pDX, IDC_LIST_PAGE, m_wndPageList);
+ DDX_Control(pDX, IDC_TAB, mTabStrip);
+ DDX_Control(pDX, IDC_TREE, mTree);
+ DDX_Control(pDX, IDC_LIST_PAGE, mPageList);
}
void CAmisSidebar::clearAll()
@@ -87,12 +87,12 @@
if (p_navl) delete p_navl;
}
- if (m_wndTree) m_wndTree.DeleteAllItems();
- if (m_wndPageList) m_wndPageList.DeleteAllItems();
+ if (mTree) mTree.DeleteAllItems();
+ if (mPageList) mPageList.DeleteAllItems();
- if (m_wndTab)
+ if (mTabStrip)
{
- m_wndTab.DeleteAllItems();
+ mTabStrip.DeleteAllItems();
this->RedrawWindow();
}
mNumTabs = 0;
@@ -108,8 +108,8 @@
}
void CAmisSidebar::setPageBGColor(amis::util::Color clr)
{
- m_wndTree.SetBkColor(clr.getAsColorRef());
- m_wndPageList.SetBkColor(clr.getAsColorRef());
+ mTree.SetBkColor(clr.getAsColorRef());
+ mPageList.SetBkColor(clr.getAsColorRef());
for (int i = 0; i<mNavLists.size(); i++)
{
mNavLists[i]->SetBkColor(clr.getAsColorRef());
@@ -117,8 +117,8 @@
}
void CAmisSidebar::setPageFGColor(amis::util::Color clr)
{
- m_wndTree.SetTextColor(clr.getAsColorRef());
- m_wndPageList.SetTextColor(clr.getAsColorRef());
+ mTree.SetTextColor(clr.getAsColorRef());
+ mPageList.SetTextColor(clr.getAsColorRef());
for (int i = 0; i<mNavLists.size(); i++)
{
mNavLists[i]->SetTextColor(clr.getAsColorRef());
@@ -128,7 +128,7 @@
{
USES_CONVERSION;
CFont* p_font = NULL;
- p_font=m_wndTree.GetFont();
+ p_font=mTree.GetFont();
LOGFONT lf;
p_font->GetLogFont(&lf);
CString font_name;
@@ -139,8 +139,8 @@
lf.lfWeight = 600;
mDefaultFont.DeleteObject();
mDefaultFont.CreatePointFontIndirect(&lf);
- m_wndTree.SetFont(&mDefaultFont);
- m_wndPageList.SetFont(&mDefaultFont);
+ mTree.SetFont(&mDefaultFont);
+ mPageList.SetFont(&mDefaultFont);
for (int i = 0; i < mNavLists.size(); i++)
{
mNavLists[i]->SetFont(&mDefaultFont);
@@ -162,8 +162,8 @@
lf.lfHeight = mFontSizeInPoints;
mDefaultFont.DeleteObject();
mDefaultFont.CreatePointFontIndirect(&lf);
- m_wndTree.SetFont(&mDefaultFont);
- m_wndPageList.SetFont(&mDefaultFont);
+ mTree.SetFont(&mDefaultFont);
+ mPageList.SetFont(&mDefaultFont);
for (int i = 0; i < mNavLists.size(); i++)
{
mNavLists[i]->SetFont(&mDefaultFont);
@@ -171,20 +171,20 @@
}
void CAmisSidebar::OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult)
{
- m_iSel = m_wndTab.GetCurSel();
- if (m_iSel == 0)
+ mTabSel = mTabStrip.GetCurSel();
+ if (mTabSel == 0)
{
showNavMap();
}
- else if(m_iSel == 1)
+ else if(mTabSel == 1)
{
if (amis::dtb::DtbWithHooks::Instance()->getNavModel()->hasPages() == true) showPageList();
- else showNavList(m_iSel-1);
+ else showNavList(mTabSel-1);
}
else
{
- if (amis::dtb::DtbWithHooks::Instance()->getNavModel()->hasPages() == true) showNavList(m_iSel-2);
- else showNavList(m_iSel-1);
+ if (amis::dtb::DtbWithHooks::Instance()->getNavModel()->hasPages() == true) showNavList(mTabSel-2);
+ else showNavList(mTabSel-1);
}
*pResult = 0;
}
@@ -193,10 +193,11 @@
void CAmisSidebar::OnSelchangeTree(NMHDR* pNMHDR, LRESULT* pResult)
{
if (theApp.isBookOpen() == false) return;
+ if (mbIgnoreTreeSelect == true) return;
amis::dtb::nav::NavPoint* p_nav = NULL;
HTREEITEM item;
- item = m_wndTree.GetSelectedItem();
- p_nav = (amis::dtb::nav::NavPoint*)m_wndTree.GetItemData(item);
+ item = mTree.GetSelectedItem();
+ p_nav = (amis::dtb::nav::NavPoint*)mTree.GetItemData(item);
if (p_nav != NULL) amis::dtb::DtbWithHooks::Instance()->loadNavNode(p_nav);
}
@@ -210,13 +211,14 @@
void CAmisSidebar::OnPageListClick(NMHDR* pNMHDR, LRESULT* pResult)
{
if (theApp.isBookOpen() == false) return;
+ if (mbIgnorePageListSelect == true) return;
amis::dtb::nav::PageTarget* p_page = NULL;
int curr_sel;
- curr_sel = m_wndPageList.GetSelectionMark();
+ curr_sel = mPageList.GetSelectionMark();
if (curr_sel > -1)
{
- p_page = (amis::dtb::nav::PageTarget*)m_wndPageList.GetItemData(curr_sel);
+ p_page = (amis::dtb::nav::PageTarget*)mPageList.GetItemData(curr_sel);
if (p_page != NULL) amis::dtb::DtbWithHooks::Instance()->loadNavNode(p_page);
}
}
@@ -227,33 +229,35 @@
//by the list control because the message hasn't gone through yet
//so we need to go either forward or back one, depending on what key the user pressed
+ if (mbIgnorePageListSelect == true)
+ {
+ *pResult = 0;
+ return;
+ }
+
NMLVKEYDOWN* pKeyDown = (NMLVKEYDOWN*)pNMHDR;
-
amis::dtb::nav::PageTarget* p_page = NULL;
-
int curr_sel;
string content;
- curr_sel = m_wndPageList.GetSelectionMark();
-
+ curr_sel = mPageList.GetSelectionMark();
if (pKeyDown->wVKey == VK_UP && (!mIsControlDown || !mIsShiftDown))
{
- if (curr_sel - 1 > -1 && curr_sel - 1 < m_wndPageList.GetItemCount())
+ if (curr_sel - 1 > -1 && curr_sel - 1 < mPageList.GetItemCount())
{
curr_sel--;
- p_page = (amis::dtb::nav::PageTarget*)m_wndPageList.GetItemData(curr_sel);
+ p_page = (amis::dtb::nav::PageTarget*)mPageList.GetItemData(curr_sel);
}
}
else if (pKeyDown->wVKey == VK_DOWN && (!mIsControlDown || !mIsShiftDown))
{
- if (curr_sel + 1 > -1 && curr_sel + 1 < m_wndPageList.GetItemCount())
+ if (curr_sel + 1 > -1 && curr_sel + 1 < mPageList.GetItemCount())
{
curr_sel++;
- p_page = (amis::dtb::nav::PageTarget*)m_wndPageList.GetItemData(curr_sel);
+ p_page = (amis::dtb::nav::PageTarget*)mPageList.GetItemData(curr_sel);
}
}
if (p_page != NULL) amis::dtb::DtbWithHooks::Instance()->loadNavNode(p_page);
-
*pResult = 0;
}
@@ -263,7 +267,7 @@
cdxCDynamicBarDlg::OnInitDialog();
- m_wndTree.GetWindowRect(mInitialRect);
+ mTree.GetWindowRect(mInitialRect);
this->GetWindowRect(mInitialParentRect);
mNumTabs = 0;
@@ -300,16 +304,17 @@
mImagesForTab.Add(hIcon[1]);
mImagesForTab.Add(hIcon[2]);
- m_wndTab.SetImageList(&mImagesForTab);
+ mTabStrip.SetImageList(&mImagesForTab);
- AddSzControl(m_wndTree,mdResize,mdResize);
- AddSzControl(m_wndTab,mdResize,mdRepos);
- AddSzControl(m_wndPageList, mdResize, mdResize);
+ AddSzControl(mTree,mdResize,mdResize);
+ AddSzControl(mTabStrip,mdResize,mdRepos);
+ AddSzControl(mPageList, mdResize, mdResize);
- m_wndPageList.ShowWindow(SW_HIDE);
- m_wndTab.ShowWindow(SW_HIDE);
- m_wndTree.ShowWindow(SW_HIDE);
-
+ mPageList.ShowWindow(SW_HIDE);
+ mTabStrip.ShowWindow(SW_HIDE);
+ mTree.ShowWindow(SW_HIDE);
+ mbIgnoreTreeSelect = false;
+ mbIgnorePageListSelect = false;
return TRUE;
}
@@ -394,13 +399,13 @@
}
void CAmisSidebar::showPageList()
{
- m_wndPageList.ShowWindow(SW_SHOW);
- m_wndTree.ShowWindow(SW_HIDE);
+ mPageList.ShowWindow(SW_SHOW);
+ mTree.ShowWindow(SW_HIDE);
for (unsigned int i=0; i<mNavLists.size(); i++)
mNavLists[i]->ShowWindow(SW_HIDE);
- m_wndPageList.SetFocus();
+ mPageList.SetFocus();
this->RedrawWindow();
//TODO: then amis should play an audio prompt "pages"
}
@@ -417,8 +422,8 @@
mNavLists[idx]->ShowWindow(SW_SHOW);
- m_wndPageList.ShowWindow(SW_HIDE);
- m_wndTree.ShowWindow(SW_HIDE);
+ mPageList.ShowWindow(SW_HIDE);
+ mTree.ShowWindow(SW_HIDE);
mNavLists[idx]->SetFocus();
this->RedrawWindow();
@@ -432,12 +437,12 @@
void CAmisSidebar::showNavMap()
{
- m_wndTree.ShowWindow(SW_SHOW);
+ mTree.ShowWindow(SW_SHOW);
for (unsigned int i=0; i<mNavLists.size(); i++)
mNavLists[i]->ShowWindow(SW_HIDE);
- m_wndPageList.ShowWindow(SW_HIDE);
- m_wndTree.SetFocus();
+ mPageList.ShowWindow(SW_HIDE);
+ mTree.SetFocus();
this->RedrawWindow();
//TODO: amis should play an audio prompt "sections"
}
@@ -452,7 +457,7 @@
GetWindowRect(parent_rect);
//the pageview's rectangle
- m_wndPageList.GetWindowRect(rect);
+ mPageList.GetWindowRect(rect);
//use init rects when sizing a runtime control
//the sizing control manager requires this
@@ -475,8 +480,8 @@
void CAmisSidebar::addTab(std::wstring label)
{
CString tab_label = label.c_str();
- int pos = m_wndTab.GetItemCount() + 1;
- m_wndTab.InsertItem(pos, tab_label, pos-1);
+ int pos = mTabStrip.GetItemCount() + 1;
+ mTabStrip.InsertItem(pos, tab_label, pos-1);
mNumTabs++;
}
@@ -509,17 +514,17 @@
//save the current selection
HTREEITEM h_selected = NULL;
- h_selected = m_wndTree.GetSelectedItem();
+ h_selected = mTree.GetSelectedItem();
- HTREEITEM h_curr = m_wndTree.GetRootItem();
+ HTREEITEM h_curr = mTree.GetRootItem();
//first: collapse all branches
while (h_curr != NULL)
{
treeBranchCollapse(h_curr);
- h_curr = m_wndTree.GetNextSiblingItem(h_curr);
+ h_curr = mTree.GetNextSiblingItem(h_curr);
}
- h_curr = m_wndTree.GetRootItem();
+ h_curr = mTree.GetRootItem();
//then expand to the right depth
if (level > 1)
@@ -527,28 +532,28 @@
while (h_curr != NULL)
{
treeBranchExpand(h_curr, level-1);
- h_curr = m_wndTree.GetNextSiblingItem(h_curr);
+ h_curr = mTree.GetNextSiblingItem(h_curr);
}
}
//make sure the selection is visible
- if (h_selected == NULL) h_selected = m_wndTree.GetRootItem();
- m_wndTree.EnsureVisible(h_selected);
+ if (h_selected == NULL) h_selected = mTree.GetRootItem();
+ mTree.EnsureVisible(h_selected);
}
void CAmisSidebar::treeBranchCollapse(HTREEITEM hItem)
{
HTREEITEM h_curr = hItem;
- if(h_curr != NULL && m_wndTree.ItemHasChildren(h_curr) == TRUE)
+ if(h_curr != NULL && mTree.ItemHasChildren(h_curr) == TRUE)
{
- m_wndTree.Expand(h_curr, TVE_COLLAPSE );
- h_curr = m_wndTree.GetChildItem(h_curr);
+ mTree.Expand(h_curr, TVE_COLLAPSE );
+ h_curr = mTree.GetChildItem(h_curr);
while (h_curr != NULL)
{
treeBranchCollapse(h_curr);
- h_curr = m_wndTree.GetNextSiblingItem(h_curr);
+ h_curr = mTree.GetNextSiblingItem(h_curr);
}
}
}
@@ -557,15 +562,85 @@
{
HTREEITEM h_curr = hItem;
- if (h_curr != NULL && level > 0 && m_wndTree.ItemHasChildren(h_curr) == TRUE)
+ if (h_curr != NULL && level > 0 && mTree.ItemHasChildren(h_curr) == TRUE)
{
- m_wndTree.Expand(h_curr, TVE_EXPAND);
- h_curr = m_wndTree.GetChildItem(h_curr);
+ mTree.Expand(h_curr, TVE_EXPAND);
+ h_curr = mTree.GetChildItem(h_curr);
while (h_curr != NULL)
{
treeBranchExpand(h_curr, level - 1);
- h_curr = m_wndTree.GetNextSiblingItem(h_curr);
+ h_curr = mTree.GetNextSiblingItem(h_curr);
}
}
+}
+
+void CAmisSidebar::setSelectedNode(amis::dtb::nav::NavPoint* pNode)
+{
+ if (pNode == NULL) return;
+ mbIgnoreTreeSelect = true;
+
+ HTREEITEM h_curr;
+ HTREEITEM h_temp;
+ h_curr = mTree.GetFirstVisibleItem();
+ bool b_found = false;
+ amis::dtb::nav::NavPoint* p_item_data = NULL;
+ while (h_curr != NULL && b_found == false)
+ {
+ p_item_data = (amis::dtb::nav::NavPoint*)mTree.GetItemData(h_curr);
+ if (p_item_data == pNode)
+ {
+ b_found = true;
+ }
+ else
+ {
+ //it will not autotraverse in-order, so give it a parameter..next sibling, child, whatever
+ //the idea is to go to the first child
+ h_temp = mTree.GetNextItem(h_curr, TVGN_CHILD);
+ //otherwise go to the sibling item
+ if (h_temp == NULL) h_temp = mTree.GetNextItem(h_curr, TVGN_NEXT);
+ //otherwise find a parent who has siblings
+ if (h_temp == NULL)
+ {
+ h_temp = h_curr;
+ HTREEITEM h_parent;
+ do
+ {
+ h_parent = mTree.GetParentItem(h_temp);
+ if (h_parent != NULL)
+ {
+ h_temp = mTree.GetNextItem(h_parent, TVGN_NEXT);
+ if (h_temp == NULL) h_temp = h_parent;
+ else break;
+ }
+ else
+ {
+ //we are at the root so just return NULL
+ //the root has no info
+ h_temp = NULL;
+ break;
+ }
+ }
+ while (1);
+ }
+ h_curr = h_temp;
+ }
+ }
+
+ if (b_found == true && h_curr != NULL)
+ mTree.SelectItem(h_curr) == TRUE;
+
+ mbIgnoreTreeSelect = false;
+}
+void CAmisSidebar::setSelectedNode(amis::dtb::nav::PageTarget* pNode)
+{
+ if (pNode == NULL) return;
+ mbIgnorePageListSelect = true;
+
+ LVITEM item;
+ mPageList.SetSelectionMark(pNode->getIndex());
+ mPageList.GetItem(&item);
+ mPageList.SetItemState(pNode->getIndex(), 0, LVIS_SELECTED);
+
+ mbIgnorePageListSelect = false;
}
\ No newline at end of file
Modified: branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebarLoader.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebarLoader.cpp 2008-03-17 03:41:55 UTC (rev 2413)
+++ branches/amis3/AmisGuiMFC2/src/gui/sidebar/AmisSidebarLoader.cpp 2008-03-17 03:44:41 UTC (rev 2414)
@@ -53,7 +53,7 @@
mpSidebar = pSidebar;
mpSidebar->clearAll();
- mpSidebar->m_wndTab.ShowWindow(SW_SHOW);
+ mpSidebar->mTabStrip.ShowWindow(SW_SHOW);
//1. load nav map
if (pNavModel != NULL && pNavModel->getNavMap() != NULL)
@@ -64,15 +64,15 @@
//load its data
pNavModel->getNavMap()->acceptDepthFirst(this);
- mpSidebar->m_wndTree.ShowWindow(SW_SHOW);
- mpSidebar->m_wndTree.Expand(mpSidebar->m_wndTree.GetRootItem(), 3);
+ mpSidebar->mTree.ShowWindow(SW_SHOW);
+ mpSidebar->mTree.Expand(mpSidebar->mTree.GetRootItem(), 3);
}
//2. load the pagelist
if (pNavModel->hasPages())
{
mpSidebar->addTab(getTextLabel(pNavModel->getPageList()));
- loadNavList(pNavModel->getPageList(), &mpSidebar->m_wndPageList);
+ loadNavList(pNavModel->getPageList(), &mpSidebar->mPageList);
}
//3. load the navlists (if exist)
@@ -115,7 +115,7 @@
int level = ((amis::dtb::nav::NavPoint*)pNode)->getLevel();
if (level == 1)
{
- hItem = mpSidebar->m_wndTree.InsertItem(tmpstr);
+ hItem = mpSidebar->mTree.InsertItem(tmpstr);
hParent = hItem;
mWidgetNodes.clear();
}
@@ -134,10 +134,10 @@
mWidgetNodes.pop_back();
}
- hItem = mpSidebar->m_wndTree.InsertItem(tmpstr, mWidgetNodes.back());
+ hItem = mpSidebar->mTree.InsertItem(tmpstr, mWidgetNodes.back());
}
mWidgetNodes.push_back(hItem);
- mpSidebar->m_wndTree.SetItemData(hItem, (DWORD)pNode);
+ mpSidebar->mTree.SetItemData(hItem, (DWORD)pNode);
return true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dan...@us...> - 2008-03-17 23:48:14
|
Revision: 2420
http://amis.svn.sourceforge.net/amis/?rev=2420&view=rev
Author: daniel_weck
Date: 2008-03-17 16:48:20 -0700 (Mon, 17 Mar 2008)
Log Message:
-----------
- fixed a typo in XML for an ID that matches an item in resource.h
- resource.h.ini was out of date: regenerated.
- added support for Page Style menu item, although it currently interferes with the play menu...(global problem because of lack of MFC menu events...trying to find a different implementation to fix this).
Modified Paths:
--------------
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
branches/amis3/AmisGuiMFC2/resource.h
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/MenuVoicing.cpp
branches/amis3/DefaultLangpack/amisAccessibleUi.xml
branches/amis3/bin/settings/resource.h.ini
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
===================================================================
(Binary files differ)
Modified: branches/amis3/AmisGuiMFC2/resource.h
===================================================================
--- branches/amis3/AmisGuiMFC2/resource.h 2008-03-17 22:54:01 UTC (rev 2419)
+++ branches/amis3/AmisGuiMFC2/resource.h 2008-03-17 23:48:20 UTC (rev 2420)
@@ -95,7 +95,6 @@
#define ID_AMIS_EXIT 32925
#define ID_AMIS_TOGGLE_SIDEBAR 32926
#define ID_AMIS_TOGGLE_VIEW 32927
-#define ID_AMIS_NO_PAGE_STYLES 32928
#define ID_AMIS_BIGGER_FONT 32929
#define ID_AMIS_SMALLER_FONT 32930
#define ID_AMIS_PLAYPAUSE 32931
@@ -120,6 +119,7 @@
#define ID_AMIS_SHOW_HELP_CONTENTS 32950
#define ID_AMIS_ABOUT 32951
#define ID_AMIS_SHOW_TEXTSTYLE 32953
+#define ID_AMIS_NO_PAGE_STYLES 32954
#define IDS_SELFOLDER_TITLE 61258
#define IDS_SELFOLDER_INSTR 61259
#define IDS_FOLDERDOESNOTEXIST 61279
@@ -133,7 +133,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 193
-#define _APS_NEXT_COMMAND_VALUE 32954
+#define _APS_NEXT_COMMAND_VALUE 32955
#define _APS_NEXT_CONTROL_VALUE 1115
#define _APS_NEXT_SYMED_VALUE 143
#endif
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/MenuVoicing.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/MenuVoicing.cpp 2008-03-17 22:54:01 UTC (rev 2419)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/MenuVoicing.cpp 2008-03-17 23:48:20 UTC (rev 2420)
@@ -46,6 +46,11 @@
firstItemId == AMIS_RECENT_BOOK_BASE_ID) {
str_id = "recentBooksList";
}
+
+ else if (firstItemId == ID_AMIS_NO_PAGE_STYLES ||
+ firstItemId == AMIS_PAGE_STYLE_BASE_ID) {
+ str_id = "pageStylesList";
+ }
else if(firstItemId == ID_AMIS_TOGGLE_SIDEBAR)
{
str_id = "view";
@@ -211,7 +216,7 @@
}
- if ((nItemID == 8 || nItemID == 2) && mFrm->m_lastOpenPopupMenu != NULL) { // 8 => "recent" (including separators), 2 => "show section depth"
+ if ((nItemID == 8 || nItemID == 2 || nItemID == 3) && mFrm->m_lastOpenPopupMenu != NULL) { // 8 => "recent" (including separators), 2 => "show section depth"
UINT nID = mFrm->m_lastOpenPopupMenu->GetMenuItemID(0);
std::string prompt = computeRootMenuFromFirstChildID(nID, false);
@@ -259,6 +264,26 @@
AudioSequencePlayer::Instance()->Play(seq);
}
return;
+ } else if (prompt.compare("view") == 0 || prompt.compare("pageStylesList") == 0) {
+ AudioSequencePlayer::fillSequenceContainerPromptFromId(seq, "pageStylesList");
+
+
+ PromptItem* p_prompt_ = DataTree::Instance()->findPromptItem("menu");
+
+ if (p_prompt_ != NULL)
+ {
+ AudioSequencePlayer::fillSequenceContents(seq, p_prompt_);
+ }
+ else {
+ seq->append(_T("menu"));
+ }
+
+ if (seq->GetCount() == 0) {
+ delete seq;
+ } else {
+ AudioSequencePlayer::Instance()->Play(seq);
+ }
+ return;
} else {
delete seq;
}
Modified: branches/amis3/DefaultLangpack/amisAccessibleUi.xml
===================================================================
--- branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-17 22:54:01 UTC (rev 2419)
+++ branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-17 23:48:20 UTC (rev 2420)
@@ -226,7 +226,7 @@
<text id="xx">Page Style</text>
<audio src=""/>
</caption>
- <action mfcid="ID_AMIS_NO_PAGE_STYLE" widget="menuItem">
+ <action mfcid="ID_AMIS_NO_PAGE_STYLES" widget="menuItem">
<note>This is going to be a menu item</note>
<caption>
<text id="xx">None</text>
Modified: branches/amis3/bin/settings/resource.h.ini
===================================================================
--- branches/amis3/bin/settings/resource.h.ini 2008-03-17 22:54:01 UTC (rev 2419)
+++ branches/amis3/bin/settings/resource.h.ini 2008-03-17 23:48:20 UTC (rev 2420)
@@ -1,9 +1,6 @@
;
[resources]
-
-
-
IDD_ABOUTBOX=100
IDS_PROPSHT_CAPTION=102
IDD_SIDEBAR=103
@@ -28,6 +25,7 @@
IDB_BOOKSHELFMAG=186
IDD_OPENURL=190
IDD_PREFERENCES=191
+IDD_TEXTSTYLE=192
AMIS_RECENT_BOOK_BASE_ID=200
AMIS_SECTION_DEPTH_BASE_ID=250
AMIS_NAVLIST_BASE_ID=300
@@ -73,6 +71,16 @@
IDC_MULTIVOLCD_INSTRUCTIONS=1103
IDC_GOTOPAGE_CAPTION=1104
IDC_OPENURL_CAPTION=1105
+IDC_FONT=1106
+IDC_HIGHLIGHTFOREGROUND=1107
+IDC_HIGHLIGHTBACKGROUND=1108
+IDC_FONTLABEL=1109
+IDC_HIGHLIGHTFOREGROUNDLABEL=1110
+IDC_HIGHLIGHTBACKGROUNDLABEL=1111
+IDC_TEXTSTYLEPREVIEW=1112
+IDC_TEXTPREVIEW=1113
+IDC_EDIT1=1114
+SELF_VOICING_PLAY_NEXT=6969
IDC_CURRLANG=9002
IDC_VERSION=9006
IDC_VERSIONNOTE=9007
@@ -110,21 +118,10 @@
ID_AMIS_SHOW_PUBLICATION_SUMMARY=32949
ID_AMIS_SHOW_HELP_CONTENTS=32950
ID_AMIS_ABOUT=32951
+ID_AMIS_SHOW_TEXTSTYLE=32953
IDS_SELFOLDER_TITLE=61258
IDS_SELFOLDER_INSTR=61259
IDS_FOLDERDOESNOTEXIST=61279
IDS_FOLDERINVALID=61280
IDS_FOLDERCANTBECREATED=61281
IDS_FILE_OPEN_DAISY_BOOKS=61288
-
-
-
-
-
-_APS_3D_CONTROLS=1
-_APS_NEXT_RESOURCE_VALUE=192
-_APS_NEXT_COMMAND_VALUE=32952
-_APS_NEXT_CONTROL_VALUE=1106
-_APS_NEXT_SYMED_VALUE=143
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dan...@us...> - 2008-03-18 02:30:20
|
Revision: 2422
http://amis.svn.sourceforge.net/amis/?rev=2422&view=rev
Author: daniel_weck
Date: 2008-03-17 19:30:27 -0700 (Mon, 17 Mar 2008)
Log Message:
-----------
- fixed XML to match data flow in the GUI list of publication summary
- fixed minor memory leak
Modified Paths:
--------------
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/Prompt.cpp
branches/amis3/DefaultLangpack/amisAccessibleUi.xml
Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-18 01:50:14 UTC (rev 2421)
+++ branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-18 02:30:27 UTC (rev 2422)
@@ -72,7 +72,7 @@
#if _DEBUG
//get Visual Leak Detector version 1.0 here: http://dmoulding.googlepages.com/downloads
-//#include <vld.h>
+#include <vld.h>
#endif
using namespace amis::gui;
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp 2008-03-18 01:50:14 UTC (rev 2421)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp 2008-03-18 02:30:27 UTC (rev 2422)
@@ -31,6 +31,8 @@
#include "gui/MainWndParts.h"
#include "util/FilePathTools.h"
#include "util/Log.h"
+#include "gui/self-voicing/datamodel/DataTree.h"
+
using namespace amis::gui::dialogs;
BEGIN_MESSAGE_MAP(PublicationSummaryDialog, CDialog)
@@ -267,7 +269,7 @@
CString value;
if (mCreator.size() > 0) value = mCreator.c_str();
- else value = _T("Author not available");
+ else value = _T("not available");
return value;
}
@@ -275,13 +277,14 @@
CString value;
if (mpTitle != NULL) value = mpTitle->getText()->getTextString().c_str();
- else value = _T("Title not available");
+ else value = _T("not available");
return value;
}
void PublicationSummaryDialog::resolvePromptVariables(Prompt* pPrompt) {
PromptVar* p_var = NULL;
+ PromptItem* promptNotAvailable = DataTree::Instance()->findPromptItem("not_available");
for (int i=0; i<pPrompt->getNumberOfItems(); i++)
{
@@ -297,7 +300,13 @@
str = computeTitle();
if (node == NULL) {
- p_var->setContents(str, "");
+ if (str.length() != 0) {
+ p_var->setContents(str, "");
+ }
+ else if (promptNotAvailable != NULL)
+ {
+ p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
} else {
p_var->setContents(str, node);
}
@@ -306,24 +315,54 @@
{
wstring str;
str = computeAuthor();
- p_var->setContents(str, "");
+ if (str.length() != 0) {
+ p_var->setContents(str, "");
+ }
+ else if (promptNotAvailable != NULL)
+ {
+ p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
}
else if (p_var->getName() == "META_PUBLISHER")
{
- p_var->setContents(mPublisher, "");
+ if (mPublisher.length() != 0) {
+ p_var->setContents(mPublisher, "");
+ }
+ else if (promptNotAvailable != NULL)
+ {
+ p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
}
else if (p_var->getName() == "META_DESC")
{
- p_var->setContents(mDescription, "");
+ if (mDescription.length() != 0) {
+ p_var->setContents(mDescription, "");
+ }
+ else if (promptNotAvailable != NULL)
+ {
+ p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
}
else if (p_var->getName() == "META_NARRATOR")
{
- p_var->setContents(mNarrator, "");
+ if (mNarrator.length() != 0) {
+ p_var->setContents(mNarrator, "");
+ }
+ else if (promptNotAvailable != NULL)
+ {
+ p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
}
else if (p_var->getName() == "META_TOTALTIME")
{
- p_var->setContents(mTotalTime, "");
+ if (mTotalTime.length() != 0) {
+ p_var->setContents(mTotalTime, "");
+ }
+ else if (promptNotAvailable != NULL)
+ {
+ p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
}
else if (p_var->getName() == "META_NUMPAGES")
{
@@ -335,15 +374,52 @@
}
else if (p_var->getName() == "META_DATE")
{
- p_var->setContents(mDate, "");
+ if (mDate.length() != 0) {
+ p_var->setContents(mDate, "");
+ }
+ else if (promptNotAvailable != NULL)
+ {
+ p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
}
else if (p_var->getName() == "META_FORMAT")
{
- p_var->setContents(mFormat, "");
+ if (mFormat.length() != 0) {
+ p_var->setContents(mFormat, "");
+ }
+ else if (promptNotAvailable != NULL)
+ {
+ p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
}
- else if (p_var->getName() == "META_TOCITEMS")
+ else if (p_var->getName() == "TOC_CATEGORIES")
{
- p_var->setContents(mNavigableItems, "");
+ if (mNavigableItems.length() != 0) {
+ p_var->setContents(mNavigableItems, "");
+ }
+ else if (promptNotAvailable != NULL)
+ {
+ p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
+
+ /*
+ //TODO: get the full multimedia data (should be available directly from the nav data model)
+ if (p_nav->getNavMap()->getLabel() != NULL)
+ {
+ mNavigableItems = p_nav->getNavMap()->getLabel()->getText()->getTextString();
+ if (p_nav->hasPages())
+ {
+ mNavigableItems.append(L", ");
+ mNavigableItems.append(p_nav->getPageList()->getLabel()->getText()->getTextString());
+ }
+ }
+ int sz = p_nav->getNumberOfNavLists();
+ for (int i=0; i<sz; i++)
+ {
+ mNavigableItems.append(L", ");
+ if (p_nav->getNavList(i)->getLabel() != NULL)
+ mNavigableItems.append(p_nav->getNavList(i)->getLabel()->getText()->getTextString());
+ } */
}
else if (p_var->getName() == "CURRENT_PAGE")
@@ -354,7 +430,7 @@
}
else if (p_var->getName() == "CURRENT_TIME")
{
- p_var->setContents(L"TODO", "");
+ p_var->setContents(promptNotAvailable->getContents()->clone());
}
else if (p_var->getName() == "CURRENT_SECTION_TITLE")
@@ -383,11 +459,15 @@
p_var->setContents(str, "");
}
- //TODO: what about the variables below:
- //META_DEPTH
- //TOC_CATEGORIES
- // ??
-
+ else if (p_var->getName() == "META_DEPTH")
+ {
+ p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
+
+ else if (p_var->getName() == "META_TOCITEMS")
+ {
+ p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
}
}
AmisDialogBase::resolvePromptVariables(pPrompt);
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/Prompt.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/Prompt.cpp 2008-03-18 01:50:14 UTC (rev 2421)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/Prompt.cpp 2008-03-18 02:30:27 UTC (rev 2422)
@@ -68,7 +68,7 @@
p_pair->setText(p_text);
}
- amis::AudioNode* p_audio = new amis::AudioNode();
+ amis::AudioNode* p_audio = NULL;
if (!audioSrc.empty()) {
p_audio = new amis::AudioNode();
p_audio->setSrc(audioSrc);
Modified: branches/amis3/DefaultLangpack/amisAccessibleUi.xml
===================================================================
--- branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-18 01:50:14 UTC (rev 2421)
+++ branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-18 02:30:27 UTC (rev 2422)
@@ -1474,26 +1474,6 @@
<promptVar name="META_NUMPAGES"/>
</prompt>
</caption>
- <caption condition="DATA_EXISTS">
- <prompt>
- <promptItem>
- <!--changed text-->
- <text id="t244">Total TOC items:</text>
- <audio src="./audio/241_Number_of_navigation_points_in.mp3"/>
- </promptItem>
- <promptVar name="META_TOCITEMS"/>
- </prompt>
- </caption>
- <caption condition="DATA_EXISTS">
- <prompt>
- <promptItem>
- <!--changed text-->
- <text id="t245">Max. section depth:</text>
- <audio src="./audio/242_Maximum_section_depth.mp3"/>
- </promptItem>
- <promptVar name="META_DEPTH"/>
- </prompt>
- </caption>
<!--new item-->
<caption condition="DATA_EXISTS">
<prompt>
@@ -1557,20 +1537,40 @@
<!--new item (except for some reused texts)-->
<caption condition="DATA_EXISTS">
<prompt>
- <promptVar name="CURRENT_SECTION_NUM_SUBSECTIONS"/>
<promptItem>
<!--changed text-->
<text id="t217">subsections, </text>
<audio src="./audio/215_Number_of_subsections_in_this_.mp3"/>
</promptItem>
- <promptVar name="CURRENT_SECTION_NUM_PAGES"/>
+ <promptVar name="CURRENT_SECTION_NUM_SUBSECTIONS"/>
<promptItem>
<!--changed text-->
<text id="t216">pages</text>
<audio src="./audio/214_Number_of_pages_in_this_sectio.mp3"/>
</promptItem>
+ <promptVar name="CURRENT_SECTION_NUM_PAGES"/>
</prompt>
</caption>
+ <caption condition="DATA_EXISTS">
+ <prompt>
+ <promptItem>
+ <!--changed text-->
+ <text id="t244">Total TOC items:</text>
+ <audio src="./audio/241_Number_of_navigation_points_in.mp3"/>
+ </promptItem>
+ <promptVar name="META_TOCITEMS"/>
+ </prompt>
+ </caption>
+ <caption condition="DATA_EXISTS">
+ <prompt>
+ <promptItem>
+ <!--changed text-->
+ <text id="t245">Max. section depth:</text>
+ <audio src="./audio/242_Maximum_section_depth.mp3"/>
+ </promptItem>
+ <promptVar name="META_DEPTH"/>
+ </prompt>
+ </caption>
</list>
</control>
</dialog>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dan...@us...> - 2008-03-18 03:10:48
|
Revision: 2425
http://amis.svn.sourceforge.net/amis/?rev=2425&view=rev
Author: daniel_weck
Date: 2008-03-17 20:10:52 -0700 (Mon, 17 Mar 2008)
Log Message:
-----------
- added max section depth and number of TOC navigation points to publication summary
Modified Paths:
--------------
branches/amis3/AmisCore/include/dtb/nav/NavMap.h
branches/amis3/AmisCore/src/dtb/nav/NavMap.cpp
branches/amis3/AmisCore/src/dtb/nav/NavPoint.cpp
branches/amis3/AmisGuiMFC2/include/gui/dialogs/PublicationSummaryDialog.h
branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp
Modified: branches/amis3/AmisCore/include/dtb/nav/NavMap.h
===================================================================
--- branches/amis3/AmisCore/include/dtb/nav/NavMap.h 2008-03-18 02:52:01 UTC (rev 2424)
+++ branches/amis3/AmisCore/include/dtb/nav/NavMap.h 2008-03-18 03:10:52 UTC (rev 2425)
@@ -55,6 +55,8 @@
NavNode* goToPlayOrder(int);
NavNode* goToContentRef(string);
NavNode* goToId(string);
+
+ int getNumberOfNavPoints();
int getMaxDepth();
Modified: branches/amis3/AmisCore/src/dtb/nav/NavMap.cpp
===================================================================
--- branches/amis3/AmisCore/src/dtb/nav/NavMap.cpp 2008-03-18 02:52:01 UTC (rev 2424)
+++ branches/amis3/AmisCore/src/dtb/nav/NavMap.cpp 2008-03-18 03:10:52 UTC (rev 2425)
@@ -182,6 +182,19 @@
else return false;
}
+int amis::dtb::nav::NavMap::getNumberOfNavPoints()
+{
+ NavPoint* p_node = mpRoot;
+ int n = 0;
+ while (p_node != NULL)
+ {
+ n++;
+ p_node = p_node->next();
+ }
+ return n-1;
+}
+
+
amis::dtb::nav::NavNode* amis::dtb::nav::NavMap::goToId(string id)
{
NavPoint* p_node = mpRoot;
Modified: branches/amis3/AmisCore/src/dtb/nav/NavPoint.cpp
===================================================================
--- branches/amis3/AmisCore/src/dtb/nav/NavPoint.cpp 2008-03-18 02:52:01 UTC (rev 2424)
+++ branches/amis3/AmisCore/src/dtb/nav/NavPoint.cpp 2008-03-18 03:10:52 UTC (rev 2425)
@@ -30,6 +30,7 @@
mpSibling = NULL;
mpParent = NULL;
mpFirstChild = NULL;
+ resetChildCount();
this->mTypeOfNode = NavNode::NAV_POINT;
}
Modified: branches/amis3/AmisGuiMFC2/include/gui/dialogs/PublicationSummaryDialog.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/dialogs/PublicationSummaryDialog.h 2008-03-18 02:52:01 UTC (rev 2424)
+++ branches/amis3/AmisGuiMFC2/include/gui/dialogs/PublicationSummaryDialog.h 2008-03-18 03:10:52 UTC (rev 2425)
@@ -66,6 +66,8 @@
amis::MediaGroup* mpSectionName;
int mNumSubsections;
int mNumPagesForSection;
+ int mMaxDepth;
+ int mTocs;
wstring mTotalTime;
wstring mPublisher;
wstring mDescription;
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp 2008-03-18 02:52:01 UTC (rev 2424)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp 2008-03-18 03:10:52 UTC (rev 2425)
@@ -115,6 +115,8 @@
mpBook = NULL;
mpSectionName = NULL;
mpTitle = NULL;
+ mMaxDepth = 0;
+ mTocs = 0;
mpBook = pBook;
}
@@ -127,6 +129,9 @@
amis::dtb::DaisyVersion version = mpBook->getDaisyVersion();
amis::dtb::nav::NavModel* p_nav = mpBook->getNavModel();
+ mTocs = p_nav->getNavMap()->getNumberOfNavPoints();
+ mMaxDepth = p_nav->getNavMap()->getMaxDepth();
+
mpTitle = mpBook->getTitle();
mCreator = p_meta->getMetadataContent("dc:creator");
@@ -231,7 +236,10 @@
CString curr_time = _T("Current time:");
CString curr_section = _T("Current section:");
CString section_contents = _T("Section contents:");
+ CString maxdepth = _T("Max section depth:");
+ CString tocs = _T("TOC entries:");
+
CString value;
wstring wvalue;
int idx = 0;
@@ -263,6 +271,12 @@
wvalue = value;
appendToList(p_list, section_contents, wvalue);
}
+ value.Format(_T("%d"), mTocs);
+ wvalue = value;
+ appendToList(p_list, tocs, wvalue);
+ value.Format(_T("%d"), mMaxDepth);
+ wvalue = value;
+ appendToList(p_list, maxdepth, wvalue);
}
CString PublicationSummaryDialog::computeAuthor() {
@@ -308,7 +322,7 @@
p_var->setContents(promptNotAvailable->getContents()->clone());
}
} else {
- p_var->setContents(str, node);
+ p_var->setContents(str, node->clone());
}
}
else if (p_var->getName() == "META_CREATOR")
@@ -392,10 +406,45 @@
p_var->setContents(promptNotAvailable->getContents()->clone());
}
}
+
+ else if (p_var->getName() == "META_TOCITEMS")
+ {
+ amis::dtb::nav::NavModel* p_nav = mpBook->getNavModel();
+ int max = p_nav->getNavMap()->getNumberOfNavPoints();
+ CString value;
+ value.Format(_T("%d"), max);
+ wstring str;
+ str = value;
+ p_var->setContents(str, "");
+ //p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
+ else if (p_var->getName() == "META_DEPTH")
+ {
+ amis::dtb::nav::NavModel* p_nav = mpBook->getNavModel();
+ int max = p_nav->getNavMap()->getMaxDepth();
+ CString value;
+ value.Format(_T("%d"), max);
+ wstring str;
+ str = value;
+ p_var->setContents(str, "");
+ //p_var->setContents(promptNotAvailable->getContents()->clone());
+ }
else if (p_var->getName() == "TOC_CATEGORIES")
{
if (mNavigableItems.length() != 0) {
+
p_var->setContents(mNavigableItems, "");
+
+ /*
+ amis::dtb::nav::NavModel* p_nav = mpBook->getNavModel();
+ if (p_nav->getNavMap()->getLabel() != NULL)
+ {
+ amis::AudioNode * node = p_nav->getNavMap()->getLabel()->getAudio(0);
+ p_var->setContents(p_nav->getNavMap()->getLabel()->getText()->getTextString(), node);
+ } else {
+ p_var->setContents(mNavigableItems, "");
+ }
+ */
}
else if (promptNotAvailable != NULL)
{
@@ -404,6 +453,8 @@
/*
//TODO: get the full multimedia data (should be available directly from the nav data model)
+
+ amis::dtb::nav::NavModel* p_nav = mpBook->getNavModel();
if (p_nav->getNavMap()->getLabel() != NULL)
{
mNavigableItems = p_nav->getNavMap()->getLabel()->getText()->getTextString();
@@ -424,8 +475,9 @@
else if (p_var->getName() == "CURRENT_PAGE")
{
+ amis::AudioNode * node = mpCurrentPage->getAudio(0);
if (mpCurrentPage != NULL) {
- p_var->setContents(mpCurrentPage->getText()->getTextString(), mpCurrentPage->getAudio(0));
+ p_var->setContents(mpCurrentPage->getText()->getTextString(), (node != NULL ? node->clone() : NULL));
}
}
else if (p_var->getName() == "CURRENT_TIME")
@@ -435,9 +487,10 @@
else if (p_var->getName() == "CURRENT_SECTION_TITLE")
{
+ amis::AudioNode * node = mpSectionName->getAudio(0);
if (mpSectionName != NULL)
{
- p_var->setContents(mpSectionName->getText()->getTextString(), mpSectionName->getAudio(0));
+ p_var->setContents(mpSectionName->getText()->getTextString(), (node != NULL ? node->clone() : NULL));
}
}
@@ -458,16 +511,7 @@
str = value;
p_var->setContents(str, "");
}
-
- else if (p_var->getName() == "META_DEPTH")
- {
- p_var->setContents(promptNotAvailable->getContents()->clone());
- }
-
- else if (p_var->getName() == "META_TOCITEMS")
- {
- p_var->setContents(promptNotAvailable->getContents()->clone());
- }
+
}
}
AmisDialogBase::resolvePromptVariables(pPrompt);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dan...@us...> - 2008-03-18 03:42:07
|
Revision: 2426
http://amis.svn.sourceforge.net/amis/?rev=2426&view=rev
Author: daniel_weck
Date: 2008-03-17 20:42:12 -0700 (Mon, 17 Mar 2008)
Log Message:
-----------
enabled arrow key interactive navigation of publication summary, corrected a typo in the XML
Modified Paths:
--------------
branches/amis3/AmisGuiMFC2/include/gui/dialogs/PublicationSummaryDialog.h
branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/TTSPlayer.cpp
branches/amis3/DefaultLangpack/amisAccessibleUi.xml
Modified: branches/amis3/AmisGuiMFC2/include/gui/dialogs/PublicationSummaryDialog.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/dialogs/PublicationSummaryDialog.h 2008-03-18 03:10:52 UTC (rev 2425)
+++ branches/amis3/AmisGuiMFC2/include/gui/dialogs/PublicationSummaryDialog.h 2008-03-18 03:42:12 UTC (rev 2426)
@@ -47,6 +47,8 @@
protected:
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
+
+ afx_msg void OnLvnItemchangedSummary(NMHDR *pNMHDR, LRESULT *pResult);
virtual void DoDataExchange(CDataExchange*);
DECLARE_MESSAGE_MAP()
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp 2008-03-18 03:10:52 UTC (rev 2425)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp 2008-03-18 03:42:12 UTC (rev 2426)
@@ -38,7 +38,8 @@
BEGIN_MESSAGE_MAP(PublicationSummaryDialog, CDialog)
ON_WM_KEYUP()
ON_WM_KEYDOWN()
- ON_WM_PAINT()
+ ON_WM_PAINT()
+ ON_NOTIFY(LVN_ITEMCHANGED, IDC_SUMMARYLIST, OnLvnItemchangedSummary)
END_MESSAGE_MAP()
PublicationSummaryDialog::PublicationSummaryDialog(CWnd* pParent /*=NULL*/)
@@ -86,11 +87,19 @@
if (p_wnd)
{
int id = p_wnd->GetDlgCtrlID();
+
+ if (id = IDC_SUMMARYLIST && (pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN))
+ {
+ return CDialog::PreTranslateMessage(pMsg);
+ }
+
+
//inexplicably, the default behavior for pressing enter in a dialog is to close it.
//we're overriding this here.
if (pMsg->wParam == VK_RETURN)
{
//do nothing
+ //return CDialog::PreTranslateMessage(pMsg);
}
}
}
@@ -295,6 +304,44 @@
return value;
}
+
+void PublicationSummaryDialog::OnLvnItemchangedSummary(NMHDR *pNMHDR, LRESULT *pResult)
+{
+ LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
+ if (pNMLV->iItem != -1) {
+ if (pNMLV->uNewState == 3) {
+
+ CListCtrl* p_ctrl_list = (CListCtrl*)this->GetDlgItem(IDC_SUMMARYLIST);
+ //int i = p_ctrl_list->GetSelectionMark(); // Should = pNMLV->iItem
+ int i = pNMLV->iItem;
+
+ Dialog* p_dlg = DataTree::Instance()->findDialog(IDD_PUBLICATIONSUMMARY);
+
+ if (p_dlg != NULL)
+ {
+ DialogControl* p_ctrl = p_dlg->findControl(IDC_SUMMARYLIST);
+ if (p_ctrl != NULL)
+ {
+ LabelList* p_list = p_ctrl->getLabelList();
+ if (p_list != NULL)
+ {
+ Prompt* p_prompt = p_list->getLabel(i)->getPrompt();
+ if (p_prompt != NULL)
+ {
+ AudioSequence* seq = new AudioSequence();
+ AudioSequencePlayer::Instance()->fillSequencePrompt(seq, p_prompt, NULL);
+ if (seq->IsEmpty()) {delete seq;}else{
+ AudioSequencePlayer::Instance()->Play(seq);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ *pResult = 0;
+}
+
void PublicationSummaryDialog::resolvePromptVariables(Prompt* pPrompt) {
PromptVar* p_var = NULL;
@@ -519,8 +566,8 @@
void PublicationSummaryDialog::appendToList(CListCtrl* pList, CString field, wstring value)
{
- //don't add empty items
- if (value.size() == 0) return;
+ //don't add empty items (no anymore: to match self-voicing exactly, and to support interactive navigation in the list)
+ //if (value.size() == 0) return;
int idx = pList->GetItemCount();
pList->InsertItem(idx, _T(""));
pList->SetItemText(idx, 0, field);
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/TTSPlayer.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/TTSPlayer.cpp 2008-03-18 03:10:52 UTC (rev 2425)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/TTSPlayer.cpp 2008-03-18 03:42:12 UTC (rev 2426)
@@ -86,11 +86,12 @@
USES_CONVERSION;
#endif
- TRACE(L"******");
+ TRACE(L"\n*-*=*+*");
TRACE(str);
if (IsSpeaking()) {
TRACE("????????");
}
+ TRACE("\n");
#ifdef USE_WSTRING
@@ -104,6 +105,7 @@
void TTSPlayer::Stop()
{
+ TRACE(_T("\nStop TTS\r\n") );
m_iV->Speak(NULL, SPF_ASYNC | SPF_PURGEBEFORESPEAK, NULL);
m_isSpeaking = FALSE;
@@ -141,13 +143,13 @@
switch( event.eEventId )
{
case SPEI_START_INPUT_STREAM:
- TRACE(_T("StartStream event\r\n") );
+ TRACE(_T("\nStartStream event\r\n") );
((TTSPlayer *)lParam)->m_isSpeaking = TRUE;
break;
case SPEI_END_INPUT_STREAM:
- TRACE(_T("EndStream event\r\n") );
+ TRACE(_T("\nEndStream event\r\n") );
((TTSPlayer *)lParam)->m_isSpeaking = FALSE;
@@ -156,7 +158,7 @@
break;
case SPEI_VOICE_CHANGE:
- TRACE(_T("Voicechange event\r\n") );
+ TRACE(_T("\nVoicechange event\r\n") );
break;
Modified: branches/amis3/DefaultLangpack/amisAccessibleUi.xml
===================================================================
--- branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-18 03:10:52 UTC (rev 2425)
+++ branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-18 03:42:12 UTC (rev 2426)
@@ -1396,7 +1396,7 @@
<promptItem refid="ok_button_description"/>
</description>
</control>
- <control mfcid="IDC_SUMMARY" widget="list">
+ <control mfcid="IDC_SUMMARYLIST" widget="list">
<caption mfcid="IDC_LISTCAPTION">
<!--changed text-->
<text id="t214">Information about this publication and your current position:</text>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dan...@us...> - 2008-03-18 07:27:27
|
Revision: 2432
http://amis.svn.sourceforge.net/amis/?rev=2432&view=rev
Author: daniel_weck
Date: 2008-03-18 00:27:33 -0700 (Tue, 18 Mar 2008)
Log Message:
-----------
improvements in Preferences dialog, more to come.
Modified Paths:
--------------
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
branches/amis3/AmisGuiMFC2/include/gui/self-voicing/AudioSequencePlayer.h
branches/amis3/AmisGuiMFC2/include/gui/self-voicing/PreTranslateMessageHandler.h
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp
branches/amis3/AmisGuiMFC2/src/gui/dialogs/AmisDialogBase.cpp
branches/amis3/AmisGuiMFC2/src/gui/dialogs/PreferencesDialog.cpp
branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp
branches/amis3/AmisGuiMFC2/src/gui/dialogs/SkipDialog.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/PreTranslateMessageHandler.cpp
branches/amis3/DefaultLangpack/amisAccessibleUi.xml
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
===================================================================
(Binary files differ)
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-18 05:58:51 UTC (rev 2431)
+++ branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-18 07:27:33 UTC (rev 2432)
@@ -384,12 +384,10 @@
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Use self-voicing",IDC_ISSELFVOICING,"Button",
- BS_AUTOCHECKBOX | BS_NOTIFY | WS_DISABLED | WS_TABSTOP,7,
- 7,241,10
- LTEXT "Select TTS voice:",IDC_SELTTSLABEL,7,22,242,8,
- WS_DISABLED
+ BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,7,7,241,10
+ LTEXT "Select TTS voice:",IDC_SELTTSLABEL,7,22,242,8
COMBOBOX IDC_TTSVOICES,7,35,108,88,CBS_DROPDOWNLIST | CBS_SORT |
- WS_DISABLED | WS_VSCROLL | WS_TABSTOP
+ WS_VSCROLL | WS_TABSTOP
CONTROL "Highlight text as it is read aloud",IDC_HIGHLIGHTTEXT,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,59,242,10
CONTROL "Load the most recently read book on startup",
Modified: branches/amis3/AmisGuiMFC2/include/gui/self-voicing/AudioSequencePlayer.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/self-voicing/AudioSequencePlayer.h 2008-03-18 05:58:51 UTC (rev 2431)
+++ branches/amis3/AmisGuiMFC2/include/gui/self-voicing/AudioSequencePlayer.h 2008-03-18 07:27:33 UTC (rev 2432)
@@ -76,16 +76,16 @@
static void playPromptItemFromStringId(string);
static void playDialogInstructionsFromUiId(int nItemID);
static void playDialogTextControlsFromUiId(int nItemID, PromptResolver* pResolver);
- static AudioSequence * playDialogControlFromUiIds(int dlgID, int ctrlId, bool playNow = true);
+ static AudioSequence * playDialogControlFromUiIds(int dlgID, int ctrlId, PromptResolver* pResolver, bool playNow = true);
static void fillSequenceContainerPromptFromId(AudioSequence* seq, string id);
static void fillSequencePrompt(AudioSequence* seq, Prompt* prompt, PromptResolver* pResolver);
- static void fillSequenceCaptionAndDescription(AudioSequence* seq, UiItem* uiItem);
+ static void fillSequenceCaptionAndDescription(AudioSequence* seq, UiItem* uiItem, PromptResolver * pResolver);
static void fillSequenceSwitch(AudioSequence* seq, UiItem* uiItem, string switchCondition = "");
- static void fillSequenceContentAndPrompt(AudioSequence* seq, Label* label);
+ static void fillSequenceContentAndPrompt(AudioSequence* seq, Label* label, PromptResolver * pResolver);
static void fillSequenceContents(AudioSequence* seq, PromptItemBase* pi);
- static void resolvePromptVariables(Prompt*);
+ static void resolvePromptVariables(Prompt*, PromptResolver* pResolver);
private:
static void fillOK_CANCEL(AudioSequence * seq, UINT ctrlId);
Modified: branches/amis3/AmisGuiMFC2/include/gui/self-voicing/PreTranslateMessageHandler.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/self-voicing/PreTranslateMessageHandler.h 2008-03-18 05:58:51 UTC (rev 2431)
+++ branches/amis3/AmisGuiMFC2/include/gui/self-voicing/PreTranslateMessageHandler.h 2008-03-18 07:27:33 UTC (rev 2432)
@@ -1,8 +1,8 @@
#pragma once
#include "AudioSequencePlayer.h"
+#include "promptresolver.h"
-
namespace amis
{
namespace gui
@@ -19,7 +19,7 @@
~PreTranslateMessageHandler(void);
CString normalizeTextEntry(CString str, int nStartChar, int nEndChar);
- void handle(
+ void handle(PromptResolver * pResolver,
MSG* pMsg,
int idUiFocus,
bool ignoreSpaceKey = false,
Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-18 05:58:51 UTC (rev 2431)
+++ branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-18 07:27:33 UTC (rev 2432)
@@ -818,7 +818,7 @@
void CAmisApp::OnShowTextStyle()
{
amis::gui::dialogs::TextStyleDialog dlg;
- if (dlg.DoModal() == IDOK)
+ if (dlg.do_modal() == IDOK)
{
TextRenderBrain::Instance()->redoPageColors();
MainWndParts::Instance()->mpSidebar->m_wndDlg.setFontName(Preferences::Instance()->getSidebarFontName());
Modified: branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp 2008-03-18 05:58:51 UTC (rev 2431)
+++ branches/amis3/AmisGuiMFC2/src/gui/MainFrm.cpp 2008-03-18 07:27:33 UTC (rev 2432)
@@ -393,7 +393,7 @@
(pMsg->message == WM_KEYDOWN || pMsg->message == WM_KEYUP))
{
CWnd* cwnd = this->GetFocus();
- if (cwnd) mCommonPreTranslateMessageHandler->handle(pMsg, (cwnd == NULL ? -1 : cwnd->GetDlgCtrlID()));
+ if (cwnd) mCommonPreTranslateMessageHandler->handle(NULL, pMsg, (cwnd == NULL ? -1 : cwnd->GetDlgCtrlID()));
}
if (pMsg->message == WM_CANCELMODE) {
//TRACE("\n---------------DANOUL2\n\n");
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/AmisDialogBase.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/AmisDialogBase.cpp 2008-03-18 05:58:51 UTC (rev 2431)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/AmisDialogBase.cpp 2008-03-18 07:27:33 UTC (rev 2432)
@@ -63,13 +63,13 @@
str = mCommonPreTranslateMessageHandler->normalizeTextEntry(str, nStartChar, nEndChar);
if (!str.IsEmpty()) { // && (pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN || pMsg->wParam == VK_LEFT || pMsg->wParam == VK_RIGHT)) {
- mCommonPreTranslateMessageHandler->handle(pMsg, (cwnd == NULL ? -1 : cwnd->GetDlgCtrlID()),false,true,str, strFULL, false);
+ mCommonPreTranslateMessageHandler->handle(this, pMsg, (cwnd == NULL ? -1 : cwnd->GetDlgCtrlID()),false,true,str, strFULL, false);
return CDialog::PreTranslateMessage(pMsg);
}
}
}
- mCommonPreTranslateMessageHandler->handle(pMsg, (cwnd == NULL ? -1 : cwnd->GetDlgCtrlID()));
+ mCommonPreTranslateMessageHandler->handle(this, pMsg, (cwnd == NULL ? -1 : cwnd->GetDlgCtrlID()));
}
}
@@ -86,7 +86,7 @@
if (cwnd)
{
mCommonPreTranslateMessageHandler->handle
- (pMsg, (cwnd == NULL ? -1 : cwnd->GetDlgCtrlID()));
+ (this, pMsg, (cwnd == NULL ? -1 : cwnd->GetDlgCtrlID()));
}
}
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/PreferencesDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/PreferencesDialog.cpp 2008-03-18 05:58:51 UTC (rev 2431)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/PreferencesDialog.cpp 2008-03-18 07:27:33 UTC (rev 2432)
@@ -29,6 +29,8 @@
#include "io/ModuleDescReader.h"
#include "ModuleDescData.h"
#include "ambulant/net/url.h"
+#include "gui/self-voicing/TTSPlayer.h"
+#include "gui/self-voicing/datamodel/DataTree.h"
using namespace amis::gui::dialogs;
@@ -53,7 +55,132 @@
END_MESSAGE_MAP()
void PreferencesDialog::resolvePromptVariables(Prompt* pPrompt) {
- return;
+
+
+ CButton* p_button = NULL;
+
+ PromptVar* p_var = NULL;
+ PromptItem* promptNotAvailable = DataTree::Instance()->findPromptItem("not_available");
+
+ PromptItem* promptSelected = DataTree::Instance()->findPromptItem("item_selected");
+ PromptItem* promptDeSelected = DataTree::Instance()->findPromptItem("item_deselected");
+
+ for (int i=0; i<pPrompt->getNumberOfItems(); i++)
+ {
+ if (pPrompt->getItem(i)->getPromptItemType() == PROMPT_VARIABLE)
+ {
+ p_var = (PromptVar*)pPrompt->getItem(i);
+
+ if (p_var->getName().compare("ON_OR_OFF") == 0)
+ {
+
+
+ if (p_var->getParam().compare("SELF_VOICING_FEATURE") == 0)
+ {
+ p_button = (CButton*)this->GetDlgItem(IDC_ISSELFVOICING);
+ if (p_button != NULL)
+ {
+ if (p_button->GetCheck() == 1)
+ {
+ p_var->setContents(promptSelected->getContents()->clone());
+ }
+ else
+ {
+ p_var->setContents(promptDeSelected->getContents()->clone());
+ }
+ }
+ } else if (p_var->getParam().compare("HIGHLIGHTTEXT_FEATURE") == 0)
+ {
+
+ p_button = (CButton*)this->GetDlgItem(IDC_HIGHLIGHTTEXT);
+ if (p_button != NULL)
+ {
+ if (p_button->GetCheck() == 1)
+ {
+ p_var->setContents(promptSelected->getContents()->clone());
+ }
+ else
+ {
+ p_var->setContents(promptDeSelected->getContents()->clone());
+ }
+ }
+ } else if (p_var->getParam().compare("LOAD_LAST_READ_FEATURE") == 0)
+ {
+ p_button = (CButton*)this->GetDlgItem(IDC_LOADLASTBOOK);
+ if (p_button != NULL)
+ {
+ if (p_button->GetCheck() == 1)
+ {
+ p_var->setContents(promptSelected->getContents()->clone());
+ }
+ else
+ {
+ p_var->setContents(promptDeSelected->getContents()->clone());
+ }
+ }
+ } else if (p_var->getParam().compare("BASIC_VIEW_FEATURE") == 0)
+ {
+ p_button = (CButton*)this->GetDlgItem(IDC_STARTINBASICVIEW);
+ if (p_button != NULL)
+ {
+ if (p_button->GetCheck() == 1)
+ {
+ p_var->setContents(promptSelected->getContents()->clone());
+ }
+ else
+ {
+ p_var->setContents(promptDeSelected->getContents()->clone());
+ }
+ }
+ } else if (p_var->getParam().compare("PAUSEONLOSTFOCUS_FEATURE") == 0)
+ {
+ p_button = (CButton*)this->GetDlgItem(IDC_PAUSEONLOSTFOCUS);
+ if (p_button != NULL)
+ {
+ if (p_button->GetCheck() == 1)
+ {
+ p_var->setContents(promptSelected->getContents()->clone());
+ }
+ else
+ {
+ p_var->setContents(promptDeSelected->getContents()->clone());
+ }
+ }
+ } else if (p_var->getParam().compare("DISABLESCREENSAVER_FEATURE") == 0)
+ {
+ p_button = (CButton*)this->GetDlgItem(IDC_DISABLESCREENSAVER);
+ if (p_button != NULL)
+ {
+ if (p_button->GetCheck() == 1)
+ {
+ p_var->setContents(promptSelected->getContents()->clone());
+ }
+ else
+ {
+ p_var->setContents(promptDeSelected->getContents()->clone());
+ }
+ }
+ }
+ }else if (p_var->getName().compare("LANGUAGE_NAME") == 0)
+ {
+ wstring str;
+ CString cstr(mUiLanguageSelection.c_str());
+ str = cstr;
+ p_var->setContents(str, "");
+
+ }else if (p_var->getName().compare("TTS_VOICE_NAME") == 0)
+ {
+
+ CComboBox* list = (CComboBox*)GetDlgItem(IDC_TTSVOICES);
+
+ wstring str = L"Daniel";
+ p_var->setContents(str, "");
+
+ }
+
+ }
+ }
+ AmisDialogBase::resolvePromptVariables(pPrompt);
}
PreferencesDialog::PreferencesDialog(CWnd* pParent /*=NULL*/)
@@ -99,13 +226,12 @@
{
//fill the combo box for the tts voices, and return an index to the voice we are currently using
//TODO: need this "initVoiceList" function
- /*int index = TTSPlayer::Instance()->initVoiceList(this->GetSafeHwnd());
+ int index = amis::tts::TTSPlayer::Instance()->initVoiceList(this->GetSafeHwnd());
if (index != -1)
{
CComboBox* list = (CComboBox*)GetDlgItem(IDC_TTSVOICES);
list->SetCurSel(index);
}
- */
}
void PreferencesDialog::initializeUiLanguageOption()
{
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp 2008-03-18 05:58:51 UTC (rev 2431)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/PublicationSummaryDialog.cpp 2008-03-18 07:27:33 UTC (rev 2432)
@@ -329,7 +329,7 @@
if (p_prompt != NULL)
{
AudioSequence* seq = new AudioSequence();
- AudioSequencePlayer::Instance()->fillSequencePrompt(seq, p_prompt, NULL);
+ AudioSequencePlayer::Instance()->fillSequencePrompt(seq, p_prompt, this);
if (seq->IsEmpty()) {delete seq;}else{
AudioSequencePlayer::Instance()->Play(seq);
}
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/SkipDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/SkipDialog.cpp 2008-03-18 05:58:51 UTC (rev 2431)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/SkipDialog.cpp 2008-03-18 07:27:33 UTC (rev 2432)
@@ -75,7 +75,7 @@
if (cwnd)
{
int id = cwnd->GetDlgCtrlID();
- mCommonPreTranslateMessageHandler->handle(pMsg, (cwnd == NULL ? -1 : id), (id == IDC_SKIPS ? true : false), (id == IDC_SKIPS ? true : false), L"", L"", (id == IDC_SKIPS ? true : false));
+ mCommonPreTranslateMessageHandler->handle(this, pMsg, (cwnd == NULL ? -1 : id), (id == IDC_SKIPS ? true : false), (id == IDC_SKIPS ? true : false), L"", L"", (id == IDC_SKIPS ? true : false));
if (pMsg->message == WM_KEYUP)
{
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp 2008-03-18 05:58:51 UTC (rev 2431)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp 2008-03-18 07:27:33 UTC (rev 2432)
@@ -878,17 +878,17 @@
Label* label = p_uiItem->getCaption();
if (label != NULL) {
- fillSequenceContentAndPrompt(seq, label);
+ fillSequenceContentAndPrompt(seq, label, NULL);
}
if (mnemonic != NULL) {
- fillSequenceContentAndPrompt(seq, mnemonic);
+ fillSequenceContentAndPrompt(seq, mnemonic, NULL);
}
if (keyboardShortcutAccelerator != NULL) {
- fillSequenceContentAndPrompt(seq, keyboardShortcutAccelerator);
+ fillSequenceContentAndPrompt(seq, keyboardShortcutAccelerator, NULL);
}
label = p_uiItem->getDescription();
if (label != NULL) {
- fillSequenceContentAndPrompt(seq, label);
+ fillSequenceContentAndPrompt(seq, label, NULL);
}
}
@@ -953,11 +953,11 @@
Container* p_container = DataTree::Instance()->findContainer(id);
if (p_container != NULL) {
- fillSequenceCaptionAndDescription(seq, p_container);
+ fillSequenceCaptionAndDescription(seq, p_container, NULL);
Label* keyboardShortcutAccelerator = p_container->getKeyboardAccelerator();
if (keyboardShortcutAccelerator != NULL) {
- fillSequenceContentAndPrompt(seq, keyboardShortcutAccelerator);
+ fillSequenceContentAndPrompt(seq, keyboardShortcutAccelerator, NULL);
}
}
}
@@ -1040,7 +1040,7 @@
Dialog* p_dialog = DataTree::Instance()->findDialog(nItemID);
if (p_dialog != NULL) {
- fillSequenceCaptionAndDescription(seq, p_dialog);
+ fillSequenceCaptionAndDescription(seq, p_dialog, NULL);
fillSequenceSwitch(seq, p_dialog);
int count = p_dialog->getNumChildControls();
@@ -1049,7 +1049,7 @@
string strCat = control->getWidgetCategories();
int find = strCat.find("button");
if (-1 == find) {
- fillSequenceCaptionAndDescription(seq, control);
+ fillSequenceCaptionAndDescription(seq, control, presolver);
}
LabelList* p_list = control->getLabelList();
@@ -1121,7 +1121,7 @@
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
// This works for Dialogs
-AudioSequence * AudioSequencePlayer::playDialogControlFromUiIds(int dlgID, int ctrlId, bool playNow) {
+AudioSequence * AudioSequencePlayer::playDialogControlFromUiIds(int dlgID, int ctrlId, PromptResolver* pResolver, bool playNow) {
if (
(dlgID != -1 && ctrlId != -1)
@@ -1138,7 +1138,7 @@
DialogControl* control = p_dialog->findControl(ctrlId);
if (control != NULL) {
- fillSequenceCaptionAndDescription(seq, control);
+ fillSequenceCaptionAndDescription(seq, control, pResolver);
}
} else {
fillOK_CANCEL(seq, ctrlId);
@@ -1165,10 +1165,7 @@
////////////////////////////////////////////////////////////////////////////////////
void AudioSequencePlayer::fillSequencePrompt(AudioSequence* seq, Prompt* prompt, PromptResolver* pResolver) {
- resolvePromptVariables(prompt);
- if (pResolver != NULL) {
- pResolver->resolvePromptVariables(prompt);
- }
+ resolvePromptVariables(prompt, pResolver);
int sz = prompt->getNumberOfItems();
for (int i=0; i<sz; i++)
@@ -1193,16 +1190,16 @@
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
-void AudioSequencePlayer::fillSequenceCaptionAndDescription(AudioSequence* seq, UiItem* uiItem) {
+void AudioSequencePlayer::fillSequenceCaptionAndDescription(AudioSequence* seq, UiItem* uiItem, PromptResolver * pResolver) {
Label* label = uiItem->getCaption();
if (label != NULL) {
- fillSequenceContentAndPrompt(seq, label);
+ fillSequenceContentAndPrompt(seq, label, pResolver);
}
label = uiItem->getDescription();
if (label != NULL) {
- fillSequenceContentAndPrompt(seq, label);
+ fillSequenceContentAndPrompt(seq, label, pResolver);
}
}
@@ -1217,7 +1214,7 @@
case ACTIONSWITCH: {
Action* action = zwitch->getAction(switchCondition);
if (action != NULL) {
- fillSequenceCaptionAndDescription(seq, action);
+ fillSequenceCaptionAndDescription(seq, action, NULL);
}
break;
}
@@ -1225,7 +1222,7 @@
case DESCRIPTIONSWITCH: {
Label* label = zwitch->getLabel(switchCondition);
if (label != NULL) {
- fillSequenceContentAndPrompt(seq, label);
+ fillSequenceContentAndPrompt(seq, label, NULL);
}
break;
}
@@ -1235,7 +1232,7 @@
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
-void AudioSequencePlayer::fillSequenceContentAndPrompt(AudioSequence* seq, Label* label)
+void AudioSequencePlayer::fillSequenceContentAndPrompt(AudioSequence* seq, Label* label, PromptResolver * pResolver)
{
TextAudioPair* pair = label->getContents();
if (pair != NULL) {
@@ -1259,6 +1256,8 @@
Prompt* prompt = label->getPrompt();
if (prompt != NULL)
{
+ resolvePromptVariables(prompt, pResolver);
+
int count = prompt->getNumberOfItems();
for (int i=0; i<count; i++)
{
@@ -1346,8 +1345,8 @@
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
-//the new one
-void AudioSequencePlayer::resolvePromptVariables(Prompt* pPrompt)
+
+void AudioSequencePlayer::resolvePromptVariables(Prompt* pPrompt, PromptResolver* pResolver)
{
USES_CONVERSION;
@@ -1368,6 +1367,9 @@
}
}
}
+ if (pResolver != NULL) {
+ pResolver->resolvePromptVariables(pPrompt);
+ }
}
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/PreTranslateMessageHandler.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/PreTranslateMessageHandler.cpp 2008-03-18 05:58:51 UTC (rev 2431)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/PreTranslateMessageHandler.cpp 2008-03-18 07:27:33 UTC (rev 2432)
@@ -212,7 +212,7 @@
AudioSequencePlayer::Instance()->playNext(true);
}
}
-void PreTranslateMessageHandler::handle(MSG* pMsg, int idUiFocus, bool ignoreSpaceKey, bool ignoreArrowKeys, CString strTextField, CString strTextFieldFULL, bool ignoreCharKeys) {
+void PreTranslateMessageHandler::handle(PromptResolver * pResolver, MSG* pMsg, int idUiFocus, bool ignoreSpaceKey, bool ignoreArrowKeys, CString strTextField, CString strTextFieldFULL, bool ignoreCharKeys) {
if (pMsg->message == WM_KEYDOWN)
@@ -286,7 +286,7 @@
if (p_prompt_ != NULL)
{
- AudioSequencePlayer::Instance()->fillSequencePrompt(mSeq, p_prompt_, NULL);
+ AudioSequencePlayer::Instance()->fillSequencePrompt(mSeq, p_prompt_, pResolver);
}
if (!strTextFieldFULL.IsEmpty()) {
@@ -307,17 +307,17 @@
if (idUiFocus == IDOK)
{
- AudioSequencePlayer::Instance()->playDialogControlFromUiIds(m_instructionsDialogID, IDOK);
+ AudioSequencePlayer::Instance()->playDialogControlFromUiIds(m_instructionsDialogID, IDOK, pResolver);
return;
}
else if (idUiFocus == IDCANCEL)
{
- AudioSequencePlayer::Instance()->playDialogControlFromUiIds(m_instructionsDialogID, IDCANCEL);
+ AudioSequencePlayer::Instance()->playDialogControlFromUiIds(m_instructionsDialogID, IDCANCEL, pResolver);
return;
} else if (idUiFocus >= 0) {
- AudioSequence * mSeq = AudioSequencePlayer::Instance()->playDialogControlFromUiIds(m_instructionsDialogID, idUiFocus, false);
+ AudioSequence * mSeq = AudioSequencePlayer::Instance()->playDialogControlFromUiIds(m_instructionsDialogID, idUiFocus, pResolver, false);
if (mSeq == NULL) {
@@ -329,7 +329,7 @@
if (p_prompt_ != NULL)
{
- AudioSequencePlayer::Instance()->fillSequencePrompt(mSeq, p_prompt_, NULL);
+ AudioSequencePlayer::Instance()->fillSequencePrompt(mSeq, p_prompt_, pResolver);
}
}
}
@@ -373,7 +373,7 @@
if (p_prompt_ != NULL)
{
- AudioSequencePlayer::Instance()->fillSequencePrompt(mSeq, p_prompt_, NULL);
+ AudioSequencePlayer::Instance()->fillSequencePrompt(mSeq, p_prompt_, pResolver);
}
mSeq->append(strTextFieldFULL);
}
Modified: branches/amis3/DefaultLangpack/amisAccessibleUi.xml
===================================================================
--- branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-18 05:58:51 UTC (rev 2431)
+++ branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-18 07:27:33 UTC (rev 2432)
@@ -1200,6 +1200,7 @@
<prompt>
<promptItem refid="thisItemIsCurrently"/>
<promptVar name="ON_OR_OFF" param="SELF_VOICING_FEATURE"/>
+ <promptItem refid="spaceToToggle"/>
</prompt>
</description>
</control>
@@ -1246,7 +1247,7 @@
</prompt>
</description>
</control>
- <control mfcid="IDC_STARTINBASICVIEWBASIC" widget="checkbox">
+ <control mfcid="IDC_STARTINBASICVIEW" widget="checkbox">
<caption>
<!--changed text-->
<text id="t223">Start in basic view mode</text>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-18 07:42:34
|
Revision: 2433
http://amis.svn.sourceforge.net/amis/?rev=2433&view=rev
Author: marisademeglio
Date: 2008-03-18 00:42:39 -0700 (Tue, 18 Mar 2008)
Log Message:
-----------
Modified default Preferences
Opening URLs from the command line now supported
Modified Paths:
--------------
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/bin/settings/amisPrefs.xml.default
Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-18 07:27:33 UTC (rev 2432)
+++ branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-18 07:42:39 UTC (rev 2433)
@@ -77,7 +77,6 @@
using namespace amis::gui;
-
BEGIN_MESSAGE_MAP(CAmisApp, CWinApp)
ON_COMMAND(ID_AMIS_OPEN_FILE, OnFileOpen)
ON_COMMAND(ID_AMIS_PLAYPAUSE, OnPlayPause)
@@ -117,6 +116,8 @@
ON_COMMAND(ID_AMIS_SHOW_TEXTSTYLE, OnShowTextStyle)
END_MESSAGE_MAP()
+
+
CAmisApp::CAmisApp()
{
mpHistory = NULL;
@@ -196,24 +197,34 @@
//command parameters want to open a document.
//our workaround is the mbShouldIgnoreOpenDoc event flag
mbShouldIgnoreOpenDocEvent = true;
+ //save the value in cmdInfo
+ CString cmd_file_name = cmdInfo.m_strFileName;
+ bool b_open_from_cmdline = false;
+ ambulant::net::url book_to_open;
+ if (cmd_file_name.GetLength() > 0)
+ {
+ b_open_from_cmdline = true;
+ if (cmd_file_name.Find(_T(":")) != 1)
+ {
+ //override the cmd info data; otherwise MFC will do something clever with this URL and crash
+ cmdInfo.m_strFileName.Empty();
+ cmdInfo.m_nShellCommand = CCommandLineInfo::FileNew;
+ book_to_open = ambulant::net::url::from_url(T2A(cmd_file_name));
+ }
+ //else it's a local file and there shouldn't be any problems
+ else
+ {
+ book_to_open = ambulant::net::url::from_filename(T2A(cmd_file_name));
+ }
+ amis::util::Log::Instance()->writeMessage("Command line parameter: ", &book_to_open, "CAmisApp::InitInstance", "AmisGuiMFC2");
+ }
if (!ProcessShellCommand(cmdInfo))
{
amis::util::Log::Instance()->writeError("Error processing shell command info", "CAmisApp::InitInstance", "AmisGuiMFC2");
return FALSE;
}
mbShouldIgnoreOpenDocEvent = false;
- bool b_open_from_cmdline = false;
- ambulant::net::url book_to_open;
- if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileOpen)
- {
- //we have to assume that command line parameters are local files
- //TODO: introduce a command line parameter to identify URLs
- //if we get the two mixed up, then the path gets mangled
- b_open_from_cmdline = true;
- book_to_open = ambulant::net::url::from_filename(T2A(cmdInfo.m_strFileName));
- amis::util::Log::Instance()->writeMessage("Command line parameter: ", &book_to_open, "CAmisApp::InitInstance", "AmisGuiMFC2");
- }
-
+ //done with command line stuff .. phew
// try to load shared MDI menus and accelerator table
HINSTANCE hInst = AfxGetResourceHandle();
@@ -375,11 +386,6 @@
//this function is used by all functions here that lead to a book being opened
void CAmisApp::openBook(const ambulant::net::url* filename)
{
- //TODO: AMIS says "TITLE" Playing etc even if the book couldn't be opened
- MainWndParts::Instance()->updateTitleBar(MainWndParts::TITLEBAR_APPNAME, CString(L"Amis"));
- MainWndParts::Instance()->updateTitleViewMode();
- MainWndParts::Instance()->updateTitleSelfVoicing(Preferences::Instance()->getIsSelfVoicing());
-
bool b_a_book_was_open = false;
//close the open book
if (mbBookIsOpen == true)
@@ -393,6 +399,11 @@
if (amis::dtb::DtbWithHooks::Instance()->open
(filename, amis::Preferences::Instance()->getUserBmkDir()))
{
+ //update the status in the title bar
+ MainWndParts::Instance()->updateTitleBar(MainWndParts::TITLEBAR_APPNAME, CString(L"Amis"));
+ MainWndParts::Instance()->updateTitleViewMode();
+ MainWndParts::Instance()->updateTitleSelfVoicing(Preferences::Instance()->getIsSelfVoicing());
+
mbBookIsOpen = true;
MainWndParts::Instance()->mpMainFrame->updateToolbarState
(MainWndParts::Instance()->mpBasicToolbar);
@@ -552,6 +563,8 @@
MainWndParts::Instance()->mpMmView->OnDestroy();
amis::gui::MainWndParts::Instance()->mpSidebar->m_wndDlg.clearAll();
amis::gui::MenuManip::Instance()->clearBookmarks();
+ //update the status in the title bar
+ amis::gui::MainWndParts::Instance()->updateTitleBar(amis::gui::MainWndParts::TITLEBAR_BOOKTITLE, _T(""));
}
}
Modified: branches/amis3/bin/settings/amisPrefs.xml.default
===================================================================
--- branches/amis3/bin/settings/amisPrefs.xml.default 2008-03-18 07:27:33 UTC (rev 2432)
+++ branches/amis3/bin/settings/amisPrefs.xml.default 2008-03-18 07:42:39 UTC (rev 2433)
@@ -4,8 +4,8 @@
<section name="general">
<entry id="ui-lang-id" value="eng-US"/>
<entry id="start-in-basic-view" value="no"/>
-<entry id="load-last-book" value="no"/>
-<entry id="is-self-voicing" value="no"/>
+<entry id="load-last-book" value="yes"/>
+<entry id="is-self-voicing" value="yes"/>
<entry id="tts-voice-index" value="0"/>
<entry id="pause-on-lost-focus" value="no"/>
<entry id="use-tts-not-audio" value="no"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dan...@us...> - 2008-03-18 15:36:25
|
Revision: 2436
http://amis.svn.sourceforge.net/amis/?rev=2436&view=rev
Author: daniel_weck
Date: 2008-03-18 08:36:16 -0700 (Tue, 18 Mar 2008)
Log Message:
-----------
- PreferencesDialog:
* TTS Voice selection is now self-voiced, with the ability to preview the voice without saving the preferences (voice selection only saved for good when pressing OK)
* The language selection combo is also voiced now, with the proper audio title rather than just "eng-US".
Modified Paths:
--------------
branches/amis3/AmisGuiMFC2/include/gui/self-voicing/AudioSequencePlayer.h
branches/amis3/AmisGuiMFC2/src/Preferences.cpp
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/AmisGuiMFC2/src/gui/dialogs/PreferencesDialog.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/PreTranslateMessageHandler.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/TTSPlayer.cpp
branches/amis3/DefaultLangpack/amisAccessibleUi.xml
Modified: branches/amis3/AmisGuiMFC2/include/gui/self-voicing/AudioSequencePlayer.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/self-voicing/AudioSequencePlayer.h 2008-03-18 12:16:56 UTC (rev 2435)
+++ branches/amis3/AmisGuiMFC2/include/gui/self-voicing/AudioSequencePlayer.h 2008-03-18 15:36:16 UTC (rev 2436)
@@ -82,9 +82,12 @@
static void fillSequencePrompt(AudioSequence* seq, Prompt* prompt, PromptResolver* pResolver);
static void fillSequenceCaptionAndDescription(AudioSequence* seq, UiItem* uiItem, PromptResolver * pResolver);
static void fillSequenceSwitch(AudioSequence* seq, UiItem* uiItem, string switchCondition = "");
+
static void fillSequenceContentAndPrompt(AudioSequence* seq, Label* label, PromptResolver * pResolver);
+ static void fillSequenceContentAndPrompt(AudioSequence* seq, LabelList * p_list, PromptResolver * pResolver);
+
static void fillSequenceContents(AudioSequence* seq, PromptItemBase* pi);
-
+
static void resolvePromptVariables(Prompt*, PromptResolver* pResolver);
private:
Modified: branches/amis3/AmisGuiMFC2/src/Preferences.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/Preferences.cpp 2008-03-18 12:16:56 UTC (rev 2435)
+++ branches/amis3/AmisGuiMFC2/src/Preferences.cpp 2008-03-18 15:36:16 UTC (rev 2436)
@@ -51,7 +51,7 @@
setUseTTSNotAudio(false);
setLoadLastBook(false);
setStartInBasicView(false);
- setTTSVoiceIndex(-1);
+ setTTSVoiceIndex(0);
setWasExitClean(true);
setDisableScreensaver(true);
mFontsizeCssFiles.clear();
Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-18 12:16:56 UTC (rev 2435)
+++ branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-18 15:36:16 UTC (rev 2436)
@@ -779,6 +779,7 @@
amis::util::Log::Instance()->writeMessage("Showing preferences dialog", "CAmisApp::OnPreferences", "AmisGuiMFC2");
if (prefs.do_modal() == IDOK)
{
+ Preferences::Instance()->setTTSVoiceIndex(prefs.mTTSVoiceIndex);
Preferences::Instance()->setIsSelfVoicing(prefs.mbIsSelfVoicing);
Preferences::Instance()->setPauseOnLostFocus(prefs.mbPauseOnLostFocus);
Preferences::Instance()->setStartInBasicView(prefs.mbStartInBasicView);
@@ -800,8 +801,12 @@
prefs_io.writeToFile(Preferences::Instance()->getSourceUrl()->get_file(), Preferences::Instance());
Preferences::Instance()->logUserControllablePreferences();
}
- else
+ else {
amis::util::Log::Instance()->writeMessage("Dialog cancelled", "CAmisApp::OnPreferences", "AmisGuiMFC2");
+
+ // make sure to restore the original voice (which may have been changed in the preference dialog)
+ amis::tts::TTSPlayer::Instance()->ChangeVoice(Preferences::Instance()->getTTSVoiceIndex());
+ }
}
void CAmisApp::OnPublicationSummary()
{
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/PreferencesDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/PreferencesDialog.cpp 2008-03-18 12:16:56 UTC (rev 2435)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/PreferencesDialog.cpp 2008-03-18 15:36:16 UTC (rev 2436)
@@ -163,22 +163,52 @@
}
}
}else if (p_var->getName().compare("LANGUAGE_NAME") == 0)
- {
+ {
+
+ CComboBox* lang_combo = (CComboBox*)GetDlgItem(IDC_INSTALLEDLANGUAGES);
+ int sel = lang_combo->GetCurSel();
+ amis::StringModuleMap* p_langs = Preferences::Instance()->getInstalledLanguages();
+ amis::StringModuleMap::iterator it = p_langs->begin();
+ //increment the iterator to go to the same number as the combo selection
+ for (int i = 0; i<sel; i++) it++;
+ mUiLanguageSelection = it->first;
+
+
wstring str;
CString cstr(mUiLanguageSelection.c_str());
str = cstr;
p_var->setContents(str, "");
+
+ amis::ModuleDescData* p_data = Preferences::Instance()->getCurrentLanguageData();
+ if (p_data != NULL || p_data->getLabel() != NULL) {
+
+ amis::MediaGroup* p_media = p_data->getLabel();
+ //p_media->getText()->getTextString().c_str();
+
+ p_var->setContents(p_media);
+
+ }
+
+
}else if (p_var->getName().compare("TTS_VOICE_NAME") == 0)
- {
-
- CComboBox* list = (CComboBox*)GetDlgItem(IDC_TTSVOICES);
+ {
+ CComboBox* list = (CComboBox*)GetDlgItem(IDC_TTSVOICES);
- wstring str = L"Daniel";
- p_var->setContents(str, "");
+ int selected = list->GetCurSel();
+ mTTSVoiceIndex = selected;
+
+ amis::tts::TTSPlayer::Instance()->ChangeVoice(selected);
+
+ CString cstr;
+ list->GetWindowText(cstr);
+ wstring str = L"Daniel";
+ str = cstr.GetBuffer();
+ p_var->setContents(str, "");
+
}
-
+
}
}
AmisDialogBase::resolvePromptVariables(pPrompt);
@@ -209,6 +239,7 @@
}
BOOL PreferencesDialog::OnInitDialog()
{
+
mbIsSelfVoicing = Preferences::Instance()->getIsSelfVoicing();
mbPauseOnLostFocus = Preferences::Instance()->getPauseOnLostFocus();
mbLoadLastBook = Preferences::Instance()->getLoadLastBook();
@@ -225,13 +256,17 @@
void PreferencesDialog::initializeTTSVoiceOption()
{
+ // Make sure to initialize the voice (just in case TTSPlayer has been unused until now)
+ amis::tts::TTSPlayer::Instance()->ChangeVoice(Preferences::Instance()->getTTSVoiceIndex());
+
+ mTTSVoiceIndex = 0;
//fill the combo box for the tts voices, and return an index to the voice we are currently using
- //TODO: need this "initVoiceList" function
int index = amis::tts::TTSPlayer::Instance()->initVoiceList(this->GetSafeHwnd());
if (index != -1)
{
CComboBox* list = (CComboBox*)GetDlgItem(IDC_TTSVOICES);
list->SetCurSel(index);
+ mTTSVoiceIndex = index;
}
}
void PreferencesDialog::initializeUiLanguageOption()
@@ -334,9 +369,16 @@
}
void PreferencesDialog::OnCbnSelchangeTTSVoices()
{
+ CComboBox* list = (CComboBox*)GetDlgItem(IDC_TTSVOICES);
+
+ int selected = list->GetCurSel();
+ mTTSVoiceIndex = selected;
+
+ triggerVirtualKeyStroke();
}
void PreferencesDialog::OnCbnSetfocusTTSVoices()
{
+ triggerVirtualKeyStroke();
}
void PreferencesDialog::OnBnClickedStartInBasicView()
{
@@ -367,10 +409,13 @@
amis::StringModuleMap::iterator it = p_langs->begin();
//increment the iterator to go to the same number as the combo selection
for (int i = 0; i<sel; i++) it++;
- mUiLanguageSelection = it->first;
+ mUiLanguageSelection = it->first;
+
+ triggerVirtualKeyStroke();
}
void PreferencesDialog::OnCbnSetfocusInstalledLanguages()
-{
+{
+ triggerVirtualKeyStroke();
}
void PreferencesDialog::OnBnSetfocusDisableScreensaver()
{
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp 2008-03-18 12:16:56 UTC (rev 2435)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp 2008-03-18 15:36:16 UTC (rev 2436)
@@ -890,7 +890,10 @@
if (label != NULL) {
fillSequenceContentAndPrompt(seq, label, NULL);
}
-
+ LabelList * list = p_uiItem->getLabelList();
+ if (list != NULL) {
+ fillSequenceContentAndPrompt(seq, list, NULL);
+ }
}
else {
@@ -1055,6 +1058,9 @@
LabelList* p_list = control->getLabelList();
if (p_list != NULL)
{
+
+ fillSequenceContentAndPrompt(seq, p_list, presolver);
+ /*
for (int i = 0; i<p_list->getNumberOfLabels(); i++)
{
Prompt* p_prompt = p_list->getLabel(i)->getPrompt();
@@ -1062,7 +1068,7 @@
{
fillSequencePrompt(seq, p_prompt, presolver);
}
- }
+ }*/
}
}
}
@@ -1138,6 +1144,9 @@
DialogControl* control = p_dialog->findControl(ctrlId);
if (control != NULL) {
+ if (ctrlId == IDC_TTSVOICES) {
+ int i = 0;
+ }
fillSequenceCaptionAndDescription(seq, control, pResolver);
}
} else {
@@ -1201,6 +1210,21 @@
if (label != NULL) {
fillSequenceContentAndPrompt(seq, label, pResolver);
}
+ LabelList * p_list = uiItem->getLabelList();
+
+ if (p_list != NULL)
+ {
+ fillSequenceContentAndPrompt(seq, p_list, pResolver);
+ /*
+ for (int i = 0; i<p_list->getNumberOfLabels(); i++)
+ {
+ Prompt* p_prompt = p_list->getLabel(i)->getPrompt();
+ if (p_prompt != NULL)
+ {
+ fillSequencePrompt(seq, p_prompt, pResolver);
+ }
+ }*/
+ }
}
////////////////////////////////////////////////////////////////////////////////////
@@ -1232,6 +1256,19 @@
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
+void AudioSequencePlayer::fillSequenceContentAndPrompt(AudioSequence* seq, LabelList * p_list, PromptResolver * pResolver)
+{
+ for (int i = 0; i<p_list->getNumberOfLabels(); i++)
+ {
+ Prompt* p_prompt = p_list->getLabel(i)->getPrompt();
+ if (p_prompt != NULL)
+ {
+ fillSequencePrompt(seq, p_prompt, pResolver);
+ }
+ }
+}
+////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
void AudioSequencePlayer::fillSequenceContentAndPrompt(AudioSequence* seq, Label* label, PromptResolver * pResolver)
{
TextAudioPair* pair = label->getContents();
@@ -1256,6 +1293,9 @@
Prompt* prompt = label->getPrompt();
if (prompt != NULL)
{
+ fillSequencePrompt(seq, prompt, pResolver);
+
+ /*
resolvePromptVariables(prompt, pResolver);
int count = prompt->getNumberOfItems();
@@ -1317,6 +1357,7 @@
}
}
}
+ */
}
}
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/PreTranslateMessageHandler.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/PreTranslateMessageHandler.cpp 2008-03-18 12:16:56 UTC (rev 2435)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/PreTranslateMessageHandler.cpp 2008-03-18 15:36:16 UTC (rev 2436)
@@ -323,7 +323,7 @@
mSeq = new AudioSequence();
- if (idUiFocus == IDC_URL) {
+ if (idUiFocus == IDC_URL) { // TODO: this is a temporary hack until there is XML data for the URL open dialog
Prompt* p_prompt_ = DataTree::Instance()->findPrompt("textFieldEntry");
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/TTSPlayer.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/TTSPlayer.cpp 2008-03-18 12:16:56 UTC (rev 2435)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/TTSPlayer.cpp 2008-03-18 15:36:16 UTC (rev 2436)
@@ -233,6 +233,7 @@
ChangeVoice(amis::Preferences::Instance()->getTTSVoiceIndex());
+
//ChangeVoice(FALSE);
m_iV->SetVolume(50); //TODO: this value works well on my laptop/configuration...but how about other machines ??
Modified: branches/amis3/DefaultLangpack/amisAccessibleUi.xml
===================================================================
--- branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-18 12:16:56 UTC (rev 2435)
+++ branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-18 15:36:16 UTC (rev 2436)
@@ -1204,7 +1204,7 @@
</prompt>
</description>
</control>
- <control mfcid="IDC_TTSVOICE" widget="list">
+ <control mfcid="IDC_TTSVOICES" widget="list">
<caption mfcid="IDC_SELTTSLABEL">
<text id="t221">Select TTS voice:</text>
<audio src="./audio/219_Select_TTS_voice.mp3"/>
@@ -1290,7 +1290,7 @@
</description>
</control>
<!--new item (except for t197)-->
- <control mfcid="IDC_LANGLIST" widget="list">
+ <control mfcid="IDC_INSTALLEDLANGUAGES" widget="list">
<caption mfcid="IDC_CURRLANG">
<text id="xx">You are currently using AMIS in:</text>
<audio src=""/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-18 20:33:12
|
Revision: 2441
http://amis.svn.sourceforge.net/amis/?rev=2441&view=rev
Author: marisademeglio
Date: 2008-03-18 13:33:17 -0700 (Tue, 18 Mar 2008)
Log Message:
-----------
new release and version audio files; new release notes
Modified Paths:
--------------
branches/amis3/amis_features.txt
branches/amis3/amis_issues.txt
branches/amis3/bin/settings/lang/releasedate.mp3
branches/amis3/bin/settings/lang/version.mp3
Added Paths:
-----------
branches/amis3/alpha-2-release-notes.txt
Added: branches/amis3/alpha-2-release-notes.txt
===================================================================
--- branches/amis3/alpha-2-release-notes.txt (rev 0)
+++ branches/amis3/alpha-2-release-notes.txt 2008-03-18 20:33:17 UTC (rev 2441)
@@ -0,0 +1,38 @@
+ALPHA 2 Release Notes
+March 18, 2008
+
+FEATURES AND FIXES ADDED AFTER ALPHA 1
+-------
+* Loads last book on startup
+* Loads from command line
+* Supports an unlimited number of font size CSS files. The default is still 4.
+* If no dc:identifier or the bookmark file can't be created, it no longer crashes
+* publication summary dialog not getting current section for zed books
+* "previous section" works as it should
+* bookmarking for books with non-ascii dc:identifiers
+* dialog to adjust highlight colors and font type
+* font and fontsize control in the sidebar
+* phrase arrow keys work when the focus is in the sidebar
+* page navigation bug fixed
+* navigation cursor synchronized
+* bookmarks cleared when closing a book
+* IE7 right-click menu doesn't appear
+* Navigation text not cut off in nav lists
+* stabilized self-voicing for menus
+* audio changes speed
+* play/pause buttons show the correct state
+* can open a URL from the command line
+
+KNOWN ISSUES
+-------
+* Load CD shows more titles than the ones on discinfo.htm. However, we don't think this is really a bug.
+* Shows □□ for <br /> in the list of bookmarks
+* A book won't close all the way
+* Zed stylesheet doesn't work
+* Page styles overlap a bit when applied in sequence
+* Book in a japanese folder can't be opened
+* Not all shortcuts are displayed in the menu items. They are active though. (i.e. open URL: CTRL+U).
+* Not all dialogs are fully self-voicing
+* Audio for some user interface items might not be an exact match for the text
+* "Browse" button in the Search for Books dialog doesn't work
+
Modified: branches/amis3/amis_features.txt
===================================================================
--- branches/amis3/amis_features.txt 2008-03-18 20:18:17 UTC (rev 2440)
+++ branches/amis3/amis_features.txt 2008-03-18 20:33:17 UTC (rev 2441)
@@ -43,7 +43,7 @@
Open a recently-read book
Automatically open your last-read book on startup
-Open a local book from the command line
+Open a book from the command line
Open the contents of a CD-ROM containing a single book or containing multiple books
Open a book from your local file system
Open a book from a remote URL
@@ -59,6 +59,7 @@
Move the navigation sidebar around the screen
Change the style of the page
Make the font bigger up to X times (and go back and forth between sizes)
+Adjust highlight colors and change the sidebar font through the Text Style dialog
Customization
Toolbars
@@ -68,12 +69,11 @@
Fontsize
- font size is defined using css files in settings\css\font\*.css
- - You can put anything in here up to X files.
+ - You can put any number of files in here. They will be applied in alphabetical order, so put the smallest increase in font size first in the list of files, and the largest increase last.
Page styles
- page styles are defined using css files in settings\css\customStyles\*.css
- You can put anything in here and it will show up in the Page Styles submenu.
- Each will be applied in turn when the user presses the Page Style button.
- AMIS own highlight settings are defined in settings\css\amis.css . See the notes there about how the file is set up.
-
\ No newline at end of file
+ User-defined default styles should be added to settings\css\amis.css .
Modified: branches/amis3/amis_issues.txt
===================================================================
--- branches/amis3/amis_issues.txt 2008-03-18 20:18:17 UTC (rev 2440)
+++ branches/amis3/amis_issues.txt 2008-03-18 20:33:17 UTC (rev 2441)
@@ -31,7 +31,8 @@
* a book won't close all the way
* Zed stylesheet doesn't work
==>problem reproduced in a test app: applying CSS to XML in an HtmlView doesn't work
-* Page styles overlap a bit when applyed in sequence
+* Page styles overlap a bit when applied in sequence
+* book in a japanese folder can't be opened (ambulant::net::url problem?)
AMBULANT ISSUES (some of these are repeated from the above "Known Issues" list)
--
Modified: branches/amis3/bin/settings/lang/releasedate.mp3
===================================================================
(Binary files differ)
Modified: branches/amis3/bin/settings/lang/version.mp3
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-18 21:13:57
|
Revision: 2442
http://amis.svn.sourceforge.net/amis/?rev=2442&view=rev
Author: marisademeglio
Date: 2008-03-18 14:13:40 -0700 (Tue, 18 Mar 2008)
Log Message:
-----------
updated features and issues
Modified Paths:
--------------
branches/amis3/alpha-2-release-notes.txt
branches/amis3/amis_issues.txt
Modified: branches/amis3/alpha-2-release-notes.txt
===================================================================
--- branches/amis3/alpha-2-release-notes.txt 2008-03-18 20:33:17 UTC (rev 2441)
+++ branches/amis3/alpha-2-release-notes.txt 2008-03-18 21:13:40 UTC (rev 2442)
@@ -22,6 +22,7 @@
* audio changes speed
* play/pause buttons show the correct state
* can open a URL from the command line
+* reading options dialog works
KNOWN ISSUES
-------
Modified: branches/amis3/amis_issues.txt
===================================================================
--- branches/amis3/amis_issues.txt 2008-03-18 20:33:17 UTC (rev 2441)
+++ branches/amis3/amis_issues.txt 2008-03-18 21:13:40 UTC (rev 2442)
@@ -17,10 +17,9 @@
ISSUES and BUGS (things to address)
---
-* READING_OPTIONS dialog crashes...very strange unexplained bug, probably some internal MFC conflict.
-[MARISA + DANIEL on it for next release]
+
KNOWN ISSUES (not going to change for alpha 2; should be listed as bugs to work on for beta 1)
---
* Load CD shows more titles than the ones on discinfo.html
@@ -151,4 +150,5 @@
* stabilized self-voicing for menus
* audio changes speed
* play/pause buttons show the correct state
-* can open a URL from the command line
\ No newline at end of file
+* can open a URL from the command line
+* reading options dialog works
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-18 21:23:42
|
Revision: 2444
http://amis.svn.sourceforge.net/amis/?rev=2444&view=rev
Author: marisademeglio
Date: 2008-03-18 14:23:29 -0700 (Tue, 18 Mar 2008)
Log Message:
-----------
stupid reading options dialog works!
Modified Paths:
--------------
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
branches/amis3/AmisGuiMFC2/include/gui/dialogs/SkipDialog.h
branches/amis3/AmisGuiMFC2/resource.h
branches/amis3/AmisGuiMFC2/src/gui/dialogs/SkipDialog.cpp
branches/amis3/DefaultLangpack/amisAccessibleUi.xml
branches/amis3/bin/settings/resource.h.ini
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.aps
===================================================================
(Binary files differ)
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-18 21:23:14 UTC (rev 2443)
+++ branches/amis3/AmisGuiMFC2/AmisGuiMFC2.rc 2008-03-18 21:23:29 UTC (rev 2444)
@@ -67,14 +67,6 @@
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
- IDD_SKIP, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 231
- TOPMARGIN, 7
- BOTTOMMARGIN, 179
- END
-
IDD_SIDEBAR, DIALOG
BEGIN
RIGHTMARGIN, 86
@@ -152,6 +144,14 @@
TOPMARGIN, 7
BOTTOMMARGIN, 142
END
+
+ IDD_READING_OPTIONS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 229
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 184
+ END
END
#endif // APSTUDIO_INVOKED
@@ -252,18 +252,6 @@
// Dialog
//
-IDD_SKIP DIALOGEX 0, 0, 238, 186
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Reading options"
-FONT 8, "MS Sans Serif", 0, 0, 0x0
-BEGIN
- LTEXT "This book contains the following special types of items. Checked items will be played. Unchecked items will be skipped.",
- IDC_SKIP_INSTRUCTIONS,7,7,224,21
- LISTBOX IDC_SKIPS,7,32,224,123,LBS_HASSTRINGS |
- LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
- DEFPUSHBUTTON "OK",IDOK,94,165,50,14
-END
-
IDD_SIDEBAR DIALOGEX 0, 0, 175, 183
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_VISIBLE |
WS_CLIPCHILDREN | WS_BORDER
@@ -431,7 +419,21 @@
PUSHBUTTON "Cancel",IDCANCEL,94,128,50,14
END
+IDD_READING_OPTIONS DIALOGEX 0, 0, 236, 191
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
+ WS_SYSMENU
+CAPTION "Reading Options"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,94,170,50,14
+ LTEXT "This book contains the following special types of items. Checked items will be played. Unchecked items will be skipped.",
+ IDC_READING_OPTIONS_INSTRUCTIONS,7,7,222,31
+ LISTBOX IDC_OPTIONS_LIST,7,31,222,134,LBS_OWNERDRAWFIXED |
+ LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
+ WS_TABSTOP
+END
+
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
Modified: branches/amis3/AmisGuiMFC2/include/gui/dialogs/SkipDialog.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/dialogs/SkipDialog.h 2008-03-18 21:23:14 UTC (rev 2443)
+++ branches/amis3/AmisGuiMFC2/include/gui/dialogs/SkipDialog.h 2008-03-18 21:23:29 UTC (rev 2444)
@@ -46,7 +46,7 @@
~SkipDialog();
void initializeData(amis::dtb::CustomTestSet*);
//Dialog Data
- enum { IDD = IDD_SKIP };
+ enum { IDD = IDD_READING_OPTIONS };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
@@ -58,7 +58,7 @@
protected:
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
-CCheckListBox m_ListSkips;
+ CCheckListBox m_ListSkips;
private:
void fillListBox();
void saveChanges();
Modified: branches/amis3/AmisGuiMFC2/resource.h
===================================================================
--- branches/amis3/AmisGuiMFC2/resource.h 2008-03-18 21:23:14 UTC (rev 2443)
+++ branches/amis3/AmisGuiMFC2/resource.h 2008-03-18 21:23:29 UTC (rev 2444)
@@ -16,7 +16,6 @@
#define ID_AMIS_TOGGLE_AUDIO_SELFVOICING_PLAYBACK 134
#define IDD_FIND 147
#define AMIS_VIEW_MENU_BASE_ID 150
-#define IDD_SKIP 153
#define IDI_AMIS 164
#define IDD_SEARCHDAISY 177
#define IDD_GOTOPAGE 180
@@ -27,6 +26,7 @@
#define IDD_OPENURL 190
#define IDD_PREFERENCES 191
#define IDD_TEXTSTYLE 192
+#define IDD_READING_OPTIONS 193
#define AMIS_RECENT_BOOK_BASE_ID 200
#define AMIS_SECTION_DEPTH_BASE_ID 250
#define AMIS_NAVLIST_BASE_ID 300
@@ -49,7 +49,6 @@
#define IDC_PICTURE 1050
#define IDC_SEARCHING 1051
#define IDC_FILESFOUND 1052
-#define IDC_SKIPS 1054
#define IDC_PAGENUM 1055
#define IDC_SEARCHPATH 1056
#define IDC_BOOKLIST 1058
@@ -68,7 +67,6 @@
#define IDC_INSTALLEDLANGUAGES 1097
#define IDC_PUBLICATIONSUMMARYCAPTION 1100
#define IDC_AMISICON 1101
-#define IDC_SKIP_INSTRUCTIONS 1102
#define IDC_MULTIVOLCD_INSTRUCTIONS 1103
#define IDC_GOTOPAGE_CAPTION 1104
#define IDC_OPENURL_CAPTION 1105
@@ -81,6 +79,9 @@
#define IDC_TEXTSTYLEPREVIEW 1112
#define IDC_TEXTPREVIEW 1113
#define IDC_EDIT1 1114
+#define IDC_READING_OPTIONS_INSTRUCTIONS 1115
+#define IDC_LIST1 1116
+#define IDC_OPTIONS_LIST 1116
#define SELF_VOICING_PLAY_NEXT 6969
#define IDC_CURRLANG 9002
#define IDC_VERSION 9006
@@ -132,9 +133,9 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 193
+#define _APS_NEXT_RESOURCE_VALUE 194
#define _APS_NEXT_COMMAND_VALUE 32955
-#define _APS_NEXT_CONTROL_VALUE 1115
+#define _APS_NEXT_CONTROL_VALUE 1117
#define _APS_NEXT_SYMED_VALUE 143
#endif
#endif
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/SkipDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/SkipDialog.cpp 2008-03-18 21:23:14 UTC (rev 2443)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/SkipDialog.cpp 2008-03-18 21:23:29 UTC (rev 2444)
@@ -75,11 +75,11 @@
if (cwnd)
{
int id = cwnd->GetDlgCtrlID();
- mCommonPreTranslateMessageHandler->handle(this, pMsg, (cwnd == NULL ? -1 : id), (id == IDC_SKIPS ? true : false), (id == IDC_SKIPS ? true : false), L"", L"", (id == IDC_SKIPS ? true : false));
+ mCommonPreTranslateMessageHandler->handle(this, pMsg, (cwnd == NULL ? -1 : id), (id == IDC_OPTIONS_LIST ? true : false), (id == IDC_OPTIONS_LIST ? true : false), L"", L"", (id == IDC_OPTIONS_LIST ? true : false));
if (pMsg->message == WM_KEYUP)
{
- if (id == IDC_SKIPS && (pMsg->wParam == ' ' || pMsg->wParam == VK_SPACE))
+ if (id == IDC_OPTIONS_LIST && (pMsg->wParam == ' ' || pMsg->wParam == VK_SPACE))
{
OnSelchangeSkips();
}
@@ -94,7 +94,7 @@
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSkipDialog)
- DDX_Control(pDX, IDC_SKIPS, m_ListSkips);
+ DDX_Control(pDX, IDC_OPTIONS_LIST, m_ListSkips);
DDX_Control(pDX, IDOK, m_Ok);
//}}AFX_DATA_MAP
}
@@ -108,6 +108,7 @@
BOOL SkipDialog::OnInitDialog()
{
+
CDialog::OnInitDialog();
//clear the list box
@@ -170,7 +171,7 @@
}
BEGIN_MESSAGE_MAP(SkipDialog, CDialog)
- ON_LBN_SELCHANGE(IDC_SKIPS, OnSelchangeSkips)
+ ON_LBN_SELCHANGE(IDC_OPTIONS_LIST, OnSelchangeSkips)
//{{AFX_MSG_MAP(SkipDialog)
ON_WM_PAINT()
//}}AFX_MSG_MAP
Modified: branches/amis3/DefaultLangpack/amisAccessibleUi.xml
===================================================================
--- branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-18 21:23:14 UTC (rev 2443)
+++ branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-18 21:23:29 UTC (rev 2444)
@@ -1125,14 +1125,14 @@
</mnemonic>
</control>
</dialog>
- <dialog mfcid="IDD_SKIP">
+ <dialog mfcid="IDD_READING_OPTIONS">
<note>This dialog lets the user control rendering of skippable structures.</note>
<caption>
<!--changed text-->
<text id="t187">Reading Options</text>
<audio src="./audio/speechgen0191.mp3" from="file:///Users/marisa/amisxml/narrated/daisy202/speechgen0191.smil#txtd1334e9"/>
</caption>
- <description mfcid="IDC_SKIP_INSTRUCTIONS">
+ <description mfcid="IDC_READING_OPTIONS_INSTRUCTIONS">
<text id="t188">This book contains the following special types of items. Checked items will be played. Unchecked items will be skipped.</text>
<audio src="./audio/speechgen0192.mp3" from="file:///Users/marisa/amisxml/narrated/daisy202/speechgen0192.smil#txtd1341e15"/>
</description>
@@ -1150,7 +1150,7 @@
<promptItem refid="ok_button_description"/>
</description>
</control>
- <control mfcid="IDC_SKIPS" widget="list">
+ <control mfcid="IDC_OPTIONS_LIST" widget="list">
<caption>
<text id="t190">Skippable items</text>
<audio src="./audio/speechgen0193.mp3" from="file:///Users/marisa/amisxml/narrated/daisy202/speechgen0193.smil#txtd1350e9"/>
Modified: branches/amis3/bin/settings/resource.h.ini
===================================================================
--- branches/amis3/bin/settings/resource.h.ini 2008-03-18 21:23:14 UTC (rev 2443)
+++ branches/amis3/bin/settings/resource.h.ini 2008-03-18 21:23:29 UTC (rev 2444)
@@ -1,6 +1,9 @@
;
[resources]
+
+
+
IDD_ABOUTBOX=100
IDS_PROPSHT_CAPTION=102
IDD_SIDEBAR=103
@@ -15,7 +18,6 @@
ID_AMIS_TOGGLE_AUDIO_SELFVOICING_PLAYBACK=134
IDD_FIND=147
AMIS_VIEW_MENU_BASE_ID=150
-IDD_SKIP=153
IDI_AMIS=164
IDD_SEARCHDAISY=177
IDD_GOTOPAGE=180
@@ -26,6 +28,7 @@
IDD_OPENURL=190
IDD_PREFERENCES=191
IDD_TEXTSTYLE=192
+IDD_READING_OPTIONS=193
AMIS_RECENT_BOOK_BASE_ID=200
AMIS_SECTION_DEPTH_BASE_ID=250
AMIS_NAVLIST_BASE_ID=300
@@ -48,7 +51,6 @@
IDC_PICTURE=1050
IDC_SEARCHING=1051
IDC_FILESFOUND=1052
-IDC_SKIPS=1054
IDC_PAGENUM=1055
IDC_SEARCHPATH=1056
IDC_BOOKLIST=1058
@@ -67,7 +69,6 @@
IDC_INSTALLEDLANGUAGES=1097
IDC_PUBLICATIONSUMMARYCAPTION=1100
IDC_AMISICON=1101
-IDC_SKIP_INSTRUCTIONS=1102
IDC_MULTIVOLCD_INSTRUCTIONS=1103
IDC_GOTOPAGE_CAPTION=1104
IDC_OPENURL_CAPTION=1105
@@ -80,6 +81,9 @@
IDC_TEXTSTYLEPREVIEW=1112
IDC_TEXTPREVIEW=1113
IDC_EDIT1=1114
+IDC_READING_OPTIONS_INSTRUCTIONS=1115
+IDC_LIST1=1116
+IDC_OPTIONS_LIST=1116
SELF_VOICING_PLAY_NEXT=6969
IDC_CURRLANG=9002
IDC_VERSION=9006
@@ -94,7 +98,6 @@
ID_AMIS_EXIT=32925
ID_AMIS_TOGGLE_SIDEBAR=32926
ID_AMIS_TOGGLE_VIEW=32927
-ID_AMIS_NO_PAGE_STYLES=32928
ID_AMIS_BIGGER_FONT=32929
ID_AMIS_SMALLER_FONT=32930
ID_AMIS_PLAYPAUSE=32931
@@ -119,9 +122,22 @@
ID_AMIS_SHOW_HELP_CONTENTS=32950
ID_AMIS_ABOUT=32951
ID_AMIS_SHOW_TEXTSTYLE=32953
+ID_AMIS_NO_PAGE_STYLES=32954
IDS_SELFOLDER_TITLE=61258
IDS_SELFOLDER_INSTR=61259
IDS_FOLDERDOESNOTEXIST=61279
IDS_FOLDERINVALID=61280
IDS_FOLDERCANTBECREATED=61281
IDS_FILE_OPEN_DAISY_BOOKS=61288
+
+
+
+
+
+_APS_3D_CONTROLS=1
+_APS_NEXT_RESOURCE_VALUE=194
+_APS_NEXT_COMMAND_VALUE=32955
+_APS_NEXT_CONTROL_VALUE=1117
+_APS_NEXT_SYMED_VALUE=143
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2008-03-18 21:32:39
|
Revision: 2445
http://amis.svn.sourceforge.net/amis/?rev=2445&view=rev
Author: marisademeglio
Date: 2008-03-18 14:31:43 -0700 (Tue, 18 Mar 2008)
Log Message:
-----------
updated issues and release notes again
Modified Paths:
--------------
branches/amis3/alpha-2-release-notes.txt
branches/amis3/amis_issues.txt
Modified: branches/amis3/alpha-2-release-notes.txt
===================================================================
--- branches/amis3/alpha-2-release-notes.txt 2008-03-18 21:23:29 UTC (rev 2444)
+++ branches/amis3/alpha-2-release-notes.txt 2008-03-18 21:31:43 UTC (rev 2445)
@@ -36,4 +36,4 @@
* Not all dialogs are fully self-voicing
* Audio for some user interface items might not be an exact match for the text
* "Browse" button in the Search for Books dialog doesn't work
-
+* It crashes the first time you run it but will be ok after that
Modified: branches/amis3/amis_issues.txt
===================================================================
--- branches/amis3/amis_issues.txt 2008-03-18 21:23:29 UTC (rev 2444)
+++ branches/amis3/amis_issues.txt 2008-03-18 21:31:43 UTC (rev 2445)
@@ -11,6 +11,7 @@
ISSUES
---
+* It crashes the first time you run it but will be ok after that
* shows □□ for <br /> in the list of bookmarks
* a book won't close all the way
* Zed stylesheet doesn't work
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dan...@us...> - 2008-03-19 11:17:18
|
Revision: 2446
http://amis.svn.sourceforge.net/amis/?rev=2446&view=rev
Author: daniel_weck
Date: 2008-03-19 04:16:59 -0700 (Wed, 19 Mar 2008)
Log Message:
-----------
minor improvements of self-voicing for ReadingOptionsDialog and SearchForBooksDialog
Modified Paths:
--------------
branches/amis3/AmisGuiMFC2/include/gui/dialogs/SearchForBooksDialog.h
branches/amis3/AmisGuiMFC2/include/gui/dialogs/SkipDialog.h
branches/amis3/AmisGuiMFC2/include/gui/self-voicing/AudioSequence.h
branches/amis3/AmisGuiMFC2/include/gui/self-voicing/dialogs/SkipDialogVoicing.h
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/AmisGuiMFC2/src/gui/dialogs/SearchForBooksDialog.cpp
branches/amis3/AmisGuiMFC2/src/gui/dialogs/SkipDialog.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequence.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/Prompt.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/SkipDialogVoicing.cpp
branches/amis3/DefaultLangpack/amisAccessibleUi.xml
Modified: branches/amis3/AmisGuiMFC2/include/gui/dialogs/SearchForBooksDialog.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/dialogs/SearchForBooksDialog.h 2008-03-18 21:31:43 UTC (rev 2445)
+++ branches/amis3/AmisGuiMFC2/include/gui/dialogs/SearchForBooksDialog.h 2008-03-19 11:16:59 UTC (rev 2446)
@@ -51,6 +51,7 @@
afx_msg void OnBrowse();
afx_msg void OnStartsearch();
afx_msg void OnStopsearch();
+ afx_msg void OnSelchangeFilelist();
DECLARE_MESSAGE_MAP()
private:
Modified: branches/amis3/AmisGuiMFC2/include/gui/dialogs/SkipDialog.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/dialogs/SkipDialog.h 2008-03-18 21:31:43 UTC (rev 2445)
+++ branches/amis3/AmisGuiMFC2/include/gui/dialogs/SkipDialog.h 2008-03-19 11:16:59 UTC (rev 2446)
@@ -19,6 +19,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
#ifndef SKIPDIALOG_H
#define SKIPDIALOG_H
@@ -48,17 +49,13 @@
//Dialog Data
enum { IDD = IDD_READING_OPTIONS };
+
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnInitDialog();
- afx_msg void OnSelchangeSkips();
virtual BOOL PreTranslateMessage(MSG* pMsg);
-protected:
- afx_msg void OnPaint();
- DECLARE_MESSAGE_MAP()
- CCheckListBox m_ListSkips;
private:
void fillListBox();
void saveChanges();
@@ -67,6 +64,13 @@
CButton m_Ok;
void setDescriptiveText(bool);
+
+protected:
+ CCheckListBox m_ListSkips;
+public:
+ afx_msg void OnSelchangeSkips();
+ afx_msg void OnPaint();
+ DECLARE_MESSAGE_MAP()
};
}
}
Modified: branches/amis3/AmisGuiMFC2/include/gui/self-voicing/AudioSequence.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/self-voicing/AudioSequence.h 2008-03-18 21:31:43 UTC (rev 2445)
+++ branches/amis3/AmisGuiMFC2/include/gui/self-voicing/AudioSequence.h 2008-03-19 11:16:59 UTC (rev 2446)
@@ -27,14 +27,15 @@
~AudioSequence();
UINT GetCount();
bool IsEmpty();
+ void appendAll(AudioSequence * seq);
AudioSequenceComponent* RemoveTail();
void AddTail(AudioSequenceComponent* comp);
void append(CString strTTS);
void prepend(CString strTTS);
void append(amis::AudioNode* audioClip, CString strTTS);
AudioSequence* clone();
+ CAtlList<AudioSequenceComponent*> m_AudioSequence;
private:
- CAtlList<AudioSequenceComponent*> m_AudioSequence;
};
Modified: branches/amis3/AmisGuiMFC2/include/gui/self-voicing/dialogs/SkipDialogVoicing.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/self-voicing/dialogs/SkipDialogVoicing.h 2008-03-18 21:31:43 UTC (rev 2445)
+++ branches/amis3/AmisGuiMFC2/include/gui/self-voicing/dialogs/SkipDialogVoicing.h 2008-03-19 11:16:59 UTC (rev 2446)
@@ -1,3 +1,4 @@
+
#include "gui/dialogs/SkipDialog.h";
#include "gui/self-voicing/datamodel/DataTree.h"
@@ -19,9 +20,13 @@
private:
amis::gui::dialogs::SkipDialog * mpDialog;
void appendSeqListContent(AudioSequence* seq, amis::dtb::CustomTest* p_custom_test, int i);
+
public:
void OnSelchangeSkips();
SkipDialogVoicing(amis::gui::dialogs::SkipDialog * dlg);
~SkipDialogVoicing(void);
+
+ static amis::gui::spoken::PromptItem* getPromptItemForReadingOptionName(string item_id);
+
};
}}}
\ No newline at end of file
Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-18 21:31:43 UTC (rev 2445)
+++ branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-19 11:16:59 UTC (rev 2446)
@@ -591,7 +591,7 @@
long currentRate = amis::tts::TTSPlayer::Instance()->GetSpeechRate();
amis::tts::TTSPlayer::Instance()->SetSpeechRate(currentRate+1);
- double rate = ambulant::gui::dx::change_global_rate(0.5);
+ double rate = ambulant::gui::dx::change_global_rate(0.7);
ambulantX::gui::dx::audio_playerX::Instance()->set_rate(rate);
updateSpeedButtons();
//amis::gui::spoken::AudioSequencePlayer::Instance()->playPromptFromUiId(ID_MENU_PLAY_FASTER, true, NULL);
@@ -605,7 +605,7 @@
amis::tts::TTSPlayer::Instance()->SetSpeechRate(currentRate-1);
//TODO: Doesn't seem to affect the playback speed at all
- double rate = ambulant::gui::dx::change_global_rate(-0.5);
+ double rate = ambulant::gui::dx::change_global_rate(-0.7);
ambulantX::gui::dx::audio_playerX::Instance()->set_rate(rate);
updateSpeedButtons();
//amis::gui::spoken::AudioSequencePlayer::Instance()->playPromptFromUiId(ID_MENU_PLAY_SLOWER, true, NULL);
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/SearchForBooksDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/SearchForBooksDialog.cpp 2008-03-18 21:31:43 UTC (rev 2445)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/SearchForBooksDialog.cpp 2008-03-19 11:16:59 UTC (rev 2446)
@@ -32,15 +32,40 @@
using namespace amis::gui::dialogs;
BEGIN_MESSAGE_MAP(SearchForBooksDialog, CDialog)
+ //{{AFX_MSG_MAP(SearchForBooksDialog)
ON_WM_PAINT()
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
ON_BN_CLICKED(IDC_STARTSEARCH, OnStartsearch)
ON_BN_CLICKED(IDC_STOPSEARCH, OnStopsearch)
ON_LBN_DBLCLK(IDC_FILESFOUND, OnDblclkFilelist)
ON_BN_CLICKED(IDC_OPENBOOK, OnOpenbook)
+ ON_LBN_SELCHANGE(IDC_FILESFOUND, OnSelchangeFilelist)
+ //}}AFX_MSG_MAP
END_MESSAGE_MAP()
+void SearchForBooksDialog::OnSelchangeFilelist()
+{
+ if (amis::Preferences::Instance()->getIsSelfVoicing() == true)
+ {
+ //TODO: this list treatment removes the default XML prompts, needs improvement
+ CListBox* p_filelist = NULL;
+ p_filelist = (CListBox*)this->GetDlgItem(IDC_FILESFOUND);
+
+ int sel = p_filelist->GetCurSel();
+ if (sel >= 0) {
+ amis::UrlList* p_search_results = mSearcher.getSearchResults();
+ if (sel > -1 && sel < p_search_results->size()) {
+ //mLoadBookOnDialogClose = (*p_search_results)[sel];
+ AudioSequence * seq = new AudioSequence();
+ CString str;
+ p_filelist->GetText(sel, str);
+ seq->append(str);
+ AudioSequencePlayer::Instance()->Play(seq);
+ }
+ }
+ }
+}
void SearchForBooksDialog::resolvePromptVariables(Prompt* pPrompt) {
PromptVar* p_var = NULL;
@@ -123,12 +148,37 @@
if (mpCaptionSearchCompleteNoFilesFound.Compare(status) == 0) {
AudioSequencePlayer::Instance()->playDialogControlFromUiIds(IDD_SEARCHDAISY, IDC_SEARCHING, this, true, "SearchCompleteNoFilesFound");
} else
- if (mpCaptionSearchCompleteOneFileFound.Compare(status) == 0) {
- AudioSequencePlayer::Instance()->playDialogControlFromUiIds(IDD_SEARCHDAISY, IDC_SEARCHING, this, true, "SearchCompleteOneFileFound");
+ if (mpCaptionSearchCompleteOneFileFound.Compare(status) == 0 || mpCaptionSearchCompleteFilesFound.Compare(status) == 0) {
+ CListBox* p_filelist = NULL;
+ p_filelist = (CListBox*)this->GetDlgItem(IDC_FILESFOUND);
+ p_filelist->SetCurSel(0);
+
+ AudioSequence * seq = NULL;
+ if (mpCaptionSearchCompleteOneFileFound.Compare(status) == 0) {
+ seq = AudioSequencePlayer::Instance()->playDialogControlFromUiIds(IDD_SEARCHDAISY, IDC_SEARCHING, this, false, "SearchCompleteOneFileFound");
+ } else {
+ seq = AudioSequencePlayer::Instance()->playDialogControlFromUiIds(IDD_SEARCHDAISY, IDC_SEARCHING, this, false, "SearchCompleteFilesFound");
+ }
+ AudioSequence * seq2 = AudioSequencePlayer::Instance()->playDialogControlFromUiIds(IDD_SEARCHDAISY, IDC_FILESFOUND, this, false, "default");
+ seq->appendAll(seq2);
+ delete seq2;
+
+ int sel = p_filelist->GetCurSel();
+ if (sel >= 0) {
+ amis::UrlList* p_search_results = mSearcher.getSearchResults();
+ if (sel > -1 && sel < p_search_results->size()) {
+ //mLoadBookOnDialogClose = (*p_search_results)[sel];
+
+ CString str;
+ p_filelist->GetText(sel, str);
+ seq->append(str);
+ }
+ }
+ AudioSequencePlayer::Instance()->Play(seq);
+
+
} else
- if (mpCaptionSearchCompleteFilesFound.Compare(status) == 0) {
- AudioSequencePlayer::Instance()->playDialogControlFromUiIds(IDD_SEARCHDAISY, IDC_SEARCHING, this, true, "SearchCompleteFilesFound");
- } else
+
if (mpCaptionSearchAborted.Compare(status) == 0) {
AudioSequencePlayer::Instance()->playDialogControlFromUiIds(IDD_SEARCHDAISY, IDC_SEARCHING, this, true, "SearchAborted");
}
@@ -294,30 +344,14 @@
if (pMsg->message == WM_KEYDOWN || pMsg->message == WM_KEYUP)
{
CWnd* p_wnd = this->GetFocus();
+
if (p_wnd)
- {
+ {
int id = p_wnd->GetDlgCtrlID();
- if (amis::Preferences::Instance()->getIsSelfVoicing() == true && id == IDC_FILESFOUND && pMsg->message == WM_KEYUP && (pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN|| pMsg->wParam == VK_RIGHT || pMsg->wParam == VK_LEFT))
+ if (id = IDC_FILESFOUND && (pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN))
{
- //TODO: this list treatment removes the default XML prompts, needs improvement
- CListBox* p_filelist = NULL;
- p_filelist = (CListBox*)this->GetDlgItem(IDC_FILESFOUND);
-
- int sel = p_filelist->GetCurSel();
- if (sel >= 0) {
- amis::UrlList* p_search_results = mSearcher.getSearchResults();
- if (sel > -1 && sel < p_search_results->size()) {
- //mLoadBookOnDialogClose = (*p_search_results)[sel];
- AudioSequence * seq = new AudioSequence();
- CString str;
- p_filelist->GetText(sel, str);
- seq->append(str);
- AudioSequencePlayer::Instance()->Play(seq);
- }
- }
-
- return CDialog::PreTranslateMessage(pMsg);
+ return CDialog::PreTranslateMessage(pMsg);
}
//inexplicably, the default behavior for pressing enter in a dialog is to close it.
@@ -341,5 +375,5 @@
}
}
}
- return AmisDialogBase::PreTranslateMessageTextField(pMsg ,IDC_SEARCHPATH);
+ return AmisDialogBase::PreTranslateMessageTextField(pMsg, IDC_SEARCHPATH);
}
Modified: branches/amis3/AmisGuiMFC2/src/gui/dialogs/SkipDialog.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/dialogs/SkipDialog.cpp 2008-03-18 21:31:43 UTC (rev 2445)
+++ branches/amis3/AmisGuiMFC2/src/gui/dialogs/SkipDialog.cpp 2008-03-19 11:16:59 UTC (rev 2446)
@@ -19,8 +19,11 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
#include "stdafx.h"
+
#include "gui/dialogs/SkipDialog.h"
+
#include "../resource.h"
#include "Preferences.h"
@@ -38,8 +41,73 @@
amis::gui::dialogs::SkipDialogVoicing * mpSkipDialogVoicing = NULL;
+BEGIN_MESSAGE_MAP(SkipDialog, CDialog)
+ ON_LBN_SELCHANGE(IDC_OPTIONS_LIST, OnSelchangeSkips)
+ ON_WM_PAINT()
+END_MESSAGE_MAP()
+
void SkipDialog::resolvePromptVariables(Prompt* pPrompt) {
- return;
+
+ PromptVar* p_var = NULL;
+ PromptItem* promptNotAvailable = DataTree::Instance()->findPromptItem("not_available");
+
+ for (int i=0; i<pPrompt->getNumberOfItems(); i++)
+ {
+ if (pPrompt->getItem(i)->getPromptItemType() == PROMPT_VARIABLE)
+ {
+ p_var = (PromptVar*)pPrompt->getItem(i);
+
+ if (p_var->getName().compare("SKIPPABLE_ITEM") == 0)
+ {
+ int i = m_ListSkips.GetCurSel();
+ if (i < 0) { i = 0; }
+
+ amis::dtb::CustomTest* p_custom_test = (amis::dtb::CustomTest*)m_ListSkips.GetItemData(i);
+
+ if (p_custom_test != NULL)
+ {
+ string item_id = p_custom_test->getId();
+ amis::gui::spoken::PromptItem* pi = SkipDialogVoicing::getPromptItemForReadingOptionName(item_id);
+ if (pi != NULL)
+ {
+ p_var->setContents(pi->getContents()->clone());
+ }
+ }
+ } else if (p_var->getName().compare("WILL_SKIP_OR_NOT") == 0)
+ {
+ //SKIPPABLE_ITEM_ID
+
+ int i = m_ListSkips.GetCurSel();
+ if (i < 0) { i = 0; }
+
+ amis::dtb::CustomTest* p_custom_test = (amis::dtb::CustomTest*)m_ListSkips.GetItemData(i);
+
+ if (p_custom_test != NULL)
+ {
+ string strSelect;
+
+ //false = skip this item
+ if (m_ListSkips.GetCheck(i) == 1) //p_custom_test->getCurrentState() == false)
+ {
+ strSelect = "item_selected";
+ }
+ else
+ {
+ strSelect = "item_deselected";
+ }
+
+ amis::gui::spoken::PromptItem* pi = NULL;
+
+ pi = amis::gui::spoken::DataTree::Instance()->findPromptItem(strSelect);
+ if (pi != NULL)
+ {
+ p_var->setContents(pi->getContents()->clone());
+ }
+ }
+ }
+ }
+ }
+ AmisDialogBase::resolvePromptVariables(pPrompt);
}
SkipDialog::SkipDialog(CWnd* pParent /*=NULL*/)
@@ -75,7 +143,7 @@
if (cwnd)
{
int id = cwnd->GetDlgCtrlID();
- mCommonPreTranslateMessageHandler->handle(this, pMsg, (cwnd == NULL ? -1 : id), (id == IDC_OPTIONS_LIST ? true : false), (id == IDC_OPTIONS_LIST ? true : false), L"", L"", (id == IDC_OPTIONS_LIST ? true : false));
+ mCommonPreTranslateMessageHandler->handle(this, pMsg, id, (id == IDC_OPTIONS_LIST ? true : false), (id == IDC_OPTIONS_LIST ? true : false), L"", L"", (id == IDC_OPTIONS_LIST ? true : false));
if (pMsg->message == WM_KEYUP)
{
@@ -84,10 +152,11 @@
OnSelchangeSkips();
}
}
+ return CDialog::PreTranslateMessage(pMsg);
}
}
- return CDialog::PreTranslateMessage(pMsg);
+ return AmisDialogBase::PreTranslateMessage(pMsg);
}
void SkipDialog::DoDataExchange(CDataExchange* pDX)
@@ -160,7 +229,7 @@
p_test = (amis::dtb::CustomTest*)m_ListSkips.GetItemData(i);
if (p_test == NULL) return;
- if (Preferences::Instance()->getIsSelfVoicing() == true)
+ if (amis::Preferences::Instance()->getIsSelfVoicing() == true)
{
mpSkipDialogVoicing->OnSelchangeSkips();
}
@@ -170,12 +239,6 @@
else p_test->setCurrentState(false);
}
-BEGIN_MESSAGE_MAP(SkipDialog, CDialog)
- ON_LBN_SELCHANGE(IDC_OPTIONS_LIST, OnSelchangeSkips)
- //{{AFX_MSG_MAP(SkipDialog)
- ON_WM_PAINT()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
void SkipDialog::OnPaint()
{
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequence.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequence.cpp 2008-03-18 21:31:43 UTC (rev 2445)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequence.cpp 2008-03-19 11:16:59 UTC (rev 2446)
@@ -39,6 +39,14 @@
m_AudioSequence.AddHead(comp);
}
+void AudioSequence::appendAll(AudioSequence * seq)
+{
+ for (size_t i = 0; i < seq->m_AudioSequence.GetCount(); i++) {
+ AudioSequenceComponent* comp = seq->m_AudioSequence.GetAt(seq->m_AudioSequence.FindIndex(i))->clone();
+ m_AudioSequence.AddHead(comp);
+ }
+}
+
void AudioSequence::prepend(CString strTTS) {
if (strTTS.IsEmpty()) {
return;
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp 2008-03-18 21:31:43 UTC (rev 2445)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/AudioSequencePlayer.cpp 2008-03-19 11:16:59 UTC (rev 2446)
@@ -1054,22 +1054,6 @@
if (-1 == find) {
fillSequenceCaptionAndDescription(seq, control, presolver, "default");
}
-
- LabelList* p_list = control->getLabelList();
- if (p_list != NULL)
- {
-
- fillSequenceContentAndPrompt(seq, p_list, presolver);
- /*
- for (int i = 0; i<p_list->getNumberOfLabels(); i++)
- {
- Prompt* p_prompt = p_list->getLabel(i)->getPrompt();
- if (p_prompt != NULL)
- {
- fillSequencePrompt(seq, p_prompt, presolver);
- }
- }*/
- }
}
}
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/Prompt.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/Prompt.cpp 2008-03-18 21:31:43 UTC (rev 2445)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/Prompt.cpp 2008-03-19 11:16:59 UTC (rev 2446)
@@ -105,8 +105,6 @@
mpContents->setAudio(p_audio);
}
-
-
}
//**
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/SkipDialogVoicing.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/SkipDialogVoicing.cpp 2008-03-18 21:31:43 UTC (rev 2445)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/dialogs/SkipDialogVoicing.cpp 2008-03-19 11:16:59 UTC (rev 2446)
@@ -16,58 +16,50 @@
mpDialog = NULL;
}
-void SkipDialogVoicing::appendSeqListContent(AudioSequence* seq, amis::dtb::CustomTest* p_custom_test, int i)
+amis::gui::spoken::PromptItem* SkipDialogVoicing::getPromptItemForReadingOptionName(string item_id)
{
amis::gui::spoken::PromptItem* pi = NULL;
-
- string item_id = p_custom_test->getId();
+
if (item_id.compare("prodnote") == 0 ||
- item_id.compare("optional-prodnote") == 0 )
+ item_id.compare("optional-prodnote") == 0)
{
pi = amis::gui::spoken::DataTree::Instance()->findPromptItem("prodnotes");
- if (pi != NULL)
- {
- AudioSequencePlayer::fillSequenceContents(seq, pi);
- }
+
}
else if (item_id.compare("pages") == 0 || item_id.compare("pagenumber") == 0)
{
pi = amis::gui::spoken::DataTree::Instance()->findPromptItem("pages");
- if (pi != NULL)
- {
- AudioSequencePlayer::fillSequenceContents(seq, pi);
- }
+
}
else if (item_id.compare("sections") == 0)
{
pi = amis::gui::spoken::DataTree::Instance()->findPromptItem("sections");
- if (pi != NULL)
- {
- AudioSequencePlayer::fillSequenceContents(seq, pi);
- }
+
}
else if (item_id.compare("sidebar") == 0)
{
pi = amis::gui::spoken::DataTree::Instance()->findPromptItem("sidebars");
- if (pi != NULL)
- {
- AudioSequencePlayer::fillSequenceContents(seq, pi);
- }
+
}
else if (item_id.compare("footnote") == 0 ||
item_id.compare("noteref") == 0)
{
pi = amis::gui::spoken::DataTree::Instance()->findPromptItem("noterefs");
- if (pi != NULL)
+
+ }
+ return pi;
+}
+void SkipDialogVoicing::appendSeqListContent(AudioSequence* seq, amis::dtb::CustomTest* p_custom_test, int i)
+{
+ string item_id = p_custom_test->getId();
+ amis::gui::spoken::PromptItem* pi = getPromptItemForReadingOptionName(item_id);
+ if (pi != NULL)
{
AudioSequencePlayer::fillSequenceContents(seq, pi);
}
- }
- //seq->append(str);
-
string strSelect;
if (p_custom_test != NULL)
@@ -82,7 +74,7 @@
strSelect = "item_deselected";
}
}
- //AudioSequence* seq = AudioSequencePlayer::playPromptItemFromStringId("thisItemIsCurrently");
+
pi = amis::gui::spoken::DataTree::Instance()->findPromptItem("thisItemIsCurrently");
if (pi != NULL)
{
Modified: branches/amis3/DefaultLangpack/amisAccessibleUi.xml
===================================================================
--- branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-18 21:31:43 UTC (rev 2445)
+++ branches/amis3/DefaultLangpack/amisAccessibleUi.xml 2008-03-19 11:16:59 UTC (rev 2446)
@@ -1165,8 +1165,7 @@
</caption>
<description>
<prompt>
- <promptVar name="SKIPPABLE_ITEM"/>
- <promptItem refid="thisItem"/>
+ <promptItem refid="thisItemIsCurrently"/>
<promptVar name="WILL_SKIP_OR_NOT" param="SKIPPABLE_ITEM_ID"/>
</prompt>
</description>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dan...@us...> - 2008-03-27 02:45:00
|
Revision: 2449
http://amis.svn.sourceforge.net/amis/?rev=2449&view=rev
Author: daniel_weck
Date: 2008-03-26 19:44:35 -0700 (Wed, 26 Mar 2008)
Log Message:
-----------
- fixed a few C++ compatibility bugs so that AMIS can compile with VS 2005
Modified Paths:
--------------
branches/amis3/AmisCore/include/io/BookListFileIO.h
branches/amis3/AmisCore/include/io/BookmarksFileIO.h
branches/amis3/AmisGuiMFC2/include/gui/sidebar/SizeCBar.h
branches/amis3/AmisGuiMFC2/include/gui/sidebar/cdxCDynamicControlsManager.h
branches/amis3/AmisGuiMFC2/include/gui/sidebar/scbarg.h
branches/amis3/AmisGuiMFC2/include/io/PreferencesFileIO.h
branches/amis3/AmisGuiMFC2/src/Preferences.cpp
branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp
branches/amis3/AmisGuiMFC2/src/gui/MmView.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/datamodel/AccessibleUIDataReader.cpp
branches/amis3/AmisGuiMFC2/src/gui/self-voicing/directshow/dx_audio_player.cpp
branches/amis3/AmisGuiMFC2/src/gui/sidebar/SizeCBar.cpp
branches/amis3/AmisGuiMFC2/src/gui/sidebar/scbarg.cpp
branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp
branches/amis3/AmisGuiMFC2/src/util/VolMaster.cpp
Modified: branches/amis3/AmisCore/include/io/BookListFileIO.h
===================================================================
--- branches/amis3/AmisCore/include/io/BookListFileIO.h 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisCore/include/io/BookListFileIO.h 2008-03-27 02:44:35 UTC (rev 2449)
@@ -71,7 +71,7 @@
amis::BookList* mpBookList;
amis::BookEntry* mpCurrentEntry;
//The DOM document pointer
- xercesc_2_7::DOMDocument* mpDoc;
+ xercesc_2_8::DOMDocument* mpDoc;
};
}
}
Modified: branches/amis3/AmisCore/include/io/BookmarksFileIO.h
===================================================================
--- branches/amis3/AmisCore/include/io/BookmarksFileIO.h 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisCore/include/io/BookmarksFileIO.h 2008-03-27 02:44:35 UTC (rev 2449)
@@ -80,7 +80,7 @@
vector<string> mElementStack;
//The DOM document pointer (for saving the file)
- xercesc_2_7::DOMDocument* mpDoc;
+ xercesc_2_8::DOMDocument* mpDoc;
//the title element
amis::MediaGroup* mpTitle;
Modified: branches/amis3/AmisGuiMFC2/include/gui/sidebar/SizeCBar.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/sidebar/SizeCBar.h 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/include/gui/sidebar/SizeCBar.h 2008-03-27 02:44:35 UTC (rev 2449)
@@ -169,7 +169,12 @@
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnNcPaint();
afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
+
+#if _MSC_VER <= 1300 // VS.NET 2003 or earlier
afx_msg UINT OnNcHitTest(CPoint point);
+#else // Later than VS.NET 2003
+ afx_msg LRESULT OnNcHitTest(CPoint point);
+#endif
afx_msg void OnCaptureChanged(CWnd *pWnd);
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
Modified: branches/amis3/AmisGuiMFC2/include/gui/sidebar/cdxCDynamicControlsManager.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/sidebar/cdxCDynamicControlsManager.h 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/include/gui/sidebar/cdxCDynamicControlsManager.h 2008-03-27 02:44:35 UTC (rev 2449)
@@ -193,7 +193,7 @@
// (used by Add())
// Note that the window is not need to be already created
//
- private:
+ public:
struct ControlEntry
{
private:
Modified: branches/amis3/AmisGuiMFC2/include/gui/sidebar/scbarg.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/gui/sidebar/scbarg.h 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/include/gui/sidebar/scbarg.h 2008-03-27 02:44:35 UTC (rev 2449)
@@ -107,7 +107,11 @@
// Generated message map functions
protected:
//{{AFX_MSG(CSizingControlBarG)
+#if _MSC_VER <= 1300 // VS.NET 2003 or earlier
afx_msg UINT OnNcHitTest(CPoint point);
+#else // Later than VS.NET 2003
+ afx_msg LRESULT OnNcHitTest(CPoint point);
+#endif
afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
//}}AFX_MSG
Modified: branches/amis3/AmisGuiMFC2/include/io/PreferencesFileIO.h
===================================================================
--- branches/amis3/AmisGuiMFC2/include/io/PreferencesFileIO.h 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/include/io/PreferencesFileIO.h 2008-03-27 02:44:35 UTC (rev 2449)
@@ -66,7 +66,7 @@
void addEntry(std::string, std::string);
amis::Preferences* mpPrefs;
- xercesc_2_7::DOMDocument* mpDoc;
+ xercesc_2_8::DOMDocument* mpDoc;
};
}
}
Modified: branches/amis3/AmisGuiMFC2/src/Preferences.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/Preferences.cpp 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/src/Preferences.cpp 2008-03-27 02:44:35 UTC (rev 2449)
@@ -363,10 +363,10 @@
}
amis::ModuleDescData* Preferences::getCurrentLanguageData()
-{
- amis::ModuleDescData* p_data = mInstalledLanguages[mUiLangId];
- return p_data;
-}
+{
+ amis::ModuleDescData* p_data = mInstalledLanguages[mUiLangId];
+ return p_data;
+}
void Preferences::setHighlightBGColor(amis::util::Color value)
{
mHighlightBG = value;
@@ -390,9 +390,9 @@
std::string Preferences::getSidebarFontName()
{
return mSidebarFontName;
-}
-void Preferences::logAllPreferences()
-{
+}
+void Preferences::logAllPreferences()
+{
amis::util::Log* p_log = amis::util::Log::Instance();
p_log->writeMessage("__Preferences (all)__");
@@ -467,18 +467,18 @@
p_log->writeMessage("\tCustom CSS files:");
- for (i = 0; i<mCustomCssFiles.size(); i++)
- p_log->writeMessage("\t\t", &mCustomCssFiles[i]);
-}
-
-void Preferences::logUserControllablePreferences()
-{
+ for (int i = 0; i<mCustomCssFiles.size(); i++)
+ p_log->writeMessage("\t\t", &mCustomCssFiles[i]);
+}
+
+void Preferences::logUserControllablePreferences()
+{
amis::util::Log* p_log = amis::util::Log::Instance();
- p_log->writeMessage("__Preferences (user-controllable only)__");
-
+ p_log->writeMessage("__Preferences (user-controllable only)__");
+
string log_msg = "\tLanguage pack = " + getUiLangId();
- p_log->writeMessage(log_msg);
-
+ p_log->writeMessage(log_msg);
+
log_msg = "\tStartup view = ";
if (getStartInBasicView()) log_msg += "Basic";
else log_msg += "Default";
@@ -497,8 +497,8 @@
log_msg = "\tIs self-voicing? ";
if (getIsSelfVoicing()) log_msg += "Yes";
else log_msg += "No";
- p_log->writeMessage(log_msg);
-
+ p_log->writeMessage(log_msg);
+
log_msg = "\tHighlight text? ";
if (getHighlightText()) log_msg += "Yes";
else log_msg += "No";
@@ -507,5 +507,5 @@
log_msg = "\tDisable screensaver? ";
if (getDisableScreensaver()) log_msg += "Yes";
else log_msg += "No";
- p_log->writeMessage(log_msg);
+ p_log->writeMessage(log_msg);
}
\ No newline at end of file
Modified: branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/src/gui/AmisApp.cpp 2008-03-27 02:44:35 UTC (rev 2449)
@@ -476,14 +476,14 @@
if (view->isPlaying() == true)
{
amis::util::Log::Instance()->writeMessage("Pausing", "CAmisApp::OnPlayPause", "AmisGuiMFC2");
- MainWndParts::Instance()->mpDefaultToolbar->togglePlayPause(true);
+ MainWndParts::Instance()->mpDefaultToolbar->togglePlayPause(true);
MainWndParts::Instance()->mpBasicToolbar->togglePlayPause(true);
view->OnFilePause();
}
else
{
amis::util::Log::Instance()->writeMessage("Playing", "CAmisApp::OnPlayPause", "AmisGuiMFC2");
- MainWndParts::Instance()->mpDefaultToolbar->togglePlayPause(false);
+ MainWndParts::Instance()->mpDefaultToolbar->togglePlayPause(false);
MainWndParts::Instance()->mpBasicToolbar->togglePlayPause(false);
view->OnFilePlay();
}
@@ -569,57 +569,57 @@
}
void CAmisApp::OnVolumeUp()
-{
- amis::util::Log::Instance()->writeMessage("Volume increase", "CAmisApp::OnVolumeUp", "AmisGuiMFC2");
- //amis::audio::AmisAudio::Instance()->adjustVolume(1.2); REMOVED because it makes more sense to allow book volume control than the whole application: otherwise users would use their OS-level volume control.
+{
+ amis::util::Log::Instance()->writeMessage("Volume increase", "CAmisApp::OnVolumeUp", "AmisGuiMFC2");
+ //amis::audio::AmisAudio::Instance()->adjustVolume(1.2); REMOVED because it makes more sense to allow book volume control than the whole application: otherwise users would use their OS-level volume control.
ambulant::gui::dx::change_global_level(1.2);
//amis::gui::spoken::AudioSequencePlayer::Instance()->playPromptFromUiId(ID_MENU_PLAY_VOLUP, true, NULL);
}
void CAmisApp::OnVolumeDown()
-{
- amis::util::Log::Instance()->writeMessage("Volume decrease", "CAmisApp::OnVolumeDown", "AmisGuiMFC2");
- //amis::audio::AmisAudio::Instance()->adjustVolume(1.0/1.2); REMOVED because it makes more sense to allow book volume control than the whole application: otherwise users would use their OS-level volume control.
+{
+ amis::util::Log::Instance()->writeMessage("Volume decrease", "CAmisApp::OnVolumeDown", "AmisGuiMFC2");
+ //amis::audio::AmisAudio::Instance()->adjustVolume(1.0/1.2); REMOVED because it makes more sense to allow book volume control than the whole application: otherwise users would use their OS-level volume control.
ambulant::gui::dx::change_global_level(1.0/1.2);
//amis::gui::spoken::AudioSequencePlayer::Instance()->playPromptFromUiId(ID_MENU_PLAY_VOLDOWN, true, NULL);
}
void CAmisApp::OnSpeedUp()
-{
- amis::util::Log::Instance()->writeMessage("Speed increase", "CAmisApp::OnSpeedUp", "AmisGuiMFC2");
-
- long currentRate = amis::tts::TTSPlayer::Instance()->GetSpeechRate();
- amis::tts::TTSPlayer::Instance()->SetSpeechRate(currentRate+1);
-
- double rate = ambulant::gui::dx::change_global_rate(0.7);
- ambulantX::gui::dx::audio_playerX::Instance()->set_rate(rate);
- updateSpeedButtons();
+{
+ amis::util::Log::Instance()->writeMessage("Speed increase", "CAmisApp::OnSpeedUp", "AmisGuiMFC2");
+
+ long currentRate = amis::tts::TTSPlayer::Instance()->GetSpeechRate();
+ amis::tts::TTSPlayer::Instance()->SetSpeechRate(currentRate+1);
+
+ double rate = ambulant::gui::dx::change_global_rate(0.7);
+ ambulantX::gui::dx::audio_playerX::Instance()->set_rate(rate);
+ updateSpeedButtons();
//amis::gui::spoken::AudioSequencePlayer::Instance()->playPromptFromUiId(ID_MENU_PLAY_FASTER, true, NULL);
}
void CAmisApp::OnSpeedDown()
-{
- amis::util::Log::Instance()->writeMessage("Speed decrease", "CAmisApp::OnSpeedDown", "AmisGuiMFC2");
-
- long currentRate = amis::tts::TTSPlayer::Instance()->GetSpeechRate();
- amis::tts::TTSPlayer::Instance()->SetSpeechRate(currentRate-1);
-
- //TODO: Doesn't seem to affect the playback speed at all
- double rate = ambulant::gui::dx::change_global_rate(-0.7);
- ambulantX::gui::dx::audio_playerX::Instance()->set_rate(rate);
- updateSpeedButtons();
+{
+ amis::util::Log::Instance()->writeMessage("Speed decrease", "CAmisApp::OnSpeedDown", "AmisGuiMFC2");
+
+ long currentRate = amis::tts::TTSPlayer::Instance()->GetSpeechRate();
+ amis::tts::TTSPlayer::Instance()->SetSpeechRate(currentRate-1);
+
+ //TODO: Doesn't seem to affect the playback speed at all
+ double rate = ambulant::gui::dx::change_global_rate(-0.7);
+ ambulantX::gui::dx::audio_playerX::Instance()->set_rate(rate);
+ updateSpeedButtons();
//amis::gui::spoken::AudioSequencePlayer::Instance()->playPromptFromUiId(ID_MENU_PLAY_SLOWER, true, NULL);
}
void CAmisApp::OnSpeedNormal()
-{
- amis::util::Log::Instance()->writeMessage("Speed reset to normal", "CAmisApp::OnSpeedNormal", "AmisGuiMFC2");
-
- amis::tts::TTSPlayer::Instance()->SetSpeechRate(0);
-
- ambulant::gui::dx::set_global_rate(1.0);
- ambulantX::gui::dx::audio_playerX::Instance()->set_rate(1.0);
- updateSpeedButtons();
+{
+ amis::util::Log::Instance()->writeMessage("Speed reset to normal", "CAmisApp::OnSpeedNormal", "AmisGuiMFC2");
+
+ amis::tts::TTSPlayer::Instance()->SetSpeechRate(0);
+
+ ambulant::gui::dx::set_global_rate(1.0);
+ ambulantX::gui::dx::audio_playerX::Instance()->set_rate(1.0);
+ updateSpeedButtons();
//amis::gui::spoken::AudioSequencePlayer::Instance()->playPromptFromUiId(ID_MENU_PLAY_NORMALSPEED, true, NULL);
}
@@ -735,12 +735,12 @@
{
amis::util::Log::Instance()->writeMessage("Loading from CD", "CAmisApp::OnLoadCd", "AmisGuiMFC2");
amis::util::SearchForFilesMFC searcher;
- //prepare the search tool
- searcher.clearAll();
- searcher.addSearchCriteria("ncc.htm");
- searcher.addSearchCriteria(".opf");
- //sometimes I see these temp files on my drive .. excluding them just to be safe
- searcher.addSearchExclusionCriteria("_ncc.html");
+ //prepare the search tool
+ searcher.clearAll();
+ searcher.addSearchCriteria("ncc.htm");
+ searcher.addSearchCriteria(".opf");
+ //sometimes I see these temp files on my drive .. excluding them just to be safe
+ searcher.addSearchExclusionCriteria("_ncc.html");
searcher.setRecursiveSearch(true);
int num_books = searcher.startSearchOnCdRom();
@@ -856,8 +856,8 @@
{
amis::gui::MenuManip::Instance()->setPauseState(pauseState);
MainWndParts::Instance()->updateTitlePlayState(!pauseState);
-
- MainWndParts::Instance()->mpDefaultToolbar->togglePlayPause(pauseState);
+
+ MainWndParts::Instance()->mpDefaultToolbar->togglePlayPause(pauseState);
MainWndParts::Instance()->mpBasicToolbar->togglePlayPause(pauseState);
}
@@ -918,11 +918,11 @@
}
void CAmisApp::updateFontSizeButtons()
-{
- bool can_increase = TextRenderBrain::Instance()->canIncreaseFontSize();
- bool can_decrease = TextRenderBrain::Instance()->canDecreaseFontSize();
- MainWndParts::Instance()->mpDefaultToolbar->enable(ID_AMIS_BIGGER_FONT, can_increase);
- MainWndParts::Instance()->mpBasicToolbar->enable(ID_AMIS_BIGGER_FONT, can_increase);
+{
+ bool can_increase = TextRenderBrain::Instance()->canIncreaseFontSize();
+ bool can_decrease = TextRenderBrain::Instance()->canDecreaseFontSize();
+ MainWndParts::Instance()->mpDefaultToolbar->enable(ID_AMIS_BIGGER_FONT, can_increase);
+ MainWndParts::Instance()->mpBasicToolbar->enable(ID_AMIS_BIGGER_FONT, can_increase);
MainWndParts::Instance()->mpDefaultToolbar->enable(ID_AMIS_SMALLER_FONT, can_decrease);
MainWndParts::Instance()->mpBasicToolbar->enable(ID_AMIS_SMALLER_FONT, can_decrease);
}
@@ -930,9 +930,9 @@
void CAmisApp::updateSpeedButtons()
{
bool can_increase = canIncreasePlaybackSpeed();
- bool can_decrease = canDecreasePlaybackSpeed();
- MainWndParts::Instance()->mpDefaultToolbar->enable(ID_AMIS_FASTER, can_increase);
- MainWndParts::Instance()->mpBasicToolbar->enable(ID_AMIS_FASTER, can_increase);
+ bool can_decrease = canDecreasePlaybackSpeed();
+ MainWndParts::Instance()->mpDefaultToolbar->enable(ID_AMIS_FASTER, can_increase);
+ MainWndParts::Instance()->mpBasicToolbar->enable(ID_AMIS_FASTER, can_increase);
MainWndParts::Instance()->mpDefaultToolbar->enable(ID_AMIS_SLOWER, can_decrease);
MainWndParts::Instance()->mpBasicToolbar->enable(ID_AMIS_SLOWER, can_decrease);
}
Modified: branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/src/gui/MenuManip.cpp 2008-03-27 02:44:35 UTC (rev 2449)
@@ -90,7 +90,7 @@
int max = AMIS_MAX_RECENT_BOOKS;
if (num_entries < max) max = num_entries;
//get the last X entries
- for (i=num_entries-1; i>=num_entries-max; i--)
+ for (int i=num_entries-1; i>=num_entries-max; i--)
{
p_entry = theApp.getHistory()->getEntry(i);
string filepath = p_entry->mPath.get_url();
Modified: branches/amis3/AmisGuiMFC2/src/gui/MmView.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/MmView.cpp 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/src/gui/MmView.cpp 2008-03-27 02:44:35 UTC (rev 2449)
@@ -178,7 +178,7 @@
}
static dg_or_dx_player *player = 0;
-static needs_done_redraw = false;
+static bool needs_done_redraw = false;
CWnd* topView = NULL;
@@ -419,7 +419,7 @@
void MmView::OnFilePlay()
{
- /*DBG*/static in_here = 0;
+ /*DBG*/static int in_here = 0;
/*DBG*/assert(!in_here);
/*DBG*/in_here++;
if(player)
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/datamodel/AccessibleUIDataReader.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/datamodel/AccessibleUIDataReader.cpp 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/datamodel/AccessibleUIDataReader.cpp 2008-03-27 02:44:35 UTC (rev 2449)
@@ -22,7 +22,7 @@
#include "Preferences.h"
#include "util/FilePathTools.h"
-
+
#include "util/xercesutils.h"
using namespace amis::gui::spoken;
Modified: branches/amis3/AmisGuiMFC2/src/gui/self-voicing/directshow/dx_audio_player.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/self-voicing/directshow/dx_audio_player.cpp 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/src/gui/self-voicing/directshow/dx_audio_player.cpp 2008-03-27 02:44:35 UTC (rev 2449)
@@ -30,7 +30,7 @@
//#include "ambulant/lib/logger.h"
//#include "ambulant/lib/textptr.h"
#include <math.h>
-#include <vfwmsgs.h>
+//#include <vfwmsgs.h>
// CLSID_FilterGraph
//#include <uuids.h>
#include <dshow.h>
Modified: branches/amis3/AmisGuiMFC2/src/gui/sidebar/SizeCBar.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/sidebar/SizeCBar.cpp 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/src/gui/sidebar/SizeCBar.cpp 2008-03-27 02:44:35 UTC (rev 2449)
@@ -573,7 +573,11 @@
CPaintDC dc(this);
}
-UINT CSizingControlBar::OnNcHitTest(CPoint point)
+#if _MSC_VER <= 1300 // VS.NET 2003 or earlier
+ UINT CSizingControlBar::OnNcHitTest(CPoint point)
+#else // Later than VS.NET 2003
+ LRESULT CSizingControlBar::OnNcHitTest(CPoint point)
+#endif
{
CRect rcBar, rcEdge;
GetWindowRect(rcBar);
@@ -1008,7 +1012,7 @@
}
// make all the bars the same width
- for (i = 0; i < nNumBars; i++)
+ for (int i = 0; i < nNumBars; i++)
if (bHorz)
arrSCBars[i]->m_szHorz.cy = nWidthMax;
else
@@ -1019,7 +1023,7 @@
while (nDelta != 0)
{
int nDeltaOld = nDelta;
- for (i = 0; i < nNumBars; i++)
+ for (int i = 0; i < nNumBars; i++)
{
pBar = arrSCBars[i];
int nLMin = bHorz ?
@@ -1039,7 +1043,7 @@
}
// clear m_bKeepSize flags
if ((nDeltaOld == nDelta) || (nDelta == 0))
- for (i = 0; i < nNumBars; i++)
+ for (int i = 0; i < nNumBars; i++)
arrSCBars[i]->m_bKeepSize = FALSE;
}
Modified: branches/amis3/AmisGuiMFC2/src/gui/sidebar/scbarg.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/gui/sidebar/scbarg.cpp 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/src/gui/sidebar/scbarg.cpp 2008-03-27 02:44:35 UTC (rev 2449)
@@ -144,13 +144,20 @@
m_biHide.Paint(pDC);
}
-
-UINT CSizingControlBarG::OnNcHitTest(CPoint point)
+#if _MSC_VER <= 1300 // VS.NET 2003 or earlier
+ UINT CSizingControlBarG::OnNcHitTest(CPoint point)
+#else // Later than VS.NET 2003
+ LRESULT CSizingControlBarG::OnNcHitTest(CPoint point)
+#endif
{
CRect rcBar;
GetWindowRect(rcBar);
+#if _MSC_VER <= 1300 // VS.NET 2003 or earlier
UINT nRet = baseCSizingControlBarG::OnNcHitTest(point);
+#else // Later than VS.NET 2003
+ LRESULT nRet = baseCSizingControlBarG::OnNcHitTest(point);
+#endif
if (nRet != HTCLIENT)
return nRet;
Modified: branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp 2008-03-27 02:44:35 UTC (rev 2449)
@@ -229,7 +229,7 @@
DOMImplementation* pImpl = NULL;
DOMWriter* pWriter = NULL;
- xercesc_2_7::DOMDocument* pDoc = NULL;
+ xercesc_2_8::DOMDocument* pDoc = NULL;
XMLFormatTarget* pFormTarget = NULL;
try
@@ -246,7 +246,7 @@
pDoc = pImpl->createDocument(
X("http://amisproject.org"),
X("preferences"),
- (xercesc_2_7::DOMDocumentType*)0);
+ (xercesc_2_8::DOMDocumentType*)0);
mpDoc = pDoc;
writeData();
Modified: branches/amis3/AmisGuiMFC2/src/util/VolMaster.cpp
===================================================================
--- branches/amis3/AmisGuiMFC2/src/util/VolMaster.cpp 2008-03-19 11:56:58 UTC (rev 2448)
+++ branches/amis3/AmisGuiMFC2/src/util/VolMaster.cpp 2008-03-27 02:44:35 UTC (rev 2449)
@@ -14,7 +14,7 @@
//
int CVolumeMaster::GetLogicalDriveStrings(CStringArray& ar)
{
- const BUFLEN = 26*4;
+ const int BUFLEN = 26*4;
TCHAR buf[BUFLEN+1];
::GetLogicalDriveStrings(BUFLEN, buf);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dan...@us...> - 2008-03-27 08:23:29
|
Revision: 2450
http://amis.svn.sourceforge.net/amis/?rev=2450&view=rev
Author: daniel_weck
Date: 2008-03-27 01:17:37 -0700 (Thu, 27 Mar 2008)
Log Message:
-----------
- brutal transition to Visual Studio 2005 (v8.0) from 2003 (v7.1).
To compile, AMIS (and any other 2005 C++ project) now requires a bunch of changes in sphelper.h, which is part of the SAPI SDK. The corrections are mostly trivial and are due to differences in the C++ compiler, like the lack of default-int for variables declared without a type.
Another VERY important aspect is that ALL libraries used (Xerces, Ambulant, LibJPEG, Expat, etc.) as well as AMIS itself need to be re-compiled using the /Zc:wchar_t- option, which is exposed as "treat wchar_t as built-in type == NO" under Project -> Properties -> C/C++ -> Language
Finally, this upgrade requires using the latest Xerces 2.8 (AMIS was using 2.7, which did not have VS2005/8 projcet files).
Good luck ! (works fine here in DEBUG and RELEASE modes)
Modified Paths:
--------------
branches/amis3/AmisCore/AmisCore.vcproj
branches/amis3/AmisGuiMFC2/AmisGuiMFC2.vcproj
branches/amis3/DefaultLangpack/AmisLangpack/AmisLangpack.vcproj
branches/amis3/VC7/amis.sln
Modified: branches/amis3/AmisCore/AmisCore.vcproj
===================================================================
--- branches/amis3/AmisCore/AmisCore.vcproj 2008-03-27 02:44:35 UTC (rev 2449)
+++ branches/amis3/AmisCore/AmisCore.vcproj 2008-03-27 08:17:37 UTC (rev 2450)
@@ -1,99 +1,151 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="7.10"
+ Version="8.00"
Name="AmisCore"
ProjectGUID="{E0F81CE5-9C15-4E36-BC71-42BE1C0F2406}"
RootNamespace="AmisCore"
- Keyword="Win32Proj">
+ Keyword="Win32Proj"
+ >
<Platforms>
<Platform
- Name="Win32"/>
+ Name="Win32"
+ />
</Platforms>
+ <ToolFiles>
+ </ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../lib"
IntermediateDirectory="Debug"
ConfigurationType="4"
- CharacterSet="1">
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="1"
+ >
<Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="./include; ../../../../xerces-c-src/src;../../../../ambulant/include;c:\program files\visual leak detector;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS; AMIS_COMPILER_MSVC; AMIS_PLATFORM_WINDOWS;"
- MinimalRebuild="TRUE"
+ PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS; WIN32;_DEBUG;_WINDOWS; AMIS_COMPILER_MSVC; AMIS_PLATFORM_WINDOWS;"
+ MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="false"
UsePrecompiledHeader="0"
WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
<Tool
- Name="VCCustomBuildTool"/>
+ Name="VCManagedResourceCompilerTool"
+ />
<Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/$(ProjectName)D.lib"
AdditionalLibraryDirectories=""
- IgnoreDefaultLibraryNames=""/>
+ IgnoreDefaultLibraryNames=""
+ />
<Tool
- Name="VCMIDLTool"/>
+ Name="VCALinkTool"
+ />
<Tool
- Name="VCPostBuildEventTool"/>
+ Name="VCXDCMakeTool"
+ />
<Tool
- Name="VCPreBuildEventTool"/>
+ Name="VCBscMakeTool"
+ />
<Tool
- Name="VCPreLinkEventTool"/>
+ Name="VCFxCopTool"
+ />
<Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ Name="VCPostBuildEventTool"
+ />
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="../lib"
IntermediateDirectory="Release"
ConfigurationType="4"
- CharacterSet="1">
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="1"
+ >
<Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="./include; ../../../../xerces-c-src/src;../../../../ambulant/include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS; AMIS_COMPILER_MSVC; AMIS_PLATFORM_WINDOWS;"
RuntimeLibrary="2"
- EnableFunctionLevelLinking="TRUE"
+ EnableFunctionLevelLinking="true"
+ TreatWChar_tAsBuiltInType="false"
UsePrecompiledHeader="0"
WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="0"/>
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="0"
+ />
<Tool
- Name="VCCustomBuildTool"/>
+ Name="VCManagedResourceCompilerTool"
+ />
<Tool
- Name="VCLibrarianTool"
- AdditionalLibraryDirectories=""/>
+ Name="VCResourceCompilerTool"
+ />
<Tool
- Name="VCMIDLTool"/>
+ Name="VCPreLinkEventTool"
+ />
<Tool
- Name="VCPostBuildEventTool"/>
+ Name="VCLibrarianTool"
+ AdditionalLibraryDirectories=""
+ />
<Tool
- Name="VCPreBuildEventTool"/>
+ Name="VCALinkTool"
+ />
<Tool
- Name="VCPreLinkEventTool"/>
+ Name="VCXDCMakeTool"
+ />
<Tool
- Name="VCResourceCompilerTool"/>
+ Name="VCBscMakeTool"
+ />
<Tool
- Name="VCWebServiceProxyGeneratorTool"/>
+ Name="VCFxCopTool"
+ />
<Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ Name="VCPostBuildEventTool"
+ />
</Configuration>
</Configurations>
<References>
@@ -101,538 +153,701 @@
<Files>
<Filter
Name="src"
- Filter="">
+ >
<File
- RelativePath=".\src\AmisCore.cpp">
+ RelativePath=".\src\AmisCore.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\BookList.cpp">
+ RelativePath=".\src\BookList.cpp"
+ >
</File>
<File
- RelativePath=".\src\Error.cpp">
+ RelativePath=".\src\Error.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\Media.cpp">
+ RelativePath=".\src\Media.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\ModuleDescData.cpp">
+ RelativePath=".\src\ModuleDescData.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<Filter
Name="io"
- Filter="">
+ >
<File
- RelativePath=".\src\io\BookListFileIO.cpp">
+ RelativePath=".\src\io\BookListFileIO.cpp"
+ >
</File>
<File
- RelativePath=".\src\io\BookmarksFileIO.cpp">
+ RelativePath=".\src\io\BookmarksFileIO.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\io\ModuleDescReader.cpp">
+ RelativePath=".\src\io\ModuleDescReader.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\io\NavFileReader.cpp">
+ RelativePath=".\src\io\NavFileReader.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\io\NccFileReader.cpp">
+ RelativePath=".\src\io\NccFileReader.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\io\NcxFileReader.cpp">
+ RelativePath=".\src\io\NcxFileReader.cpp"
+ >
</File>
<File
- RelativePath=".\src\io\OpfFileReader.cpp">
+ RelativePath=".\src\io\OpfFileReader.cpp"
+ >
</File>
<File
- RelativePath=".\src\io\QuickDataSmilFileReader.cpp">
+ RelativePath=".\src\io\QuickDataSmilFileReader.cpp"
+ >
</File>
<File
- RelativePath=".\src\io\SmilFileReader.cpp">
+ RelativePath=".\src\io\SmilFileReader.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\io\TextSearch.cpp">
+ RelativePath=".\src\io\TextSearch.cpp"
+ >
</File>
<File
- RelativePath=".\src\io\UrlInputSource.cpp">
+ RelativePath=".\src\io\UrlInputSource.cpp"
+ >
</File>
<File
- RelativePath=".\src\io\XercesSaxParseBase.cpp">
+ RelativePath=".\src\io\XercesSaxParseBase.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
</Filter>
<Filter
Name="dtb"
- Filter="">
+ >
<File
- RelativePath=".\src\dtb\Bookmarks.cpp">
+ RelativePath=".\src\dtb\Bookmarks.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\CustomTest.cpp">
+ RelativePath=".\src\dtb\CustomTest.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\Dtb.cpp">
+ RelativePath=".\src\dtb\Dtb.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\DtbFileSet.cpp">
+ RelativePath=".\src\dtb\DtbFileSet.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\Metadata.cpp">
+ RelativePath=".\src\dtb\Metadata.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\Spine.cpp">
+ RelativePath=".\src\dtb\Spine.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<Filter
Name="nav"
- Filter="">
+ >
<File
- RelativePath=".\src\dtb\nav\NavContainer.cpp">
+ RelativePath=".\src\dtb\nav\NavContainer.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\nav\NavList.cpp">
+ RelativePath=".\src\dtb\nav\NavList.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\nav\NavMap.cpp">
+ RelativePath=".\src\dtb\nav\NavMap.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\nav\NavModel.cpp">
+ RelativePath=".\src\dtb\nav\NavModel.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\nav\NavNode.cpp">
+ RelativePath=".\src\dtb\nav\NavNode.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\nav\NavPoint.cpp">
+ RelativePath=".\src\dtb\nav\NavPoint.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\nav\NavTarget.cpp">
+ RelativePath=".\src\dtb\nav\NavTarget.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\nav\NavVisitor.cpp">
+ RelativePath=".\src\dtb\nav\NavVisitor.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\nav\PageList.cpp">
+ RelativePath=".\src\dtb\nav\PageList.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\nav\PageTarget.cpp">
+ RelativePath=".\src\dtb\nav\PageTarget.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
</Filter>
<Filter
Name="smil"
- Filter="">
+ >
<File
- RelativePath=".\src\dtb\smil\ContentNode.cpp">
+ RelativePath=".\src\dtb\smil\ContentNode.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\smil\Node.cpp">
+ RelativePath=".\src\dtb\smil\Node.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\smil\NodeFactory.cpp">
+ RelativePath=".\src\dtb\smil\NodeFactory.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\smil\ParNode.cpp">
+ RelativePath=".\src\dtb\smil\ParNode.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\smil\SeqNode.cpp">
+ RelativePath=".\src\dtb\smil\SeqNode.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\smil\SmilMediaGroup.cpp">
+ RelativePath=".\src\dtb\smil\SmilMediaGroup.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\smil\SmilTree.cpp">
+ RelativePath=".\src\dtb\smil\SmilTree.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\smil\SmilVisitor.cpp">
+ RelativePath=".\src\dtb\smil\SmilVisitor.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\dtb\smil\TimeContainerNode.cpp">
+ RelativePath=".\src\dtb\smil\TimeContainerNode.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
</Filter>
</Filter>
<Filter
Name="util"
- Filter="">
+ >
<File
- RelativePath=".\src\util\FilePathTools.cpp">
+ RelativePath=".\src\util\FilePathTools.cpp"
+ >
<FileConfiguration
- Name="Debug|Win32">
+ Name="Debug|Win32"
+ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"/>
+ UsePrecompiledHeader="0"
+ />
</FileConfiguration>
</File>
<File
- RelativePath=".\src\util\Log.cpp">
+ RelativePath=".\src\util\Log.cpp"
+ >
</File>
<File
- RelativePath=".\src\util\SearchForFiles.cpp">
+ RelativePath=".\src\util\SearchForFiles.cpp"
+ >
</File>
</Filter>
</Filter>
<Filter
Name="include"
- Filter="">
+ >
<File
- RelativePath=".\include\AmisCore.h">
+ RelativePath=".\include\AmisCore.h"
+ >
</File>
<File
- RelativePath=".\include\BookList.h">
+ RelativePath=".\include\BookList.h"
+ >
</File>
<File
- RelativePath=".\include\Error.h">
+ RelativePath=".\include\Error.h"
+ >
</File>
<File
- RelativePath=".\include\Media.h">
+ RelativePath=".\include\Media.h"
+ >
</File>
<File
- RelativePath=".\include\ModuleDescData.h">
+ RelativePath=".\include\ModuleDescData.h"
+ >
</File>
<Filter
Name="io"
- Filter="">
+ >
<File
- RelativePath=".\include\io\BookListFileIO.h">
+ RelativePath=".\include\io\BookListFileIO.h"
+ >
</File>
<File
- RelativePath=".\include\io\BookmarksFileIO.h">
+ RelativePath=".\include\io\BookmarksFileIO.h"
+ >
</File>
<File
- RelativePath=".\include\io\ModuleDescReader.h">
+ RelativePath=".\include\io\ModuleDescReader.h"
+ >
</File>
<File
- RelativePath=".\include\io\NavFileReader.h">
+ RelativePath=".\include\io\NavFileReader.h"
+ >
</File>
<File
- RelativePath=".\include\io\NccFileReader.h">
+ RelativePath=".\include\io\NccFileReader.h"
+ >
</File>
<File
- RelativePath=".\include\io\NcxFileReader.h">
+ RelativePath=".\include\io\NcxFileReader.h"
+ >
</File>
<File
- RelativePath=".\include\io\OpfFileReader.h">
+ RelativePath=".\include\io\OpfFileReader.h"
+ >
</File>
<File
- RelativePath=".\include\io\QuickDataSmilFileReader.h">
+ RelativePath=".\include\io\QuickDataSmilFileReader.h"
+ >
</File>
<File
- RelativePath=".\include\io\SmilFileReader.h">
+ RelativePath=".\include\io\SmilFileReader.h"
+ >
</File>
<File
- RelativePath=".\include\io\TextSearch.h">
+ RelativePath=".\include\io\TextSearch.h"
+ >
</File>
<File
- RelativePath=".\include\io\UrlInputSource.h">
+ RelativePath=".\include\io\UrlInputSource.h"
+ >
</File>
<File
- RelativePath=".\include\io\XercesSaxParseBase.h">
+ RelativePath=".\include\io\XercesSaxParseBase.h"
+ >
</File>
</Filter>
<Filter
Name="dtb"
- Filter="">
+ >
<File
- RelativePath=".\include\dtb\Bookmarks.h">
+ RelativePath=".\include\dtb\Bookmarks.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\CustomTest.h">
+ RelativePath=".\include\dtb\CustomTest.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\Dtb.h">
+ RelativePath=".\include\dtb\Dtb.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\DtbFileSet.h">
+ RelativePath=".\include\dtb\DtbFileSet.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\Metadata.h">
+ RelativePath=".\include\dtb\Metadata.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\Spine.h">
+ RelativePath=".\include\dtb\Spine.h"
+ >
</File>
<Filter
Name="nav"
- Filter="">
+ >
<File
- RelativePath=".\include\dtb\nav\NavContainer.h">
+ RelativePath=".\include\dtb\nav\NavContainer.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\nav\NavList.h">
+ RelativePath=".\include\dtb\nav\NavList.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\nav\NavMap.h">
+ RelativePath=".\include\dtb\nav\NavMap.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\nav\NavModel.h">
+ RelativePath=".\include\dtb\nav\NavModel.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\nav\NavNode.h">
+ RelativePath=".\include\dtb\nav\NavNode.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\nav\NavPoint.h">
+ RelativePath=".\include\dtb\nav\NavPoint.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\nav\NavTarget.h">
+ RelativePath=".\include\dtb\nav\NavTarget.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\nav\NavVisitor.h">
+ RelativePath=".\include\dtb\nav\NavVisitor.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\nav\PageList.h">
+ RelativePath=".\include\dtb\nav\PageList.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\nav\PageTarget.h">
+ RelativePath=".\include\dtb\nav\PageTarget.h"
+ >
</File>
</Filter>
<Filter
Name="smil"
- Filter="">
+ >
<File
- RelativePath=".\include\dtb\smil\ContentNode.h">
+ RelativePath=".\include\dtb\smil\ContentNode.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\smil\Node.h">
+ RelativePath=".\include\dtb\smil\Node.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\smil\NodeFactory.h">
+ RelativePath=".\include\dtb\smil\NodeFactory.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\smil\ParNode.h">
+ RelativePath=".\include\dtb\smil\ParNode.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\smil\SeqNode.h">
+ RelativePath=".\include\dtb\smil\SeqNode.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\smil\SmilMediaGroup.h">
+ RelativePath=".\include\dtb\smil\SmilMediaGroup.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\smil\SmilTree.h">
+ RelativePath=".\include\dtb\smil\SmilTree.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\smil\SmilVisitor.h">
+ RelativePath=".\include\dtb\smil\SmilVisitor.h"
+ >
</File>
<File
- RelativePath=".\include\dtb\smil\TimeContainerNode.h">
+ RelativePath=".\include\dtb\smil\TimeContainerNode.h"
+ >
</File>
</Filter>
</Filter>
<Filter
Name="util"
- Filter="">
+ >
<File
- RelativePath=".\include\util\FilePathTools.h">
+ RelativePath=".\include\util\FilePathTools.h"
+ >
</File>
<File
- RelativePath=".\include\util\Log.h">
+ RelativePath=".\include\util\Log.h"
+ >
</File>
<File
- RelativePath=".\include\util\SearchForFiles.h">
+ RelativePath=".\include\util\SearchForFiles.h"
+ >
</File>
<File
- RelativePath=".\include\util\xercesutils.h">
+ RelativePath=".\include\util\xercesutils.h"
+ >
</File>
</Filter>
</Filter>
Modified: branches/amis3/AmisGuiMFC2/AmisGuiMFC2.vcproj
===================================================================
--- branches/amis3/AmisGuiMFC2/AmisGuiMFC2.vcproj 2008-03-27 02:44:35 UTC (rev 2449)
+++ branches/amis3/AmisGuiMFC2/AmisGuiMFC2.vcproj 2008-03-27 08:17:37 UTC (rev 2450)
@@ -1,133 +1,197 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="7.10"
+ Version="8.00"
Name="AmisGuiMFC2"
ProjectGUID="{A7A37247-BAAC-4376-8354-96A8C09F926A}"
- Keyword="MFCProj">
+ Keyword="MFCProj"
+ >
<Platforms>
<Platform
- Name="Win32"/>
+ Name="Win32"
+ />
</Platforms>
+ <ToolFiles>
+ </ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../bin"
IntermediateDirectory="Debug"
ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="2"
- CharacterSet="1">
+ CharacterSet="1"
+ >
<Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="false"
+ />
+ <Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="include;../AmisAudio/include;../../../../ambulant/include/;"../../../../ambulant-private/pdtbplugin";"../../../../ambulant-private/pdtbplugin/PdtbIePlugin";../AmisCore/include;"../../../../xerces-c-src/src";"$(VSInstallDir)\..\Microsoft Speech SDK 5.1\Include";"$(VSInstallDir)\..\Visual Leak Detector";"
- PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;AMIS_COMPILER_MSVC;AMIS_PLATFORM_WINDOWS;WITH_EXTERNAL_SMIL_PLAYER;"
- MinimalRebuild="TRUE"
+ PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;_DEBUG;AMIS_COMPILER_MSVC;AMIS_PLATFORM_WINDOWS;WITH_EXTERNAL_SMIL_PLAYER;"
+ MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
- TreatWChar_tAsBuiltInType="FALSE"
- UsePrecompiledHeader="3"
+ TreatWChar_tAsBuiltInType="false"
+ UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
<Tool
- Name="VCCustomBuildTool"/>
+ Na...
[truncated message content] |