2006-07-16 19:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/ChangeLog
    ! fixed typo in date

  * harbour/doc/gtapi.txt
  * harbour/include/hbgtcore.h
  * harbour/source/rtl/hbgtcore.c
  * harbour/source/rtl/gtgui/gtdef.c
    * changed HB_GT_DEFAULT_<name> to HB_GT_<name>_DEFAULT and added
      REQUEST posibilities so now the GT drivers can be REQUESTed and
      the default one set in similar way.
      F.e.:
         REQUEST HB_GT_WIN
         REQUEST HB_GT_WVT_DEFAULT
         REQUEST HB_GT_STD
      I think that it will be much easier and also using _DEFAULT as suffix
      does not resolve fully 10 character symbol but will work if GT name
      is not longer then 3 characters
This commit is contained in:
Przemyslaw Czerpak
2006-07-16 16:59:43 +00:00
parent 62edb72902
commit 5db88c1acc
5 changed files with 34 additions and 18 deletions

View File

@@ -8,7 +8,26 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2006-07-45 16:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
2006-07-16 23:26 UTC+0200 Enrico Maria Giordano <e.m.giordano@emagsoftware.it>
* source\common\expropt1.c
* Removed unuseful break inside hb_compExprAsSymbol function
2006-07-16 19:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/ChangeLog
! fixed typo in date
* harbour/doc/gtapi.txt
* harbour/include/hbgtcore.h
* harbour/source/rtl/hbgtcore.c
* harbour/source/rtl/gtgui/gtdef.c
* changed HB_GT_DEFAULT_<name> to HB_GT_<name>_DEFAULT and added
REQUEST posibilities so now the GT drivers can be REQUESTed and
the default one set in similar way.
F.e.:
REQUEST HB_GT_WIN
REQUEST HB_GT_WVT_DEFAULT
REQUEST HB_GT_STD
I think that it will be much easier and also using _DEFAULT as suffix
does not resolve fully 10 character symbol but will work if GT name
is not longer then 3 characters

View File

@@ -192,16 +192,14 @@ and:
Most of Windows linkers execute startup initialization code in the
order of linked modules, so the first linked GT driver will be the
default one. But you can control it also from your application, by
defining HB_GT_DEFAULT_<name> symbol (I do not like this name because
requesting HB_GT_<name>_DEFAULT symbol (I do not like this name because
it cannot be used with 10 character symbols so I'm ready for any other
positions). For example, if you add to your code:
ANNOUNCE HB_GT_DEFAULT_NUL
or:
PROC HB_GT_DEFAULT_NUL; RETURN
REQUEST HB_GT_NUL_DEFAULT
Then GTNUL will be the default GT driver, and even if you would not
disable GTWIN and link it with you application, GTWIN will not be
disable GTWIN and link it with your application, GTWIN will not be
activated but GTNUL.
It could be intentional, because if your application is linked with more
@@ -230,13 +228,12 @@ final users, because it allow to integrate GUI library with standard
Clipper screen functions.
How to create such base GUI GT driver?
It's enough take current GTWIN or GTWVT code and remove 90% of the code
from it. That is all, well almost, you have to also set new GT name.
You can use the following as a base for your new GT driver:
TODO: add location of the sample GT driver [Chen]
See as example GTGUI in source/rtl/gtgui/gtgui.c
It supports only TONE and CLIPBOARD operations.
GUI libraries can use it or create other GT driver inheriting from
this one.
NOTE: source/rtl/gtgui/gtdef.c is a hack which overloads the default
Harbour build time GT driver and should not be replicated.
Best regards,
Przemek

View File

@@ -97,7 +97,7 @@
#define HB_GT_ANNOUNCE( id ) HB_GT_ANNOUNCE_( _HB_GT_PREF_( id ) )
#define HB_GT_ANNOUNCE_( id ) HB_GT_ANNOUNCE__( id )
#define HB_GT_ANNOUNCE__( id ) HB_FUNC( id ) {}
#define HB_GT_ANNOUNCE__( id ) HB_FUNC( id ) {} HB_FUNC( id##_DEFAULT ) {}
#define HB_GT_DRVNAME( id ) HB_MACRO2STRING( id )

View File

@@ -85,8 +85,8 @@
#include "hbgtcore.h"
#include "hbinit.h"
HB_GT_REQUEST( GUI );
HB_GT_ANNOUNCE( HB_GT_NAME );
HB_GT_REQUEST( GUI )
HB_GT_ANNOUNCE( HB_GT_NAME )
HB_CALL_ON_STARTUP_BEGIN( _hb_startup_gt_hack_ )
hb_gtSetDefault( "GUI" );

View File

@@ -2751,12 +2751,12 @@ static char * hb_gtFindDefault( void )
for( iPos = 0; iPos < s_iGtCount; iPos++ )
{
sprintf( szFuncName, "HB_GT_DEFAULT_%s", s_gtInit[ iPos ]->id );
sprintf( szFuncName, "HB_GT_%s_DEFAULT", s_gtInit[ iPos ]->id );
if( hb_dynsymFind( szFuncName ) )
return s_gtInit[ iPos ]->id;
}
if( hb_dynsymFind( "HB_GT_DEFAULT_NUL" ) )
if( hb_dynsymFind( "HB_GT_NUL_DEFAULT" ) )
return "NUL";
else
return NULL;