[Harbour] is the list working

2010-06-11 Thread francesco perillo
... I don't receive anything
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] To Francesco Perillo - Send again the patch for QTreeWidget, etc.

2010-06-11 Thread francesco perillo
 Hello Francesco

 Please send again the patch for QTreeWidget and family of
 classes to be included in .qth. You were right in your
 assertions.

Message received, I'll do it later this evening
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] Possible problem in wapi_shellexecute

2010-05-28 Thread francesco perillo
According to this microsoft page:
http://msdn.microsoft.com/en-us/library/bb762153%28VS.85%29.aspx
the third parameter (filename) is mandatory but in wapi_shellexecute
it is not...
HB_PARSTR( 3, hFile  , NULL ),
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Building libs with hbmk2

2010-05-23 Thread francesco perillo
 So, if indeed everything is linked, it can only be the
 result of real references.

I started a new build in a new fresh checkout area and it seems ok now.

Sorry
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] Building libs with hbmk2

2010-05-21 Thread francesco perillo
I have this .hbp file:
-trace
-info
-hblib
-omylib
-inc
-workdir=hbobj
-iInclude
-prgflag=-b

and then a list of about 20 source files.


this files are compiled and I find the .obj files in directory hbobj

From these files a mylib.lib is assembled.

Now I'm linking this library in a program using -lmylib and I find the
linker loads the WHOLE mylib.lib, not just the used functions... is it
normal ?

I'm using Harbour 2.0 and bcc5.5
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] To Harbour linux experts

2010-05-20 Thread francesco perillo
Hi Bruno,

$? returns the errorlevel set by the program, not just 0 and 1... 0 is
the standard for error-less returns.

 But when I run an external aplicattion this variable don't generate a
 usefull value

 in example an hbmk2 command .

 Anybody have an idea in how to achieve this task ?

I don't really understand what you mean

hbmk2 should return a value, we may ask Viktor what to return the
value the external program returns... let's say gcc returns 1 to
signal a problem, hbmk2 should return 1
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: SF.net SVN: harbour-project:[14538] trunk/harbour

2010-05-20 Thread francesco perillo
 Because I was simply starting to explore, and my development times are never
 on the same macine ever, I want it to be resident of hbide/qscintilla so I
 could
 access it on whatever I machine I am currently with.

If you want I can provide access to a Mercurial repository that can be
public or password-protected. Mercurial is a distributed version
control very easy to use...
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: SF.net SVN: harbour-project:[14538] trunk/harbour

2010-05-20 Thread francesco perillo
You can download and install the gui and cli program from here:
http://sourceforge.net/projects/tortoisehg/

There are 3 types of repository:
public: everybody can pull (checkout) /push (commit and push)
readonly: everybody can read, only authorized people can push
private: only authorized people can access

I can provide a preadonly or private repository.


Official mercurial site is here: http://mercurial.selenic.com/
To have a crash-course you can start from here: http://hginit.com/
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[14518] trunk/harbour

2010-05-18 Thread francesco perillo
Line blocks are the yy command in vi ? And the p/P for paste ? I use
it always (I don't know how to do other types of cut/paste in vi)

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: Res: Res: [Harbour] tipclientsmtp problem with MT

2010-05-16 Thread francesco perillo
Fernando, I told you to remove the password  :-)

From your first message:
20100514-10:05:23  :INETSENDALL( pointer, 25, HELO myn...@gmail.comcrlf
)
 25 
From today message:
20100515-21:31:32  :INETSENDALL( pointer, 35, EHLO
fjsiste...@fjsistemas.com.br
crlf )
 35 

Since EHLO command is sent only from :OpenSecure there should be some
parameters of hb_sendmail that toggle it, different from the gmail.prg
sample.


About the MT problem... when the client connects to a smtp server it must
wait for a 220space message that signals the smtp server is ready (5xx
messages signal server is not ready). It does it ST mode...
In MT it seems the connect - probably due to the ssl library - doesn't get
the server reply and that only after sending the QUIT (after the timeout) it
gets the 220...

I did some changes in sendmail.prg code about it, since it did not respect
RFC... I did not check the ssl part since I have openssl installed... I will
try to install today.

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: SF.net SVN: harbour-project:[14476] trunk/harbour

2010-05-16 Thread francesco perillo
I use vi (actually, vim) on both windows and linux... I used to use E2
(was it pe2??) I was given in 1987 by some programmers I met... it
could do block copy/paste, I don't remember how but it could do... you
could also select a box on the screen and then add borders...
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: SF.net SVN: harbour-project:[14476] trunk/harbour

2010-05-16 Thread francesco perillo
Alt-b now I remember...

 Actually PE2 still exists:
http://www.pe32.com

Nice to know !!!

About the integrated editor... notepad++ is a windows only editor
based on Scintilla Scintilla works both in Windows and Linux and
so it cuold be used as a base editor... but hbide was a project for
born to show hbqt potentials...

I don't want to talk about hbIde since I run it just to check the
memory release problem... I don't know, for example, how to import a
project that I work on that is hbmk2 based...
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] tipclientsmtp problem with MT

2010-05-15 Thread francesco perillo
yes the message come to the list.

I want to say that the code of sending mails with hbtip is far from
perfect and not always follows SMTP protocol and best practices...

Anyway, to be short, try port 587 and not 465... I can't get a proper
reply from their servers on 465 so the connection goes timeout (10
seconds) and aborts... the strange thing is that you get the 220
message after the QUIT...

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] How to update commits using SVN - Newbie question.

2010-05-15 Thread francesco perillo
I confirm that TortoiseSVN doesn't have a command-line svn. You have
to go via gui I didn't check but in order to commit you must be
enabled.
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: Res: Res: [Harbour] tipclientsmtp problem with MT

2010-05-15 Thread francesco perillo
I don't have openssl installed... is it just ok to install it and
point to it and rebuild harbour ?

@Fernando:
I did try to analyze your logs... are they complete or are some lines missing ?

If I telnet to port 465 I receive no data from the server... I also
checked with a tcpdump... so it's strange that in what you call the
log without error you get a 220 mx.google.com ESMTP
x34sm670731qce.15 without first sending some more commands... It may
be that some data is sent to the server not using INETSENDALL so it is
not logged...


I need to install openssl before further investigation

Francesco

In the meanwhile I found this:

 587 uses a TLS encryption connection.
 465 uses an SSL encryption connection.
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] tipclientsmtp problem with MT

2010-05-15 Thread francesco perillo
 but with MT returns .F. very slower

 log smtp with error
 20100514-09:29:31  :INETCONNECT( smtp.gmail.com, 465 )
 pointer 

 20100514-09:29:31  :INETERRORCODE( pointer )
  0 

 20100514-09:29:41  :INETRECVLINE( pointer, , 512 )
 NIL 

 20100514-09:29:41  :INETERRORCODE( pointer )
  0 

 20100514-09:29:42  :INETSENDALL( pointer, 6, QUITcrlf )
  6 

 20100514-09:29:42  :INETRECVLINE( pointer, , 512 )
 220 mx.google.com ESMTP 21sm1329732yxe.15 


I DON'T UNDERSTAND why is the server replaying to your QUIT message
with a 220 !

I have some ideas to check but I need to install openssl
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: Res: Res: [Harbour] tipclientsmtp problem with MT

2010-05-15 Thread francesco perillo
I will install openssl tomorrow and I will have a look. Anyway, also
your ok logs don't show that the message is really sent... Can you
please:
1) insert in gmail.prg valid username/password, compile and run it in
both ST and MT mode
2) delete username and password from gmail.prg and logs and send to me

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] tipclientsmtp problem with MT

2010-05-15 Thread francesco perillo
Viktor

 ATM HB_SENDMAIL() is not working at one of my clients,
 but it works at others. The one failing is simple SMTP,
 no SSL or MT mode. HB_SENDMAIL() returns .F. Unfortunately
 I don't have logs. The build in question uses latest hbtip
 code.

Can you please provide a minimal, self-contained, example ?   :-)

A log is necessary to start the debug the protocol  and if the
server refuses the message you may also understand why yourself
because the server will provide some info

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[14454] trunk/harbour

2010-05-10 Thread francesco perillo
What if I want to register menu items ? Or create a toolbar ?

Maybe you can keep a list of active plugins... just don't scan the
directory to load all plugins but you must activate them before and
only the enabled plugins will be opened at startup...

    % Changed: plugins are loaded on first call instead of
      loading all plugins at startup. Now the overhead is negligible.
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[14454] trunk/harbour

2010-05-10 Thread francesco perillo
 IMO it's much better and simpler to use the directory listing.

 If a plugin is not needed, it's enough to move it away.

Me too... but sometimes it's easier to enable/disable from a list...
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[14454] trunk/harbour

2010-05-10 Thread francesco perillo
 It's not worth it.

Ok, I agree. Just scan the directory
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Harbour for the iPad - ok

2010-05-10 Thread francesco perillo
 At least that's Apple's intent. As to how they
 can defend these rules in court, I have no idea.

They will not accept your program in their store...  if you program is
a .99$ one it is a real problem but if you are able to sell one
program in a vertical market for 100.000$... no need of iTunes :-)
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: hbIDE - Plugins

2010-05-09 Thread francesco perillo
Some ideas.

binary format: .hrb, should be platform indipendent and it may be
closed-source...

hbide at startup checks the content of plugin directory where there
will be all the .hrb files. Imagine the file ext.hrb

ext.hrb must contain some mandatory routines, name after the filename,
for example:
ext_init()

hbide loads every hrb file and calls the ext_init(). you must decide
if this function can access hbide internals directly or via a well
defined API (the latter is better).
It must check hbide version, API version, etc...
the plugin can add items in the menu system, add toolbars, menu items
in the right-click menu in the editor, eventuallly register in the
keystroke controller

