Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Ivan Ilin 13 years ago
commit 7670a812cc
  1. 134
      Sankore.iss
  2. 2
      Sankore_3.1.pro
  3. 71
      release.win7.vc9.64.bat
  4. 2
      release.win7.vc9.bat
  5. 3
      resources/library/interactive/Anyembed.wgt/css/ubwidget.css
  6. 1
      resources/library/interactive/Anyembed.wgt/js/languages.js
  7. 14
      resources/library/interactive/Anyembed.wgt/js/ubw-main.js
  8. 9
      resources/library/interactive/VideoPicker.wgt/css/main.css
  9. 13
      resources/library/interactive/VideoPicker.wgt/index.html
  10. 16
      resources/library/search/VideoSearch.wgs/config.xml
  11. 148
      resources/library/search/VideoSearch.wgs/css/basic.css
  12. BIN
      resources/library/search/VideoSearch.wgs/icon.png
  13. BIN
      resources/library/search/VideoSearch.wgs/icon.thumbnail.png
  14. BIN
      resources/library/search/VideoSearch.wgs/images/down.png
  15. BIN
      resources/library/search/VideoSearch.wgs/images/greySquare.png
  16. BIN
      resources/library/search/VideoSearch.wgs/images/icon-close.png
  17. BIN
      resources/library/search/VideoSearch.wgs/images/popupBack.png
  18. BIN
      resources/library/search/VideoSearch.wgs/images/search.png
  19. BIN
      resources/library/search/VideoSearch.wgs/images/trgDown.png
  20. BIN
      resources/library/search/VideoSearch.wgs/images/trgUp.png
  21. BIN
      resources/library/search/VideoSearch.wgs/images/up.png
  22. 279
      resources/library/search/VideoSearch.wgs/index.html
  23. 18
      resources/library/search/VideoSearch.wgs/scripts/jquery-1.6.2.min.js
  24. 4
      src/adaptors/UBImportPDF.cpp
  25. 3
      src/adaptors/UBImportPDF.h
  26. 2
      src/adaptors/UBMetadataDcSubsetAdaptor.cpp
  27. 2
      src/board/UBBoardController.cpp
  28. 8
      src/core/UBSetting.cpp
  29. 10
      src/core/UBSettings.cpp
  30. 4
      src/core/UBSettings.h
  31. 4
      src/document/UBDocumentProxy.cpp
  32. 3
      src/pdf/PDFRenderer.cpp
  33. 6
      src/pdf/PDFRenderer.h
  34. 44
      src/pdf/XPDFRenderer.cpp
  35. 2
      src/pdf/XPDFRenderer.h
  36. 91
      src/web/browser/UBOEmbedParser.cpp

