summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2013-01-14 09:39:56 +0000
committerCedric BAIL <cedric.bail@free.fr>2013-01-14 09:39:56 +0000
commitcb4dea0c9e2fd1214349e5554ca85278f0f1225f (patch)
tree616d00109ce321bfb5120ca35f9a6cd7d4aae92a
parentf20d437bd358e38cb5e68a1e049c7f6987191eb6 (diff)
eoxx: let welcome a little prototype of an Eo binding in C++.
That was a long time since I wrote some C++. Review is more than welcome ! But don't forget the goal here, stable API/ABI for as long as the 1.x branch is stable. A lot still need to be done ! NOTE: I would really like that eo_do(NULL, ...) does nothing and still be valid... SVN revision: 82746
-rw-r--r--eoxx/AUTHORS1
-rw-r--r--eoxx/COPYING489
-rw-r--r--eoxx/ChangeLog0
-rw-r--r--eoxx/INSTALL370
-rw-r--r--eoxx/Makefile.am14
-rw-r--r--eoxx/NEWS0
-rw-r--r--eoxx/README7
-rw-r--r--eoxx/TODO7
-rwxr-xr-xeoxx/autogen.sh32
-rw-r--r--eoxx/configure.ac59
-rw-r--r--eoxx/eoxx.pc.in13
-rw-r--r--eoxx/src/Makefile.am1
-rw-r--r--eoxx/src/examples/Makefile.am12
-rw-r--r--eoxx/src/examples/eoxx_test.cc68
-rw-r--r--eoxx/src/lib/Eo.cc9
-rw-r--r--eoxx/src/lib/Eo.hh148
-rw-r--r--eoxx/src/lib/Eo.xx24
-rw-r--r--eoxx/src/lib/Makefile.am22
18 files changed, 1276 insertions, 0 deletions
diff --git a/eoxx/AUTHORS b/eoxx/AUTHORS
new file mode 100644
index 0000000..8266484
--- /dev/null
+++ b/eoxx/AUTHORS
@@ -0,0 +1 @@
Cedric Bail <cedric.bail@free.fr>
diff --git a/eoxx/COPYING b/eoxx/COPYING
new file mode 100644
index 0000000..145182e
--- /dev/null
+++ b/eoxx/COPYING
@@ -0,0 +1,489 @@
1Copyright (C) 2013 Cedric BAIL and various contributors (see AUTHORS)
2
3This library is free software; you can redistribute it and/or modify it
4under the terms of the GNU Lesser General Public License as published by the
5Free Software Foundation; either version 2.1 of the License.
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
10details.
11
12Below is a copy of the GNU Lesser General Public License that is distributed
13along with this library. If you do not have a copy below, write to the Free
14Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
1502110-1301 USA
16
17 GNU LESSER GENERAL PUBLIC LICENSE
18 Version 2.1, February 1999
19
20 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 Everyone is permitted to copy and distribute verbatim copies
23 of this license document, but changing it is not allowed.
24
25[This is the first released version of the Lesser GPL. It also counts
26 as the successor of the GNU Library Public License, version 2, hence
27 the version number 2.1.]
28
29 Preamble
30
31 The licenses for most software are designed to take away your
32freedom to share and change it. By contrast, the GNU General Public
33Licenses are intended to guarantee your freedom to share and change
34free software--to make sure the software is free for all its users.
35
36 This license, the Lesser General Public License, applies to some
37specially designated software packages--typically libraries--of the
38Free Software Foundation and other authors who decide to use it. You
39can use it too, but we suggest you first think carefully about whether
40this license or the ordinary General Public License is the better
41strategy to use in any particular case, based on the explanations below.
42
43 When we speak of free software, we are referring to freedom of use,
44not price. Our General Public Licenses are designed to make sure that
45you have the freedom to distribute copies of free software (and charge
46for this service if you wish); that you receive source code or can get
47it if you want it; that you can change the software and use pieces of
48it in new free programs; and that you are informed that you can do
49these things.
50
51 To protect your rights, we need to make restrictions that forbid
52distributors to deny you these rights or to ask you to surrender these
53rights. These restrictions translate to certain responsibilities for
54you if you distribute copies of the library or if you modify it.
55
56 For example, if you distribute copies of the library, whether gratis
57or for a fee, you must give the recipients all the rights that we gave
58you. You must make sure that they, too, receive or can get the source
59code. If you link other code with the library, you must provide
60complete object files to the recipients, so that they can relink them
61with the library after making changes to the library and recompiling
62it. And you must show them these terms so they know their rights.
63
64 We protect your rights with a two-step method: (1) we copyright the
65library, and (2) we offer you this license, which gives you legal
66permission to copy, distribute and/or modify the library.
67
68 To protect each distributor, we want to make it very clear that
69there is no warranty for the free library. Also, if the library is
70modified by someone else and passed on, the recipients should know
71that what they have is not the original version, so that the original
72author's reputation will not be affected by problems that might be
73introduced by others.
74
75 Finally, software patents pose a constant threat to the existence of
76any free program. We wish to make sure that a company cannot
77effectively restrict the users of a free program by obtaining a
78restrictive license from a patent holder. Therefore, we insist that
79any patent license obtained for a version of the library must be
80consistent with the full freedom of use specified in this license.
81
82 Most GNU software, including some libraries, is covered by the
83ordinary GNU General Public License. This license, the GNU Lesser
84General Public License, applies to certain designated libraries, and
85is quite different from the ordinary General Public License. We use
86this license for certain libraries in order to permit linking those
87libraries into non-free programs.
88
89 When a program is linked with a library, whether statically or using
90a shared library, the combination of the two is legally speaking a
91combined work, a derivative of the original library. The ordinary
92General Public License therefore permits such linking only if the
93entire combination fits its criteria of freedom. The Lesser General
94Public License permits more lax criteria for linking other code with
95the library.
96
97 We call this license the "Lesser" General Public License because it
98does Less to protect the user's freedom than the ordinary General
99Public License. It also provides other free software developers Less
100of an advantage over competing non-free programs. These disadvantages
101are the reason we use the ordinary General Public License for many
102libraries. However, the Lesser license provides advantages in certain
103special circumstances.
104
105 For example, on rare occasions, there may be a special need to
106encourage the widest possible use of a certain library, so that it becomes
107a de-facto standard. To achieve this, non-free programs must be
108allowed to use the library. A more frequent case is that a free
109library does the same job as widely used non-free libraries. In this
110case, there is little to gain by limiting the free library to free
111software only, so we use the Lesser General Public License.
112
113 In other cases, permission to use a particular library in non-free
114programs enables a greater number of people to use a large body of
115free software. For example, permission to use the GNU C Library in
116non-free programs enables many more people to use the whole GNU
117operating system, as well as its variant, the GNU/Linux operating
118system.
119
120 Although the Lesser General Public License is Less protective of the
121users' freedom, it does ensure that the user of a program that is
122linked with the Library has the freedom and the wherewithal to run
123that program using a modified version of the Library.
124
125 The precise terms and conditions for copying, distribution and
126modification follow. Pay close attention to the difference between a
127"work based on the library" and a "work that uses the library". The
128former contains code derived from the library, whereas the latter must
129be combined with the library in order to run.
130
131 GNU LESSER GENERAL PUBLIC LICENSE
132 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
133
134 0. This License Agreement applies to any software library or other
135program which contains a notice placed by the copyright holder or
136other authorized party saying it may be distributed under the terms of
137this Lesser General Public License (also called "this License").
138Each licensee is addressed as "you".
139
140 A "library" means a collection of software functions and/or data
141prepared so as to be conveniently linked with application programs
142(which use some of those functions and data) to form executables.
143
144 The "Library", below, refers to any such software library or work
145which has been distributed under these terms. A "work based on the
146Library" means either the Library or any derivative work under
147copyright law: that is to say, a work containing the Library or a
148portion of it, either verbatim or with modifications and/or translated
149straightforwardly into another language. (Hereinafter, translation is
150included without limitation in the term "modification".)
151
152 "Source code" for a work means the preferred form of the work for
153making modifications to it. For a library, complete source code means
154all the source code for all modules it contains, plus any associated
155interface definition files, plus the scripts used to control compilation
156and installation of the library.
157
158 Activities other than copying, distribution and modification are not
159covered by this License; they are outside its scope. The act of
160running a program using the Library is not restricted, and output from
161such a program is covered only if its contents constitute a work based
162on the Library (independent of the use of the Library in a tool for
163writing it). Whether that is true depends on what the Library does
164and what the program that uses the Library does.
165
166 1. You may copy and distribute verbatim copies of the Library's
167complete source code as you receive it, in any medium, provided that
168you conspicuously and appropriately publish on each copy an
169appropriate copyright notice and disclaimer of warranty; keep intact
170all the notices that refer to this License and to the absence of any
171warranty; and distribute a copy of this License along with the
172Library.
173
174 You may charge a fee for the physical act of transferring a copy,
175and you may at your option offer warranty protection in exchange for a
176fee.
177
178 2. You may modify your copy or copies of the Library or any portion
179of it, thus forming a work based on the Library, and copy and
180distribute such modifications or work under the terms of Section 1
181above, provided that you also meet all of these conditions:
182
183 a) The modified work must itself be a software library.
184
185 b) You must cause the files modified to carry prominent notices
186 stating that you changed the files and the date of any change.
187
188 c) You must cause the whole of the work to be licensed at no
189 charge to all third parties under the terms of this License.
190
191 d) If a facility in the modified Library refers to a function or a
192 table of data to be supplied by an application program that uses
193 the facility, other than as an argument passed when the facility
194 is invoked, then you must make a good faith effort to ensure that,
195 in the event an application does not supply such function or
196 table, the facility still operates, and performs whatever part of
197 its purpose remains meaningful.
198
199 (For example, a function in a library to compute square roots has
200 a purpose that is entirely well-defined independent of the
201 application. Therefore, Subsection 2d requires that any
202 application-supplied function or table used by this function must
203 be optional: if the application does not supply it, the square
204 root function must still compute square roots.)
205
206These requirements apply to the modified work as a whole. If
207identifiable sections of that work are not derived from the Library,
208and can be reasonably considered independent and separate works in
209themselves, then this License, and its terms, do not apply to those
210sections when you distribute them as separate works. But when you
211distribute the same sections as part of a whole which is a work based
212on the Library, the distribution of the whole must be on the terms of
213this License, whose permissions for other licensees extend to the
214entire whole, and thus to each and every part regardless of who wrote
215it.
216
217Thus, it is not the intent of this section to claim rights or contest
218your rights to work written entirely by you; rather, the intent is to
219exercise the right to control the distribution of derivative or
220collective works based on the Library.
221
222In addition, mere aggregation of another work not based on the Library
223with the Library (or with a work based on the Library) on a volume of
224a storage or distribution medium does not bring the other work under
225the scope of this License.
226
227Linking this library statically or dynamically with other modules is
228making a combined work based on this library. Thus, the terms and
229conditions of the GNU General Public License cover the whole combination.
230
231As a special exception, the copyright holders of this library give you
232permission to link this library with independent modules to produce an
233executable, regardless of the license terms of these independent modules,
234and to copy and distribute the resulting executable under terms of your
235choice, provided that you also meet, for each linked independent module,
236the terms and conditions of the license of that module. An independent
237module is a module which is not derived from or based on this library.
238If you modify this library, you may extend this exception to your version
239of the library, but you are not obliged to do so. If you do not wish to
240do so, delete this exception statement from your version.
241
242 3. You may opt to apply the terms of the ordinary GNU General Public
243License instead of this License to a given copy of the Library. To do
244this, you must alter all the notices that refer to this License, so
245that they refer to the ordinary GNU General Public License, version 2,
246instead of to this License. (If a newer version than version 2 of the
247ordinary GNU General Public License has appeared, then you can specify
248that version instead if you wish.) Do not make any other change in
249these notices.
250
251 Once this change is made in a given copy, it is irreversible for
252that copy, so the ordinary GNU General Public License applies to all
253subsequent copies and derivative works made from that copy.
254
255 This option is useful when you wish to copy part of the code of
256the Library into a program that is not a library.
257
258 4. You may copy and distribute the Library (or a portion or
259derivative of it, under Section 2) in object code or executable form
260under the terms of Sections 1 and 2 above provided that you accompany
261it with the complete corresponding machine-readable source code, which
262must be distributed under the terms of Sections 1 and 2 above on a
263medium customarily used for software interchange.
264
265 If distribution of object code is made by offering access to copy
266from a designated place, then offering equivalent access to copy the
267source code from the same place satisfies the requirement to
268distribute the source code, even though third parties are not
269compelled to copy the source along with the object code.
270
271 5. A program that contains no derivative of any portion of the
272Library, but is designed to work with the Library by being compiled or
273linked with it, is called a "work that uses the Library". Such a
274work, in isolation, is not a derivative work of the Library, and
275therefore falls outside the scope of this License.
276
277 However, linking a "work that uses the Library" with the Library
278creates an executable that is a derivative of the Library (because it
279contains portions of the Library), rather than a "work that uses the
280library". The executable is therefore covered by this License.
281Section 6 states terms for distribution of such executables.
282
283 When a "work that uses the Library" uses material from a header file
284that is part of the Library, the object code for the work may be a
285derivative work of the Library even though the source code is not.
286Whether this is true is especially significant if the work can be
287linked without the Library, or if the work is itself a library. The
288threshold for this to be true is not precisely defined by law.
289
290 If such an object file uses only numerical parameters, data
291structure layouts and accessors, and small macros and small inline
292functions (ten lines or less in length), then the use of the object
293file is unrestricted, regardless of whether it is legally a derivative
294work. (Executables containing this object code plus portions of the
295Library will still fall under Section 6.)
296
297 Otherwise, if the work is a derivative of the Library, you may
298distribute the object code for the work under the terms of Section 6.
299Any executables containing that work also fall under Section 6,
300whether or not they are linked directly with the Library itself.
301
302 6. As an exception to the Sections above, you may also combine or
303link a "work that uses the Library" with the Library to produce a
304work containing portions of the Library, and distribute that work
305under terms of your choice, provided that the terms permit
306modification of the work for the customer's own use and reverse
307engineering for debugging such modifications.
308
309 You must give prominent notice with each copy of the work that the
310Library is used in it and that the Library and its use are covered by
311this License. You must supply a copy of this License. If the work
312during execution displays copyright notices, you must include the
313copyright notice for the Library among them, as well as a reference
314directing the user to the copy of this License. Also, you must do one
315of these things:
316
317 a) Accompany the work with the complete corresponding
318 machine-readable source code for the Library including whatever
319 changes were used in the work (which must be distributed under
320 Sections 1 and 2 above); and, if the work is an executable linked
321 with the Library, with the complete machine-readable "work that
322 uses the Library", as object code and/or source code, so that the
323 user can modify the Library and then relink to produce a modified
324 executable containing the modified Library. (It is understood
325 that the user who changes the contents of definitions files in the
326 Library will not necessarily be able to recompile the application
327 to use the modified definitions.)
328
329 b) Use a suitable shared library mechanism for linking with the
330 Library. A suitable mechanism is one that (1) uses at run time a
331 copy of the library already present on the user's computer system,
332 rather than copying library functions into the executable, and (2)
333 will operate properly with a modified version of the library, if
334 the user installs one, as long as the modified version is
335 interface-compatible with the version that the work was made with.
336
337 c) Accompany the work with a written offer, valid for at
338 least three years, to give the same user the materials
339 specified in Subsection 6a, above, for a charge no more
340 than the cost of performing this distribution.
341
342 d) If distribution of the work is made by offering access to copy
343 from a designated place, offer equivalent access to copy the above
344 specified materials from the same place.
345
346 e) Verify that the user has already received a copy of these
347 materials or that you have already sent this user a copy.
348
349 For an executable, the required form of the "work that uses the
350Library" must include any data and utility programs needed for
351reproducing the executable from it. However, as a special exception,
352the materials to be distributed need not include anything that is
353normally distributed (in either source or binary form) with the major
354components (compiler, kernel, and so on) of the operating system on
355which the executable runs, unless that component itself accompanies
356the executable.
357
358 It may happen that this requirement contradicts the license
359restrictions of other proprietary libraries that do not normally
360accompany the operating system. Such a contradiction means you cannot
361use both them and the Library together in an executable that you
362distribute.
363
364 7. You may place library facilities that are a work based on the
365Library side-by-side in a single library together with other library
366facilities not covered by this License, and distribute such a combined
367library, provided that the separate distribution of the work based on
368the Library and of the other library facilities is otherwise
369permitted, and provided that you do these two things:
370
371 a) Accompany the combined library with a copy of the same work
372 based on the Library, uncombined with any other library
373 facilities. This must be distributed under the terms of the
374 Sections above.
375
376 b) Give prominent notice with the combined library of the fact
377 that part of it is a work based on the Library, and explaining
378 where to find the accompanying uncombined form of the same work.
379
380 8. You may not copy, modify, sublicense, link with, or distribute
381the Library except as expressly provided under this License. Any
382attempt otherwise to copy, modify, sublicense, link with, or
383distribute the Library is void, and will automatically terminate your
384rights under this License. However, parties who have received copies,
385or rights, from you under this License will not have their licenses
386terminated so long as such parties remain in full compliance.
387
388 9. You are not required to accept this License, since you have not
389signed it. However, nothing else grants you permission to modify or
390distribute the Library or its derivative works. These actions are
391prohibited by law if you do not accept this License. Therefore, by
392modifying or distributing the Library (or any work based on the
393Library), you indicate your acceptance of this License to do so, and
394all its terms and conditions for copying, distributing or modifying
395the Library or works based on it.
396
397 10. Each time you redistribute the Library (or any work based on the
398Library), the recipient automatically receives a license from the
399original licensor to copy, distribute, link with or modify the Library
400subject to these terms and conditions. You may not impose any further
401restrictions on the recipients' exercise of the rights granted herein.
402You are not responsible for enforcing compliance by third parties with
403this License.
404
405 11. If, as a consequence of a court judgment or allegation of patent
406infringement or for any other reason (not limited to patent issues),
407conditions are imposed on you (whether by court order, agreement or
408otherwise) that contradict the conditions of this License, they do not
409excuse you from the conditions of this License. If you cannot
410distribute so as to satisfy simultaneously your obligations under this
411License and any other pertinent obligations, then as a consequence you
412may not distribute the Library at all. For example, if a patent
413license would not permit royalty-free redistribution of the Library by
414all those who receive copies directly or indirectly through you, then
415the only way you could satisfy both it and this License would be to
416refrain entirely from distribution of the Library.
417
418If any portion of this section is held invalid or unenforceable under any
419particular circumstance, the balance of the section is intended to apply,
420and the section as a whole is intended to apply in other circumstances.
421
422It is not the purpose of this section to induce you to infringe any
423patents or other property right claims or to contest validity of any
424such claims; this section has the sole purpose of protecting the
425integrity of the free software distribution system which is
426implemented by public license practices. Many people have made
427generous contributions to the wide range of software distributed
428through that system in reliance on consistent application of that
429system; it is up to the author/donor to decide if he or she is willing
430to distribute software through any other system and a licensee cannot
431impose that choice.
432
433This section is intended to make thoroughly clear what is believed to
434be a consequence of the rest of this License.
435
436 12. If the distribution and/or use of the Library is restricted in
437certain countries either by patents or by copyrighted interfaces, the
438original copyright holder who places the Library under this License may add
439an explicit geographical distribution limitation excluding those countries,
440so that distribution is permitted only in or among countries not thus
441excluded. In such case, this License incorporates the limitation as if
442written in the body of this License.
443
444 13. The Free Software Foundation may publish revised and/or new
445versions of the Lesser General Public License from time to time.
446Such new versions will be similar in spirit to the present version,
447but may differ in detail to address new problems or concerns.
448
449Each version is given a distinguishing version number. If the Library
450specifies a version number of this License which applies to it and
451"any later version", you have the option of following the terms and
452conditions either of that version or of any later version published by
453the Free Software Foundation. If the Library does not specify a
454license version number, you may choose any version ever published by
455the Free Software Foundation.
456
457 14. If you wish to incorporate parts of the Library into other free
458programs whose distribution conditions are incompatible with these,
459write to the author to ask for permission. For software which is
460copyrighted by the Free Software Foundation, write to the Free
461Software Foundation; we sometimes make exceptions for this. Our
462decision will be guided by the two goals of preserving the free status
463of all derivatives of our free software and of promoting the sharing
464and reuse of software generally.
465
466 NO WARRANTY
467
468 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
469WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
470EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
471OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
472KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
473IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
474PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
475LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
476THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
477
478 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
479WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
480AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
481FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
482CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
483LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
484RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
485FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
486SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
487DAMAGES.
488
489 END OF TERMS AND CONDITIONS
diff --git a/eoxx/ChangeLog b/eoxx/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/eoxx/ChangeLog
diff --git a/eoxx/INSTALL b/eoxx/INSTALL
new file mode 100644
index 0000000..a1e89e1
--- /dev/null
+++ b/eoxx/INSTALL
@@ -0,0 +1,370 @@
1Installation Instructions
2*************************
3
4Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
5Inc.
6
7 Copying and distribution of this file, with or without modification,
8are permitted in any medium without royalty provided the copyright
9notice and this notice are preserved. This file is offered as-is,
10without warranty of any kind.
11
12Basic Installation
13==================
14
15 Briefly, the shell commands `./configure; make; make install' should
16configure, build, and install this package. The following
17more-detailed instructions are generic; see the `README' file for
18instructions specific to this package. Some packages provide this
19`INSTALL' file but do not implement all of the features documented
20below. The lack of an optional feature in a given package is not
21necessarily a bug. More recommendations for GNU packages can be found
22in *note Makefile Conventions: (standards)Makefile Conventions.
23
24 The `configure' shell script attempts to guess correct values for
25various system-dependent variables used during compilation. It uses
26those values to create a `Makefile' in each directory of the package.
27It may also create one or more `.h' files containing system-dependent
28definitions. Finally, it creates a shell script `config.status' that
29you can run in the future to recreate the current configuration, and a
30file `config.log' containing compiler output (useful mainly for
31debugging `configure').
32
33 It can also use an optional file (typically called `config.cache'
34and enabled with `--cache-file=config.cache' or simply `-C') that saves
35the results of its tests to speed up reconfiguring. Caching is
36disabled by default to prevent problems with accidental use of stale
37cache files.
38
39 If you need to do unusual things to compile the package, please try
40to figure out how `configure' could check whether to do them, and mail
41diffs or instructions to the address given in the `README' so they can
42be considered for the next release. If you are using the cache, and at
43some point `config.cache' contains results you don't want to keep, you
44may remove or edit it.
45
46 The file `configure.ac' (or `configure.in') is used to create
47`configure' by a program called `autoconf'. You need `configure.ac' if
48you want to change it or regenerate `configure' using a newer version
49of `autoconf'.
50
51 The simplest way to compile this package is:
52
53 1. `cd' to the directory containing the package's source code and type
54 `./configure' to configure the package for your system.
55
56 Running `configure' might take a while. While running, it prints
57 some messages telling which features it is checking for.
58
59 2. Type `make' to compile the package.
60
61 3. Optionally, type `make check' to run any self-tests that come with
62 the package, generally using the just-built uninstalled binaries.
63
64 4. Type `make install' to install the programs and any data files and
65 documentation. When installing into a prefix owned by root, it is
66 recommended that the package be configured and built as a regular
67 user, and only the `make install' phase executed with root
68 privileges.
69
70 5. Optionally, type `make installcheck' to repeat any self-tests, but
71 this time using the binaries in their final installed location.
72 This target does not install anything. Running this target as a
73 regular user, particularly if the prior `make install' required
74 root privileges, verifies that the installation completed
75 correctly.
76
77 6. You can remove the program binaries and object files from the
78 source code directory by typing `make clean'. To also remove the
79 files that `configure' created (so you can compile the package for
80 a different kind of computer), type `make distclean'. There is
81 also a `make maintainer-clean' target, but that is intended mainly
82 for the package's developers. If you use it, you may have to get
83 all sorts of other programs in order to regenerate files that came
84 with the distribution.
85
86 7. Often, you can also type `make uninstall' to remove the installed
87 files again. In practice, not all packages have tested that
88 uninstallation works correctly, even though it is required by the
89 GNU Coding Standards.
90
91 8. Some packages, particularly those that use Automake, provide `make
92 distcheck', which can by used by developers to test that all other
93 targets like `make install' and `make uninstall' work correctly.
94 This target is generally not run by end users.
95
96Compilers and Options
97=====================
98
99 Some systems require unusual options for compilation or linking that
100the `configure' script does not know about. Run `./configure --help'
101for details on some of the pertinent environment variables.
102
103 You can give `configure' initial values for configuration parameters
104by setting variables in the command line or in the environment. Here
105is an example:
106
107 ./configure CC=c99 CFLAGS=-g LIBS=-lposix
108
109 *Note Defining Variables::, for more details.
110
111Compiling For Multiple Architectures
112====================================
113
114 You can compile the package for more than one kind of computer at the
115same time, by placing the object files for each architecture in their
116own directory. To do this, you can use GNU `make'. `cd' to the
117directory where you want the object files and executables to go and run
118the `configure' script. `configure' automatically checks for the
119source code in the directory that `configure' is in and in `..'. This
120is known as a "VPATH" build.
121
122 With a non-GNU `make', it is safer to compile the package for one
123architecture at a time in the source code directory. After you have
124installed the package for one architecture, use `make distclean' before
125reconfiguring for another architecture.
126
127 On MacOS X 10.5 and later systems, you can create libraries and
128executables that work on multiple system types--known as "fat" or
129"universal" binaries--by specifying multiple `-arch' options to the
130compiler but only a single `-arch' option to the preprocessor. Like
131this:
132
133 ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
134 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
135 CPP="gcc -E" CXXCPP="g++ -E"
136
137 This is not guaranteed to produce working output in all cases, you
138may have to build one architecture at a time and combine the results
139using the `lipo' tool if you have problems.
140
141Installation Names
142==================
143
144 By default, `make install' installs the package's commands under
145`/usr/local/bin', include files under `/usr/local/include', etc. You
146can specify an installation prefix other than `/usr/local' by giving
147`configure' the option `--prefix=PREFIX', where PREFIX must be an
148absolute file name.
149
150 You can specify separate installation prefixes for
151architecture-specific files and architecture-independent files. If you
152pass the option `--exec-prefix=PREFIX' to `configure', the package uses
153PREFIX as the prefix for installing programs and libraries.
154Documentation and other data files still use the regular prefix.
155
156 In addition, if you use an unusual directory layout you can give
157options like `--bindir=DIR' to specify different values for particular
158kinds of files. Run `configure --help' for a list of the directories
159you can set and what kinds of files go in them. In general, the
160default for these options is expressed in terms of `${prefix}', so that
161specifying just `--prefix' will affect all of the other directory
162specifications that were not explicitly provided.
163
164 The most portable way to affect installation locations is to pass the
165correct locations to `configure'; however, many packages provide one or
166both of the following shortcuts of passing variable assignments to the
167`make install' command line to change installation locations without
168having to reconfigure or recompile.
169
170 The first method involves providing an override variable for each
171affected directory. For example, `make install
172prefix=/alternate/directory' will choose an alternate location for all
173directory configuration variables that were expressed in terms of
174`${prefix}'. Any directories that were specified during `configure',
175but not in terms of `${prefix}', must each be overridden at install
176time for the entire installation to be relocated. The approach of
177makefile variable overrides for each directory variable is required by
178the GNU Coding Standards, and ideally causes no recompilation.
179However, some platforms have known limitations with the semantics of
180shared libraries that end up requiring recompilation when using this
181method, particularly noticeable in packages that use GNU Libtool.
182
183 The second method involves providing the `DESTDIR' variable. For
184example, `make install DESTDIR=/alternate/directory' will prepend
185`/alternate/directory' before all installation names. The approach of
186`DESTDIR' overrides is not required by the GNU Coding Standards, and
187does not work on platforms that have drive letters. On the other hand,
188it does better at avoiding recompilation issues, and works well even
189when some directory options were not specified in terms of `${prefix}'
190at `configure' time.
191
192Optional Features
193=================
194
195 If the package supports it, you can cause programs to be installed
196with an extra prefix or suffix on their names by giving `configure' the
197option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
198
199 Some packages pay attention to `--enable-FEATURE' options to
200`configure', where FEATURE indicates an optional part of the package.
201They may also pay attention to `--with-PACKAGE' options, where PACKAGE
202is something like `gnu-as' or `x' (for the X Window System). The
203`README' should mention any `--enable-' and `--with-' options that the
204package recognizes.
205
206 For packages that use the X Window System, `configure' can usually
207find the X include and library files automatically, but if it doesn't,
208you can use the `configure' options `--x-includes=DIR' and
209`--x-libraries=DIR' to specify their locations.
210
211 Some packages offer the ability to configure how verbose the
212execution of `make' will be. For these packages, running `./configure
213--enable-silent-rules' sets the default to minimal output, which can be
214overridden with `make V=1'; while running `./configure
215--disable-silent-rules' sets the default to verbose, which can be
216overridden with `make V=0'.
217
218Particular systems
219==================
220
221 On HP-UX, the default C compiler is not ANSI C compatible. If GNU
222CC is not installed, it is recommended to use the following options in
223order to use an ANSI C compiler:
224
225 ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
226
227and if that doesn't work, install pre-built binaries of GCC for HP-UX.
228
229 HP-UX `make' updates targets which have the same time stamps as
230their prerequisites, which makes it generally unusable when shipped
231generated files such as `configure' are involved. Use GNU `make'
232instead.
233
234 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
235parse its `<wchar.h>' header file. The option `-nodtk' can be used as
236a workaround. If GNU CC is not installed, it is therefore recommended
237to try
238
239 ./configure CC="cc"
240
241and if that doesn't work, try
242
243 ./configure CC="cc -nodtk"
244
245 On Solaris, don't put `/usr/ucb' early in your `PATH'. This
246directory contains several dysfunctional programs; working variants of
247these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
248in your `PATH', put it _after_ `/usr/bin'.
249
250 On Haiku, software installed for all users goes in `/boot/common',
251not `/usr/local'. It is recommended to use the following options:
252
253 ./configure --prefix=/boot/common
254
255Specifying the System Type
256==========================
257
258 There may be some features `configure' cannot figure out
259automatically, but needs to determine by the type of machine the package
260will run on. Usually, assuming the package is built to be run on the
261_same_ architectures, `configure' can figure that out, but if it prints
262a message saying it cannot guess the machine type, give it the
263`--build=TYPE' option. TYPE can either be a short name for the system
264type, such as `sun4', or a canonical name which has the form:
265
266 CPU-COMPANY-SYSTEM
267
268where SYSTEM can have one of these forms:
269
270 OS
271 KERNEL-OS
272
273 See the file `config.sub' for the possible values of each field. If
274`config.sub' isn't included in this package, then this package doesn't
275need to know the machine type.
276
277 If you are _building_ compiler tools for cross-compiling, you should
278use the option `--target=TYPE' to select the type of system they will
279produce code for.
280
281 If you want to _use_ a cross compiler, that generates code for a
282platform different from the build platform, you should specify the
283"host" platform (i.e., that on which the generated programs will
284eventually be run) with `--host=TYPE'.
285
286Sharing Defaults
287================
288
289 If you want to set default values for `configure' scripts to share,
290you can create a site shell script called `config.site' that gives
291default values for variables like `CC', `cache_file', and `prefix'.
292`configure' looks for `PREFIX/share/config.site' if it exists, then
293`PREFIX/etc/config.site' if it exists. Or, you can set the
294`CONFIG_SITE' environment variable to the location of the site script.
295A warning: not all `configure' scripts look for a site script.
296
297Defining Variables
298==================
299
300 Variables not defined in a site shell script can be set in the
301environment passed to `configure'. However, some packages may run
302configure again during the build, and the customized values of these
303variables may be lost. In order to avoid this problem, you should set
304them in the `configure' command line, using `VAR=value'. For example:
305
306 ./configure CC=/usr/local2/bin/gcc
307
308causes the specified `gcc' to be used as the C compiler (unless it is
309overridden in the site shell script).
310
311Unfortunately, this technique does not work for `CONFIG_SHELL' due to
312an Autoconf bug. Until the bug is fixed you can use this workaround:
313
314 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
315
316`configure' Invocation
317======================
318
319 `configure' recognizes the following options to control how it
320operates.
321
322`--help'
323`-h'
324 Print a summary of all of the options to `configure', and exit.
325
326`--help=short'
327`--help=recursive'
328 Print a summary of the options unique to this package's
329 `configure', and exit. The `short' variant lists options used
330 only in the top level, while the `recursive' variant lists options
331 also present in any nested packages.
332
333`--version'
334`-V'
335 Print the version of Autoconf used to generate the `configure'
336 script, and exit.
337
338`--cache-file=FILE'
339 Enable the cache: use and save the results of the tests in FILE,
340 traditionally `config.cache'. FILE defaults to `/dev/null' to
341 disable caching.
342
343`--config-cache'
344`-C'
345 Alias for `--cache-file=config.cache'.
346
347`--quiet'
348`--silent'
349`-q'
350 Do not print messages saying which checks are being made. To
351 suppress all normal output, redirect it to `/dev/null' (any error
352 messages will still be shown).
353
354`--srcdir=DIR'
355 Look for the package's source code in directory DIR. Usually
356 `configure' can determine that directory automatically.
357
358`--prefix=DIR'
359 Use DIR as the installation prefix. *note Installation Names::
360 for more details, including other options available for fine-tuning
361 the installation locations.
362
363`--no-create'
364`-n'
365 Run the configure checks, but stop before creating any output
366 files.
367
368`configure' also accepts some other, not widely useful, options. Run
369`configure --help' for more details.
370
diff --git a/eoxx/Makefile.am b/eoxx/Makefile.am
new file mode 100644
index 0000000..5c3c494
--- /dev/null
+++ b/eoxx/Makefile.am
@@ -0,0 +1,14 @@
1ACLOCAL_AMFLAGS = -I m4
2
3SUBDIRS = src
4
5EXTRA_DIST = \
6AUTHORS \
7COPYING \
8autogen.sh \
9eoxx.pc.in \
10README
11
12pkgconfigdir = $(libdir)/pkgconfig
13pkgconfig_DATA = eoxx.pc
14
diff --git a/eoxx/NEWS b/eoxx/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/eoxx/NEWS
diff --git a/eoxx/README b/eoxx/README
new file mode 100644
index 0000000..7bad5a6
--- /dev/null
+++ b/eoxx/README
@@ -0,0 +1,7 @@
1The goal of this project is to provide a stable API/ABI in C++ for EFL and
2still take advantage of all C++ feature. It leverage its feature from latest
3EFL 1.8.
4
5Before doing any patch to it, please read :
6http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++
7
diff --git a/eoxx/TODO b/eoxx/TODO
new file mode 100644
index 0000000..7d335b4
--- /dev/null
+++ b/eoxx/TODO
@@ -0,0 +1,7 @@
1* Handle callback
2* Test shared_eo
3* Test with std:* type
4* eo->do() ?
5* Documentation
6* Factory for some simple common type ?
7* Cleanup code
diff --git a/eoxx/autogen.sh b/eoxx/autogen.sh
new file mode 100755
index 0000000..63d4121
--- /dev/null
+++ b/eoxx/autogen.sh
@@ -0,0 +1,32 @@
1#!/bin/sh
2
3rm -rf autom4te.cache
4rm -f aclocal.m4 ltmain.sh
5
6autoreconf -vif
7
8W=0
9
10rm -f config.cache-env.tmp
11echo "OLD_PARM=\"$@\"" >> config.cache-env.tmp
12echo "OLD_CFLAGS=\"$CFLAGS\"" >> config.cache-env.tmp
13echo "OLD_PATH=\"$PATH\"" >> config.cache-env.tmp
14echo "OLD_PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\"" >> config.cache-env.tmp
15echo "OLD_LDFLAGS=\"$LDFLAGS\"" >> config.cache-env.tmp
16
17cmp config.cache-env.tmp config.cache-env >> /dev/null
18if [ $? -ne 0 ]; then
19 W=1;
20fi
21
22if [ $W -ne 0 ]; then
23 echo "Cleaning configure cache...";
24 rm -f config.cache config.cache-env
25 mv config.cache-env.tmp config.cache-env
26else
27 rm -f config.cache-env.tmp
28fi
29
30if [ -z "$NOCONFIGURE" ]; then
31 exec ./configure -C "$@"
32fi
diff --git a/eoxx/configure.ac b/eoxx/configure.ac
new file mode 100644
index 0000000..62956ac
--- /dev/null
+++ b/eoxx/configure.ac
@@ -0,0 +1,59 @@
1m4_define([v_maj], [1])
2m4_define([v_min], [7])
3m4_define([v_mic], [99])
4
5m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
6m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
7
8#### FIXME: i am sure that we can do some m4 to automagically do the stuff below for release and snapshots
9
10##-- When released, remove the dnl on the below line
11dnl m4_undefine([v_rev])
12
13m4_define([v_rel], [])
14##-- When doing snapshots - change soname. remove dnl on below line
15dnl m4_define([relname], [ver-pre-svn-07])
16dnl m4_define([v_rel], [-release relname])
17
18m4_ifdef([v_rev], [m4_define([eoxx_version], [v_maj.v_min.v_mic.v_rev])], [m4_define([eoxx_version], [v_maj.v_min.v_mic])])
19
20m4_define([lt_cur], m4_eval(v_maj + v_min))
21m4_define([lt_rev], v_mic)
22m4_define([lt_age], v_min)
23
24AC_INIT([eoxx], [eoxx_version], [enlightenment-devel@lists.sourceforge.net])
25AC_PREREQ([2.60])
26AC_CONFIG_SRCDIR([configure.ac])
27AC_CONFIG_MACRO_DIR([m4])
28
29AM_INIT_AUTOMAKE([1.6 dist-bzip2 -Wall])
30m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31
32
33m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
34AC_DEFINE_UNQUOTED([VMAJ], [v_maj], [Major version])
35AC_DEFINE_UNQUOTED([VMIN], [v_min], [Minor version])
36AC_DEFINE_UNQUOTED([VMIC], [v_mic], [Micro version])
37AC_DEFINE_UNQUOTED([VREV], [v_rev], [Revison])
38VMAJ=v_maj
39VMIN=v_min
40AC_SUBST([VMAJ])
41AC_SUBST([VMIN])
42
43AC_ISC_POSIX
44AC_PROG_CXX
45AM_PROG_CC_STDC
46AC_HEADER_STDC
47
48AM_PROG_LIBTOOL
49
50PKG_CHECK_MODULES(EFL, eo elementary)
51PKG_CHECK_MODULES(SIGC, sigc++-2.0)
52
53AC_OUTPUT([
54Makefile
55src/Makefile
56src/lib/Makefile
57src/examples/Makefile
58eoxx.pc
59])
diff --git a/eoxx/eoxx.pc.in b/eoxx/eoxx.pc.in
new file mode 100644
index 0000000..2c9897a
--- /dev/null
+++ b/eoxx/eoxx.pc.in
@@ -0,0 +1,13 @@
1prefix=@prefix@
2exec_prefix=@prefix@
3libdir=@exec_prefix@/lib
4includedir=@prefix@/include
5
6Name: @PACKAGE@
7Description: EFL C++ Wrapper
8Version: @VERSION@
9Requires: sigc++-2.0 eo
10Conflicts:
11Libs: -L${libdir} -leoxx
12Cflags: -I${includedir}
13
diff --git a/eoxx/src/Makefile.am b/eoxx/src/Makefile.am
new file mode 100644
index 0000000..1211d20
--- /dev/null
+++ b/eoxx/src/Makefile.am
@@ -0,0 +1 @@
SUBDIRS = lib examples
diff --git a/eoxx/src/examples/Makefile.am b/eoxx/src/examples/Makefile.am
new file mode 100644
index 0000000..b26520c
--- /dev/null
+++ b/eoxx/src/examples/Makefile.am
@@ -0,0 +1,12 @@
1bin_PROGRAMS = \
2 eoxx_test
3
4eoxx_test_SOURCES = \
5 eoxx_test.cc
6eoxx_test_CPPFLAGS = \
7 -I$(top_srcdir)/src/lib/ \
8 -I$(top_builddir)/src/lib/ \
9 -DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)/\" \
10 @EFL_CFLAGS@ @SIGC_CFLAGS@
11eoxx_test_LDADD = $(top_srcdir)/src/lib/libeoxx.la @EFL_LIBS@ @SIGC_LIBS@
12
diff --git a/eoxx/src/examples/eoxx_test.cc b/eoxx/src/examples/eoxx_test.cc
new file mode 100644
index 0000000..c8155fa
--- /dev/null
+++ b/eoxx/src/examples/eoxx_test.cc
@@ -0,0 +1,68 @@
1#include <iostream>
2
3#include <Elementary.h>
4
5#include "Eo.hh"
6
7static void
8_win_del(void *data EINA_UNUSED,
9 Evas_Object *obj EINA_UNUSED,
10 void *event_info EINA_UNUSED)
11{
12 elm_exit();
13}
14
15static Eina_Bool
16_timer_run(void *data)
17{
18 std::cout << "Timer expired !" << std::endl;
19 elm_exit();
20 return EINA_FALSE;
21}
22
23int
24main(int argc, char **argv)
25{
26 efl::weak_eo<efl::eo> timer;
27 efl::weak_eo<efl::eo> window;
28 efl::weak_eo<efl::eo> rect;
29
30 elm_init(argc, argv);
31
32 window = elm_win_add(NULL, "Eroxx", ELM_WIN_BASIC);
33 if ((Eo*) window == NULL)
34 return -1;
35 elm_win_title_set(window, "Eroxx");
36 evas_object_smart_callback_add(window, "delete,request", _win_del, NULL);
37
38 rect = evas_object_rectangle_add(evas_object_evas_get(window));
39 if ((Eo*) rect == NULL)
40 return -1;
41 evas_object_color_set(rect, 0, 128, 0, 255);
42 evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
43 evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, EVAS_HINT_FILL);
44 evas_object_show(rect);
45
46 elm_win_resize_object_add(window, rect);
47 evas_object_resize(window, 256, 256);
48 evas_object_show(window);
49
50 timer = ecore_timer_add(1, _timer_run, NULL);
51
52 elm_run();
53
54 if ((Eo*) window)
55 {
56 std::cout << "Destroying window" << std::endl;
57 evas_object_del(window);
58 }
59 if ((Eo*) timer)
60 {
61 std::cout << "Destroying timer" << std::endl;
62 ecore_timer_del(timer);
63 }
64
65 elm_shutdown();
66
67 return 0;
68}
diff --git a/eoxx/src/lib/Eo.cc b/eoxx/src/lib/Eo.cc
new file mode 100644
index 0000000..bd9b891
--- /dev/null
+++ b/eoxx/src/lib/Eo.cc
@@ -0,0 +1,9 @@
1#include <Eo.hh>
2
3void efl::eo::_ref()
4{
5}
6
7void efl::eo::_unref()
8{
9}
diff --git a/eoxx/src/lib/Eo.hh b/eoxx/src/lib/Eo.hh
new file mode 100644
index 0000000..aa0dcf6
--- /dev/null
+++ b/eoxx/src/lib/Eo.hh
@@ -0,0 +1,148 @@
1#ifndef EO_HH__
2# define EO_HH__
3
4#include <exception>
5
6#include <Eo.h>
7
8namespace efl {
9 class eo_null_exception : public std::exception
10 {
11 virtual const char * what() const throw()
12 {
13 return "Eo source object is NULL";
14 }
15 } eo_null;
16
17 class eo {
18 public:
19 eo() : iobj(NULL)
20 {
21 }
22 eo(Eo *cobj) : iobj(cobj)
23 {
24 if (!iobj) throw efl::eo_null;
25 }
26 eo(Eo_Class *cclass, Eo *cparent)
27 {
28 iobj = eo_add(cclass, cparent);
29 if (!iobj) throw efl::eo_null;
30 }
31
32 void invalidate();
33 bool valid() const;
34
35 eo & operator=(Eo *c)
36 {
37 _unref();
38 iobj = c;
39 _ref();
40 }
41
42 const eo & operator=(const Eo *c)
43 {
44 _unref();
45 iobj = const_cast<Eo*> (c);
46 _ref();
47 }
48
49 ~eo() {};
50
51 operator Eo *() { return iobj; }
52
53 bool operator==(const eo &c) const { return iobj == c.iobj; }
54 bool operator!=(const eo &c) const { return iobj != c.iobj; }
55
56 protected:
57 virtual void _unref();
58 virtual void _ref();
59
60 void assign(const eo &r);
61 void assign(eo &r);
62
63 Eo *iobj;
64 };
65
66 template <class X>
67 class weak_eo : public eo {
68
69 public:
70 weak_eo<X> & operator=(const eo &c)
71 {
72 assign(c);
73 return *this;
74 }
75 weak_eo<X> & operator=(eo &c)
76 {
77 assign(c);
78 return *this;
79 }
80
81 weak_eo<X> & operator=(Eo *c)
82 {
83 _unref();
84 iobj = c;
85 _ref();
86 }
87 const weak_eo<X> & operator=(const Eo *c)
88 {
89 _unref();
90 iobj = c;
91 _ref();
92 }
93
94 protected:
95 virtual void _unref()
96 {
97 eo_weak_unref(&iobj);
98 }
99
100 virtual void _ref()
101 {
102 eo_weak_ref(&iobj);
103 }
104 };
105
106 template <class X>
107 class shared_eo : public eo {
108 public:
109 shared_eo<X> & operator=(const eo &c)
110 {
111 assign(c);
112 return *this;
113 }
114 shared_eo<X> & operator=(eo &c)
115 {
116 assign(c);
117 return *this;
118 }
119
120 shared_eo<X> & operator=(Eo *c)
121 {
122 _unref();
123 iobj = c;
124 _ref();
125 }
126 const shared_eo<X> & operator=(const Eo *c)
127 {
128 _unref();
129 iobj = c;
130 _ref();
131 }
132
133 protected:
134 virtual void _unref()
135 {
136 eo_xunref(iobj, NULL);
137 }
138
139 virtual void _ref()
140 {
141 eo_xref(iobj, NULL);
142 }
143 };
144
145#include "Eo.xx"
146};
147
148#endif
diff --git a/eoxx/src/lib/Eo.xx b/eoxx/src/lib/Eo.xx
new file mode 100644
index 0000000..2db3248
--- /dev/null
+++ b/eoxx/src/lib/Eo.xx
@@ -0,0 +1,24 @@
1void eo::invalidate()
2{
3 _unref();
4 iobj = NULL;
5}
6
7bool eo::valid() const
8{
9 return iobj != NULL;
10}
11
12void eo::assign(const eo &r)
13{
14 _unref();
15 iobj = r.iobj;
16 _ref();
17}
18
19void eo::assign(eo &r)
20{
21 _unref();
22 iobj = r.iobj;
23 _ref();
24}
diff --git a/eoxx/src/lib/Makefile.am b/eoxx/src/lib/Makefile.am
new file mode 100644
index 0000000..e579e0a
--- /dev/null
+++ b/eoxx/src/lib/Makefile.am
@@ -0,0 +1,22 @@
1AM_CPPFLAGS = \
2 -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
3 -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
4 -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
5 $(EFL_CFLAGS) \
6 $(SIGC_CFLAGS)
7
8installed_libeoxxdir = $(includedir)/eoxx-@VMAJ@
9dist_installed_libeoxxdir = \
10 Eo.hh \
11 Eo.xx
12
13lib_LTLIBRARIES = \
14 libeoxx.la
15
16libeoxx_la_SOURCES = \
17 Eo.cc
18
19libeoxx_la_LIBADD = \
20 $(EFL_LIBS) \
21 $(SIGC_LIBS)
22