When invoked, a plugin funcion must be able to access various elements:
a - active source code window
b - a list of source code window
c - source code from a window
d - retrieve the selected lines/block/stream of a window and able to
replace the text
e - retrieve any text of any full row or single char of any source code window
f - able to stuff characters in any position


Imagine some plugins:
- code beautifer ( works on the active window if no text selected, or
on the selection active )
- code converter to apply some conversion (not a search/replace) on
some code, imagine like running sorce code thrpough the pre-processor
to translate COMMIT  to dbCommit(). I once wrote a preprocessor to
import a @ SAY / GET based code to hwgui compatible objects
- some refactoring functions, imagine a function rename from pippo to
pippo2... it must convert the
function pippo
but also all pippo( in all files included in the project... and it
can't be a simple strtran() well, using regexp probably you can...
- refactoring: selecting a DATA pippo line, right-click - refactoring
- create getter/setter: it is necessary to go up in the source code
and get the class name, then go down until the end of class and just
before the closing line adding the
function setPippo( var )
::pippo = var
return ::pippo
function getPippo()
return ::pippo


Just some ideas to give you something to think about, what to expose
to plugins... how it can be done, I don't know

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Harbour for the iPad - ok

2010-05-07 Thread francesco perillo
 Hi
 Are there any license problem to run Harbour on iPad?
 []'s Maniero

Yes, since you have to jailbreak it you are probably breaking apple license...

You are not using official compilers, not following apple guidelines,
not giving money for SDK, not paying fee for selling via their
store
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Harbour for the iPad - ok

2010-05-07 Thread francesco perillo
Viktor, my post was ironic !

 Such experimentation is obviously a technical stunt
 rather than a proper way to create official iPad
 application. It's nevertheless interesting, just like
 running Linux on every possible electronic device.

Yes, I have a frined running linux on his NintendoDS

 [ It would be interesting to see though if it's possible
 to mix the official XCode / iPad SDK Objective-C world
 with Harbour to create real and officially accepted
 applications.

It is clear that officially you can't create applications with other
tools... so I understood...

 (and it still remains a question what
 real benefit does it give to be able to use Harbour
 in such scenario) ]

I'd like to be able to use harbour in one mobile... I will probably
receive a smartphone from office in next weeks and I already have some
ideas... I understand that Windows CE is ok (but with which gt or gui
package)... now iPad (and I believe iPhone is good too)... Android
still missing

Francesco

 Viktor

 ___
 Harbour mailing list (attachment size limit: 40KB)
 Harbour@harbour-project.org
 http://lists.harbour-project.org/mailman/listinfo/harbour

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Vdei creation of harbour-project

2010-05-05 Thread francesco perillo

 [ I run into a problem when converting Harbour
 SVN to Git. At first our 1.0.0rc1 tag got
 created in trunk, which broke its parent
 following logic. ]

I have a repository converted to mercurial and in effect I had the
same problem. I had to give some special parameter to the import
procedure tio not break the flow...


A question I always wanted to ask to you and Prezmek is about your
workflow... how do you handle parallel development, patch management
(hg queue/quilt), debug messages, etc ?
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[14426] trunk/harbour

2010-05-04 Thread francesco perillo
  * contrib/hbqt/hbqt_errorsys.prg
    + Error trace copied to clipboard, requested by Massimo.

This should be active only if a specific option is set... you should
never destroy clipboard content without user permission !!! I could
have hundreds on source code lines in the clipboard 

Better would be to save the error log in a file with a
DATE-TIME-error.txt name  !!!

but not change the clipboard !
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SMB1 and SMB2

2010-04-30 Thread francesco perillo
Enrico,
do a search on past messages. There was a person that had several
serious issues with smb2.

From memory, he solved applyuing a security patch that allowed to
disable smb2...

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SMB1 and SMB2

2010-04-30 Thread francesco perillo
From a thread started by smu johnson on March 3


Well we have a ton of people who still use Windows, and because of
that we need a Windows solution.

I am happy to report that after about 30 mins of Googling, I came
across this page, which solved the problem, if you disable SMB2.


http://blogs.msdn.com/robmar/archive/2009/09/23/get-microsoft-fix-it-for-smb2-issue.aspx

It's amazing, as we have spent countless hours Googling for this
months ago, and relied on .bat files that worked 80% of the time.  So
far, this works 100% of the time.

This is a miracle for us!!!  We've worried for 6 years about this problem.
- Show quoted text -
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SMB1 and SMB2

2010-04-30 Thread francesco perillo
Enrico should answer... I just forwarded the message...

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Patch for Pritpal

2010-04-29 Thread francesco perillo
 The whole point is, if we go this direction,
 I am afraid a lot of .qth have to be changed.

With my hbqtgen patch there is no need to change .qth files, just to
write the specific new functions (that may be automatically generated
once we set the necessary info somewhere)

 Everywhere there is a parent/child relation.

Exactly  -  it should be done when an object becomes owned and we
should also think about what to do when the object is un-owned...

 Probably I do not feel comfortable this way.

May I ask why ?

It's just a bad sensation or are there more technical reasons ?

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] Patch for Pritpal

2010-04-28 Thread francesco perillo
I wanted to create a QTableWidget and populate it with different values.

My code is:

 for i:= 1 to len(aL)
aAdd( oGridItem0x0 ,  )
t := QTableWidgetItem():new()
t:setBackground( oBrushBackItem0x0 )
t:setForeground( oBrushForeItem0x0 )
t:setText( cella +str(i) )
oGrid:setItem( i-1, 0, t )
 next

The result was that only the last cell has value... this happens
because when t is re:New()ed, the previous t is destroyed ... so
::setItem needs  treatment for detaching it when calling setItem

So please apply this patch:

HB_FUNC( QT_QTABLEWIDGET_SETITEM )
{
QGC_POINTER_QTableWidget * q;
QGC_POINTER * p;

HB_TRACE( HB_TR_DEBUG, (Entering QTABLEWIDGET_SETITEM ) );

  q = ( QGC_POINTER_QTableWidget * ) hb_parptrGC( hbqt_gcFuncs(), 1 );
  p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 4 );

  if( p  p-ph  q  q-ph )
  {
 HB_TRACE( HB_TR_DEBUG, ( QT_QTABLEWIDGET_SETITEM() Qt oject: %p
is attached to: %p, ( void * ) p-ph, ( void * ) q-ph ) );
 p-bNew = HB_FALSE;
 ( q-ph )-setItem( hb_parni( 2 ), hb_parni( 3 ), (
QTableWidgetItem * ) p-ph );
  }

}


Francesco

PS: why didn't you use my patch to have the exceptional functions
out of qth files ?
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] Re: Patch for Pritpal

2010-04-28 Thread francesco perillo
A couple more...


QTableWidget_setVerticalHeaderItem
Description: Binary data


QTableWidget_setHorizontalHeaderItem
Description: Binary data
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Patch for Pritpal

2010-04-28 Thread francesco perillo
 Also we agreed that this mechanism will be usedonly where we have
 problem with the destruction mecanism.

not really. this mechanism must be used when a object becomes owned by
some other object to avoid a double destruction...

Probably I should go directly to xbp (I see you wrote tons of code
lines for the browse system) strictly following the published code and
try to never read the source code because I fear that there are some
hacks to overcome some hbqt problems... :-)

 Local aItems := {}
cut
this was the first test I did in order to check that no other problems
were present... and it worked.
But I feel it is not a correct way... since there is no need to store
them from a functional point of view i




  // And destructor
  for each aItm in aItems
     qItm := NIL
  next

 This mechanism has an advantage.
 You have all the control over items spread in different columns,
 and can later deal with them if there is a need of changes, for example,
 if you would like to let it be edited or changing the colors.

I can do this using ::item(row,col) if necessary

 This is how it looks close to Clipper syntax.

But not to c++ samples...


More, some other patches should be done, for example for
QTableWidget::setCellWidget... please read the doc text...

There another probable problem if the patches are not committed... if
you have not compiled my patches try my unmodified sample but change
only:
oGrid:setItem( i-1, 0, t )
to
oGrid:setItem( 0, 0, t ) // all items set at the same place

does it GPF ? with setCellWidget it will according to the doc text

Ciao,
Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: someone uses hbqt for business applications ?

2010-04-24 Thread francesco perillo
 And if you count on me, I will surely provide whatever I could on hbXBP
 front.

Ok, I will do some tests asap.

Thanks,
Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: someone uses hbqt for business applications ?

2010-04-24 Thread francesco perillo
 I've nothing against hbqt.
 The discussion is about using it to create business apps and I pointed
 one problem: many here have a lot of C5x CUI code to convert and hbqt
 does not help.

It is not its job !
hbqt maps the Qt classes, and it's something we must have. Also
hwgui/minigui  have such classes but in hwgui case (I didn't study
minigui code) they are a mess, since a class maps a windows objects
WITH clipper behaviour  hbqt is better on this front, since a
QLineEdit works like a documented QLineEdit widget. And then you can
have hbxbp on top, that encapsulates QLineEdit in a xbpSLE, a bit
misleading name, but with written documentation and some sample code.


We can think about a compatibility layer and base it on hbxbp or
directly on hbqt...


 This is the main problem of
 every GUI library. We tend to forget the basic differences of
 CONSOLE and GUI way of programming flow - program controlled vs
 user controlled. We can mimic the CUI calls to present the interface
 but we _cannot_ mimic the CUI like behavior, viz., ReadModal().

 Here I disagree.

Me too, . But for example in CUI applications with no mouse enabled
you were forced to enter all the on-screen fields (*) so that you
could use VALID/WHEN for side-effects jobs like moving record
pointers, setting variables, etc. With the mouse, you can jump from
field to field... in windows users expect that disabled fields are
grayed (WHEN condition= false) and not just skipped so that you should
evalutate the conditions not just when entering the field (but it can
have side-effects...)


 I have a Fivewin version of my apps since 1998 and I'm still selling
 it.
