-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[glib, fltk, cairo, python3] Sequence of adjustments for windows and macos #9593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8af9571
49731f8
c1b9a58
e16e9fc
04fe29b
b7f17b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| Source: cairo | ||
| Version: 1.16.0-2 | ||
| Version: 1.16.0-3 | ||
| Homepage: https://cairographics.org | ||
| Description: Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB. | ||
| Build-Depends: zlib, libpng, pixman, glib, freetype, fontconfig | ||
|
|
||
| Feature: x11 | ||
| Description: build with x11 support | ||
| Description: build with x11 support |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,33 @@ | ||
| #ifndef CAIRO_FEATURES_H | ||
| #define CAIRO_FEATURES_H | ||
| /* Chosen from the various possible defines in "../build/Makefile.win32.features.h"" | ||
| guided by "../build/Makefile.win32.features". Modify at your own risk. | ||
| */ | ||
|
|
||
| /* Always for Win32 */ | ||
| #ifdef _WIN32 | ||
| #define CAIRO_HAS_WIN32_SURFACE 1 | ||
| #define CAIRO_HAS_WIN32_FONT 1 | ||
| #endif | ||
|
|
||
| /* Require libpng */ | ||
| #define CAIRO_HAS_PNG_FUNCTIONS 1 | ||
| #define CAIRO_HAS_PS_SURFACE 1 | ||
| #define CAIRO_HAS_PDF_SURFACE 1 | ||
|
|
||
| // Likely available | ||
| #define CAIRO_HAS_SCRIPT_SURFACE 1 | ||
| #define CAIRO_HAS_SVG_SURFACE 1 | ||
|
|
||
| /* Always available */ | ||
| #define CAIRO_HAS_IMAGE_SURFACE 1 | ||
| #define CAIRO_HAS_MIME_SURFACE 1 | ||
| #define CAIRO_HAS_RECORDING_SURFACE 1 | ||
| #define CAIRO_HAS_OBSERVER_SURFACE 1 | ||
| #define CAIRO_HAS_USER_FONT 1 | ||
|
|
||
| /* Require GObject */ | ||
| #define CAIRO_HAS_GOBJECT_FUNCTIONS 1 | ||
|
|
||
| /* Require FreeType */ | ||
| #define CAIRO_HAS_FT_FONT 1 | ||
|
|
||
| /* Require FontConfig */ | ||
| #define CAIRO_HAS_FC_FONT 1 | ||
|
|
||
| #ifdef _WIN32 | ||
| #define CAIRO_HAS_WIN32_SURFACE 1 | ||
| #define CAIRO_HAS_WIN32_FONT 1 | ||
| #endif | ||
|
|
||
| #ifdef __APPLE__ | ||
| #define CAIRO_HAS_QUARTZ_FONT 1 | ||
| #define CAIRO_HAS_QUARTZ_SURFACE 1 | ||
| #define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1 | ||
| #define CAIRO_HAS_XCB_SHM_FUNCTIONS 1 | ||
| #define CAIRO_HAS_XCB_SURFACE 1 | ||
| #define CAIRO_HAS_XLIB_SURFACE 1 | ||
| #define CAIRO_HAS_XLIB_XRENDER_SURFACE 1 | ||
| #endif | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| Source: fltk | ||
| Version: 1.3.5-1 | ||
| Version: 1.4-2 | ||
| Homepage: https://www.fltk.org/ | ||
| Description: FLTK (pronounced fulltick) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL and its built-in GLUT emulation. | ||
| Build-Depends: zlib, libpng, libjpeg-turbo | ||
|
|
||
| Feature: cairo | ||
| Description: build with cairo support | ||
| Build-Depends: cairo |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| diff --git a/CMake/macros.cmake b/CMake/macros.cmake | ||
| index 4def62d..27b4901 100644 | ||
| index e54d984..09e515f 100644 | ||
| --- a/CMake/macros.cmake | ||
| +++ b/CMake/macros.cmake | ||
| @@ -67,6 +67,8 @@ macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES) | ||
| @@ -97,6 +97,8 @@ macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES) | ||
| COMPILE_DEFINITIONS "FL_DLL" | ||
| ) | ||
| endif (${LIBTYPE} STREQUAL "SHARED") | ||
| + | ||
| + target_link_libraries(${LIBRARY_NAME} gdi32 gdiplus user32 advapi32 ole32 shell32 comdlg32) | ||
| + target_link_libraries(${LIBRARY_NAME} gdi32 gdiplus user32 advapi32 ole32 shell32 comdlg32) | ||
| endif (MSVC) | ||
|
|
||
| install(TARGETS ${LIBRARY_NAME} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| diff --git a/CMake/options.cmake b/CMake/options.cmake | ||
| index 3784314..ae0b48f 100644 | ||
| --- a/CMake/options.cmake | ||
| +++ b/CMake/options.cmake | ||
| @@ -157,37 +157,33 @@ if(OPTION_BUILD_HTML_DOCUMENTATION OR OPTION_BUILD_PDF_DOCUMENTATION) | ||
| endif(OPTION_BUILD_HTML_DOCUMENTATION OR OPTION_BUILD_PDF_DOCUMENTATION) | ||
|
|
||
| ####################################################################### | ||
| -include(FindPkgConfig) | ||
|
|
||
| option(OPTION_CAIRO "use lib Cairo" OFF) | ||
| option(OPTION_CAIROEXT | ||
| "use FLTK code instrumentation for Cairo extended use" OFF | ||
| ) | ||
|
|
||
| -if ((OPTION_CAIRO OR OPTION_CAIROEXT) AND LIB_CAIRO) | ||
| - pkg_search_module(PKG_CAIRO cairo) | ||
| -endif ((OPTION_CAIRO OR OPTION_CAIROEXT) AND LIB_CAIRO) | ||
| - | ||
| -if (PKG_CAIRO_FOUND) | ||
| +if (OPTION_CAIRO OR OPTION_CAIROEXT) | ||
| + # find_library(LIB_CAIRO cairo) in resources.cmake | ||
| + if (NOT LIB_CAIRO) | ||
| + message(STATUS "*** Cairo was requested but not found - please install Cairo ...") | ||
| + message(STATUS "*** or disable options OPTION_CAIRO and OPTION_CAIRO_EXT") | ||
| + message(FATAL_ERROR "*** Terminating: missing Cairo libs or headers") | ||
| + endif (NOT LIB_CAIRO) | ||
| set (FLTK_HAVE_CAIRO 1) | ||
| add_subdirectory(cairo) | ||
| - list(APPEND FLTK_LDLIBS -lcairo -lpixman-1) | ||
| - include_directories(${PKG_CAIRO_INCLUDE_DIRS}) | ||
| - string(REPLACE ";" " " CAIROFLAGS "${PKG_CAIRO_CFLAGS}") | ||
| - | ||
| +# list(APPEND FLTK_LDLIBS -lcairo -lpixman-1) | ||
| +# include_directories(${PKG_CAIRO_INCLUDE_DIRS}) | ||
| +# string(REPLACE ";" " " CAIROFLAGS "${PKG_CAIRO_CFLAGS}") | ||
| if (LIB_CAIRO AND OPTION_CAIROEXT) | ||
| - set(FLTK_USE_CAIRO 1) | ||
| - set(FLTK_CAIRO_FOUND TRUE) | ||
| - else () | ||
| - set(FLTK_CAIRO_FOUND FALSE) | ||
| - endif (LIB_CAIRO AND OPTION_CAIROEXT) | ||
| -else () | ||
| - if (OPTION_CAIRO OR OPTION_CAIROEXT) | ||
| - message(STATUS "*** Cairo was requested but not found - please check your cairo installation") | ||
| - message(STATUS "*** or disable options OPTION_CAIRO and OPTION_CAIRO_EXT.") | ||
| - message(FATAL_ERROR "*** Terminating: missing Cairo libs or headers.") | ||
| - endif (OPTION_CAIRO OR OPTION_CAIROEXT) | ||
| -endif (PKG_CAIRO_FOUND) | ||
| + set(FLTK_USE_CAIRO 1) | ||
| + set(FLTK_CAIRO_FOUND TRUE) | ||
| + else() | ||
| + set(FLTK_CAIRO_FOUND FALSE) | ||
| + endif() | ||
| +else() | ||
| + set(FLTK_CAIRO_FOUND FALSE) | ||
| +endif (OPTION_CAIRO OR OPTION_CAIROEXT) | ||
|
|
||
| ####################################################################### | ||
| option(OPTION_USE_NANOSVG "support SVG images" ON) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| diff --git a/CMake/resources.cmake b/CMake/resources.cmake | ||
| index 3676d3b..3e9cc1d 100644 | ||
| --- a/CMake/resources.cmake | ||
| +++ b/CMake/resources.cmake | ||
| @@ -63,15 +63,25 @@ endmacro (fl_find_header) | ||
| fl_find_header (HAVE_ALSA_ASOUNDLIB_H alsa/asoundlib.h) | ||
| fl_find_header (HAVE_DLFCN_H dlfcn.h) | ||
| fl_find_header (HAVE_GL_GLU_H GL/glu.h) | ||
| -fl_find_header (HAVE_LIBPNG_PNG_H libpng/png.h) | ||
| +#fl_find_header (HAVE_LIBPNG_PNG_H libpng/png.h) | ||
|
||
| fl_find_header (HAVE_LOCALE_H locale.h) | ||
| fl_find_header (HAVE_OPENGL_GLU_H OpenGL/glu.h) | ||
| -fl_find_header (HAVE_PNG_H png.h) | ||
| +#fl_find_header (HAVE_PNG_H png.h) | ||
| fl_find_header (HAVE_STDIO_H stdio.h) | ||
| fl_find_header (HAVE_STRINGS_H strings.h) | ||
| fl_find_header (HAVE_SYS_SELECT_H sys/select.h) | ||
| fl_find_header (HAVE_SYS_STDTYPES_H sys/stdtypes.h) | ||
|
|
||
| +find_package(PNG REQUIRED) | ||
| +if(PNG_FOUND) | ||
| + set(LIB_png ${PNG_LIBRARIES}) | ||
| + set(HAVE_PNG_H ${PNG_FOUND}) | ||
| +endif() | ||
| +find_package(ZLIB REQUIRED) | ||
| +if(ZLIB_FOUND) | ||
| + set(LIB_zlib ${ZLIB_LIBRARIES}) | ||
| +endif() | ||
| + | ||
| if (USE_FIND_FILE) | ||
| fl_find_header (HAVE_X11_XREGION_H "X11/Xregion.h") | ||
| fl_find_header (HAVE_XDBE_H "X11/extensions/Xdbe.h") | ||
| @@ -184,12 +194,13 @@ find_library(LIB_freetype freetype) | ||
| find_library(LIB_GL GL) | ||
| find_library(LIB_MesaGL MesaGL) | ||
| find_library(LIB_jpeg jpeg) | ||
| -find_library(LIB_png png) | ||
| -find_library(LIB_zlib z) | ||
| +#find_library(LIB_png png) | ||
|
||
| +#find_library(LIB_zlib z) | ||
|
|
||
| mark_as_advanced(LIB_CAIRO LIB_dl LIB_fontconfig LIB_freetype) | ||
| mark_as_advanced(LIB_GL LIB_MesaGL) | ||
| -mark_as_advanced(LIB_jpeg LIB_png LIB_zlib) | ||
| +#mark_as_advanced(LIB_jpeg LIB_png LIB_zlib) | ||
|
||
| +mark_as_advanced(LIB_jpeg) | ||
|
|
||
| ####################################################################### | ||
| # functions | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx | ||
| index 655aa72..0cf83ba 100644 | ||
| --- a/fluid/Fl_Widget_Type.cxx | ||
| +++ b/fluid/Fl_Widget_Type.cxx | ||
| @@ -46,6 +46,8 @@ extern const char* i18n_include; | ||
| extern const char* i18n_function; | ||
| extern const char* i18n_file; | ||
| extern const char* i18n_set; | ||
| +extern int varused_test, varused; | ||
| +extern bool fl_curr_write_once; | ||
|
|
||
| int Fl_Widget_Type::default_size = FL_NORMAL_SIZE; | ||
|
|
||
| @@ -2093,8 +2095,6 @@ const char *Fl_Type::callback_name() { | ||
| return unique_id(this, "cb", name(), label()); | ||
| } | ||
|
|
||
| -extern int varused_test, varused; | ||
| - | ||
| void Fl_Widget_Type::write_code1() { | ||
| const char* t = subclassname(this); | ||
| const char *c = array_name(this); | ||
| @@ -2153,6 +2153,16 @@ void Fl_Widget_Type::write_code1() { | ||
| } | ||
| } | ||
|
|
||
| + if(fl_curr_write_once) { | ||
| + write_c("%s#ifndef fl_curr_x\n", indent()); | ||
| + write_c("%s#define fl_curr_x() 0\n", indent()); | ||
| + write_c("%s#endif\n", indent()); | ||
| + write_c("%s#ifndef fl_curr_y\n", indent()); | ||
| + write_c("%s#define fl_curr_y() 0\n", indent()); | ||
| + write_c("%s#endif\n", indent()); | ||
| + fl_curr_write_once = false; | ||
| + } | ||
| + | ||
| write_c("%s{ ", indent()); | ||
| write_comment_inline_c(); | ||
| if (varused) write_c("%s* o = ", t); | ||
| @@ -2163,9 +2173,9 @@ void Fl_Widget_Type::write_code1() { | ||
| if (!strstr(t, "Window")) | ||
| write_c("new %s(0, 0, %d, %d", t, o->w(), o->h()); | ||
| else | ||
| - write_c("new %s(%d, %d", t, o->w(), o->h()); | ||
| + write_c("new %s(fl_curr_x()+%d, fl_curr_y()+%d", t, o->w(), o->h()); | ||
| } else { | ||
| - write_c("new %s(%d, %d, %d, %d", t, o->x(), o->y(), o->w(), o->h()); | ||
| + write_c("new %s(fl_curr_x()+%d, fl_curr_y()+%d, %d, %d", t, o->x(), o->y(), o->w(), o->h()); | ||
| } | ||
| if (label() && *label()) { | ||
| write_c(", "); | ||
| diff --git a/fluid/code.cxx b/fluid/code.cxx | ||
| index 50e5d70..8dd1f82 100644 | ||
| --- a/fluid/code.cxx | ||
| +++ b/fluid/code.cxx | ||
| @@ -149,6 +149,7 @@ int write_declare(const char *format, ...) { | ||
| // anything, but set a variable if it looks like the variable "o" is used: | ||
| int varused_test; | ||
| int varused; | ||
| +bool fl_curr_write_once; | ||
|
|
||
| // write an array of C characters (adds a null): | ||
| void write_cstring(const char *s, int length) { | ||
| @@ -364,6 +365,7 @@ int write_code(const char *s, const char *t) { | ||
| indentation = 0; | ||
| current_class = 0L; | ||
| current_widget_class = 0L; | ||
| + fl_curr_write_once = true; | ||
| if (!s) code_file = stdout; | ||
| else { | ||
| FILE *f = fl_fopen(s, filemode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you delete these three lines instead of commenting them out?
Thanks.