Skip navigation.
Home
The QNX Community Portal

View topic - C++/libsigc++ interface for QNX(r) Photon

C++/libsigc++ interface for QNX(r) Photon

Isn't the name clear?

C++/libsigc++ interface for QNX(r) Photon

Postby yakov » Fri May 26, 2006 10:16 am

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 &
yakov
Active Member
 
Posts: 10
Joined: Thu Nov 10, 2005 7:49 am

RE: C++/libsigc++ interface for QNX(r) Photon

Postby dxwang » Sat May 27, 2006 7:37 am

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 Tue May 30, 2006 1:48 am, edited 1 time in total.
dxwang
Senior Member
 
Posts: 129
Joined: Mon Sep 27, 2004 1:39 pm

RE: C++/libsigc++ interface for QNX(r) Photon

Postby dxwang » Sat May 27, 2006 7:40 am

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 Tue May 30, 2006 2:09 am, edited 1 time in total.
dxwang
Senior Member
 
Posts: 129
Joined: Mon Sep 27, 2004 1:39 pm

RE: C++/libsigc++ interface for QNX(r) Photon

Postby yakov » Mon May 29, 2006 6:37 am

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
yakov
Active Member
 
Posts: 10
Joined: Thu Nov 10, 2005 7:49 am

Re: RE: C++/libsigc++ interface for QNX(r) Photon

Postby dxwang » Tue May 30, 2006 3:06 am

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.

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!
dxwang
Senior Member
 
Posts: 129
Joined: Mon Sep 27, 2004 1:39 pm

Re: RE: C++/libsigc++ interface for QNX(r) Photon

Postby mario » Tue May 30, 2006 3:23 am

[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
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon

Postby dxwang » Tue May 30, 2006 7:59 am

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
dxwang
Senior Member
 
Posts: 129
Joined: Mon Sep 27, 2004 1:39 pm

RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon

Postby yakov » Tue May 30, 2006 9:29 am

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 &
yakov
Active Member
 
Posts: 10
Joined: Thu Nov 10, 2005 7:49 am

RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon

Postby mario » Tue May 30, 2006 12:31 pm

.cc files are considered to be C++ files.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon

Postby dxwang » Thu Jun 01, 2006 3:22 am

yakov: now I just to wait for your produce 0.2.0 release?
Do you have some examples about the latest release . Thanks
dxwang
Senior Member
 
Posts: 129
Joined: Mon Sep 27, 2004 1:39 pm

RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon

Postby yakov » Thu Jun 01, 2006 10:46 am

dxwang, check out tracker system here http://sourceforge.net/tracker/?func=ad ... tid=828504
You should submit your requests there! ;)

Thanks in advance

// wbr
Yakov &
yakov
Active Member
 
Posts: 10
Joined: Thu Nov 10, 2005 7:49 am

RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon

Postby dxwang » Fri Jun 02, 2006 2:08 am

yakov: my qnx 6.3.0 isn't formal version . is yours formal and 6.3.0 ?
Thanks
dxwang
Senior Member
 
Posts: 129
Joined: Mon Sep 27, 2004 1:39 pm

RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon

Postby yakov » Fri Jun 02, 2006 7:12 am

what do you mean "formal". I have QNX 6.3.2 professional with service pack level 2.
yakov
Active Member
 
Posts: 10
Joined: Thu Nov 10, 2005 7:49 am

RE: Re: RE: C++/libsigc++ interface for QNX(r) Photon

Postby yakov » Fri Jun 02, 2006 7:18 am

ofcourse i have formal version.

it is does not matter anyway ;)
yakov
Active Member
 
Posts: 10
Joined: Thu Nov 10, 2005 7:49 am

Postby dxwang » Sun Jun 04, 2006 11:34 pm

8) Thanks a lot! :lol:
dxwang
Senior Member
 
Posts: 129
Joined: Mon Sep 27, 2004 1:39 pm

Next

Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 1 guest