Commit 970a16fc authored by shibakaneki's avatar shibakaneki

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

parents ffeccc4b 9c48fd20
......@@ -49,8 +49,8 @@ else
LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`"
if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then
echo creating a tag with the version $VERSION
git tag -a "v$VERSION" -m "Generating setup for v$VERSION"
git push origin --tags
# git tag -a "v$VERSION" -m "Generating setup for v$VERSION"
# git push origin --tags
fi
fi
......@@ -191,7 +191,7 @@ CHANGE_LOG_FILE="$BASE_WORKING_DIR/DEBIAN/changelog-sankore-$VERSION.txt"
CONTROL_FILE="$BASE_WORKING_DIR/DEBIAN/control"
CHANGE_LOG_TEXT="changelog.txt"
ARCHITECTURE=`uname -i`
ARCHITECTURE=`uname -m`
if [ "$ARCHITECTURE" == "x86_64" ]; then
ARCHITECTURE="amd64"
fi
......
......@@ -3,6 +3,7 @@ html, body{
height: 100%;
margin: 0;
padding: 0;
background-color: white;
}
.toggle_mode{
......@@ -122,29 +123,35 @@ html, body{
background-color: white;
}
.close_img{
.close_img, .clear_img, .numb_img {
width: 30px;
height: 30px;
background-image: url(../img/close_img.png);
height: 30px;
background-repeat: no-repeat;
position: absolute;
top: -15px;
position: absolute;
right: -15px;
cursor: pointer;
}
.close_img{
background-image: url(../img/close_img.png);
top: -15px;
}
.clear_img{
width: 30px;
height: 30px;
background-image: url(../img/clear_img.png);
background-repeat: no-repeat;
position: absolute;
top: 15px;
right: -15px;
cursor: pointer;
}
.fill_img{
.numb_img{
background-image: url(../img/numb_img.png);
left: -15px;
top: -15px;
color: white;
font-weight: bold;
font-size: 130%;
}
/*.fill_img{
width: 30px;
height: 30px;
background-image: url(../img/fill_hor.png);
......@@ -153,7 +160,9 @@ html, body{
top: -15px;
right: 17px;
cursor: pointer;
}
}*/
.add_block{
margin: 20px 0 0 20px;
......
......@@ -15,10 +15,26 @@
lang = sankore.locale().substr(0,2);
} else
lang = "en";
$("<script type='text/javascript' src='js/translation/" + lang + ".js'>").appendTo("head");
if((typeof sankoreLang) == "undefined")
$("<script type='text/javascript' src='js/translation/en.js'>").appendTo("head");
start();
if(lang == "en")
start();
else{
returnStatus(lang);
}
function returnStatus(lang){
$.ajax({
type: 'POST',
url:'locales/' + lang + '/index.html',
statusCode: {
404: function() {
start();
},
200: function(){
window.location.href = 'locales/' + lang + '/index.html';
}
}
});
}
//here you can put your code
if(window.sankore)
sankore.enableDropOnWidget();
......@@ -38,13 +54,13 @@
<div style="width: 50%; height: 100%; float: left;">
<div id="display" style="float: right; width: 90px; cursor: pointer;" class="selected">
<div id="display_img" style="float: right;" class="green_point"></div>
<div id="display_text" style="float: right;">Display</div>
<div id="display_text" style="float: right;"></div>
</div>
</div>
<div style="width: 50%; height: 100%; float: right;">
<div id="edit" style="float: left; width: 90px; cursor: pointer;">
<div id="edit_img" style="float: left;" class="red_point"></div>
<div id="edit_text" style="float: left;">Edit</div>
<div id="edit_text" style="float: left;"></div>
</div>
</div>
</div>
......
var sankoreLang = {display: "Display", edit: "Edit", short_desc: "Place the pictures in ascending order.", add: "Add new block"};
//main function
function start(){
......@@ -40,9 +42,10 @@ function start(){
container.find(".add_img").remove();
container.find(".close_cont").remove();
container.find(".img_block").each(function(){
if($(this).html().match(/<img/)){
if($(this).find("img").attr("src") != "img/drop_img.png"){
$(this).find(".close_img").remove();
$(this).find(".clear_img").remove();
$(this).find(".numb_img").remove();
$(this).removeAttr("ondragenter")
.removeAttr("ondragleave")
.removeAttr("ondragover")
......@@ -78,7 +81,7 @@ function start(){
$("<div class='close_cont'>").appendTo(container);
container.find(".text_cont").attr("contenteditable","true");
container.find(".imgs_cont").sortable("destroy");
//container.find(".imgs_cont").sortable("destroy");
container.find(".imgs_cont").css("background-color", "white");
var add_img = $("<div class='add_img'>");
......@@ -87,10 +90,12 @@ function start(){
.attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;")
.attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;")
.attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);")
.css("float","left");
//.css("float","left");
$("<div class='close_img'>").appendTo($(this));
$("<div class='clear_img'>").appendTo($(this));
$("<div class='numb_img'>" + $(this).find("input").val() + "</div>").appendTo($(this));
});
rightOrder(container.find(".imgs_cont"));
container.find(".imgs_cont").append(add_img)
});
......@@ -130,9 +135,7 @@ function start(){
var tmp_obj = $(this).parent().parent();
$(this).parent().remove();
if(tmp_obj.find(".img_block").size() > 0){
tmp_obj.find(".img_block").each(function(){
$(this).find("input").val(++i);
});
refreshImgNumbers(tmp_obj);
}
});
......@@ -154,7 +157,7 @@ function start(){
//cleaning an image
$(".clear_img").live("click",function(){
//$(this).parent().find(".fill_img").remove();
$(this).parent().find("img").remove();
$(this).parent().find("img").attr("src","img/drop_img.png");
});
}
......@@ -274,13 +277,17 @@ function showExample(){
//check result
function checkResult(event)
{
var str = "";
var right_str = $(event.target).find("input").val();
$(event.target).find(".img_block").each(function(){
str += $(this).find("input").val() + "*";
});
if(str == right_str)
$(event.target).css("background-color","#9f9");
if($("#display").hasClass("selected")){
var str = "";
var right_str = $(event.target).find("input").val();
$(event.target).find(".img_block").each(function(){
str += $(this).find("input").val() + "*";
});
if(str == right_str)
$(event.target).css("background-color","#9f9");
} else {
refreshImgNumbers($(event.target));
}
}
//add new container
......@@ -300,11 +307,13 @@ function addContainer(){
//add new img block
function addImgBlock(dest){
var img_block = $("<div class='img_block' ondragenter='return false;' ondragleave='$(this).css(\"background-color\",\"white\"); return false;' ondragover='$(this).css(\"background-color\",\"#ccc\"); return false;' ondrop='$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);' style='text-align: center; float: left;'></div>").insertBefore(dest);
var img_block = $("<div class='img_block' ondragenter='return false;' ondragleave='$(this).css(\"background-color\",\"white\"); return false;' ondragover='$(this).css(\"background-color\",\"#ccc\"); return false;' ondrop='$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);' style='text-align: center;'></div>").insertBefore(dest);
var tmp_counter = dest.parent().find(".img_block").size();
$("<div class='close_img'>").appendTo(img_block);
$("<div class='clear_img'>").appendTo(img_block);
$("<div class='numb_img'>" + tmp_counter + "</div>").appendTo(img_block);
$("<input type='hidden' value='" + tmp_counter + "'/>").appendTo(img_block);
$("<img src='img/drop_img.png' height='120'/>").appendTo(img_block);
}
function refreshBlockNumbers(){
......@@ -329,6 +338,35 @@ function shuffle( arr )
return arr;
}
//regulation the images in right order
function rightOrder(source){
var tmp_arr = [];
var tmp_var;
source.find(".img_block").each(function(){
tmp_arr.push($(this));
$(this).remove();
});
for(var i = 0; i < tmp_arr.length; i++)
for(var j = 0; j < tmp_arr.length - 1; j++){
if(tmp_arr[j].find("input").val() > tmp_arr[j+1].find("input").val()){
tmp_var = tmp_arr[j];
tmp_arr[j] = tmp_arr[j+1];
tmp_arr[j+1] = tmp_var;
}
}
for(i in tmp_arr)
source.append(tmp_arr[i]);
}
//refresh the numbers of the images
function refreshImgNumbers(source){
var tmp = 1;
source.find(".img_block").each(function(){
$(this).find("input").val(tmp);
$(this).find(".numb_img").text(tmp);
tmp++;
});
}
function stringToXML(text){
if (window.ActiveXObject){
......
var sankoreLang = {
short_desc: "Place the pictures in ascending order.",
display:"Display",
edit:"Edit",
add:"Add new block"
};
var sankoreLang = {
short_desc: "Placez les photos dans l'ordre croissant.",
display:"D'affichage",
edit:"Modifier",
add:"Ajouter nouveau bloc"
};
var sankoreLang = {
short_desc: "Расположите картинки в порядке возрастания цифр.",
display:"Показать",
edit:"Изменить",
add:"Добавить новый блок"
};
<!DOCTYPE html>
<html>
<head>
<title>D'n'd</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="../../css/basic.css"/>
<script type="text/javascript" src="../../js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../../js/jquery-ui-1.8.9.custom.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript">
$(document).ready(function(){
start();
//here you can put your code
if(window.sankore)
sankore.enableDropOnWidget();
});
</script>
</head>
<body>
<!--<div class="dnd_container">
<div class="dnd_1" id="dnd_1" ondragenter="return false;" ondragleave="$(this).css('border-color','#ccc'); return false;" ondragover="$(this).css('border-color','orange'); return false;" ondrop="$(this).css('border-color','#ccc'); return onDropTarget1(event);">Drop the item here ...</div>
<div class="dnd_2" id="dnd_2" ondragenter="return false;" ondragleave="$(this).css('border-color','#ccc'); return false;" ondragover="$(this).css('border-color','orange'); return false;" ondrop="$(this).css('border-color','#ccc'); return onDropTarget2(event);">Drop the item here ...</div>
</div>
<div class='black_overlay' id='fade'></div>
<a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">открыть</a></p>
<div id="light" class="white_content">
Содержание<a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">закрыть</a></div>-->
<div class="toggle_mode">
<div style="width: 50%; height: 100%; float: left;">
<div id="display" style="float: right; width: 130px; cursor: pointer;" class="selected">
<div id="display_img" style="float: right;" class="green_point"></div>
<div id="display_text" style="float: right;"></div>
</div>
</div>
<div style="width: 50%; height: 100%; float: right;">
<div id="edit" style="float: left; width: 130px; cursor: pointer;">
<div id="edit_img" style="float: left;" class="red_point"></div>
<div id="edit_text" style="float: left;"></div>
</div>
</div>
</div>
<div style="width: 100%; height: 25px;"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>D'n'd</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="../../css/basic.css"/>
<script type="text/javascript" src="../../js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../../js/jquery-ui-1.8.9.custom.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript">
$(document).ready(function(){
start();
//here you can put your code
if(window.sankore)
sankore.enableDropOnWidget();
});
</script>
</head>
<body>
<!--<div class="dnd_container">
<div class="dnd_1" id="dnd_1" ondragenter="return false;" ondragleave="$(this).css('border-color','#ccc'); return false;" ondragover="$(this).css('border-color','orange'); return false;" ondrop="$(this).css('border-color','#ccc'); return onDropTarget1(event);">Drop the item here ...</div>
<div class="dnd_2" id="dnd_2" ondragenter="return false;" ondragleave="$(this).css('border-color','#ccc'); return false;" ondragover="$(this).css('border-color','orange'); return false;" ondrop="$(this).css('border-color','#ccc'); return onDropTarget2(event);">Drop the item here ...</div>
</div>
<div class='black_overlay' id='fade'></div>
<a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">открыть</a></p>
<div id="light" class="white_content">
Содержание<a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">закрыть</a></div>-->
<div class="toggle_mode">
<div style="width: 50%; height: 100%; float: left;">
<div id="display" style="float: right; width: 120px; cursor: pointer;" class="selected">
<div id="display_img" style="float: right;" class="green_point"></div>
<div id="display_text" style="float: right;"></div>
</div>
</div>
<div style="width: 50%; height: 100%; float: right;">
<div id="edit" style="float: left; width: 120px; cursor: pointer;">
<div id="edit_img" style="float: left;" class="red_point"></div>
<div id="edit_text" style="float: left;"></div>
</div>
</div>
</div>
<div style="width: 100%; height: 25px;"></div>
</body>
</html>
......@@ -179,9 +179,6 @@ void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QS
QString pdfName = UBPersistenceManager::objectDirectory + "/" + pdfItem->fileUuid().toString() + ".pdf";
QString backgroundPath = pDocumentProxy->persistencePath() + "/" + pdfName;
QPointF boudingRectBottomLeft = scene->itemsBoundingRect().bottomLeft();
QPointF pdfItemBottomLeft = pdfItem->sceneBoundingRect().bottomLeft();
qDebug() << "scene->itemsBoundingRect()" << scene->itemsBoundingRect();
qDebug() << "pdfItem->boundingRect()" << pdfItem->boundingRect();
qDebug() << "pdfItem->sceneBoundingRect()" << pdfItem->sceneBoundingRect();
......
......@@ -40,7 +40,6 @@ void UBActionableWidget::removeAllActions()
void UBActionableWidget::setActionsVisible(bool bVisible)
{
//mShowActions = bVisible;
if(!mActions.empty() && mActions.contains(eAction_Close)){
mCloseButtons.setVisible(bVisible);
}
......@@ -51,35 +50,6 @@ void UBActionableWidget::onCloseClicked()
emit close(this);
}
bool UBActionableWidget::shouldClose(QPoint p)
{
bool close = false;
// if(mShowActions &&
// p.x() >= 0 &&
// p.x() <= ACTIONSIZE &&
// p.y() >= 0 &&
// p.y() <= ACTIONSIZE){
// close = true;
// }
return close;
}
void UBActionableWidget::paintEvent(QPaintEvent* ev)
{
// if(mShowActions){
// QPainter p(this);
// if(mActions.contains(eAction_Close)){
// p.drawPixmap(0, 0, 16, 16, QPixmap(":images/close.svg"));
// }else if(mActions.contains(eAction_MoveUp)){
// // Implement me later
// }else if(mActions.contains(eAction_MoveDown)){
// // Implement me later
// }
// }
}
void UBActionableWidget::setActionsParent(QWidget *parent)
{
if(mActions.contains(eAction_Close)){
......
......@@ -38,5 +38,5 @@ void UBDraggableMedia::mouseMoveEvent(QMouseEvent* ev)
drag->setMimeData(mimeData);
Qt::DropAction dropAction = drag->exec(Qt::CopyAction | Qt::MoveAction);
drag->exec(Qt::CopyAction | Qt::MoveAction);
}
......@@ -7,12 +7,12 @@
#include "UBWidgetList.h"
UBWidgetList::UBWidgetList(QWidget* parent, eWidgetListOrientation orientation, const char* name):QScrollArea(parent)
, mCanRemove(true)
, mpLayout(NULL)
, mpContainer(NULL)
, mMargin(10)
, mListElementsSpacing(10)
, mpEmptyLabel(NULL)
, mCanRemove(true)
, mpCurrentWidget(NULL)
{
setObjectName(name);
......@@ -139,6 +139,7 @@ void UBWidgetList::resizeEvent(QResizeEvent *ev)
void UBWidgetList::mousePressEvent(QMouseEvent *ev)
{
Q_UNUSED(ev);
if(mCanRemove){
QWidget* pWAt = widgetAt(ev->pos());
if(NULL != mpCurrentWidget){
......
......@@ -1755,6 +1755,9 @@ void UBGraphicsScene::addCache()
mTools << cache;
addItem(cache);
cache->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Tool));
cache->setVisible(true);
cache->setSelected(true);
UBApplication::boardController->notifyCache(true);
......
......@@ -47,7 +47,7 @@ QByteArray UBBase32::decode(const QString& base32String)
if (lookup < 0 || lookup >= 80)
continue;
int digit = sBase32Lookup[lookup];
int digit = sBase32Lookup[(int)lookup];
/* If this digit is not in the table, ignore it */
if (digit == 0xFF)
......
......@@ -16,10 +16,12 @@
#include "UBFileSystemUtils.h"
#include <QtGui>
#include "globals/UBGlobals.h"
THIRD_PARTY_WARNINGS_DISABLE
#include "quazipfile.h"
#include <openssl/md5.h>
THIRD_PARTY_WARNINGS_ENABLE
#include "core/memcheck.h"
......
......@@ -191,8 +191,8 @@ private:
void resizeTabs();
private:
UBTabDockPalete *mTabPalette;
eUBDockPaletteType mPaletteType;
UBTabDockPalete *mTabPalette;
};
#endif // UBDOCKPALETTE_H
......@@ -2,6 +2,7 @@
#include "UBTBDocumentPreviewWidget.h"
UBTBDocumentPreviewWidget::UBTBDocumentPreviewWidget(UBTeacherBarDataMgr *pDataMgr, QWidget *parent, const char *name):QWidget(parent)
, mpContainer(NULL)
, mpPageViewButton(NULL)
, mpEditButton(NULL)
, mpSessionLabel(NULL)
......@@ -19,7 +20,6 @@ UBTBDocumentPreviewWidget::UBTBDocumentPreviewWidget(UBTeacherBarDataMgr *pDataM
, mpTopicLabel(NULL)
, mpTopic(NULL)
, mpLicense(NULL)
, mpContainer(NULL)
{
setObjectName(name);
mpDataMgr = pDataMgr;
......
......@@ -74,6 +74,7 @@ void UBTeacherBarDataMgr::saveContent()
void UBTeacherBarDataMgr::loadContent(bool docChanged)
{
Q_UNUSED(docChanged);
clearLists();
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument();
......@@ -132,6 +133,7 @@ void UBTeacherBarDataMgr::loadContent(bool docChanged)
// ------------------------------------------------------------------------------------
UBTBSeparator::UBTBSeparator(QWidget *parent, const char *name):QFrame(parent)
{
Q_UNUSED(name);
setObjectName("UBTBSeparator");
setMinimumHeight(5);
setMaximumHeight(5);
......
......@@ -37,6 +37,7 @@ void UBTeacherBarPreviewMedia::cleanMedia()
void UBTeacherBarPreviewMedia::loadWidgets(QList<QWidget*> pWidgetsList, bool isResizable)
{
Q_UNUSED(isResizable);
foreach(QWidget*eachWidget, pWidgetsList){
mWidget->addWidget(eachWidget);
mWidgetList[eachWidget]="DRAG UNAVAILABLE";
......@@ -362,6 +363,7 @@ void UBTeacherBarPreviewWidget::generateComments()
void UBTeacherBarPreviewWidget::showEvent(QShowEvent* ev)
{
Q_UNUSED(ev);
updateFields();
}
......@@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <iostream>
#include <QtGlobal>
#include "ASCII85Decode.h"
#include "core/memcheck.h"
......@@ -51,6 +51,12 @@ void ASCII85Decode::_wput(std::string &cur,unsigned long tuple, int len)
}
}
bool ASCII85Decode::encode(std::string & decoded)
{
Q_UNUSED(decoded);
return false;
}
bool ASCII85Decode::decode(std::string &encoded)
{
unsigned long tuple = 0;
......@@ -58,7 +64,6 @@ bool ASCII85Decode::decode(std::string &encoded)
int count = 0;
int size = encoded.size();
int i = 0;
bool found = false;
for(;size;)
{
char ch = encoded[i++];
......@@ -121,3 +126,7 @@ bool ASCII85Decode::decode(std::string &encoded)
}
return true;
}
void ASCII85Decode::initialize(Object * objectWithStram)
{
Q_UNUSED(objectWithStram);
};
......@@ -26,9 +26,9 @@ namespace merge_lib
public:
ASCII85Decode(){};
virtual ~ASCII85Decode(){};
bool encode(std::string & decoded) {return false;}
bool encode(std::string & decoded);
bool decode(std::string & encoded);
void initialize(Object * objectWithStram){};
void initialize(Object * objectWithStram);
private:
void _wput(std::string &cur,unsigned long tuple, int len);
......
......@@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ASCIIHexDecode.h"
#include <QtGlobal>
#include <string>
#include "Utils.h"
......@@ -42,6 +42,12 @@ static unsigned int convertHexVal(unsigned char c)
return 0;
}
bool ASCIIHexDecode::encode(std::string & decoded)
{
Q_UNUSED(decoded);
return false;
}
bool ASCIIHexDecode::decode(std::string & encoded)
{
bool isLow = true;
......@@ -75,3 +81,8 @@ bool ASCIIHexDecode::decode(std::string & encoded)
encoded = decoded;
return true;
}
void ASCIIHexDecode::initialize(Object * objectWithStram)
{
Q_UNUSED(objectWithStram);
}
......@@ -26,9 +26,9 @@ namespace merge_lib
public:
ASCIIHexDecode(){};
virtual ~ASCIIHexDecode(){};
bool encode(std::string & decoded){return false;}
bool encode(std::string & decoded);
bool decode(std::string & encoded);
void initialize(Object * objectWithStram){};
void initialize(Object * objectWithStram);
};
}
......
/*
* 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 <QtGlobal>
#include "CCITTFaxDecode.h"
using namespace merge_lib;
bool CCITTFaxDecode::encode(std::string & decoded)
{
Q_UNUSED(decoded);
return true;
}
bool CCITTFaxDecode::decode(std::string & encoded)
{
Q_UNUSED(encoded);
return true;
}
void CCITTFaxDecode::initialize(Object * objectWithStram)
{
Q_UNUSED(objectWithStram);
}
......@@ -16,6 +16,8 @@
#define CCITTFaxDecode_H
#include <string>
#include "Decoder.h"
namespace merge_lib
{
// this class provides method for FlateDecode encoding and decoding
......@@ -24,9 +26,9 @@ namespace merge_lib
public:
CCITTFaxDecode(){};
virtual ~CCITTFaxDecode(){};
bool encode(std::string & decoded) {return true;};
bool decode(std::string & encoded) {return true;};
void initialize(Object * objectWithStram){};
bool encode(std::string & decoded);
bool decode(std::string & encoded);
void initialize(Object * objectWithStram);
};
}
......
......@@ -12,6 +12,7 @@
* 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 "ContentHandler.h"
#include "Filter.h"
#include "FlateDecode.h"
......
/*
* 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 <QtGlobal>
#include "DCTDecode.h"
using namespace merge_lib;
bool DCTDecode::encode(std::string & decoded)
{
Q_UNUSED(decoded);
return true;
}
bool DCTDecode::decode(std::string & encoded)
{
Q_UNUSED(encoded);
return true;
}
void DCTDecode::initialize(Object * objectWithStram)
{
Q_UNUSED(objectWithStram);
}
......@@ -16,7 +16,7 @@
#define DCTDecode_H
#include <string>
#include "Decoder.h"
namespace merge_lib
{
// this class provides method for FlateDecode encoding and decoding
......@@ -25,9 +25,9 @@ namespace merge_lib
public:
DCTDecode(){};
virtual ~DCTDecode(){};
bool encode(std::string & decoded) {return true;};
bool decode(std::string & encoded) {return true;};
void initialize(Object * objectWithStram){};
bool encode(std::string & decoded);
bool decode(std::string & encoded);
void initialize(Object * objectWithStram);
};
}
......
......@@ -28,7 +28,8 @@
using namespace merge_lib;
const std::string firstObj("%PDF-1.4\n1 0 obj\n<<\n/Title ()/Creator ()/Producer (Qt 4.5.0 (C) 1992-2009 Nokia Corporation and/or its subsidiary(-ies))/CreationDate (D:20090424120829)\n>>\nendobj\n");
const std::string zeroStr("0000000000");
Document::Document(const char * fileName): _pages(), _maxObjectNumber(0),_root(0),_documentName(fileName)
Document::Document(const char * fileName):
_root(0), _pages(), _documentName(fileName), _maxObjectNumber(0)
{
}
......
......@@ -15,6 +15,7 @@
#include "Config.h"
#include <iostream>
#include <map>
#include <QtGlobal>
#include "FilterPredictor.h"
#include "Utils.h"
......@@ -49,6 +50,12 @@ FilterPredictor::~FilterPredictor()
{
}
bool FilterPredictor::encode(std::string & decoded)
{
Q_UNUSED(decoded);
return false;
}
std::string FilterPredictor::getDictionaryContentStr(std::string & in, size_t &pos )
{
size_t beg = in.find(DICT_START_TOKEN,pos);
......
......@@ -27,7 +27,7 @@ namespace merge_lib
public:
FilterPredictor();
virtual ~FilterPredictor();
bool encode(std::string & decoded){return false;}
bool encode(std::string & decoded);
bool decode(std::string & encoded);
void initialize(Object * objectWithStream);
......
/*
* 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 <QtGlobal>
#include "JBIG2Decode.h"
using namespace merge_lib;
bool JBIG2Decode::encode(std::string & decoded)
{
Q_UNUSED(decoded);
return true;
}
bool JBIG2Decode::decode(std::string & encoded)
{
Q_UNUSED(encoded);
return true;
}
void JBIG2Decode::initialize(Object * objectWithStram)
{
Q_UNUSED(objectWithStram);
}
......@@ -16,6 +16,7 @@
#define JBIG2Decode_H
#include <string>
#include "Decoder.h"
namespace merge_lib
{
......@@ -25,9 +26,9 @@ namespace merge_lib
public:
JBIG2Decode(){};
virtual ~JBIG2Decode(){};
bool encode(std::string & decoded) {return true;};
bool decode(std::string & encoded) {return true;};
void initialize(Object * objectWithStram){};
bool encode(std::string & decoded);
bool decode(std::string & encoded);
void initialize(Object * objectWithStram);
};
}
......
......@@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <iostream>
#include <QtGlobal>
#include "LZWDecode.h"
#include "FilterPredictor.h"
......@@ -31,8 +32,9 @@ LZWDecode::LZWDecode():
_readBits(0),
_nextCode(0),
_bitsToRead(0),
_curSequenceLength(0),
_first(true)
_first(true),
_curSequenceLength(0)
{
clearTable();
}
......@@ -44,6 +46,12 @@ LZWDecode::~LZWDecode()
}
}
bool LZWDecode::encode(std::string & decoded)
{
Q_UNUSED(decoded);
return true;
}
void LZWDecode::initialize(Object * objectWithStream)
{
if( objectWithStream )
......
......@@ -27,7 +27,7 @@ namespace merge_lib
public:
LZWDecode();
virtual ~LZWDecode();
bool encode(std::string & decoded) {return true;};
bool encode(std::string & decoded);
bool decode(std::string & encoded);
void initialize(Object * objectWithStram);
private:
......@@ -37,8 +37,8 @@ namespace merge_lib
void clearTable();
int getCode();
std::string &_encoded;
std::string _dummy;
std::string &_encoded;
size_t _curSymbolIndex;
int _earlyChange; // early parameter
......
......@@ -15,6 +15,7 @@
#include "OverlayDocumentParser.h"
#include <fstream>
#include <string.h>
#include <QtGlobal>
#include "Exception.h"
#include "Object.h"
......@@ -74,7 +75,6 @@ void OverlayDocumentParser::_readXRefAndCreateObjects()
notEndOfFile = false;
}
unsigned long toReadAgain = 0;
for(objIter = objectsAndPositions.begin(); objIter != objectsAndPositions.end(); )
{
if((objectsAndSizes[objIter->first] + objIter->second <= nextPartStart) && (objIter->second >= partStart) && ((objIter->second < nextPartStart)))
......@@ -100,6 +100,11 @@ void OverlayDocumentParser::_readXRefAndCreateObjects()
while(notEndOfFile);
}
void OverlayDocumentParser::_getFileContent(const char * fileName)
{
Q_UNUSED(fileName);
}
void OverlayDocumentParser::_getPartOfFileContent(long startOfPart, unsigned int length)
{
ifstream pdfFile;
......
......@@ -38,7 +38,7 @@ namespace merge_lib
private:
//methods
void _getFileContent(const char * fileName){};
void _getFileContent(const char * fileName);
void _readXRefAndCreateObjects();
void _readXref(std::map<unsigned int, unsigned long> & objectsAndSizes);
void _getPartOfFileContent(long startOfPart, unsigned int length);
......
......@@ -37,7 +37,7 @@
using namespace merge_lib;
Page::Page(unsigned int pageNumber): _pageNumber(pageNumber),_root(NULL), _rotation(0)
Page::Page(unsigned int pageNumber): _root(NULL),_pageNumber(pageNumber), _rotation(0)
{
}
......
......@@ -12,8 +12,9 @@
* 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 "PageElementHandler.h"
#include "PageElementHandler.h"
#include <QtGlobal>
#include "core/memcheck.h"
using namespace merge_lib;
......@@ -88,3 +89,8 @@ unsigned int PageElementHandler::_findEndOfElementContent(unsigned int startOfPa
}
return _pageContent.rfind(">>");
}
void PageElementHandler::_processObjectContent(unsigned int startOfPageElement)
{
Q_UNUSED(startOfPageElement);
}
......@@ -73,14 +73,14 @@ namespace merge_lib
void _createAllPageFieldsSet();
//members
std::string & _pageContent;
Object * _page;
std::string & _pageContent;
std::string _handlerName;
PageElementHandler * _nextHandler;
private:
//methods
virtual void _processObjectContent(unsigned int startOfPageElement){};
virtual void _processObjectContent(unsigned int startOfPageElement);
virtual void _changeObjectContent(unsigned int startOfPageElement) = 0;
virtual void _pageElementNotFound() {};
unsigned int _findStartOfPageElement()
......
......@@ -24,21 +24,21 @@
using namespace merge_lib;
Rectangle::Rectangle(const char * rectangleName):
_rectangleName(rectangleName),
x1(0),
y1(0),
x2(0),
y2(0),
_rectangleName(rectangleName),
_tm()
{}
Rectangle::Rectangle(const char * rectangleName, const std::string content):
_rectangleName(rectangleName),
x1(0),
y1(0),
x2(0),
y2(0)
y2(0),
_rectangleName(rectangleName)
{
unsigned int rectanglePosition = Parser::findToken(content,rectangleName);
......
......@@ -40,7 +40,7 @@ namespace merge_lib
double getHeight();
//members
double x1, x2, y1, y2;
double x1, y1, x2, y2;
private:
//methods
const std::string _getRectangleAsString(const char * delimeter);
......
......@@ -15,6 +15,8 @@
#if !defined RotationHandler_h
#define RotationHandler_h
#include <QtGlobal>
#include "PageElementHandler.h"
#include "Page.h"
......@@ -55,7 +57,7 @@ namespace merge_lib
strin>>rotation;
_basePage.setRotation(rotation);
}
virtual void _changeObjectContent(unsigned int startOfPageElement) {};
virtual void _changeObjectContent(unsigned int startOfPageElement) {Q_UNUSED(startOfPageElement);};
//members
Page & _basePage;
......
......@@ -12,12 +12,19 @@
* 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 "RunLengthDecode.h"
#include "RunLengthDecode.h"
#include <QtGlobal>
#include "core/memcheck.h"
using namespace merge_lib;
bool RunLengthDecode::encode(std::string & decoded)
{
Q_UNUSED(decoded);
return false;
}
/* The encoded data is a sequence of
runs, where each run consists of a length byte followed by 1 to 128 bytes of data. If
the length byte is in the range 0 to 127, the following length + 1 (1 to 128) bytes
......@@ -57,3 +64,8 @@ bool RunLengthDecode::decode(std::string & encoded)
}
return true;
}
void RunLengthDecode::initialize(Object * objectWithStream)
{
Q_UNUSED(objectWithStream);
};
......@@ -26,9 +26,9 @@ namespace merge_lib
public:
RunLengthDecode(){};
virtual ~RunLengthDecode(){};
bool encode(std::string & decoded){return false;}
bool encode(std::string & decoded);
bool decode(std::string & encoded);
void initialize(Object * objectWithStream){};
void initialize(Object * objectWithStream);
};
}
......
......@@ -12,6 +12,8 @@
* 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 <QtGlobal>
#include "Config.h"
#include "Utils.h"
#include "Exception.h"
......@@ -101,6 +103,7 @@ bool Utils::doubleEquals(const double left, const double right, const double eps
double Utils::normalizeValue(double &val, const double epsilon )
{
Q_UNUSED(epsilon);
if( Utils::doubleEquals(val,0))
{
val = 0;
......
......@@ -54,7 +54,10 @@ SOURCES += \
RemoveHimselfHandler.cpp \
RunLengthDecode.cpp \
Utils.cpp \
OverlayDocumentParser.cpp
OverlayDocumentParser.cpp \
src/pdf-merger/CCITTFaxDecode.cpp \
src/pdf-merger/JBIG2Decode.cpp \
src/pdf-merger/DCTDecode.cpp
macx {
......@@ -83,3 +86,6 @@ linux-g++-64 {
LIBS += -lz
}
......@@ -112,6 +112,7 @@ void UBYouTubePublisher::postClientLoginRequest(const QString& userName, const Q
void UBYouTubePublisher::postClientLoginResponse(bool success, const QByteArray& pPayload)
{
Q_UNUSED(success);
mAuthToken = "";
QString auth = QString::fromUtf8(pPayload);
......@@ -136,7 +137,7 @@ void UBYouTubePublisher::postClientLoginResponse(bool success, const QByteArray&
if(mAuthToken.length() == 0)
{
UBApplication::showMessage(tr("YouTube authentication failed."));
success = false;
// success = false;
deleteLater();
}
else
......
......@@ -26,6 +26,7 @@
UBOEmbedParser::UBOEmbedParser(QObject *parent, const char* name)
{
Q_UNUSED(parent);
setObjectName(name);
mParsedTitles.clear();
connect(this, SIGNAL(parseContent(QString)), this, SLOT(onParseContent(QString)));
......@@ -223,7 +224,6 @@ void UBOEmbedParser::onParseContent(QString url)
void UBOEmbedParser::onFinished(QNetworkReply *reply)
{
QNetworkReply::NetworkError err = reply->error();
if(QNetworkReply::NoError == reply->error()){
QString receivedDatas = reply->readAll().constData();
sOEmbedContent crntContent;
......
......@@ -75,7 +75,6 @@ void WBClearButton::paintEvent(QPaintEvent *event)
int height = this->height();
painter.setRenderHint(QPainter::Antialiasing, true);
QColor color = palette().color(QPalette::Mid);
painter.setBrush(isDown()
? palette().color(QPalette::Dark)
: palette().color(QPalette::Mid));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment