Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Merge branch 'develop' into 'master'

See merge request Scientific-IT-Systems/gr!1382
  • Loading branch information
IngoMeyer441 committed Jan 20, 2025
2 parents 9e61244 + 5f726f8 commit d780112
Show file tree
Hide file tree
Showing 31 changed files with 2,725 additions and 1,291 deletions.
7 changes: 4 additions & 3 deletions .gitlab-ci/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ windows-64bit-cmake-msvc:
- vcvars_cmd cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/c/gr -DGR_USE_BUNDLED_LIBRARIES=OFF
- vcvars_cmd cmake --build build --config Release
- vcvars_cmd cmake --install build --config Release
- cd /c/Qt/5.15.2/msvc2019_64/bin
- cp -v Qt5Core.dll Qt5Gui.dll Qt5Widgets.dll Qt5Network.dll /c/gr/bin/
- cd /c/Qt6/6.8.1/msvc2022_64/bin
- cp -v Qt6Core.dll Qt6Gui.dll Qt6Widgets.dll Qt6Network.dll /c/gr/bin/
- cd -
- cd /c/gr/bin
- mkdir -p platforms
- cp -v /c/Qt/5.15.2/msvc2019_64/plugins/platforms/qwindows.dll platforms/
- cp -v /c/Qt6/6.8.1/msvc2022_64/plugins/platforms/qwindows.dll platforms/
- cd -
- cd /c/local/bin
- cp -v cairo.dll freetype.dll jpeg62.dll libpng16.dll pixman-1-0.dll qhull_r.dll tiff.dll tiffxx.dll turbojpeg.dll xerces-c_3_2.dll zlib.dll /c/gr/bin/
Expand All @@ -235,6 +235,7 @@ windows-64bit-cmake-msvc:
- cp -v "/c/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Redist/MSVC/14.31.31103/x64/Microsoft.VC143.CRT/vcruntime140_1.dll" /c/gr/bin/
- cp -v "/c/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Redist/MSVC/14.31.31103/x64/Microsoft.VC143.CRT/msvcp140.dll" /c/gr/bin/
- cp -v "/c/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Redist/MSVC/14.31.31103/x64/Microsoft.VC143.CRT/msvcp140_1.dll" /c/gr/bin/
- cp -v "/c/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Redist/MSVC/14.31.31103/x64/Microsoft.VC143.CRT/msvcp140_2.dll" /c/gr/bin/
- mv /c/gr artifacts-windows-64bit-cmake-msvc
artifacts:
expire_in: 1 week
Expand Down
5 changes: 0 additions & 5 deletions .gitlab-ci/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ deploy-to-obs:
mv -f ${OBS_PROJECT}/gr/_service.new
${OBS_PROJECT}/gr/_service
- osc commit ${OBS_PROJECT}/gr/_service -m "Release $REVISION"
- fails="$(osc results -w -f -F ${OBS_PROJECT}/gr)"
- if [[ -n "${fails}" ]]; then
echo "$fails";
exit 1;
fi

deploy-to-aur:
stage: deploy
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ foreach(LIBRARY gks_static gks_shared)
target_link_libraries(${LIBRARY} ${GKS_LINK_MODE} pthread)
target_link_libraries(${LIBRARY} ${GKS_LINK_MODE} m)
endif()
if(FREETYPE_FOUND)
if(Freetype_FOUND)
target_link_libraries(${LIBRARY} ${GKS_LINK_MODE} Freetype::Freetype)
else()
target_compile_definitions(
Expand Down Expand Up @@ -670,6 +670,11 @@ if(Agg_FOUND)
target_link_libraries(aggplugin PRIVATE Libpng::Libpng)
string(APPEND GR_REPORT "- aggplugin: Yes\n")
target_compile_options(aggplugin PRIVATE ${COMPILER_OPTION_ERROR_IMPLICIT})
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Do not define `min` and `max` as macros because this can have unintended side effects (like error messages when
# using `std::min`)
target_compile_definitions(aggplugin PRIVATE NOMINMAX)
endif()
else()
target_compile_definitions(aggplugin PRIVATE NO_AGG)
string(APPEND GR_REPORT "- aggplugin: No (Agg not found)\n")
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindAgg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# If false, do not try to use Agg.

if(NOT AGG_INCLUDE_DIR)
find_path(AGG_INCLUDE_DIR agg_basics.h)
find_path(AGG_INCLUDE_DIR agg_basics.h PATH_SUFFIXES agg2)
endif()

if(NOT AGG_LIBRARY)
Expand Down
15 changes: 14 additions & 1 deletion lib/gks/gks.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,16 @@ static int gks_parse_encoding(const char *encoding)
}


static void gks_exit_handler(void)
{
s->in_exit_handler = 1;
gks_emergency_close();
}


static void gks_parse_env(void)
{
static int exit_handler_installed = 0;
static int did_report_invalid_encoding = 0;
const char *env;

Expand Down Expand Up @@ -416,7 +424,11 @@ static void gks_parse_env(void)
s->input_encoding = (char *)gks_getenv("GKS_IGNORE_ENCODING") != NULL ? ENCODING_UTF8 : ENCODING_LATIN1;
}

if (gks_getenv("GKS_NO_EXIT_HANDLER") == NULL) atexit(gks_emergency_close);
if (gks_getenv("GKS_NO_EXIT_HANDLER") == NULL && !exit_handler_installed)
{
atexit(gks_exit_handler);
exit_handler_installed = 1;
}

if (gks_getenv("GKS_DEBUG") != NULL) s->debug = 1;
}
Expand Down Expand Up @@ -546,6 +558,7 @@ void gks_init_gks(void)
s->aspect_ratio = 1;

