Index: head/graphics/milton/Makefile =================================================================== --- head/graphics/milton/Makefile (revision 513339) +++ head/graphics/milton/Makefile (revision 513340) @@ -1,54 +1,55 @@ # Created by: Alexey Dokuchaev # $FreeBSD$ PORTNAME= milton -PORTVERSION= 1.6.2 -PORTREVISION= 1 +PORTVERSION= 1.9.0 DISTVERSIONPREFIX= v CATEGORIES= graphics MAINTAINER= danfe@FreeBSD.org COMMENT= Infinite-canvas paint program LICENSE= GPLv3+ BUILD_DEPENDS= icotool:graphics/icoutils USE_GITHUB= yes GH_ACCOUNT= serge-rgb -USES= cmake compiler:c++11-lang gl gnome sdl +USES= cmake compiler:c++11-lang gl gnome sdl xorg USE_GL= gl glu USE_GNOME= cairo gtk20 USE_SDL= sdl2 image2 USE_XORG= ice sm x11 xext xi INSTALLS_ICONS= yes PLIST_FILES= bin/milton ${DATADIR_REL}/Carlito.ttf .for n in 16 32 48 64 128 256 PLIST_FILES+= share/icons/hicolor/${n}x${n}/apps/milton.png .endfor post-patch: @${REINPLACE_CMD} -e 's:__linux__:__${OPSYS}__:' \ ${WRKSRC}/src/easytab.h + @${REINPLACE_CMD} -e '39s:^:#undef COUNT:' \ + ${WRKSRC}/src/milton.h @${REINPLACE_CMD} -e 's:Carlito\.ttf:${DATADIR}/&:' \ ${WRKSRC}/src/sdl_milton.cc @${REINPLACE_CMD} -e 's:milton\.png:${PREFIX}/share/icons/hicolor/256x256/apps/&:' \ ${WRKSRC}/src/platform_linux.cc @${REINPLACE_CMD} -E '/case (ENODATA|ENOST?R|ETIME):/d' \ ${WRKSRC}/src/shadergen.cc do-install: ${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/Milton \ ${STAGEDIR}${PREFIX}/bin/milton @${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${WRKSRC}/third_party/Carlito.ttf \ ${STAGEDIR}${DATADIR} .for n in 16 32 48 64 128 256 @${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${n}x${n}/apps ${INSTALL_DATA} ${INSTALL_WRKSRC}/milton_icon_?_${n}x${n}x32.png \ ${STAGEDIR}${PREFIX}/share/icons/hicolor/${n}x${n}/apps/milton.png .endfor .include Index: head/graphics/milton/distinfo =================================================================== --- head/graphics/milton/distinfo (revision 513339) +++ head/graphics/milton/distinfo (revision 513340) @@ -1,3 +1,3 @@ -TIMESTAMP = 1559748893 -SHA256 (serge-rgb-milton-v1.6.2_GH0.tar.gz) = 2f8dc4dd912eda2afe16b741def1eb0136dbd7da910d8715a5406169a342ac87 -SIZE (serge-rgb-milton-v1.6.2_GH0.tar.gz) = 12062781 +TIMESTAMP = 1569705067 +SHA256 (serge-rgb-milton-v1.9.0_GH0.tar.gz) = fd6ae60c41db203a1f6008c0d82b74ce527a05f47b25234560d2b7596bbca073 +SIZE (serge-rgb-milton-v1.9.0_GH0.tar.gz) = 12068156 Index: head/graphics/milton/files/patch-src_platform__linux.cc =================================================================== --- head/graphics/milton/files/patch-src_platform__linux.cc (revision 513339) +++ head/graphics/milton/files/patch-src_platform__linux.cc (revision 513340) @@ -1,24 +1,62 @@ ---- src/platform_linux.cc.orig 2019-03-15 04:11:43 UTC +--- src/platform_linux.cc.orig 2019-09-28 21:11:07 UTC +++ src/platform_linux.cc @@ -1,6 +1,8 @@ // Copyright (c) 2015 Sergio Gonzalez. All rights reserved. // License: https://github.com/serge-rgb/milton#license +#include + #include "platform.h" #include "common.h" -@@ -318,5 +320,12 @@ platform_deinit(PlatformState* platform) +@@ -30,7 +32,7 @@ perf_counter() + milton_log("Something went wrong with clock_gettime\n"); + } + +- return tp.tv_nsec; ++ return tp.tv_sec * 1000 * 1000 * 1000 + tp.tv_nsec; + } + void +@@ -148,7 +150,7 @@ platform_dialog_yesno(char* info, char* title) + } + + YesNoCancelAnswer +-platform_dialog_yesnocancel(char* info, char* title); ++platform_dialog_yesnocancel(char* info, char* title) + { + // NOTE: As of 2019-09-23, this function hasn't been tested on Linux. + +@@ -342,5 +344,32 @@ platform_deinit(PlatformState* platform) + void platform_setup_cursor(Arena* arena, PlatformState* platform) { + SDL_Surface *surface; + surface = IMG_Load("milton.png"); + if (surface == NULL) + return; + + SDL_SetWindowIcon(platform->window, surface); + SDL_FreeSurface(surface); ++} ++ ++v2i ++platform_cursor_get_position(PlatformState* platform) ++{ ++ v2i pos; ++ ++ SDL_GetMouseState(&pos.x, &pos.y); ++ return pos; ++} ++ ++void ++platform_cursor_set_position(PlatformState* platform, v2i pos) ++{ ++ SDL_WarpMouseInWindow(platform->window, pos.x, pos.y); ++ ++ // Pending mouse move events will have the cursor close ++ // to where it was before we set it. ++ SDL_FlushEvent(SDL_MOUSEMOTION); ++ SDL_FlushEvent(SDL_SYSWMEVENT); }