diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000000000000000000000000000000000000..a973a5e8f666f457eee0c5d23f441623510cff4a --- /dev/null +++ b/AUTHORS @@ -0,0 +1,4 @@ +Guillaume Casanova +Mathieu Champely +Edward Hervey +Raphael Pralat diff --git a/COPYING b/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..60549be514af76c5db0c17ce6bbe01b2f81e2d9e --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000000000000000000000000000000000000..b42a17ac4640e9a2bfe5e480e44d0eef3f365928 --- /dev/null +++ b/INSTALL @@ -0,0 +1,182 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/Makefile.am b/Makefile.am new file mode 100755 index 0000000000000000000000000000000000000000..dd91b5600aa914aeb9f9289da86da5dc08557ecd --- /dev/null +++ b/Makefile.am @@ -0,0 +1,30 @@ +## +## configure.in +## +## Made by guillaume casanova +## Email +## +## + +# AUTOMAKE_OPTIONS = foreign +SUBDIRS = src +# will come later : pixmaps libs docs + +EXTRA_DIST = \ + NEWS \ + NORME \ + README \ + AUTHORS + +AUTOMAKE_OPTIONS = dist-bzip2 + +release: dist + make @PACKAGE@-@VERSION@.tar.gz.md5 + make @PACKAGE@-@VERSION@.tar.bz2.md5 + +# generate md5 sum files +%.md5: % + md5sum $< > $@ + +rpm: dist + rpm -ta $(distdir).tar.gz diff --git a/NEWS b/NEWS new file mode 100644 index 0000000000000000000000000000000000000000..ae6c4c4628c6f5bd55ebd844647bb621eab7ad24 --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ +No time to add NEWS. We must finish our minimum interface for the first 6 march. diff --git a/NORME b/NORME new file mode 100644 index 0000000000000000000000000000000000000000..7f7f5d10d617c4a5e4a0d941660e0b2dc2066943 --- /dev/null +++ b/NORME @@ -0,0 +1,119 @@ +launch gst-inspect gui +http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstRegistry.html +Quelques recommandations avant de se lancer dans le code sans +réfléchir : + +- respecter la norme de programmation comme suit : + +- un objet ou widget gtk a un fichier et a un header : + example : je fais une menubar donc + fichier source C : + - gpi_menubar.c + fichier header .h + - gpi_menubar.h + Le nommage de fichier respecte la contrainte suivante : gpi_"nom de +la widget".extension +Pkoi gpi : pour g (gstreamer, gtk, glib, gnome) et pi pour pitivi. +Le respect de ce système de nommage permet de différencier nos +fonctions +de gstreamer et autres. + +- Dans le fichier source C : + Contraintes à respecter : + - entête à epita regarder les sources gip_gui (c'est assez +explicite). + - ne pas oublier les defines conditionnelles c++ + dans lequel on insère du code source. + ex : ouverture -> #ifdef __cplusplus + extern "C" { + #endif /* __cplusplus */ + Code Source ...... + #ifdef __cplusplus + } + #endif /* __cplusplus */ + + - nommage des fonctions : + gpi_"nom_de_la_fonction" () + Le nom de la fonction doit etre en anglais et le plus +explicite possible. + example : je fais une menubar, créer une menubar : + GtkWidget * gpi_menubar_new (); + - Dans les fichier headers .h + Contraintes à respecter : + s'inspirer du code sources de gtkDial, et des sources +sur le cvs. + recommendations : + - Décalaration : + #ifndef __GPI_MENBAR_H__ + # define __GPI_MENBAR_H__ + Déclaration des types , defines + +#endif /* __GPI_MENBAR_H__ */ + - NE PAS OUBLIER d'implémenter dans le .h les defines de CAST +des +WIDGETS + examples : #define GPI_MENUBAR_TYPE +gpi_menubar_get_type() + #define .... + #define .... + + Les structures et les types + Deux choses importantes en ce qui concnerne +les types et les strcutures : + décalaration d'une strcuture : + struct _GPIMenubar + { + GtkWidget *widget; + .... + }; + typedef struct +_GpiMenubar GpiMenubar; + Header des fonctions .... . + + le gobject est une simulation de l'objet donc + les méthodes et les propriétés sont dissociées : + Ainsi il faudra déclarer une structure ou vous +aurez à stocker + vos objets style par example : + partie déclaration des objets / +propriétés. + + struct _GpiMenubar + { + GtkContainer parent; + GtkWidget *window; + GtkUIManager ui_manager; + GtkWidget *menu; + }; + partie déclaration des méthodes. + Cette partie ne contient que des pointers sur fonctions + à part le parentClass + struct _GpiMenuBarClass + { + GtkContainerClass parent_class; + void (*show)(); + ..... + } + + Ainsi de suite. + + Point important la dérivation et l'heritage. + Pour l'instant la dérivation va plutot se faire sur la widget +GtkContainer. + Ce qui veut en gros dire qu'a chaque fois que vous créez une +widget vous + devez mettre dans la première ligne de la structure de la +propriété l'objet hérité. + et dans la classe également. + + example : + struct _GpiMenubar + { + ----->GtkContainer parent; + ... + } + struct _GpiMenubar + { + ----->GtkContainerClass parent; + ... + } diff --git a/README b/README new file mode 100644 index 0000000000000000000000000000000000000000..754e400c9d3a3855510d51c4d820cb3cb611023b --- /dev/null +++ b/README @@ -0,0 +1,6 @@ +Pitivi is a opensource nonlinear multimedia editor for GStreamer. + +This Simple first GUI demonstrates : +- a simple minimum interface +- Playing samples of multimedia sources +- Managing MDI diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000000000000000000000000000000000000..cce9cd99f14f5e7700795fceabb1d86bc60f1433 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,120 @@ +#!/bin/sh +# ************************************************************ +# Autotools For Pitivi-GUI +# +# Made By Casaxno +# See also : gst-autogen.sh, configure.ac, src/Makefile.am +# +# ============Modifications=================================== +# Author Date Version Description +# ------------------------------------------------------------ +# GC 27/02/2004 0.0.1 Including common files +# like gst-autogen.sh +# EH 26/04/2004 0.0.1 Updated +# ************************************************************* + +DIE=0 +package=pitivi +srcfile=src/main.c + +################################## +# Checking Host Operating System # +################################## + + if [ $OSTYPE != linux-gnu ] + then + echo "OS Only Accepted : linux-gnu" + exit + else + +################################### +# Setting Environnement Variables # +################################### + +# if test -z $AUTOMAKE; then +# export AUTOMAKE=automake +# export ACLOCAL=aclocal +# if test -z $AUTOCONF; then export AUTOCONF=autoconf; fi +# else +# echo "Automake not Found : Please Install at least automake-1.7" +# exit +# fi + + + # CHECK PRESENCE OF GST AUTOTOOLS COMMON FUNCS + + if test ! -f common/gst-autogen.sh; + then + echo "There is something wrong with your source tree." + echo "You are missing common/gst-autogen.sh" + exit 1 + fi + + . common/gst-autogen.sh + +################################### +# Launching Autotools # +################################### +# This shouldn't be done, you never know where that Makefile comes from... +# if [ -f Makefile ] +# then +# make distclean ; +# fi + + CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-debug --enable-DEBUG' + + autogen_options $@ + + ### AUTOTOOLS CHECKING ### + + echo -n "+ check for build tools" + if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi + version_check "autoconf" \ + "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53 autoconf-2.52" \ + "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1 + version_check "automake" \ + "$AUTOMAKE automake \ + automake-1.7 automake-1.6 automake-1.5" \ + "ftp://ftp.gnu.org/pub/gnu/automake/" 1 5 || DIE=1 + version_check "gettext" "" \ + "ftp://alpha.gnu.org/gnu/" 0 10 35 || DIE=1 + version_check "intltoolize" "" \ + "ftp://ftp.gnome.org/pub/GNOME/stable/sources/intltool" 0 1 5 || DIE=1 + version_check "libtool" "" \ + "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 4 0 || DIE=1 + version_check "pkg-config" "" \ + "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 + die_check $DIE + + ### CHECKING PART ### + + toplevel_check $srcfile + autoconf_2_52d_check || DIE=1 + aclocal_check || DIE=1 + autoheader_check || DIE=1 + + ### RUNNING TOOLS ### + + tool_run "libtoolize --copy --force" + tool_run "$aclocal -I common/m4/" + tool_run "$autoheader" + tool_run "$autoconf" + tool_run "$automake -ac" + + ### CONFIGURE PART ### + + echo "+ running configure ... " + test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT" + test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT" + ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || { + echo " configure failed" + exit 1 + } + + ### END PART COMPILATION ### + echo "Now type 'make' to compile $package." + # for go faster enables comments + # make; + # ./src/Pitivi + fi + \ No newline at end of file diff --git a/common/ChangeLog b/common/ChangeLog new file mode 100644 index 0000000000000000000000000000000000000000..c8acb0ae3f8784c0f33e88868fd55e551c46a5a2 --- /dev/null +++ b/common/ChangeLog @@ -0,0 +1,98 @@ +2004-03-18 Thomas Vander Stichele + + * Makefile.am: + * m4/Makefile.am: + integrate these with the dist + +2004-03-17 Thomas Vander Stichele + + * release.mak: add a release target + +2004-03-09 Thomas Vander Stichele + + patch by: Stephane Loeuillet + + * m4/ax_create_stdint_h.m4: + use head -n instead of head - (#136500) + +2004-03-05 Thomas Vander Stichele + + * m4/gst-doc.m4: don't build PS without dvips binary + +2004-02-22 Julio M. Merino Vidal + + reviewed by: Benjamin Otte + + * m4/as-docbook.m4: + don't use == operator with test(1) (fixes #135115) + +2004-02-16 Thomas Vander Stichele + + * common/m4/gst-arch.m4: x86_64 is x86 too (clue from Fedora 2 test) + +2004-02-13 Thomas Vander Stichele + + * m4/gst-feature.m4: + remove AM_CONDITIONAL for the subsystem since automake 1.6.x + requires that call be in configure.ac + +2004-02-13 Thomas Vander Stichele + + * m4/gst-libxml2.m4: + take required version as argument, and default to 2.4.9 if not + specified + +2004-02-12 Thomas Vander Stichele + + * m4/gst-feature.m4: + rename and fix up GST_CHECK_DISABLE_SUBSYSTEM + +2004-02-11 Thomas Vander Stichele + + * common/m4/as-ac-expand.m4: + * common/m4/as-auto-alt.m4: + * common/m4/as-compiler-flag.m4: + * common/m4/as-compiler.m4: + * common/m4/as-docbook.m4: + * common/m4/as-libtool.m4: + * common/m4/as-scrub-include.m4: + * common/m4/as-version.m4: + * common/m4/glib-gettext.m4: + * common/m4/gst-arch.m4: + * common/m4/gst-debuginfo.m4: + * common/m4/gst-doc.m4: + * common/m4/gst-feature.m4: + * common/m4/gst-function.m4: + * common/m4/gst-glib2.m4: + * common/m4/gst-gstreamer.m4: + * common/m4/gst-libxml2.m4: + * common/m4/gst-makecontext.m4: + * common/m4/gst-mcsc.m4: + * common/m4/pkg.m4: + fix underquoted macros as reported by automake 1.8.x (#133800) + +2004-02-11 Johan Dahlin + + * gst-autogen.sh: Use A-Z instead of A-z in sed expression to + avoid a warning + +2004-02-05 Thomas Vander Stichele + + * m4/gst-doc.m4: + we use --output-format=xml and --ingnore-files options to + gtkdoc-mkdb, which got added between 0.9 and 1.0 + +2004-02-04 Thomas Vander Stichele + + * m4/as-libtool.m4: remove AM_PROG_LIBTOOL so it can move back + to configure.ac to shut up libtoolize + +2004-02-03 Thomas Vander Stichele + + * glib-gen.mak: added; used to generate enums and marshal code + +2004-01-13 Thomas Vander Stichele + + * gettext.patch: added; used by autogen.sh to make sure + GETTEXT_PACKAGE is understood from po/Makefile.in.in -> po/Makefile.in + diff --git a/common/Makefile.am b/common/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..6dd775eddb185ae8fc9c7a634d8499a375c93d4e --- /dev/null +++ b/common/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = m4 + +EXTRA_DIST = ChangeLog gettext.patch glib-gen.mak release.mak gst-autogen.sh diff --git a/common/as-libtool.mak b/common/as-libtool.mak new file mode 100644 index 0000000000000000000000000000000000000000..dabbecfd703c8997ad76544077730bf340a39ca8 --- /dev/null +++ b/common/as-libtool.mak @@ -0,0 +1,47 @@ +# some Makefile.am snippets to fix libtool's breakage w.r.t. DLL +# building +# +# +# define AS_LIBTOOL_LIB before calling. Sorry, only one lib per +# directory +# + + +# add this to EXTRA_DIST +as_libtool_EXTRA_DIST = $(AS_LIBTOOL_LIB).def + +if AS_LIBTOOL_WIN32 + +as_libtool_noinst_DATA_files = $(AS_LIBTOOL_LIB).lib + +as_libtool_LDFLAGS = -no-undefined + +# depend on this in install-data-local +as-libtool-install-data-local: + $(INSTALL) $(AS_LIBTOOL_LIB).lib $(DESTDIR)$(libdir) + $(INSTALL) $(AS_LIBTOOL_LIB).def $(DESTDIR)$(libdir) + +# depend on this in uninstall-local +as-libtool-uninstall-local: + -rm $(DESTDIR)$(libdir)/$(AS_LIBTOOL_LIB).lib + -rm $(DESTDIR)$(libdir)/$(AS_LIBTOOL_LIB).def + +else + +as-libtool-install-data-local: +as-libtool-uninstall-local: + +endif + +$(AS_LIBTOOL_LIB).lib: $(AS_LIBTOOL_LIB).la $(AS_LIBTOOL_LIB).def + dlltool -S $(CC) -f "-c" --export-all-symbols --input-def \ + $(srcdir)/$(AS_LIBTOOL_LIB).def --output-lib $@ + +$(AS_LIBTOOL_LIB).def: + echo EXPORTS >$(AS_LIBTOOL_LIB).def.tmp + nm --defined-only -g .libs/$(AS_LIBTOOL_LIB).a | \ + grep ^0 | \ + awk '{ print $$3 }' | \ + sed 's/^/ /' >>$(AS_LIBTOOL_LIB).def.tmp + mv $(AS_LIBTOOL_LIB).def.tmp $(AS_LIBTOOL_LIB).def + diff --git a/common/gettext.patch b/common/gettext.patch new file mode 100644 index 0000000000000000000000000000000000000000..c00eb34d1c2fc902852948a9ec57cb384b246c91 --- /dev/null +++ b/common/gettext.patch @@ -0,0 +1,11 @@ +--- po/Makefile.in.in.orig 2004-01-09 16:35:54.000000000 +0100 ++++ po/Makefile.in.in 2004-01-09 16:36:43.000000000 +0100 +@@ -11,6 +11,9 @@ + PACKAGE = @PACKAGE@ + VERSION = @VERSION@ + ++# thomas: add GETTEXT_PACKAGE substitution as used in Makevars ++GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ ++ + SHELL = /bin/sh + @SET_MAKE@ diff --git a/common/glib-gen.mak b/common/glib-gen.mak new file mode 100644 index 0000000000000000000000000000000000000000..1de0cd5e4bf164fb7eec0027dcf4b2d375179da5 --- /dev/null +++ b/common/glib-gen.mak @@ -0,0 +1,42 @@ +# these are the variables your Makefile.am should set +# the example is based on the colorbalance interface + +#glib_enum_headers=$(colorbalance_headers) +#glib_enum_define=GST_COLOR_BALANCE +#glib_enum_prefix=gst_color_balance + +# these are all the rules generating the relevant files +%-marshal.h: %-marshal.list + glib-genmarshal --header --prefix=$(glib_enum_prefix)_marshal $^ > $*-marshal.h.tmp + mv $*-marshal.h.tmp $*-marshal.h + +%-marshal.c: %-marshal.list + echo "#include \"$*-marshal.h\"" >> $*-marshal.c.tmp + glib-genmarshal --body --prefix=$(glib_enum_prefix)_marshal $^ >> $*-marshal.c.tmp + mv $*-marshal.c.tmp $*-marshal.c + +%-enumtypes.h: $(glib_enum_headers) + glib-mkenums \ + --fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \ + $^ > $@ + +%-enumtypes.c: $(glib_enum_headers) + @if test "x$(glib_enum_headers)" == "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi + glib-mkenums \ + --fhead "#include <$*.h>" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $^ > $@ + +# a hack rule to make sure .Plo files exist because they get include'd +# from Makefile's +.deps/%-marshal.Plo: + touch $@ + +.deps/%-enumtypes.Plo: + touch $@ diff --git a/common/gst-autogen.sh b/common/gst-autogen.sh new file mode 100644 index 0000000000000000000000000000000000000000..6b4c72941a803f9ad43ef566dd24e648a9561314 --- /dev/null +++ b/common/gst-autogen.sh @@ -0,0 +1,300 @@ +# a silly hack that generates autoregen.sh but it's handy +echo "#!/bin/sh" > autoregen.sh +echo "./autogen.sh $@ \$@" >> autoregen.sh +chmod +x autoregen.sh + +# helper functions for autogen.sh + +debug () +# print out a debug message if DEBUG is a defined variable +{ + if test ! -z "$DEBUG" + then + echo "DEBUG: $1" + fi +} + +version_check () +# check the version of a package +# first argument : package name (executable) +# second argument : optional path where to look for it instead +# third argument : source download url +# rest of arguments : major, minor, micro version +# all consecutive ones : suggestions for binaries to use +# (if not specified in second argument) +{ + PACKAGE=$1 + PKG_PATH=$2 + URL=$3 + MAJOR=$4 + MINOR=$5 + MICRO=$6 + + # for backwards compatibility, we let PKG_PATH=PACKAGE when PKG_PATH null + if test -z "$PKG_PATH"; then PKG_PATH=$PACKAGE; fi + debug "major $MAJOR minor $MINOR micro $MICRO" + VERSION=$MAJOR + if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi + if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi + + debug "major $MAJOR minor $MINOR micro $MICRO" + + for SUGGESTION in $PKG_PATH; do + COMMAND="$SUGGESTION" + + # don't check if asked not to + test -z "$NOCHECK" && { + echo -n " checking for $COMMAND >= $VERSION ... " + } || { + # we set a var with the same name as the package, but stripped of + # unwanted chars + VAR=`echo $PACKAGE | sed 's/-//g'` + debug "setting $VAR" + eval $VAR="$COMMAND" + return 0 + } + + debug "checking version with $COMMAND" + ($COMMAND --version) < /dev/null > /dev/null 2>&1 || + { + echo "not found." + continue + } + # strip everything that's not a digit, then use cut to get the first field + pkg_version=`$COMMAND --version|head -n 1|sed 's/^[^0-9]*//'|cut -d' ' -f1` + debug "pkg_version $pkg_version" + # remove any non-digit characters from the version numbers to permit numeric + # comparison + pkg_major=`echo $pkg_version | cut -d. -f1 | sed s/[a-zA-Z\-].*//g` + pkg_minor=`echo $pkg_version | cut -d. -f2 | sed s/[a-zA-Z\-].*//g` + pkg_micro=`echo $pkg_version | cut -d. -f3 | sed s/[a-zA-Z\-].*//g` + test -z "$pkg_major" && pkg_major=0 + test -z "$pkg_minor" && pkg_minor=0 + test -z "$pkg_micro" && pkg_micro=0 + debug "found major $pkg_major minor $pkg_minor micro $pkg_micro" + + #start checking the version + debug "version check" + + # reset check + WRONG= + + if [ ! "$pkg_major" -gt "$MAJOR" ]; then + debug "major: $pkg_major <= $MAJOR" + if [ "$pkg_major" -lt "$MAJOR" ]; then + debug "major: $pkg_major < $MAJOR" + WRONG=1 + elif [ ! "$pkg_minor" -gt "$MINOR" ]; then + debug "minor: $pkg_minor <= $MINOR" + if [ "$pkg_minor" -lt "$MINOR" ]; then + debug "minor: $pkg_minor < $MINOR" + WRONG=1 + elif [ "$pkg_micro" -lt "$MICRO" ]; then + debug "micro: $pkg_micro < $MICRO" + WRONG=1 + fi + fi + fi + + if test ! -z "$WRONG"; then + echo "found $pkg_version, not ok !" + continue + else + echo "found $pkg_version, ok." + # we set a var with the same name as the package, but stripped of + # unwanted chars + VAR=`echo $PACKAGE | sed 's/-//g'` + debug "setting $VAR" + eval $VAR="$COMMAND" + return 0 + fi + done + + echo "not found !" + echo "You must have $PACKAGE installed to compile $package." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at $URL" + return 1; +} + +aclocal_check () +{ + # normally aclocal is part of automake + # so we expect it to be in the same place as automake + # so if a different automake is supplied, we need to adapt as well + # so how's about replacing automake with aclocal in the set var, + # and saving that in $aclocal ? + # note, this will fail if the actual automake isn't called automake* + # or if part of the path before it contains it + if [ -z "$automake" ]; then + echo "Error: no automake variable set !" + return 1 + else + aclocal=`echo $automake | sed s/automake/aclocal/` + debug "aclocal: $aclocal" + if [ "$aclocal" != "aclocal" ]; + then + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-aclocal=$aclocal" + fi + if [ ! -x `which $aclocal` ]; then + echo "Error: cannot execute $aclocal !" + return 1 + fi + fi +} + +autoheader_check () +{ + # same here - autoheader is part of autoconf + # use the same voodoo + if [ -z "$autoconf" ]; then + echo "Error: no autoconf variable set !" + return 1 + else + autoheader=`echo $autoconf | sed s/autoconf/autoheader/` + debug "autoheader: $autoheader" + if [ "$autoheader" != "autoheader" ]; + then + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoheader=$autoheader" + fi + if [ ! -x `which $autoheader` ]; then + echo "Error: cannot execute $autoheader !" + return 1 + fi + fi + +} +autoconf_2_52d_check () +{ + # autoconf 2.52d has a weird issue involving a yes:no error + # so don't allow it's use + test -z "$NOCHECK" && { + ac_version=`$autoconf --version|head -n 1|sed 's/^[a-zA-Z\.\ ()]*//;s/ .*$//'` + if test "$ac_version" = "2.52d"; then + echo "autoconf 2.52d has an issue with our current build." + echo "We don't know who's to blame however. So until we do, get a" + echo "regular version. RPM's of a working version are on the gstreamer site." + exit 1 + fi + } + return 0 +} + +die_check () +{ + # call with $DIE + # if set to 1, we need to print something helpful then die + DIE=$1 + if test "x$DIE" = "x1"; + then + echo + echo "- Please get the right tools before proceeding." + echo "- Alternatively, if you're sure we're wrong, run with --nocheck." + exit 1 + fi +} + +autogen_options () +{ + if test "x$1" = "x"; then + return 0 + fi + + while test "x$1" != "x" ; do + optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + case "$1" in + --noconfigure) + NOCONFIGURE=defined + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --noconfigure" + echo "+ configure run disabled" + shift + ;; + --nocheck) + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --nocheck" + NOCHECK=defined + echo "+ autotools version check disabled" + shift + ;; + --debug) + DEBUG=defined + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --debug" + echo "+ debug output enabled" + shift + ;; + --prefix=*) + CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT --prefix=$optarg" + echo "+ passing --prefix=$optarg to configure" + shift + ;; + --prefix) + shift + echo "DEBUG: $1" + CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT --prefix=$1" + echo "+ passing --prefix=$1 to configure" + shift + ;; + + -h|--help) + echo "autogen.sh (autogen options) -- (configure options)" + echo "autogen.sh help options: " + echo " --noconfigure don't run the configure script" + echo " --nocheck don't do version checks" + echo " --debug debug the autogen process" + echo " --prefix will be passed on to configure" + echo + echo " --with-autoconf PATH use autoconf in PATH" + echo " --with-automake PATH use automake in PATH" + echo + echo "to pass options to configure, put them as arguments after -- " + exit 1 + ;; + --with-automake=*) + AUTOMAKE=$optarg + echo "+ using alternate automake in $optarg" + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-automake=$AUTOMAKE" + shift + ;; + --with-autoconf=*) + AUTOCONF=$optarg + echo "+ using alternate autoconf in $optarg" + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoconf=$AUTOCONF" + shift + ;; + --disable*|--enable*|--with*) + echo "+ passing option $1 to configure" + CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $1" + shift + ;; + --) shift ; break ;; + *) echo "- ignoring unknown autogen.sh argument $1"; shift ;; + esac + done + + for arg do CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $arg"; done + if test ! -z "$CONFIGURE_EXT_OPT" + then + echo "+ options passed to configure: $CONFIGURE_EXT_OPT" + fi +} + +toplevel_check () +{ + srcfile=$1 + test -f $srcfile || { + echo "You must run this script in the top-level $package directory" + exit 1 + } +} + + +tool_run () +{ + tool=$1 + options=$2 + echo "+ running $tool $options..." + $tool $options || { + echo + echo $tool failed + exit 1 + } +} diff --git a/common/m4/.cvsignore b/common/m4/.cvsignore new file mode 100644 index 0000000000000000000000000000000000000000..ae2f6d849d71ba2aeeec87797c063fa31f000cda --- /dev/null +++ b/common/m4/.cvsignore @@ -0,0 +1,17 @@ +codeset.m4 +gettext.m4 +glibc21.m4 +iconv.m4 +intdiv0.m4 +inttypes-pri.m4 +inttypes.m4 +inttypes_h.m4 +isc-posix.m4 +lcmessage.m4 +lib-ld.m4 +lib-link.m4 +lib-prefix.m4 +progtest.m4 +stdint_h.m4 +uintmax_t.m4 +ulonglong.m4 diff --git a/common/m4/Makefile.am b/common/m4/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..5201ecb8e16fc1b44af8f5b82aef4e254eb7a047 --- /dev/null +++ b/common/m4/Makefile.am @@ -0,0 +1,24 @@ +EXTRA_DIST = \ + README \ + as-ac-expand.m4 \ + as-auto-alt.m4 \ + as-compiler-flag.m4 \ + as-compiler.m4 \ + as-docbook.m4 \ + as-libtool.m4 \ + as-python.m4 \ + as-scrub-include.m4 \ + as-version.m4 \ + ax_create_stdint_h.m4 \ + glib-gettext.m4 \ + gst-arch.m4 \ + gst-debuginfo.m4 \ + gst-doc.m4 \ + gst-feature.m4 \ + gst-function.m4 \ + gst-glib2.m4 \ + gst-gstreamer.m4 \ + gst-libxml2.m4 \ + gst-makecontext.m4 \ + gst-mcsc.m4 \ + pkg.m4 diff --git a/common/m4/README b/common/m4/README new file mode 100644 index 0000000000000000000000000000000000000000..f044598500ebcd33177d4fdac841cc88e6eef7d9 --- /dev/null +++ b/common/m4/README @@ -0,0 +1,3 @@ +All aclocal .m4 files we need are put here and cat'd to acinclude.m4 in +the source root. Official ones (taken from the relevant devel packages) +are named as-is, unofficial ones (or changed ones) get a gst-prefix. diff --git a/common/m4/as-ac-expand.m4 b/common/m4/as-ac-expand.m4 new file mode 100644 index 0000000000000000000000000000000000000000..d6c9e33060aa8b828347bcda9f8b8ef17d7f61de --- /dev/null +++ b/common/m4/as-ac-expand.m4 @@ -0,0 +1,43 @@ +dnl as-ac-expand.m4 0.2.0 +dnl autostars m4 macro for expanding directories using configure's prefix +dnl thomas@apestaart.org + +dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR) +dnl example +dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) +dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local + +AC_DEFUN([AS_AC_EXPAND], +[ + EXP_VAR=[$1] + FROM_VAR=[$2] + + dnl first expand prefix and exec_prefix if necessary + prefix_save=$prefix + exec_prefix_save=$exec_prefix + + dnl if no prefix given, then use /usr/local, the default prefix + if test "x$prefix" = "xNONE"; then + prefix="$ac_default_prefix" + fi + dnl if no exec_prefix given, then use prefix + if test "x$exec_prefix" = "xNONE"; then + exec_prefix=$prefix + fi + + full_var="$FROM_VAR" + dnl loop until it doesn't change anymore + while true; do + new_full_var="`eval echo $full_var`" + if test "x$new_full_var" = "x$full_var"; then break; fi + full_var=$new_full_var + done + + dnl clean up + full_var=$new_full_var + AC_SUBST([$1], "$full_var") + + dnl restore prefix and exec_prefix + prefix=$prefix_save + exec_prefix=$exec_prefix_save +]) diff --git a/common/m4/as-auto-alt.m4 b/common/m4/as-auto-alt.m4 new file mode 100644 index 0000000000000000000000000000000000000000..3f7920dd23525950c94640283600ca49e8a44d56 --- /dev/null +++ b/common/m4/as-auto-alt.m4 @@ -0,0 +1,50 @@ +dnl as-auto-alt.m4 0.0.2 +dnl autostars m4 macro for supplying alternate autotools versions to configure +dnl thomas@apestaart.org +dnl +dnl AS_AUTOTOOLS_ALTERNATE() +dnl +dnl supplies --with arguments for autoconf, autoheader, automake, aclocal + +AC_DEFUN([AS_AUTOTOOLS_ALTERNATE], +[ + dnl allow for different autoconf version + AC_ARG_WITH(autoconf, + AC_HELP_STRING([--with-autoconf], + [use a different autoconf for regeneration of Makefiles]), + [ + unset AUTOCONF + AM_MISSING_PROG(AUTOCONF, ${withval}) + AC_MSG_NOTICE([Using $AUTOCONF as autoconf]) + ]) + + dnl allow for different autoheader version + AC_ARG_WITH(autoheader, + AC_HELP_STRING([--with-autoheader], + [use a different autoheader for regeneration of Makefiles]), + [ + unset AUTOHEADER + AM_MISSING_PROG(AUTOHEADER, ${withval}) + AC_MSG_NOTICE([Using $AUTOHEADER as autoheader]) + ]) + + dnl allow for different automake version + AC_ARG_WITH(automake, + AC_HELP_STRING([--with-automake], + [use a different automake for regeneration of Makefiles]), + [ + unset AUTOMAKE + AM_MISSING_PROG(AUTOMAKE, ${withval}) + AC_MSG_NOTICE([Using $AUTOMAKE as automake]) + ]) + + dnl allow for different aclocal version + AC_ARG_WITH(aclocal, + AC_HELP_STRING([--with-aclocal], + [use a different aclocal for regeneration of Makefiles]), + [ + unset ACLOCAL + AM_MISSING_PROG(ACLOCAL, ${withval}) + AC_MSG_NOTICE([Using $ACLOCAL as aclocal]) + ]) +]) diff --git a/common/m4/as-compiler-flag.m4 b/common/m4/as-compiler-flag.m4 new file mode 100644 index 0000000000000000000000000000000000000000..4d2cdab1821160b21babcbeffb1073bc893c5f22 --- /dev/null +++ b/common/m4/as-compiler-flag.m4 @@ -0,0 +1,25 @@ +dnl as-compiler-flag.m4 0.0.1 +dnl autostars m4 macro for detection of compiler flags +dnl +dnl ds@schleef.org + +AC_DEFUN([AS_COMPILER_FLAG], +[ + AC_MSG_CHECKING(to see if compiler understands $1) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + diff --git a/common/m4/as-compiler.m4 b/common/m4/as-compiler.m4 new file mode 100644 index 0000000000000000000000000000000000000000..8918811d8ad28ef41c679786af26bed3e167ed3f --- /dev/null +++ b/common/m4/as-compiler.m4 @@ -0,0 +1,41 @@ +dnl as-compiler.m4 0.0.2 +dnl autostars m4 macro for detection of compiler flavour +dnl +dnl thomas@apestaart.org + +dnl AS_COMPILER(COMPILER) +dnl will set COMPILER to +dnl - gcc +dnl - forte +dnl - (empty) if no guess could be made + +AC_DEFUN([AS_COMPILER], +[ + as_compiler= + AC_MSG_CHECKING(for compiler flavour) + + dnl is it gcc ? + if test "x$GCC" = "xyes"; then + as_compiler="gcc" + fi + + dnl is it forte ? + AC_TRY_RUN([ +int main +(int argc, char *argv[]) +{ +#ifdef __sun + return 0; +#else + return 1; +#endif +} + ], as_compiler="forte", ,) + + if test "x$as_compiler" = "x"; then + AC_MSG_RESULT([unknown !]) + else + AC_MSG_RESULT($as_compiler) + fi + [$1]=$as_compiler +]) diff --git a/common/m4/as-docbook.m4 b/common/m4/as-docbook.m4 new file mode 100644 index 0000000000000000000000000000000000000000..6a2aa458d83d34f849981b6dfee368b3c7d56718 --- /dev/null +++ b/common/m4/as-docbook.m4 @@ -0,0 +1,66 @@ +dnl AS_DOCBOOK([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl checks if xsltproc can build docbook documentation +dnl (which is possible if the catalog is set up properly +dnl I also tried checking for a specific version and type of docbook +dnl but xsltproc seemed to happily run anyway, so we can't check for that +dnl and version +dnl this macro takes inspiration from +dnl http://www.movement.uklinux.net/docs/docbook-autotools/configure.html +AC_DEFUN([AS_DOCBOOK], +[ + XSLTPROC_FLAGS=--nonet + DOCBOOK_ROOT= + TYPE_LC=xml + TYPE_UC=XML + DOCBOOK_VERSION=4.1.2 + + if test ! -f /etc/xml/catalog; then + for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/; + do + if test -d "$i"; then + DOCBOOK_ROOT=$i + fi + done + else + XML_CATALOG=/etc/xml/catalog + CAT_ENTRY_START='' + fi + + dnl We need xsltproc to process the test + AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,) + XSLTPROC_WORKS=no + if test -n "$XSLTPROC"; then + AC_MSG_CHECKING([whether xsltproc docbook processing works]) + + if test -n "$XML_CATALOG"; then + DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" + else + DB_FILE="$DOCBOOK_ROOT/docbook.xsl" + fi + $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END + + + + +END + if test "$?" = 0; then + XSLTPROC_WORKS=yes + fi + AC_MSG_RESULT($XSLTPROC_WORKS) + fi + + if test "x$XSLTPROC_WORKS" = "xyes"; then + dnl execute ACTION-IF-FOUND + ifelse([$1], , :, [$1]) + else + dnl execute ACTION-IF-NOT-FOUND + ifelse([$2], , :, [$2]) + fi + + AC_SUBST(XML_CATALOG) + AC_SUBST(XSLTPROC_FLAGS) + AC_SUBST(DOCBOOK_ROOT) + AC_SUBST(CAT_ENTRY_START) + AC_SUBST(CAT_ENTRY_END) +]) diff --git a/common/m4/as-libtool.m4 b/common/m4/as-libtool.m4 new file mode 100644 index 0000000000000000000000000000000000000000..807cf24aa30fefd94f46d40139dfa30ab3ca8941 --- /dev/null +++ b/common/m4/as-libtool.m4 @@ -0,0 +1,55 @@ +dnl as-libtool.m4 0.1.3 +dnl autostars m4 macro for libtool versioning +dnl thomas@apestaart.org +dnl +dnl AS_LIBTOOL(PREFIX, CURRENT, REVISION, AGE, RELEASE) +dnl example +dnl AS_VERSION(GST, 2, 0, 0) +dnl +dnl this macro +dnl - defines [$PREFIX]_CURRENT, REVISION AND AGE +dnl - defines [$PREFIX]_LIBVERSION +dnl - defines [$PREFIX]_LT_LDFLAGS to set versioning +dnl - AC_SUBST's them all +dnl +dnl if USE_RELEASE is used, then add a -release option to the LDFLAGS +dnl with the given release version +dnl then use [$PREFIX]_LT_LDFLAGS in the relevant Makefile.am's + +AC_DEFUN([AS_LIBTOOL], +[ + [$1]_CURRENT=[$2] + [$1]_REVISION=[$3] + [$1]_AGE=[$4] + [$1]_LIBVERSION=[$2]:[$3]:[$4] + AC_SUBST([$1]_CURRENT) + AC_SUBST([$1]_REVISION) + AC_SUBST([$1]_AGE) + AC_SUBST([$1]_LIBVERSION) + +dnl [$1]_LT_LDFLAGS="$[$1]_LT_LDFLAGS -version-info $[$1]_LIBVERSION" + if test ! -z "[$5]" + then + [$1]_LT_LDFLAGS="$[$1]_LT_LDFLAGS -release [$5]" + fi + AC_SUBST([$1]_LT_LDFLAGS) + + AC_LIBTOOL_DLOPEN + AM_PROG_LIBTOOL + + case "$host" in + *-*-mingw*) + as_libtool_win32=yes + enable_static=no + enable_shared=yes + ;; + *) + as_libtool_win32=no + ;; + esac + AM_CONDITIONAL(AS_LIBTOOL_WIN32, [test "$as_libtool_win32" = "yes"]) + + m4_pattern_allow([AS_LIBTOOL_WIN32]) + m4_pattern_allow([AS_LIBTOOL_WIN32_TRUE]) + m4_pattern_allow([AS_LIBTOOL_WIN32_FALSE]) +]) diff --git a/common/m4/as-python.m4 b/common/m4/as-python.m4 new file mode 100644 index 0000000000000000000000000000000000000000..eb9b1754de2ee725514901b325c16b7c05d78852 --- /dev/null +++ b/common/m4/as-python.m4 @@ -0,0 +1,152 @@ +## ------------------------ +## Python file handling +## From Andrew Dalke +## Updated by James Henstridge +## Updated by Andy Wingo to loop through possible pythons +## ------------------------ + +# AS_PATH_PYTHON([MINIMUM-VERSION]) + +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. + +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. + +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). + +# If the MINIMUM-VERSION argument is passed, AS_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. + +# Updated to loop over all possible python binaries by Andy Wingo +# +# Updated to only warn and unset PYTHON if no good one is found + +AC_DEFUN([AS_PATH_PYTHON], + [ + dnl Find a version of Python. I could check for python versions 1.4 + dnl or earlier, but the default installation locations changed from + dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages + dnl in 1.5, and I don't want to maintain that logic. + + dnl should we do the version check? + PYTHON_CANDIDATES="python python2.2 python2.1 python2.0 python2 \ + python1.6 python1.5" + ifelse([$1],[], + [AC_PATH_PROG(PYTHON, $PYTHON_CANDIDATES)], + [ + AC_MSG_NOTICE(Looking for Python version >= $1) + changequote(<<, >>)dnl + prog=" +import sys, string +minver = '$1' +# split string by '.' and convert to numeric +minver_info = map(string.atoi, string.split(minver, '.')) +# we can now do comparisons on the two lists: +if sys.version_info >= tuple(minver_info): + sys.exit(0) +else: + sys.exit(1)" + changequote([, ])dnl + + python_good=false + for python_candidate in $PYTHON_CANDIDATES; do + unset PYTHON + AC_PATH_PROG(PYTHON, $python_candidate) 1> /dev/null 2> /dev/null + + if test "x$PYTHON" = "x"; then continue; fi + + if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC; then + AC_MSG_CHECKING(["$PYTHON":]) + AC_MSG_RESULT([okay]) + python_good=true + break; + else + dnl clear the cache val + unset ac_cv_path_PYTHON + fi + done + ]) + + if test "$python_good" != "true"; then + AC_MSG_WARN([No suitable version of python found]) + PYTHON= + else + + AC_MSG_CHECKING([local Python configuration]) + + dnl Query Python for its version number. Getting [:3] seems to be + dnl the best way to do this; it's what "site.py" does in the standard + dnl library. Need to change quote character because of [:3] + + AC_SUBST(PYTHON_VERSION) + changequote(<<, >>)dnl + PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"` + changequote([, ])dnl + + + dnl Use the values of $prefix and $exec_prefix for the corresponding + dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made + dnl distinct variables so they can be overridden if need be. However, + dnl general consensus is that you shouldn't need this ability. + + AC_SUBST(PYTHON_PREFIX) + PYTHON_PREFIX='${prefix}' + + AC_SUBST(PYTHON_EXEC_PREFIX) + PYTHON_EXEC_PREFIX='${exec_prefix}' + + dnl At times (like when building shared libraries) you may want + dnl to know which OS platform Python thinks this is. + + AC_SUBST(PYTHON_PLATFORM) + PYTHON_PLATFORM=`$PYTHON -c "import sys; print sys.platform"` + + + dnl Set up 4 directories: + + dnl pythondir -- where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behaviour + dnl is more consistent with lispdir.m4 for example. + dnl + dnl Also, if the package prefix isn't the same as python's prefix, + dnl then the old $(pythondir) was pretty useless. + + AC_SUBST(pythondir) + pythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION/site-packages + + dnl pkgpythondir -- $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. + dnl Maybe this should be put in python.am? + + AC_SUBST(pkgpythondir) + pkgpythondir=\${pythondir}/$PACKAGE + + dnl pyexecdir -- directory for installing python extension modules + dnl (shared libraries) Was PYTHON_SITE_EXEC in previous betas. + + AC_SUBST(pyexecdir) + pyexecdir=$PYTHON_EXEC_PREFIX"/lib/python"$PYTHON_VERSION/site-packages + + dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) + dnl Maybe this should be put in python.am? + + AC_SUBST(pkgpyexecdir) + pkgpyexecdir=\${pyexecdir}/$PACKAGE + + AC_MSG_RESULT([looks good]) + + fi +]) diff --git a/common/m4/as-scrub-include.m4 b/common/m4/as-scrub-include.m4 new file mode 100644 index 0000000000000000000000000000000000000000..1ef251f8b0b674394a5df42fb39b6d3fc3f79603 --- /dev/null +++ b/common/m4/as-scrub-include.m4 @@ -0,0 +1,33 @@ +dnl as-scrub-include.m4 0.0.2 +dnl autostars m4 macro for scrubbing CFLAGS of system include dirs +dnl because gcc 3.x complains about including system including dirs +dnl +dnl thomas@apestaart.org +dnl +dnl This macro uses output of cpp -v and expects it to contain text that +dnl looks a little bit like this: +dnl #include <...> search starts here: +dnl /usr/local/include +dnl /usr/lib/gcc-lib/i386-redhat-linux/3.2/include +dnl /usr/include +dnl End of search list. + +dnl AS_SCRUB_INCLUDE(VAR) +dnl example +dnl AS_SCRUB_INCLUDE(CFLAGS) +dnl will remove all system include dirs from the given CFLAGS + +AC_DEFUN([AS_SCRUB_INCLUDE], +[ + GIVEN_CFLAGS=$[$1] + INCLUDE_DIRS=`echo | cpp -v 2>&1` + + dnl remove everything from this output between the "starts here" and "End of" + dnl line + INCLUDE_DIRS=`echo $INCLUDE_DIRS | sed -e 's/.*<...> search starts here://' | sed -e 's/End of search list.*//'` + for dir in $INCLUDE_DIRS; do + command="sed -e s#-I$dir##" + GIVEN_CFLAGS=`echo $GIVEN_CFLAGS | $command` + done + [$1]=$GIVEN_CFLAGS +]) diff --git a/common/m4/as-version.m4 b/common/m4/as-version.m4 new file mode 100644 index 0000000000000000000000000000000000000000..4df69db1f0e5c810420dc49dd07dfdc9ef046158 --- /dev/null +++ b/common/m4/as-version.m4 @@ -0,0 +1,59 @@ +dnl version.m4 0.0.5 +dnl autostars m4 macro for versioning +dnl thomas@apestaart.org +dnl +dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, ACTION_IF_NO_NANO, ACTION_IF_NANO) +dnl example +dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,) +dnl for a 0.3.2 release version +dnl +dnl this macro +dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO +dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode +dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE +dnl - executes the relevant action +dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE +dnl as well as the little ones +dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents +dnl maintainer mode from running ok +dnl +dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h + +AC_DEFUN([AS_VERSION], +[ + PACKAGE=[$1] + [$2]_MAJOR=[$3] + [$2]_MINOR=[$4] + [$2]_MICRO=[$5] + NANO=[$6] + [$2]_NANO=$NANO + if test "x$NANO" = "x" || test "x$NANO" = "x0"; + then + AC_MSG_NOTICE(configuring [$1] for release) + VERSION=[$3].[$4].[$5] + [$2]_RELEASE=1 + dnl execute action + ifelse([$7], , :, [$7]) + else + AC_MSG_NOTICE(configuring [$1] for development with nano $NANO) + VERSION=[$3].[$4].[$5].$NANO + [$2]_RELEASE=`date +%Y%m%d_%H%M%S` + dnl execute action + ifelse([$8], , :, [$8]) + fi + + [$2]=$VERSION + AC_DEFINE_UNQUOTED([$2], "$[$2]", [Define the version]) + AC_SUBST([$2]) + AC_DEFINE_UNQUOTED([$2]_RELEASE, "$[$2]_RELEASE", [Define the release version]) + AC_SUBST([$2]_RELEASE) + + AC_SUBST([$2]_MAJOR) + AC_SUBST([$2]_MINOR) + AC_SUBST([$2]_MICRO) + AC_SUBST([$2]_NANO) + AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name]) + AC_SUBST(PACKAGE) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version]) + AC_SUBST(VERSION) +]) diff --git a/common/m4/ax_create_stdint_h.m4 b/common/m4/ax_create_stdint_h.m4 new file mode 100644 index 0000000000000000000000000000000000000000..706fc1ce058ee558b02975b236fbcd47b742c828 --- /dev/null +++ b/common/m4/ax_create_stdint_h.m4 @@ -0,0 +1,569 @@ +dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] +dnl +dnl the "ISO C9X: 7.18 Integer types " section requires the +dnl existence of an include file that defines a set of +dnl typedefs, especially uint8_t,int32_t,uintptr_t. +dnl Many older installations will not provide this file, but some will +dnl have the very same definitions in . In other enviroments +dnl we can use the inet-types in which would define the +dnl typedefs int8_t and u_int8_t respectivly. +dnl +dnl This macros will create a local "_stdint.h" or the headerfile given as +dnl an argument. In many cases that file will just "#include " +dnl or "#include ", while in other environments it will provide +dnl the set of basic 'stdint's definitions/typedefs: +dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t +dnl int_least32_t.. int_fast32_t.. intmax_t +dnl which may or may not rely on the definitions of other files, +dnl or using the AC_CHECK_SIZEOF macro to determine the actual +dnl sizeof each type. +dnl +dnl if your header files require the stdint-types you will want to create an +dnl installable file mylib-int.h that all your other installable header +dnl may include. So if you have a library package named "mylib", just use +dnl AX_CREATE_STDINT_H(mylib-int.h) +dnl in configure.ac and go to install that very header file in Makefile.am +dnl along with the other headers (mylib.h) - and the mylib-specific headers +dnl can simply use "#include " to obtain the stdint-types. +dnl +dnl Remember, if the system already had a valid , the generated +dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things... +dnl +dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/) +dnl @version $Id$ +dnl @author Guido Draheim + +AC_DEFUN([AX_CREATE_STDINT_H], +[# ------ AX CREATE STDINT H ------------------------------------- +AC_MSG_CHECKING([for stdint types]) +ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` +# try to shortcircuit - if the default include path of the compiler +# can find a "stdint.h" header then we assume that all compilers can. +AC_CACHE_VAL([ac_cv_header_stdint_t],[ +old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" +old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" +old_CFLAGS="$CFLAGS" ; CFLAGS="" +AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], +[ac_cv_stdint_result="(assuming C99 compatible system)" + ac_cv_header_stdint_t="stdint.h"; ], +[ac_cv_header_stdint_t=""]) +CXXFLAGS="$old_CXXFLAGS" +CPPFLAGS="$old_CPPFLAGS" +CFLAGS="$old_CFLAGS" ]) + +v="... $ac_cv_header_stdint_h" +if test "$ac_stdint_h" = "stdint.h" ; then + AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)]) +elif test "$ac_stdint_h" = "inttypes.h" ; then + AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)]) +elif test "_$ac_cv_header_stdint_t" = "_" ; then + AC_MSG_RESULT([(putting them into $ac_stdint_h)$v]) +else + ac_cv_header_stdint="$ac_cv_header_stdint_t" + AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)]) +fi + +if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. + +dnl .....intro message done, now do a few system checks..... +dnl btw, all CHECK_TYPE macros do automatically "DEFINE" a type, therefore +dnl we use the autoconf implementation detail _AC CHECK_TYPE_NEW instead + +inttype_headers=`echo $2 | sed -e 's/,/ /g'` + +ac_cv_stdint_result="(no helpful system typedefs seen)" +AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[ + ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) + AC_MSG_RESULT([(..)]) + for i in stdint.h inttypes.h sys/inttypes.h $inttype_headers ; do + unset ac_cv_type_uintptr_t + unset ac_cv_type_uint64_t + _AC_CHECK_TYPE_NEW(uintptr_t,[ac_cv_header_stdint_x=$i],dnl + continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) + ac_cv_stdint_result="(seen uintptr_t$and64 in $i)" + break; + done + AC_MSG_CHECKING([for stdint uintptr_t]) + ]) + +if test "_$ac_cv_header_stdint_x" = "_" ; then +AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[ + ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) + AC_MSG_RESULT([(..)]) + for i in inttypes.h sys/inttypes.h stdint.h $inttype_headers ; do + unset ac_cv_type_uint32_t + unset ac_cv_type_uint64_t + AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],dnl + continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) + ac_cv_stdint_result="(seen uint32_t$and64 in $i)" + break; + done + AC_MSG_CHECKING([for stdint uint32_t]) + ]) +fi + +if test "_$ac_cv_header_stdint_x" = "_" ; then +if test "_$ac_cv_header_stdint_o" = "_" ; then +AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ + ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) + AC_MSG_RESULT([(..)]) + for i in sys/types.h inttypes.h sys/inttypes.h $inttype_headers ; do + unset ac_cv_type_u_int32_t + unset ac_cv_type_u_int64_t + AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],dnl + continue,[#include <$i>]) + AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>]) + ac_cv_stdint_result="(seen u_int32_t$and64 in $i)" + break; + done + AC_MSG_CHECKING([for stdint u_int32_t]) + ]) +fi fi + +dnl if there was no good C99 header file, do some typedef checks... +if test "_$ac_cv_header_stdint_x" = "_" ; then + AC_MSG_CHECKING([for stdint datatype model]) + AC_MSG_RESULT([(..)]) + AC_CHECK_SIZEOF(char) + AC_CHECK_SIZEOF(short) + AC_CHECK_SIZEOF(int) + AC_CHECK_SIZEOF(long) + AC_CHECK_SIZEOF(void*) + ac_cv_stdint_char_model="" + ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_char" + ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_short" + ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_int" + ac_cv_stdint_long_model="" + ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_int" + ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_long" + ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_voidp" + name="$ac_cv_stdint_long_model" + case "$ac_cv_stdint_char_model/$ac_cv_stdint_long_model" in + 122/242) name="$name, IP16 (standard 16bit machine)" ;; + 122/244) name="$name, LP32 (standard 32bit mac/win)" ;; + 122/*) name="$name (unusual int16 model)" ;; + 124/444) name="$name, ILP32 (standard 32bit unixish)" ;; + 124/488) name="$name, LP64 (standard 64bit unixish)" ;; + 124/448) name="$name, LLP64 (unusual 64bit unixish)" ;; + 124/*) name="$name (unusual int32 model)" ;; + 128/888) name="$name, ILP64 (unusual 64bit numeric)" ;; + 128/*) name="$name (unusual int64 model)" ;; + 222/*|444/*) name="$name (unusual dsptype)" ;; + *) name="$name (very unusal model)" ;; + esac + AC_MSG_RESULT([combined for stdint datatype model... $name]) +fi + +if test "_$ac_cv_header_stdint_x" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_x" +elif test "_$ac_cv_header_stdint_o" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_o" +elif test "_$ac_cv_header_stdint_u" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_u" +else + ac_cv_header_stdint="stddef.h" +fi + +AC_MSG_CHECKING([for extra inttypes in chosen header]) +AC_MSG_RESULT([($ac_cv_header_stdint)]) +dnl see if int_least and int_fast types are present in _this_ header. +unset ac_cv_type_int_least32_t +unset ac_cv_type_int_fast32_t +AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) +AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) +AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>]) + +fi # shortcircut to system "stdint.h" +# ------------------ PREPARE VARIABLES ------------------------------ +if test "$GCC" = "yes" ; then +ac_cv_stdint_message="using gnu compiler "`$CC --version | head -n 1` +else +ac_cv_stdint_message="using $CC" +fi + +AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl +$ac_cv_stdint_result]) + +# ----------------- DONE inttypes.h checks START header ------------- +AC_CONFIG_COMMANDS([$ac_stdint_h],[ +AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h) +ac_stdint=$tmp/_stdint.h + +echo "#ifndef" $_ac_stdint_h >$ac_stdint +echo "#define" $_ac_stdint_h "1" >>$ac_stdint +echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint +echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint +echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint +if test "_$ac_cv_header_stdint_t" != "_" ; then +echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint +fi + +cat >>$ac_stdint < +#else +#include + +/* .................... configured part ............................ */ + +STDINT_EOF + +echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint +if test "_$ac_cv_header_stdint_x" != "_" ; then + ac_header="$ac_cv_header_stdint_x" + echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint +fi + +echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint +if test "_$ac_cv_header_stdint_o" != "_" ; then + ac_header="$ac_cv_header_stdint_o" + echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint +fi + +echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint +if test "_$ac_cv_header_stdint_u" != "_" ; then + ac_header="$ac_cv_header_stdint_u" + echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint +fi + +echo "" >>$ac_stdint + +if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then + echo "#include <$ac_header>" >>$ac_stdint + echo "" >>$ac_stdint +fi fi + +echo "/* which 64bit typedef has been found */" >>$ac_stdint +if test "$ac_cv_type_uint64_t" = "yes" ; then +echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint +fi +if test "$ac_cv_type_u_int64_t" = "yes" ; then +echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint +fi +echo "" >>$ac_stdint + +echo "/* which type model has been detected */" >>$ac_stdint +if test "_$ac_cv_stdint_char_model" != "_" ; then +echo "#define _STDINT_CHAR_MODEL" "$ac_cv_stdint_char_model" >>$ac_stdint +echo "#define _STDINT_LONG_MODEL" "$ac_cv_stdint_long_model" >>$ac_stdint +else +echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint +echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint +fi +echo "" >>$ac_stdint + +echo "/* whether int_least types were detected */" >>$ac_stdint +if test "$ac_cv_type_int_least32_t" = "yes"; then +echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint +fi +echo "/* whether int_fast types were detected */" >>$ac_stdint +if test "$ac_cv_type_int_fast32_t" = "yes"; then +echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint +fi +echo "/* whether intmax_t type was detected */" >>$ac_stdint +if test "$ac_cv_type_intmax_t" = "yes"; then +echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint +fi +echo "" >>$ac_stdint + + cat >>$ac_stdint <= 199901L +#define _HAVE_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; + +#elif !defined __STRICT_ANSI__ +#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ +#define _HAVE_UINT64_T +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; + +#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ +/* note: all ELF-systems seem to have loff-support which needs 64-bit */ +#if !defined _NO_LONGLONG +#define _HAVE_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif + +#elif defined __alpha || (defined __mips && defined _ABIN32) +#if !defined _NO_LONGLONG +typedef long int64_t; +typedef unsigned long uint64_t; +#endif + /* compiler/cpu type to define int64_t */ +#endif +#endif +#endif + +#if defined _STDINT_HAVE_U_INT_TYPES +/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ +typedef u_int8_t uint8_t; +typedef u_int16_t uint16_t; +typedef u_int32_t uint32_t; + +/* glibc compatibility */ +#ifndef __int8_t_defined +#define __int8_t_defined +#endif +#endif + +#ifdef _STDINT_NEED_INT_MODEL_T +/* we must guess all the basic types. Apart from byte-adressable system, */ +/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ +/* (btw, those nibble-addressable systems are way off, or so we assume) */ + +dnl /* have a look at "64bit and data size neutrality" at */ +dnl /* http://unix.org/version2/whatsnew/login_64bit.html */ +dnl /* (the shorthand "ILP" types always have a "P" part) */ + +#if defined _STDINT_BYTE_MODEL +#if _STDINT_LONG_MODEL+0 == 242 +/* 2:4:2 = IP16 = a normal 16-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef long int32_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 +/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ +/* 4:4:4 = ILP32 = a normal 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 +/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ +/* 4:8:8 = LP64 = a normal 64-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +/* this system has a "long" of 64bit */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef unsigned long uint64_t; +typedef long int64_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 448 +/* LLP64 a 64-bit system derived from a 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +/* assuming the system has a "long long" */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef unsigned long long uint64_t; +typedef long long int64_t; +#endif +#else +#define _STDINT_NO_INT32_T +#endif +#else +#define _STDINT_NO_INT8_T +#define _STDINT_NO_INT32_T +#endif +#endif + +/* + * quote from SunOS-5.8 sys/inttypes.h: + * Use at your own risk. As of February 1996, the committee is squarely + * behind the fixed sized types; the "least" and "fast" types are still being + * discussed. The probability that the "fast" types may be removed before + * the standard is finalized is high enough that they are not currently + * implemented. + */ + +#if defined _STDINT_NEED_INT_LEAST_T +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +#ifdef _HAVE_UINT64_T +typedef int64_t int_least64_t; +#endif + +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +#ifdef _HAVE_UINT64_T +typedef uint64_t uint_least64_t; +#endif + /* least types */ +#endif + +#if defined _STDINT_NEED_INT_FAST_T +typedef int8_t int_fast8_t; +typedef int int_fast16_t; +typedef int32_t int_fast32_t; +#ifdef _HAVE_UINT64_T +typedef int64_t int_fast64_t; +#endif + +typedef uint8_t uint_fast8_t; +typedef unsigned uint_fast16_t; +typedef uint32_t uint_fast32_t; +#ifdef _HAVE_UINT64_T +typedef uint64_t uint_fast64_t; +#endif + /* fast types */ +#endif + +#ifdef _STDINT_NEED_INTMAX_T +#ifdef _HAVE_UINT64_T +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; +#else +typedef long intmax_t; +typedef unsigned long uintmax_t; +#endif +#endif + +#ifdef _STDINT_NEED_INTPTR_T +#ifndef __intptr_t_defined +#define __intptr_t_defined +/* we encourage using "long" to store pointer values, never use "int" ! */ +#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 +typedef unsinged int uintptr_t; +typedef int intptr_t; +#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 +typedef unsigned long uintptr_t; +typedef long intptr_t; +#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T +typedef uint64_t uintptr_t; +typedef int64_t intptr_t; +#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ +typedef unsigned long uintptr_t; +typedef long intptr_t; +#endif +#endif +#endif + + /* shortcircuit*/ +#endif + /* once */ +#endif +#endif +STDINT_EOF + if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then + AC_MSG_NOTICE([$ac_stdint_h is unchanged]) + else + ac_dir=`AS_DIRNAME(["$ac_stdint_h"])` + AS_MKDIR_P(["$ac_dir"]) + rm -f $ac_stdint_h + mv $ac_stdint $ac_stdint_h + fi +],[# variables for create stdint.h replacement +PACKAGE="$PACKAGE" +VERSION="$VERSION" +ac_stdint_h="$ac_stdint_h" +_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h) +ac_cv_stdint_message="$ac_cv_stdint_message" +ac_cv_header_stdint_t="$ac_cv_header_stdint_t" +ac_cv_header_stdint_x="$ac_cv_header_stdint_x" +ac_cv_header_stdint_o="$ac_cv_header_stdint_o" +ac_cv_header_stdint_u="$ac_cv_header_stdint_u" +ac_cv_type_uint64_t="$ac_cv_type_uint64_t" +ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" +ac_cv_stdint_char_model="$ac_cv_stdint_char_model" +ac_cv_stdint_long_model="$ac_cv_stdint_long_model" +ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" +ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" +ac_cv_type_intmax_t="$ac_cv_type_intmax_t" +]) +]) diff --git a/common/m4/glib-gettext.m4 b/common/m4/glib-gettext.m4 new file mode 100644 index 0000000000000000000000000000000000000000..33d6473d0bca5dcc32fa6dfe561fc5972160cd7c --- /dev/null +++ b/common/m4/glib-gettext.m4 @@ -0,0 +1,377 @@ +# Copyright (C) 1995-2002 Free Software Foundation, Inc. +# Copyright (C) 2001-2003 Red Hat, Inc. +# +# This file is free software, distributed under the terms of the GNU +# General Public License. As a special exception to the GNU General +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995, 1996 +# +# Modified to never use included libintl. +# Owen Taylor , 12/15/1998 +# +# Major rework to remove unused code +# Owen Taylor , 12/11/2002 +# +# Added better handling of ALL_LINGUAS from GNU gettext version +# written by Bruno Haible, Owen Taylor 5/30/3002 + +# +# We need this here as well, since someone might use autoconf-2.5x +# to configure GLib then an older version to configure a package +# using AM_GLIB_GNU_GETTEXT +AC_PREREQ(2.53) + +dnl +dnl We go to great lengths to make sure that aclocal won't +dnl try to pull in the installed version of these macros +dnl when running aclocal in the glib directory. +dnl +m4_copy([AC_DEFUN],[glib_DEFUN]) +m4_copy([AC_REQUIRE],[glib_REQUIRE]) +dnl +dnl At the end, if we're not within glib, we'll define the public +dnl definitions in terms of our private definitions. +dnl + +# GLIB_LC_MESSAGES +#-------------------- +glib_DEFUN([GLIB_LC_MESSAGES], + [AC_CHECK_HEADERS([locale.h]) + if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi + fi]) + +# GLIB_PATH_PROG_WITH_TEST +#---------------------------- +dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +# GLIB_WITH_NLS +#----------------- +glib_DEFUN([GLIB_WITH_NLS], + dnl NLS is obligatory + [USE_NLS=yes + AC_SUBST(USE_NLS) + + gt_cv_have_gettext=no + + CATOBJEXT=NONE + XGETTEXT=: + INTLLIBS= + + AC_CHECK_HEADER(libintl.h, + [gt_cv_func_dgettext_libintl="no" + libintl_extra_libs="" + + # + # First check in libc + # + AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, + [AC_TRY_LINK([ +#include +], + [return (int) dgettext ("","")], + gt_cv_func_dgettext_libc=yes, + gt_cv_func_dgettext_libc=no) + ]) + + if test "$gt_cv_func_dgettext_libc" = "yes" ; then + AC_CHECK_FUNCS(bind_textdomain_codeset) + fi + + # + # If we don't have everything we want, check in libintl + # + if test "$gt_cv_func_dgettext_libc" != "yes" \ + || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then + + AC_CHECK_LIB(intl, bindtextdomain, + [AC_CHECK_LIB(intl, dgettext, + gt_cv_func_dgettext_libintl=yes)]) + + if test "$gt_cv_func_dgettext_libintl" != "yes" ; then + AC_MSG_CHECKING([if -liconv is needed to use gettext]) + AC_MSG_RESULT([]) + AC_CHECK_LIB(intl, dcgettext, + [gt_cv_func_dgettext_libintl=yes + libintl_extra_libs=-liconv], + :,-liconv) + fi + + # + # If we found libintl, then check in it for bind_textdomain_codeset(); + # we'll prefer libc if neither have bind_textdomain_codeset(), + # and both have dgettext + # + if test "$gt_cv_func_dgettext_libintl" = "yes" ; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $libintl_extra_libs" + unset ac_cv_func_bind_textdomain_codeset + AC_CHECK_FUNCS(bind_textdomain_codeset) + LIBS="$glib_save_LIBS" + + if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then + gt_cv_func_dgettext_libc=no + else + if test "$gt_cv_func_dgettext_libc" = "yes"; then + gt_cv_func_dgettext_libintl=no + fi + fi + fi + fi + + if test "$gt_cv_func_dgettext_libc" = "yes" \ + || test "$gt_cv_func_dgettext_libintl" = "yes"; then + gt_cv_have_gettext=yes + fi + + if test "$gt_cv_func_dgettext_libintl" = "yes"; then + INTLLIBS="-lintl $libintl_extra_libs" + fi + + if test "$gt_cv_have_gettext" = "yes"; then + AC_DEFINE(HAVE_GETTEXT,1, + [Define if the GNU gettext() function is already present or preinstalled.]) + GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl + if test "$MSGFMT" != "no"; then + AC_CHECK_FUNCS(dcgettext) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr], + [CATOBJEXT=.gmo + DATADIRNAME=share], + [case $host in + *-*-solaris*) + dnl On Solaris, if bind_textdomain_codeset is in libc, + dnl GNU format message catalog is always supported, + dnl since both are added to the libc all together. + dnl Hence, we'd like to go with DATADIRNAME=share and + dnl and CATOBJEXT=.gmo in this case. + AC_CHECK_FUNC(bind_textdomain_codeset, + [CATOBJEXT=.gmo + DATADIRNAME=share], + [CATOBJEXT=.mo + DATADIRNAME=lib]) + ;; + *) + CATOBJEXT=.mo + DATADIRNAME=lib + ;; + esac]) + INSTOBJEXT=.mo + else + gt_cv_have_gettext=no + fi + fi + ]) + + if test "$gt_cv_have_gettext" = "yes" ; then + AC_DEFINE(ENABLE_NLS, 1, + [always defined to indicate that i18n is enabled]) + fi + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is not GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + + AC_OUTPUT_COMMANDS( + [case "$CONFIG_FILES" in *po/Makefile.in*) + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + esac]) + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLLIBS) + AC_SUBST(PO_IN_DATADIR_TRUE) + AC_SUBST(PO_IN_DATADIR_FALSE) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +# AM_GLIB_GNU_GETTEXT +# ------------------- +# Do checks necessary for use of gettext. If a suitable implementation +# of gettext is found in either in libintl or in the C library, +# it will set INTLLIBS to the libraries needed for use of gettext +# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable +# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() +# on various variables needed by the Makefile.in.in installed by +# glib-gettextize. +dnl +glib_DEFUN(GLIB_GNU_GETTEXT, + [AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + + GLIB_LC_MESSAGES + GLIB_WITH_NLS + + if test "$gt_cv_have_gettext" = "yes"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but ($top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl Generate list of files to be processed by xgettext which will + dnl be included in po/Makefile. + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + ]) + +# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) +# ------------------------------- +# Define VARIABLE to the location where catalog files will +# be installed by po/Makefile. +glib_DEFUN(GLIB_DEFINE_LOCALEDIR, +[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl +glib_save_prefix="$prefix" +glib_save_exec_prefix="$exec_prefix" +test "x$prefix" = xNONE && prefix=$ac_default_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +if test "x$CATOBJEXT" = "x.mo" ; then + localedir=`eval echo "${libdir}/locale"` +else + localedir=`eval echo "${datadir}/locale"` +fi +prefix="$glib_save_prefix" +exec_prefix="$glib_save_exec_prefix" +AC_DEFINE_UNQUOTED($1, "$localedir", + [Define the location where the catalogs will be installed]) +]) + +dnl +dnl Now the definitions that aclocal will find +dnl +ifdef(glib_configure_in,[],[ +AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) +AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) +])dnl diff --git a/common/m4/gst-arch.m4 b/common/m4/gst-arch.m4 new file mode 100644 index 0000000000000000000000000000000000000000..0facaa24b7298e2a986a165d844078e077ae8c5f --- /dev/null +++ b/common/m4/gst-arch.m4 @@ -0,0 +1,123 @@ +AC_DEFUN([GST_ARCH], [ +dnl Set up conditionals for (target) architecture: +dnl ============================================== + +dnl Determine CPU +case "x${target_cpu}" in + xi?86 | xk? | xi?86_64) HAVE_CPU_I386=yes + AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an +x86]) + dnl FIXME could use some better detection + dnl (ie CPUID) + case "x${target_cpu}" in + xi386 | xi486) ;; + *) AC_DEFINE(HAVE_RDTSC, 1, [Define if RDTSC is available]) ;; + esac ;; + xpowerpc*) HAVE_CPU_PPC=yes + AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a +PowerPC]) ;; + xalpha*) HAVE_CPU_ALPHA=yes + AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an +Alpha]) ;; + xarm*) HAVE_CPU_ARM=yes + AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an +ARM]) ;; + xsparc*) HAVE_CPU_SPARC=yes + AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a +SPARC]) ;; + xmips*) HAVE_CPU_MIPS=yes + AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a +MIPS]) ;; + xhppa*) HAVE_CPU_HPPA=yes + AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a +HPPA]) ;; + xs390*) HAVE_CPU_S390=yes + AC_DEFINE(HAVE_CPU_S390, 1, [Define if the target CPU is a +S390]) ;; + xia64*) HAVE_CPU_IA64=yes + AC_DEFINE(HAVE_CPU_IA64, 1, [Define if the target CPU is a +IA64]) ;; + xm68k*) HAVE_CPU_M68K=yes + AC_DEFINE(HAVE_CPU_M68K, 1, [Define if the target CPU is a +M68K]) ;; + xx86_64) HAVE_CPU_X86_64=yes + AC_DEFINE(HAVE_CPU_X86_64, 1, [Define if the target CPU is a +x86_64]) ;; +esac + +dnl Determine endianness +AC_C_BIGENDIAN + +dnl Check for MMX-capable compiler +AC_MSG_CHECKING(for MMX-capable compiler) +AC_TRY_RUN([ +#include "include/mmx.h" + +main() +{ movq_r2r(mm0, mm1); return 0; } +], +[ +HAVE_LIBMMX="yes" +AC_MSG_RESULT(yes) +], +HAVE_LIBMMX="no" +AC_MSG_RESULT(no) +, +HAVE_LIBMMX="no" +AC_MSG_RESULT(no) +) + +AM_CONDITIONAL(HAVE_CPU_I386, test "x$HAVE_CPU_I386" = "xyes") +AM_CONDITIONAL(HAVE_CPU_PPC, test "x$HAVE_CPU_PPC" = "xyes") +AM_CONDITIONAL(HAVE_CPU_ALPHA, test "x$HAVE_CPU_ALPHA" = "xyes") +AM_CONDITIONAL(HAVE_CPU_ARM, test "x$HAVE_CPU_ARM" = "xyes") +AM_CONDITIONAL(HAVE_CPU_SPARC, test "x$HAVE_CPU_SPARC" = "xyes") +AM_CONDITIONAL(HAVE_CPU_HPPA, test "x$HAVE_CPU_HPPA" = "xyes") +AM_CONDITIONAL(HAVE_CPU_MIPS, test "x$HAVE_CPU_MIPS" = "xyes") +AM_CONDITIONAL(HAVE_CPU_S390, test "x$HAVE_CPU_S390" = "xyes") +AM_CONDITIONAL(HAVE_CPU_IA64, test "x$HAVE_CPU_IA64" = "xyes") +AM_CONDITIONAL(HAVE_CPU_M68K, test "x$HAVE_CPU_M68K" = "xyes") +AM_CONDITIONAL(HAVE_CPU_X86_64, test "x$HAVE_CPU_X86_64" = "xyes") +AM_CONDITIONAL(HAVE_LIBMMX, test "x$USE_LIBMMX" = "xyes") + +]) + +AC_DEFUN([GST_UNALIGNED_ACCESS], [ + AC_MSG_CHECKING([if unaligned memory access works correctly]) + if test x"$as_cv_unaligned_access" = x ; then + case $host in + alpha*|arm*|hp*|mips*|sh*|sparc*|ia64*) + _AS_ECHO_N([(blacklisted) ]) + as_cv_unaligned_access=no + ;; + i?86*|powerpc*|m68k*) + _AS_ECHO_N([(whitelisted) ]) + as_cv_unaligned_access=yes + ;; + esac + else + _AS_ECHO_N([(cached) ]) + fi + if test x"$as_cv_unaligned_access" = x ; then + AC_TRY_RUN([ +int main(int argc, char **argv) +{ + char array[] = "ABCDEFGH"; + unsigned int iarray[2]; + memcpy(iarray,array,8); +#define GET(x) (*(unsigned int *)((char *)iarray + (x))) + if(GET(0) != 0x41424344 && GET(0) != 0x44434241) return 1; + if(GET(1) != 0x42434445 && GET(1) != 0x45444342) return 1; + if(GET(2) != 0x43444546 && GET(2) != 0x46454443) return 1; + if(GET(3) != 0x44454647 && GET(3) != 0x47464544) return 1; + return 0; +} + ], as_cv_unaligned_access="yes", as_cv_unaligned_access="no") + fi + AC_MSG_RESULT($as_cv_unaligned_access) + if test "$as_cv_unaligned_access" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_UNALIGNED_ACCESS, 1, + [defined if unaligned memory access works correctly]) + fi +]) + diff --git a/common/m4/gst-debuginfo.m4 b/common/m4/gst-debuginfo.m4 new file mode 100644 index 0000000000000000000000000000000000000000..0a1b830f4c1a9fb56c94981c02091f109bf87eb0 --- /dev/null +++ b/common/m4/gst-debuginfo.m4 @@ -0,0 +1,46 @@ +AC_DEFUN([GST_DEBUGINFO], [ +AC_ARG_ENABLE(debug, +AC_HELP_STRING([--disable-debug],[disable addition of -g debugging info]), +[case "${enableval}" in + yes) USE_DEBUG=yes ;; + no) USE_DEBUG=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; +esac], +[USE_DEBUG=yes]) dnl Default value + +AC_ARG_ENABLE(DEBUG, +AC_HELP_STRING([--disable-DEBUG],[disables compilation of debugging messages]), +[case "${enableval}" in + yes) ENABLE_DEBUG=yes ;; + no) ENABLE_DEBUG=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;; +esac], +[ENABLE_DEBUG=yes]) dnl Default value +if test x$ENABLE_DEBUG = xyes; then + AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in]) +fi + +AC_ARG_ENABLE(INFO, +AC_HELP_STRING([--disable-INFO],[disables compilation of informational messages]), +[case "${enableval}" in + yes) ENABLE_INFO=yes ;; + no) ENABLE_INFO=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;; +esac], +[ENABLE_INFO=yes]) dnl Default value +if test x$ENABLE_INFO = xyes; then + AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in]) +fi + +AC_ARG_ENABLE(debug-color, +AC_HELP_STRING([--disable-debug-color],[disables color output of DEBUG and INFO output]), +[case "${enableval}" in + yes) ENABLE_DEBUG_COLOR=yes ;; + no) ENABLE_DEBUG_COLOR=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;; +esac], +[ENABLE_DEBUG_COLOR=yes]) dnl Default value +if test "x$ENABLE_DEBUG_COLOR" = xyes; then + AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized]) +fi +]) diff --git a/common/m4/gst-doc.m4 b/common/m4/gst-doc.m4 new file mode 100644 index 0000000000000000000000000000000000000000..0e35abc99ec4fae141b16f502ed2681d677f0efb --- /dev/null +++ b/common/m4/gst-doc.m4 @@ -0,0 +1,159 @@ +AC_DEFUN([GST_DOC], [ +AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs])) + +if test "x$with_html_dir" = "x" ; then + HTML_DIR='${datadir}/gtk-doc/html' +else + HTML_DIR=$with_html_dir +fi + +AC_SUBST(HTML_DIR) + +dnl check for gtk-doc +AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-scangobj, true, false) +gtk_doc_min_version=1.0 +if $HAVE_GTK_DOC ; then + gtk_doc_version=`gtkdoc-mkdb --version` + AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version]) + if perl -w < \$min_version_major) || + (\$gtk_doc_version_major == \$min_version_major) && + (\$gtk_doc_version_minor >= \$min_version_minor)) ? 0 : 1); +EOF + then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + HAVE_GTK_DOC=false + fi +fi + +# don't you love undocumented command line options? +GTK_DOC_SCANOBJ="gtkdoc-scangobj --nogtkinit" +AC_SUBST(HAVE_GTK_DOC) +AC_SUBST(GTK_DOC_SCANOBJ) + +dnl check for docbook tools +AC_CHECK_PROG(HAVE_DOCBOOK2PS, docbook2ps, true, false) +AC_CHECK_PROG(HAVE_DOCBOOK2HTML, docbook2html, true, false) +AC_CHECK_PROG(HAVE_JADETEX, jadetex, true, false) +AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, true, false) + +dnl check if we can process docbook stuff +AS_DOCBOOK(HAVE_DOCBOOK=true, HAVE_DOCBOOK=false) + +dnl check for extra tools +AC_CHECK_PROG(HAVE_DVIPS, dvips, true, false) + +dnl check for image conversion tools +AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, true, false) +if test "x$HAVE_FIG2DEV" = "xfalse" ; then + AC_MSG_WARN([Did not find fig2dev (from xfig), images will not be generated.]) +fi + +dnl The following is a hack: if fig2dev doesn't display an error message +dnl for the desired type, we assume it supports it. +HAVE_FIG2DEV_EPS=false +if test "x$HAVE_FIG2DEV" = "xtrue" ; then + fig2dev_quiet=`fig2dev -L pdf &1 >/dev/null` + if test "x$fig2dev_quiet" = "x" ; then + HAVE_FIG2DEV_EPS=true + fi +fi +HAVE_FIG2DEV_PNG=false +if test "x$HAVE_FIG2DEV" = "xtrue" ; then + fig2dev_quiet=`fig2dev -L png &1 >/dev/null` + if test "x$fig2dev_quiet" = "x" ; then + HAVE_FIG2DEV_PNG=true + fi +fi +HAVE_FIG2DEV_PDF=false +if test "x$HAVE_FIG2DEV" = "xtrue" ; then + fig2dev_quiet=`fig2dev -L pdf &1 >/dev/null` + if test "x$fig2dev_quiet" = "x" ; then + HAVE_FIG2DEV_PDF=true + fi +fi + +AC_CHECK_PROG(HAVE_PNGTOPNM, pngtopnm, true, false) +AC_CHECK_PROG(HAVE_PNMTOPS, pnmtops, true, false) +AC_CHECK_PROG(HAVE_EPSTOPDF, epstopdf, true, false) + +dnl check if we can generate HTML +if test "x$HAVE_DOCBOOK2HTML" = "xtrue" && \ + test "x$HAVE_DOCBOOK" = "xtrue" && \ + test "x$HAVE_FIG2DEV_PNG" = "xtrue"; then + DOC_HTML=true + AC_MSG_NOTICE(Will output HTML documentation) +else + DOC_HTML=false + AC_MSG_NOTICE(Will not output HTML documentation) +fi + +dnl check if we can generate PS +if test "x$HAVE_DOCBOOK2PS" = "xtrue" && \ + test "x$HAVE_DOCBOOK" = "xtrue" && \ + test "x$HAVE_JADETEX" = "xtrue" && \ + test "x$HAVE_FIG2DEV_EPS" = "xtrue" && \ + test "x$HAVE_DVIPS" = "xtrue" && \ + test "x$HAVE_PNGTOPNM" = "xtrue" && \ + test "x$HAVE_PNMTOPS" = "xtrue"; then + DOC_PS=true + AC_MSG_NOTICE(Will output PS documentation) +else + DOC_PS=false + AC_MSG_NOTICE(Will not output PS documentation) +fi + +dnl check if we can generate PDF - using only ps2pdf +if test "x$DOC_PS" = "xtrue" && \ + test "x$HAVE_DOCBOOK" = "xtrue" && \ + test "x$HAVE_PS2PDF" = "xtrue"; then + DOC_PDF=true + AC_MSG_NOTICE(Will output PDF documentation) +else + DOC_PDF=false + AC_MSG_NOTICE(Will not output PDF documentation) +fi + +AS_PATH_PYTHON(2.1) +AC_SUBST(PYTHON) + +AC_ARG_ENABLE(docs-build, +AC_HELP_STRING([--disable-docs-build],[disable building of documentation]), +[case "${enableval}" in + yes) + if test "x$HAVE_GTK_DOC" = "xtrue" && \ + test "x$HAVE_DOCBOOK" = "xtrue"; then + BUILD_DOCS=yes + else + BUILD_DOCS=no + fi ;; + no) BUILD_DOCS=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-docs-build) ;; +esac], +[BUILD_DOCS=yes]) dnl Default value + +dnl AC_ARG_ENABLE(plugin-docs, +dnl [ --enable-plugin-docs enable the building of plugin documentation +dnl (this is currently broken, so off by default)], +dnl [case "${enableval}" in +dnl yes) BUILD_PLUGIN_DOCS=yes ;; +dnl no) BUILD_PLUGIN_DOCS=no ;; +dnl *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-docs) ;; +dnl esac], +dnl [BUILD_PLUGIN_DOCS=yes]) dnl Default value +BUILD_PLUGIN_DOCS=no + +AM_CONDITIONAL(HAVE_GTK_DOC, $HAVE_GTK_DOC) +AM_CONDITIONAL(HAVE_DOCBOOK, $HAVE_DOCBOOK) +AM_CONDITIONAL(BUILD_DOCS, test "x$BUILD_DOCS" = "xyes") +AM_CONDITIONAL(BUILD_PLUGIN_DOCS, test "x$BUILD_PLUGIN_DOCS" = "xyes") +AM_CONDITIONAL(DOC_HTML, $DOC_HTML) +AM_CONDITIONAL(DOC_PDF, $DOC_PDF) +AM_CONDITIONAL(DOC_PS, $DOC_PS) +]) + diff --git a/common/m4/gst-feature.m4 b/common/m4/gst-feature.m4 new file mode 100644 index 0000000000000000000000000000000000000000..a4ea24344eaba5c1e125317027a3a8ddaa15d4e9 --- /dev/null +++ b/common/m4/gst-feature.m4 @@ -0,0 +1,206 @@ +dnl Perform a check for a feature for GStreamer +dnl Richard Boulton +dnl Thomas Vander Stichele added useful stuff +dnl Last modification: 25/06/2001 +dnl GST_CHECK_FEATURE(FEATURE-NAME, FEATURE-DESCRIPTION, +dnl DEPENDENT-PLUGINS, TEST-FOR-FEATURE, +dnl DISABLE-BY-DEFAULT, ACTION-IF-USE, ACTION-IF-NOTUSE) +dnl +dnl This macro adds a command line argument to enable the user to enable +dnl or disable a feature, and if the feature is enabled, performs a supplied +dnl test to check if the feature is available. +dnl +dnl The test should define HAVE_ to "yes" or "no" depending +dnl on whether the feature is available. +dnl +dnl The macro will set USE_ to "yes" or "no" depending on +dnl whether the feature is to be used. +dnl Thomas changed this, so that when USE_ was already set +dnl to no, then it stays that way. +dnl +dnl The macro will call AM_CONDITIONAL(USE_<, ...) to allow +dnl the feature to control what is built in Makefile.ams. If you want +dnl additional actions resulting from the test, you can add them with the +dnl ACTION-IF-USE and ACTION-IF-NOTUSE parameters. +dnl +dnl FEATURE-NAME is the name of the feature, and should be in +dnl purely upper case characters. +dnl FEATURE-DESCRIPTION is used to describe the feature in help text for +dnl the command line argument. +dnl DEPENDENT-PLUGINS lists any plugins which depend on this feature. +dnl TEST-FOR-FEATURE is a test which sets HAVE_ to "yes" +dnl or "no" depending on whether the feature is +dnl available. +dnl DISABLE-BY-DEFAULT if "disabled", the feature is disabled by default, +dnl if any other value, the feature is enabled by default. +dnl ACTION-IF-USE any extra actions to perform if the feature is to be +dnl used. +dnl ACTION-IF-NOTUSE any extra actions to perform if the feature is not to +dnl be used. +dnl +dnl +dnl thomas : +dnl we also added a history. +dnl GST_PLUGINS_YES will contain all plugins to be built +dnl that were checked through GST_CHECK_FEATURE +dnl GST_PLUGINS_NO will contain those that won't be built + +AC_DEFUN([GST_CHECK_FEATURE], +[dnl +builtin(define, [gst_endisable], ifelse($5, [disabled], [enable], [disable]))dnl +dnl if it is set to NO, then don't even consider it for building +NOUSE= +if test "x$USE_[$1]" = "xno"; then + NOUSE="yes" +fi +AC_ARG_ENABLE(translit([$1], A-Z, a-z), + [ ]builtin(format, --%-26s gst_endisable %s, gst_endisable-translit([$1], A-Z, a-z), [$2]ifelse([$3],,,: [$3])), + [ case "${enableval}" in + yes) USE_[$1]=yes;; + no) USE_[$1]=no;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-translit([$1], A-Z, a-z)) ;; + esac], + [ USE_$1=]ifelse($5, [disabled], [no], [yes])) dnl DEFAULT + +dnl *** set it back to no if it was preset to no +if test "x$NOUSE" = "xyes"; then + USE_[$1]="no" + AC_MSG_WARN(*** $3 pre-configured not to be built) +fi +NOUSE= + +dnl *** If it's enabled + +if test x$USE_[$1] = xyes; then + dnl save compile variables before the test + + gst_check_save_LIBS=$LIBS + gst_check_save_LDFLAGS=$LDFLAGS + gst_check_save_CFLAGS=$CFLAGS + gst_check_save_CPPFLAGS=$CPPFLAGS + gst_check_save_CXXFLAGS=$CXXFLAGS + + HAVE_[$1]=no + dnl TEST_FOR_FEATURE + $4 + + LIBS=$gst_check_save_LIBS + LDFLAGS=$gst_check_save_LDFLAGS + CFLAGS=$gst_check_save_CFLAGS + CPPFLAGS=$gst_check_save_CPPFLAGS + CXXFLAGS=$gst_check_save_CXXFLAGS + + dnl If it isn't found, unset USE_[$1] + if test x$HAVE_[$1] = xno; then + USE_[$1]=no + fi +fi +dnl *** Warn if it's disabled or not found +if test x$USE_[$1] = xyes; then + ifelse([$6], , :, [$6]) + if test "x$3" != "x"; then + GST_PLUGINS_YES="\t[$3]\n$GST_PLUGINS_YES" + fi + AC_DEFINE(HAVE_[$1], , [support for features: $3]) +else + ifelse([$3], , :, [AC_MSG_NOTICE(*** These plugins will not be built: [$3])]) + if test "x$3" != "x"; then + GST_PLUGINS_NO="\t[$3]\n$GST_PLUGINS_NO" + fi + ifelse([$7], , :, [$7]) +fi +dnl *** Define the conditional as appropriate +AM_CONDITIONAL(USE_[$1], test x$USE_[$1] = xyes) +]) + +dnl Use a -config program which accepts --cflags and --libs parameters +dnl to set *_CFLAGS and *_LIBS and check existence of a feature. +dnl Richard Boulton +dnl Last modification: 26/06/2001 +dnl GST_CHECK_CONFIGPROG(FEATURE-NAME, CONFIG-PROG-FILENAME, MODULES) +dnl +dnl This check was written for GStreamer: it should be renamed and checked +dnl for portability if you decide to use it elsewhere. +dnl +AC_DEFUN([GST_CHECK_CONFIGPROG], +[ + AC_PATH_PROG([$1]_CONFIG, [$2], no) + if test x$[$1]_CONFIG = xno; then + [$1]_LIBS= + [$1]_CFLAGS= + HAVE_[$1]=no + else + [$1]_LIBS=`[$2] --plugin-libs [$3]` + if test "x$[$1]_LIBS" = x; then + [$1]_LIBS=`[$2] --libs [$3]` + fi + [$1]_CFLAGS=`[$2] --cflags [$3]` + HAVE_[$1]=yes + fi + AC_SUBST([$1]_LIBS) + AC_SUBST([$1]_CFLAGS) +]) + +dnl Use AC_CHECK_LIB and AC_CHECK_HEADER to do both tests at once +dnl sets HAVE_module if we have it +dnl Richard Boulton +dnl Last modification: 26/06/2001 +dnl GST_CHECK_LIBHEADER(FEATURE-NAME, LIB NAME, LIB FUNCTION, EXTRA LD FLAGS, +dnl HEADER NAME, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) +dnl +dnl This check was written for GStreamer: it should be renamed and checked +dnl for portability if you decide to use it elsewhere. +dnl +AC_DEFUN([GST_CHECK_LIBHEADER], +[ + AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no,[$4]) + if test "x$HAVE_[$1]" = "xyes"; then + AC_CHECK_HEADER([$5], :, HAVE_[$1]=no) + if test "x$HAVE_[$1]" = "xyes"; then + dnl execute what needs to be + ifelse([$6], , :, [$6]) + else + ifelse([$7], , :, [$7]) + fi + else + ifelse([$7], , :, [$7]) + fi + AC_SUBST(HAVE_[$1]) +] +) + +dnl 2004-02-14 Thomas - changed to get set properly and use proper output +dnl 2003-06-27 Benjamin Otte - changed to make this work with gstconfig.h +dnl +dnl Add a subsystem --disable flag and all the necessary symbols and substitions +dnl +dnl GST_CHECK_SUBSYSTEM_DISABLE(SYSNAME, [subsystem name]) +dnl +AC_DEFUN([GST_CHECK_SUBSYSTEM_DISABLE], +[ + dnl this define will replace each literal subsys_def occurrence with + dnl the lowercase hyphen-separated subsystem + dnl e.g. if $1 is GST_DEBUG then subsys_def will be a macro with gst-debug + define([subsys_def],translit([$1], _A-Z, -a-z)) + + AC_ARG_ENABLE(subsys_def, + AC_HELP_STRING(--disable-subsys_def, [disable $2]), + [ + case "${enableval}" in + yes) GST_DISABLE_[$1]=no ;; + no) GST_DISABLE_[$1]=yes ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-subsys_def]) ;; + esac + ], + [GST_DISABLE_[$1]=no]) dnl Default value + + if test x$GST_DISABLE_[$1] = xyes; then + AC_MSG_NOTICE([disabled subsystem [$2]]) + GST_DISABLE_[$1]_DEFINE="#define GST_DISABLE_$1 1" + else + GST_DISABLE_[$1]_DEFINE="/* #undef GST_DISABLE_$1 */" + fi + AC_SUBST(GST_DISABLE_[$1]_DEFINE) + undefine([subsys_def]) +]) + diff --git a/common/m4/gst-function.m4 b/common/m4/gst-function.m4 new file mode 100644 index 0000000000000000000000000000000000000000..978fa7123dc516712c0d90091e3e82ac7a3f9b4b --- /dev/null +++ b/common/m4/gst-function.m4 @@ -0,0 +1,63 @@ +dnl +dnl Check for compiler mechanism to show functions in debugging +dnl copied from an Ali patch floating on the internet +dnl +AC_DEFUN([GST_CHECK_FUNCTION],[ + dnl #1: __PRETTY_FUNCTION__ + AC_MSG_CHECKING(whether $CC implements __PRETTY_FUNCTION__) + AC_CACHE_VAL(have_pretty_function,[ + AC_TRY_LINK([#include ], + [printf("%s", __PRETTY_FUNCTION__);], + have_pretty_function=yes, + have_pretty_function=no) + ]) + AC_MSG_RESULT($have_pretty_function) + if test "$have_pretty_function" = yes; then + AC_DEFINE(HAVE_PRETTY_FUNCTION, 1, + [defined if the compiler implements __PRETTY_FUNCTION__]) + fi + +dnl #2: __FUNCTION__ + AC_MSG_CHECKING(whether $CC implements __FUNCTION__) + AC_CACHE_VAL(have_function,[ + AC_TRY_LINK([#include ], + [printf("%s", __FUNCTION__);], + have_function=yes, + have_function=no) + ]) + AC_MSG_RESULT($have_function) + if test "$have_function" = yes; then + AC_DEFINE(HAVE_FUNCTION, 1, + [defined if the compiler implements __FUNCTION__]) + fi + +dnl #3: __func__ + AC_MSG_CHECKING(whether $CC implements __func__) + AC_CACHE_VAL(have_func,[ + AC_TRY_LINK([#include ], + [printf("%s", __func__);], + have_func=yes, + have_func=no) + ]) + AC_MSG_RESULT($have_func) + if test "$have_func" = yes; then + AC_DEFINE(HAVE_FUNC, 1, + [defined if the compiler implements __func__]) + fi + +dnl now define FUNCTION to whatever works, and fallback to "" + if test "$have_pretty_function" = yes; then + function=__PRETTY_FUNCTION__ + else + if test "$have_function" = yes; then + function=__FUNCTION__ + else + if test "$have_func" = yes; then + function=__func__ + else + function=\"\" + fi + fi + fi + AC_DEFINE_UNQUOTED(GST_FUNCTION, $function, [macro to use to show function name]) +]) diff --git a/common/m4/gst-glib2.m4 b/common/m4/gst-glib2.m4 new file mode 100644 index 0000000000000000000000000000000000000000..021ae5577ffcd994656fa614064d86b6278e7a23 --- /dev/null +++ b/common/m4/gst-glib2.m4 @@ -0,0 +1,18 @@ +AC_DEFUN([GST_GLIB2_CHECK], [ +dnl === GLib 2 === +dnl Minimum required version of GLib2 +GLIB2_REQ="1.3.12" +AC_SUBST(GLIB2_REQ) + +dnl Check for glib2 +PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0, + HAVE_GLIB2=yes,HAVE_GLIB2=no) +GLIB_LIBS=$GLIB2_LIBS +GLIB_CFLAGS=$GLIB2_CFLAGS +AC_SUBST(GLIB_LIBS) +AC_SUBST(GLIB_CFLAGS) + +if test "x$HAVE_GLIB2" = "xno"; then + AC_MSG_ERROR([This package requires GLib 2.0 to compile.]) +fi +]) diff --git a/common/m4/gst-gstreamer.m4 b/common/m4/gst-gstreamer.m4 new file mode 100644 index 0000000000000000000000000000000000000000..e98a370678098e526f5cad0ae684bd4092fd3ed8 --- /dev/null +++ b/common/m4/gst-gstreamer.m4 @@ -0,0 +1,14 @@ +dnl check for gstreamer +dnl check for installed gstreamer first +dnl if necessary, check for uninstalled gstreamer +dnl AC_SUBST GST_CFLAGS and GST_LIBS +AC_DEFUN([GST_GSTREAMER],[ + PKG_CHECK_MODULES(GST, gstreamer, HAVE_GST=yes, HAVE_GST=no) + if test "x$HAVE_GST" = "xno"; + then + PKG_CHECK_MODULES(GST, gstreamer-uninstalled, HAVE_GST=yes, exit) + fi + AC_SUBST(GST_CFLAGS) + AC_SUBST(GST_LIBS) +]) + diff --git a/common/m4/gst-libxml2.m4 b/common/m4/gst-libxml2.m4 new file mode 100644 index 0000000000000000000000000000000000000000..b3f3675387390377d50a1bb040566c92bcae7a5b --- /dev/null +++ b/common/m4/gst-libxml2.m4 @@ -0,0 +1,40 @@ +dnl call this macro with the minimum required version as an argument +AC_DEFUN([GST_LIBXML2_CHECK], +[ + dnl Minimum required version of libxml2 + dnl default to 2.4.9 if not specified + LIBXML2_REQ=ifelse([$1],,2.4.9,[$1]) + AC_SUBST(LIBXML2_REQ) + + dnl check for libxml2 + PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, + HAVE_LIBXML2=yes, HAVE_LIBXML2=no) + if test "x$HAVE_LIBXML2" = "xyes"; then + AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available]) + else + AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing]) + fi + dnl this is for the .pc file + LIBXML_PKG=', libxml-2.0' + AC_SUBST(LIBXML_PKG) + AC_SUBST(XML_LIBS) + AC_SUBST(XML_CFLAGS) + + dnl XML_LIBS might pull in -lz without zlib actually being on the system, so + dnl try linking with these LIBS and CFLAGS + ac_save_CFLAGS=$CFLAGS + ac_save_LIBS=$LIBS + CFLAGS="$CFLAGS $XML_CFLAGS" + LIBS="$LIBS $XML_LIBS" + AC_TRY_LINK([ +#include +#include +],[ +/* function body */ +], + AC_MSG_NOTICE([Test xml2 program linked]), + AC_MSG_ERROR([Could not link libxml2 test program. Check if you have the necessary dependencies.]) + ) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" +]) diff --git a/common/m4/gst-makecontext.m4 b/common/m4/gst-makecontext.m4 new file mode 100644 index 0000000000000000000000000000000000000000..34dfe6c278b9e4f9e73b7b6ad26c3fbca5c23757 --- /dev/null +++ b/common/m4/gst-makecontext.m4 @@ -0,0 +1,34 @@ +AC_DEFUN([GST_CHECK_MAKECONTEXT], [ + AC_MSG_CHECKING([whether we have makecontext]) + AC_TRY_RUN([ +#include +#include + +void test(void) +{ + exit(0); +} + +int main(int argc, char *argv[]) +{ + ucontext_t ucp; + int ret; + + ret = getcontext(&ucp); + if(ret<0)exit(1); + + ucp.uc_stack.ss_sp = malloc(65536); + ucp.uc_stack.ss_size = 65536; + + makecontext(&ucp,test,0); + setcontext(&ucp); + + exit(1); +} +], HAVE_MAKECONTEXT="yes", HAVE_MAKECONTEXT="no") +AC_MSG_RESULT($HAVE_MAKECONTEXT) +if test "$HAVE_MAKECONTEXT" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_MAKECONTEXT, $HAVE_MAKECONTEXT, + [defined if we have makecontext ()]) +fi +]) diff --git a/common/m4/gst-mcsc.m4 b/common/m4/gst-mcsc.m4 new file mode 100644 index 0000000000000000000000000000000000000000..6b7bcf277d2c467a57bef0f5a76bb425b1ee254c --- /dev/null +++ b/common/m4/gst-mcsc.m4 @@ -0,0 +1,79 @@ + +dnl ## (Taken from pth-1.4.1) +dnl ## +dnl ## Check whether SVR4/SUSv2 makecontext(2), swapcontext(2) and +dnl ## friends can be used for user-space context switching +dnl ## +dnl ## configure.in: +dnl ## AC_CHECK_MCSC(, ) +dnl ## + +AC_DEFUN([AC_CHECK_MCSC], [ +AC_MSG_CHECKING(for usable SVR4/SUSv2 makecontext(2)/swapcontext(2)) +AC_CACHE_VAL(ac_cv_check_mcsc, [ +AC_TRY_RUN([ + +#include +#include +#include + +ucontext_t uc_child; +ucontext_t uc_main; + +void child(void *arg) +{ + if (arg != (void *)12345) + exit(1); + if (swapcontext(&uc_child, &uc_main) != 0) + exit(1); +} + +int main(int argc, char *argv[]) +{ + FILE *fp; + void *stack; + + /* the default is that it fails */ + if ((fp = fopen("conftestval", "w")) == NULL) + exit(1); + fprintf(fp, "no\n"); + fclose(fp); + + /* configure a child user-space context */ + if ((stack = malloc(64*1024)) == NULL) + exit(1); + if (getcontext(&uc_child) != 0) + exit(1); + uc_child.uc_link = NULL; + uc_child.uc_stack.ss_sp = (char *)stack+(32*1024); + uc_child.uc_stack.ss_size = 32*1024; + uc_child.uc_stack.ss_flags = 0; + makecontext(&uc_child, child, 2, (void *)12345); + + /* switch into the user context */ + if (swapcontext(&uc_main, &uc_child) != 0) + exit(1); + + /* Fine, child came home */ + if ((fp = fopen("conftestval", "w")) == NULL) + exit(1); + fprintf(fp, "yes\n"); + fclose(fp); + + /* die successfully */ + exit(0); +} +], +ac_cv_check_mcsc=`cat conftestval`, +ac_cv_check_mcsc=no, +ac_cv_check_mcsc=no +)dnl +])dnl +AC_MSG_RESULT([$ac_cv_check_mcsc]) +if test ".$ac_cv_check_mcsc" = .yes; then + ifelse([$1], , :, [$1]) +else + ifelse([$2], , :, [$2]) +fi +])dnl + diff --git a/common/m4/pkg.m4 b/common/m4/pkg.m4 new file mode 100644 index 0000000000000000000000000000000000000000..f2bfc2d49f9bf073fc71d81d77ce4ef4c623adb5 --- /dev/null +++ b/common/m4/pkg.m4 @@ -0,0 +1,57 @@ + +dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) +dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page +dnl also defines GSTUFF_PKG_ERRORS on error +AC_DEFUN([PKG_CHECK_MODULES], [ + succeeded=no + + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + + if test "$PKG_CONFIG" = "no" ; then + echo "*** The pkg-config script could not be found. Make sure it is" + echo "*** in your path, or set the PKG_CONFIG environment variable" + echo "*** to the full path to pkg-config." + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + AC_MSG_CHECKING(for $2) + + if $PKG_CONFIG --exists "$2" ; then + AC_MSG_RESULT(yes) + succeeded=yes + + AC_MSG_CHECKING($1_CFLAGS) + $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` + AC_MSG_RESULT($$1_CFLAGS) + + AC_MSG_CHECKING($1_LIBS) + $1_LIBS=`$PKG_CONFIG --libs "$2"` + AC_MSG_RESULT($$1_LIBS) + else + $1_CFLAGS="" + $1_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + ifelse([$4], ,echo $$1_PKG_ERRORS,) + fi + + AC_SUBST($1_CFLAGS) + AC_SUBST($1_LIBS) + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + ifelse([$3], , :, [$3]) + else + ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) + fi +]) + + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000000000000000000000000000000000000..f2141749291b2e04d6b5716a7389979debaf7eda --- /dev/null +++ b/configure.ac @@ -0,0 +1,179 @@ +dnl ************************************************************ +dnl Autotools For Pitivi-GUI +dnl +dnl Made By Casaxno +dnl See also : autogen.sh, src/Makefile.am +dnl +dnl ============Modifications=================================== +dnl Author Date Version Description +dnl ------------------------------------------------------------ +dnl GC 20/02/2004 0.1.1 Upgrading Version of GLIB to 2.3 +dnl GC 20/03/2004 0.1.1 Upgrading Version of GLIB to 2.4 +dnl EH 26/04/2004 0.1.1 Uses the common/ macros +dnl +dnl************************************************************* + +AC_INIT +AC_CANONICAL_TARGET([]) +AM_MAINTAINER_MODE + +dnl Fill in your package name and version here + +AS_VERSION(pitivi, PITIVI_VERSION, 0, 1, 1, 0, GST_CVS="no", GST_CVS="yes") + +dnl AUTOMAKE initialisation +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) + +dnl ========================= +dnl Dispatching Sources +dnl ======================== + +dnl Check Libtool +AC_PROG_LIBTOOL() + +AC_CONFIG_SRCDIR(src/main.c) +AM_CONFIG_HEADER(config.h) + +dnl uninstalled glade ui dir +dnl AC_DEFINE_UNQUOTED(GLADEUI_UNINSTALLED_DIR,"`pwd`/src/ui",[path to glade ui dir]) +dnl AC_SUBST(GLADEUI_UNINSTALLED_DIR) + +dnl Add parameters for aclocal +dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL) +ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS" + +dnl ========================= +dnl Cheching Programs +dnl ========================= + +AC_PROG_CC +AC_STDC_HEADERS +AM_PROG_CC_STDC +AC_ISC_POSIX + +dnl Check for Presence of Lex And Yacc for later +dnl AC_PROG_YACC +dnl AM_PROG_LEX + +dnl stuff found by autoscan +AC_CHECK_FUNCS([strstr]) +AC_CHECK_HEADERS([unistd.h]) +AC_C_CONST +AC_FUNC_STAT + +dnl allow different autotools +AS_AUTOTOOLS_ALTERNATE() + +GST_DEBUGINFO + +dnl modify pkg-config path +AC_ARG_WITH(pkg-config-path, + AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]), + [export PKG_CONFIG_PATH=${withval}]) + +dnl decide on error flags +AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no") + +if test "x$GST_WALL" = "xyes"; then + GST_ERROR="$GST_ERROR -Wall" + + if test "x$GST_CVS" = "xyes"; then + AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR") + fi +fi + + + +dnl ============================= +dnl Cheching Presence of LIBGLADE +dnl ============================= + +dnl LIBGLADE_VERSION=2.0 +dnl LIBGLADE_REQUIRED=2.0 + +dnl PKG_CHECK_MODULES(LIBGLADE, libglade-$LIBGLADE_VERSION, libglade=true, libglade=false) +dnl AM_CONDITIONAL(HAVE_LIBGLADE, test x$libglade = xtrue) +dnl if test "$libglade" = "true"; then +dnl LIBGLADE_CFLAGS=`$PKG_CONFIG --cflags libglade-2.0` +dnl LIBGLADE_LIBS=`$PKG_CONFIG --libs libglade-2.0` +dnl AC_SUBST(LIBGLADE_CFLAGS) +dnl AC_SUBST(LIBGLADE_LIBS) +dnl fi + + +dnl Now we're ready to ask for gstreamer libs and cflags +dnl And we can also ask for the right version of gstreamer +HAVE_GST=no +GST_REQUIRED=0.8.0 + +dnl start with 0.7 +GST_MAJORMINOR=0.7 +PKG_CHECK_MODULES(GST, \ + gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED \ + gstreamer-interfaces-$GST_MAJORMINOR >= $GST_REQUIRED \ + gstreamer-control-$GST_MAJORMINOR >= $GST_REQUIRED, + HAVE_GST=yes,HAVE_GST=no) + +dnl fail back to 0.8 +if test "x$HAVE_GST" = "xno"; then + GST_MAJORMINOR=0.8 + PKG_CHECK_MODULES(GST, \ + gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED \ + gstreamer-interfaces-$GST_MAJORMINOR >= $GST_REQUIRED \ + gstreamer-control-$GST_MAJORMINOR >= $GST_REQUIRED, + HAVE_GST=yes,HAVE_GST=no) +fi + +dnl Give error and exit if we don't have gstreamer +if test "x$HAVE_GST" = "xno"; then + AC_MSG_ERROR(you need gstreamer development packages installed !) +fi + +dnl make GST_CFLAGS and GST_LIBS available +AC_SUBST(GST_CFLAGS) +AC_SUBST(GST_LIBS) + +dnl If we need them, we can also use the plugin libraries +PKG_CHECK_MODULES(GST_LIBS, gstreamer-libs-$GST_MAJORMINOR >= $GST_REQUIRED, + HAVE_GST_LIBS=yes, HAVE_GST_LIBS=no) + +dnl Give a warning if we don't have gstreamer libs +if test "x$HAVE_GST_LIBS" = "xno"; then + AC_MSG_NOTICE(no GStreamer plugin libs found) +fi + +dnl check for GTK +PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0 gdk-2.0 >= 2.4.0,,exit) +AC_SUBST(GTK_LIBS) +AC_SUBST(GTK_CFLAGS) + +dnl i18n stuff and gettext stuff +dnl AC_PROG_INTLTOOL([0.21]) +dnl GETTEXT_PACKAGE=gst-player +dnl AC_SUBST(GETTEXT_PACKAGE) +dnl AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Define gettext package]) +dnl ALL_LINGUAS="nl no" +dnl AM_GLIB_GNU_GETTEXT + +dnl ========================= +dnl Checks for substitutions +dnl ========================= + +dnl make GST_CFLAGS and GST_LIBS available +dnl AC_SUBST(GST_CFLAGS) +dnl AC_SUBST(GST_LIBS) + +dnl make GTK2_CFLAGS and GTK2_LIBS available +dnl AC_SUBST(GTK_CONFIG) +dnl AC_SUBST(GTK2_CFLAGS) +dnl AC_SUBST(GTK2_LIBS) + +dnl FLAGS +dnl AC_SUBST(CFLAGS, "$CFLAGS -I./include -g3 -O3 -Wall --ansi") +dnl AC_SUBST(YFLAGS, "-d -p request_lex") +dnl AC_SUBST(CC, "gcc") + +dnl Outputs +AC_OUTPUT(Makefile + src/Makefile + ) diff --git a/docs/CLASSES b/docs/CLASSES new file mode 100644 index 0000000000000000000000000000000000000000..d62d32d4f9114df80cd75d6924a74a69af7e69c6 --- /dev/null +++ b/docs/CLASSES @@ -0,0 +1,151 @@ +Modifications : +--------------------- + +-- On n'utilise plus glade du tout + Raison : Tout le monde sait maintenant programmer en gtk "pur" + +-- On utilise plus les #ifdef __cplusplus + Raison : C'est utilisé par les programmes C++ qui souhaitent utiliser notre code, HORS notre code est le plus haut niveau (ce n'est pas une librairie) ET si jamais on devait en réutiliser une partie (librairies de widgets) GObject est là pour faire des bindings dans d'autres langages (tels que le C++) + +-- On ne réalise des classes QUE pour les éléments évidents. + Ex: Une menubar ne nécessite pas de classe spécifique ! + + +Template de classe GObject +--------------------------- + J'ai cree une template complete de classe GObject de base, bien formatee, qui ne sort aucun warning, etc... + + Vous pouvez rapidement creer une nouvelle paire de fichiers .[c|h] a la norme en utilisant l'utilitaire make_filter contenu dans le repertoire docs/ + Ex : Vous voulez creer une classe PitiviMaClasse + > ./make_filter MaClasse + Et vous obtiendrez pitivi-maclasse.c et pitivi-maclasse.h que vous pouvez ensuite deplacez dans le repertoire src/ et commencer directement a travailler dessus. Ce template est archi-complet, vous n'aurez peut etre pas besoin de toutes les methodes... + +Ordre d'appel des fonctions GObject lors de l'instanciation: +------------------------------------------------------------ + pitivi__class_init() (appelle qu'une fois dans le programme) + pitivi__constructor() (appelle a chaque instanciation) + pitivi__instance_init() (appelle a chaque instanciation) + + Utilisez directement les fonctions pitivi__new() qui s'occupera d'effectuer l'instanciation correctement + +--------------------------- +/!\ /!\ /!\ /!\ /!\ /!\ /!\ +Ajouter pour les classes : + propriétés publiques + propriétés privées + méthodes + signaux +/!\ /!\ /!\ /!\ /!\ /!\ /!\ +--------------------------- + +---------------------- +Les CLASSES +---------------------- + Etant dans une interface graphique, avec la majorité du traitement effectué dans d'autres librairies, nous devons nous attacher à avoir des classes se rapprochant le plus près des éléments graphiques. + Une classe par fenetre est un bon debut. Ces classes peuvent contenir des éléments définis dans des classes eux-aussi. + On part du général pour arriver au spécifique. + +Liste des classes : +---------------------- +** Classes non-graphiques : +--------------------------- + + * PitiviMainApp : + L'application principale, qui contient/utilise toutes les autres classes + Elle n'est pas une fenetre, mais regit le fonctionnement de l'application + centralise les informations propres à "L'APPLICATION". + Elle est la classe lié à GStreamer + Contient LE GstPipeline général de l'application + Référence les différents "PitiviProject" ouverts + Contient un PitiviSettings qui spécifie les réglages de l'application et qui peut être enregistré dans / chargé depuis un fichier + + * PitiviSettings : + + Contient les réglages/préférences de l'application + Doit pouvoir être sérialisé pour être enregistré/chargé + + * PitiviProject : + Un projet multimédia + lié à gnonlin + Contient un GnlTimeline (la timeline principale de gnonlin) + Contient un PitiviProjectSettings qui spécifie les réglages du projet + Contient un PitiviProjectSourceList qui spécifie la liste des sources utilisés pour le projet + Peut être enregistré dans / chargé depuis un fichier + + * PitiviProjectSourceList + Contient la liste des sources d'un PitiviProject + Doit pouvoir etre sérialisé pour etre enregistré/chargé + + * PitiviProjectSettings : + Les réglages de projet + Aussi bien utilisé pour un projet en particulier que dans la liste des pré-réglages + Doit pouvoir être sérialisé pour être enregistré/chargé + +** Classes de fenetres (Dérivent de GtkWindow) : +------------------------------------------------ + + * PitiviToolboxWindow : + Contient la PitiviToolbox et le menu général + Les callbacks de la MenuBar appellent les méthodes adéquates de PitiviMainApp + Fenetre minimum de l'application. + Unique pour l'application + + * PitiviSourceListWindow : + contient la librairie des sources mutimédias (PitiviSourceList) + Propre à chaque projet, ou s'ajuste suivant le "focus" + + * PitiviViewerWindow : + contient le visualisateur multimédia + Propre à chaque projet, ou s'ajuste suivant le "focus" + + * PitiviNewProjectWindow : + Fenetre de creation d'un nouveau projet + Permet de créer un nouveau projet à partir d'un PitiviProjectSettings + Donne accés aux PitiviProjectSettings disponibles, et permet d'en ajouter/supprimer/modifier + + * PitiviProjectSettingsWindow : + Propriétés d'un projet + Permet de modifier les réglages d'un projet (PitiviProjectSettings) + Propre à chaque projet + + * PitiviCaptureWindow : + Fenetre de capture multimédia + Unique à l'application + permet de capturer des sources à mettre dans la sourcelist (à choisir) + + * PitiviTimelineWindow : + contient la PitiviTimeline et le menu de projet + Propre à chaque projet + + * PitiviEffectsWindow : + Affiche et donne accés aux effets (transition/audio/vidéo/...) + Unique pour l'application + + * PitiviSettingssWindow : + Contient les préférences du programme + Unique pour l'application + + +** Classes de Widgets : +----------------------- + + * PitiviToolbox(GtkToolbar) : + Boites à outils, contient les outils d'edition + + * PitiviTimeline : + Ligne de temps, espace d'edition principal. + Lié au GnlTimeline du (PitiviTimelineWindow du) PitiviProject en cours + Contient des PitiviTimelineLayer + + * PitiviTimelineLayer : + Couche de média + Lié au bon GnlLayer du (GnlTimeline du) PitiviTimeline conteneur + Contient des PitiviTimelineSource et des PitiviTimelineOperation + + * PitiviTimelineSource : + Séquence de média + Lié au bon GnlSource du (GnlLayer du) PitiviTimelineLayer conteneur + + * PitiviTimelineOperation : + Séquence d'effet + Lié au bon GnlOperation du (GnlLayer du) PitiviTimelineLayer conteneur diff --git a/docs/make_filter b/docs/make_filter new file mode 100755 index 0000000000000000000000000000000000000000..e30e4877f7018cb21f79d2743be9756730c951ff --- /dev/null +++ b/docs/make_filter @@ -0,0 +1,38 @@ +#!/bin/sh + +Template=$1; +srcfile=$2; + +if test x"$1" = x ; then + echo "$0 Objectname [templatetype]\n"; + echo " creates pitivi-objectname.{c,h} , a clean base GObject class,\n"; + exit 1; +fi + +if test x"$2" = x ; then + srccfile="pitivi-classtemplate.c" + srchfile="pitivi-classtemplate.h" +else + srccfile=$2.c + srchfile=$2.h +fi + +TEMPLATE=`echo $Template | tr a-z A-Z` +template=`echo $Template | tr A-Z a-z` + +sed \ + -e "s/Template/$Template/g" \ + -e "s/TEMPLATE/$TEMPLATE/g" \ + -e "s/temp_late/$template/g" \ + -e "s/template/$template/g" \ + $srccfile > pitivi-$template.c.tmp && mv pitivi-$template.c.tmp pitivi-$template.c + +sed \ + -e "s/Template/$Template/g" \ + -e "s/TEMPLATE/$TEMPLATE/g" \ + -e "s/temp_late/$template/g" \ + -e "s/template/$template/g" \ + $srchfile > pitivi-$template.h.tmp && mv pitivi-$template.h.tmp pitivi-$template.h + + + diff --git a/docs/pitivi-classtemplate.c b/docs/pitivi-classtemplate.c new file mode 100644 index 0000000000000000000000000000000000000000..f2751a4bb22ae63900b5e731817c34eb5627dcf0 --- /dev/null +++ b/docs/pitivi-classtemplate.c @@ -0,0 +1,226 @@ +/* + * PiTiVi + * Copyright (C) <2004> Edward G. Hervey + * Guillaume Casanova + * + * This software has been written in EPITECH + * EPITECH is a computer science school in Paris - FRANCE - + * under the direction of Flavien Astraud and Jerome Landrieu. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "pitivi.h" +#include "pitivi-template.h" + +struct _PitiviTemplatePrivate +{ + /* instance private members */ + gboolean dispose_has_run; +}; + +/* + * forward definitions + */ + +/* + * Insert "added-value" functions here + */ + +PitiviTemplate * +pitivi_temp_late_new(void) +{ + PitiviTemplate *template; + + g_printf("pitivi_temp_late_new()\n"); + + template = (PitiviTemplate *) g_object_new(PITIVI_TEMPLATE_TYPE, NULL); + g_assert(template != NULL); + return template; +} + +static GObject * +pitivi_temp_late_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam * construct_properties) +{ + g_printf("pitivi_temp_late_constructor()\n"); + + GObject *obj; + { + /* Invoke parent constructor. */ + PitiviTemplateClass *klass; + GObjectClass *parent_class; + klass = PITIVI_TEMPLATE_CLASS (g_type_class_peek (PITIVI_TEMPLATE_TYPE)); + parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass)); + obj = parent_class->constructor (type, n_construct_properties, + construct_properties); + } + + /* do stuff. */ + + return obj; +} + +static void +pitivi_temp_late_instance_init (GTypeInstance * instance, gpointer g_class) +{ + PitiviTemplate *self = (PitiviTemplate *) instance; + + g_printf("pitivi_temp_late_instance_init()\n"); + + self->private = g_new0(PitiviTemplatePrivate, 1); + + /* initialize all public and private members to reasonable default values. */ + + self->private->dispose_has_run = FALSE; + + /* If you need specific consruction properties to complete initialization, + * delay initialization completion until the property is set. + */ + +} + +static void +pitivi_temp_late_dispose (GObject *object) +{ + PitiviTemplate *self = PITIVI_TEMPLATE(object); + + /* If dispose did already run, return. */ + if (self->private->dispose_has_run) + return; + + /* Make sure dispose does not run twice. */ + self->private->dispose_has_run = TRUE; + + /* + * In dispose, you are supposed to free all types referenced from this + * object which might themselves hold a reference to self. Generally, + * the most simple solution is to unref all members on which you own a + * reference. + */ + +} + +static void +pitivi_temp_late_finalize (GObject *object) +{ + PitiviTemplate *self = PITIVI_TEMPLATE(object); + + /* + * Here, complete object destruction. + * You might not need to do much... + */ + + g_free (self->private); +} + +static void +pitivi_temp_late_set_property (GObject * object, + guint property_id, + const GValue * value, GParamSpec * pspec) +{ + PitiviTemplate *self = (PitiviTemplate *) object; + + switch (property_id) + { + /* case PITIVI_TEMPLATE_PROPERTY: { */ + /* g_free (self->private->name); */ + /* self->private->name = g_value_dup_string (value); */ + /* g_print ("maman: %s\n",self->private->name); */ + /* } */ + /* break; */ + default: + /* We don't have any other property... */ + g_assert (FALSE); + break; + } +} + +static void +pitivi_temp_late_get_property (GObject * object, + guint property_id, + GValue * value, GParamSpec * pspec) +{ + PitiviTemplate *self = (PitiviTemplate *) object; + + switch (property_id) + { + /* case PITIVI_TEMPLATE_PROPERTY: { */ + /* g_value_set_string (value, self->private->name); */ + /* } */ + /* break; */ + default: + /* We don't have any other property... */ + g_assert (FALSE); + break; + } +} + +static void +pitivi_temp_late_class_init (gpointer g_class, gpointer g_class_data) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (g_class); + PitiviTemplateClass *klass = PITIVI_TEMPLATE_CLASS (g_class); + + g_printf("pitivi_main_class_init()\n"); + + gobject_class->constructor = pitivi_temp_late_constructor; + gobject_class->dispose = pitivi_temp_late_dispose; + gobject_class->finalize = pitivi_temp_late_finalize; + + gobject_class->set_property = pitivi_temp_late_set_property; + gobject_class->get_property = pitivi_temp_late_get_property; + + /* Install the properties in the class here ! */ + /* pspec = g_param_spec_string ("maman-name", */ + /* "Maman construct prop", */ + /* "Set maman's name", */ + /* "no-name-set" /\* default value *\/, */ + /* G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE); */ + /* g_object_class_install_property (gobject_class, */ + /* MAMAN_BAR_CONSTRUCT_NAME, */ + /* pspec); */ + + +} + +GType +pitivi_temp_late_get_type (void) +{ + static GType type = 0; + + g_printf("pitivi_main_get_type()\n"); + + if (type == 0) + { + static const GTypeInfo info = { + sizeof (PitiviTemplateClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + pitivi_temp_late_class_init, /* class_init */ + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PitiviTemplate), + 0, /* n_preallocs */ + pitivi_temp_late_instance_init /* instance_init */ + }; + type = g_type_register_static (G_TYPE_OBJECT, + "PitiviTemplateType", &info, 0); + } + + return type; +} diff --git a/docs/pitivi-classtemplate.h b/docs/pitivi-classtemplate.h new file mode 100644 index 0000000000000000000000000000000000000000..f03bd2529bc0086e8204c5c9119aab6b773e08d3 --- /dev/null +++ b/docs/pitivi-classtemplate.h @@ -0,0 +1,73 @@ +/* + * PiTiVi + * Copyright (C) <2004> Edward G. Hervey + * Guillaume Casanova + * + * This software has been written in EPITECH + * EPITECH is a computer science school in Paris - FRANCE - + * under the direction of Flavien Astraud and Jerome Landrieu. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef PITIVI_TEMPLATE_H +#define PITIVI_TEMPLATE_H + +/* + * Potentially, include other headers on which this header depends. + */ + +/* + * Type macros. + */ + +#define PITIVI_TEMPLATE_TYPE (pitivi_temp_late_get_type ()) +#define PITIVI_TEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PITIVI_TEMPLATE_TYPE, PitiviTemplate)) +#define PITIVI_TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PITIVI_TEMPLATE_TYPE, PitiviTemplateClass)) +#define PITIVI_IS_TEMPLATE(obj) (G_TYPE_CHECK_TYPE ((obj), PITIVI_TEMPLATE_TYPE)) +#define PITIVI_IS_TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PITIVI_TEMPLATE_TYPE)) +#define PITIVI_TEMPLATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PITIVI_TEMPLATE_TYPE, PitiviTemplateClass)) + +typedef struct _PitiviTemplate PitiviTemplate; +typedef struct _PitiviTemplateClass PitiviTemplateClass; +typedef struct _PitiviTemplatePrivate PitiviTemplatePrivate; + +struct _PitiviTemplate +{ + GObject parent; + + /* instance public members */ + + /* private */ + PitiviTemplatePrivate *private; +}; + +struct _PitiviTemplateClass +{ + GObjectClass parent; + /* class members */ +}; + +/* used by PITIVI_TEMPLATE_TYPE */ +GType pitivi_temp_late_get_type (void); + +/* + * Method definitions. + */ + +PitiviTemplate *pitivi_temp_late_new(void); + +#endif diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..ef1d0b004f676e59fcacfcd4ae29bbaea9528430 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,33 @@ +## +## Makefile.am +## +## Made by guillaume casanova +## Email +## +## +## + + +#AUTOMAKE_OPTIONS = foreign +#INCLUDES = -I$(top_srcdir)/src/include + +bin_PROGRAMS = pitivi + +pitivi_SOURCES = \ + pitivi-mainapp.c \ + pitivi-project.c \ + pitivi-toolbox.c \ + pitivi-toolboxwindow.c \ + main.c + +# our CFLAGS and LDFLAGS used for compiling and linking +# make sure you prefix these with the name of your binary + +pitivi_CFLAGS = $(GTK_CFLAGS) $(GLIB2_CFLAGS) $(GST_CFLAGS) +pitivi_LDFLAGS = $(GTK_LIBS) $(GLIB2_LIBS) $(GST_LIBS) + +LEX_OUTPUT_ROOT = lex.$* +YFLAGS = -d -p request_lex + +depend : + makedepend -I../include/ diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000000000000000000000000000000000000..f75d07090151de118fdb95fa1d1287d45f66792c --- /dev/null +++ b/src/main.c @@ -0,0 +1,45 @@ +/* + * PiTiVi + * Copyright (C) <2004> Edward G. Hervey + * Guillaume Casanova + * + * This software has been written in EPITECH + * EPITECH is a computer science school in Paris - FRANCE - + * under the direction of Flavien Astraud and Jerome Landrieu. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include "pitivi.h" +#include "pitivi-mainapp.h" + +int +main (int argc, char **argv) +{ + PitiviMainApp *mainapp; + + gtk_init (&argc, &argv); + gst_init (&argc, &argv); + + /* We create a PitiviMainApp */ + mainapp = pitivi_mainapp_new (); + + /* And we start the fun */ + gtk_main (); + return 0; +} diff --git a/src/pitivi-mainapp.c b/src/pitivi-mainapp.c new file mode 100644 index 0000000000000000000000000000000000000000..c90e0d0a87863ef6024564a1c90ac0e23e2410f8 --- /dev/null +++ b/src/pitivi-mainapp.c @@ -0,0 +1,228 @@ +/* + * PiTiVi + * Copyright (C) <2004> Edward G. Hervey + * Guillaume Casanova + * + * This software has been written in EPITECH + * EPITECH is a computer science school in Paris - FRANCE - + * under the direction of Flavien Astraud and Jerome Landrieu. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "pitivi.h" +#include "pitivi-mainapp.h" +#include "pitivi-toolboxwindow.h" + + +struct _PitiviMainAppPrivate +{ + /* instance private members */ + gboolean dispose_has_run; + PitiviToolboxWindow *tbxwin; +}; + +/* + * forward definitions + */ + +/* + * Insert "added-value" functions here + */ +void +pitivi_mainapp_destroy(GtkWidget *pWidget, gpointer pData) +{ + gtk_main_quit(); +} + + +PitiviMainApp * +pitivi_mainapp_new (void) +{ + PitiviMainApp *mainapp; + + mainapp = (PitiviMainApp *) g_object_new (PITIVI_MAINAPP_TYPE, NULL); + g_assert (mainapp != NULL); + return mainapp; +} + +static GObject * +pitivi_mainapp_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam * construct_properties) +{ + GObject *obj; + { + /* Invoke parent constructor. */ + PitiviMainAppClass *klass; + GObjectClass *parent_class; + klass = PITIVI_MAINAPP_CLASS (g_type_class_peek (PITIVI_MAINAPP_TYPE)); + parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass)); + obj = parent_class->constructor (type, n_construct_properties, + construct_properties); + } + + /* do stuff. */ + + return obj; +} + +static void +pitivi_mainapp_instance_init (GTypeInstance * instance, gpointer g_class) +{ + PitiviMainApp *self = (PitiviMainApp *) instance; + + self->private = g_new0 (PitiviMainAppPrivate, 1); + + /* initialize all public and private members to reasonable default values. */ + + self->private->dispose_has_run = FALSE; + + /* If you need specific consruction properties to complete initialization, + * delay initialization completion until the property is set. + */ + self->private->tbxwin = pitivi_toolboxwindow_new (); + g_signal_connect(G_OBJECT(self->private->tbxwin), "delete_event", + G_CALLBACK(pitivi_mainapp_destroy), NULL); + gtk_widget_show_all (GTK_WIDGET (self->private->tbxwin)); +} + +static void +pitivi_mainapp_dispose (GObject * object) +{ + PitiviMainApp *self = PITIVI_MAINAPP (object); + + /* If dispose did already run, return. */ + if (self->private->dispose_has_run) + return; + + /* Make sure dispose does not run twice. */ + self->private->dispose_has_run = TRUE; + + /* + * In dispose, you are supposed to free all types referenced from this + * object which might themselves hold a reference to self. Generally, + * the most simple solution is to unref all members on which you own a + * reference. + */ + +} + +static void +pitivi_mainapp_finalize (GObject * object) +{ + PitiviMainApp *self = PITIVI_MAINAPP (object); + + /* + * Here, complete object destruction. + * You might not need to do much... + */ + + g_free (self->private); +} + +static void +pitivi_mainapp_set_property (GObject * object, + guint property_id, + const GValue * value, GParamSpec * pspec) +{ + PitiviMainApp *self = (PitiviMainApp *) object; + + switch (property_id) + { + /* case PITIVI_MAINAPP_PROPERTY: { */ + /* g_free (self->private->name); */ + /* self->private->name = g_value_dup_string (value); */ + /* g_print ("maman: %s\n",self->private->name); */ + /* } */ + /* break; */ + default: + /* We don't have any other property... */ + g_assert (FALSE); + break; + } +} + +static void +pitivi_mainapp_get_property (GObject * object, + guint property_id, + GValue * value, GParamSpec * pspec) +{ + PitiviMainApp *self = (PitiviMainApp *) object; + + switch (property_id) + { + /* case PITIVI_MAINAPP_PROPERTY: { */ + /* g_value_set_string (value, self->private->name); */ + /* } */ + /* break; */ + default: + /* We don't have any other property... */ + g_assert (FALSE); + break; + } +} + +static void +pitivi_mainapp_class_init (gpointer g_class, gpointer g_class_data) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (g_class); + PitiviMainAppClass *klass = PITIVI_MAINAPP_CLASS (g_class); + + gobject_class->constructor = pitivi_mainapp_constructor; + gobject_class->dispose = pitivi_mainapp_dispose; + gobject_class->finalize = pitivi_mainapp_finalize; + + gobject_class->set_property = pitivi_mainapp_set_property; + gobject_class->get_property = pitivi_mainapp_get_property; + + /* Install the properties in the class here ! */ + /* pspec = g_param_spec_string ("maman-name", */ + /* "Maman construct prop", */ + /* "Set maman's name", */ + /* "no-name-set" /\* default value *\/, */ + /* G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE); */ + /* g_object_class_install_property (gobject_class, */ + /* MAMAN_BAR_CONSTRUCT_NAME, */ + /* pspec); */ + + +} + +GType +pitivi_mainapp_get_type (void) +{ + static GType type = 0; + + if (type == 0) + { + static const GTypeInfo info = { + sizeof (PitiviMainAppClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + pitivi_mainapp_class_init, /* class_init */ + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PitiviMainApp), + 0, /* n_preallocs */ + pitivi_mainapp_instance_init /* instance_init */ + }; + type = g_type_register_static (G_TYPE_OBJECT, + "PitiviMainAppType", &info, 0); + } + + return type; +} diff --git a/src/pitivi-mainapp.h b/src/pitivi-mainapp.h new file mode 100644 index 0000000000000000000000000000000000000000..9a38b62bfd88d2fa741e69f825955cb68134596f --- /dev/null +++ b/src/pitivi-mainapp.h @@ -0,0 +1,73 @@ +/* + * PiTiVi + * Copyright (C) <2004> Edward G. Hervey + * Guillaume Casanova + * + * This software has been written in EPITECH + * EPITECH is a computer science school in Paris - FRANCE - + * under the direction of Flavien Astraud and Jerome Landrieu. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef PITIVI_MAINAPP_H +#define PITIVI_MAINAPP_H + +/* + * Potentially, include other headers on which this header depends. + */ + +/* + * Type macros. + */ + +#define PITIVI_MAINAPP_TYPE (pitivi_mainapp_get_type ()) +#define PITIVI_MAINAPP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PITIVI_MAINAPP_TYPE, PitiviMainApp)) +#define PITIVI_MAINAPP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PITIVI_MAINAPP_TYPE, PitiviMainAppClass)) +#define PITIVI_IS_MAINAPP(obj) (G_TYPE_CHECK_TYPE ((obj), PITIVI_MAINAPP_TYPE)) +#define PITIVI_IS_MAINAPP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PITIVI_MAINAPP_TYPE)) +#define PITIVI_MAINAPP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PITIVI_MAINAPP_TYPE, PitiviMainAppClass)) + +typedef struct _PitiviMainApp PitiviMainApp; +typedef struct _PitiviMainAppClass PitiviMainAppClass; +typedef struct _PitiviMainAppPrivate PitiviMainAppPrivate; + +struct _PitiviMainApp +{ + GObject parent; + + /* instance public members */ + + /* private */ + PitiviMainAppPrivate *private; +}; + +struct _PitiviMainAppClass +{ + GObjectClass parent; + /* class members */ +}; + +/* used by PITIVI_MAINAPP_TYPE */ +GType pitivi_mainapp_get_type (void); + +/* + * Method definitions. + */ + +PitiviMainApp *pitivi_mainapp_new (void); + +#endif diff --git a/src/pitivi-project.c b/src/pitivi-project.c new file mode 100644 index 0000000000000000000000000000000000000000..c4a56deffbed93df970f54acac8d04000a63b456 --- /dev/null +++ b/src/pitivi-project.c @@ -0,0 +1,226 @@ +/* + * PiTiVi + * Copyright (C) <2004> Edward G. Hervey + * Guillaume Casanova + * + * This software has been written in EPITECH + * EPITECH is a computer science school in Paris - FRANCE - + * under the direction of Flavien Astraud and Jerome Landrieu. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "pitivi.h" +#include "pitivi-project.h" + +struct _PitiviProjectPrivate +{ + /* instance private members */ + gboolean dispose_has_run; +}; + +/* + * forward definitions + */ + +/* + * Insert "added-value" functions here + */ + +PitiviProject * +pitivi_project_new (void) +{ + PitiviProject *project; + + g_printf ("pitivi_project_new()\n"); + + project = (PitiviProject *) g_object_new (PITIVI_PROJECT_TYPE, NULL); + g_assert (project != NULL); + return project; +} + +static GObject * +pitivi_project_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam * construct_properties) +{ + g_printf ("pitivi_project_constructor()\n"); + + GObject *obj; + { + /* Invoke parent constructor. */ + PitiviProjectClass *klass; + GObjectClass *parent_class; + klass = PITIVI_PROJECT_CLASS (g_type_class_peek (PITIVI_PROJECT_TYPE)); + parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass)); + obj = parent_class->constructor (type, n_construct_properties, + construct_properties); + } + + /* do stuff. */ + + return obj; +} + +static void +pitivi_project_instance_init (GTypeInstance * instance, gpointer g_class) +{ + PitiviProject *self = (PitiviProject *) instance; + + g_printf ("pitivi_project_instance_init()\n"); + + self->private = g_new0 (PitiviProjectPrivate, 1); + + /* initialize all public and private members to reasonable default values. */ + + self->private->dispose_has_run = FALSE; + + /* If you need specific consruction properties to complete initialization, + * delay initialization completion until the property is set. + */ + +} + +static void +pitivi_project_dispose (GObject * object) +{ + PitiviProject *self = PITIVI_PROJECT (object); + + /* If dispose did already run, return. */ + if (self->private->dispose_has_run) + return; + + /* Make sure dispose does not run twice. */ + self->private->dispose_has_run = TRUE; + + /* + * In dispose, you are supposed to free all types referenced from this + * object which might themselves hold a reference to self. Generally, + * the most simple solution is to unref all members on which you own a + * reference. + */ + +} + +static void +pitivi_project_finalize (GObject * object) +{ + PitiviProject *self = PITIVI_PROJECT (object); + + /* + * Here, complete object destruction. + * You might not need to do much... + */ + + g_free (self->private); +} + +static void +pitivi_project_set_property (GObject * object, + guint property_id, + const GValue * value, GParamSpec * pspec) +{ + PitiviProject *self = (PitiviProject *) object; + + switch (property_id) + { + /* case PITIVI_PROJECT_PROPERTY: { */ + /* g_free (self->private->name); */ + /* self->private->name = g_value_dup_string (value); */ + /* g_print ("maman: %s\n",self->private->name); */ + /* } */ + /* break; */ + default: + /* We don't have any other property... */ + g_assert (FALSE); + break; + } +} + +static void +pitivi_project_get_property (GObject * object, + guint property_id, + GValue * value, GParamSpec * pspec) +{ + PitiviProject *self = (PitiviProject *) object; + + switch (property_id) + { + /* case PITIVI_PROJECT_PROPERTY: { */ + /* g_value_set_string (value, self->private->name); */ + /* } */ + /* break; */ + default: + /* We don't have any other property... */ + g_assert (FALSE); + break; + } +} + +static void +pitivi_project_class_init (gpointer g_class, gpointer g_class_data) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (g_class); + PitiviProjectClass *klass = PITIVI_PROJECT_CLASS (g_class); + + g_printf ("pitivi_main_class_init()\n"); + + gobject_class->constructor = pitivi_project_constructor; + gobject_class->dispose = pitivi_project_dispose; + gobject_class->finalize = pitivi_project_finalize; + + gobject_class->set_property = pitivi_project_set_property; + gobject_class->get_property = pitivi_project_get_property; + + /* Install the properties in the class here ! */ + /* pspec = g_param_spec_string ("maman-name", */ + /* "Maman construct prop", */ + /* "Set maman's name", */ + /* "no-name-set" /\* default value *\/, */ + /* G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE); */ + /* g_object_class_install_property (gobject_class, */ + /* MAMAN_BAR_CONSTRUCT_NAME, */ + /* pspec); */ + + +} + +GType +pitivi_project_get_type (void) +{ + static GType type = 0; + + g_printf ("pitivi_main_get_type()\n"); + + if (type == 0) + { + static const GTypeInfo info = { + sizeof (PitiviProjectClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + pitivi_project_class_init, /* class_init */ + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PitiviProject), + 0, /* n_preallocs */ + pitivi_project_instance_init /* instance_init */ + }; + type = g_type_register_static (G_TYPE_OBJECT, + "PitiviProjectType", &info, 0); + } + + return type; +} diff --git a/src/pitivi-project.h b/src/pitivi-project.h new file mode 100644 index 0000000000000000000000000000000000000000..e281b91e45be8e9c4aef32475419bdad6112ed8a --- /dev/null +++ b/src/pitivi-project.h @@ -0,0 +1,73 @@ +/* + * PiTiVi + * Copyright (C) <2004> Edward G. Hervey + * Guillaume Casanova + * + * This software has been written in EPITECH + * EPITECH is a computer science school in Paris - FRANCE - + * under the direction of Flavien Astraud and Jerome Landrieu. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef PITIVI_PROJECT_H +#define PITIVI_PROJECT_H + +/* + * Potentially, include other headers on which this header depends. + */ + +/* + * Type macros. + */ + +#define PITIVI_PROJECT_TYPE (pitivi_project_get_type ()) +#define PITIVI_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PITIVI_PROJECT_TYPE, PitiviProject)) +#define PITIVI_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PITIVI_PROJECT_TYPE, PitiviProjectClass)) +#define PITIVI_IS_PROJECT(obj) (G_TYPE_CHECK_TYPE ((obj), PITIVI_PROJECT_TYPE)) +#define PITIVI_IS_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PITIVI_PROJECT_TYPE)) +#define PITIVI_PROJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PITIVI_PROJECT_TYPE, PitiviProjectClass)) + +typedef struct _PitiviProject PitiviProject; +typedef struct _PitiviProjectClass PitiviProjectClass; +typedef struct _PitiviProjectPrivate PitiviProjectPrivate; + +struct _PitiviProject +{ + GObject parent; + + /* instance public members */ + + /* private */ + PitiviProjectPrivate *private; +}; + +struct _PitiviProjectClass +{ + GObjectClass parent; + /* class members */ +}; + +/* used by PITIVI_PROJECT_TYPE */ +GType pitivi_project_get_type (void); + +/* + * Method definitions. + */ + +PitiviProject *pitivi_project_new (void); + +#endif diff --git a/src/pitivi-toolbox.c b/src/pitivi-toolbox.c new file mode 100644 index 0000000000000000000000000000000000000000..8202e3f780e03031f0c7ba133759d0fbd53289ae --- /dev/null +++ b/src/pitivi-toolbox.c @@ -0,0 +1,327 @@ +/* + * PiTiVi + * Copyright (C) <2004> Edward G. Hervey + * Guillaume Casanova + * + * This software has been written in EPITECH + * EPITECH is a computer science school in Paris - FRANCE - + * under the direction of Flavien Astraud and Jerome Landrieu. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "pitivi.h" +#include "pitivi-toolbox.h" + +struct _PitiviToolboxPrivate +{ + /* instance private members */ + gboolean dispose_has_run; + GtkWidget *button[4]; + GSList *group_button; +}; + +/* + * forward definitions + */ + +/* + * Insert "added-value" functions here + */ + +/* + * CALLBACKS + */ + +void +cursor_change_select (GtkRadioButton * radiobutton, gpointer window) +{ + GdkCursor *cursor; + + if (gtk_toggle_tool_button_get_active + (GTK_TOGGLE_TOOL_BUTTON (radiobutton))) + { + cursor = gdk_cursor_new (GDK_TOP_LEFT_ARROW); + gdk_window_set_cursor (GDK_WINDOW (GTK_WIDGET (window)->window), + cursor); + gdk_cursor_unref (cursor); + } +} +void +cursor_change_cut (GtkRadioButton * radiobutton, gpointer window) +{ + GdkCursor *cursor; + + if (gtk_toggle_tool_button_get_active + (GTK_TOGGLE_TOOL_BUTTON (radiobutton))) + { + cursor = gdk_cursor_new (GDK_BOGOSITY); + gdk_window_set_cursor (GDK_WINDOW (GTK_WIDGET (window)->window), + cursor); + gdk_cursor_unref (cursor); + } +} + +void +cursor_change_hand (GtkRadioButton * radiobutton, gpointer window) +{ + GdkCursor *cursor; + + if (gtk_toggle_tool_button_get_active + (GTK_TOGGLE_TOOL_BUTTON (radiobutton))) + { + cursor = gdk_cursor_new (GDK_HAND2); + gdk_window_set_cursor (GDK_WINDOW (GTK_WIDGET (window)->window), + cursor); + gdk_cursor_unref (cursor); + } +} + + +/* + * Standard GObject functions + */ + +PitiviToolbox * +pitivi_toolbox_new (void) +{ + PitiviToolbox *toolbox; + + g_printf ("pitivi_toolbox_new()\n"); + + toolbox = (PitiviToolbox *) g_object_new (PITIVI_TOOLBOX_TYPE, NULL); + g_assert (toolbox != NULL); + return toolbox; +} + +static GObject * +pitivi_toolbox_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam * construct_properties) +{ + g_printf ("pitivi_toolbox_constructor()\n"); + + GObject *obj; + { + /* Invoke parent constructor. */ + PitiviToolboxClass *klass; + GObjectClass *parent_class; + klass = PITIVI_TOOLBOX_CLASS (g_type_class_peek (PITIVI_TOOLBOX_TYPE)); + parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass)); + obj = parent_class->constructor (type, n_construct_properties, + construct_properties); + } + + /* do stuff. */ + + return obj; +} + +static void +pitivi_toolbox_instance_init (GTypeInstance * instance, gpointer g_class) +{ + PitiviToolbox *self = (PitiviToolbox *) instance; + GtkToolbar *tbar = GTK_TOOLBAR (instance); + + g_printf ("pitivi_toolbox_instance_init()\n"); + + self->private = g_new0 (PitiviToolboxPrivate, 1); + self->private->group_button = g_new0 (GSList, 1); + + /* initialize all public and private members to reasonable default values. */ + + self->private->dispose_has_run = FALSE; + + /* If you need specific consruction properties to complete initialization, + * delay initialization completion until the property is set. + */ + + self->private->button[0] = + GTK_WIDGET (gtk_radio_tool_button_new_from_stock + (NULL, GTK_STOCK_COLOR_PICKER)); + self->private->group_button = + gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON + (self->private->button[0])); + self->private->button[1] = + GTK_WIDGET (gtk_radio_tool_button_new_from_stock + (self->private->group_button, GTK_STOCK_CUT)); + self->private->group_button = + gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON + (self->private->button[0])); + self->private->button[2] = + GTK_WIDGET (gtk_radio_tool_button_new_from_stock + (self->private->group_button, GTK_STOCK_INDEX)); + self->private->group_button = + gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON + (self->private->button[0])); + self->private->button[3] = + GTK_WIDGET (gtk_radio_tool_button_new_from_stock + (self->private->group_button, GTK_STOCK_ZOOM_IN)); + + /* + * We'll have to modify these functions so that they set the cursor + * to work in the good window (i.e: PitiviTimelineWindow) + */ + + g_signal_connect (G_OBJECT (self->private->button[0]), "toggled", + G_CALLBACK (cursor_change_select), (gpointer) self); + g_signal_connect (G_OBJECT (self->private->button[1]), "toggled", + G_CALLBACK (cursor_change_cut), (gpointer) self); + g_signal_connect (G_OBJECT (self->private->button[2]), "toggled", + G_CALLBACK (cursor_change_hand), (gpointer) self); +/* g_signal_connect(G_OBJECT(self->private->button[3]), "toggled", */ +/* G_CALLBACK(cursor_change_zoom), (gpointer)self) ; */ + + gtk_toolbar_set_orientation (tbar, GTK_ORIENTATION_VERTICAL); + gtk_toolbar_set_show_arrow (tbar, FALSE); + gtk_toolbar_set_style (tbar, GTK_TOOLBAR_ICONS); + gtk_toolbar_insert (tbar, GTK_TOOL_ITEM (self->private->button[0]), 0); + gtk_toolbar_insert (tbar, GTK_TOOL_ITEM (self->private->button[1]), 1); + gtk_toolbar_insert (tbar, GTK_TOOL_ITEM (self->private->button[2]), 2); + gtk_toolbar_insert (tbar, GTK_TOOL_ITEM (self->private->button[3]), 3); + +} + +static void +pitivi_toolbox_dispose (GObject * object) +{ + PitiviToolbox *self = PITIVI_TOOLBOX (object); + + /* If dispose did already run, return. */ + if (self->private->dispose_has_run) + return; + + /* Make sure dispose does not run twice. */ + self->private->dispose_has_run = TRUE; + + /* + * In dispose, you are supposed to free all types referenced from this + * object which might themselves hold a reference to self. Generally, + * the most simple solution is to unref all members on which you own a + * reference. + */ + +} + +static void +pitivi_toolbox_finalize (GObject * object) +{ + PitiviToolbox *self = PITIVI_TOOLBOX (object); + + /* + * Here, complete object destruction. + * You might not need to do much... + */ + + g_free (self->private); +} + +static void +pitivi_toolbox_set_property (GObject * object, + guint property_id, + const GValue * value, GParamSpec * pspec) +{ + PitiviToolbox *self = (PitiviToolbox *) object; + + switch (property_id) + { + /* case PITIVI_TOOLBOX_PROPERTY: { */ + /* g_free (self->private->name); */ + /* self->private->name = g_value_dup_string (value); */ + /* g_print ("maman: %s\n",self->private->name); */ + /* } */ + /* break; */ + default: + /* We don't have any other property... */ + g_assert (FALSE); + break; + } +} + +static void +pitivi_toolbox_get_property (GObject * object, + guint property_id, + GValue * value, GParamSpec * pspec) +{ + PitiviToolbox *self = (PitiviToolbox *) object; + + switch (property_id) + { + /* case PITIVI_TOOLBOX_PROPERTY: { */ + /* g_value_set_string (value, self->private->name); */ + /* } */ + /* break; */ + default: + /* We don't have any other property... */ + g_assert (FALSE); + break; + } +} + +static void +pitivi_toolbox_class_init (gpointer g_class, gpointer g_class_data) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (g_class); + PitiviToolboxClass *klass = PITIVI_TOOLBOX_CLASS (g_class); + + g_printf ("pitivi_main_class_init()\n"); + + gobject_class->constructor = pitivi_toolbox_constructor; + gobject_class->dispose = pitivi_toolbox_dispose; + gobject_class->finalize = pitivi_toolbox_finalize; + + gobject_class->set_property = pitivi_toolbox_set_property; + gobject_class->get_property = pitivi_toolbox_get_property; + + /* Install the properties in the class here ! */ + /* pspec = g_param_spec_string ("maman-name", */ + /* "Maman construct prop", */ + /* "Set maman's name", */ + /* "no-name-set" /\* default value *\/, */ + /* G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE); */ + /* g_object_class_install_property (gobject_class, */ + /* MAMAN_BAR_CONSTRUCT_NAME, */ + /* pspec); */ + + +} + +GType +pitivi_toolbox_get_type (void) +{ + static GType type = 0; + + g_printf ("pitivi_main_get_type()\n"); + + if (type == 0) + { + static const GTypeInfo info = { + sizeof (PitiviToolboxClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + pitivi_toolbox_class_init, /* class_init */ + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PitiviToolbox), + 0, /* n_preallocs */ + pitivi_toolbox_instance_init /* instance_init */ + }; + type = g_type_register_static (GTK_TYPE_TOOLBAR, + "PitiviToolboxType", &info, 0); + } + + return type; +} diff --git a/src/pitivi-toolbox.h b/src/pitivi-toolbox.h new file mode 100644 index 0000000000000000000000000000000000000000..8b6f142ffbad2553c6af3eb92a36e3681e71be9f --- /dev/null +++ b/src/pitivi-toolbox.h @@ -0,0 +1,75 @@ +/* + * PiTiVi + * Copyright (C) <2004> Edward G. Hervey + * Guillaume Casanova + * + * This software has been written in EPITECH + * EPITECH is a computer science school in Paris - FRANCE - + * under the direction of Flavien Astraud and Jerome Landrieu. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef PITIVI_TOOLBOX_H +#define PITIVI_TOOLBOX_H + +/* + * Potentially, include other headers on which this header depends. + */ + +#include + +/* + * Type macros. + */ + +#define PITIVI_TOOLBOX_TYPE (pitivi_toolbox_get_type ()) +#define PITIVI_TOOLBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PITIVI_TOOLBOX_TYPE, PitiviToolbox)) +#define PITIVI_TOOLBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PITIVI_TOOLBOX_TYPE, PitiviToolboxClass)) +#define PITIVI_IS_TOOLBOX(obj) (G_TYPE_CHECK_TYPE ((obj), PITIVI_TOOLBOX_TYPE)) +#define PITIVI_IS_TOOLBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PITIVI_TOOLBOX_TYPE)) +#define PITIVI_TOOLBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PITIVI_TOOLBOX_TYPE, PitiviToolboxClass)) + +typedef struct _PitiviToolbox PitiviToolbox; +typedef struct _PitiviToolboxClass PitiviToolboxClass; +typedef struct _PitiviToolboxPrivate PitiviToolboxPrivate; + +struct _PitiviToolbox +{ + GtkToolbar parent; + + /* instance public members */ + + /* private */ + PitiviToolboxPrivate *private; +}; + +struct _PitiviToolboxClass +{ + GtkToolbarClass parent; + /* class members */ +}; + +/* used by PITIVI_TOOLBOX_TYPE */ +GType pitivi_toolbox_get_type (void); + +/* + * Method definitions. + */ + +PitiviToolbox *pitivi_toolbox_new (void); + +#endif diff --git a/src/pitivi-toolboxwindow.c b/src/pitivi-toolboxwindow.c new file mode 100644 index 0000000000000000000000000000000000000000..3166bd7d22eadc25ab86a7a7533e48c41a2e8ac7 --- /dev/null +++ b/src/pitivi-toolboxwindow.c @@ -0,0 +1,213 @@ +/* + * PiTiVi + * Copyright (C) <2004> Edward G. Hervey + * Guillaume Casanova + * + * This software has been written in EPITECH + * EPITECH is a computer science school in Paris - FRANCE - + * under the direction of Flavien Astraud and Jerome Landrieu. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "pitivi-toolbox.h" +#include "pitivi-toolboxwindow.h" +#include "pitivi.h" + +struct _PitiviToolboxWindowPrivate +{ + /* instance private members */ + gboolean dispose_has_run; + GtkWidget *vbox; + PitiviToolbox *toolbox; +}; + +/* + * forward definitions + */ + +/* + * Insert "added-value" functions here + */ + +PitiviToolboxWindow * +pitivi_toolboxwindow_new (void) +{ + PitiviToolboxWindow *toolboxwindow; + + g_printf ("pitivi_toolboxwindow_new()\n"); + + toolboxwindow = + (PitiviToolboxWindow *) g_object_new (PITIVI_TOOLBOXWINDOW_TYPE, NULL); + g_assert (toolboxwindow != NULL); + return toolboxwindow; +} + +static void +pitivi_toolboxwindow_instance_init (GTypeInstance * instance, + gpointer g_class) +{ + PitiviToolboxWindow *self = (PitiviToolboxWindow *) instance; + + g_printf ("pitivi_toolboxwindow_instance_init()\n"); + + self->private = g_new0 (PitiviToolboxWindowPrivate, 1); + + /* initialize all public and private members to reasonable default values. */ + + self->private->dispose_has_run = FALSE; + + /* If you need specific consruction properties to complete initialization, + * delay initialization completion until the property is set. + */ + + self->private->toolbox = pitivi_toolbox_new (); + self->private->vbox = gtk_vbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (self->private->vbox), + GTK_WIDGET (self->private->toolbox), FALSE, FALSE, 0); + gtk_container_add (GTK_CONTAINER (self), self->private->vbox); +} + +static void +pitivi_toolboxwindow_dispose (GObject * object) +{ + PitiviToolboxWindow *self = PITIVI_TOOLBOXWINDOW (object); + + /* If dispose did already run, return. */ + if (self->private->dispose_has_run) + return; + + /* Make sure dispose does not run twice. */ + self->private->dispose_has_run = TRUE; + + /* + * In dispose, you are supposed to free all types referenced from this + * object which might themselves hold a reference to self. Generally, + * the most simple solution is to unref all members on which you own a + * reference. + */ + +} + +static void +pitivi_toolboxwindow_finalize (GObject * object) +{ + PitiviToolboxWindow *self = PITIVI_TOOLBOXWINDOW (object); + + /* + * Here, complete object destruction. + * You might not need to do much... + */ + + g_free (self->private); +} + +static void +pitivi_toolboxwindow_set_property (GObject * object, + guint property_id, + const GValue * value, GParamSpec * pspec) +{ + PitiviToolboxWindow *self = (PitiviToolboxWindow *) object; + + switch (property_id) + { + /* case PITIVI_TOOLBOXWINDOW_PROPERTY: { */ + /* g_free (self->private->name); */ + /* self->private->name = g_value_dup_string (value); */ + /* g_print ("maman: %s\n",self->private->name); */ + /* } */ + /* break; */ + default: + /* We don't have any other property... */ + g_assert (FALSE); + break; + } +} + +static void +pitivi_toolboxwindow_get_property (GObject * object, + guint property_id, + GValue * value, GParamSpec * pspec) +{ + PitiviToolboxWindow *self = (PitiviToolboxWindow *) object; + + switch (property_id) + { + /* case PITIVI_TOOLBOXWINDOW_PROPERTY: { */ + /* g_value_set_string (value, self->private->name); */ + /* } */ + /* break; */ + default: + /* We don't have any other property... */ + g_assert (FALSE); + break; + } +} + +static void +pitivi_toolboxwindow_class_init (gpointer g_class, gpointer g_class_data) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (g_class); + PitiviToolboxWindowClass *klass = PITIVI_TOOLBOXWINDOW_CLASS (g_class); + + g_printf ("pitivi_main_class_init()\n"); + + gobject_class->dispose = pitivi_toolboxwindow_dispose; + gobject_class->finalize = pitivi_toolboxwindow_finalize; + + gobject_class->set_property = pitivi_toolboxwindow_set_property; + gobject_class->get_property = pitivi_toolboxwindow_get_property; + + /* Install the properties in the class here ! */ + /* pspec = g_param_spec_string ("maman-name", */ + /* "Maman construct prop", */ + /* "Set maman's name", */ + /* "no-name-set" /\* default value *\/, */ + /* G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE); */ + /* g_object_class_install_property (gobject_class, */ + /* MAMAN_BAR_CONSTRUCT_NAME, */ + /* pspec); */ + + +} + +GType +pitivi_toolboxwindow_get_type (void) +{ + static GType type = 0; + + g_printf ("pitivi_toolboxwindow_get_type()\n"); + + if (type == 0) + { + static const GTypeInfo info = { + sizeof (PitiviToolboxWindowClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + pitivi_toolboxwindow_class_init, /* class_init */ + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PitiviToolboxWindow), + 0, /* n_preallocs */ + pitivi_toolboxwindow_instance_init /* instance_init */ + }; + type = g_type_register_static (GTK_TYPE_WINDOW, + "PitiviToolboxWindowType", &info, 0); + } + + return type; +} diff --git a/src/pitivi-toolboxwindow.h b/src/pitivi-toolboxwindow.h new file mode 100644 index 0000000000000000000000000000000000000000..879439a1f6f0366e1d8df61c605471519a0a244f --- /dev/null +++ b/src/pitivi-toolboxwindow.h @@ -0,0 +1,75 @@ +/* + * PiTiVi + * Copyright (C) <2004> Edward G. Hervey + * Guillaume Casanova + * + * This software has been written in EPITECH + * EPITECH is a computer science school in Paris - FRANCE - + * under the direction of Flavien Astraud and Jerome Landrieu. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef PITIVI_TOOLBOXWINDOW_H +#define PITIVI_TOOLBOXWINDOW_H + +/* + * Potentially, include other headers on which this header depends. + */ + +#include + +/* + * Type macros. + */ + +#define PITIVI_TOOLBOXWINDOW_TYPE (pitivi_toolboxwindow_get_type ()) +#define PITIVI_TOOLBOXWINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PITIVI_TOOLBOXWINDOW_TYPE, PitiviToolboxWindow)) +#define PITIVI_TOOLBOXWINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PITIVI_TOOLBOXWINDOW_TYPE, PitiviToolboxWindowClass)) +#define PITIVI_IS_TOOLBOXWINDOW(obj) (G_TYPE_CHECK_TYPE ((obj), PITIVI_TOOLBOXWINDOW_TYPE)) +#define PITIVI_IS_TOOLBOXWINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PITIVI_TOOLBOXWINDOW_TYPE)) +#define PITIVI_TOOLBOXWINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PITIVI_TOOLBOXWINDOW_TYPE, PitiviToolboxWindowClass)) + +typedef struct _PitiviToolboxWindow PitiviToolboxWindow; +typedef struct _PitiviToolboxWindowClass PitiviToolboxWindowClass; +typedef struct _PitiviToolboxWindowPrivate PitiviToolboxWindowPrivate; + +struct _PitiviToolboxWindow +{ + GtkWindow parent; + + /* instance public members */ + + /* private */ + PitiviToolboxWindowPrivate *private; +}; + +struct _PitiviToolboxWindowClass +{ + GtkWindowClass parent; + /* class members */ +}; + +/* used by PITIVI_TOOLBOXWINDOW_TYPE */ +GType pitivi_toolboxwindow_get_type (void); + +/* + * Method definitions. + */ + +PitiviToolboxWindow *pitivi_toolboxwindow_new (void); + +#endif diff --git a/src/pitivi.h b/src/pitivi.h new file mode 100644 index 0000000000000000000000000000000000000000..f70362d58943b3717f9d9a654f26b0e5ed9245c0 --- /dev/null +++ b/src/pitivi.h @@ -0,0 +1,32 @@ +/* + * PiTiVi + * Copyright (C) <2004> Edward G. Hervey + * Guillaume Casanova + * + * This software has been written in EPITECH + * EPITECH is a computer science school in Paris - FRANCE - + * under the direction of Flavien Astraud and Jerome Landrieu. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef PITIVI_H +#define PITIVI_H + +#include +#include + +#endif