00001 /* 00002 * File Name: plugin_render_result.h 00003 */ 00004 00005 /* 00006 * This file is part of uds-plugin-common. 00007 * 00008 * uds-plugin-common 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-common 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 #ifndef PLUGIN_RENDER_RESULT_H_ 00028 #define PLUGIN_RENDER_RESULT_H_ 00029 00030 #ifdef __cplusplus 00031 extern "C" { 00032 #endif 00033 00034 #include "plugin_type.h" 00035 #include "plugin_unknown.h" 00036 00037 /** 00038 * @brief Rendering bitmap structure used to communicate between plugin and UDS. 00039 * Struct derived from XImage. 00040 * 00041 */ 00042 typedef struct 00043 { 00044 int width; /**< The width of image. */ 00045 int height; /**< The height of image. */ 00046 const unsigned char * data; /**< The image buffer data. */ 00047 int row_stride; /**< Number of bytes between the start of a row and the start of the next row. 00048 See also GdkPixBuf property rowstride. */ 00049 } PluginBitmapAttributes; 00050 00051 /** 00052 * @brief Render result interface, for querying bitmap inside render result 00053 get bounding rectangles for a specified range, and get the anchor 00054 for a specified point 00055 */ 00056 typedef struct 00057 { 00058 /** 00059 * @brief Query bitmap attributes from render result 00060 * @param thiz IPluginUnknown interface pointer of the render result object 00061 * @param attributes output attributes 00062 * @return TODO. Add return code here. 00063 */ 00064 PluginStatus (* get_bitmap_attributes)( IPluginUnknown *thiz, 00065 PluginBitmapAttributes *attributes ); 00066 00067 /** 00068 * @brief Query content location for a specified point 00069 * @param thiz IPluginUnknown interface pointer of the render result object 00070 * @param x x coordinate of the point 00071 * @param y y coordinate of the point 00072 * @param anchor output anchor 00073 * @return TODO. Add return code here. 00074 */ 00075 PluginStatus (* get_anchor_from_coordinates)( IPluginUnknown *thiz, 00076 const int x, 00077 const int y, 00078 UDSString *anchor ); 00079 00080 /** 00081 * @brief Get bounding rectangles for a specified range 00082 * @param thiz IPluginUnknown interface pointer of the render result object 00083 * @param range user specified range 00084 * @return IPluginUnknown interface of the collection object containing the array of bounding rectangles 00085 */ 00086 IPluginUnknown* (* get_bounding_rectangles_from_range)( IPluginUnknown *thiz, 00087 const PluginRange *range); 00088 00089 /** 00090 * @brief Retrieve range from render result. 00091 * @param thiz The IPluginUnknown interface pointer of the render result object. 00092 * @param range The range of the render result. 00093 * @return This function returns PLUGIN_OK if it can retrieve the range of the 00094 * render result. Otherwise it returns the PLUGIN_FAIL. 00095 */ 00096 PluginStatus (* get_rendered_range) ( IPluginUnknown *thiz, 00097 PluginRange *range ); 00098 00099 00100 } IPluginRenderResult; 00101 00102 #ifdef __cplusplus 00103 } 00104 #endif 00105 00106 #endif