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

preferencesAboutTextFull
shibakaneki 13 years ago
commit 970a16fc01
  1. 6
      buildDebianPackage
  2. 35
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/css/basic.css
  3. BIN
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/1.jpg
  4. BIN
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/1.png
  5. BIN
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/2.png
  6. BIN
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/clear_img.png
  7. BIN
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/drop_img.png
  8. BIN
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/numb_img.png
  9. 28
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/index.html
  10. 68
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/js/script.js
  11. 8
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/js/translation/en.js
  12. 8
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/js/translation/fr.js
  13. 8
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/js/translation/ru.js
  14. BIN
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/fr/img/drop_img.png
  15. 45
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/fr/index.html
  16. 392
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/fr/js/script.js
  17. BIN
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/ru/img/drop_img.png
  18. 45
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/ru/index.html
  19. 392
      resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/ru/js/script.js
  20. 3
      src/adaptors/UBExportFullPDF.cpp
  21. 30
      src/customWidgets/UBActionableWidget.cpp
  22. 2
      src/customWidgets/UBDraggableMedia.cpp
  23. 3
      src/customWidgets/UBWidgetList.cpp
  24. 3
      src/domain/UBGraphicsScene.cpp
  25. 2
      src/frameworks/UBBase32.cpp
  26. 4
      src/frameworks/UBFileSystemUtils.cpp
  27. 2
      src/gui/UBDockPalette.h
  28. 2
      src/gui/UBTBDocumentPreviewWidget.cpp
  29. 2
      src/gui/UBTeacherBarDataMgr.cpp
  30. 2
      src/gui/UBTeacherBarPreviewWidget.cpp
  31. 13
      src/pdf-merger/ASCII85Decode.cpp
  32. 4
      src/pdf-merger/ASCII85Decode.h
  33. 13
      src/pdf-merger/ASCIIHexDecode.cpp
  34. 4
      src/pdf-merger/ASCIIHexDecode.h
  35. 36
      src/pdf-merger/CCITTFaxDecode.cpp
  36. 8
      src/pdf-merger/CCITTFaxDecode.h
  37. 1
      src/pdf-merger/ContentHandler.cpp
  38. 36
      src/pdf-merger/DCTDecode.cpp
  39. 8
      src/pdf-merger/DCTDecode.h
  40. 3
      src/pdf-merger/Document.cpp
  41. 7
      src/pdf-merger/FilterPredictor.cpp
  42. 2
      src/pdf-merger/FilterPredictor.h
  43. 36
      src/pdf-merger/JBIG2Decode.cpp
  44. 7
      src/pdf-merger/JBIG2Decode.h
  45. 12
      src/pdf-merger/LZWDecode.cpp
  46. 4
      src/pdf-merger/LZWDecode.h
  47. 7
      src/pdf-merger/OverlayDocumentParser.cpp
  48. 2
      src/pdf-merger/OverlayDocumentParser.h
  49. 2
      src/pdf-merger/Page.cpp
  50. 8
      src/pdf-merger/PageElementHandler.cpp
  51. 4
      src/pdf-merger/PageElementHandler.h
  52. 6
      src/pdf-merger/Rectangle.cpp
  53. 2
      src/pdf-merger/Rectangle.h
  54. 4
      src/pdf-merger/RotationHandler.h
  55. 14
      src/pdf-merger/RunLengthDecode.cpp
  56. 4
      src/pdf-merger/RunLengthDecode.h
  57. 3
      src/pdf-merger/Utils.cpp
  58. 8
      src/pdf-merger/pdfMerger.pri
  59. 3
      src/podcast/youtube/UBYouTubePublisher.cpp
  60. 2
      src/web/UBOEmbedParser.cpp
  61. 1
      src/web/browser/WBSearchLineEdit.cpp

@ -49,8 +49,8 @@ else
LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`" LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`"
if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then
echo creating a tag with the version $VERSION echo creating a tag with the version $VERSION
git tag -a "v$VERSION" -m "Generating setup for v$VERSION" # git tag -a "v$VERSION" -m "Generating setup for v$VERSION"
git push origin --tags # git push origin --tags
fi fi
fi fi
@ -191,7 +191,7 @@ CHANGE_LOG_FILE="$BASE_WORKING_DIR/DEBIAN/changelog-sankore-$VERSION.txt"
CONTROL_FILE="$BASE_WORKING_DIR/DEBIAN/control" CONTROL_FILE="$BASE_WORKING_DIR/DEBIAN/control"
CHANGE_LOG_TEXT="changelog.txt" CHANGE_LOG_TEXT="changelog.txt"
ARCHITECTURE=`uname -i` ARCHITECTURE=`uname -m`
if [ "$ARCHITECTURE" == "x86_64" ]; then if [ "$ARCHITECTURE" == "x86_64" ]; then
ARCHITECTURE="amd64" ARCHITECTURE="amd64"
fi fi