@ -1,134 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{E63D17F8-D9DA-479D-B9B5-0D101A03703B}
AppName=Sankore
AppVerName=Sankore
AppPublisher=Sankore
AppPublisherURL=http://dev.open-sankore.org
AppSupportURL=http://dev.open-sankore.org
AppUpdatesURL=http://dev.open-sankore.org
DefaultDirName={pf}\Sankore
DefaultGroupName=Sankore
OutputDir=.\install\win32\
OutputBaseFilename=Sankore
SetupIconFile=.\resources\win\uniboard.ico
Compression=lzma
SolidCompression=yes
[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl"
Name: "fr"; MessagesFile: "compiler:Languages\French.isl"
Name: "gr"; MessagesFile: "compiler:Languages\German.isl"
Name: "it"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "sp"; MessagesFile: "compiler:Languages\Spanish.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[InstallDelete]
Type: files ; Name: "{app}\Sankore.pdb"
Type: filesandordirs ; Name: "{app}\library"
Type: filesandordirs ; Name: "{app}\Microsoft.VC90.CRT"
Type: filesandordirs ; Name: "{app}\plugins"
Type: filesandordirs ; Name: "{app}\i18n"
Type: files ; Name: "{app}\*.dll"
[Files]
Source: "..\Sankore-ThirdParty\microsoft\vcredist_x86.exe"; DestDir:"{tmp}"
Source: ".\build\win32\release\product\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
;OpenSSL
Source: "..\Sankore-ThirdParty\openssl\win32\libeay32.dll"; DestDir:"{app}"; Flags: ignoreversion
Source: "..\Sankore-ThirdParty\openssl\win32\ssleay32.dll"; DestDir:"{app}"; Flags: ignoreversion
;Qt base dll
Source: "..\Qt-sankore3.1\lib\QtScript4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\lib\QtGui4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\lib\QtXml4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\lib\QtCore4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\lib\QtWebKit4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\lib\phonon4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\lib\QtNetwork4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\lib\QtSvg4.dll"; DestDir: "{app}"; Flags: ignoreversion
;Qt plugins
Source: "..\Qt-sankore3.1\plugins\accessible\qtaccessiblecompatwidgets4.dll"; DestDir: "{app}\accessible"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\accessible\qtaccessiblewidgets4.dll"; DestDir: "{app}\accessible"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\bearer\qgenericbearer4.dll"; DestDir: "{app}\bearer"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\bearer\qnativewifibearer4.dll"; DestDir: "{app}\bearer"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\codecs\qcncodecs4.dll"; DestDir: "{app}\codecs"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\codecs\qjpcodecs4.dll"; DestDir: "{app}\codecs"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\codecs\qkrcodecs4.dll"; DestDir: "{app}\codecs"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\codecs\qtwcodecs4.dll"; DestDir: "{app}\codecs"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\graphicssystems\qglgraphicssystem4.dll"; DestDir: "{app}\graphicssystems"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\graphicssystems\qtracegraphicssystem4.dll"; DestDir: "{app}\graphicssystems"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\iconengines\qsvgicon4.dll"; DestDir: "{app}\iconengines"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\imageformats\qgif4.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\imageformats\qico4.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\imageformats\qjpeg4.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\imageformats\qmng4.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\imageformats\qsvg4.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\imageformats\qtiff4.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\plugins\phonon_backend\phonon_ds94.dll"; DestDir: "{app}\phonon_backend"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\Sankore"; Filename: "{app}\Sankore.exe"
Name: "{group}\{cm:UninstallProgram,Sankore}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Sankore"; Filename: "{app}\Sankore.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Sankore"; Filename: "{app}\Sankore.exe"; Tasks: quicklaunchicon
;Name: "{group}\Printing Preferences"; Filename: "{app}\properties.exe"; WorkingDir: {app}
[Registry]
Root: HKCR; Subkey: ".ubz"; ValueType: string; ValueName: ""; ValueData: "SankoreFile"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "SankoreFile"; ValueType: string; ValueName: ""; ValueData: "Sankore document"; Flags: uninsdeletekey
Root: HKCR; Subkey: "SankoreFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\Sankore.exe,1"
Root: HKCR; Subkey: "SankoreFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\Sankore.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\Sankore"; ValueType: string; ValueName: "Client application"; ValueData: "{app}\Sankore.exe"; Flags: uninsdeletevalue; Check: isProcessorNotX64
Root: HKLM; Subkey: "SOFTWARE\Sankore"; ValueType: dword; ValueName: "Transfer mode"; ValueData: "0"; Flags: uninsdeletevalue; Check: isProcessorNotX64
Root: HKLM; Subkey: "SOFTWARE\Sankore"; ValueType: dword; ValueName: "EMF: Hide page"; ValueData: "1"; Flags: uninsdeletevalue; Check: isProcessorNotX64
Root: HKLM; Subkey: "SOFTWARE\Sankore\Defaults"; ValueType: dword; ValueName: "PDF: Enabled"; ValueData: "1"; Flags: uninsdeletevalue; Check: isProcessorNotX64
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Internet Explorer\Low Rights\DragDrop\{{E63D17F8-D9DA-479D-B9B5-0D101A03703B}"; ValueType: dword; ValueName: "Policy"; ValueData: "3"; Flags: uninsdeletevalue; Check: isProcessorNotX64
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Internet Explorer\Low Rights\DragDrop\{{E63D17F8-D9DA-479D-B9B5-0D101A03703B}"; ValueType: string; ValueName: "AppName"; ValueData: "Sankore.exe"; Flags: uninsdeletevalue; Check: isProcessorNotX64
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Internet Explorer\Low Rights\DragDrop\{{E63D17F8-D9DA-479D-B9B5-0D101A03703B}"; ValueType: string; ValueName: "AppPath"; ValueData: "{app}"; Flags: uninsdeletevalue; Check: isProcessorNotX64
Root: HKLM64; Subkey: "SOFTWARE\Sankore"; ValueType: string; ValueName: "Client application"; ValueData: "{app}\Sankore.exe"; Flags: uninsdeletevalue; Check: isProcessorX64
Root: HKLM64; Subkey: "SOFTWARE\Sankore"; ValueType: dword; ValueName: "Transfer mode"; ValueData: "0"; Flags: uninsdeletevalue; Check: isProcessorX64
Root: HKLM64; Subkey: "SOFTWARE\Sankore"; ValueType: dword; ValueName: "EMF: Hide page"; ValueData: "1"; Flags: uninsdeletevalue; Check: isProcessorX64
Root: HKLM64; Subkey: "SOFTWARE\Sankore\Defaults"; ValueType: dword; ValueName: "PDF: Enabled"; ValueData: "1"; Flags: uninsdeletevalue; Check: isProcessorX64
Root: HKLM64; Subkey: "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Low Rights\DragDrop\{{E63D17F8-D9DA-479D-B9B5-0D101A03703B}"; ValueType: dword; ValueName: "Policy"; ValueData: "3"; Flags: uninsdeletevalue; Check: isProcessorX64
Root: HKLM64; Subkey: "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Low Rights\DragDrop\{{E63D17F8-D9DA-479D-B9B5-0D101A03703B}"; ValueType: string; ValueName: "AppName"; ValueData: "Sankore.exe"; Flags: uninsdeletevalue; Check: isProcessorX64
Root: HKLM64; Subkey: "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Low Rights\DragDrop\{{E63D17F8-D9DA-479D-B9B5-0D101A03703B}"; ValueType: string; ValueName: "AppPath"; ValueData: "{app}"; Flags: uninsdeletevalue; Check: isProcessorX64
[Run]
Filename: "{tmp}\vcredist_x86.exe";WorkingDir:"{tmp}"
Filename: "{app}\Sankore.exe"; Description: "{cm:LaunchProgram,Sankore}"; Flags: nowait postinstall
[UninstallDelete]
; cleanup and delete whole installation directory
Name: {app}; Type: filesandordirs
[Code]
function isProcessorX64: Boolean;
begin
Result := (ProcessorArchitecture = paX64);
end;
function isProcessorNotX64: Boolean;
begin
Result := not isProcessorX64;
end;

@ -13,7 +13,7 @@ linux-g++-64 {
VERSION_MAJ = 1 VERSION_MAJ = 1
VERSION_MIN = 40 VERSION_MIN = 40
VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error
VERSION_PATCH = 01 VERSION_PATCH = 02
VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}" VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}"
VERSION = $$replace(VERSION, "\\.r", "") VERSION = $$replace(VERSION, "\\.r", "")

@ -0,0 +1,71 @@
REM --------------------------------------------------------------------
REM This program is free software: you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
REM the Free Software Foundation, either version 3 of the License, or
REM (at your option) any later version.
REM
REM This program is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
REM GNU General Public License for more details.
REM
REM You should have received a copy of the GNU General Public License
REM along with this program. If not, see <http://www.gnu.org/licenses/>.
REM ---------------------------------------------------------------------
set QT_DIR=..\Qt-sankore3.1
set QT_BIN=%QT_DIR%\bin
set PROGRAMS_FILE_PATH=C:\Program Files (x86)
set GIT_BIN=%PROGRAMS_FILE_PATH%\Git\bin
set VS_BIN=%PROGRAMS_FILE_PATH%\Microsoft Visual Studio 9.0\VC\bin
set WIN_SDK_BIN=%PROGRAMS_FILE_PATH%\Microsoft SDKs\Windows\v6.0A\Bin
set INNO_EXE=%PROGRAMS_FILE_PATH%\Inno Setup 5\iscc.exe
set BUILD_DIR=build\win32\release
set LRELEASE=%QT_DIR%\bin\lrelease
set PATH=%QT_BIN%;%PATH%;%WIN_SDK_BIN%;%GIT_BIN%
call "%VS_BIN%\vcvars32.bat"
echo %PATH%
REM this checks if the custom qt directory path
REM is correct. This is important because installer
REM pick up dll from this directory
IF NOT EXIST "..\Qt-sankore3.1\lib\QtCore4.dll" GOTO EXIT_WITH_ERROR
REM rmdir /S /Q %BUILD_DIR%
set EDITION=MNEMIS_EDITION
"%QT_BIN%\qmake.exe" "DEFINES+=%EDITION%"
%LRELEASE% Sankore_3.1.pro
set /p VERSION= < build\win32\release\version
git rev-list --tags --max-count=1 > tmp
set /p LAST_TAG= < tmp
erase tmp
git describe %LAST_TAG% > tmp
set /p LAST_TAG_VERSION=< tmp
erase tmp
echo %VERSION%
echo %LAST_TAG_VERSION%
REM if not v%VERSION%==%LAST_TAG_VERSION% GOTO EXIT_WITH_ERROR
nmake release-install
del ".\build\win32\release\product\Sankore.pdb"
set INSTALLER_NAME=Open-Sankore
set INSTALLER_PATH=.\install\win32\%INSTALLER_NAME%.exe
call "%INNO_EXE%" "Sankore 3.1.iss" /F"%INSTALLER_NAME%"
:EXIT_WITH_ERROR
echo ERROR

@ -65,7 +65,7 @@ set INSTALLER_NAME=Open-Sankore
set INSTALLER_PATH=.\install\win32\%INSTALLER_NAME%.exe set INSTALLER_PATH=.\install\win32\%INSTALLER_NAME%.exe
call "%INNO_EXE%" "Sankore.iss" /F"%INSTALLER_NAME%" call "%INNO_EXE%" "Sankore 3.1.iss" /F"%INSTALLER_NAME%"
:EXIT_WITH_ERROR :EXIT_WITH_ERROR
echo ERROR echo ERROR

@ -19,3 +19,6 @@ body{
} }
.bordered{
border: 1px solid red;
}

@ -9,4 +9,3 @@ var sankoreLang = {
"embed": "Intégrer" "embed": "Intégrer"
} }
}; };

