From 4710155eb2939395a92df16f3d5748188e736746 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 18 Feb 2009 11:26:39 +0000 Subject: [PATCH] 2009-02-18 12:20 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * include/hbextern.ch * common.mak * source/rtl/Makefile * source/rtl/mouse53.c + Added HB_MMIDDLEDOWN() functions, plus MMIDDLEDOWN() alias. These are always available regardless of the CLIP53 compatibility setting. ; TOFIX: K_MM*DOWN events _override_ C5.3 compatible K_MOUSEMOVE events (in GTWVT only), which created an unfortunate incompatibility with our target C5.x compiler when using some specific GT. Ideas are welcome how to fix this. We should probably either send out both codes and let the inkey queue do the filtering as requested by app (we need a new filter then), or remove these event code and generate proper K_MOUSEMOVE events instead. Apps using this these incompatible keycodes are encouraged to replace expressions: '( key == K_KK*DOWN )' with the compatible: '( key == K_MOUSEMOVE .AND. M*DOWN() )' to prepare for the fix. --- harbour/ChangeLog | 24 ++++++++++++++++++++++++ harbour/common.mak | 1 + harbour/include/hbextern.ch | 2 ++ harbour/source/rtl/Makefile | 1 + harbour/source/rtl/mouse53.c | 11 ++++++++--- 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6dda7dba28..9497bafb28 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,30 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-02-18 12:20 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * include/hbextern.ch + * common.mak + * source/rtl/Makefile + * source/rtl/mouse53.c + + Added HB_MMIDDLEDOWN() functions, plus MMIDDLEDOWN() alias. + These are always available regardless of the CLIP53 + compatibility setting. + + ; TOFIX: K_MM*DOWN events _override_ C5.3 compatible + K_MOUSEMOVE events (in GTWVT only), which created + an unfortunate incompatibility with our target + C5.x compiler when using some specific GT. Ideas + are welcome how to fix this. We should probably + either send out both codes and let the inkey queue + do the filtering as requested by app (we need a + new filter then), or remove these event code and + generate proper K_MOUSEMOVE events instead. Apps + using this these incompatible keycodes are encouraged + to replace expressions: + '( key == K_KK*DOWN )' with the compatible: + '( key == K_MOUSEMOVE .AND. M*DOWN() )' to prepare + for the fix. + 2009-02-18 12:17 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbapi.h * harbour/source/vm/hvm.c diff --git a/harbour/common.mak b/harbour/common.mak index 765e575795..2d54b7d1e7 100644 --- a/harbour/common.mak +++ b/harbour/common.mak @@ -577,6 +577,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\mod$(OBJEXT) \ $(OBJ_DIR)\mouse53$(OBJEXT) \ $(OBJ_DIR)\mouseapi$(OBJEXT) \ + $(OBJ_DIR)\mousehb$(OBJEXT) \ $(OBJ_DIR)\mousex$(OBJEXT) \ $(OBJ_DIR)\mtran$(OBJEXT) \ $(OBJ_DIR)\natmsg$(OBJEXT) \ diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index b89de21c4b..cd952c8cd0 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -337,6 +337,7 @@ EXTERNAL DBEXISTS EXTERNAL FIELDLEN EXTERNAL FIELDDEC EXTERNAL FIELDTYPE +EXTERNAL MMIDDLEDOWN /* HiPer-SEEK / CFTS compatible functions */ @@ -896,6 +897,7 @@ EXTERNAL HB_RUN EXTERNAL HB_GETREADVAR EXTERNAL HB_DISABLEWAITLOCKS EXTERNAL HB_MACROBLOCK +EXTERNAL HB_MMIDDLEDOWN EXTERNAL HB_INISETCOMMENT EXTERNAL HB_INIREAD diff --git a/harbour/source/rtl/Makefile b/harbour/source/rtl/Makefile index 7466c10353..dfcba72e24 100644 --- a/harbour/source/rtl/Makefile +++ b/harbour/source/rtl/Makefile @@ -94,6 +94,7 @@ C_SOURCES=\ mod.c \ mouse53.c \ mouseapi.c \ + mousehb.c \ mousex.c \ mtran.c \ natmsg.c \ diff --git a/harbour/source/rtl/mouse53.c b/harbour/source/rtl/mouse53.c index c3bba9c04f..b76628f77e 100644 --- a/harbour/source/rtl/mouse53.c +++ b/harbour/source/rtl/mouse53.c @@ -6,7 +6,7 @@ * Harbour Project source code: * Mouse API * - * Copyright 1999-2001 Viktor Szakats + * Copyright 1999-2009 Viktor Szakats * www - http://www.harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -54,12 +54,12 @@ /* HARBOUR callable interface */ -#ifdef HB_COMPAT_C53 - #define M_BUTTON_LEFT 0 #define M_BUTTON_RIGHT 1 #define M_BUTTON_MIDDLE 2 +#ifdef HB_COMPAT_C53 + HB_FUNC( MPRESENT ) { hb_retl( hb_mouseIsPresent() ); @@ -167,3 +167,8 @@ HB_FUNC( MSETBOUNDS ) } #endif + +HB_FUNC( HB_MMIDDLEDOWN ) +{ + hb_retl( hb_mouseButtonState( M_BUTTON_MIDDLE ) ); +}