X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fgtk2%2Ffactory.c;h=be50416909f8d5cf1b05061a3a497740bb7ef8b5;hb=bf3264b9e340ba5c11cbf59835a8af3db94e0cc2;hp=bbddaa25f6b0507d6ce28584b76ad4c4fbf594d4;hpb=5f0547204a5a08185e9d8162016cc2ec9a670486;p=melted diff --git a/src/modules/gtk2/factory.c b/src/modules/gtk2/factory.c index bbddaa2..be50416 100644 --- a/src/modules/gtk2/factory.c +++ b/src/modules/gtk2/factory.c @@ -3,40 +3,74 @@ * Copyright (C) 2003-2004 Ushodaya Enterprises Limited * Author: Charles Yates * - * 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 library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser 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. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" #include +#ifdef USE_PIXBUF +#include #include "producer_pixbuf.h" -#include "producer_pango.h" #include "filter_rescale.h" +#endif + +#ifdef USE_GTK2 +#include "consumer_gtk2.h" +#endif + +#ifdef USE_PANGO +#include "producer_pango.h" +#endif + +static void initialise( ) +{ + static int init = 0; + if ( init == 0 ) + { + init = 1; + g_type_init( ); + } +} void *mlt_create_producer( char *id, void *arg ) { + initialise( ); + +#ifdef USE_PIXBUF if ( !strcmp( id, "pixbuf" ) ) return producer_pixbuf_init( arg ); - else if ( !strcmp( id, "pango" ) ) +#endif + +#ifdef USE_PANGO + if ( !strcmp( id, "pango" ) ) return producer_pango_init( arg ); +#endif + return NULL; } void *mlt_create_filter( char *id, void *arg ) { - if ( !strcmp( id, "rescale" ) ) + initialise( ); + +#ifdef USE_PIXBUF + if ( !strcmp( id, "gtkrescale" ) ) return filter_rescale_init( arg ); +#endif + return NULL; } @@ -47,6 +81,13 @@ void *mlt_create_transition( char *id, void *arg ) void *mlt_create_consumer( char *id, void *arg ) { + initialise( ); + +#ifdef USE_GTK2 + if ( !strcmp( id, "gtk2_preview" ) ) + return consumer_gtk2_preview_init( arg ); +#endif + return NULL; }