@ -74,8 +74,9 @@ function init(){
$("#ubwidget").append(searchWrap); $("#ubwidget").append(searchWrap);
submit.click(function(){ submit.click(function(){
$("#ubwidget").append(loadWindow)
embed = inputBox.val(); embed = inputBox.val();
if(embed){
$("#ubwidget").append(loadWindow);
searchWrap.hide(); searchWrap.hide();
if(/<object/.test(embed)){ if(/<object/.test(embed)){
@ -92,7 +93,16 @@ function init(){
window.sankore.resize($(document).width(),$(document).height()); window.sankore.resize($(document).width(),$(document).height());
window.sankore.setPreference("embed", escape(embed)); window.sankore.setPreference("embed", escape(embed));
} }
} else{
var sleepTime = 100;
var counter = 0;
var id = setInterval(function(){
inputBox.toggleClass("bordered");
counter ++;
if(counter == 10)
clearInterval(id);
}, sleepTime);
}
}); });
if(window.sankore){ if(window.sankore){

@ -135,7 +135,6 @@ body{
margin-top:17px; margin-top:17px;
margin-left:17px; margin-left:17px;
outline:none; outline:none;
border:1px solid #666;
font-family:Arial, Sans-serif; font-family:Arial, Sans-serif;
font-size:15px; font-size:15px;
color:#444; color:#444;
@ -167,3 +166,11 @@ body{
background-image:url(../imgs/right.png); background-image:url(../imgs/right.png);
background-repeat:no-repeat; background-repeat:no-repeat;
} }
.bordered1{
border: 1px solid red;
}
.bordered2{
border:1px solid #666;
}

@ -65,6 +65,7 @@
$("#search-button") $("#search-button")
.click(function(){ .click(function(){
if($("#textbox").val()){
window.resizeTo(385, 80); window.resizeTo(385, 80);
$("#container").removeClass("welcome").removeClass("change").removeClass("error").addClass("load"); $("#container").removeClass("welcome").removeClass("change").removeClass("error").addClass("load");
$("#container-shadow").hide(); $("#container-shadow").hide();
@ -74,6 +75,16 @@
marginTop:-9000 marginTop:-9000
}).empty().oembed($("#textbox").val()); }).empty().oembed($("#textbox").val());
checkcontent(); checkcontent();
} else {
var sleepTime = 100;
var counter = 0;
var id = setInterval(function(){
$("#textbox").toggleClass("bordered1").toggleClass("bordered2");
counter ++;
if(counter == 10)
clearInterval(id);
}, sleepTime);
}
}) })
.mouseenter(function(){ .mouseenter(function(){
$(this) $(this)
@ -187,7 +198,7 @@
<div id="shadow"></div> <div id="shadow"></div>
<div id="inputfield"> <div id="inputfield">
<input id="textbox" type="text"> <input id="textbox" type="text" class="bordered2">
<div id="search-button" class="button">Show</div> <div id="search-button" class="button">Show</div>
</div> </div>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://uniboard.mnemis.com/widgets/webbrowser"
version="1.1"
width="900"
height="500"
ub:resizable="true">
<name>Choisir</name>
<author href="http://www.getuniboard.com"
email="info@mnemis.com">Mnemis SA</author>
<description>Choisir widget</description>
<content src="index.html"/>
</widget>

@ -0,0 +1,148 @@
body{
width: 100%;
padding: 0;
height: auto;
background-color: white;
margin: 0;
}
.disclaimer{
width: 90%;
height: 50px;
position: absolute;
left: 0;
bottom: 0;
margin-left: 1px;
margin-right: 1px;
margin-bottom: 0px;
padding: 5px;
text-align: center;
background-color: #BBBBBB;
-webkit-border-top-left-radius: 15px;
-webkit-border-top-right-radius: 15px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
border: solid 4px #EEEEEE;
border-bottom: none;
z-index: 10;
}
.search{
width: 90%;
position: absolute;
top: 0;
left: 0;
margin-left: 1px;
margin-right: 1px;
margin-top: 0px;
padding: 5px;
background-color: #BBBBBB;
-webkit-border-bottom-left-radius: 15px;
-webkit-border-bottom-right-radius: 15px;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
border: solid 4px #EEEEEE;
border-top: none;
z-index: 10;
}
.togglePages{
padding: 0;
position: absolute;
bottom: -14px;
left: 43%;
width: 15%;
height: 10px;
background-color: #666;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
-webkit-box-shadow: #dadada -1px 0 4px;
box-shadow: #dadada -1px 0 4px;
cursor: pointer;
}
.toggleIcon{
width: 14px;
height: 10px;
background-image: url(../images/trgUp.png);
}
.searchInput{
margin: 10px 5px 10px 5px;
padding: 2px;
padding-left: 8px;
padding-right:8px;
float: left;
width: 60%;
border-radius: 15px;
border-style: none;
}
.searchButton{
width: 32px;
height: 32px;
margin: 5px 5px;
background-image: url(../images/search.png);
float: left;
cursor: pointer;
}
.subSearch{
margin: 0;
float: left;
}
#subSearchInput{
width: 100%;
float: left;
}
.searchResult{
width: 98%;
padding: 3px;
background-color:#123456;
}
.videoContainer{
float: left;
padding: 3px;
margin: 3px;
text-align: center;
overflow: hidden;
font-size: small;
font-family: Verdana,Arial,Helvetica,sans-serif;
border: 1px solid #666;
border-radius: 5px;
-webkit-box-shadow: #dadada -1px 0 4px;
-webkit-border-radius: 5px;
box-shadow: #666 -1px 0 4px;
}
.resultFooter{
float: left;
margin: 5px;
padding: 3px;
width: 100%;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-weight: bold;
font-size: x-large;
}
#branding{
position: absolute;
top: 0;
left: 10px;
z-index: 2;
}
span{
font-family: Verdana,Arial,Helvetica,sans-serif;
color: #666;
}
[draggable] {
-webkit-user-select: none;
user-select: none;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,279 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Google Image Search</title>
<link rel="stylesheet" type="text/css" href="css/basic.css"/>
<script type="text/javascript" src="http://www.google.com/uds"></script>
<script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
// This code generates a "Raw Searcher" to handle search queries. The Raw Searcher requires
// you to handle and draw the search results manually.
google.load('search', '1');
var videoSearch;
var minHeight = 180;
var minWidht = 150;
var filtersDisplayed = false; //display or hide filters
function addPaginationLinks() {
// To paginate search results, use the cursor function.
var cursor = videoSearch.cursor;
var curPage = cursor.currentPageIndex; // check what page the app is on
var pagesDiv = $("<div id='resultFooter' class='resultFooter'>");
for (var i = 0; i < cursor.pages.length; i++) {
var page = cursor.pages[i];
if (curPage == i) {
// If we are on the current page, then don't make a link.
var label = document.createTextNode(' ' + page.label + ' ');
pagesDiv.append($(label));
} else {
// Create links to other pages using gotoPage() on the searcher.
var link = document.createElement('a');
link.href = 'javascript:videoSearch.gotoPage('+i+');';
link.innerHTML = page.label;
link.style.marginRight = '2px';
pagesDiv.append($(link));
}
}
pagesDiv.appendTo($('#searchResult'));
$(".videoContainer").each(function(){
this.addEventListener("dragstart", imageDragging, false);
})
$(".videoContainer").each(function(){
this.addEventListener("dragenter", imageDragenter, false);
})
$(".videoContainer").each(function(){
this.addEventListener("dragleave", imageDragleave, false);
})
$(".videoContainer").each(function(){
this.addEventListener("dragover", imageDragover, false);
})
}
function searchComplete() {
// Check that we got results
document.getElementById('searchResult').innerHTML = '';
if (videoSearch.results && videoSearch.results.length > 0) {
var contentDiv = $('#searchResult').empty();
var results = videoSearch.results;
for (var i = 0; i < results.length; i++) {
// Create HTML elements for search results
var result = results[i];
/*var str = videoSearch.results[i].playUrl.replace("&autoplay=1","").replace("&autoplay=true","");
alert(str)
a.src = str + "&autoPlay=false";
a.type = "application/x-shockwave-flash";*/
// Append search results to the HTML nodes
//p.appendChild(a);
//document.body.appendChild(p);
var videoContainer = $("<div class='videoContainer' draggable='true'>");
var title = document.createElement('div');
var vUrl = $("<input type='hidden'/>");
var vContent = $("<input type='hidden'/>");
var vHeight = $("<input type='hidden'/>");
var vWidth = $("<input type='hidden'/>");
var vTitle = $("<input type='hidden'/>");
var vAuthor = $("<input type='hidden'/>");
var vDuration = $("<input type='hidden'/>");
var vPublished = $("<input type='hidden'/>");
var vPublisher = $("<input type='hidden'/>");
var vRating = $("<input type='hidden'/>");
var vCount = $("<input type='hidden'/>");
// We use titleNoFormatting so that no HTML tags are left in the
// title
title.innerHTML = result.title;
var newImg = document.createElement('img');
// There is also a result.url property which has the escaped version
newImg.src = result.tbUrl;
//var str = videoSearch.results[i].playUrl.replace("&autoplay=1","").replace("&autoplay=true","");
vUrl.attr("value", result.url);
vContent.attr("value", result.content);
vHeight.attr("value", result.tbHeight);
vWidth.attr("value", result.tbWidth);
vTitle.attr("value",result.titleNoFormatting);
vAuthor.attr("value", result.author);
vDuration.attr("value", result.duration);
vPublished.attr("value", result.published);
vPublisher.attr("value", result.publisher);
vRating.attr("value",result.rating);
vCount.attr("value",result.viewCount);
//var imgWidth = (result.tbWidth > minWidht)?result.tbWidth:minWidht;
//var imgHeight = (result.tbHeight > minHeight)?result.tbHeight:minHeight;
videoContainer.width(minWidht).height(minHeight);
videoContainer.append($(newImg));
videoContainer.append($(title));
videoContainer.append(vUrl);
videoContainer.append(vContent);
videoContainer.append(vHeight);
videoContainer.append(vWidth);
videoContainer.append(vTitle);
videoContainer.append(vAuthor);
videoContainer.append(vDuration);
videoContainer.append(vPublished);
videoContainer.append(vPublisher);
videoContainer.append(vRating);
videoContainer.append(vCount);
// Put our title + image in the content
videoContainer.appendTo(contentDiv);
}
addPaginationLinks(videoSearch);
}
}
function onLoad() {
// Create a VideoSearch instance.
videoSearch = new google.search.VideoSearch();
// Set searchComplete as the callback function when a search is complete. The
// videoSearch object will have results in it.
videoSearch.setSearchCompleteCallback(this, searchComplete, null);
videoSearch.setResultSetSize(8);
// Include the required Google branding
google.search.Search.getBranding('branding');
}
// Set a callback to call your code when the page loads
google.setOnLoadCallback(onLoad);
function imageDragging(e){
e.dataTransfer.setData("text/plain",$(this).find("input:hidden").eq(0).val());
//alert($(this).find("input:hidden").val());
}
function imageDragleave(e){
return false;
}
function imageDragover(e){
return false;
}
function imageDragenter(e){
return false;
}
$(document).ready(function(){
//variables
var mode = false; //search or view mode
var hide = false; //hide or no main panel
//basic containers and elements
var disclaimer = $("<div id='disclaimer' class='disclaimer'>Disclaimer<div>").appendTo("body");
var search = $("<div id='search' class='search'>").appendTo("body");
disclaimer.width($("body").width()-20);
search.width($("body").width()-20);
var togglePages = $("<div id='togglePages' class='togglePages'>").appendTo(search);
var toggleIcon = $("<div id='toggleIcon' class='toggleIcon'>").appendTo(togglePages).css("margin-left",(togglePages.width()/2 - 7));
var subSearchInput = $("<div id='subSearchInput' class='subSearch'>").appendTo(search);
var searchInput = $("<input id='searchInput' class='searchInput' type='text'/>").appendTo(subSearchInput);
var searchButton = $("<div id='searchButton' class='searchButton'>").appendTo(subSearchInput);
togglePages.click(function(event){
if(mode){
hide = false;
$("#search, #disclaimer").slideDown('slow', function(){
toggleIcon.css("background-image","url(images/trgUp.png)");
togglePages.appendTo("#search").css("top","").css("bottom","-14px");
});
mode = false;
} else {
hide = true;
$("#search, #disclaimer").slideUp('slow', function(){
toggleIcon.css("background-image","url(images/trgDown.png)");
togglePages.appendTo("body").css("top","0");
});
mode = true;
}
});
searchButton.click(function(){
if(!hide){
videoSearch.execute(searchInput.val());
togglePages.trigger("click");
}
});
searchInput.keydown(function(event){
if(!hide){
if((event.keyCode == 0xA)||(event.keyCode == 0xD)){
videoSearch.execute(searchInput.val());
togglePages.trigger("click");
}
}
});
$(".videoContainer").live("click",function(){
//alert(createMetaData($(this)));
sankore.sendFileMetadata(createMetaData($(this)));
});
$(window).resize(function(){
disclaimer.width($("body").width()-20);
search.width($("body").width()-20);
toggleIcon.css("margin-left",(togglePages.width()/2 - 7));
})
});
function createMetaData(parent){
var meta = "";
//alert($(this).find("input:hidden").eq(0).val());
meta = "<metadata><data><key>Type</key><value>Video</value></data><data><key>Url</key><value>" +
parent.find("input:hidden").eq(0).val() +
"</value></data><data><key>Content</key><value>" +
parent.find("input:hidden").eq(1).val() +
"</value></data><data><key>tbHeight</key><value>" +
parent.find("input:hidden").eq(2).val() +
"</value></data><data><key>tbWidth</key><value>" +
parent.find("input:hidden").eq(3).val() +
"</value></data><data><key>Title</key><value>" +
parent.find("input:hidden").eq(4).val() +
"</value></data><data><key>Author</key><value>" +
parent.find("input:hidden").eq(5).val() +
"</value></data><data><key>Duration</key><value>" +
parent.find("input:hidden").eq(6).val() +
"</value></data><data><key>Published</key><value>" +
parent.find("input:hidden").eq(7).val() +
"</value></data><data><key>Publisher</key><value>" +
parent.find("input:hidden").eq(8).val() +
"</value></data><data><key>Rating</key><value>" +
parent.find("input:hidden").eq(9).val() +
"</value></data><data><key>View count</key><value>" +
parent.find("input:hidden").eq(10).val() +
"</value></data></metadata>";
return meta;
}
</script>
</head>
<body style="font-family: Arial;border: 0 none;">
<div id="branding" style="float: left;"></div><br />
<div id="searchResult"></div>
</body>
</html>

File diff suppressed because one or more lines are too long

@ -31,7 +31,8 @@
UBImportPDF::UBImportPDF(QObject *parent) UBImportPDF::UBImportPDF(QObject *parent)
: UBImportAdaptor(parent) : UBImportAdaptor(parent)
{ {
// NOOP QDesktopWidget* desktop = UBApplication::desktop();
this->dpi = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
} }
@ -68,6 +69,7 @@ bool UBImportPDF::addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFi
UBApplication::showMessage(tr("PDF import failed.")); UBApplication::showMessage(tr("PDF import failed."));
return false; return false;
} }
pdfRenderer->setDPI(this->dpi);
int documentPageCount = pDocument->pageCount(); int documentPageCount = pDocument->pageCount();

@ -33,6 +33,9 @@ class UBImportPDF : public UBImportAdaptor
virtual QString importFileFilter(); virtual QString importFileFilter();
virtual bool addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFile); virtual bool addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFile);
private:
int dpi;
}; };
#endif /* UBIMPORTPDF_H_ */ #endif /* UBIMPORTPDF_H_ */