I don't know fivewin

 It has been relatively easy to reach the point where menus, forms
 and tbrowses are shared between the CUI and GUI. Clearly it required
 some classes, some PP and also some changes in the FW classes code but
 since FW has SAY/GET and TCBROWSE classes it was not so hard.

Is your code using @ GET, or is data-driven based ? In the first case
the only way to go  is with PP (like Massimo has shown) and some glue
classes, in the second case it can be easier (can be, Maurizio warned
about possible coordinates problems)
It would be nice to see two screenshot of the same form of your
application, one from CUI and the other from fivewin...

 Result: I can build the same app as CUI or GUI simply defining a
 __DOS__ or a __WIN__ macro at build time.


 The main point is that FiveWin was planned as a convertion tool for
 C5x code while hbqt is a direct wrapper of C++ classes.

 IMHO hbqt needs a compatibility layer towards C5x UI components (
 and it can't be XBP for the reasons I already explained many times
 before ).

We can think about a compatibility layer and base it on hbxbp or
directly on hbqt...

I don't think it would be a hard job... hwgui already has such layer...

Francesco

(*) I modified the getsys.prg so that when the user presses page-down
all when/valid conditions of following fields are checked
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: someone uses hbqt for business applications ?

2010-04-23 Thread francesco perillo
 This means that a developer needs to change every ROW, COL value to X,
 Y and add the WIDTH value.

Personally, I did some tests in the past with hwgui and used the text
based coordinates as multipliers of font height and width...
WIDTH value can be calculated... code can be taken from the GET
system, since it calculates the screen area to use... just multiply by
font width..

PICTURE are a problem since there is non compatibility with Qt... I
don't use complex picture string, just some @!...
VALID and WHEN are a completely diffent subject since you have to
create a layer that handles object focus... more, I did not understand
if there is already a system (hbxbp???) to interface memory variables
with widgets
Example, setting a variable value inside a widget is easy... but
then the widget must set the new value back, possibly in a clipper
compatible way

Or otherwise we should change programing paradigm, a new style of
programming, at least the screen interface...

 And what about tbrowses, achoices, prompts,
 menus?

Well, if they were incapsulated in your functions, you may try to
adapt them to hbqt...


In the long end, it would be difficult to adapt an old application
without serious changes in the code

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: someone uses hbqt for business applications ?

2010-04-22 Thread francesco perillo
I don't think that it's too early... we may work hard for many
months to have stable hbQt.. but if it doesn't interface with the
clipper way of doing business applications ?

In my code I have a lot of VALID and WHEN and PICTURE... if we don't
think about a way to emulate such functionalities we may be forced to
rewrite too much code...
For QLineEdit we have :inputMask to act like a PICTURE but with a
slighty different syntax... validators may also help...

For VALIDs... should we connect to returnPressed() ? Or FocusOut ? and
FocusIn for WHENs...


I'd just like to receive this code snipped in a hbqt compatible way...
just to understnad what changes are needed for the followinfg code
snippet


procedure main()
local age := 0
local surname := space( 20 )
clear screen
@ 2,2 say Surname:  get surname PICTURE @!
@ 4,2 say Age get age picture 99 when ! empty( surname ) valid  age  = 18
read
? Hello  + surname + ! Your are  + alltrim(str( age )) +  years old

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] someone uses hbqt for business applications ?

2010-04-21 Thread francesco perillo
Now that hbqt seems more stable than before, I'd like to know if
someone is using hbqt for business-type applications, I mean crud
applications, ERP, accounting, etc

Anyone wants to share some screenshots ?

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: hbIDE - Linux Distro - Need some Tips

2010-04-19 Thread francesco perillo
There are a couple of semi-standard way of installing packages in unix

a) tar + manual modification
b) self-executable

a) tar
it's just like a zip, you untar (unzip) it from a specific location
and then set some variables (PATH, ld.conf (pointing to libraries) etc

b) self-executable shell script
There is a feature of the shell script that allows you to write a
file from the program, something like this:
echo  filetowrite  ENDOFTEXT
1
2
3
ENDOFTEXT
This script will create file filetowrite with text enclosed by
ENDOFTEXT In this way you can embed multiple files in one.
The program will also set PATH, add library directory and so on... but
it must do so based on the unix/linux distribution...


HP-UX has a method
Solaris has a method (pkgadd)

Suse and others have rpm
others use apt-get


In order to not have problems a static version is the way to go

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: hbIDE - Linux Distro - Need some Tips

2010-04-19 Thread francesco perillo
 Such a shame :/

Well... tar can be used to read from tapes... and in the past a
command cpio was widely used for installations

 In order to not have problems a static version is the way to go

 Yes. I wonder what dependencies QT libs themselves have?

I remember to have read that there are no strange dependencies other
than standard cpp libraries...

But you need to recompile Qt library and it is not without problems
(and sometimes you won't get a completely static executable)

http://lists.trolltech.com/qt-interest/2008-02/thread00925-0.html
http://chrishowells.co.uk/?p=239

and for windows (I'd prefer to have static executables)
http://blog.lugru.com/2009/03/qt-static-mingwm10dll-and-deployment-under-windows-environment/
http://www.formortals.com/how-to-statically-link-qt-4/
http://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] hbIDE - http://hbide.vouch.info/ - Needed your Reviews

2010-04-19 Thread francesco perillo
 in The Origin this sentence:
 Francesco: suggested to integrate Eclipse which he thought, and others
 supported, is a great tool, but also expressed that he has no knowledge, so
 far, how it can be integrated with Harbour.

It was me... :-) I was just out of an introductory course of Java
ausing Eclipse and found it a very powerfull tool...
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[14341] trunk/harbour

2010-04-17 Thread francesco perillo
Pritpal,
beware about the fact that the QTabWidget.cpp you committed was not
created by the generator, at least not the last one !

In order to change one function, every function was modified

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Pritpal and Vikto, please test this generator

2010-04-15 Thread francesco perillo
Pritpal, I now think that in prg classes we should add destructor and
destroy all the children at harbour level from there, so doing that
ourself  and not leaving the job to Qt

The other test I want to do is to use object.deleteLater() but it is
not a solution, is an hack
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Pritpal and Vikto, please test this generator

2010-04-15 Thread francesco perillo

 Did you test this code ? I think, yes.
 Then prg level :addItem() method is missing, how you solved that?
 Manually writing in TQLayout.prg ?


I have this function in TQLayout.prg
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Pritpal and Vikto, please test this generator

2010-04-15 Thread francesco perillo
Hi to everybody,

I tried to solve the problem starting from the end, the delete... I
wanted to intercept the delete and from the pointer going back to the
harbour QGC_POINTER and nullify it From the end you cover all
cases in a generic way..

Your solution is from another point of view, you disable the delete
statement when GC destructor is called on children  so the only way to
REALLY destroy a child is to wait for parent deletion... this may
solve some problems but, as said and as I understood your sample, we
may have deveral hanging objects...

Is it also necessary to implement the same logic for addWidget, but
also a inverted logic for removeWidget and removeItem...

More, we need to devise a standard way to generate such code from
qth/include files  from the actual generator I think it is very
difficult, we should create an in-memory structure of calls and then
generate code as automatically as possible...

Anyway, congratulations for the finding...

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Pritpal and Vikto, please test this generator

2010-04-15 Thread francesco perillo
 Yes, you are right, this patch is just the first step in the crash hunting.
 The next steps should be oriented to a more general dynamic approach.

This is an important patch because it started a new way for solving GPF...

Now there are several protections against GPFs...

- guarded pointers for objects deriving from QObject
- your way when objects are parented at runtime
- second parameter of *_gcAllocate_* set to false

Still missing is full check on parameter types but Przemek already
gave some ideas...

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] To Istvan

2010-04-15 Thread francesco perillo
Hi Istvan,
in your sample code there is:
HB_FUNC( QT_QLAYOUT_ADDITEM )
{
  QGC_POINTER * p;
  QGC_POINTER * q;

  HB_TRACE( HB_TR_DEBUG, ( Entering function QT_QLAYOUT_ADDITEM() ) );

  q = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 1 );
  p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 2 );

...

hbqt_par_QLayout( 1 )-addItem( hbqt_par_QLayoutItem( 2 ) )



My proposal is to change hb_parptrGC with the proper function call
hbqt_par_QLayout/hbqt_par_QLayoutItem so to apply, in the future,
hierarchy checks...

and
hbqt_par_QLayout( 1 )-addItem( hbqt_par_QLayoutItem( 2 ) )
to
(q)-addItem( p )

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Pritpal and Vikto, please test this generator

2010-04-15 Thread francesco perillo
Istvan,
in hbide.prg please comment all the :destroy() lines, there are a
bunch together... I will try later...

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Test of Hbide build r14331 on Linux Ubuntu 10.04 i get no more GPF errors

2010-04-15 Thread francesco perillo
 sudo apt-get update; sudo apt-get install subversion wget rcs
 build-essential ncurses-dev libslang2-dev tk8.3-dev unixodbc-dev
 libncurses-dev libx11-dev libgpm-dev firebird2.1-dev libfreeimage-dev
 libmysqlclient15-dev libpq-dev libqt3-mt-dev liballegro4.2-dev wine
 dosemu-freedos mingw32 zlib1g-dev libpcre3-dev libncurses-dev libslang2-dev
 libx11-dev libgpmg1-dev unixodbc-dev libcurl4-gnutls-dev firebird2.1-dev
 libgd2-xpm-dev libsqlite3-dev libqt4-dev

the line above downloads and install the packages listed... imagine a
package as a .msi in windows. packages contain files (can be source
code, executable, configuration files, etc)

 Might be useful to set some default, please type this command:
 sudo update-alternatives --set moc /usr/bin/moc-qt4


create directory /home/(username)/src   $HOME is equal to %HOME% in windows
 mkdir $HOME/src
 cd $HOME/src