s->callback = NULL;
s->in_exit_handler = 0;
s->debug = 0;
}
}
Expand Down
1 change: 1 addition & 0 deletions lib/gks/gkscore.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ typedef struct
double nominal_size;
double aspect_ratio;
char *(*callback)(const char *);
int in_exit_handler;
int debug;
} gks_state_list_t;

Expand Down
20 changes: 11 additions & 9 deletions lib/gks/pdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,14 +778,9 @@ static void set_xform(void)

p->width = nint(p->a * (p->window[1] - p->window[0]));
p->height = nint(p->c * (p->window[3] - p->window[2]));
if (gkss->nominal_size > 0)
{
p->nominal_size = 558 / 500.0 * gkss->nominal_size;
}
else
{
p->nominal_size = min(p->width, p->height) / 500.0;
}

p->nominal_size = min(p->width, p->height) / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;
}

static void seg_xform(double *x, double *y)
Expand Down Expand Up @@ -873,7 +868,8 @@ static void open_ws(int fd, int wstype)
p->viewport[0] = p->viewport[2] = 0;
p->viewport[1] = p->viewport[3] = 0.1984;
p->width = p->height = 558;
p->nominal_size = 558 / 500.0;
p->nominal_size = min(p->width, p->height) / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;

p->empty = 1;

