From: Sergey Matveev Date: Wed, 4 Mar 2026 10:56:08 +0000 (+0300) Subject: MuPDF with working Unicode-aware FreeGLUT X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ac2d24fe225c0886e546c3081d07774c97d0a59f4874da9977b4159e3171cc48;p=bass.git MuPDF with working Unicode-aware FreeGLUT --- diff --git a/build/skel/graphics/mupdf-1.27.2.do b/build/skel/graphics/mupdf-1.27.2.do index 7d74b0e..1d58815 100644 --- a/build/skel/graphics/mupdf-1.27.2.do +++ b/build/skel/graphics/mupdf-1.27.2.do @@ -24,9 +24,12 @@ $TAR xf "$DISTFILES"/$NAME.tar.zst --options read_concatenated_archives "$BASS_ROOT"/bin/rm-r "$SKELBINS"/$ARCH/$NAME-$hsh cd $NAME +# use dummy joystick handlers, as does not work on FreeBSD +cp "$BASS_ROOT"/build/skel/graphics/mupdf-freeglut-fg_joystick.c thirdparty/freeglut/src/fg_joystick.c +cp "$BASS_ROOT"/build/skel/graphics/mupdf-freeglut-fg_joystick_x11.c thirdparty/freeglut/src/x11/fg_joystick_x11.c perl -i -npe "s/-lfreetype2/-lfreetype/" Makerules XCFLAGS=-fPIC gmake -j$MAKE_JOBS \ - HAVE_GLUT=no \ + HAVE_X11=no \ HAVE_CURL=no \ USE_SYSTEM_FREETYPE=yes \ USE_SYSTEM_HARFBUZZ=yes \ diff --git a/build/skel/graphics/mupdf-freeglut-fg_joystick.c b/build/skel/graphics/mupdf-freeglut-fg_joystick.c new file mode 100644 index 0000000..a009776 --- /dev/null +++ b/build/skel/graphics/mupdf-freeglut-fg_joystick.c @@ -0,0 +1,140 @@ +#include +#include "fg_internal.h" +#ifdef HAVE_SYS_PARAM_H +# include +#endif + +#define JS_TRUE 1 +#define JS_FALSE 0 + +/* External function declarations (mostly platform-specific) */ +extern void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes ); +extern void fgPlatformJoystickOpen( SFG_Joystick* joy ); +extern void fgPlatformJoystickInit( SFG_Joystick *fgJoystick[], int ident ); +extern void fgPlatformJoystickClose ( int ident ); + +#define MAX_NUM_JOYSTICKS 2 +SFG_Joystick *fgJoystick [ MAX_NUM_JOYSTICKS ]; + +void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes ) +{ +} + +void fgPlatformJoystickOpen( SFG_Joystick* joy ) +{ + joy->error = GL_TRUE; +} + +void fgPlatformJoystickInit( SFG_Joystick *fgJoystick[], int ident ) +{ + fgJoystick[ ident ]->id = ident; + fgJoystick[ ident ]->error = GL_FALSE; +} + +void fgPlatformJoystickClose ( int ident ) +{ +} + +void fgInitialiseJoysticks ( void ) +{ +} + +void fgJoystickClose( void ) +{ +} + +void fgJoystickPollWindow( SFG_Window* window ) +{ +} + +int fgJoystickDetect( void ) +{ + return 0; +} + +void FGAPIENTRY glutForceJoystickFunc( void ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutForceJoystickFunc" ); +#if !defined(_WIN32_WCE) + freeglut_return_if_fail( fgStructure.CurrentWindow != NULL ); + freeglut_return_if_fail( FETCH_WCB( *( fgStructure.CurrentWindow ), Joystick ) ); + fgJoystickPollWindow( fgStructure.CurrentWindow ); +#endif /* !defined(_WIN32_WCE) */ +} +int glutJoystickGetNumAxes( int ident ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickGetNumAxes" ); + return fgJoystick[ ident ]->num_axes; +} +int glutJoystickGetNumButtons( int ident ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickGetNumButtons" ); + return fgJoystick[ ident ]->num_buttons; +} +int glutJoystickNotWorking( int ident ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickNotWorking" ); + return fgJoystick[ ident ]->error; +} + +float glutJoystickGetDeadBand( int ident, int axis ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickGetDeadBand" ); + return fgJoystick[ ident ]->dead_band [ axis ]; +} +void glutJoystickSetDeadBand( int ident, int axis, float db ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickSetDeadBand" ); + fgJoystick[ ident ]->dead_band[ axis ] = db; +} + +float glutJoystickGetSaturation( int ident, int axis ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickGetSaturation" ); + return fgJoystick[ ident ]->saturate[ axis ]; +} +void glutJoystickSetSaturation( int ident, int axis, float st ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickSetSaturation" ); + fgJoystick[ ident ]->saturate [ axis ] = st; +} + +void glutJoystickSetMinRange( int ident, float *axes ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickSetMinRange" ); + memcpy( fgJoystick[ ident ]->min, axes, + fgJoystick[ ident ]->num_axes * sizeof( float ) ); +} +void glutJoystickSetMaxRange( int ident, float *axes ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickSetMaxRange" ); + memcpy( fgJoystick[ ident ]->max, axes, + fgJoystick[ ident ]->num_axes * sizeof( float ) ); +} +void glutJoystickSetCenter( int ident, float *axes ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickSetCenter" ); + memcpy( fgJoystick[ ident ]->center, axes, + fgJoystick[ ident ]->num_axes * sizeof( float ) ); +} + +void glutJoystickGetMinRange( int ident, float *axes ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickGetMinRange" ); + memcpy( axes, fgJoystick[ ident ]->min, + fgJoystick[ ident ]->num_axes * sizeof( float ) ); +} +void glutJoystickGetMaxRange( int ident, float *axes ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickGetMaxRange" ); + memcpy( axes, fgJoystick[ ident ]->max, + fgJoystick[ ident ]->num_axes * sizeof( float ) ); +} +void glutJoystickGetCenter( int ident, float *axes ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickGetCenter" ); + memcpy( axes, fgJoystick[ ident ]->center, + fgJoystick[ ident ]->num_axes * sizeof( float ) ); +} + +/*** END OF FILE ***/ diff --git a/build/skel/graphics/mupdf-freeglut-fg_joystick_x11.c b/build/skel/graphics/mupdf-freeglut-fg_joystick_x11.c new file mode 100644 index 0000000..89212ac --- /dev/null +++ b/build/skel/graphics/mupdf-freeglut-fg_joystick_x11.c @@ -0,0 +1,31 @@ +#include +#include "../fg_internal.h" +#ifdef HAVE_SYS_PARAM_H +# include +#endif + +#include + +#define MAX_NUM_JOYSTICKS 2 +extern SFG_Joystick *fgJoystick [ MAX_NUM_JOYSTICKS ]; + +void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes ) +{ + joy->error = GL_TRUE; + return; +} + +void fgPlatformJoystickOpen( SFG_Joystick* joy ) +{ + joy->error = 1; +} + +void fgPlatformJoystickInit( SFG_Joystick *fgJoystick[], int ident ) +{ + fgJoystick[ ident ]->id = ident; + fgJoystick[ ident ]->error = GL_TRUE; +} + +void fgPlatformJoystickClose ( int ident ) +{ +}