@ -185,7 +185,7 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
if (width == 1024 && height == 768) // move from 1024/768 to 1280/960 if (width == 1024 && height == 768) // move from 1024/768 to 1280/960
{ {
docSize = UBSettings::settings()->defaultDocumentSize; docSize = UBSettings::settings()->pageSize->get().toSize();
} }
metadata.insert(UBSettings::documentSize, QVariant(docSize)); metadata.insert(UBSettings::documentSize, QVariant(docSize));

@ -1589,6 +1589,8 @@ void UBBoardController::setPageSize(QSize newSize)
updatePageSizeState(); updatePageSizeState();
adjustDisplayViews(); adjustDisplayViews();
mActiveDocument->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); mActiveDocument->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
UBSettings::settings()->pageSize->set(newSize);
} }
} }

@ -29,8 +29,12 @@ UBSetting::UBSetting(UBSettings* parent) :
UBSetting::UBSetting(UBSettings* owner, const QString& pDomain, const QString& pKey, UBSetting::UBSetting(UBSettings* owner, const QString& pDomain, const QString& pKey,
const QVariant& pDefaultValue) : const QVariant& pDefaultValue) :
QObject(owner), mOwner(owner), mDomain(pDomain), mKey(pKey), mPath( QObject(owner),
pDomain + "/" + pKey), mDefaultValue(pDefaultValue) mOwner(owner),
mDomain(pDomain),
mKey(pKey),
mPath(pDomain + "/" + pKey),
mDefaultValue(pDefaultValue)
{ {
//NOOP //NOOP
} }