wget  is to download web pages/files (but also ftp). It downloads the
file MBaggharbour2_svn. It's like a browser text-based.
 wget http://www.elart.it/harbour/MBaggharbour2_svn
sets the permissions so that only you can use this file and execute it
(in unix permissions to execute is a specific permissions... like in
windows hidden we have in linux Read Write Execute)
 chmod 700 MBaggharbour2_svn
execute the file ./MBaggharbour2_svn . Storically the local directory
is not included in the path automatically so you have to indicate a
path . Probaly this file is an auto-install file
 ./MBaggharbour2_svn
 And your system will  be ready to compile hbide
goes to directory /home/(username)/src/harbour/contrib/hbide
 cd $HOME/src/harbour/contrib/hbide
you should know this...
 hbmk2 hbide -rebuild
 to run hbide type:


About apt-get: there is usually the possibility to download/install
different versions of the same package, - something is supported
sometimes not. For example (it's just an example !) you may have
installed Qt3 and Qt4 on the same pc, but only one version of 4 and
3... can't have 4.2 and 4.3 ! (I repeat, it may be ok for Qt but not
for other packages, was just a sample)

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Pritpal and Vikto, please test this generator

2010-04-15 Thread francesco perillo
Sorry Pritpal, you were correct.
In the QLayout.qth file proposed by Istvan the line of addItem is
commented and so the harbour class is not generated...

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Pritpal and Vikto, please test this generator

2010-04-15 Thread francesco perillo
A bit more tracing in the debug log

diff -r 020effeac192 harbour/contrib/hbqt/generatorF/hbqtgen.prg
--- a/harbour/contrib/hbqt/generatorF/hbqtgen.prg   Thu Apr 15
09:56:57 2010 +0200
+++ b/harbour/contrib/hbqt/generatorF/hbqtgen.prg   Thu Apr 15
22:52:42 2010 +0200
@@ -50,6 +50,8 @@
  *
  */
 /*--*/
+
+#define TRACE_QT_CALLS

 #include common.ch
 #include fileio.ch
@@ -1237,7 +1239,9 @@
   aadd( txt_, + cWidget + iif( lList,  void *, ) + * p; )
   aadd( txt_,  )
   aadd( txt_,p = hbqt_par_ + cWidget + ( 1 ); )
-
+#ifdef TRACE_QT_CALLS
+  aadd( txt_, 'HB_TRACE( ' + s_trMode + ', (' +
upper( cWidget ) + '_' + upper( cHBFunc) + ' ) );')
+#endif
   /* Insert parameters by reference */
   IF ! empty( aPre )
  FOR n := 1 TO len( aPre )
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Pritpal and Vikto, please test this generator

2010-04-15 Thread francesco perillo
Since I got GPF in another point (removing the :destroy() part) of the
code (releasing a QToolBar) I used the trace above to see what
function calls were done on that QToolBar... they are
addAction
toggleViewAction
setIcon

at least one of them must have the change you proposed

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Pritpal and Vikto, please test this generator

2010-04-15 Thread francesco perillo
Ok, just for trying to understand how it is possible to proceed and to
validate the idea I did some tests... I was able to remove a GPFs
changing some add* functions.
It was a manual work and I strongly believe it can't be done manually !

Just for reference I post here one of this changed functions, for code review:

HB_FUNC( QT_QMAINWINDOW_ADDTOOLBAR )
{
   QGC_POINTER_QMainWindow * q;
   QGC_POINTER * p;

   HB_TRACE( HB_TR_DEBUG, (QMAINWINDOW_ADDTOOLBAR ) );

   q = ( QGC_POINTER_QMainWindow * ) hb_parptrGC( hbqt_gcFuncs(), 1 );
   p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), 3 );

   if ( p  p-ph  q  q-ph )
   {
 HB_TRACE( HB_TR_DEBUG, ( QT_QMAINWINDOW_ADDTOOLBAR() Qt oject:
%p is attached to: %p, (void *) p-ph, (void *) q-ph) );
 p-bNew = HB_FALSE;
 if ( q  q-ph )
   ( q-ph )-addToolBar( ( Qt::ToolBarArea ) hb_parni( 2 ), ( (
QToolBar *) p-ph ));
 else
   HB_TRACE( HB_TR_DEBUG, ( F=QT_QMAINWINDOW_ADDACTION FP=( q-ph
)-addAction( xx ); q-ph is NULL ));
  }
}

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Test of Hbide build r14331 on Linux Ubuntu 10.04 i get no more GPF errors

2010-04-14 Thread francesco perillo
Marco,
can't you prepare a virtual installation for Pritpal ?

Virtualbox or Vmware client or whatever Pritpal agrees on

I just received a phone call from an experienced windows user that
tried to install ubuntu on one pc and got confused...


I can prepare a vmware virtual machine by the end of next week and put
it on a web server for download...

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Test of Hbide build r14331 on Linux Ubuntu 10.04 i get no more GPF errors

2010-04-14 Thread francesco perillo
On Wed, Apr 14, 2010 at 11:59 AM, marco bra marcobra.ubu...@gmail.com wrote:
 @Francesco Perillo
 Installing Ubuntu in a virtual pc ( i suggest Virtualbox ) inside Windows or
 in a real pc with Windows in dual boot mode is very very very easy...

Marco, I know this (I use linux from the gone floppy days), and for
me and you installing and configuring linux is really easy...
nonetheless this my friend, really really expert on windows side,
installed ubuntu but was not able to get an ip from the dhcp server...
and gave up...

More, in order to have replicable error situations, perhaps it is
better we all settle to use one specific VM (no updates enabled)
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Test of Hbide build r14331 on Linux Ubuntu 10.04 i get no more GPF errors

2010-04-14 Thread francesco perillo
I use suse enterprise server 10 at the office and I STRONGLY suggest
to NOT use it for developing. Infact it misses several libraries,
includes etc

Please use OpenSuse, Ubuntu, Mandriva  whatever you like but DO NOT
use SLES or RedHat advanced server...

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Pritpal and Vikto, please test this generator

2010-04-14 Thread francesco perillo
I'm about to implement a -massivedebug switch to the generator
sample:
HB_FUNC( QT_QPUSHBUTTON_ISFLAT )
{
   QPushButton * p;
   HB_TRACE( HB, ( Entering function QT_QPUSHBUTTON_ISFLAT ) );


and with a bit more knowledge on parameters/object (also thanks to
Viktor generator2) we may also print the parameter passed and the
return value/pointer...


I also created my cppstub with some debug info inside... I need to
print more infos and then match one new with one delete

Ciao
Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: A question on C++

2010-04-13 Thread francesco perillo
Massimo, solution to my other problem will be a side-effect of what
is being worked on now.

Francesco

Massimo, il lavoro che si sta facendo ora, di inserire una migliore
gestione degli oggetti in hbqt, permetterà di adattare il codice dei
costruttori per avere funzioni di overloading... esempio al volo, in
c++ puoi avere due funzioni con lo stesso nome ma TIPI dei parametri
diversi:
funzione( int )
funzione( string, int)
in harbour non puoi, quindi dentro funzione devi controllarti il
numero dei parametri E IL TIPO, cose che fin'ora (o meglio, fino a che
non verrà a breve implementato) non è possibile per gli oggetti di
hbqt
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[14330] trunk/harbour

2010-04-13 Thread francesco perillo
Thank you very much for your work because I think it can go in the
right direction. I didn't study your code yet but I want to ask you
one thing anyway... can may the code be written to be modular and
easily adaptable to various sources ? It may be nice tobe able to
harbour-ize any external library using a generator to create the
interface...  Probably this generator already exists for Harbour but I
never heard of it for example how were created the bindings to
harupdf ?

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Compiling CGI programs and RUN on Apache

