diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ccef6eaeb4..534b80c8f2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,20 @@ The license applies to all entries newer than 2009-04-28. */ +2011-03-01 09:43 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * include/hbgtinfo.ch + * src/rtl/gtwin/gtwin.c + * src/rtl/gtwvt/gtwvt.c + + HB_GTI_ISFULLSCREEN checking and setting inside GTWIN done. + ! Minor fix for GTWVT, code patched to work on Windows 95 (tested). + ; [Aleksander Czajczynski] + + * config/beos/gcc.mk + * config/bsd/clang.mk + * config/bsd/pcc.mk + * config/linux/clang.mk + + add soname specs to some gnu lds [Tamas Tevesz] + 2011-03-01 02:06 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/utils/hbmk2/hbmk2.prg * harbour/config/dos/watcom.mk @@ -36,7 +50,7 @@ sure it cannot exceed maximum string item size * harbour/src/rtl/base64c.c - * generate RTE if encode string size is too big + * generate RTE if encode string size is too big * eliminated unnecessary INT_MAX string limit 2011-02-28 23:21 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) diff --git a/harbour/config/beos/gcc.mk b/harbour/config/beos/gcc.mk index 30f2c67b54..7c45773253 100644 --- a/harbour/config/beos/gcc.mk +++ b/harbour/config/beos/gcc.mk @@ -53,6 +53,6 @@ DFLAGS += -shared $(LIBPATHS) DY_OUT := -o$(subst x,x, ) DLIBS := $(foreach lib,$(HB_USER_LIBS) $(SYSLIBS),-l$(lib)) -DY_RULE = $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE_NVR) && $(LN) $(@F) $(DYN_FILE_CPT) +DY_RULE = $(DY) $(DFLAGS) -Wl,-soname,$(DYN_NAME_CPT) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE_NVR) && $(LN) $(@F) $(DYN_FILE_CPT) include $(TOP)$(ROOT)config/rules.mk diff --git a/harbour/config/bsd/clang.mk b/harbour/config/bsd/clang.mk index 943a185b55..59c536cbe5 100644 --- a/harbour/config/bsd/clang.mk +++ b/harbour/config/bsd/clang.mk @@ -60,6 +60,6 @@ DFLAGS += -shared $(LIBPATHS) DY_OUT := -o$(subst x,x, ) DLIBS := $(foreach lib,$(HB_USER_LIBS) $(SYSLIBS),-l$(lib)) -DY_RULE = $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE_NVR) && $(LN) $(@F) $(DYN_FILE_CPT) +DY_RULE = $(DY) $(DFLAGS) -Wl,-soname,$(DYN_NAME_CPT) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE_NVR) && $(LN) $(@F) $(DYN_FILE_CPT) include $(TOP)$(ROOT)config/rules.mk diff --git a/harbour/config/bsd/pcc.mk b/harbour/config/bsd/pcc.mk index b10454bde2..9fde18ad09 100644 --- a/harbour/config/bsd/pcc.mk +++ b/harbour/config/bsd/pcc.mk @@ -6,27 +6,29 @@ ifeq ($(HB_BUILD_MODE),cpp) HB_BUILD_MODE := c endif -HB_CMP := pcc - OBJ_EXT := .o LIB_PREF := lib LIB_EXT := .a +HB_DYN_COPT := -DHB_DYNLIB -fPIC + CC := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP)$(HB_CCPOSTFIX) CC_IN := -c -CC_OUT := -o$(subst x,x, ) +CC_OUT := -o -CFLAGS += -I. -I$(HB_HOST_INC) -fpic +CFLAGS += -I. -I$(HB_HOST_INC) -# Warning and optimization options are not stable yet #ifneq ($(HB_BUILD_WARN),no) -# CFLAGS += +# CFLAGS += -W -Wall #else -# CFLAGS += +# CFLAGS += -Wmissing-braces -Wreturn-type -Wformat +# ifneq ($(HB_BUILD_MODE),cpp) +# CFLAGS += -Wimplicit-int -Wimplicit-function-declaration +# endif #endif # #ifneq ($(HB_BUILD_OPTIM),no) -# CFLAGS += -O +# CFLAGS += -O3 #endif ifeq ($(HB_BUILD_DEBUG),yes) @@ -34,7 +36,7 @@ ifeq ($(HB_BUILD_DEBUG),yes) endif LD := $(CC) -LD_OUT := -o$(subst x,x, ) +LD_OUT := -o LIBPATHS := $(foreach dir,$(LIB_DIR) $(SYSLIBPATHS),-L$(dir)) LDLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),-l$(lib)) @@ -49,17 +51,6 @@ DFLAGS += -shared $(LIBPATHS) DY_OUT := -o$(subst x,x, ) DLIBS := $(foreach lib,$(HB_USER_LIBS) $(SYSLIBS),-l$(lib)) -# NOTE: The empty line directly before 'endef' HAVE TO exist! -define dynlib_object - @$(ECHO) $(ECHOQUOTE)INPUT($(subst \,/,$(file)))$(ECHOQUOTE) >> __dyn__.tmp - -endef -define create_dynlib - $(if $(wildcard __dyn__.tmp),@$(RM) __dyn__.tmp,) - $(foreach file,$^,$(dynlib_object)) - $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ __dyn__.tmp $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE_NVR) && $(LN) $(@F) $(DYN_FILE_CPT) -endef - -DY_RULE = $(create_dynlib) +DY_RULE = $(DY) $(DFLAGS) -Wl,-soname,$(DYN_NAME_CPT) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE_NVR) && $(LN) $(@F) $(DYN_FILE_CPT) include $(TOP)$(ROOT)config/rules.mk diff --git a/harbour/config/linux/clang.mk b/harbour/config/linux/clang.mk index 943a185b55..59c536cbe5 100644 --- a/harbour/config/linux/clang.mk +++ b/harbour/config/linux/clang.mk @@ -60,6 +60,6 @@ DFLAGS += -shared $(LIBPATHS) DY_OUT := -o$(subst x,x, ) DLIBS := $(foreach lib,$(HB_USER_LIBS) $(SYSLIBS),-l$(lib)) -DY_RULE = $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE_NVR) && $(LN) $(@F) $(DYN_FILE_CPT) +DY_RULE = $(DY) $(DFLAGS) -Wl,-soname,$(DYN_NAME_CPT) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE_NVR) && $(LN) $(@F) $(DYN_FILE_CPT) include $(TOP)$(ROOT)config/rules.mk diff --git a/harbour/include/hbgtinfo.ch b/harbour/include/hbgtinfo.ch index 231cb3f184..ac0075af70 100644 --- a/harbour/include/hbgtinfo.ch +++ b/harbour/include/hbgtinfo.ch @@ -77,7 +77,7 @@ #define HB_GTI_KBDALT 12 /* This will get/set the status of the alt-numpad key handling. Default is Enabled. */ -#define HB_GTI_ISSCREENPOS 13 /* Is it full screen GT driver? */ +#define HB_GTI_ISSCREENPOS 13 /* Is full screen cursor positioning supported by GT driver? */ #define HB_GTI_FULLSCREEN HB_GTI_ISSCREENPOS /* Compatibility. Do not use it. */ #define HB_GTI_KBDSUPPORT 14 /* Is it keyboard input supported? */ #define HB_GTI_CLIPBOARDDATA 15 /* Get/Set clipboard */ @@ -143,7 +143,7 @@ #define HB_GTI_INKEYREAD 61 /* Get/Set inkey read block */ #define HB_GTI_ALTENTER 62 /* Toggles Alt+Enter as full screen switch (supported by: GTWVT) */ -#define HB_GTI_ISFULLSCREEN 63 /* Is the GT windows using the full physical display? (supported by: GTWVT) */ +#define HB_GTI_ISFULLSCREEN 63 /* Is the GT windows using the full physical display? (supported by: GTWIN, GTWVT) */ /* Font weights */ #define HB_GTI_FONTW_THIN 1 diff --git a/harbour/src/rtl/gtwin/gtwin.c b/harbour/src/rtl/gtwin/gtwin.c index 89ab498467..b7f2b02f0e 100644 --- a/harbour/src/rtl/gtwin/gtwin.c +++ b/harbour/src/rtl/gtwin/gtwin.c @@ -136,6 +136,18 @@ # define MOUSE_WHEELED 0x0004 #endif +#ifndef CONSOLE_FULLSCREEN_HARDWARE +# define CONSOLE_FULLSCREEN_HARDWARE 2 +#endif + +#ifndef CONSOLE_FULLSCREEN_MODE +# define CONSOLE_FULLSCREEN_MODE 1 +#endif + +#ifndef CONSOLE_WINDOWED_MODE +# define CONSOLE_WINDOWED_MODE 0 +#endif + /* To disable mouse, initialization was made in cmdarg.c */ @@ -1805,12 +1817,63 @@ static HB_BOOL hb_gt_win_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const cha /* *********************************************************************** */ +static HB_BOOL hb_gt_win_IsFullScreen() +{ + DWORD dwModeFlags; + typedef BOOL ( WINAPI * P_GCDM )( LPDWORD ); + + P_GCDM pGetConsoleDisplayMode = ( P_GCDM ) + GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), + "GetConsoleDisplayMode" ); + + if( pGetConsoleDisplayMode && pGetConsoleDisplayMode( &dwModeFlags ) ) + { + if( dwModeFlags & CONSOLE_FULLSCREEN_HARDWARE ) + return HB_TRUE; + } + + return HB_FALSE; +} + +/* *********************************************************************** */ + +static HB_BOOL hb_gt_win_FullScreen( HB_BOOL bFullScreen ) +{ + typedef BOOL ( WINAPI * P_SCDM )( HANDLE, DWORD, LPDWORD ); + + P_SCDM pSetConsoleDisplayMode = ( P_SCDM ) + GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), + "SetConsoleDisplayMode" ); + + if( pSetConsoleDisplayMode ) + { + if( bFullScreen ) + return pSetConsoleDisplayMode( s_HOutput, CONSOLE_FULLSCREEN_MODE, NULL ); + else + return !pSetConsoleDisplayMode( s_HOutput, CONSOLE_WINDOWED_MODE, NULL ); + } + + return HB_FALSE; +} + +/* *********************************************************************** */ + static HB_BOOL hb_gt_win_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) { HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Info(%p,%d,%p)", pGT, iType, pInfo ) ); switch( iType ) { + case HB_GTI_ISFULLSCREEN: + pInfo->pResult = hb_itemPutL( pInfo->pResult, hb_gt_win_IsFullScreen() ); + if( hb_itemType( pInfo->pNewVal ) & HB_IT_LOGICAL ) + { + HB_BOOL bNewValue = hb_itemGetL( pInfo->pNewVal ); + if( hb_itemGetL( pInfo->pResult ) != bNewValue ) + hb_gt_win_FullScreen( bNewValue ); + } + break; + case HB_GTI_ISSCREENPOS: case HB_GTI_KBDSUPPORT: pInfo->pResult = hb_itemPutL( pInfo->pResult, HB_TRUE ); diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index 5c1ba0d8be..4baaf9f50b 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -1938,6 +1938,10 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT ) #ifdef MONITOR_DEFAULTTONEAREST HMONITOR mon; MONITORINFO mi; + typedef HMONITOR ( WINAPI * P_MFW )( HWND, DWORD ); + typedef BOOL ( WINAPI * P_GMI )( HMONITOR, LPMONITORINFO ); + P_MFW pMonitorFromWindow; + P_GMI pGetMonitorInfo; #endif pWVT = HB_GTWVT_GET( pGT ); @@ -1982,11 +1986,23 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT ) rt.bottom = 0; #ifdef MONITOR_DEFAULTTONEAREST - mon = MonitorFromWindow( pWVT->hWnd, MONITOR_DEFAULTTONEAREST ); - mi.cbSize = sizeof( mi ); - GetMonitorInfo( mon, &mi ); + pMonitorFromWindow = ( P_MFW ) + GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ), + "MonitorFromWindow" ); + pGetMonitorInfo = ( P_GMI ) + GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ), + "GetMonitorInfo" ); - rt = mi.rcMonitor; + if( pMonitorFromWindow && pGetMonitorInfo ) + { + mon = pMonitorFromWindow( pWVT->hWnd, MONITOR_DEFAULTTONEAREST ); + mi.cbSize = sizeof( mi ); + pGetMonitorInfo( mon, &mi ); + rt = mi.rcMonitor; + } + else + GetClientRect( GetDesktopWindow(), &rt ); + #else GetClientRect( GetDesktopWindow(), &rt ); #endif @@ -2220,9 +2236,8 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) pInfo->pResult = hb_itemPutL( pInfo->pResult, pWVT->bFullScreen ); if( hb_itemType( pInfo->pNewVal ) & HB_IT_LOGICAL ) { - if( ( hb_itemGetL( pInfo->pNewVal ) && !pWVT->bFullScreen ) - || ( !hb_itemGetL( pInfo->pNewVal ) && pWVT->bFullScreen ) ) - hb_gt_wvt_FullScreen( pGT ); + if( hb_itemGetL( pInfo->pNewVal ) != pWVT->bFullScreen ) + hb_gt_wvt_FullScreen( pGT ); } break;