particles: compile as shared libraries (plugins)

This commit is contained in:
Daniel Eklöf 2019-01-13 11:13:47 +01:00
parent 7b98ea2b7c
commit 47018104da
13 changed files with 89 additions and 130 deletions

24
particles/CMakeLists.txt Normal file
View file

@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.13)
add_library(particle-sdk INTERFACE)
target_compile_definitions(particle-sdk INTERFACE _GNU_SOURCE)
target_compile_options(particle-sdk INTERFACE ${CAIRO_CFLAGS_OTHER})
target_include_directories(particle-sdk INTERFACE ${CAIRO_INCLUDE_DIRS})
add_library(empty MODULE empty.c empty.h)
target_link_libraries(empty particle-sdk)
add_library(list MODULE list.c list.h)
target_link_libraries(list particle-sdk)
add_library(map MODULE map.c map.h)
target_link_libraries(map particle-sdk)
add_library(progress-bar MODULE progress-bar.c progress-bar.h)
target_link_libraries(progress-bar particle-sdk)
add_library(ramp MODULE ramp.c ramp.h)
target_link_libraries(ramp particle-sdk)
add_library(string MODULE string.c string.h)
target_link_libraries(string particle-sdk)

View file

@ -48,7 +48,7 @@ from_conf(const struct yml_node *node, const struct font *parent_font,
return empty_new(left_margin, right_margin, on_click_template);
}
const struct particle_info particle_empty = {
const struct particle_info plugin_info = {
.from_conf = &from_conf,
.attr_count = PARTICLE_COMMON_ATTRS_COUNT + 0,
.attrs = {

View file

@ -198,7 +198,7 @@ from_conf(const struct yml_node *node, const struct font *parent_font,
on_click_template);
}
const struct particle_info particle_list = {
const struct particle_info plugin_info = {
.from_conf = &from_conf,
.attr_count = PARTICLE_COMMON_ATTRS_COUNT + 4,
.attrs = {

View file

@ -228,7 +228,7 @@ from_conf(const struct yml_node *node, const struct font *parent_font,
default_particle, left_margin, right_margin, on_click_template);
}
const struct particle_info particle_map = {
const struct particle_info plugin_info = {
.from_conf = &from_conf,
.attr_count = PARTICLE_COMMON_ATTRS_COUNT + 3,
.attrs = {

View file

@ -257,7 +257,7 @@ from_conf(const struct yml_node *node, const struct font *parent_font,
left_margin, right_margin, on_click_template);
}
const struct particle_info particle_progress_bar = {
const struct particle_info plugin_info = {
.from_conf = &from_conf,
.attr_count = PARTICLE_COMMON_ATTRS_COUNT + 7,
.attrs = {

View file

@ -178,7 +178,7 @@ from_conf(const struct yml_node *node, const struct font *parent_font,
on_click_template);
}
const struct particle_info particle_ramp = {
const struct particle_info plugin_info = {
.from_conf = &from_conf,
.attr_count = PARTICLE_COMMON_ATTRS_COUNT + 2,
.attrs = {

View file

@ -171,7 +171,7 @@ from_conf(const struct yml_node *node, const struct font *parent_font,
fg_color, left_margin, right_margin, on_click_template);
}
const struct particle_info particle_string = {
const struct particle_info plugin_info = {
.from_conf = &from_conf,
.attr_count = PARTICLE_COMMON_ATTRS_COUNT + 5,
.attrs = {