@ -188,6 +188,9 @@ void UBSettings::init()
softwareHomeUrl = productWebUrl->get().toString(); softwareHomeUrl = productWebUrl->get().toString();
documentSizes.insert(DocumentSizeRatio::Ratio4_3, QSize(1280, 960)); // 1.33
documentSizes.insert(DocumentSizeRatio::Ratio16_9, QSize((960 / 9 * 16), 960)); // 1.77
appToolBarPositionedAtTop = new UBSetting(this, "App", "ToolBarPositionedAtTop", true); appToolBarPositionedAtTop = new UBSetting(this, "App", "ToolBarPositionedAtTop", true);
appToolBarDisplayText = new UBSetting(this, "App", "ToolBarDisplayText", true); appToolBarDisplayText = new UBSetting(this, "App", "ToolBarDisplayText", true);
appEnableAutomaticSoftwareUpdates = new UBSetting(this, "App", "EnableAutomaticSoftwareUpdates", true); appEnableAutomaticSoftwareUpdates = new UBSetting(this, "App", "EnableAutomaticSoftwareUpdates", true);
@ -216,6 +219,8 @@ void UBSettings::init()
boardKeyboardPaletteKeyBtnSize = new UBSetting(this, "Board", "KeyboardPaletteKeyBtnSize", "16x16"); boardKeyboardPaletteKeyBtnSize = new UBSetting(this, "Board", "KeyboardPaletteKeyBtnSize", "16x16");
ValidateKeyboardPaletteKeyBtnSize(); ValidateKeyboardPaletteKeyBtnSize();
pageSize = new UBSetting(this, "Board", "DefaultPageSize", documentSizes.value(DocumentSizeRatio::Ratio4_3));
QStringList penLightBackgroundColors; QStringList penLightBackgroundColors;
penLightBackgroundColors << "#000000" << "#FF0000" <<"#004080" << "#008000" << "#C87400" << "#800040" << "#008080" << "#5F2D0A"; penLightBackgroundColors << "#000000" << "#FF0000" <<"#004080" << "#008000" << "#C87400" << "#800040" << "#008080" << "#5F2D0A";
boardPenLightBackgroundColors = new UBColorListSetting(this, "Board", "PenLightBackgroundColors", penLightBackgroundColors, 1.0); boardPenLightBackgroundColors = new UBColorListSetting(this, "Board", "PenLightBackgroundColors", penLightBackgroundColors, 1.0);
@ -310,11 +315,6 @@ void UBSettings::init()
boardShowToolsPalette = new UBSetting(this, "Board", "ShowToolsPalette", "false"); boardShowToolsPalette = new UBSetting(this, "Board", "ShowToolsPalette", "false");
documentSizes.insert(DocumentSizeRatio::Ratio4_3, QSize(1280, 960)); // 1.33
documentSizes.insert(DocumentSizeRatio::Ratio16_9, QSize((960 / 9 * 16), 960)); // 1.77
defaultDocumentSize = documentSizes.value(DocumentSizeRatio::Ratio4_3);
svgViewBoxMargin = new UBSetting(this, "SVG", "ViewBoxMargin", "50"); svgViewBoxMargin = new UBSetting(this, "SVG", "ViewBoxMargin", "50");
pdfMargin = new UBSetting(this, "PDF", "Margin", "20"); pdfMargin = new UBSetting(this, "PDF", "Margin", "20");

