Commit 2a55093c authored by Sam Hocevar's avatar Sam Hocevar

* ./bootstrap, ./toolbox: moved the Glade bugs fixing to toolbox, now

    use "./toolbox --fix-glade" to generate and fix source files.
  * ./include/vlc_common.h: fixed compilation warnings.
parent a793be38
#! /bin/sh
## bootstrap file for vlc, the VideoLAN Client
## $Id: bootstrap,v 1.39 2003/01/27 23:42:59 sam Exp $
## $Id: bootstrap,v 1.40 2003/01/28 17:11:38 sam Exp $
##
## Authors: Samuel Hocevar <sam@zoy.org>
......@@ -283,39 +283,6 @@ rm -f mozilla/vlcintf.h
##
set +x
##
## Glade sometimes sucks
##
echo "workarounds for annoying glade features"
for file in gnome_interface.c gtk_interface.c
do
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
then
rm -f /tmp/$$.$file.bak
cat > /tmp/$$.$file.bak << EOF
/* This file was created automatically by glade and fixed by bootstrap */
#include <vlc/vlc.h>
EOF
sed -e 1,7d \
-e 's#_("-:--:--")#"-:--:--"#' \
-e 's#_("---")#"---"#' \
-e 's#_("--")#"--"#' \
-e 's#_("/dev/dvd")#"/dev/dvd"#' \
-e 's#_(\("./."\))#\1#' \
< modules/gui/gtk/$file >> /tmp/$$.$file.bak
mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
fi
done
file=gtk_support.h
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
then
rm -f /tmp/$$.$file.bak
sed -e 's/DO NOT EDIT THIS FILE.*/This file was created automatically by glade and fixed by bootstrap/ ; s/#if.*ENABLE_NLS.*/#if defined( ENABLE_NLS ) \&\& defined ( HAVE_GETTEXT )/' < modules/gui/gtk/$file > /tmp/$$.$file.bak
mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
fi
##
## Tell the user about gettext and sed
##
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.51 2003/01/28 12:30:44 gbazin Exp $
* $Id: vlc_common.h,v 1.52 2003/01/28 17:11:38 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -648,9 +648,8 @@ typedef __int64 off_t;
VLC_EXPORT( char *, vlc_dgettext, ( const char *package, const char *msgid ) );
#if defined( ENABLE_NLS ) && \
(defined(MODULE_NAME_IS_gnome)||defined(MODULE_NAME_IS_gtk) \
||defined(MODULE_NAME_IS_familiar))
/* Declare nothing: gtk.h will do it for us */
(defined(MODULE_NAME_IS_gnome)||defined(MODULE_NAME_IS_gnome_main))
/* Declare nothing: gnome.h will do it for us */
#elif defined( ENABLE_NLS ) && defined( HAVE_INCLUDED_GETTEXT )
# include "libintl.h"
# undef _
......
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
/* This file was created automatically by glade and fixed by bootstrap */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <vlc/vlc.h>
#include <sys/types.h>
#include <sys/stat.h>
......@@ -195,7 +191,7 @@ create_familiar (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_about);
slider_label = gtk_label_new (_("0:00:00"));
slider_label = gtk_label_new ("0:00:00");
gtk_widget_set_name (slider_label, "slider_label");
gtk_widget_ref (slider_label);
gtk_object_set_data_full (GTK_OBJECT (familiar), "slider_label", slider_label,
......@@ -315,12 +311,12 @@ create_familiar (void)
gtk_fixed_put (GTK_FIXED (fixedMedia), comboURL, 40, 4);
gtk_widget_set_uposition (comboURL, 40, 4);
gtk_widget_set_usize (comboURL, 185, 24);
comboURL_items = g_list_append (comboURL_items, (gpointer) _("file://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("ftp://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("http://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("udp://:1234"));
comboURL_items = g_list_append (comboURL_items, (gpointer) "file://");
comboURL_items = g_list_append (comboURL_items, (gpointer) "ftp://");
comboURL_items = g_list_append (comboURL_items, (gpointer) "http://");
comboURL_items = g_list_append (comboURL_items, (gpointer) "udp://:1234");
comboURL_items = g_list_append (comboURL_items, (gpointer) _("udp6://:1234"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("rtp://:1234"));
comboURL_items = g_list_append (comboURL_items, (gpointer) "rtp://:1234");
comboURL_items = g_list_append (comboURL_items, (gpointer) _("rtp6://:1234"));
gtk_combo_set_popdown_strings (GTK_COMBO (comboURL), comboURL_items);
g_list_free (comboURL_items);
......@@ -331,7 +327,7 @@ create_familiar (void)
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboURL_entry", comboURL_entry,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (comboURL_entry);
gtk_entry_set_text (GTK_ENTRY (comboURL_entry), _("file://"));
gtk_entry_set_text (GTK_ENTRY (comboURL_entry), "file://");
media = gtk_label_new (_("Media"));
gtk_widget_set_name (media, "media");
......
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
* Created by glade, fixed by bootstrap
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
# include <vlc/vlc.h>
#endif
#include <gtk/gtk.h>
......@@ -11,7 +11,7 @@
/*
* Standard gettext macros.
*/
#ifdef ENABLE_NLS
#if 0 /* Disabled by bootstrap */
# include <libintl.h>
# undef _
# define _(String) dgettext (PACKAGE, String)
......@@ -20,7 +20,7 @@
# else
# define N_(String) (String)
# endif
#else
/* #else */
# define textdomain(String) (String)
# define gettext(String) (String)
# define dgettext(Domain,Message) (Message)
......
/*
* This file was created automatically by glade and fixed by bootstrap
* Created by glade, fixed by bootstrap
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
# include <vlc/vlc.h>
#endif
#include <gtk/gtk.h>
......@@ -11,7 +11,7 @@
/*
* Standard gettext macros.
*/
#if defined( ENABLE_NLS ) && defined ( HAVE_GETTEXT )
#if 0 /* Disabled by bootstrap */
# include <libintl.h>
# undef _
# define _(String) dgettext (PACKAGE, String)
......@@ -20,7 +20,7 @@
# else
# define N_(String) (String)
# endif
#else
/* #else */
# define textdomain(String) (String)
# define gettext(String) (String)
# define dgettext(Domain,Message) (Message)
......
#! /bin/sh
## toolbox for vlc, the VideoLAN Client
## $Id: toolbox,v 1.5 2003/01/16 12:49:28 sam Exp $
## $Id: toolbox,v 1.6 2003/01/28 17:11:38 sam Exp $
##
## Authors: Samuel Hocevar <sam@zoy.org>
......@@ -22,6 +22,7 @@ help()
recognized flags are:
--update-vc update Microsoft Visual Studio files
--update-po update translation files
--fix-glade fix Glade-generated files
EOF
exit 1
}
......@@ -32,6 +33,7 @@ EOF
do_help=yes
do_po=no
do_vc=no
do_glade=no
while test $# -gt 0; do
case "$1" in
--update-vc)
......@@ -42,6 +44,10 @@ while test $# -gt 0; do
do_help=no
do_po=yes
;;
--fix-glade)
do_help=no
do_glade=yes
;;
*)
echo "$0: unknown option $1"
do_help=yes
......@@ -304,3 +310,55 @@ then
exit 0
fi
##
## Fix glade-generated files
##
if test "$do_glade" = "yes"
then
for file in modules/gui/gtk/gnome.glade modules/gui/gtk/gtk.glade modules/gui/familiar/familiar.glade
do
echo "generating code from $file"
glade -w $file || exit 1
done
for file in modules/gui/gtk/gnome_interface.c modules/gui/gtk/gtk_interface.c modules/gui/familiar/interface.c
do
echo "fixing $file"
if grep "DO NOT EDIT THIS FILE" $file 2>&1 > /dev/null
then
rm -f $file.$$.bak
cat > $file.$$.bak << EOF
/* This file was created automatically by glade and fixed by bootstrap */
#include <vlc/vlc.h>
EOF
sed -e 1,7d \
-e 's#_(\(".:..:.."\))#\1#' \
-e 's#_(\("[a-z]*://[^"]*"\))#\1#' \
-e 's#_("---")#"---"#' \
-e 's#_("--")#"--"#' \
-e 's#_("/dev/dvd")#"/dev/dvd"#' \
-e 's#_(\("./."\))#\1#' \
< $file >> $file.$$.bak
mv -f $file.$$.bak $file
fi
done
for file in modules/gui/gtk/gtk_support.h modules/gui/familiar/support.h
do
echo "fixing $file"
if grep "DO NOT EDIT THIS FILE" $file 2>&1 > /dev/null
then
rm -f $file.$$.bak
sed -e 's/DO NOT EDIT.*/Created by glade, fixed by bootstrap/' \
-e 's,<config.h>,<vlc/vlc.h>,' \
-e 's,#if.*ENABLE_NLS.*,#if 0 /* Disabled by bootstrap */,' \
-e 's,#else,/* & */,' \
< $file > $file.$$.bak
mv -f $file.$$.bak $file
fi
done
exit 0
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment