| Author |
Message |
|
|
Post subject: C++/libsigc++ interface for QNX(r) Photon
Posted: May 26, 2006 - 10:16 AM
|
|
Active Member
Joined: Nov 10, 2005
Posts: 10
|
|
Check it out on
http://www.sourceforge.net/projects/photon-cxx
This is 'planing' preview release, so if you find my ideas intersting (bringed by gtkmm interface for GTK+) let me know here or email at iakovz@gmail.com
It is assumed that you coded Photon in C, because of the lack of any documentation in the package (im working on it).
thanks in advance!
with best regards,
Yakov & |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: May 27, 2006 - 07:37 AM
|
|
Senior Member
Joined: Sep 27, 2004
Posts: 129
|
|
phab now can't use the language of C++ ? oh my god . I have created a phab project from IDE. can I use the c++ , because now I have serval c++ files (which contain class and exception). and I want to use them in ths phab project .
how can I solve this problem . Thanks a lot |
Last edited by dxwang on May 30, 2006 - 01:48 AM; edited 1 time in total
|
| |
|
|
|
 |
|
|
Post subject: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: May 27, 2006 - 07:40 AM
|
|
Senior Member
Joined: Sep 27, 2004
Posts: 129
|
|
I have downloaded the interface you provided , and I have a try .still not solve my problem . In proto.h ,may errors occur. such as :
void A::b() ;// error: parse error before ':'
any advice will be appreciated .Thanks! |
Last edited by dxwang on May 30, 2006 - 02:09 AM; edited 1 time in total
|
| |
|
|
|
 |