2010-04-13 Thread francesco perillo
 [Tue Apr 13 14:46:33 2010] [error] [client 127.0.0.1] malformed header from
 script. Bad header=\x1b[0m\x1b[1;1H\x1b[?25hHTTP/1.0 200 O: testcgi


They seem to be console codes... like if not the correct GT is being used...

You can use wget to get the page and store in a file:
wget -O outputfile http://sitename/url.cgi

in outputfile you have the returned text from the server. Other
than that messy stuff, is there the expected text ?
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: looking for hbqt GPFs...

2010-04-12 Thread francesco perillo
 You tried with hbIDE ?

 If yes, please note that it is now optimized to destroy objects
 in proper way.

Would be possible to disable to optimized destroy to do some tests ?
If yes, please reply privately how it can be done...

Thanks
Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] Re: A question on C++

2010-04-12 Thread francesco perillo
On Mon, Apr 12, 2010 at 2:56 PM, Viktor Szakáts harbour...@syenar.hu wrote:
 Hi,

 Hi Viktor, I was about to send this message to the list when I had a
 shocking vision

 In postgres.c it is NORMAL to discriminate between objects... there is
 no use in passing type X instead of type Y and it must be avoided and
 RTE is good.

 But in Qt we have a HIERARCHY !

 It is perfectly normal to pass a QPushButton to a function that
 expects a QObject !! since QObject is a super-class !

 Since we don't store the object hierarchy Pritpal just checks that
 ClassName() starts with a Q or HB  and keeps the finger crossed...

 That's even worse than handling everything as the base class.

It's not a different situation from c++...

 First I think we need to make sure we can identify the
 class of every GC allocated objects.

If you do this, you need to implement and mantain a class hierarchy in
the code, checking ancestors for every access. And since every Gui
object . Probably as first step we may differentiate between
base-classes: this will avoid some class of problems

Also, we must keep in mind how some methods are redefined
Example from QRadioButton
14 protected functions inherited from QAbstractButton
37 protected functions inherited from QWidget
7 protected functions inherited from QObject
1 protected function inherited from QPaintDevice

If I call qRB:height() actually is called a QWidget:height() that is:
RETURN Qt_QWidget_height( ::pPtr ) that is: hb_retni(
hbqt_par_QWidget( 1 )-height() );
and  hbqt_par_QWidget( 1 )  becomes, in a strict type checking as
per my (unpublished) proposal: hbqt_par_QWidget( 1,
pointer_to_qwidget_destructor )... since ::pPtr was created by
QRadioButton, hbqt_par_QWidget will return NULL

In hbqt_par_QWidget( 1, pointer_to_qwidget_destructor ) we may
implement hierarcht knowledge, or via an iterator (going up the
hierarchy until no more items or an item is found) or via a hasehd
table...



 If we can do this,
 we may make the next step and properly filter accepted
 parameters.

Yes, it may be a next step.

 For this we also need to maintain the layout
 of the QT class hierarchy. This raises other issues, like
 how to keep this in sync with QT version. This information
 BTW is already maintained in HBQT on the .prg level.

Yes, it is, not completely but it is.  (BTW: muliptle inheritance is
possible in harbour ?)

 Another random thought: Maybe it would be worth to
 investigate if it would be useful to merge current
 separate .prg level HBQT class wrappers with low-level
 method implementations on the .cpp level.

low-level method implementations can be merged, and it would be good
to make them static (calling them directly is a way to problems). But
some hbqt_gcAllocate_Q* functions are called from other objects and so
they can't be hidden...

 In Harbour it's possible to create classes purely in .c/.cpp
 code, so this may give performance and may help maintaining
 the whole thing. (see src/rtl/errapi.c)

I saw a library where c code was included in a prg file by a #pragma...

 BTW, if we could properly identify object types, current
 hack of method overloading on the wrapper level could also be
 change for a better solution.

There are easy and not easy solutions, at both c++ and prg code
level In some objects there is already a form of constructor
overriding, as in QRadioButton,
in other similar cases there is no overriding (QPushButton has 3
constructor)

   if( HB_ISCHAR( 1 ) )
  pObj = ( QRadioButton* ) new QRadioButton( hbqt_par_QString( 1
), hbqt_par_QWidget( 2 ) ) ;
   else
  pObj = ( QRadioButton* ) new QRadioButton( hbqt_par_QWidget( 1 ) ) ;


 I mean code like this:
 ---
 HB_FUNC( QT_QTRANSLATOR_TRANSLATE )
 {
   hb_retc( hbqt_par_QTranslator( 1 )-translate( hbqt_par_char( 2 ), 
 hbqt_par_char( 3 ), hbqt_par_char( 4 ) ).toAscii().data() );
 }

 HB_FUNC( QT_QTRANSLATOR_TRANSLATE_1 )
 {
   hb_retc( hbqt_par_QTranslator( 1 )-translate( hbqt_par_char( 2 ), 
 hbqt_par_char( 3 ), hbqt_par_char( 4 ), hb_parni( 5 ) ).toAscii().data() );
 }
transalte declaration is different in Qt 4.6... but maybe it was just
an example...

 ---
 (though in this specific case it could be fixed easily even now)

Yes.

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Improve on hbqt object handling

2010-04-12 Thread francesco perillo
 2nd link I never read but it has little for us.

I sent the wrong link,but anyway it states that they too had problems
with memory deallocations and that it is important that each object
has a parent.

The link I wanted to send warned to never allocate a Qt object on the stack...
some thing like
func x()
{
   QPushButton qpb;
}
but allways use new operator

I'm not saying you are using this, I wanted only to give an info I
found (and you probably already knew)

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] My first study on hbqt code...

2010-04-11 Thread francesco perillo
 If I understand correctly (correct me if not):

 - You intend to create separate hbqt_gcpointer*() calls for
 each object type.

No,  my proposal 1) has just 2 functions, one hbqt_gcpointer for Qt
objects that don't have pq and one hbqt_gcpointer_has_pq for objects
that have one... Proposal 2) keeps only one function but uses bNew to
store if pq is valid or not. Proposal 3) stress it more using QPointer
in place of ph to streamline some routine...

 - To add NULL checking to these functions.

Yes. But Pritpal says that we don't have such cases and the problem is
only in destructor... Infact I proposed that bNew status bits to
better trace what happens...

---

I was also thinking about the possibility of eliminating all the
QGC_POINTER_Q* structures at all and just use QGC_POINTER but with the
addition of pq and bNews used as status... It would add 4 bytes to
each Qt object

All QGC_POINTER_Q* I examined are equal to QGC_POINTER or to
QGC_POINTER plus pq member... I only don't know if it is possibile to
have a generic definition
 QPointer *  pq;

So I believe that each QGC_POINTER_Q* that has no pq member can become
a QGC_POINTER, while for the others that have the pq member a C++
expert should tell if QPointer *  pq; is supported.

I found also a case where QGC_POINTER_QHttpResponseHeader is defined,
but a standard QGC_pointer is used


Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] My first study on hbqt code...

2010-04-11 Thread francesco perillo
 Yes. Plus check TOFIX notes in HBQT code, and it's
 worth to carefully read Przemek's recent quick summary
 of HBQT problems, there are some important issues
 raised there which may help finding the right direction.
 (f.e. confusing/mixing raw pointers with GC collected
 ones, which is another clear GPF situation).

Can you point me to this message ? Date would be enough.

Thanks
Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] My first study on hbqt code...

2010-04-11 Thread francesco perillo
It seems that I'm looking in the right direction

And this one ?

 I also do not see any protection against wrong object casting and
 raw pointer items are accepted what effectively blocks any serious
 cleanups. Few months ago I sent code example which adds such protection
 to this list.


Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Installation of hbide

2010-04-11 Thread francesco perillo
Update from svn...
after harbour-project:[14315] trunk/harbour  should be ok
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] Pritpal, can you commit this more HB_TRACE ?

2010-04-11 Thread francesco perillo
void * hbqt_gcpointer( int iParam )
{
   HB_TRACE( HB_TR_DEBUG, ( hbqt_gcpointer   iParam=%d, iParam ) );
   QGC_POINTER * p = ( QGC_POINTER * ) hb_parptrGC( hbqt_gcFuncs(), iParam );
   if( p  p-ph )
   {
 HB_TRACE( HB_TR_DEBUG, ( hbqt_gcpointer returns p-ph
ph=%p, p-ph ) );
 return p-ph;
   }
   else if( HB_ISPOINTER( iParam ) )
   {
  HB_TRACE( HB_TR_DEBUG, ( hbqt_gcpointer returns hb_parptr(
iParam )  ) );
  return hb_parptr( iParam ); /* TOFIX: In what cases is this
needed? Reference counting to avoid referring to freed pointers? */
   }
   else {
  HB_TRACE( HB_TR_DEBUG, ( HBQT_GCPOINTER RETURNS NULL  ) );
  return NULL; /* TODO: Still better if RTE. */
   }
}


From my logs, you can't RTE because  when you, for example, create a
QPushButton with
hello := QPushButton():new( )
there is a
 pObj = ( QPushButton* ) new QPushButton( hbqt_par_QWidget( 1 ) ) ;

hbqt_par_QWidget( 1 ) is a define to hbqt_gcpointer... if parameter at
harbour level is not present hbqt_gcpointer returns NULL. If the
parameter is mandatory, probably it should be enforced at harbour
class level

Francesco

there is a
HB_TRACE( HB_TR_DEBUG, ( HBQT_GCPOINTER RETURNS NULL  ) );
  return NULL; /* TODO: Still better if RTE. */
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Pritpal, can you commit this more HB_TRACE ?

2010-04-11 Thread francesco perillo
 Maybe it'd be a good idea to also add similar traces to
 hbqt_gcpointerFromItem(), hbqt_pPtrFromItem() and hbqt_pPtrFromObj()
 function.

Yes, of course.
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] Improve on hbqt object handling

2010-04-11 Thread francesco perillo
I have yet another proposal:
in QGC_POINTER_* a new member should be added, call it fingerprint.

Every QObject should be issued a different fingerprint, let's say
QApplication is 1, QPushButton is 2 and so on.
So when we get somehow a QGC_POINTER_* we can get back it's c++ class...
hbqt_gcpointer may accept as second parameter the fingerprint of the
requested object and RTE if not matched it may be 0 to not do any
check...

typedef struct
{
   void * ph;
   bool bNew;
   QT_G_FUNC_PTR func;
   QPointer QPushButton  pq;
   long fingerprint;
} QGC_POINTER_QPushButton;

   p-bNew = bNew;
   p-func = hbqt_gcRelease_QPushButton;
   p-fingerprint = 2 ;

...
#define hbqt_par_QPushButton( n )   ( ( QPushButton
 * ) hbqt_gcpointer( n ) )
becomes
#define hbqt_par_QPushButton( n )   ( ( QPushButton
 * ) hbqt_gcpointer( n , 2 ) )

and hbqt_gcpinter is amended as necessary.

It must be said that hbqt_gcpointer is allways called via the previous
defines. Only in hbqt_destruct.cpp is called directly twice with -1
and a couple of times with iParam...
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: looking for hbqt GPFs...

2010-04-11 Thread francesco perillo
I'm on XP, mingw32 gcc 4.4.-dw2 (TDM-2 mingw32) and Qt sdk 2010.02,
should be Qt 4.6.2
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Improve on hbqt object handling

2010-04-11 Thread francesco perillo
 Let me _repeat_ again:

I know exactly what you have been saying for a long time :-)
this specific proposal was only to do parameter checking

 Problem is not with functioning of the objects,
 that is working perfect. It lies when object is _destructed_
 by Qt and when Harbour tries to _free_ the pointer.

 This is the scenario we should base our findings...

    oWnd contains oPushButton, oMenu's and lot other controls - comples
    parent child hirarchy. Now suppose oWnd goes out of scope, Harbour
    schedules garbage collection and it is not know in what order it will
    release the variables. Assume, oWidget is released first which contains
    many others. Our destructor will be called which in turn will issue
    delete ( QWidget * ) p-ph . The request will reach Qt GC ( they may
 call is
    with another name ) and Qt deletes oWidget and, by its way of
 handellings,
    Qt will also delete all childeren.