@ -3,6 +3,7 @@ html, body{
height: 100%; height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
background-color: white;
} }
.toggle_mode{ .toggle_mode{
@ -122,29 +123,35 @@ html, body{
background-color: white; background-color: white;
} }
.close_img{ .close_img, .clear_img, .numb_img {
width: 30px; width: 30px;
height: 30px; height: 30px;
background-image: url(../img/close_img.png);
background-repeat: no-repeat; background-repeat: no-repeat;
position: absolute; position: absolute;
top: -15px;
right: -15px; right: -15px;
cursor: pointer; cursor: pointer;
} }
.close_img{
background-image: url(../img/close_img.png);
top: -15px;
}
.clear_img{ .clear_img{
width: 30px;
height: 30px;
background-image: url(../img/clear_img.png); background-image: url(../img/clear_img.png);
background-repeat: no-repeat;
position: absolute;
top: 15px; 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; width: 30px;
height: 30px; height: 30px;
background-image: url(../img/fill_hor.png); background-image: url(../img/fill_hor.png);
@ -153,7 +160,9 @@ html, body{
top: -15px; top: -15px;
right: 17px; right: 17px;
cursor: pointer; cursor: pointer;
} }*/
.add_block{ .add_block{
margin: 20px 0 0 20px; margin: 20px 0 0 20px;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

@ -15,10 +15,26 @@
lang = sankore.locale().substr(0,2); lang = sankore.locale().substr(0,2);
} else } else
lang = "en"; lang = "en";
$("<script type='text/javascript' src='js/translation/" + lang + ".js'>").appendTo("head"); if(lang == "en")
if((typeof sankoreLang) == "undefined") start();
$("<script type='text/javascript' src='js/translation/en.js'>").appendTo("head"); else{
start(); 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 //here you can put your code
if(window.sankore) if(window.sankore)
sankore.enableDropOnWidget(); sankore.enableDropOnWidget();
@ -38,13 +54,13 @@
<div style="width: 50%; height: 100%; float: left;"> <div style="width: 50%; height: 100%; float: left;">
<div id="display" style="float: right; width: 90px; cursor: pointer;" class="selected"> <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_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> </div>
<div style="width: 50%; height: 100%; float: right;"> <div style="width: 50%; height: 100%; float: right;">
<div id="edit" style="float: left; width: 90px; cursor: pointer;"> <div id="edit" style="float: left; width: 90px; cursor: pointer;">
<div id="edit_img" style="float: left;" class="red_point"></div> <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> </div>
</div> </div>

@ -1,3 +1,5 @@
var sankoreLang = {display: "Display", edit: "Edit", short_desc: "Place the pictures in ascending order.", add: "Add new block"};
//main function //main function
function start(){ function start(){
@ -40,9 +42,10 @@ function start(){
container.find(".add_img").remove(); container.find(".add_img").remove();
container.find(".close_cont").remove(); container.find(".close_cont").remove();
container.find(".img_block").each(function(){ 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(".close_img").remove();
$(this).find(".clear_img").remove(); $(this).find(".clear_img").remove();
$(this).find(".numb_img").remove();
$(this).removeAttr("ondragenter") $(this).removeAttr("ondragenter")
.removeAttr("ondragleave") .removeAttr("ondragleave")
.removeAttr("ondragover") .removeAttr("ondragover")
@ -78,7 +81,7 @@ function start(){
$("<div class='close_cont'>").appendTo(container); $("<div class='close_cont'>").appendTo(container);
container.find(".text_cont").attr("contenteditable","true"); 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"); container.find(".imgs_cont").css("background-color", "white");
var add_img = $("<div class='add_img'>"); var add_img = $("<div class='add_img'>");
@ -87,10 +90,12 @@ function start(){
.attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;") .attr("ondragleave", "$(this).css(\"background-color\",\"white\"); return false;")
.attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;") .attr("ondragover", "$(this).css(\"background-color\",\"#ccc\"); return false;")
.attr("ondrop", "$(this).css(\"background-color\",\"white\"); return onDropTarget(this,event);") .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='close_img'>").appendTo($(this));
$("<div class='clear_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) container.find(".imgs_cont").append(add_img)
}); });
@ -130,9 +135,7 @@ function start(){
var tmp_obj = $(this).parent().parent(); var tmp_obj = $(this).parent().parent();
$(this).parent().remove(); $(this).parent().remove();
if(tmp_obj.find(".img_block").size() > 0){ if(tmp_obj.find(".img_block").size() > 0){
tmp_obj.find(".img_block").each(function(){ refreshImgNumbers(tmp_obj);
$(this).find("input").val(++i);
});
} }
}); });
@ -154,7 +157,7 @@ function start(){
//cleaning an image //cleaning an image
$(".clear_img").live("click",function(){ $(".clear_img").live("click",function(){
//$(this).parent().find(".fill_img").remove(); //$(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 //check result
function checkResult(event) function checkResult(event)
{ {
var str = ""; if($("#display").hasClass("selected")){
var right_str = $(event.target).find("input").val(); var str = "";
$(event.target).find(".img_block").each(function(){ var right_str = $(event.target).find("input").val();
str += $(this).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(str == right_str)
$(event.target).css("background-color","#9f9");
} else {
refreshImgNumbers($(event.target));
}
} }
//add new container //add new container
@ -300,11 +307,13 @@ function addContainer(){
//add new img block //add new img block
function addImgBlock(dest){ 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(); var tmp_counter = dest.parent().find(".img_block").size();
$("<div class='close_img'>").appendTo(img_block); $("<div class='close_img'>").appendTo(img_block);
$("<div class='clear_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); $("<input type='hidden' value='" + tmp_counter + "'/>").appendTo(img_block);
$("<img src='img/drop_img.png' height='120'/>").appendTo(img_block);
} }
function refreshBlockNumbers(){ function refreshBlockNumbers(){
@ -329,6 +338,35 @@ function shuffle( arr )
return 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){ function stringToXML(text){
if (window.ActiveXObject){ if (window.ActiveXObject){

@ -1,8 +0,0 @@
var sankoreLang = {
short_desc: "Place the pictures in ascending order.",
display:"Display",
edit:"Edit",
add:"Add new block"
};

@ -1,8 +0,0 @@
var sankoreLang = {
short_desc: "Placez les photos dans l'ordre croissant.",
display:"D'affichage",
edit:"Modifier",
add:"Ajouter nouveau bloc"
};

@ -1,8 +0,0 @@
var sankoreLang = {
short_desc: "Расположите картинки в порядке возрастания цифр.",
display:"Показать",
edit:"Изменить",
add:"Добавить новый блок"
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -0,0 +1,45 @@
<!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>

@ -0,0 +1,392 @@
var sankoreLang = {display: "D'affichage", edit: "Modifier", short_desc: "Placez les photos dans l'ordre croissant.", add: "Nouveau bloc"};
//main function
function start(){
$("#display_text").text(sankoreLang.display);
$("#edit_text").text(sankoreLang.edit);
if(window.sankore){
if(sankore.preference("odr_des_imgs","")){
var data = jQuery.parseJSON(sankore.preference("odr_des_imgs",""));
importData(data);
} else {
showExample();
}
}
else
showExample();
//events
$("body").live("mouseout",function(){
if(event.target.tagName == "BODY")
if(window.sankore)
exportData();
})
$("#display, #edit").click(function(event){
if(this.id == "display"){
if(!$(this).hasClass("selected")){
$(this).addClass("selected");
$("#display_img").removeClass("red_point").addClass("green_point");
$("#edit_img").removeClass("green_point").addClass("red_point");
$("#edit").removeClass("selected");
$(".add_block").remove();
$(".cont").each(function(){
var container = $(this);
var tmp_i = 0;
var tmp_right = "";
var tmp_array = [];
container.find(".text_cont").removeAttr("contenteditable");
container.find(".add_img").remove();
container.find(".close_cont").remove();
container.find(".img_block").each(function(){
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")
.removeAttr("ondrop");
$(this).find("input").val(++tmp_i)
tmp_right += tmp_i + "*";
} else
$(this).remove();
});
container.find(".imgs_cont>input").val(tmp_right);
container.find(".img_block").each(function(){
$(this).css("float","");
tmp_array.push($(this));
});
tmp_array = shuffle(tmp_array);
for(var i = 0; i<tmp_array.length;i++)
tmp_array[i].appendTo(container.find(".imgs_cont"));
container.find(".imgs_cont").sortable( {
update: checkResult
} );
});
}
} else {
if(!$(this).hasClass("selected")){
$(this).addClass("selected");
$("#edit_img").removeClass("red_point").addClass("green_point");
$("#display_img").removeClass("green_point").addClass("red_point");
$("#display").removeClass("selected");
$(".cont").each(function(){
var container = $(this);
$("<div class='close_cont'>").appendTo(container);
container.find(".text_cont").attr("contenteditable","true");
//container.find(".imgs_cont").sortable("destroy");
container.find(".imgs_cont").css("background-color", "white");
var add_img = $("<div class='add_img'>");
container.find(".img_block").each(function(){
$(this).attr("ondragenter", "return false;")
.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");
$("<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)
});
$("<div class='add_block'>" + sankoreLang.add + "</div>").appendTo("body");
}
}
});
//add new block
$(".add_block").live("click", function(){
addContainer();
});
//adding new img
$(".add_img").live("click", function(){
addImgBlock($(this));
});
//deleting a block
$(".close_cont").live("click",function(){
$(this).parent().remove();
refreshBlockNumbers();
});
//deleting the img block
$(".close_img").live("click", function(){
var i = 0;
var tmp_obj = $(this).parent().parent();
$(this).parent().remove();
if(tmp_obj.find(".img_block").size() > 0){
refreshImgNumbers(tmp_obj);
}
});
//cleaning an image
$(".clear_img").live("click",function(){
//$(this).parent().find(".fill_img").remove();
$(this).parent().find("img").attr("src","img/drop_img.png");
});
}
//export
function exportData(){
var array_to_export = [];
if($("#edit").hasClass("selected")){
$(".cont").each(function(){
var container = $(this);
var tmp_right = "";
var tmp_i = 0;
container.find(".img_block").each(function(){
if($(this).html().match(/<img/)){
$(this).find("input").val(++tmp_i)
tmp_right += tmp_i + "*";
}
});
container.find(".imgs_cont>input").val(tmp_right);
});
}
$(".cont").each(function(){
var cont_obj = new Object();
cont_obj.text = $(this).find(".text_cont").text();
cont_obj.right = $(this).find(".imgs_cont>input").val();
cont_obj.imgs = [];
$(this).find(".img_block").each(function(){
var img_obj = new Object();
img_obj.value = $(this).find("input").val();
img_obj.link = $(this).find("img").attr("src").replace("../../","");
img_obj.ht = $(this).find("img").height();
img_obj.wd = $(this).find("img").width();
cont_obj.imgs.push(img_obj);
});
array_to_export.push(cont_obj);
});
sankore.setPreference("odr_des_imgs", JSON.stringify(array_to_export));
}
//import
function importData(data){
var tmp = 0;
for(var i in data){
var tmp_array = [];
var container = $("<div class='cont'>");
var sub_container = $("<div class='sub_cont'>").appendTo(container);
var imgs_container = $("<div class='imgs_cont'>").appendTo(container);
var number = $("<div class='number_cont'>"+ (++tmp) +"</div>").appendTo(sub_container);
var text = $("<div class='text_cont'>" + data[i].text + "</div>").appendTo(sub_container);
$("<input type='hidden' value='" + data[i].right + "'/>").appendTo(imgs_container);
for(var j in data[i].imgs){
var img_block = $("<div class='img_block' style='text-align: center;'>");
var img = $("<img src='../../" + data[i].imgs[j].link + "' style='display: inline;'>");
img.height(data[i].imgs[j].ht).width(data[i].imgs[j].wd);
if((120 - data[i].imgs[j].ht) > 0)
img.css("margin",(120 - data[i].imgs[j].ht)/2 + "px 0");
var hidden_input = $("<input type='hidden'>").val(data[i].imgs[j].value);
img_block.append(hidden_input).append(img);
tmp_array.push(img_block);
}
tmp_array = shuffle(tmp_array);
for(j = 0; j<tmp_array.length;j++)
tmp_array[j].appendTo(imgs_container);
imgs_container.sortable( {
update: checkResult
} );
container.appendTo("body");
}
}
//example
function showExample(){
var tmp_array = [];
var container = $("<div class='cont'>");
var sub_container = $("<div class='sub_cont'>").appendTo(container);
var imgs_container = $("<div class='imgs_cont'>").appendTo(container);
var number = $("<div class='number_cont'>1</div>").appendTo(sub_container);
var text = $("<div class='text_cont'>" + sankoreLang.short_desc + "</div>").appendTo(sub_container);
$("<input type='hidden' value='1*2*3*4*5*'/>").appendTo(imgs_container);
var img1 = $("<div class='img_block' style='text-align: center;'></div>");
$("<input type='hidden' value='1'/>").appendTo(img1);
$("<img src=\"../../objects/0.gif\" style=\"display: inline;\" height=\"120\"/>").appendTo(img1);
var img2 = $("<div class='img_block' style='text-align: center;'></div>");
$("<input type='hidden' value='2'/>").appendTo(img2);
$("<img src=\"../../objects/1.gif\" style=\"display: inline;\" height=\"120\"/>").appendTo(img2);
var img3 = $("<div class='img_block' style='text-align: center;'></div>");
$("<input type='hidden' value='3'/>").appendTo(img3);
$("<img src=\"../../objects/2.gif\" style=\"display: inline;\" height=\"120\"/>").appendTo(img3);
var img4 = $("<div class='img_block' style='text-align: center;'></div>");
$("<input type='hidden' value='4'/>").appendTo(img4);
$("<img src=\"../../objects/3.gif\" style=\"display: inline;\" height=\"120\"/>").appendTo(img4);
var img5 = $("<div class='img_block' style='text-align: center;'></div>");
$("<input type='hidden' value='5'/>").appendTo(img5);
$("<img src=\"../../objects/4.gif\" style=\"display: inline;\" height=\"120\"/>").appendTo(img5);
tmp_array.push(img1, img2, img3, img4, img5);
tmp_array = shuffle(tmp_array);
for(var i = 0; i<tmp_array.length;i++)
tmp_array[i].appendTo(imgs_container);
imgs_container.sortable( {
update: checkResult
} );
container.appendTo("body")
}
//check result
function checkResult(event)
{
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
function addContainer(){
var container = $("<div class='cont'>");
var sub_container = $("<div class='sub_cont'>").appendTo(container);
var imgs_container = $("<div class='imgs_cont'>").appendTo(container);
var close = $("<div class='close_cont'>").appendTo(container);
var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container);
var text = $("<div class='text_cont' contenteditable>Enter your text here ... </div>").appendTo(sub_container);
$("<input type='hidden' value='1*2*3*4*5*'/>").appendTo(imgs_container);
var add_img = $("<div class='add_img'>").appendTo(imgs_container);
container.insertBefore($(".add_block"));
}
//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;'></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(){
var i = 0;
$(".cont").each(function(){
$(this).find(".number_cont").text(++i);
})
}
//shuffles an array
function shuffle( arr )
{
var pos, tmp;
for( var i = 0; i < arr.length; i++ )
{
pos = Math.round( Math.random() * ( arr.length - 1 ) );
tmp = arr[pos];
arr[pos] = arr[i];
arr[i] = tmp;
}
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 doc=new ActiveXObject('Microsoft.XMLDOM');
doc.async='false';
doc.loadXML(text);
} else {
var parser=new DOMParser();
doc=parser.parseFromString(text,'text/xml');
}
return doc;
}
function onDropTarget(obj, event) {
$(obj).find("img").remove();
if (event.dataTransfer) {
var format = "text/plain";
var textData = event.dataTransfer.getData(format);
if (!textData) {
alert(":(");
}
textData = stringToXML(textData);
var tmp = textData.getElementsByTagName("path")[0].firstChild.textContent;
tmp = tmp.substr(1, tmp.length);
var tmp_img = $("<img/>").attr("src", "../../" + tmp);
$(obj).append(tmp_img);
setTimeout(function(){
if(tmp_img.height() >= tmp_img.width())
tmp_img.attr("height", "120");
else{
tmp_img.attr("width","120");
tmp_img.css("margin",(120 - tmp_img.height())/2 + "px 0");
}
}, 6)
}
else {
alert ("Your browser does not support the dataTransfer object.");
}
if (event.stopPropagation) {
event.stopPropagation ();
}
else {
event.cancelBubble = true;
}
return false;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1,45 @@
<!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>

@ -0,0 +1,392 @@
var sankoreLang = {display: "Показать", edit: "Изменить", short_desc: "Расположите картинки в порядке возрастания цифр.", add: "Новый блок"};
//main function
function start(){
$("#display_text").text(sankoreLang.display);
$("#edit_text").text(sankoreLang.edit);
if(window.sankore){
if(sankore.preference("odr_des_imgs","")){
var data = jQuery.parseJSON(sankore.preference("odr_des_imgs",""));
importData(data);
} else {
showExample();
}
}
else
showExample();
//events
$("body").live("mouseout",function(){
if(event.target.tagName == "BODY")
if(window.sankore)
exportData();
})
$("#display, #edit").click(function(event){
if(this.id == "display"){
if(!$(this).hasClass("selected")){
$(this).addClass("selected");
$("#display_img").removeClass("red_point").addClass("green_point");
$("#edit_img").removeClass("green_point").addClass("red_point");
$("#edit").removeClass("selected");
$(".add_block").remove();
$(".cont").each(function(){
var container = $(this);
var tmp_i = 0;
var tmp_right = "";
var tmp_array = [];
container.find(".text_cont").removeAttr("contenteditable");
container.find(".add_img").remove();
container.find(".close_cont").remove();
container.find(".img_block").each(function(){
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")
.removeAttr("ondrop");
$(this).find("input").val(++tmp_i)
tmp_right += tmp_i + "*";
} else
$(this).remove();
});
container.find(".imgs_cont>input").val(tmp_right);
container.find(".img_block").each(function(){
$(this).css("float","");
tmp_array.push($(this));
});
tmp_array = shuffle(tmp_array);
for(var i = 0; i<tmp_array.length;i++)
tmp_array[i].appendTo(container.find(".imgs_cont"));
container.find(".imgs_cont").sortable( {
update: checkResult
} );
});
}
} else {
if(!$(this).hasClass("selected")){
$(this).addClass("selected");
$("#edit_img").removeClass("red_point").addClass("green_point");
$("#display_img").removeClass("green_point").addClass("red_point");
$("#display").removeClass("selected");
$(".cont").each(function(){
var container = $(this);
$("<div class='close_cont'>").appendTo(container);
container.find(".text_cont").attr("contenteditable","true");
//container.find(".imgs_cont").sortable("destroy");
container.find(".imgs_cont").css("background-color", "white");
var add_img = $("<div class='add_img'>");
container.find(".img_block").each(function(){
$(this).attr("ondragenter", "return false;")
.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");
$("<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)
});
$("<div class='add_block'>" + sankoreLang.add + "</div>").appendTo("body");
}
}
});
//add new block
$(".add_block").live("click", function(){
addContainer();
});
//adding new img
$(".add_img").live("click", function(){
addImgBlock($(this));
});
//deleting a block
$(".close_cont").live("click",function(){
$(this).parent().remove();
refreshBlockNumbers();
});
//deleting the img block
$(".close_img").live("click", function(){
var i = 0;
var tmp_obj = $(this).parent().parent();
$(this).parent().remove();
if(tmp_obj.find(".img_block").size() > 0){
refreshImgNumbers(tmp_obj);
}
});
//cleaning an image
$(".clear_img").live("click",function(){
//$(this).parent().find(".fill_img").remove();
$(this).parent().find("img").attr("src","img/drop_img.png");
});
}
//export
function exportData(){
var array_to_export = [];
if($("#edit").hasClass("selected")){
$(".cont").each(function(){
var container = $(this);
var tmp_right = "";
var tmp_i = 0;
container.find(".img_block").each(function(){
if($(this).html().match(/<img/)){
$(this).find("input").val(++tmp_i)
tmp_right += tmp_i + "*";
}
});
container.find(".imgs_cont>input").val(tmp_right);
});
}
$(".cont").each(function(){
var cont_obj = new Object();
cont_obj.text = $(this).find(".text_cont").text();
cont_obj.right = $(this).find(".imgs_cont>input").val();
cont_obj.imgs = [];
$(this).find(".img_block").each(function(){
var img_obj = new Object();
img_obj.value = $(this).find("input").val();
img_obj.link = $(this).find("img").attr("src").replace("../../","");
img_obj.ht = $(this).find("img").height();
img_obj.wd = $(this).find("img").width();
cont_obj.imgs.push(img_obj);
});
array_to_export.push(cont_obj);
});
sankore.setPreference("odr_des_imgs", JSON.stringify(array_to_export));
}
//import
function importData(data){
var tmp = 0;
for(var i in data){
var tmp_array = [];
var container = $("<div class='cont'>");
var sub_container = $("<div class='sub_cont'>").appendTo(container);
var imgs_container = $("<div class='imgs_cont'>").appendTo(container);
var number = $("<div class='number_cont'>"+ (++tmp) +"</div>").appendTo(sub_container);
var text = $("<div class='text_cont'>" + data[i].text + "</div>").appendTo(sub_container);
$("<input type='hidden' value='" + data[i].right + "'/>").appendTo(imgs_container);
for(var j in data[i].imgs){
var img_block = $("<div class='img_block' style='text-align: center;'>");
var img = $("<img src='../../" + data[i].imgs[j].link + "' style='display: inline;'>");
img.height(data[i].imgs[j].ht).width(data[i].imgs[j].wd);
if((120 - data[i].imgs[j].ht) > 0)
img.css("margin",(120 - data[i].imgs[j].ht)/2 + "px 0");
var hidden_input = $("<input type='hidden'>").val(data[i].imgs[j].value);
img_block.append(hidden_input).append(img);
tmp_array.push(img_block);
}
tmp_array = shuffle(tmp_array);
for(j = 0; j<tmp_array.length;j++)
tmp_array[j].appendTo(imgs_container);
imgs_container.sortable( {
update: checkResult
} );
container.appendTo("body");
}
}
//example
function showExample(){
var tmp_array = [];
var container = $("<div class='cont'>");
var sub_container = $("<div class='sub_cont'>").appendTo(container);
var imgs_container = $("<div class='imgs_cont'>").appendTo(container);
var number = $("<div class='number_cont'>1</div>").appendTo(sub_container);
var text = $("<div class='text_cont'>" + sankoreLang.short_desc + "</div>").appendTo(sub_container);
$("<input type='hidden' value='1*2*3*4*5*'/>").appendTo(imgs_container);
var img1 = $("<div class='img_block' style='text-align: center;'></div>");
$("<input type='hidden' value='1'/>").appendTo(img1);
$("<img src=\"../../objects/0.gif\" style=\"display: inline;\" height=\"120\"/>").appendTo(img1);
var img2 = $("<div class='img_block' style='text-align: center;'></div>");
$("<input type='hidden' value='2'/>").appendTo(img2);
$("<img src=\"../../objects/1.gif\" style=\"display: inline;\" height=\"120\"/>").appendTo(img2);
var img3 = $("<div class='img_block' style='text-align: center;'></div>");
$("<input type='hidden' value='3'/>").appendTo(img3);
$("<img src=\"../../objects/2.gif\" style=\"display: inline;\" height=\"120\"/>").appendTo(img3);
var img4 = $("<div class='img_block' style='text-align: center;'></div>");
$("<input type='hidden' value='4'/>").appendTo(img4);
$("<img src=\"../../objects/3.gif\" style=\"display: inline;\" height=\"120\"/>").appendTo(img4);
var img5 = $("<div class='img_block' style='text-align: center;'></div>");
$("<input type='hidden' value='5'/>").appendTo(img5);
$("<img src=\"../../objects/4.gif\" style=\"display: inline;\" height=\"120\"/>").appendTo(img5);
tmp_array.push(img1, img2, img3, img4, img5);
tmp_array = shuffle(tmp_array);
for(var i = 0; i<tmp_array.length;i++)
tmp_array[i].appendTo(imgs_container);
imgs_container.sortable( {
update: checkResult
} );
container.appendTo("body")
}
//check result
function checkResult(event)
{
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
function addContainer(){
var container = $("<div class='cont'>");
var sub_container = $("<div class='sub_cont'>").appendTo(container);
var imgs_container = $("<div class='imgs_cont'>").appendTo(container);
var close = $("<div class='close_cont'>").appendTo(container);
var number = $("<div class='number_cont'>"+ ($(".cont").size() + 1) +"</div>").appendTo(sub_container);
var text = $("<div class='text_cont' contenteditable>Enter your text here ... </div>").appendTo(sub_container);
$("<input type='hidden' value='1*2*3*4*5*'/>").appendTo(imgs_container);
var add_img = $("<div class='add_img'>").appendTo(imgs_container);
container.insertBefore($(".add_block"));
}
//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;'></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(){
var i = 0;
$(".cont").each(function(){
$(this).find(".number_cont").text(++i);
})
}
//shuffles an array
function shuffle( arr )
{
var pos, tmp;
for( var i = 0; i < arr.length; i++ )
{
pos = Math.round( Math.random() * ( arr.length - 1 ) );
tmp = arr[pos];
arr[pos] = arr[i];
arr[i] = tmp;
}
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 doc=new ActiveXObject('Microsoft.XMLDOM');
doc.async='false';
doc.loadXML(text);
} else {
var parser=new DOMParser();
doc=parser.parseFromString(text,'text/xml');
}
return doc;
}
function onDropTarget(obj, event) {
$(obj).find("img").remove();
if (event.dataTransfer) {
var format = "text/plain";
var textData = event.dataTransfer.getData(format);
if (!textData) {
alert(":(");
}
textData = stringToXML(textData);
var tmp = textData.getElementsByTagName("path")[0].firstChild.textContent;
tmp = tmp.substr(1, tmp.length);
var tmp_img = $("<img/>").attr("src", "../../" + tmp);
$(obj).append(tmp_img);
setTimeout(function(){
if(tmp_img.height() >= tmp_img.width())
tmp_img.attr("height", "120");
else{
tmp_img.attr("width","120");
tmp_img.css("margin",(120 - tmp_img.height())/2 + "px 0");
}
}, 6)
}
else {
alert ("Your browser does not support the dataTransfer object.");
}
if (event.stopPropagation) {
event.stopPropagation ();
}
else {
event.cancelBubble = true;
}
return false;
}

@ -179,9 +179,6 @@ void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QS
QString pdfName = UBPersistenceManager::objectDirectory + "/" + pdfItem->fileUuid().toString() + ".pdf"; QString pdfName = UBPersistenceManager::objectDirectory + "/" + pdfItem->fileUuid().toString() + ".pdf";
QString backgroundPath = pDocumentProxy->persistencePath() + "/" + pdfName; QString backgroundPath = pDocumentProxy->persistencePath() + "/" + pdfName;
QPointF boudingRectBottomLeft = scene->itemsBoundingRect().bottomLeft();
QPointF pdfItemBottomLeft = pdfItem->sceneBoundingRect().bottomLeft();
qDebug() << "scene->itemsBoundingRect()" << scene->itemsBoundingRect(); qDebug() << "scene->itemsBoundingRect()" << scene->itemsBoundingRect();
qDebug() << "pdfItem->boundingRect()" << pdfItem->boundingRect(); qDebug() << "pdfItem->boundingRect()" << pdfItem->boundingRect();
qDebug() << "pdfItem->sceneBoundingRect()" << pdfItem->sceneBoundingRect(); qDebug() << "pdfItem->sceneBoundingRect()" << pdfItem->sceneBoundingRect();

@ -40,7 +40,6 @@ void UBActionableWidget::removeAllActions()
void UBActionableWidget::setActionsVisible(bool bVisible) void UBActionableWidget::setActionsVisible(bool bVisible)
{ {
//mShowActions = bVisible;
if(!mActions.empty() && mActions.contains(eAction_Close)){ if(!mActions.empty() && mActions.contains(eAction_Close)){
mCloseButtons.setVisible(bVisible); mCloseButtons.setVisible(bVisible);
} }
@ -51,35 +50,6 @@ void UBActionableWidget::onCloseClicked()
emit close(this); 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) void UBActionableWidget::setActionsParent(QWidget *parent)
{ {
if(mActions.contains(eAction_Close)){ if(mActions.contains(eAction_Close)){

@ -38,5 +38,5 @@ void UBDraggableMedia::mouseMoveEvent(QMouseEvent* ev)
drag->setMimeData(mimeData); 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" #include "UBWidgetList.h"
UBWidgetList::UBWidgetList(QWidget* parent, eWidgetListOrientation orientation, const char* name):QScrollArea(parent) UBWidgetList::UBWidgetList(QWidget* parent, eWidgetListOrientation orientation, const char* name):QScrollArea(parent)
, mCanRemove(true)
, mpLayout(NULL) , mpLayout(NULL)
, mpContainer(NULL) , mpContainer(NULL)
, mMargin(10) , mMargin(10)
, mListElementsSpacing(10) , mListElementsSpacing(10)
, mpEmptyLabel(NULL) , mpEmptyLabel(NULL)
, mCanRemove(true)
, mpCurrentWidget(NULL) , mpCurrentWidget(NULL)
{ {
setObjectName(name); setObjectName(name);
@ -139,6 +139,7 @@ void UBWidgetList::resizeEvent(QResizeEvent *ev)
void UBWidgetList::mousePressEvent(QMouseEvent *ev) void UBWidgetList::mousePressEvent(QMouseEvent *ev)
{ {
Q_UNUSED(ev);
if(mCanRemove){ if(mCanRemove){
QWidget* pWAt = widgetAt(ev->pos()); QWidget* pWAt = widgetAt(ev->pos());
if(NULL != mpCurrentWidget){ if(NULL != mpCurrentWidget){

@ -1755,6 +1755,9 @@ void UBGraphicsScene::addCache()
mTools << cache; mTools << cache;
addItem(cache); addItem(cache);
cache->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Tool));
cache->setVisible(true); cache->setVisible(true);
cache->setSelected(true); cache->setSelected(true);
UBApplication::boardController->notifyCache(true); UBApplication::boardController->notifyCache(true);

@ -47,7 +47,7 @@ QByteArray UBBase32::decode(const QString& base32String)
if (lookup < 0 || lookup >= 80) if (lookup < 0 || lookup >= 80)
continue; continue;
int digit = sBase32Lookup[lookup]; int digit = sBase32Lookup[(int)lookup];
/* If this digit is not in the table, ignore it */ /* If this digit is not in the table, ignore it */
if (digit == 0xFF) if (digit == 0xFF)

@ -16,10 +16,12 @@
#include "UBFileSystemUtils.h" #include "UBFileSystemUtils.h"
#include <QtGui> #include <QtGui>
#include "globals/UBGlobals.h"
THIRD_PARTY_WARNINGS_DISABLE
#include "quazipfile.h" #include "quazipfile.h"
#include <openssl/md5.h> #include <openssl/md5.h>
THIRD_PARTY_WARNINGS_ENABLE
#include "core/memcheck.h" #include "core/memcheck.h"

@ -191,8 +191,8 @@ private:
void resizeTabs(); void resizeTabs();
private: private:
UBTabDockPalete *mTabPalette;
eUBDockPaletteType mPaletteType; eUBDockPaletteType mPaletteType;
UBTabDockPalete *mTabPalette;
}; };
#endif // UBDOCKPALETTE_H #endif // UBDOCKPALETTE_H

@ -2,6 +2,7 @@
#include "UBTBDocumentPreviewWidget.h" #include "UBTBDocumentPreviewWidget.h"
UBTBDocumentPreviewWidget::UBTBDocumentPreviewWidget(UBTeacherBarDataMgr *pDataMgr, QWidget *parent, const char *name):QWidget(parent) UBTBDocumentPreviewWidget::UBTBDocumentPreviewWidget(UBTeacherBarDataMgr *pDataMgr, QWidget *parent, const char *name):QWidget(parent)
, mpContainer(NULL)
, mpPageViewButton(NULL) , mpPageViewButton(NULL)
, mpEditButton(NULL) , mpEditButton(NULL)
, mpSessionLabel(NULL) , mpSessionLabel(NULL)
@ -19,7 +20,6 @@ UBTBDocumentPreviewWidget::UBTBDocumentPreviewWidget(UBTeacherBarDataMgr *pDataM
, mpTopicLabel(NULL) , mpTopicLabel(NULL)
, mpTopic(NULL) , mpTopic(NULL)
, mpLicense(NULL) , mpLicense(NULL)
, mpContainer(NULL)
{ {
setObjectName(name); setObjectName(name);
mpDataMgr = pDataMgr; mpDataMgr = pDataMgr;

@ -74,6 +74,7 @@ void UBTeacherBarDataMgr::saveContent()
void UBTeacherBarDataMgr::loadContent(bool docChanged) void UBTeacherBarDataMgr::loadContent(bool docChanged)
{ {
Q_UNUSED(docChanged);
clearLists(); clearLists();
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument();
@ -132,6 +133,7 @@ void UBTeacherBarDataMgr::loadContent(bool docChanged)
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
UBTBSeparator::UBTBSeparator(QWidget *parent, const char *name):QFrame(parent) UBTBSeparator::UBTBSeparator(QWidget *parent, const char *name):QFrame(parent)
{ {
Q_UNUSED(name);
setObjectName("UBTBSeparator"); setObjectName("UBTBSeparator");
setMinimumHeight(5); setMinimumHeight(5);
setMaximumHeight(5); setMaximumHeight(5);

@ -37,6 +37,7 @@ void UBTeacherBarPreviewMedia::cleanMedia()
void UBTeacherBarPreviewMedia::loadWidgets(QList<QWidget*> pWidgetsList, bool isResizable) void UBTeacherBarPreviewMedia::loadWidgets(QList<QWidget*> pWidgetsList, bool isResizable)
{ {
Q_UNUSED(isResizable);
foreach(QWidget*eachWidget, pWidgetsList){ foreach(QWidget*eachWidget, pWidgetsList){
mWidget->addWidget(eachWidget); mWidget->addWidget(eachWidget);
mWidgetList[eachWidget]="DRAG UNAVAILABLE"; mWidgetList[eachWidget]="DRAG UNAVAILABLE";
@ -362,6 +363,7 @@ void UBTeacherBarPreviewWidget::generateComments()
void UBTeacherBarPreviewWidget::showEvent(QShowEvent* ev) void UBTeacherBarPreviewWidget::showEvent(QShowEvent* ev)
{ {
Q_UNUSED(ev);
updateFields(); updateFields();
} }

@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <iostream> #include <iostream>
#include <QtGlobal>
#include "ASCII85Decode.h" #include "ASCII85Decode.h"
#include "core/memcheck.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) bool ASCII85Decode::decode(std::string &encoded)
{ {
unsigned long tuple = 0; unsigned long tuple = 0;
@ -58,7 +64,6 @@ bool ASCII85Decode::decode(std::string &encoded)
int count = 0; int count = 0;
int size = encoded.size(); int size = encoded.size();
int i = 0; int i = 0;
bool found = false;
for(;size;) for(;size;)
{ {
char ch = encoded[i++]; char ch = encoded[i++];
@ -121,3 +126,7 @@ bool ASCII85Decode::decode(std::string &encoded)
} }
return true; return true;
} }
void ASCII85Decode::initialize(Object * objectWithStram)
{
Q_UNUSED(objectWithStram);
};

@ -26,9 +26,9 @@ namespace merge_lib
public: public:
ASCII85Decode(){}; ASCII85Decode(){};
virtual ~ASCII85Decode(){}; virtual ~ASCII85Decode(){};
bool encode(std::string & decoded) {return false;} bool encode(std::string & decoded);
bool decode(std::string & encoded); bool decode(std::string & encoded);
void initialize(Object * objectWithStram){}; void initialize(Object * objectWithStram);
private: private:
void _wput(std::string &cur,unsigned long tuple, int len); 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "ASCIIHexDecode.h" #include "ASCIIHexDecode.h"
#include <QtGlobal>
#include <string> #include <string>
#include "Utils.h" #include "Utils.h"
@ -42,6 +42,12 @@ static unsigned int convertHexVal(unsigned char c)
return 0; return 0;
} }
bool ASCIIHexDecode::encode(std::string & decoded)
{
Q_UNUSED(decoded);
return false;
}
bool ASCIIHexDecode::decode(std::string & encoded) bool ASCIIHexDecode::decode(std::string & encoded)
{ {
bool isLow = true; bool isLow = true;
@ -75,3 +81,8 @@ bool ASCIIHexDecode::decode(std::string & encoded)
encoded = decoded; encoded = decoded;
return true; return true;
} }
void ASCIIHexDecode::initialize(Object * objectWithStram)
{
Q_UNUSED(objectWithStram);
}

@ -26,9 +26,9 @@ namespace merge_lib
public: public:
ASCIIHexDecode(){}; ASCIIHexDecode(){};
virtual ~ASCIIHexDecode(){}; virtual ~ASCIIHexDecode(){};
bool encode(std::string & decoded){return false;} bool encode(std::string & decoded);
bool decode(std::string & encoded); bool decode(std::string & encoded);
void initialize(Object * objectWithStram){}; void initialize(Object * objectWithStram);
}; };
} }

@ -0,0 +1,36 @@
/*
* 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 #define CCITTFaxDecode_H
#include <string> #include <string>
#include "Decoder.h"
namespace merge_lib namespace merge_lib
{ {
// this class provides method for FlateDecode encoding and decoding // this class provides method for FlateDecode encoding and decoding
@ -24,9 +26,9 @@ namespace merge_lib
public: public:
CCITTFaxDecode(){}; CCITTFaxDecode(){};
virtual ~CCITTFaxDecode(){}; virtual ~CCITTFaxDecode(){};
bool encode(std::string & decoded) {return true;}; bool encode(std::string & decoded);
bool decode(std::string & encoded) {return true;}; bool decode(std::string & encoded);
void initialize(Object * objectWithStram){}; void initialize(Object * objectWithStram);
}; };
} }

@ -12,6 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "ContentHandler.h" #include "ContentHandler.h"
#include "Filter.h" #include "Filter.h"
#include "FlateDecode.h" #include "FlateDecode.h"

@ -0,0 +1,36 @@
/*
* 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 #define DCTDecode_H
#include <string> #include <string>
#include "Decoder.h"
namespace merge_lib namespace merge_lib
{ {
// this class provides method for FlateDecode encoding and decoding // this class provides method for FlateDecode encoding and decoding
@ -25,9 +25,9 @@ namespace merge_lib
public: public:
DCTDecode(){}; DCTDecode(){};
virtual ~DCTDecode(){}; virtual ~DCTDecode(){};
bool encode(std::string & decoded) {return true;}; bool encode(std::string & decoded);
bool decode(std::string & encoded) {return true;}; bool decode(std::string & encoded);
void initialize(Object * objectWithStram){}; void initialize(Object * objectWithStram);
}; };
} }

@ -28,7 +28,8 @@
using namespace merge_lib; 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 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"); 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 "Config.h"
#include <iostream> #include <iostream>
#include <map> #include <map>
#include <QtGlobal>
#include "FilterPredictor.h" #include "FilterPredictor.h"
#include "Utils.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 ) std::string FilterPredictor::getDictionaryContentStr(std::string & in, size_t &pos )
{ {
size_t beg = in.find(DICT_START_TOKEN,pos); size_t beg = in.find(DICT_START_TOKEN,pos);

@ -27,7 +27,7 @@ namespace merge_lib
public: public:
FilterPredictor(); FilterPredictor();
virtual ~FilterPredictor(); virtual ~FilterPredictor();
bool encode(std::string & decoded){return false;} bool encode(std::string & decoded);
bool decode(std::string & encoded); bool decode(std::string & encoded);
void initialize(Object * objectWithStream); void initialize(Object * objectWithStream);

@ -0,0 +1,36 @@
/*
* 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 #define JBIG2Decode_H
#include <string> #include <string>
#include "Decoder.h"
namespace merge_lib namespace merge_lib
{ {
@ -25,9 +26,9 @@ namespace merge_lib
public: public:
JBIG2Decode(){}; JBIG2Decode(){};
virtual ~JBIG2Decode(){}; virtual ~JBIG2Decode(){};
bool encode(std::string & decoded) {return true;}; bool encode(std::string & decoded);
bool decode(std::string & encoded) {return true;}; bool decode(std::string & encoded);
void initialize(Object * objectWithStram){}; void initialize(Object * objectWithStram);
}; };
} }

@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <iostream> #include <iostream>
#include <QtGlobal>
#include "LZWDecode.h" #include "LZWDecode.h"
#include "FilterPredictor.h" #include "FilterPredictor.h"
@ -31,8 +32,9 @@ LZWDecode::LZWDecode():
_readBits(0), _readBits(0),
_nextCode(0), _nextCode(0),
_bitsToRead(0), _bitsToRead(0),
_curSequenceLength(0), _first(true),
_first(true) _curSequenceLength(0)
{ {
clearTable(); clearTable();
} }
@ -44,6 +46,12 @@ LZWDecode::~LZWDecode()
} }
} }
bool LZWDecode::encode(std::string & decoded)
{
Q_UNUSED(decoded);
return true;
}
void LZWDecode::initialize(Object * objectWithStream) void LZWDecode::initialize(Object * objectWithStream)
{ {
if( objectWithStream ) if( objectWithStream )

@ -27,7 +27,7 @@ namespace merge_lib
public: public:
LZWDecode(); LZWDecode();
virtual ~LZWDecode(); virtual ~LZWDecode();
bool encode(std::string & decoded) {return true;}; bool encode(std::string & decoded);
bool decode(std::string & encoded); bool decode(std::string & encoded);
void initialize(Object * objectWithStram); void initialize(Object * objectWithStram);
private: private:
@ -37,8 +37,8 @@ namespace merge_lib
void clearTable(); void clearTable();
int getCode(); int getCode();
std::string &_encoded;
std::string _dummy; std::string _dummy;
std::string &_encoded;
size_t _curSymbolIndex; size_t _curSymbolIndex;
int _earlyChange; // early parameter int _earlyChange; // early parameter

@ -15,6 +15,7 @@
#include "OverlayDocumentParser.h" #include "OverlayDocumentParser.h"
#include <fstream> #include <fstream>
#include <string.h> #include <string.h>
#include <QtGlobal>
#include "Exception.h" #include "Exception.h"
#include "Object.h" #include "Object.h"
@ -74,7 +75,6 @@ void OverlayDocumentParser::_readXRefAndCreateObjects()
notEndOfFile = false; notEndOfFile = false;
} }
unsigned long toReadAgain = 0;
for(objIter = objectsAndPositions.begin(); objIter != objectsAndPositions.end(); ) for(objIter = objectsAndPositions.begin(); objIter != objectsAndPositions.end(); )
{ {
if((objectsAndSizes[objIter->first] + objIter->second <= nextPartStart) && (objIter->second >= partStart) && ((objIter->second < nextPartStart))) if((objectsAndSizes[objIter->first] + objIter->second <= nextPartStart) && (objIter->second >= partStart) && ((objIter->second < nextPartStart)))
@ -100,6 +100,11 @@ void OverlayDocumentParser::_readXRefAndCreateObjects()
while(notEndOfFile); while(notEndOfFile);
} }
void OverlayDocumentParser::_getFileContent(const char * fileName)
{
Q_UNUSED(fileName);
}
void OverlayDocumentParser::_getPartOfFileContent(long startOfPart, unsigned int length) void OverlayDocumentParser::_getPartOfFileContent(long startOfPart, unsigned int length)
{ {
ifstream pdfFile; ifstream pdfFile;

@ -38,7 +38,7 @@ namespace merge_lib
private: private:
//methods //methods
void _getFileContent(const char * fileName){}; void _getFileContent(const char * fileName);
void _readXRefAndCreateObjects(); void _readXRefAndCreateObjects();
void _readXref(std::map<unsigned int, unsigned long> & objectsAndSizes); void _readXref(std::map<unsigned int, unsigned long> & objectsAndSizes);
void _getPartOfFileContent(long startOfPart, unsigned int length); void _getPartOfFileContent(long startOfPart, unsigned int length);

@ -37,7 +37,7 @@
using namespace merge_lib; 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 * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "PageElementHandler.h"
#include "PageElementHandler.h"
#include <QtGlobal>
#include "core/memcheck.h" #include "core/memcheck.h"
using namespace merge_lib; using namespace merge_lib;
@ -88,3 +89,8 @@ unsigned int PageElementHandler::_findEndOfElementContent(unsigned int startOfPa
} }
return _pageContent.rfind(">>"); return _pageContent.rfind(">>");
} }
void PageElementHandler::_processObjectContent(unsigned int startOfPageElement)
{
Q_UNUSED(startOfPageElement);
}

@ -73,14 +73,14 @@ namespace merge_lib
void _createAllPageFieldsSet(); void _createAllPageFieldsSet();
//members //members
std::string & _pageContent;
Object * _page; Object * _page;
std::string & _pageContent;
std::string _handlerName; std::string _handlerName;
PageElementHandler * _nextHandler; PageElementHandler * _nextHandler;
private: private:
//methods //methods
virtual void _processObjectContent(unsigned int startOfPageElement){}; virtual void _processObjectContent(unsigned int startOfPageElement);
virtual void _changeObjectContent(unsigned int startOfPageElement) = 0; virtual void _changeObjectContent(unsigned int startOfPageElement) = 0;
virtual void _pageElementNotFound() {}; virtual void _pageElementNotFound() {};
unsigned int _findStartOfPageElement() unsigned int _findStartOfPageElement()

@ -24,21 +24,21 @@
using namespace merge_lib; using namespace merge_lib;
Rectangle::Rectangle(const char * rectangleName): Rectangle::Rectangle(const char * rectangleName):
_rectangleName(rectangleName),
x1(0), x1(0),
y1(0), y1(0),
x2(0), x2(0),
y2(0), y2(0),
_rectangleName(rectangleName),
_tm() _tm()
{} {}
Rectangle::Rectangle(const char * rectangleName, const std::string content): Rectangle::Rectangle(const char * rectangleName, const std::string content):
_rectangleName(rectangleName),
x1(0), x1(0),
y1(0), y1(0),
x2(0), x2(0),
y2(0) y2(0),
_rectangleName(rectangleName)
{ {
unsigned int rectanglePosition = Parser::findToken(content,rectangleName); unsigned int rectanglePosition = Parser::findToken(content,rectangleName);

@ -40,7 +40,7 @@ namespace merge_lib
double getHeight(); double getHeight();
//members //members
double x1, x2, y1, y2; double x1, y1, x2, y2;
private: private:
//methods //methods
const std::string _getRectangleAsString(const char * delimeter); const std::string _getRectangleAsString(const char * delimeter);

@ -15,6 +15,8 @@
#if !defined RotationHandler_h #if !defined RotationHandler_h
#define RotationHandler_h #define RotationHandler_h
#include <QtGlobal>
#include "PageElementHandler.h" #include "PageElementHandler.h"
#include "Page.h" #include "Page.h"
@ -55,7 +57,7 @@ namespace merge_lib
strin>>rotation; strin>>rotation;
_basePage.setRotation(rotation); _basePage.setRotation(rotation);
} }
virtual void _changeObjectContent(unsigned int startOfPageElement) {}; virtual void _changeObjectContent(unsigned int startOfPageElement) {Q_UNUSED(startOfPageElement);};
//members //members
Page & _basePage; Page & _basePage;

@ -12,12 +12,19 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "RunLengthDecode.h"
#include "RunLengthDecode.h"
#include <QtGlobal>
#include "core/memcheck.h" #include "core/memcheck.h"
using namespace merge_lib; using namespace merge_lib;
bool RunLengthDecode::encode(std::string & decoded)
{
Q_UNUSED(decoded);
return false;
}
/* The encoded data is a sequence of /* 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 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 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; return true;
} }
void RunLengthDecode::initialize(Object * objectWithStream)
{
Q_UNUSED(objectWithStream);
};

@ -26,9 +26,9 @@ namespace merge_lib
public: public:
RunLengthDecode(){}; RunLengthDecode(){};
virtual ~RunLengthDecode(){}; virtual ~RunLengthDecode(){};
bool encode(std::string & decoded){return false;} bool encode(std::string & decoded);
bool decode(std::string & encoded); 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 * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <QtGlobal>
#include "Config.h" #include "Config.h"
#include "Utils.h" #include "Utils.h"
#include "Exception.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 ) double Utils::normalizeValue(double &val, const double epsilon )
{ {
Q_UNUSED(epsilon);
if( Utils::doubleEquals(val,0)) if( Utils::doubleEquals(val,0))
{ {
val = 0; val = 0;

@ -54,7 +54,10 @@ SOURCES += \
RemoveHimselfHandler.cpp \ RemoveHimselfHandler.cpp \
RunLengthDecode.cpp \ RunLengthDecode.cpp \
Utils.cpp \ Utils.cpp \
OverlayDocumentParser.cpp OverlayDocumentParser.cpp \
src/pdf-merger/CCITTFaxDecode.cpp \
src/pdf-merger/JBIG2Decode.cpp \
src/pdf-merger/DCTDecode.cpp
macx { macx {
@ -83,3 +86,6 @@ linux-g++-64 {
LIBS += -lz LIBS += -lz
} }

@ -112,6 +112,7 @@ void UBYouTubePublisher::postClientLoginRequest(const QString& userName, const Q
void UBYouTubePublisher::postClientLoginResponse(bool success, const QByteArray& pPayload) void UBYouTubePublisher::postClientLoginResponse(bool success, const QByteArray& pPayload)
{ {
Q_UNUSED(success);
mAuthToken = ""; mAuthToken = "";
QString auth = QString::fromUtf8(pPayload); QString auth = QString::fromUtf8(pPayload);
@ -136,7 +137,7 @@ void UBYouTubePublisher::postClientLoginResponse(bool success, const QByteArray&
if(mAuthToken.length() == 0) if(mAuthToken.length() == 0)
{ {
UBApplication::showMessage(tr("YouTube authentication failed.")); UBApplication::showMessage(tr("YouTube authentication failed."));
success = false; // success = false;
deleteLater(); deleteLater();
} }
else else

@ -26,6 +26,7 @@
UBOEmbedParser::UBOEmbedParser(QObject *parent, const char* name) UBOEmbedParser::UBOEmbedParser(QObject *parent, const char* name)
{ {
Q_UNUSED(parent);
setObjectName(name); setObjectName(name);
mParsedTitles.clear(); mParsedTitles.clear();
connect(this, SIGNAL(parseContent(QString)), this, SLOT(onParseContent(QString))); connect(this, SIGNAL(parseContent(QString)), this, SLOT(onParseContent(QString)));
@ -223,7 +224,6 @@ void UBOEmbedParser::onParseContent(QString url)
void UBOEmbedParser::onFinished(QNetworkReply *reply) void UBOEmbedParser::onFinished(QNetworkReply *reply)
{ {
QNetworkReply::NetworkError err = reply->error();
if(QNetworkReply::NoError == reply->error()){ if(QNetworkReply::NoError == reply->error()){
QString receivedDatas = reply->readAll().constData(); QString receivedDatas = reply->readAll().constData();
sOEmbedContent crntContent; sOEmbedContent crntContent;

@ -75,7 +75,6 @@ void WBClearButton::paintEvent(QPaintEvent *event)
int height = this->height(); int height = this->height();
painter.setRenderHint(QPainter::Antialiasing, true); painter.setRenderHint(QPainter::Antialiasing, true);
QColor color = palette().color(QPalette::Mid);
painter.setBrush(isDown() painter.setBrush(isDown()
? palette().color(QPalette::Dark) ? palette().color(QPalette::Dark)
: palette().color(QPalette::Mid)); : palette().color(QPalette::Mid));

Loading…
Cancel
Save