Re: Dia plugins and C++



Le Tue, Apr 30, 2002, à 10:35:38AM -0500, Lars Clausen a écrit:
On Tue, 30 Apr 2002, Pierre Pronchery wrote:
Hi,

I'm developping a Dia plugin for 2 weeks now, and I started in C.
I may host it somewhere, but it's very specific and so not interesting
to include directly in Dia project.

Now I'd like to use C++, because I need to build and see special trees
based on my plugin graphical language, and I want to be able to do it
while editing the diagram.

question: can I use both C and C++ in a Dia plugin?
else, can I use C++, or do I have to use C?

I think C++ would work ok, as the function calling works the same for
non-member functions.  You may have to do the inline C {} thing for the
includes, at least.

You mean extern "C" { } ? The OP would have to export all routines expected
by a plug-in with "C" linkage as well. Basically, this means writing plain C
dia objects (OK, with the implementation being done in the temporary
variable of the expression "C++"), and have these also serve as a 
"C++ world-to-C world" translation layer. 

Of course, the linker stage may bring its own set of interesting problems.

        -- Cyrille

-- 
Grumpf.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]