@ -266,7 +266,7 @@ class UBSettings : public QObject
QMap<DocumentSizeRatio::Enum, QSize> documentSizes; QMap<DocumentSizeRatio::Enum, QSize> documentSizes;
QSize defaultDocumentSize; //QSize defaultDocumentSize;
UBSetting* svgViewBoxMargin; UBSetting* svgViewBoxMargin;
UBSetting* pdfMargin; UBSetting* pdfMargin;
@ -311,6 +311,8 @@ class UBSettings : public QObject
UBSetting* communityUser; UBSetting* communityUser;
UBSetting* communityPsw; UBSetting* communityPsw;
UBSetting* pageSize;
/* /*
static int navigPaletteWidth; static int navigPaletteWidth;
static int libPaletteWidth; static int libPaletteWidth;

@ -48,7 +48,7 @@ void UBDocumentProxy::init()
setUuid(QUuid::createUuid()); setUuid(QUuid::createUuid());
setDefaultDocumentSize(UBSettings::settings()->defaultDocumentSize); setDefaultDocumentSize(UBSettings::settings()->pageSize->get().toSize());
} }
@ -162,7 +162,7 @@ QSize UBDocumentProxy::defaultDocumentSize() const
if (mMetaDatas.contains(UBSettings::documentSize)) if (mMetaDatas.contains(UBSettings::documentSize))
return metaData(UBSettings::documentSize).toSize(); return metaData(UBSettings::documentSize).toSize();
else else
return UBSettings::settings()->defaultDocumentSize; return UBSettings::settings()->pageSize->get().toSize();
} }
void UBDocumentProxy::setDefaultDocumentSize(QSize pSize) void UBDocumentProxy::setDefaultDocumentSize(QSize pSize)

@ -23,6 +23,9 @@
QMap< QUuid, QPointer<PDFRenderer> > PDFRenderer::sRenderers; QMap< QUuid, QPointer<PDFRenderer> > PDFRenderer::sRenderers;
PDFRenderer::PDFRenderer() : dpiForRendering(96)
{
}
PDFRenderer::~PDFRenderer() PDFRenderer::~PDFRenderer()
{ {

@ -50,6 +50,8 @@ class PDFRenderer : public QObject
QUuid fileUuid() const { return mFileUuid; } QUuid fileUuid() const { return mFileUuid; }
QByteArray fileData() const { return mFileData; } QByteArray fileData() const { return mFileData; }
void setDPI(int desiredDPI) { this->dpiForRendering = desiredDPI; }
public slots: public slots:
virtual void render(QPainter *p, int pageNumber, const QRectF &bounds = QRectF()) = 0; virtual void render(QPainter *p, int pageNumber, const QRectF &bounds = QRectF()) = 0;
@ -63,6 +65,10 @@ class PDFRenderer : public QObject
void setFileUuid(const QUuid &fileUuid); void setFileUuid(const QUuid &fileUuid);
static QMap< QUuid, QPointer<PDFRenderer> > sRenderers; static QMap< QUuid, QPointer<PDFRenderer> > sRenderers;
protected:
int dpiForRendering;
PDFRenderer();
}; };
#endif // PDFRENDERER_H #endif // PDFRENDERER_H

@ -39,8 +39,6 @@ XPDFRenderer::XPDFRenderer(const QString &filename, bool importingFile)
mDocument = new PDFDoc(new GString(filename.toUtf8().data()), 0, 0, 0); // the filename GString is deleted on PDFDoc desctruction mDocument = new PDFDoc(new GString(filename.toUtf8().data()), 0, 0, 0); // the filename GString is deleted on PDFDoc desctruction
sInstancesCount.ref(); sInstancesCount.ref();
mScaleX = 0.0;
mScaleY = 0.0;
} }
XPDFRenderer::~XPDFRenderer() XPDFRenderer::~XPDFRenderer()
@ -114,16 +112,17 @@ QSizeF XPDFRenderer::pageSizeF(int pageNumber) const
{ {
int rotate = mDocument->getPageRotate(pageNumber); int rotate = mDocument->getPageRotate(pageNumber);
cropWidth = mDocument->getPageCropWidth(pageNumber); cropWidth = mDocument->getPageCropWidth(pageNumber) * this->dpiForRendering / 72.0;
cropHeight = mDocument->getPageCropHeight(pageNumber); cropHeight = mDocument->getPageCropHeight(pageNumber) * this->dpiForRendering / 72.0;
if ((rotate == 90) || (rotate == 270)) if (rotate == 90 || rotate == 270)
{ {
cropWidth = mDocument->getPageCropHeight(pageNumber); //switching width and height
cropHeight = mDocument->getPageCropWidth(pageNumber); qreal tmpVar = cropWidth;
cropWidth = cropHeight;
cropHeight = tmpVar;
} }
} }
return QSizeF(cropWidth, cropHeight); return QSizeF(cropWidth, cropHeight);
} }
@ -142,14 +141,6 @@ void XPDFRenderer::render(QPainter *p, int pageNumber, const QRectF &bounds)
{ {
qreal xscale = p->worldTransform().m11(); qreal xscale = p->worldTransform().m11();
qreal yscale = p->worldTransform().m22(); qreal yscale = p->worldTransform().m22();
bool bZoomChanged = false;
if(fabs(mScaleX - xscale) > 0.1 || fabs(mScaleY - yscale) > 0.1)
{
mScaleX = xscale;
mScaleY = yscale;
bZoomChanged = true;
}
QImage *pdfImage = createPDFImage(pageNumber, xscale, yscale, bounds); QImage *pdfImage = createPDFImage(pageNumber, xscale, yscale, bounds);
QTransform savedTransform = p->worldTransform(); QTransform savedTransform = p->worldTransform();
@ -162,7 +153,6 @@ void XPDFRenderer::render(QPainter *p, int pageNumber, const QRectF &bounds)
QImage* XPDFRenderer::createPDFImage(int pageNumber, const qreal xscale, const qreal yscale, const QRectF &bounds) QImage* XPDFRenderer::createPDFImage(int pageNumber, const qreal xscale, const qreal yscale, const QRectF &bounds)
{ {
QImage* img = new QImage();
if (isValid()) if (isValid())
{ {
SplashColor paperColor = {0xFF, 0xFF, 0xFF}; // white SplashColor paperColor = {0xFF, 0xFF, 0xFF}; // white
@ -170,36 +160,30 @@ QImage* XPDFRenderer::createPDFImage(int pageNumber, const qreal xscale, const q
delete mSplash; delete mSplash;
mSplash = new SplashOutputDev(splashModeRGB8, 1, gFalse, paperColor); mSplash = new SplashOutputDev(splashModeRGB8, 1, gFalse, paperColor);
mSplash->startDoc(mDocument->getXRef()); mSplash->startDoc(mDocument->getXRef());
int hResolution = 72;
int vResolution = 72;
int rotation = 0; // in degrees (get it from the worldTransform if we want to support rotation) int rotation = 0; // in degrees (get it from the worldTransform if we want to support rotation)
GBool useMediaBox = gFalse; GBool useMediaBox = gFalse;
GBool crop = gTrue; GBool crop = gTrue;
GBool printing = gFalse; GBool printing = gFalse;
const qreal xScale = xscale;
const qreal yScale = yscale;
mSliceX = 0.; mSliceX = 0.;
mSliceY = 0.; mSliceY = 0.;
if (bounds.isNull()) if (bounds.isNull())
{ {
mDocument->displayPage(mSplash, pageNumber, hResolution * xScale, vResolution * yScale, mDocument->displayPage(mSplash, pageNumber, this->dpiForRendering, this->dpiForRendering,
rotation, useMediaBox, crop, printing); rotation, useMediaBox, crop, printing);
} }
else else
{ {
mSliceX = bounds.x() * xScale; mSliceX = bounds.x() * xscale;
mSliceY = bounds.y() * yScale; mSliceY = bounds.y() * yscale;
qreal sliceW = bounds.width() * xScale; qreal sliceW = bounds.width() * xscale;
qreal sliceH = bounds.height() * yScale; qreal sliceH = bounds.height() * yscale;
mDocument->displayPageSlice(mSplash, pageNumber, hResolution * xScale, vResolution * yScale, mDocument->displayPageSlice(mSplash, pageNumber, this->dpiForRendering, this->dpiForRendering,
rotation, useMediaBox, crop, printing, mSliceX, mSliceY, sliceW, sliceH); rotation, useMediaBox, crop, printing, mSliceX, mSliceY, sliceW, sliceH);
} }
mpSplashBitmap = mSplash->getBitmap(); mpSplashBitmap = mSplash->getBitmap();
delete img;
img = new QImage(mpSplashBitmap->getDataPtr(), mpSplashBitmap->getWidth(), mpSplashBitmap->getHeight(), mpSplashBitmap->getWidth() * 3, QImage::Format_RGB888);
} }
return img; return new QImage(mpSplashBitmap->getDataPtr(), mpSplashBitmap->getWidth(), mpSplashBitmap->getHeight(), mpSplashBitmap->getWidth() * 3, QImage::Format_RGB888);
} }

@ -57,8 +57,6 @@ class XPDFRenderer : public PDFRenderer
SplashBitmap* mpSplashBitmap; SplashBitmap* mpSplashBitmap;
SplashOutputDev* mSplash; SplashOutputDev* mSplash;
qreal mScaleX;
qreal mScaleY;
}; };
#endif // XPDFRENDERER_H #endif // XPDFRENDERER_H

@ -1,91 +0,0 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QRegExp>
#include "UBOEmbedParser.h"
/**********************************************************************************
----------------------------------------------------------------
Here is an example of an embed content in an XML representation
----------------------------------------------------------------
<oembed>
<provider_url>http://www.youtube.com/</provider_url>
<title>EPISODE 36 Traditional Mediums</title>
<html>
<iframe width="480" height="270" src="http://www.youtube.com/embed/C3lApsNmdwM?fs=1&feature=oembed" frameborder="0" allowfullscreen></iframe>
</html>
<author_name>FZDSCHOOL</author_name>
<height>270</height>
<thumbnail_width>480</thumbnail_width>
<width>480</width>
<version>1.0</version>
<author_url>http://www.youtube.com/user/FZDSCHOOL</author_url>
<provider_name>YouTube</provider_name>
<thumbnail_url>http://i4.ytimg.com/vi/C3lApsNmdwM/hqdefault.jpg</thumbnail_url>
<type>video</type>
<thumbnail_height>360</thumbnail_height>
</oembed>
***********************************************************************************/
typedef struct{
QString providerUrl;
QString title;
QString author;
int height;
int thumbWidth;
float version;
QString authorUrl;
QString providerName;
QString thumbUrl;
QString type;
QString thumbHeight;
QString sourceUrl;
}sOEmbedContent;
UBOEmbedParser::UBOEmbedParser(QObject *parent, const char* name)
{
setObjectName(name);
mParsedTitles.clear();
}
UBOEmbedParser::~UBOEmbedParser()
{
}
void UBOEmbedParser::parse(const QString& html, QList<QUrl> *pList)
{
// get all the oembed links and parse their informations
QString query = "";
}
/**
/brief Extract the oembed infos from the JSON
@param jsonUrl as the url of the JSON file
*/
void UBOEmbedParser::getJSONInfos(const QString &jsonUrl)
{
}
/**
/brief Extract the oembed infos from the XML
@param xmlUrl as the url of the XML file
*/
void UBOEmbedParser::getXMLInfos(const QString &xmlUrl)
{
}
Loading…
Cancel
Save