Perfect, this is exactly what Qt documentation says. This is normal.
And I checked this via the trace logs.

 The pointers held in Harbour GC of
 those
    children are still there to be released as per same cycle. And voila
 GPF, because
    those are already been freed by Qt.

This should only happen if in this hierarchy there are objects without
QPointer...  if all objects have QPointers then there is something
wrong... If there are objects that are not deriving from QObject so
that they can't have QPointer (is it ever possible for display classes
) I agree with you that this doing a recursion and deleting
objects ourself is the only way unless we overload the delete
operator, take the pointer value, lookup the address (via an HASH ???)
and discover the QGC_POINTER_* whose ph is equal to the pointer value.

in pseudo-code,
in hbqt_gcAllocate_*
  hash[ p-ph ] = p

in  the overloaded delete:
  if ( t := hash[ ptr ] ) {
 t-ph := 0;
 remove hash[ ptr ];
  }

If you accept my first idea to change bNew in a bitmap status you can
 t-bNew |= QT_DELETED ;

In this way you should not care about object destruction order


I just found but not completely understood these two links:
http://silmor.de/33
http://search.cpan.org/~awin/PerlQt-2.105/doc/starting.pod#Object_destruction

Francesco
PS: Qt has an hash class, QHash...
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] My first study on hbqt code...

2010-04-10 Thread francesco perillo
Let's start with

qtgui/QPushButton.cpp

HB_FUNC( QT_QPUSHBUTTON_SETAUTODEFAULT )
{
   hbqt_par_QPushButton( 1 )-setAutoDefault( hb_parl( 2 ) );
}

Since
#define hbqt_par_QPushButton( n )   ( ( QPushButton
 * ) hbqt_gcpointer( n ) )

this line:
hbqt_par_QPushButton( 1 )-setAutoDefault( hb_parl( 2 ) );
becomes:
( ( QPushButton * ) hbqt_gcpointer( 1 ) )-setAutoDefault( hb_parl( 2 ) );

In hbqt_destruct.cpp there is hbqt_gcpointer(). Its job is to return
the pointer to the object.

For every Qt object hbqt actually stores a struct, and in pq member it
stores a guarded pointer that is binded to the object at creation
time. A guarded pointer is a special pointer that is guaranteed to
became NULL if the binded object is deleted. QPointer may only be
created for objects descending from QObject.

Guarded pointers are important since (from what I understood from my
readings) there are many different possibilities for object
destruction, for example using MT, where a thread can delete an object
while another is updating it...

In the objects destructor ( the hbqt_gcRelease_* functions ) pq value
is checked against NULL... But in hbqt_gcpointer it is not... because
in hbqt_gcpointer we just have a generic QGC_POINTER and not the
specific QGC_POINTER_QPushButton so pq is not available...
See:
typedef struct
{
   void * ph;
   bool bNew;
   QT_G_FUNC_PTR func;
   QPointer QPushButton  pq;
} QGC_POINTER_QPushButton;

typedef struct
{
  void * ph;
  bool bNew;
  QT_G_FUNC_PTR func;
} QGC_POINTER;

My idea is then to add a Qpointer placeholder in QGC_POINTER but it
would need some more changes, infact it seems ok for objects in
directory qtgui (they descend from QObject) but not for objects in
qtcore that doesn't inherit from QObject.

So there are 2 possibilities to verify:

1) in hbqt.h change the #define hbqt_par_QPushButton( n )   ( (
QPushButton  * ) hbqt_gcpointerFromQObject( n ) ) for object in qtgui
and then copy hbqt_gcpointer to hbqt_gcpointerFromQObject adding pq
checking (the some for *FromObj) but then how to handle Q_release ?

2) using bNew not as a bool but as a bitmask with values
1=CREATED_BY_NEW 2=HAS_PQ 4=INVALID 8=DELETE_IN_PROGRESS (to
trap/debug strange interactions between c++ delete and harbour GC)
giving us a clear picture of what is happening and also a lot more
status bit to use

Using 2) it may be just a matter of adding the status bit at object
creation and checking the 1-ness of bit 2 before testing pq and some
other trivial changes...


Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: hbqt: a couple of questions

2010-04-09 Thread francesco perillo

 BTW what are exactly : hbqt: a couple of questions ?

1) is there some reason for having s_slots and s_events handled by the
programmer and not hidden someway ?

2) how can I translate 1:1 from c++
QObject::connect( quit, SIGNAL(clicked()), a, SLOT(quit()) );
to harbour/Qt ...


I was translating some C++ sample code in order to do some basic tests
and a simple 8 lines c++ code translated in 20 harbour lines including
the handling of the s_slots variable Also, I could not translate
the connect call - I know owr connect is better but how can I
translate ?

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: hbqt: a couple of questions

2010-04-09 Thread francesco perillo
Hi Pritpal

 1) is there some reason for having s_slots and s_events handled by the
 programmer and not hidden someway ?

 Yes, because in Harbour we are calling Qt classes by function calls
 instead of class/method calls. We cannot call Qt classes directly.
 Though my explanation may appear a bit tough but this is how
 Harbour bindings for Qt are implemented. We are calling Qt classes
 from PRG level and not from C++ level.

I understand that we are using Harbour functions to call C++ functions like
HB_FUNC( QT_SLOTS_CONNECT ) that call a static function connect_signal
that finally does the real connect, for example:
if( signal == ( QString ) clicked() )
   return object-connect( object, SIGNAL(clicked()), t_slots, SLOT(
clicked()), Qt::AutoConnection );

We are passing s_slots from Harbour to connect_signal where it is
HBSlots * t_slots... and this is my concern: WHY are you passing
s_slots back/forth between Harbour and C++ ?

Since from example number 2 slots are used (a Qt program without
slots/events is almost useless..., just a basic display perhaps...)
WHY don't change hbqt_slots.cpp to include a file-wide static variable
s_slots, completely handled by Qt (so no Harbour GC hassle) and then
remove harbour level s_slots variables ?

I know it is a non compatible change (well, it may become compatible
if  you check number of parameters in QT_SLOTS_CONNECT) but it frees
the programmer from the s_slots burden...

There may be only one problem: if Qt may handle multiple slots
lists... something I sincerely don't know... but, properly changing
QT_SLOTS_CONNECT this may be handled too.

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: hbqt: a couple of questions

2010-04-09 Thread francesco perillo
 Perhaps:
  VAR events // in QApplication
 instead of:
  STATIC s_events

 Former is much cleaner. QApplication class
 seems to be a requirement for any HBQT app
 so it seems doable.

 Anyway just ignore this like most other
 suggestions from me. For me it's not a problem.


Or please tell us clearly why this is not possible... I believe Qt is
a great framework, a lot more than a framework and your work (hbide
for example) shows how powerfull it is. And more, Qt is really
documented: web sites, books and a lot of source code available to
study on and it is a REAL PLUS for a harbour gui framework

But if hbqt deviates too much from standard Qt a lot of docs won't
match, code portability from c++ will not be easy
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: hbqt: a couple of questions

2010-04-09 Thread francesco perillo
Hi Pritpal
I think that there is some misunderstanding... I'm not a native
english speaker so I may be confusing some time... I will try to be
more clear i n the future.

A bit about me: I was a programmer, up to about year 2000 my income
was from programming. No more. I only have one copy of a big
application running (started in 1986 in dBase III+) that I ported to
Harbour more for a personal pleasure than for a friend request
(friend, not client). So my point of view may be a bit different from
who uses harbour to earn a living.

I want to add that I spent really many nights on hwgui. I wanted to
use it for a small program I needed for my own use and found myself
involved in its development since I found more and more missing
bits... implementing activeX and filling the many missing bits in the
browse after months of work I didn't use hwgui as the framework
because I still fell is missing something and it misses the most
important part: there is NO documentation !

So when I read about hbqt I was curious, when I tried demoqt I become
interested and when I tried hbide I become addicted ! So I got a
couple of books from the many available on Qt and read them in a few
days. There are more than 20 books listed on Amazon !

So my brain started to think that Qt could solve all my need: a
multi-platform GUI, well documented, well developed, with lots of
goodies inside, with lots of sample code available, tutorials, faq,
etc... and most important to be used like an external library, a
black-box, something that I should not work on. but nonetheless I
offered my help to trace the memory problem (till the comunication
stopped) because I feel that Qt and hbqt is the road to go !

Sorry for the long intro but I though it was due.


 I assume you have some framework in mind to achieve what you say.
 Do you ?

No, I don't have any framework in my mind... Qt is a framework for me.
I don't want to use hbxpp or hbqtcommand at the moment... I'd like to
use pure Qt.

 If yes, please post the code here for review and if the group
 agrees, we will follow that pattern. Also keep in mind that it must be
 backward compatible.

Sorry, Pritpal, I don't have any code since I don't have any framework
in mind... or are you referring to the proposal to hide s_slots in the
code ? I think it is a bit too early for me to modify your code, I
have really basic knowledge about everything works... Infact I
proposed to put s_slots in c++ code and you said that - if I
understood correctly - this is not possible since multitasking
applications may have different s_slots lists... Viktor proposed to
hide s_slots as a VAR in QApplication (actually in TQApplication.prg)
but Qt docs says:
For any GUI application using Qt, there is precisely one QApplication
object, no matter whether the application has 0, 1, 2 or more windows
at any given  I never used MT with harbour so I can't say more on
the subject...
From what I understood from your message it seems that s_events is
unique and so it may be hidden inside harbour class QApplication. But
hiding in a VAR means you have this GC variable passed back and forth
in the calls... why not keep it in C++ code ? Totally handled by Qt ?

 But if you expect this overhaul from me, I am sorry, I did my level
 best to reach to this level and I know how much it is difficult to
 establish code flow to acheive final results something like hbIDE.

 Alternatively, you can start parallel development on this segment
 and send the code here. I am sure someone more conversant with
 C++ will join this effort. For now I am only concentrated on hbIDE.

