diff --git a/buildDebianPackage b/buildDebianPackage index 9eb6010e..7056a1d7 100755 --- a/buildDebianPackage +++ b/buildDebianPackage @@ -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 diff --git a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/css/basic.css b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/css/basic.css index 476eeb71..dc78a0d9 100644 --- a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/css/basic.css +++ b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/css/basic.css @@ -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; diff --git a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/1.jpg b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/1.jpg deleted file mode 100644 index d3807e82..00000000 Binary files a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/1.jpg and /dev/null differ diff --git a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/1.png b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/1.png deleted file mode 100644 index c50733dc..00000000 Binary files a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/1.png and /dev/null differ diff --git a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/2.png b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/2.png deleted file mode 100644 index 7ad83b87..00000000 Binary files a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/2.png and /dev/null differ diff --git a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/clear_img.png b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/clear_img.png index fbaefffb..b00fca9a 100644 Binary files a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/clear_img.png and b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/clear_img.png differ diff --git a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/drop_img.png b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/drop_img.png new file mode 100644 index 00000000..17024f03 Binary files /dev/null and b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/drop_img.png differ diff --git a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/numb_img.png b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/numb_img.png new file mode 100644 index 00000000..6a0284c4 Binary files /dev/null and b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/img/numb_img.png differ diff --git a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/index.html b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/index.html index 5525abd4..20aaf679 100644 --- a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/index.html +++ b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/index.html @@ -15,10 +15,26 @@ lang = sankore.locale().substr(0,2); } else lang = "en"; - $(" + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + diff --git a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/fr/js/script.js b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/fr/js/script.js new file mode 100644 index 00000000..83d61c86 --- /dev/null +++ b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/fr/js/script.js @@ -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").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 = $("
"); + 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"); + $("
").appendTo($(this)); + $("
").appendTo($(this)); + $("
" + $(this).find("input").val() + "
").appendTo($(this)); + }); + rightOrder(container.find(".imgs_cont")); + container.find(".imgs_cont").append(add_img) + }); + + $("
" + sankoreLang.add + "
").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(/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 = $("
"); + var sub_container = $("
").appendTo(container); + var imgs_container = $("
").appendTo(container); + + var number = $("
"+ (++tmp) +"
").appendTo(sub_container); + var text = $("
" + data[i].text + "
").appendTo(sub_container); + + $("").appendTo(imgs_container); + + for(var j in data[i].imgs){ + var img_block = $("
"); + var img = $(""); + 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 = $("").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"); + var sub_container = $("
").appendTo(container); + var imgs_container = $("
").appendTo(container); + + var number = $("
1
").appendTo(sub_container); + var text = $("
" + sankoreLang.short_desc + "
").appendTo(sub_container); + + $("").appendTo(imgs_container); + + var img1 = $("
"); + $("").appendTo(img1); + $("").appendTo(img1); + var img2 = $("
"); + $("").appendTo(img2); + $("").appendTo(img2); + var img3 = $("
"); + $("").appendTo(img3); + $("").appendTo(img3); + var img4 = $("
"); + $("").appendTo(img4); + $("").appendTo(img4); + var img5 = $("
"); + $("").appendTo(img5); + $("").appendTo(img5); + + tmp_array.push(img1, img2, img3, img4, img5); + tmp_array = shuffle(tmp_array); + for(var i = 0; i"); + var sub_container = $("
").appendTo(container); + var imgs_container = $("
").appendTo(container); + + var close = $("
").appendTo(container); + var number = $("
"+ ($(".cont").size() + 1) +"
").appendTo(sub_container); + var text = $("
Enter your text here ...
").appendTo(sub_container); + + $("").appendTo(imgs_container); + var add_img = $("
").appendTo(imgs_container); + container.insertBefore($(".add_block")); +} + +//add new img block +function addImgBlock(dest){ + var img_block = $("
").insertBefore(dest); + var tmp_counter = dest.parent().find(".img_block").size(); + $("
").appendTo(img_block); + $("
").appendTo(img_block); + $("
" + tmp_counter + "
").appendTo(img_block); + $("").appendTo(img_block); + $("").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 = $("").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; +} + diff --git a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/ru/img/drop_img.png b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/ru/img/drop_img.png new file mode 100644 index 00000000..2796c020 Binary files /dev/null and b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/ru/img/drop_img.png differ diff --git a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/ru/index.html b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/ru/index.html new file mode 100644 index 00000000..9388cd2f --- /dev/null +++ b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/ru/index.html @@ -0,0 +1,45 @@ + + + + D'n'd + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + diff --git a/resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/ru/js/script.js b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/ru/js/script.js new file mode 100644 index 00000000..ae10471c --- /dev/null +++ b/resources/library/sankoreInteractivities/ordonner_des_images.wgt/locales/ru/js/script.js @@ -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").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 = $("
"); + 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"); + $("
").appendTo($(this)); + $("
").appendTo($(this)); + $("
" + $(this).find("input").val() + "
").appendTo($(this)); + }); + rightOrder(container.find(".imgs_cont")); + container.find(".imgs_cont").append(add_img) + }); + + $("
" + sankoreLang.add + "
").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(/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 = $("
"); + var sub_container = $("
").appendTo(container); + var imgs_container = $("
").appendTo(container); + + var number = $("
"+ (++tmp) +"
").appendTo(sub_container); + var text = $("
" + data[i].text + "
").appendTo(sub_container); + + $("").appendTo(imgs_container); + + for(var j in data[i].imgs){ + var img_block = $("
"); + var img = $(""); + 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 = $("").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"); + var sub_container = $("
").appendTo(container); + var imgs_container = $("
").appendTo(container); + + var number = $("
1
").appendTo(sub_container); + var text = $("
" + sankoreLang.short_desc + "
").appendTo(sub_container); + + $("").appendTo(imgs_container); + + var img1 = $("
"); + $("").appendTo(img1); + $("").appendTo(img1); + var img2 = $("
"); + $("").appendTo(img2); + $("").appendTo(img2); + var img3 = $("
"); + $("").appendTo(img3); + $("").appendTo(img3); + var img4 = $("
"); + $("").appendTo(img4); + $("").appendTo(img4); + var img5 = $("
"); + $("").appendTo(img5); + $("").appendTo(img5); + + tmp_array.push(img1, img2, img3, img4, img5); + tmp_array = shuffle(tmp_array); + for(var i = 0; i"); + var sub_container = $("
").appendTo(container); + var imgs_container = $("
").appendTo(container); + + var close = $("
").appendTo(container); + var number = $("
"+ ($(".cont").size() + 1) +"
").appendTo(sub_container); + var text = $("
Enter your text here ...
").appendTo(sub_container); + + $("").appendTo(imgs_container); + var add_img = $("
").appendTo(imgs_container); + container.insertBefore($(".add_block")); +} + +//add new img block +function addImgBlock(dest){ + var img_block = $("
").insertBefore(dest); + var tmp_counter = dest.parent().find(".img_block").size(); + $("
").appendTo(img_block); + $("
").appendTo(img_block); + $("
" + tmp_counter + "
").appendTo(img_block); + $("").appendTo(img_block); + $("").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 = $("").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; +} + diff --git a/src/adaptors/UBExportFullPDF.cpp b/src/adaptors/UBExportFullPDF.cpp index 402ef9cb..858809c6 100644 --- a/src/adaptors/UBExportFullPDF.cpp +++ b/src/adaptors/UBExportFullPDF.cpp @@ -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(); diff --git a/src/customWidgets/UBActionableWidget.cpp b/src/customWidgets/UBActionableWidget.cpp index 8c7ae5c7..65e440a3 100644 --- a/src/customWidgets/UBActionableWidget.cpp +++ b/src/customWidgets/UBActionableWidget.cpp @@ -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)){ diff --git a/src/customWidgets/UBDraggableMedia.cpp b/src/customWidgets/UBDraggableMedia.cpp index b9ef83cb..4136f742 100644 --- a/src/customWidgets/UBDraggableMedia.cpp +++ b/src/customWidgets/UBDraggableMedia.cpp @@ -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); } diff --git a/src/customWidgets/UBWidgetList.cpp b/src/customWidgets/UBWidgetList.cpp index 82d51fa8..fd8ddb03 100644 --- a/src/customWidgets/UBWidgetList.cpp +++ b/src/customWidgets/UBWidgetList.cpp @@ -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){ diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 0f2d0c52..4a489a1f 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -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); diff --git a/src/frameworks/UBBase32.cpp b/src/frameworks/UBBase32.cpp index efd0b614..29fcb75c 100644 --- a/src/frameworks/UBBase32.cpp +++ b/src/frameworks/UBBase32.cpp @@ -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) diff --git a/src/frameworks/UBFileSystemUtils.cpp b/src/frameworks/UBFileSystemUtils.cpp index 5be2c1f8..97a7d157 100644 --- a/src/frameworks/UBFileSystemUtils.cpp +++ b/src/frameworks/UBFileSystemUtils.cpp @@ -16,10 +16,12 @@ #include "UBFileSystemUtils.h" #include +#include "globals/UBGlobals.h" +THIRD_PARTY_WARNINGS_DISABLE #include "quazipfile.h" - #include +THIRD_PARTY_WARNINGS_ENABLE #include "core/memcheck.h" diff --git a/src/gui/UBDockPalette.h b/src/gui/UBDockPalette.h index ff3b546d..0d660e0a 100644 --- a/src/gui/UBDockPalette.h +++ b/src/gui/UBDockPalette.h @@ -191,8 +191,8 @@ private: void resizeTabs(); private: - UBTabDockPalete *mTabPalette; eUBDockPaletteType mPaletteType; + UBTabDockPalete *mTabPalette; }; #endif // UBDOCKPALETTE_H diff --git a/src/gui/UBTBDocumentPreviewWidget.cpp b/src/gui/UBTBDocumentPreviewWidget.cpp index 9f2ca0d8..ed54ee1b 100644 --- a/src/gui/UBTBDocumentPreviewWidget.cpp +++ b/src/gui/UBTBDocumentPreviewWidget.cpp @@ -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; diff --git a/src/gui/UBTeacherBarDataMgr.cpp b/src/gui/UBTeacherBarDataMgr.cpp index e2e2bdad..ae84996b 100644 --- a/src/gui/UBTeacherBarDataMgr.cpp +++ b/src/gui/UBTeacherBarDataMgr.cpp @@ -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); diff --git a/src/gui/UBTeacherBarPreviewWidget.cpp b/src/gui/UBTeacherBarPreviewWidget.cpp index e82acd30..46cf05e5 100644 --- a/src/gui/UBTeacherBarPreviewWidget.cpp +++ b/src/gui/UBTeacherBarPreviewWidget.cpp @@ -37,6 +37,7 @@ void UBTeacherBarPreviewMedia::cleanMedia() void UBTeacherBarPreviewMedia::loadWidgets(QList 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(); } diff --git a/src/pdf-merger/ASCII85Decode.cpp b/src/pdf-merger/ASCII85Decode.cpp index 1a3d3ac9..640bf5fa 100644 --- a/src/pdf-merger/ASCII85Decode.cpp +++ b/src/pdf-merger/ASCII85Decode.cpp @@ -13,7 +13,7 @@ * along with this program. If not, see . */ #include - +#include #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); +}; diff --git a/src/pdf-merger/ASCII85Decode.h b/src/pdf-merger/ASCII85Decode.h index fb1094f0..a6d7ae3e 100644 --- a/src/pdf-merger/ASCII85Decode.h +++ b/src/pdf-merger/ASCII85Decode.h @@ -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); diff --git a/src/pdf-merger/ASCIIHexDecode.cpp b/src/pdf-merger/ASCIIHexDecode.cpp index 17e184ac..93aa990e 100644 --- a/src/pdf-merger/ASCIIHexDecode.cpp +++ b/src/pdf-merger/ASCIIHexDecode.cpp @@ -13,7 +13,7 @@ * along with this program. If not, see . */ #include "ASCIIHexDecode.h" - +#include #include #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); +} diff --git a/src/pdf-merger/ASCIIHexDecode.h b/src/pdf-merger/ASCIIHexDecode.h index 4b0e4a0b..35c80a36 100644 --- a/src/pdf-merger/ASCIIHexDecode.h +++ b/src/pdf-merger/ASCIIHexDecode.h @@ -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); }; } diff --git a/src/pdf-merger/CCITTFaxDecode.cpp b/src/pdf-merger/CCITTFaxDecode.cpp new file mode 100644 index 00000000..1b9310c9 --- /dev/null +++ b/src/pdf-merger/CCITTFaxDecode.cpp @@ -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 . + */ + +#include +#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); +} diff --git a/src/pdf-merger/CCITTFaxDecode.h b/src/pdf-merger/CCITTFaxDecode.h index add43139..9bc65ac8 100644 --- a/src/pdf-merger/CCITTFaxDecode.h +++ b/src/pdf-merger/CCITTFaxDecode.h @@ -16,6 +16,8 @@ #define CCITTFaxDecode_H #include +#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); }; } diff --git a/src/pdf-merger/ContentHandler.cpp b/src/pdf-merger/ContentHandler.cpp index 0e298b39..8194524e 100644 --- a/src/pdf-merger/ContentHandler.cpp +++ b/src/pdf-merger/ContentHandler.cpp @@ -12,6 +12,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "ContentHandler.h" #include "Filter.h" #include "FlateDecode.h" diff --git a/src/pdf-merger/DCTDecode.cpp b/src/pdf-merger/DCTDecode.cpp new file mode 100644 index 00000000..603926c5 --- /dev/null +++ b/src/pdf-merger/DCTDecode.cpp @@ -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 . + */ + +#include +#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); +} diff --git a/src/pdf-merger/DCTDecode.h b/src/pdf-merger/DCTDecode.h index 011b9520..3e22cdc8 100644 --- a/src/pdf-merger/DCTDecode.h +++ b/src/pdf-merger/DCTDecode.h @@ -16,7 +16,7 @@ #define DCTDecode_H #include - +#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); }; } diff --git a/src/pdf-merger/Document.cpp b/src/pdf-merger/Document.cpp index ac3c0cb8..fad1ee2b 100644 --- a/src/pdf-merger/Document.cpp +++ b/src/pdf-merger/Document.cpp @@ -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) { } diff --git a/src/pdf-merger/FilterPredictor.cpp b/src/pdf-merger/FilterPredictor.cpp index 4be65d31..b828c515 100644 --- a/src/pdf-merger/FilterPredictor.cpp +++ b/src/pdf-merger/FilterPredictor.cpp @@ -15,6 +15,7 @@ #include "Config.h" #include #include +#include #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); diff --git a/src/pdf-merger/FilterPredictor.h b/src/pdf-merger/FilterPredictor.h index 45897d9b..f201fc52 100644 --- a/src/pdf-merger/FilterPredictor.h +++ b/src/pdf-merger/FilterPredictor.h @@ -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); diff --git a/src/pdf-merger/JBIG2Decode.cpp b/src/pdf-merger/JBIG2Decode.cpp new file mode 100644 index 00000000..6ef248d0 --- /dev/null +++ b/src/pdf-merger/JBIG2Decode.cpp @@ -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 . + */ + +#include +#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); +} diff --git a/src/pdf-merger/JBIG2Decode.h b/src/pdf-merger/JBIG2Decode.h index f4ad9e17..4b7e7cbd 100644 --- a/src/pdf-merger/JBIG2Decode.h +++ b/src/pdf-merger/JBIG2Decode.h @@ -16,6 +16,7 @@ #define JBIG2Decode_H #include +#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); }; } diff --git a/src/pdf-merger/LZWDecode.cpp b/src/pdf-merger/LZWDecode.cpp index fcc710df..0669dd7b 100644 --- a/src/pdf-merger/LZWDecode.cpp +++ b/src/pdf-merger/LZWDecode.cpp @@ -13,6 +13,7 @@ * along with this program. If not, see . */ #include +#include #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 ) diff --git a/src/pdf-merger/LZWDecode.h b/src/pdf-merger/LZWDecode.h index 882276ab..6d3d3cf8 100644 --- a/src/pdf-merger/LZWDecode.h +++ b/src/pdf-merger/LZWDecode.h @@ -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 diff --git a/src/pdf-merger/OverlayDocumentParser.cpp b/src/pdf-merger/OverlayDocumentParser.cpp index 379b63cd..91bf4293 100644 --- a/src/pdf-merger/OverlayDocumentParser.cpp +++ b/src/pdf-merger/OverlayDocumentParser.cpp @@ -15,6 +15,7 @@ #include "OverlayDocumentParser.h" #include #include +#include #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; diff --git a/src/pdf-merger/OverlayDocumentParser.h b/src/pdf-merger/OverlayDocumentParser.h index fbba57da..d2fa7aec 100644 --- a/src/pdf-merger/OverlayDocumentParser.h +++ b/src/pdf-merger/OverlayDocumentParser.h @@ -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 & objectsAndSizes); void _getPartOfFileContent(long startOfPart, unsigned int length); diff --git a/src/pdf-merger/Page.cpp b/src/pdf-merger/Page.cpp index 6f3de10f..3cb7c18b 100644 --- a/src/pdf-merger/Page.cpp +++ b/src/pdf-merger/Page.cpp @@ -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) { } diff --git a/src/pdf-merger/PageElementHandler.cpp b/src/pdf-merger/PageElementHandler.cpp index c29ada4a..462ea8b7 100644 --- a/src/pdf-merger/PageElementHandler.cpp +++ b/src/pdf-merger/PageElementHandler.cpp @@ -12,8 +12,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "PageElementHandler.h" +#include "PageElementHandler.h" +#include #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); +} diff --git a/src/pdf-merger/PageElementHandler.h b/src/pdf-merger/PageElementHandler.h index 721476c0..c00cd93e 100644 --- a/src/pdf-merger/PageElementHandler.h +++ b/src/pdf-merger/PageElementHandler.h @@ -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() diff --git a/src/pdf-merger/Rectangle.cpp b/src/pdf-merger/Rectangle.cpp index be7c02b5..7fe82696 100644 --- a/src/pdf-merger/Rectangle.cpp +++ b/src/pdf-merger/Rectangle.cpp @@ -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); diff --git a/src/pdf-merger/Rectangle.h b/src/pdf-merger/Rectangle.h index d0484a1d..8941333a 100644 --- a/src/pdf-merger/Rectangle.h +++ b/src/pdf-merger/Rectangle.h @@ -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); diff --git a/src/pdf-merger/RotationHandler.h b/src/pdf-merger/RotationHandler.h index 285063c9..7b06ae0c 100644 --- a/src/pdf-merger/RotationHandler.h +++ b/src/pdf-merger/RotationHandler.h @@ -15,6 +15,8 @@ #if !defined RotationHandler_h #define RotationHandler_h +#include + #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; diff --git a/src/pdf-merger/RunLengthDecode.cpp b/src/pdf-merger/RunLengthDecode.cpp index 33014041..cf5e64c0 100644 --- a/src/pdf-merger/RunLengthDecode.cpp +++ b/src/pdf-merger/RunLengthDecode.cpp @@ -12,12 +12,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "RunLengthDecode.h" +#include "RunLengthDecode.h" +#include #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); +}; diff --git a/src/pdf-merger/RunLengthDecode.h b/src/pdf-merger/RunLengthDecode.h index fd429eda..a6af064f 100644 --- a/src/pdf-merger/RunLengthDecode.h +++ b/src/pdf-merger/RunLengthDecode.h @@ -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); }; } diff --git a/src/pdf-merger/Utils.cpp b/src/pdf-merger/Utils.cpp index 74b056a4..7f117af8 100644 --- a/src/pdf-merger/Utils.cpp +++ b/src/pdf-merger/Utils.cpp @@ -12,6 +12,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +#include #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; diff --git a/src/pdf-merger/pdfMerger.pri b/src/pdf-merger/pdfMerger.pri index edc8d1fd..d94a2c7b 100644 --- a/src/pdf-merger/pdfMerger.pri +++ b/src/pdf-merger/pdfMerger.pri @@ -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 } + + + diff --git a/src/podcast/youtube/UBYouTubePublisher.cpp b/src/podcast/youtube/UBYouTubePublisher.cpp index f160d4a4..ebd6fb61 100644 --- a/src/podcast/youtube/UBYouTubePublisher.cpp +++ b/src/podcast/youtube/UBYouTubePublisher.cpp @@ -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 diff --git a/src/web/UBOEmbedParser.cpp b/src/web/UBOEmbedParser.cpp index f4247bd0..1cb8e1f8 100644 --- a/src/web/UBOEmbedParser.cpp +++ b/src/web/UBOEmbedParser.cpp @@ -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; diff --git a/src/web/browser/WBSearchLineEdit.cpp b/src/web/browser/WBSearchLineEdit.cpp index cc91b23d..cffca189 100644 --- a/src/web/browser/WBSearchLineEdit.cpp +++ b/src/web/browser/WBSearchLineEdit.cpp @@ -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));