00001 /* 00002 * File Name: images_renderer_unittest.cpp 00003 */ 00004 00005 /* 00006 * This file is part of uds-plugin-images. 00007 * 00008 * uds-plugin-images is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation, either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * uds-plugin-images is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00020 */ 00021 00022 /** 00023 * Copyright (C) 2008 iRex Technologies B.V. 00024 * All rights reserved. 00025 */ 00026 00027 #include <iostream> 00028 #include <glib.h> 00029 #include <glib-object.h> 00030 #include "images_renderer.h" 00031 #include "images_document.h" 00032 00033 using namespace images; 00034 00035 int main() 00036 { 00037 g_type_init(); 00038 g_thread_init(0); 00039 00040 ImagesDocument doc; 00041 doc.open_document("/data/wa/uds/trunk/sample"); 00042 00043 ImagesRenderer renderer(&doc); 00044 00045 ImagePageAttrs attrs; 00046 attrs.desired_width = 800; 00047 attrs.desired_height = 600; 00048 attrs.zoom = 100; 00049 attrs.rotation = Clockwise_Degrees_0; 00050 00051 int i = doc.page_count() / 2; 00052 std::string anchor; 00053 if (doc.get_anchor_of_page(i, anchor)) 00054 { 00055 renderer.render(anchor, attrs, -1, 0); 00056 } 00057 // Sleep a while to wait the tasks get the chance to running. 00058 usleep(50*1000); 00059 00060 return 0; 00061 } 00062 00063