We all say thank you for your job, we are almost all programmers here
and we know and respect the work you put into hbqt and hbide. About
your idea of concentrating on hbIDE... I respect it but permit me to
not agree with you it seems to me like crossing a river during a
japanese tv game show... one of the stones may be fake and the runner
drop into the water...


To reach your level of knowledge it will take me more than a month,
too much to catch up, and I still miss all the harbour internals ! ...
so my proposal is that you shortly document in some way how all the
stuff is supposed to run, from a qB := QPushButton():new() to the
different cases of object destruction ( qB:destroy(), qB := NIL, qB
out of scope ). With this overview we have this benefits:
- everybody knows how it is supposed to work
- everybody can verify if it really works this way and propose
changes, for example Viktor that has a more in-depth knowledge of
harbour GC internals may spot some missing or inconsistent bits..

What do you think ?

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] To Pritpal and Viktor on problems in hbide compiling

2010-04-08 Thread francesco perillo
 This is not true. What most likely happens is that you
 had a hbqt.ch copied into /include dir by using 'install'
 in the past but not using it after making subsequent
 incremental builds.

True, infact there is a hbqt.ch in /include but it should be updated
by a make install shouldn't it ?


 Even library changes
 are detected. If not, pls report it with '-debuginc'
 (and possibly more details).

Unfortunately the snadbox was updated so we can't get a snapshot.

The only thing I was able to think about Maurizio error is that make
clean install failed, hbqt.ch in /include was not updated, some old
libs were hanging around and doing a hbmk2 hbide.hbp compiled the last
version of hbide with older hbqt.ch headers and probably libs...

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: To Pritpal and Viktor on problems in hbide compiling

2010-04-08 Thread francesco perillo
error was in hbidefindreplace, where Qt_StrongFocus is used... but it
used also in thbqtui.prg...

Maurizio uses a batch file to do a clean/install (the same I use) so
he can't forget... at this point I may only thing that the make did
not complete, the error message is redirected to a file so Maurizio
PROBABLY didn't realize something was not ok

In my reasing it is the only way to have such an error after a make
clean install and hbmk2 hbide.hbp..

I can't think of any other combinations of events...

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: To Pritpal and Viktor on problems in hbide compiling

2010-04-08 Thread francesco perillo
Viktor, your answers are like GOLD, not worthless. Infact you pointed
to the right direction, a hbqt.ch file in /include

What is not normal is that /include/hbqt.ch was not updated by a
make clean install and I was trying to understand what happened to
make the process more straightforward...


I'd add that:

- hbide should be in utils and not in contrib, because it is more a
utility than a library... and it is not normally built by make

- due to recurring problems in compiling hbide that show up in the
mailing list, and Maurizio problem was just an example, there should
be something not idiot-proof in the process and I was trying to help
looking for possible problems.

For example, now I learned that it is better to always set
HB_INSTALL_PREFIX in order to avoid problems, and it is probably a
smart thing to do... I will do some tests later

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: To Pritpal and Viktor on problems in hbide compiling

2010-04-08 Thread francesco perillo
 Well, HB_INSTALL_PREFIX will default to SVN dir
 or system dir on *nix by default (since these are
 the only known dir by the make system). So, if you
 leave it to default, it's much better option to not
 use it at all, as I suggested several times.

So, just a mingw32-make clean all ?

But in order to have a clean situation I completely deleted the
sandbox, did a new checkout and built with a HB_INSTALL_PREFIX...
build failed... I then deleted the sandbox, did a new checkout and
built again... and again it failed


./bin/win/mingw/hbrun.exe --hb:gtcgi ./config/postinst.prg
! Making C:\cvs\harbour\harbour\bin\hbmk.cfg...
! Making shared version of Harbour binaries...
windres.exe: can't open icon file `utils/hbrun/': Permission denied
hbmk2: Error: Running resource compiler. 1

I know that 99.99% is not harbour fault but I'd like to know how I can
trace the build process to see the command line of windres call

I want to repeat that this error started to appear after I deleted the
/include directory (and did an update... ) so that no installed .ch
files were present..

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: R: [Harbour] Re: hbIde error selecting into output console window

2010-04-08 Thread francesco perillo

 PrgVersion() is nowhere called in hbIDE.  OR I am unable to understand you.

In its main program file there is  a function definition
code..
code...
code...
function PrgVersion()
return (a certain value)


When compiling from hbide he gets:
../(path)/(file).a(_ERRSYS.o):_ERRSYS.c:(.data+0x3a8): undefined
reference to `HB_FUN_PRGVERSION'
../(path)/(file).a(_PWD.o):_PWD.c:(.data+0x1e8): undefined reference
to `HB_FUN_PRGVERSION'
collect2: ld returned 1 exit status
hbmk2: Error: Running linker. 1
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] hbqt: a couple of questions

2010-04-08 Thread francesco perillo
This evening I started to study hbqt and I started from the sample
code I found on trolltech site... they are very basic samples based on
qt3 but so simple that they are still valid.
I converted sample 1 in a few minutes... just pay attention to
constructor that in Harbour is not overloaded...
QPushButton hello( Hello world!, 0 );
hello.resize( 100, 30 );
becomes
  hello := QPushButton():new(  )
  hello:setText( Hello, World! )
  hello:resize( 100,30)

Sample 2 adds a connect and it becomes a bit more complicated:
QPushButton quit( Quit, 0 );
quit.resize( 75, 30 );
QObject::connect( quit, SIGNAL(clicked()), a, SLOT(quit()) );

I translated to

   quit := QPushButton():new( )
   quit:setText( Quit! )
   quit:resize( 100,30)
   QT_SLOTS_CONNECT( s_slots, quit, clicked(), {|| MsgInfo( pressed ) } )

and it works... but I had to define and initialize s_slots and there
is no 1:1 match with QObject::connect ( I also added a MsgInfo
function, of course)

So I started to ask myself the necessity to have s_slots and s_events
(whatever you call them) defined and handled by the programmer.
And (I understand that QT_SLOTS_CONNECT has a more powerfull syntax
since it doesn't require you to create SLOT handlers in objects) was
thinking about the correct way to translate the line
QObject::connect( quit, SIGNAL(clicked()), a, SLOT(quit()) );
in harbour/Qt ...

Thanks,
Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] To Pritpal and Viktor on problems in hbide compiling

2010-04-07 Thread francesco perillo
I spent some time with Maurizio trying to investigate the error he had
this MORNING compiling hbide (QT_STRONGFOCUS non existing variable
running hbide). Following his message a reply advised to do a full
clean and compile. This EVENING Maurizio did a svn cleanup, then a
svn update, started the compilation and everything went ok.

I did a grep on today svn and found:
contrib/hbqt/hbqt.ch:#define Qt_StrongFocus 
(actually this define was added in February)

I then saw that hbide source code has
#include hbqt.ch in almost all files

hbide directory is NOT listed in contrib makefile so the make clean
doesn't delete the temporary files
... more, from my tests it seems that hbmk2 doesn't recognize that
hbqt.ch is changed, also if -inc is present (probably because is not
in . but in ../hbqt)

=== so there may be cases when a hbmk2 hbide.hbp is not enough after
a clean/install but a full -rebuild of hbide is necessary

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] To Pritpal

2010-04-03 Thread francesco perillo
Hi Pritpal, Yesterday I sent a message to your private email address
about the GPF... did you receive it ?

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] error compiling from svn

2010-04-02 Thread francesco perillo
For compiling I use

set path=C:\MinGW\bin;c:\qt\qt\bin;c:\cvs\harbour\harbour\bin;%PATH%
 ( %PATH% includes older harbour and bcc compiler)
mingw32-make clean install


From log.txt
! Building Harbour 2.1.0dev from source - http://www.harbour-project.org
! MAKE: mingw32-make 3.81 sh.exe clean install
! HB_HOST_PLAT: win (x86)  HB_SHELL: nt
! HB_PLATFORM: win (x86) (autodetected)
! HB_COMPILER: mingw (autodetected: C:/MinGW/bin/)
cut
gcc-dw2   -I. -I../../../../../include -O3 -fomit-frame-
--- HERE IT CORRECTLY USES gcc-dw2
cut
../../../../../bin/win/mingw/harbour.exe ../../../hbrun.prg
-i../../../../../include -n1 -q0 -w3 -es2 -kmo -i- -l
gcc-dw2   -I. -I../../../../../include -Wall -W -O3
-fomit-frame-pointer -march=i586 -mtune=pentiumpro -DHB_LEGACY_TYPES
_OFF  -DUNICODE  -ohbrun.o -c hbrun.c
windres -O coff   -o hbrun.res ../../../hbrun.rc
gcc non S riconosciuto come comando interno o esterno,
 un programma eseguibile o un file batch.
windres: preprocessing failed.
mingw32-make[3]: *** [hbrun.res] Error 1
mingw32-make[2]: *** [descend] Error 2
mingw32-make[1]: *** [hbrun.inst] Error 2
mingw32-make: *** [utils.inst] Error 2

It ends in this way, saying that gcc is not an executable file... and
infact it should have called gcc-dw2... :-)

Compilation stops...
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] error compiling from svn

2010-04-02 Thread francesco perillo
On Fri, Apr 2, 2010 at 12:14 PM, Viktor Szakáts harbour...@syenar.hu wrote:
 Hi,

 This seems like mingw distro bug. You can try to work it around
 by making sure gcc.exe also exists next to the -dw2 version.
 I think normally it should be there though.

 Or try using official distro if you absolutely need dw2.

 Anyway it's not Harbour problem.

Ok, you are correct (as always :-) ) the problem is in the windres
executable that has a reference to gcc...

Mingw version is from tdm-mingw-1.908.0-4.4.1-2.exe

