Subject: add missing headers and delcarations
Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=660262
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=639850
Author: Daniel T Chen <crimsun@ubuntu.com> (et al.)
Author: Thibaut Paumard <paumard@users.sourceforge.net>
Last-Update: 2011-09-27

Missing #include directives and other prototypes cause build failures
and runtime errors, in partuclar on 64 bit architectures.


--- a/gap/gap_story_dialog.h
+++ b/gap/gap_story_dialog.h
@@ -32,6 +32,8 @@
 #include "gap_story_main.h"
 #include "gap_story_properties.h"
 
+GtkWidget * p_gtk_button_new_from_stock_icon(const char *stock_id);
+
 void    gap_storyboard_dialog(GapStbMainGlobalParams *gpp);
 
 void    gap_story_dlg_attw_render_all(GapStbAttrWidget *attw);
--- a/gap/gap_story_properties.c
+++ b/gap/gap_story_properties.c
@@ -55,6 +55,7 @@
 #include "gap_timeconv.h"
 #include "gap_thumbnail.h"
 #include "gap_fmac_base.h"
+#include "gap_fmac_name.h"
 #include "gap_story_vthumb.h"
 
 
--- a/libgapvidutil/gap_gve_misc_util.c
+++ b/libgapvidutil/gap_gve_misc_util.c
@@ -33,13 +33,15 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
+#include <string.h>
 
+#include <glib/gstdio.h>
 
 /* GIMP includes */
 #include "gtk/gtk.h"
 /* #include "libgimp/stdplugins-intl.h" */
 #include "libgimp/gimp.h"
-
+#include "gap_image.h"
 
 #include "gap_libgapbase.h"
 #include "gap_gve_misc_util.h"
--- a/vid_enc_avi/gap_enc_avi_main.c
+++ b/vid_enc_avi/gap_enc_avi_main.c
@@ -57,6 +57,7 @@
 
 #include "gap_gve_story.h"     /* for STORYBOARD support */
 
+#include "gap_gve_png.h"
 #include "gap_gve_jpeg.h"      /* for the builtin JPEG support */
 #include "gap_gve_raw.h"       /* for raw CODEC support */
 #include "gap_gve_xvid.h"      /* for XVID CODEC support */
--- a/libgapvidapi/gap_vid_api_util.c
+++ b/libgapvidapi/gap_vid_api_util.c
@@ -8,7 +8,6 @@
 
 #include <glib/gstdio.h>
 
-
 /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX END fcache procedures */
 
 
@@ -212,6 +211,13 @@
 
 /* CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC END copies of gap_lib procedures */
 
+/* WARNING!
+   This is a deprecated GIMP API from #include <libgimpmath/gimpmd5.h>
+   Someone should update the code to use GChecksum from glib
+ */
+void gimp_md5_get_digest (const gchar *buffer,
+                          gint         buffer_size,
+                          guchar       digest[16]);
 
 
 /* --------------------------------
--- a/gap/gap_split.c
+++ b/gap/gap_split.c
@@ -54,6 +54,7 @@
 #endif
 
 /* GIMP includes */
+#include "glib/gstdio.h"
 #include "gtk/gtk.h"
 #include "config.h"
 #include "gap-intl.h"
--- a/gap/gap_story_sox.c
+++ b/gap/gap_story_sox.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#include <stdlib.h>
 #include <config.h>
 
 #include <glib/gstdio.h>
--- a/libgapvidapi/gap_vid_api.c
+++ b/libgapvidapi/gap_vid_api.c
@@ -63,6 +63,7 @@
 
 #include <libgimp/gimp.h>
 #include <gap_vid_api-intl.h>
+#include <gap_file_util.h>
 
 /* includes for UNIX fork-based workarond for the libmpeg3 crash on close bug */
 #ifndef G_OS_WIN32
--- a/libgapvidutil/gap_gve_png.c
+++ b/libgapvidutil/gap_gve_png.c
@@ -41,6 +41,7 @@
 #include <unistd.h>
 
 /* GIMP includes */
+#include "glib/gstdio.h"
 #include "gtk/gtk.h"
 #include "libgimp/gimp.h"
 
@@ -51,6 +52,12 @@
 
 extern int gap_debug;
 
+/*
+  p_status_to_string() is defined in gap/gap_pdb_calls.c
+ */
+const char * p_status_to_string(int status);
+
+
 /* --------------------------------
  * p_save_as_tmp_png_file
  * --------------------------------
--- a/vid_common/gap_cme_gui.c
+++ b/vid_common/gap_cme_gui.c
@@ -53,6 +53,7 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include <glib/gstdio.h>
 #include <gtk/gtk.h>
 
 #include "gap-intl.h"
--- a/libgapbase/gap_base.c
+++ b/libgapbase/gap_base.c
@@ -50,6 +50,8 @@
 /* GIMP includes */
 #include "gtk/gtk.h"
 #include "libgimp/gimp.h"
+#include "libgimpwidgets/gimpwidgetstypes.h"
+#include "libgimpwidgets/gimphelpui.h"
 
 #ifdef G_OS_WIN32
 #include <io.h>
