Commit 56d70bf9 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

update the last FVIZ_... constants

parent 6cd3c25f
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -5,9 +5,9 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/extra/cm

# Options
# -----------------------------------------------------------------------------
option(FVIZ_TEXT_ENABLE_BIDI "Enable bi-directional text support" ON)
set(FVIZ_TEXT_BACKEND "freetype" CACHE STRING "Set the text backend")
option(FVIZ_TESTING "Builds with testing flags [default: OFF]" OFF)
option(CLIP_TEXT_ENABLE_BIDI "Enable bi-directional text support" ON)
set(CLIP_TEXT_BACKEND "freetype" CACHE STRING "Set the text backend")
option(CLIP_TESTING "Builds with testing flags [default: OFF]" OFF)


# Dependencies
@@ -22,7 +22,7 @@ find_package(PNG REQUIRED)
find_package(fmt REQUIRED)
find_library(fmt_LIBRARY NAMES fmt)

#if(FVIZ_TEXT_BACKEND EQUAL "freetype")
#if(CLIP_TEXT_BACKEND EQUAL "freetype")
  pkg_check_modules(FRIBIDI QUIET fribidi)
  find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h)
  find_library(FRIBIDI_LIBRARY NAMES fribidi)
@@ -31,7 +31,7 @@ find_library(fmt_LIBRARY NAMES fmt)
    set(FRIBIDI_LIBRARIES "${FRIBIDI_LIBRARY}")
  else()
    message(WARNING "libfribidi not found; disabling BiDI support")
    set(FVIZ_TEXT_ENABLE_BIDI OFF)
    set(CLIP_TEXT_ENABLE_BIDI OFF)
  endif()
#endif()

@@ -45,7 +45,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/utils)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})

if(FVIZ_TESTING)
if(CLIP_TESTING)
  add_compile_options(
      -Wall
      -Wextra
@@ -71,8 +71,8 @@ endif()
# Build: Config
# -----------------------------------------------------------------------------
configure_file(src/config.h.in config.h)
message(STATUS "Config Options: text_backend=${FVIZ_TEXT_BACKEND}")
message(STATUS "Config Options: text_enable_bidi=${FVIZ_TEXT_ENABLE_BIDI}")
message(STATUS "Config Options: text_backend=${CLIP_TEXT_BACKEND}")
message(STATUS "Config Options: text_enable_bidi=${CLIP_TEXT_ENABLE_BIDI}")


# Build: clip Library
@@ -84,11 +84,11 @@ list(REMOVE_ITEM source_files "${CMAKE_SOURCE_DIR}/src/layout/box.cc")
list(REMOVE_ITEM source_files "${CMAKE_SOURCE_DIR}/src/plot.cc")
add_library(clip OBJECT ${source_files})
set_property(TARGET clip PROPERTY POSITION_INDEPENDENT_CODE 1)
set(FVIZ_LIB_LDFLAGS ${CAIRO_LIBRARIES} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES} ${HARFBUZZ_ICU_LIBRARIES} ${PNG_LIBRARIES} ${FONTCONFIG_LIBRARIES} ${FRIBIDI_LIBRARIES} ${fmt_LIBRARY})
set(CLIP_LIB_LDFLAGS ${CAIRO_LIBRARIES} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES} ${HARFBUZZ_ICU_LIBRARIES} ${PNG_LIBRARIES} ${FONTCONFIG_LIBRARIES} ${FRIBIDI_LIBRARIES} ${fmt_LIBRARY})
add_library(clip-lib-a STATIC $<TARGET_OBJECTS:clip>)
set_target_properties(clip-lib-a PROPERTIES OUTPUT_NAME clip)
add_library(clip-lib-so SHARED $<TARGET_OBJECTS:clip>)
target_link_libraries(clip-lib-so ${FVIZ_LIB_LDFLAGS})
target_link_libraries(clip-lib-so ${CLIP_LIB_LDFLAGS})
set_target_properties(clip-lib-so PROPERTIES OUTPUT_NAME clip)
set_target_properties(clip-lib-so PROPERTIES PUBLIC_HEADER "src/api.h")
set_target_properties(clip-lib-so PROPERTIES CXX_VISIBILITY_PRESET hidden)
@@ -96,7 +96,7 @@ set_target_properties(clip-lib-so PROPERTIES CXX_VISIBILITY_PRESET hidden)
# Build: CLI
# -----------------------------------------------------------------------------
add_executable(clip-cli "src/cli.cc" $<TARGET_OBJECTS:clip>)
target_link_libraries(clip-cli ${FVIZ_LIB_LDFLAGS})
target_link_libraries(clip-cli ${CLIP_LIB_LDFLAGS})
set_target_properties(clip-cli PROPERTIES OUTPUT_NAME clip)


+7 −7
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
extern "C" {
#endif

#define FVIZ_API __attribute__((visibility ("default")))
#define CLIP_API __attribute__((visibility ("default")))

typedef struct clip_s clip_t;

@@ -30,20 +30,20 @@ typedef struct clip_s clip_t;
 *
 * @returns: A clip context that must be free'd using `clip_destroy`
 */
FVIZ_API
CLIP_API
clip_t* clip_init();

/**
 * Free a clip context
 */
FVIZ_API
CLIP_API
void clip_destroy(clip_t* ctx);

/**
 * Retrieve the last error message. The returned pointer is valid until the next
 * `clip_*` method is called on the context.
 */
FVIZ_API
CLIP_API
const char* clip_get_error(const clip_t* ctx);

/**
@@ -51,19 +51,19 @@ const char* clip_get_error(const clip_t* ctx);
 *
 * @returns: One (1) on success and zero (0) if an error has occured
 */
FVIZ_API
CLIP_API
int clip_eval(clip_t* ctx, const char* expr);

/**
 * Retrieve the result. Pointer is valid until the next call to clip_eval
 */
FVIZ_API
CLIP_API
void clip_get_result(clip_t* ctx, const void** data, size_t* data_len);

/**
 * Set the output format
 */
FVIZ_API
CLIP_API
void clip_set_output_format(clip_t* ctx, const char* format);


+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ int main(int argc, const char** argv) {
            "Part of the clip project (https://clip.org)\n"
            "Copyright (c) 2019, Paul Asmuth, Laura Schlimmer.\n"
            "All rights reserved.\n\n",
            FVIZ_VERSION);
            CLIP_VERSION);

    return 0;
  }
+3 −3
Original line number Diff line number Diff line
#cmakedefine01 FVIZ_TEXT_ENABLE_BIDI
#define FVIZ_TEXT_BACKEND "${FVIZ_TEXT_BACKEND}"
#define FVIZ_VERSION "${PROJECT_VERSION}"
#cmakedefine01 CLIP_TEXT_ENABLE_BIDI
#define CLIP_TEXT_BACKEND "${CLIP_TEXT_BACKEND}"
#define CLIP_VERSION "${PROJECT_VERSION}"
+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@

namespace clip::text {

const constexpr std::string_view TEXT_BACKEND = FVIZ_TEXT_BACKEND;
const constexpr bool TEXT_ENABLE_BIDI = FVIZ_TEXT_ENABLE_BIDI;
const constexpr std::string_view TEXT_BACKEND = CLIP_TEXT_BACKEND;
const constexpr bool TEXT_ENABLE_BIDI = CLIP_TEXT_ENABLE_BIDI;

ReturnCode text_analyze_bidi_line(
    const TextSpan* text_begin,
Loading