I solved with a simple copy gcc-dw2.exe gcc.exe

It worked on harbour 2.0 but since then .rc file was added for the
icon and so this problem compared...

thank you,
Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] hbrun broken since a few days at least

2010-03-30 Thread francesco perillo
Maurilio,
use the bisect method... if revision X is ok and revision X+100 is
bad, start checking revision X+50 and you will split the number of
tests by half. Suppose that X+50 is ok, then test X+25... and so on...

Mercurial had a bisect functionality just for this scope...

Francesco

On Tue, Mar 30, 2010 at 5:06 PM, Maurilio Longo
maurilio.lo...@libero.it wrote:
 Przemyslaw,

 at 14236 it is still working... maybe a wrong harbour.dll in my path, but I've
 double-checked and I did not find it and I always do a

 make clean

 before every rebuild.

 I don't know, I'll keep upgrading/rebuilding until I reach current code and
 I'll let you know.

 Maurilio.

 PS. Maybe a copy of it still loaded, since a .dll gets loaded only once and
 then shared between the requesting processes; maybe the system was in an
 internal inconsistent state, I've also restarted it to be sure :/

 Przemysław Czerpak wrote:
 On Tue, 30 Mar 2010, Maurilio Longo wrote:

 Hi,

 Going back at 14230 works ok,
 now I'm rebuilding each one commit from here on, even if reading the 
 ChangeLog
 I don't see changes which could explain my problems.
 I'll let everybody know what I find out.

 Check if it's not caused by shared builds.
 Maybe only binaries using harbour.dll do not work and the problem
 is caused by wrong harbour.dll version.

 best regards,
 Przemek
 ___
 Harbour mailing list (attachment size limit: 40KB)
 Harbour@harbour-project.org
 http://lists.harbour-project.org/mailman/listinfo/harbour


 --
  __
 |  |  | |__| Maurilio Longo
 |_|_|_|| farmaconsult s.r.l.


 ___
 Harbour mailing list (attachment size limit: 40KB)
 Harbour@harbour-project.org
 http://lists.harbour-project.org/mailman/listinfo/harbour

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: hbIDE - On-line documentation-cum-distro update

2010-03-29 Thread francesco perillo
Pritpal,
can you please spend some time trying to write some documentation on
the internals of the interface to Qt ?


It would give others a quick start ...

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] inkey(0) and set key to

2010-03-26 Thread francesco perillo
You can use setkey with one parameter ( the inkey(0) return value) to
check if a codeblock is associated and then invoke it with correct
parameters...


something like this

nCode := inkey( 0 )
(check nCode)
cBlock := setkey ( nCode )
if cBlock
  Eval( cBlock, procfile(1), procname(1), procline(1)  )
endif


if you put the code in a function, like myInkey() 1 should became 2... or 3...
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] hbIDE - Autosave a Source

2010-03-20 Thread francesco perillo
yes, but only IF:
- it is an option not enabled by default
OR
- autosaves to a different file to not overwrite the file on disk

imagine you have your editor open and you go to have a drink, your cat
jumps over the keyboard and deletes some lines of code

Infact both vi editor and ms word autosave to a temporary file with
a different (but similar) name... if the program crashes and you run
it again, the program recognizes that an autosave file is present
and ask you to recover it...


So, again, YES, it is an important feature, but it must be properly
implemented

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: field-(name) in a macro

2010-03-20 Thread francesco perillo
 And since change in more than 800 files?

I don't know your source code but you wrote:
func xxx( name )
local b := ( {|| field-(' + name + ') } )
return eval( b )

so I understand that in your 800 files there are several calls like:
bGet = xxx( surname )

It this is the actual situation, you may try something like:

func xxx( name )
local b := ( {|| FieldGet(FieldPos(' + name + '))} )
return eval( b )

but it only looks in current workarea

If you have FIELD definition for different workareas you may try:

local b := ( {|| field-FieldGet(FieldPos(' + name + '))} )
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] About NoSQL Cassandra

2010-03-19 Thread francesco perillo
I was about to post about MongoDB, another NoSQL database.

With MongoDB you can have different column names for each record
giving the programmer maximum flexibility!
You can do searches but can't do joins. It supports replication and
sharding. It also support server-side operators... something like
$incr counter
instead of
REPLACE counter WITH counter+1

It already has drivers for several languages and I believe it shoudn't
be very difficult to use it.

For more infos: www.mongo.db
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] mingw 4.5.0 benchmarks

2010-03-19 Thread francesco perillo
 Though at least for live builds used by real users
 IMO it's worth to take the pain of a longer build
 to offer a faster working application. It's a one
 time overhead on developer's side and and permanent
 and noticeable gain on the users' side.

No problem for a lng one-time compiler build but I believe
that also prg compilation is slower... hbmk2 incremental helps a lot
but it is anyway a longer edit-compile-debug cycle
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] What about hard-coded make directives?

2010-03-17 Thread francesco perillo
I believe this is what hbc file is for...

On Wed, Mar 17, 2010 at 4:52 PM, pete_westg pete_we...@yahoo.gr wrote:
 Hi,

 I don't know if it is technically easy or even possible to implemented, but
 i think it might be very handy to have inside main .prg one (or more)
 make-time directive(s) instructing hbmk2, about desired compiler options
 and/or libraries inclusion.

 Something like:

 #makeoption /switch1, /switch2, ... /switchN
 and
 #libinclude libhb1, libhb2, ... libhbN
 or
 #using /switch1, /switch2, libhb1, libhb2, ... libhbN

 It could save us (the commandliners particularly) some time and stress-full
 typing of hard to remember switches and lib names. Just a thought..

 ---
 Pete



 ___
 Harbour mailing list (attachment size limit: 40KB)
 Harbour@harbour-project.org
 http://lists.harbour-project.org/mailman/listinfo/harbour

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] hbIDE - Let's review

2010-03-13 Thread francesco perillo
This morning I attended a visual studio 2010 presentation and the
speaker showed us the power of XNA framework (for game development).

He had a pane on the left with a list box containing code snippets.
Double-clicking on one item made VS insert that code (multiline code,
only the first line shown in the listbox) in the source code. He used
this to insert a group of lines in order to explain us what they were
for


I believe that this feature is nice and can be easily accomplished. To
populate the code snippet repository you can make a selection in the
source code and then drag it in the list box... only the first line is
shown in the list box.




On Friday I attented a Spring framework course, using Eclipse I
have to say that Eclipse is a very nice tool and its integration with
Java language is really good.
Today I also saw VS2010 in action and it is also a really good IDE.
Both have very powerfull intellisense, syntax checking (no coloring,
real syntax checking)

Now, can this feature be created in hbide ? ... actually a sort of
compiler is already present in a harbour compiled executable since you
may need to compile codeblock at runtime, so when CR button is pressed
and no ; at the EOL is present, we can pass the line to the compiler
and check for validity... you don't have to execute the code, just do
syntax checking
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] From array/hash to variables ?

2010-03-13 Thread francesco perillo
If I remember well, a couple of weeks ago there was a commit for a
function that enabled to pass from a array/hash to a set of
variables.. ex:
a[b]=1
a[c]=2

function( a )
and now two variables are present:
b=1 and c=2

Was it real or did I dream ?

If it was real, can it be used also for named parameter passing ?

There was a thread in the past for named parameter passing and a
little debate on the possible syntax... I learnt today that C#4 has
this new feature of named parameter passing in the form of:
calledfunction( par1: pippo, par2: 5 )

Francesco
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: hbIDE - Let's review

2010-03-13 Thread francesco perillo
On Sun, Mar 14, 2010 at 1:19 AM, Pritpal Bedi bediprit...@hotmail.com wrote:

 You always remember a name for longer periods.

Tomorrow I will ask my co-workers to show me this feature... actually
I don't know if it is a built-in feature or a plugin... I will tell
you how it really works in VS to populate the code snippet list.

I see this code snippet repository something like a sort of clipboard
on steroids... something that should be really quick and easy to
use...

so don't ask a name for the code, just show the first non-blank line
and, optionally, give the possibility to assign a name to it...

Of course, code snippet repository must be saved between editing sessions



 This is quiet easy if it is only to see if it compiles.

I keep thinking about it and I believe that harbour is a more
difficult code to parse real-time... not impossible, but difficult..

In java (I know very little of Java) a class must be contained in one
source file and they may call other classes that are in the same
package. In order to use classes from other packages you have to
import them. In Harbour you can have several classes in one source
code and there is no package concept...

Java is a typed language and variables must be declared before use, so
you if you have
static Object o;
when you type o. in the editor the intellisense can show all the
proper method...
In harbour you may have valid code that is
o:method and o is never ever declared in the source file it may be
a public/private from some other place !
In C#4 ms  introduced the dynamic data type, a type-less variable type
and infact intellisense can't work on them !



 This is quiet easy if it is only to see if it compiles.
 This is what you are asking for ?

It may be a start

 1. How to handle
      IF abc == 212
      DO CASE
      DO WHILE abc  100
   etc cases. Will these compile?

If you compile one line they should compile AS ONE LINE, they will not
in a file -level

   Also multiline comments. I mean how to determine if
   a line is macro compiled properly.
Macro is a .big. problem

 Above will not compile, not tested,
   but are valid statements. How Eclipse handles them ?

As I said they will compile as single lines, but when the compiler
reaches the EOF it will say that there is missing ENDIF, ENDCASE,
ENDDO...
Another point is that preprocessor mangle the source code and DO WHILE
- while; ENDIF,ENDDO, ENDCASE - end and so on... CLASS definition is
completely transformed in harbour code...
So, it's a real complicated matter...



It's not impossible but very difficult to achieve
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: GC Pointers - Anyway to detatch them ?

2010-03-12 Thread francesco perillo
 Preparing a flow-chart to demonstrate whole hbQT process

It would be great for us beginners in order to catch-up Qt development...
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


  1   2   >