|
|
Post subject: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: May 29, 2006 - 06:37 AM
|
|
Active Member
Joined: Nov 10, 2005
Posts: 10
|
|
Hi,
>> I have downloaded the interface you provided , and I have a try .still not solve my problem . In proto.h ,may errors occur. such as :
void A::b() ;// error: parse error before ':'
who can help me .Thanks!
There several ways to use C++ with PhAB projects. One of them if doing like this. You create project, setup to use C++ source, make callbacks static AND DO _NOT_ generate proto.h (there was option in PhAB, you should check it out). This is a rather nasty way..
The second way is to use my interface. Like this
1. create dummy project
2. draw you GUI modules in PhAB in this dummy Project
3. save all changes
4. extract *.wgt? files from project (you'll need them only)
5. write code using my interface:
5a. when you want to realize GUI module from your code you write
>> Wgt* myModule = Wgt::create ("path to the module *.wgt? file", "root container widget name");
Here you'v created _copy_ of widget from your module. Now you can extract widgets and realize/reparent them where you want:
like so:
Window* main_window;
myModule->get_widget ("base", main_window);
... / arrange main_window -- _bear_ in mind that all design from PhAB is already in main_window widget hierarchy /
...
main_window->realize ();
You can access properties of widgets (see: headers).
There also compatible interface to load PtWidget_t* from files: see Wgt.h
Feel free to post here any suggestions comments!!
//wbr |
|
|
| |
|
|
|
 |
|
|
Post subject: Re: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: May 30, 2006 - 03:06 AM
|
|
Senior Member
Joined: Sep 27, 2004
Posts: 129
|
|
hi yakov , firstly very Thanks for your help! But I still can't understand fully. I am a little beef-witted,
I will express the structure of my program clearly now. I have created a phab project from IDE. the question is I have some classes with exception in my.h and my.cpp. now I still not use these classes. just import them. then I try to compile the project. but in proto.h. some errors like int A:b() occur. the next step is that I will use these classes in some callback function.
yakov wrote:
One of them if doing like this. You create project, setup to use C++ source, make callbacks static AND DO _NOT_ generate proto.h (there was option in PhAB, you should check it out). This is a rather nasty way..
/////////it means that any callback that will use these classes must be static ? and I didn't find the option for DO _NOT_ generate proto.h to set . can you explain it in more detail ? very Thanks! //////////////
The second way is to use my interface. Like this
1. create dummy project // dummy ?
2. draw you GUI modules in PhAB in this dummy Project
3. save all changes
4. extract *.wgt? files from project (you'll need them only)//???
5. write code using my interface:
5a. when you want to realize GUI module from your code you write
>> Wgt* myModule = Wgt::create ("path to the module *.wgt? file", "root container widget name");
Here you'v created _copy_ of widget from your module. Now you can extract widgets and realize/reparent them where you want:
like so:
Window* main_window;
myModule->get_widget ("base", main_window);
... / arrange main_window -- _bear_ in mind that all design from PhAB is already in main_window widget hierarchy /
...
main_window->realize ();
You can access properties of widgets (see: headers).
There also compatible interface to load PtWidget_t* from files: see Wgt.h
Feel free to post here any suggestions comments!!
//wbr
the second method I am very confused . can you give me a example code . Thanks my email is: dxwang@mail.ustc.edu.cn
I have put libphotonmm.so.0.1.0 under the directory /usr/local/lib .
and put proc prop.h photonmm photomm.h under the /usr/local/include which directory I created.
In IDE,I have added the extra libs path and include path.
Thank again! |
|
|
| |
|
|
|
 |
|
|
Post subject: Re: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: May 30, 2006 - 03:23 AM
|
|
QNX Master
Joined: Sep 01, 2002
Posts: 2753
|
|
[quote="dxwang"]hi yakov , firstly very Thanks for your help! But I still can't understand fully. I am a little beef-witted, :lol:
I will express the structure of my program clearly now. I have created a phab project from IDE. the question is I have some classes with exception in my.h and my.cpp. now I still not use these classes. just import them. then I try to compile the project. but in proto.h. some errors like int A:b() occur. the next step is that I will use these classes in some callback function.
[quote="yakov"]
Proto.h is included by all .c and .cc file. Obviously if you have C++ code included from proto.h it will create problem when proto.h is included from a C file.
Maybe the solution would be to wrap the C++ code in #if __cplusplus / #endif.
Then make sure the callback that will call C++ object are .cc files
Mario |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: May 30, 2006 - 07:59 AM
|
|
Senior Member
Joined: Sep 27, 2004
Posts: 129
|
|
Proto.h is included by all .c and .cc file. .cc also a c++ file . can I change the .cpp to .cc . if do this, it's necessary to add#if __cplusplus / #endif.
if not, the whole .h .cpp are all c++ code . where to add #if __cplusplus / #endif is reasonable ? Thanks |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: May 30, 2006 - 09:29 AM
|
|
Active Member
Joined: Nov 10, 2005
Posts: 10
|
|
Hi,
dxwang, you'v requested for examples. I'm planing to produce 0.2.0 release wich would include:
Docs:
* short tutorial on writing with photonmm from scratch
* tutorial on how to integrate photonmm classes in your current project (PhAB/or other based)
* probably HTML reference in doxygen
* manual on writing custom widgets, custom widget classes with photon/photonmm
Code:
* more widgets would be covered (in progress)
* build system would stabilize
This will be released on 02 June 2006
// wbr
Yakov & |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: May 30, 2006 - 12:31 PM
|
|
QNX Master
Joined: Sep 01, 2002
Posts: 2753
|
|
| .cc files are considered to be C++ files. |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: Jun 01, 2006 - 03:22 AM
|
|
Senior Member
Joined: Sep 27, 2004
Posts: 129
|
|
yakov: now I just to wait for your produce 0.2.0 release?
Do you have some examples about the latest release . Thanks |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: Jun 01, 2006 - 10:46 AM
|
|
Active Member
Joined: Nov 10, 2005
Posts: 10
|
|
|
|
|
 |
|
|
Post subject: RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: Jun 02, 2006 - 02:08 AM
|
|
Senior Member
Joined: Sep 27, 2004
Posts: 129
|
|
yakov: my qnx 6.3.0 isn't formal version . is yours formal and 6.3.0 ?
Thanks |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: Jun 02, 2006 - 07:12 AM
|
|
Active Member
Joined: Nov 10, 2005
Posts: 10
|
|
| what do you mean "formal". I have QNX 6.3.2 professional with service pack level 2. |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon
Posted: Jun 02, 2006 - 07:18 AM
|
|
Active Member
Joined: Nov 10, 2005
Posts: 10
|
|
ofcourse i have formal version.
it is does not matter anyway  |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jun 04, 2006 - 11:34 PM
|
|
Senior Member
Joined: Sep 27, 2004
Posts: 129
|
|
Thanks a lot!  |
|
|
| |
|
|
|
 |
|
|