Rename python renderer to plugin example and leave it be as a template

This commit is contained in:
Mario Hüttel 2019-11-15 21:33:55 +01:00
parent efb1af7ee0
commit 3b6837b886
6 changed files with 28 additions and 11 deletions

View File

@ -30,6 +30,7 @@ pkg_search_module(GLIB REQUIRED glib-2.0)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
pkg_check_modules(CAIRO REQUIRED cairo)
include_directories(${GLIB_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include)
add_subdirectory(plugins)
add_compile_options(-Wall -Wextra -Wold-style-declaration -Wuninitialized -Wmaybe-uninitialized -Wunused-parameter)
@ -48,7 +49,6 @@ add_subdirectory(doxygen)
add_subdirectory(translations)
add_subdirectory(version)
include_directories(${GLIB_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include)
link_directories(${GLIB_LINK_DIRS} ${GTK3_LINK_DIRS} ${CAIRO_LINK_DIRS})
add_definitions(${GLIB2_CFLAGS_OTHER})

View File

@ -41,6 +41,11 @@
*/
#define EXTERNAL_LIBRARY_FORK_REQUEST exported_fork_request
/**
* @brief Define for declaring the exported functions
*/
#define FUNC_DECL(FUNC) FUNC
/** @} */
#endif /* __EXTERNAL_RENDERER_INTERFACES_H__ */

View File

@ -1,2 +1,2 @@
add_subdirectory(python-renderer)
add_custom_target(plugins DEPENDS pythonrenderer)
add_subdirectory(plugin-example)
add_custom_target(plugins DEPENDS pluginexample)

View File

@ -1,4 +1,4 @@
project(pythonrenderer)
project(pluginexample)
cmake_minimum_required(VERSION 2.8)
find_package(PkgConfig REQUIRED)
pkg_search_module(PYTHON REQUIRED python3)

View File

@ -0,0 +1,19 @@
#include <stdio.h>
#include <glib.h>
#include <gds-render/gds-utils/gds-types.h>
#include <gds-render/output-renderers/external-renderer-interfaces.h>
int FUNC_DECL(EXTERNAL_LIBRARY_RENDER_FUNCTION)(struct gds_cell *toplevel, GList *layer_info_list, const char *output_file_name, double scale)
{
if (!toplevel)
return -1000;
printf("Rendering %s\n", toplevel->name);
return 0;
}
int FUNC_DECL(EXTERNAL_LIBRARY_INIT_FUNCTION)(const char *params, const char *version)
{
printf("Init with params: %s\ngds-render version: %s\n", params, version);
return 0;
}

View File

@ -1,7 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
int a(void)
{
return 0;
}