Expand Down Expand Up @@ -2227,6 +2223,12 @@ void gks_drv_js(
init_norm_xform();
break;

case 109:
/* set nominal size */
p->nominal_size = min(p->width, p->height) / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;
break;

case 203:
/* set transparency */
p->alpha = (int)(r1[0] * 255.0);
Expand Down
25 changes: 9 additions & 16 deletions lib/gks/plugin/aggplugin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1444,14 +1444,8 @@ void gks_aggplugin(int fctid, int dx, int dy, int dimx, int *i_arr, int len_f_ar
p->viewport[0] = p->viewport[2] = 0;
p->viewport[1] = (double)p->width * p->mw / p->w;
p->viewport[3] = (double)p->height * p->mh / p->h;
if (gkss->nominal_size > 0)
{
p->nominal_size = p->dpi / 100 * gkss->nominal_size;
}
else
{
p->nominal_size = min(p->width, p->height) / 500.0;
}
p->nominal_size = min(p->width, p->height) / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;

init_colors();
open_page();
Expand Down Expand Up @@ -1600,20 +1594,19 @@ void gks_aggplugin(int fctid, int dx, int dy, int dimx, int *i_arr, int len_f_ar

p->width = (int)(p->viewport[1] * p->w / p->mw);
p->height = (int)(p->viewport[3] * p->h / p->mh);
if (gkss->nominal_size > 0)
{
p->nominal_size = p->dpi / 100 * gkss->nominal_size;
}
else
{
p->nominal_size = min(p->width, p->height) / 500.0;
}
p->nominal_size = min(p->width, p->height) / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;

close_page();
open_page();
}
break;

case 109:
p->nominal_size = min(p->width, p->height) / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;
break;

case 203:
/* set transparency */
set_transparency(f_arr_1[0]);
Expand Down
30 changes: 13 additions & 17 deletions lib/gks/plugin/cairoplugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -2277,6 +2277,7 @@ void gks_cairoplugin(int fctid, int dx, int dy, int dimx, int *ia, int lr1, doub
p->dpi = 600;
resize(2400, 2400);
p->nominal_size = 2400 / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;
}
else if (p->wtype == 143)
{
Expand Down Expand Up @@ -2336,14 +2337,8 @@ void gks_cairoplugin(int fctid, int dx, int dy, int dimx, int *ia, int lr1, doub
p->mw = p->w * 2.54 / 100 / p->dpi;
p->mh = p->h * 2.54 / 100 / p->dpi;
resize(width, height);
if (gkss->nominal_size > 0)
{
p->nominal_size = 2400 / 500.0 * gkss->nominal_size;
}
else
{
p->nominal_size = min(p->width, p->height) / 500.0;
}
p->nominal_size = min(p->width, p->height) / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;
}
else if (p->wtype == 150)
{
Expand All @@ -2353,7 +2348,8 @@ void gks_cairoplugin(int fctid, int dx, int dy, int dimx, int *ia, int lr1, doub
p->h = 420;
p->dpi = 100;
resize(400, 400);
p->nominal_size = 0.8;
p->nominal_size = 400 / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;
}
else
{
Expand All @@ -2364,6 +2360,7 @@ void gks_cairoplugin(int fctid, int dx, int dy, int dimx, int *ia, int lr1, doub
p->dpi = 100;
resize(500, 500);
p->nominal_size = 1;
if (gkss->nominal_size > 0) p->nominal_size = gkss->nominal_size;
}

p->max_points = MAX_POINTS;
Expand Down Expand Up @@ -2588,14 +2585,8 @@ void gks_cairoplugin(int fctid, int dx, int dy, int dimx, int *ia, int lr1, doub
{
p->width = p->viewport[1] * p->w / p->mw;
p->height = p->viewport[3] * p->h / p->mh;
if (gkss->nominal_size > 0)
{
p->nominal_size = 2400 / 500.0 * gkss->nominal_size;
}
else
{
p->nominal_size = min(p->width, p->height) / 500.0;
}
p->nominal_size = min(p->width, p->height) / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;
}
close_page();
open_page();
Expand All @@ -2607,6 +2598,11 @@ void gks_cairoplugin(int fctid, int dx, int dy, int dimx, int *ia, int lr1, doub
unlock();
break;

case 109:
p->nominal_size = min(p->width, p->height) / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;
break;

case 203:
/* set transparency */
lock();
Expand Down
16 changes: 8 additions & 8 deletions lib/gks/plugin/gsplugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,14 +502,8 @@ static void set_xform(double *wn, double *vp)

p->width = p->a;
p->height = p->c;
if (gkss->nominal_size > 0)
{
p->nominal_size = 72.0 / 600 * gkss->nominal_size;
}
else
{
p->nominal_size = MIN(p->width, p->height) / 500.0 * 72 / 600;
}
p->nominal_size = MIN(p->width, p->height) / 500.0 * 72 / 600;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;

p->stroke = 0;
}
Expand Down Expand Up @@ -2415,6 +2409,12 @@ void gks_gsplugin(int fctid, int dx, int dy, int dimx, int *ia, int lr1, double
init_norm_xform();
break;

/* set nominal size */
case 109:
p->nominal_size = MIN(p->width, p->height) / 500.0 * 72 / 600;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;
break;

default:;
}
}
Expand Down
18 changes: 10 additions & 8 deletions lib/gks/plugin/pgfplugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,8 @@ void gks_pgfplugin(int fctid, int dx, int dy, int dimx, int *ia, int lr1, double
p->height = 500;
p->width = 500;
p->nominal_size = 1;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;

p->window[0] = p->window[2] = 0.0;
p->window[1] = p->window[3] = 1.0;
p->viewport[0] = p->viewport[2] = 0;
Expand Down Expand Up @@ -1687,21 +1689,21 @@ void gks_pgfplugin(int fctid, int dx, int dy, int dimx, int *ia, int lr1, double

p->width = p->viewport[1] * WIDTH / MWIDTH;
p->height = p->viewport[3] * HEIGHT / MHEIGHT;
if (gkss->nominal_size > 0)
{
p->nominal_size = gkss->nominal_size;
}
else
{
p->nominal_size = min(p->width, p->height) / 500.0;
}
p->nominal_size = min(p->width, p->height) / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;

set_xform();
init_norm_xform();
set_clip_rect(gkss->cntnr);
}
break;

case 109:
/* set nominal size */
p->nominal_size = min(p->width, p->height) / 500.0;
if (gkss->nominal_size > 0) p->nominal_size *= gkss->nominal_size;
break;

case 203:
/* set transparency */
set_transparency(r1[0]);
Expand Down
Loading

0 comments on commit d780112

Please sign in to comment.