diff --git a/ChangeLog b/ChangeLog index 8ba8cada..8f613a66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2024-02-24 Araki Ken + + * cocoa.[hm], cocoatouch.m: + Add hasAlpha to arguments of MLTermView::copyArea and view_copy_area(). + If hasAlpha is true, call CGCOntextSetBlendMode(kCGBlendModeNormal). + + * quartz/ui_window.c: + ui_window_copy_area() calls view_copy_area() with hasAlpha=1 if mask is not NULL. + + * encodefilter/module/Makefile.in, configure.in: + Link ../src/libmef.la to libmef_XXXX.la instead of @EF_CHARA_LO@. + + * MLTermPty.java: Load MLTermPty.dll from ~/.mlterm/java all the time. + 2024-02-17 Araki Ken * vt_parser.c: diff --git a/configure b/configure index 66acc9e3..37dd2f0f 100755 --- a/configure +++ b/configure @@ -644,7 +644,6 @@ XPG4_LIBS ALLOCA pobl_top_builddir_suffix pobl_top_srcdir_suffix -EF_CHAR_LO MAKE_DIRS TABLE_CFLAGS mef_top_builddir_suffix @@ -16999,7 +16998,7 @@ mingw*) ;; msys*) - # msys2 + # msys2 # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -19717,6 +19716,7 @@ else fi + VT_PTY_OBJ="$VT_PTY_OBJ vt_pty_win32.o" else VT_PTY_OBJ="vt_pty_unix.o" @@ -23664,17 +23664,6 @@ if test "${MAKE_DIRS}" != "" ; then mkdir -p ${MAKE_DIRS} fi -# -# --- check for undefined symbol --- -# -if test "x$allow_undefined_flag" = "xunsupported" ; then - # link ef_char.lo to module/*.dll to resolve addresses in creating dll. - EF_CHAR_LO="../src/ef_char.lo" -else - EF_CHAR_LO="" -fi - - # # ====> check for baselib <=== # diff --git a/configure.in b/configure.in index bf1fe453..f0e3e8f7 100644 --- a/configure.in +++ b/configure.in @@ -1926,17 +1926,6 @@ if test "${MAKE_DIRS}" != "" ; then mkdir -p ${MAKE_DIRS} fi -# -# --- check for undefined symbol --- -# -if test "x$allow_undefined_flag" = "xunsupported" ; then - # link ef_char.lo to module/*.dll to resolve addresses in creating dll. - EF_CHAR_LO="../src/ef_char.lo" -else - EF_CHAR_LO="" -fi -AC_SUBST(EF_CHAR_LO) - # # ====> check for baselib <=== # diff --git a/encodefilter/configure b/encodefilter/configure index 45732f51..ae7bbc32 100755 --- a/encodefilter/configure +++ b/encodefilter/configure @@ -634,7 +634,6 @@ mef_top_builddir_suffix mef_top_srcdir_suffix DEXPORT LPOBL -EF_CHAR_LO NO_UNDEFINED_FLAG MAKE_DIRS TABLE_CFLAGS @@ -11681,13 +11680,10 @@ if test "x$allow_undefined_flag" = "xunsupported" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5 $as_echo "not supported" >&6; } NO_UNDEFINED_FLAG="-no-undefined" - # link ef_char.lo to module/*.dll to resolve addresses in creating dll. - EF_CHAR_LO="../src/ef_char.lo" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: supported" >&5 $as_echo "supported" >&6; } NO_UNDEFINED_FLAG="" - EF_CHAR_LO="" fi if test "x${POBL_BUILDDIR}" != "x" ; then LPOBL="${POBL_BUILDDIR}/src/libpobl.la" @@ -11698,7 +11694,6 @@ fi - if test "$with_gnu_ld" = "yes" ; then DEXPORT="-Wl,--version-script=\$(VPATH)/dexport.map" fi diff --git a/encodefilter/configure.in b/encodefilter/configure.in index 8b9a508c..33bb2112 100644 --- a/encodefilter/configure.in +++ b/encodefilter/configure.in @@ -96,12 +96,9 @@ AC_MSG_CHECKING([for undefined symbol]) if test "x$allow_undefined_flag" = "xunsupported" ; then AC_MSG_RESULT([not supported]) NO_UNDEFINED_FLAG="-no-undefined" - # link ef_char.lo to module/*.dll to resolve addresses in creating dll. - EF_CHAR_LO="../src/ef_char.lo" else AC_MSG_RESULT(supported) NO_UNDEFINED_FLAG="" - EF_CHAR_LO="" fi if test "x${POBL_BUILDDIR}" != "x" ; then LPOBL="${POBL_BUILDDIR}/src/libpobl.la" @@ -109,7 +106,6 @@ else LPOBL='-lpobl' fi AC_SUBST(NO_UNDEFINED_FLAG) -AC_SUBST(EF_CHAR_LO) AC_SUBST(LPOBL) diff --git a/encodefilter/module/Makefile.in b/encodefilter/module/Makefile.in index 6fa6a52d..cf36d81e 100644 --- a/encodefilter/module/Makefile.in +++ b/encodefilter/module/Makefile.in @@ -32,21 +32,22 @@ LIBTOOL_INSTALL = $(LIBTOOL) --mode=install $(INSTALL) all: $(TARGET) +# ../src/libmef.la is for ef_int_to_bytes() libmef_jajp.la: $(JAJP_TABLE_OBJ) - $(LIBTOOL_LINK) -o libmef_jajp.la $(JAJP_TABLE_OBJ:.o=.lo) @EF_CHAR_LO@ \ + $(LIBTOOL_LINK) -o libmef_jajp.la $(JAJP_TABLE_OBJ:.o=.lo) ../src/libmef.la \ ../src/ef_jis_property.lo \ -rpath $(libdir)/mef -module -avoid-version @NO_UNDEFINED_FLAG@ libmef_kokr.la: $(KOKR_TABLE_OBJ) - $(LIBTOOL_LINK) -o libmef_kokr.la $(KOKR_TABLE_OBJ:.o=.lo) @EF_CHAR_LO@ \ + $(LIBTOOL_LINK) -o libmef_kokr.la $(KOKR_TABLE_OBJ:.o=.lo) ../src/libmef.la \ -rpath $(libdir)/mef -module -avoid-version @NO_UNDEFINED_FLAG@ libmef_zh.la: $(ZH_TABLE_OBJ) - $(LIBTOOL_LINK) -o libmef_zh.la $(ZH_TABLE_OBJ:.o=.lo) @EF_CHAR_LO@ \ + $(LIBTOOL_LINK) -o libmef_zh.la $(ZH_TABLE_OBJ:.o=.lo) ../src/libmef.la \ -rpath $(libdir)/mef -module -avoid-version @NO_UNDEFINED_FLAG@ libmef_8bits.la: $(BYTE_TABLE_OBJ) - $(LIBTOOL_LINK) -o libmef_8bits.la $(BYTE_TABLE_OBJ:.o=.lo) @EF_CHAR_LO@ \ + $(LIBTOOL_LINK) -o libmef_8bits.la $(BYTE_TABLE_OBJ:.o=.lo) ../src/libmef.la \ -rpath $(libdir)/mef -module -avoid-version @NO_UNDEFINED_FLAG@ install: install-la diff --git a/java/README b/java/README index e1b0a073..ab27a4d8 100644 --- a/java/README +++ b/java/README @@ -87,12 +87,10 @@ How to build & install mlterm co-operating with Java. Control+F2: Open new pty in current mlterm window. Control+F3: Switch to a next free pty. -* On-line demo (win32 only) - http://mlterm.sourceforge.net/mltermlet.jnlp - o If libeay32.dll exits in system foler (c:\windows\system) and it is not - compatible with the one which libssh2 depends on, this demo doesn't start. + compatible with the one which libssh2 depends on, mlterm doesn't start. Remove libeay32.dll in system folder in advance. + o The path of RSA public key is %HOMEPATH%\mlterm\id_rsa.pub and the one of private key is %HOMEPATH%\mlterm\id_rsa by default. diff --git a/java/mlterm/MLTermPty.java b/java/mlterm/MLTermPty.java index 04a3468f..9d523ba7 100644 --- a/java/mlterm/MLTermPty.java +++ b/java/mlterm/MLTermPty.java @@ -16,6 +16,7 @@ public class MLTermPty { private static void loadLibraryFromJar() { Manifest mf = null; + long jarLastModified = (new File(System.getProperty("java.class.path"))).lastModified(); try { Enumeration urls = @@ -59,6 +60,12 @@ private static void loadLibraryFromJar() { byte[] buf = new byte[4096]; for (int count = 0; count < files.length; count++) { + // jarLastModified == 0L means that jar file is not found. + if (jarLastModified > 0L && + (new File(dir + files[count])).lastModified() >= jarLastModified) { + continue; + } + if (true) { System.out.println("Writing " + dir + files[count]); } @@ -131,18 +138,23 @@ private static void loadLibraryFromJar() { } static { - try { - if (DEBUG) { - System.out.println(System.getProperty("java.library.path")); - } - - System.loadLibrary("MLTermPty"); - } catch (UnsatisfiedLinkError e) { - if (DEBUG) { - e.printStackTrace(); - } + if (DEBUG) { + System.out.println(System.getProperty("java.library.path")); + } + if (true) { + // Always load ~/.mlterm/java/*.dll loadLibraryFromJar(); + } else { + try { + System.loadLibrary("MLTermPty"); + } catch (UnsatisfiedLinkError e) { + if (DEBUG) { + e.printStackTrace(); + } + + loadLibraryFromJar(); + } } } diff --git a/uitoolkit/quartz/cocoa.h b/uitoolkit/quartz/cocoa.h index 9d7d17e6..b9d6e0f0 100644 --- a/uitoolkit/quartz/cocoa.h +++ b/uitoolkit/quartz/cocoa.h @@ -28,7 +28,7 @@ void view_fill_with(void *view, ui_color_t *color, int x, int y, u_int width, u_ void view_draw_rect_frame(void *view, ui_color_t *color, int x1, int y1, int x2, int y2); void view_copy_area(void *view, Pixmap src, int src_x, int src_y, u_int width, u_int height, - int dst_x, int dst_y); + int dst_x, int dst_y, int hasAlpha); void view_scroll(void *view, int src_x, int src_y, u_int width, u_int height, int dst_x, int dst_y); diff --git a/uitoolkit/quartz/cocoa.m b/uitoolkit/quartz/cocoa.m index a1a27d8f..83737ece 100644 --- a/uitoolkit/quartz/cocoa.m +++ b/uitoolkit/quartz/cocoa.m @@ -55,7 +55,8 @@ - (void)copyArea:(Pixmap)src :(u_int)width :(u_int)height :(int)dst_x - :(int)dst_y; + :(int)dst_y + :(BOOL)hasAlpha; #if 0 - (void)scroll:(int)src_x:(int)src_y:(u_int)width:(u_int)height:(int)dst_x:(int)dst_y; #endif @@ -1251,13 +1252,19 @@ - (void)copyArea:(Pixmap)src :(u_int)width :(u_int)height :(int)dst_x - :(int)dst_y { + :(int)dst_y + :(BOOL)hasAlpha { CGImageRef clipped = CGImageCreateWithImageInRect( src, CGRectMake(src_x, src_y, width, height)); - CGContextDrawImage( - ctx, - CGRectMake(dst_x, ACTUAL_HEIGHT(uiwindow) - dst_y - height, width, height), - clipped); + if (hasAlpha) { + CGContextSetBlendMode(ctx, kCGBlendModeNormal /* kCGBlendModeMultiply */); + } + CGContextDrawImage(ctx, + CGRectMake(dst_x, ACTUAL_HEIGHT(uiwindow) - dst_y - height, width, height), + clipped); + if (hasAlpha) { + CGContextSetBlendMode(ctx, kCGBlendModeCopy); + } CGImageRelease(clipped); } @@ -1419,8 +1426,8 @@ void view_draw_rect_frame(MLTermView *view, ui_color_t *color, int x1, int y1, } void view_copy_area(MLTermView *view, Pixmap src, int src_x, int src_y, - u_int width, u_int height, int dst_x, int dst_y) { - [view copyArea:src:src_x:src_y:width:height:dst_x:dst_y]; + u_int width, u_int height, int dst_x, int dst_y, int hasAlpha) { + [view copyArea:src:src_x:src_y:width:height:dst_x:dst_y:hasAlpha]; } void view_scroll(MLTermView *view, int src_x, int src_y, u_int width, diff --git a/uitoolkit/quartz/cocoatouch.m b/uitoolkit/quartz/cocoatouch.m index 1a8b9146..92fdf442 100644 --- a/uitoolkit/quartz/cocoatouch.m +++ b/uitoolkit/quartz/cocoatouch.m @@ -79,7 +79,8 @@ - (void)copyArea:(Pixmap)src :(u_int)width :(u_int)height :(int)dst_x - :(int)dst_y; + :(int)dst_y + :(BOOL)hasAlpha; #if 0 - (void)scroll:(int)src_x:(int)src_y:(u_int)width:(u_int)height:(int)dst_x:(int)dst_y; #endif @@ -1307,13 +1308,19 @@ - (void)copyArea:(Pixmap)src :(u_int)width :(u_int)height :(int)dst_x - :(int)dst_y { + :(int)dst_y + :(BOOL)hasAlpha { CGImageRef clipped = CGImageCreateWithImageInRect( src, CGRectMake(src_x, src_y, width, height)); - CGContextDrawImage( - ctx, - CGRectMake(dst_x, ACTUAL_HEIGHT(uiwindow) - dst_y - height, width, height), - clipped); + if (hasAlpha) { + CGContextSetBlendMode(ctx, kCGBlendModeNormal /* kCGBlendModeMultiply */); + } + CGContextDrawImage(ctx, + CGRectMake(dst_x, ACTUAL_HEIGHT(uiwindow) - dst_y - height, width, height), + clipped); + if (hasAlpha) { + CGContextSetBlendMode(ctx, kCGBlendModeCopy); + } CGImageRelease(clipped); } @@ -1449,8 +1456,8 @@ void view_draw_rect_frame(MLTermView *view, ui_color_t *color, int x1, int y1, } void view_copy_area(MLTermView *view, Pixmap src, int src_x, int src_y, - u_int width, u_int height, int dst_x, int dst_y) { - [view copyArea:src:src_x:src_y:width:height:dst_x:dst_y]; + u_int width, u_int height, int dst_x, int dst_y, int hasAlpha) { + [view copyArea:src:src_x:src_y:width:height:dst_x:dst_y:hasAlpha]; } void view_scroll(MLTermView *view, int src_x, int src_y, u_int width, diff --git a/uitoolkit/quartz/ui_imagelib.c b/uitoolkit/quartz/ui_imagelib.c index c65295ca..b88b16af 100644 --- a/uitoolkit/quartz/ui_imagelib.c +++ b/uitoolkit/quartz/ui_imagelib.c @@ -128,7 +128,7 @@ static int check_has_alpha(u_char *image, u_int width, u_int height) { for (y = 0; y < height; y++) { for (x = 0; x < width; x++, p += 4) { - if (*p != 0xff) { + if (*p < 0x80) { return 1; } } diff --git a/uitoolkit/quartz/ui_window.c b/uitoolkit/quartz/ui_window.c index ea5eecf6..3f7fb7df 100644 --- a/uitoolkit/quartz/ui_window.c +++ b/uitoolkit/quartz/ui_window.c @@ -187,17 +187,18 @@ static void clear_margin_area(ui_window_t *win) { } if (win->hmargin > 0 || right_margin > 0) { - view_copy_area(win->my_window, pic, src_x, src_y, win->hmargin, ACTUAL_HEIGHT(win), 0, 0); + view_copy_area(win->my_window, pic, src_x, src_y, win->hmargin, ACTUAL_HEIGHT(win), 0, 0, 0); view_copy_area(win->my_window, pic, src_x + win_width + win->hmargin, src_y, - win->hmargin + right_margin, ACTUAL_HEIGHT(win), win_width + win->hmargin, 0); + win->hmargin + right_margin, ACTUAL_HEIGHT(win), win_width + win->hmargin, 0, + 0); } if (win->vmargin > 0 || bottom_margin > 0) { view_copy_area(win->my_window, pic, src_x + win->hmargin, src_y, win_width, win->vmargin, - win->hmargin, 0); + win->hmargin, 0, 0); view_copy_area(win->my_window, pic, src_x + win->hmargin, src_y + win_height + win->vmargin, win_width, win->vmargin + bottom_margin, win->hmargin, - win_height + win->vmargin); + win_height + win->vmargin, 0); } } else { if (win->hmargin > 0 || right_margin > 0) { @@ -813,7 +814,7 @@ void ui_window_clear(ui_window_t *win, int x, int y, u_int width, u_int height) src_x = src_y = 0; } - view_copy_area(win->my_window, pic, src_x + x, src_y + y, width, height, x, y); + view_copy_area(win->my_window, pic, src_x + x, src_y + y, width, height, x, y, 0); } else { view_fill_with(win->my_window, &win->bg_color, x, y, width, height); } @@ -1135,7 +1136,7 @@ int ui_window_copy_area(ui_window_t *win, Pixmap src, PixmapMask mask, int src_x } view_copy_area(win->my_window, src, src_x, src_y, width, height, dst_x + win->hmargin, - dst_y + win->vmargin); + dst_y + win->vmargin, mask ? 1 : 0); return 1; }