Re: Gimp 1.3 compile and link dependencies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 01:31 05.02.01 +0100, Sven Neumann wrote:
>Hans Breuer <hans@xxxxxxxxxx> writes:
>> ...
>> all the above resolves fine except libgimwidgets dependcies,
>> because there are the functions listed below, which need
>> (and have) different implementations in Gimps and Plug-Ins
>> context. Currently I'm linking gimpwidgets.dll against
>> the functions exported by Gimp, but this probably is the
>> reason why most plug-ins aren't running ...
>>
>> I could hack up a windoze specific version for those functions, 
>> to dynamically detect, if they are running in Gimp's or Plug-In's 
>> context, but does anyone now of a proper cross platform sollution ?
>> 
>> critical functions:
>>  gimp_palette_get_background
>>  gimp_palette_get_foreground
>>  gimp_standard_help_func
>>  gimp_unit_get_abbreviation
>>  gimp_unit_get_digits
>>  gimp_unit_get_factor
>>  gimp_unit_get_number_of_built_in_units
>>  gimp_unit_get_number_of_units
>>  gimp_unit_get_plural
>>  gimp_unit_get_singular
>>  gimp_unit_get_symbol
>
>We probably need to export the symbols you listed so you can link
>gimp against libgimpwidgets. libgimp exports the same symbols but
>has an implementation that works through the PDB.
>
What kind of export do you suggest ? The win32 specific one is already
done by me, but AFAIK the problems is somewhere else. 
The windoze version of gimpwidgefts can't include two symbols for 
different implementation of the same function. There is only one
version of the dll in memory, even if loaded by another process.
The code is shared across process boundaries while the data is
not.
It might be possible to build a sollution which detects at runtime, 
if the dll is loaded by gimp.exe and than dynamically resolve to symbols
exported by gimp.exe. Otherwise the implementation querying the PDB 
would be used (this is what I tried to explain above). Obviously the
PDB version does *not* work in the Gim process ...

>> Second question:
>> - to make Gimp compile again I needed to include some headers 
>> in other headers again (see attached patch). Yes, I've read the 
>> docs, which say not to do so, but is it really wanted to get 
>> a header order dependency ?
>
>Please send the patch included in your email, not as zip archive.
>Makes it easier to read and allows me to comment on the diff in
>a reply. I have looked into it and parts of it look good, others
>need a different solution imho.
>
Here it comes. Missing a ChangeLog entry, which I I would write before 
really commiting. Something like:

	* app/app_procs.c : to get the definiton of G_OS_WIN32 make sure
	<glib.h> get's included first (there must be a better sollution 
	to do this ...)

	* ...

diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/app/app_procs.c my-gtk/gimp/app/app_procs.c
---
from-cvs/gimp/app/app_procs.c	Sun Feb 04 14:25:58 2001
+++
my-gtk/gimp/app/app_procs.c	Sun Feb 04 19:05:38 2001
@@ -33,12 +33,12 @@

#include <unistd.h>
 #endif
 
+#include <gtk/gtk.h>
+
 #ifdef G_OS_WIN32

#include <process.h>		/* For _getpid() */
 #endif
  
-#include
<gtk/gtk.h>
-
 #include "libgimpwidgets/gimpwidgets.h"
 
 #include
"apptypes.h"
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/app/appenv.h my-gtk/gimp/app/appenv.h
---
from-cvs/gimp/app/appenv.h	Sun Feb 04 14:26:00 2001
+++
my-gtk/gimp/app/appenv.h	Sun Feb 04 17:51:08 2001
@@ -19,6 +19,7 @@

#ifndef __APPENV_H__
 #define __APPENV_H__
 
+#include <glib.h> /* gboolean
*/
 
 typedef enum
 {
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/app/cursorutil.h my-gtk/gimp/app/cursorutil.h
---
from-cvs/gimp/app/cursorutil.h	Thu Jan 11 23:33:48 2001
+++
my-gtk/gimp/app/cursorutil.h	Sun Feb 04 17:32:38 2001
@@ -19,6 +19,9 @@

#ifndef __CURSORUTIL_H__
 #define __CURSORUTIL_H__
 
+#include
<gdk/gdktypes.h>
+#include <gdk/gdkcursor.h>
+#include <gtk/gtkwidget.h>
 

typedef struct
 {
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/app/datafiles.h my-gtk/gimp/app/datafiles.h
---
from-cvs/gimp/app/datafiles.h	Sun Feb 04 14:26:40 2001
+++
my-gtk/gimp/app/datafiles.h	Sun Feb 04 18:42:08 2001
@@ -22,6 +22,7 @@

#ifndef __DATAFILES_H__
 #define __DATAFILES_H__
 
+#include <time.h>
 

typedef enum
 {
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/app/dialog_handler.h my-gtk/gimp/app/dialog_handler.h
---
from-cvs/gimp/app/dialog_handler.h	Sun Feb 04 18:50:02 2001
+++
my-gtk/gimp/app/dialog_handler.h	Sun Feb 04 19:16:42 2001
@@ -20,8 +20,10
@@
 #ifndef __DIALOG_HANDLER_H__
 #define __DIALOG_HANDLER_H__


-
+#include <gmodule.h>
+G_MODULE_EXPORT
 void   dialog_register
(GtkWidget *dialog);
+G_MODULE_EXPORT
 void   dialog_unregister
(GtkWidget *dialog);
 
 void   dialog_register_toolbox  (GtkWidget
*dialog);
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/app/draw_core.h my-gtk/gimp/app/draw_core.h
---
from-cvs/gimp/app/draw_core.h	Thu Jan 11 23:34:00 2001
+++
my-gtk/gimp/app/draw_core.h	Sun Feb 04 17:30:02 2001
@@ -19,6 +19,8 @@

#ifndef __DRAW_CORE_H__
 #define __DRAW_CORE_H__
 
+#include
<gdk/gdktypes.h>
+#include "apptypes.h"
 
 /*  drawing states  */
 #define
INVISIBLE   0
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/app/gdisplay.h my-gtk/gimp/app/gdisplay.h
---
from-cvs/gimp/app/gdisplay.h	Sun Feb 04 14:26:48 2001
+++
my-gtk/gimp/app/gdisplay.h	Sun Feb 04 18:05:36 2001
@@ -19,6 +19,8 @@

#ifndef __GDISPLAY_H__
 #define __GDISPLAY_H__
 
+#include
<gtk/gtkwidget.h>
+
 typedef enum
 {
   SelectionOff,
diff
--exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp/app/gimpbrush.c
my-gtk/gimp/app/gimpbrush.c
--- from-cvs/gimp/app/gimpbrush.c	Sun Feb 04
14:26:48 2001
+++ my-gtk/gimp/app/gimpbrush.c	Sun Feb 04 19:00:52 2001
@@
-29,18 +29,15 @@
 #endif
 #include <fcntl.h>
 
-#ifdef G_OS_WIN32
-#include
<io.h>
-#endif
-
 #ifndef _O_BINARY
 #define _O_BINARY 0
 #endif
 

#include <gtk/gtk.h>
 
-
-#include <stdio.h>
+#ifdef G_OS_WIN32
+#include
<io.h>
+#endif
 
 #include "apptypes.h"
 
diff
--exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/app/gimpbrushpipe.c my-gtk/gimp/app/gimpbrushpipe.c
---
from-cvs/gimp/app/gimpbrushpipe.c	Sun Feb 04 14:26:50 2001
+++
my-gtk/gimp/app/gimpbrushpipe.c	Sun Feb 04 19:01:48 2001
@@ -31,15 +31,15
@@
 #endif
 #include <fcntl.h>
 
-#ifdef G_OS_WIN32
-#include
<io.h>
-#endif
-
 #ifndef _O_BINARY
 #define _O_BINARY 0
 #endif
 

#include <gtk/gtk.h>
+
+#ifdef G_OS_WIN32
+#include <io.h>
+#endif
 

#include "libgimpmath/gimpmath.h"
 
diff
--exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp/app/gimpdrawable.h
my-gtk/gimp/app/gimpdrawable.h
--- from-cvs/gimp/app/gimpdrawable.h	Sun Feb
04 14:27:10 2001
+++ my-gtk/gimp/app/gimpdrawable.h	Sun Feb 04 18:04:02
2001
@@ -21,7 +21,7 @@
 
 
 #include "gimpobject.h"
-
+#include
"apptypes.h"
 
 #define GIMP_TYPE_DRAWABLE
(gimp_drawable_get_type ())
 #define GIMP_DRAWABLE(obj)
(GTK_CHECK_CAST ((obj), GIMP_TYPE_DRAWABLE, GimpDrawable))
diff
--exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp/app/gimpobject.h
my-gtk/gimp/app/gimpobject.h
--- from-cvs/gimp/app/gimpobject.h	Sun Feb 04
14:27:28 2001
+++ my-gtk/gimp/app/gimpobject.h	Sun Feb 04 17:49:34 2001
@@
-29,7 +29,7 @@
 #define GIMP_IS_OBJECT(obj)         (GTK_CHECK_TYPE ((obj),
GIMP_TYPE_OBJECT))
 #define GIMP_IS_OBJECT_CLASS(klass)
(GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OBJECT))
 
-
+typedef struct
_GimpObject GimpObject;
 typedef struct _GimpObjectClass GimpObjectClass;


 struct _GimpObject
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/app/patterns.c my-gtk/gimp/app/patterns.c
---
from-cvs/gimp/app/patterns.c	Sun Feb 04 14:28:14 2001
+++
my-gtk/gimp/app/patterns.c	Sun Feb 04 19:02:32 2001
@@ -29,10 +29,6 @@

#endif
 #include <fcntl.h>
 
-#ifdef G_OS_WIN32
-#include <io.h>
-#endif
-

#ifndef _O_BINARY
 #define _O_BINARY 0
 #endif
@@ -42,6 +38,10 @@
 #endif


 #include <gtk/gtk.h>
+
+#ifdef G_OS_WIN32
+#include <io.h>
+#endif
 

#include "apptypes.h"
 
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/app/pdb/fileops_cmds.c my-gtk/gimp/app/pdb/fileops_cmds.c
---
from-cvs/gimp/app/pdb/fileops_cmds.c	Sun Jan 21 22:58:16 2001
+++
my-gtk/gimp/app/pdb/fileops_cmds.c	Sun Feb 04 19:04:24 2001
@@ -27,8 +27,11
@@
 #include <unistd.h>
 #endif
 
-
 #include <gtk/gtk.h>
+
+#ifdef
G_OS_WIN32
+#include <process.h>		/* For _getpid() */
+#endif
 
 #include
"apptypes.h"
 #include "procedural_db.h"
diff
--exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/app/pdb/procedural_db.c
my-gtk/gimp/app/pdb/procedural_db.c
---
from-cvs/gimp/app/pdb/procedural_db.c	Sat Feb 03 23:05:34 2001
+++
my-gtk/gimp/app/pdb/procedural_db.c	Sun Feb 04 17:02:48 2001
@@ -276,7
+276,7 @@
           params[i].value.pdb_pointer = va_arg (args,
gpointer);
           break;
         case PDB_COLOR:
-
params[i].value.pdb_color = (GimpRGB) va_arg (args, GimpRGB);
+
params[i].value.pdb_color = va_arg (args, GimpRGB);
           break;

   case PDB_REGION:
           break;
diff
--exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp/app/plug_in.h
my-gtk/gimp/app/plug_in.h
--- from-cvs/gimp/app/plug_in.h	Sun Feb 04
14:28:38 2001
+++ my-gtk/gimp/app/plug_in.h	Sun Feb 04 17:00:58 2001
@@
-21,7 +21,7 @@
 
 
 #include "pdb/procedural_db.h"
-
+#include <time.h> /*
time_t */
 
 #define WRITE_BUFFER_SIZE  512
 
diff
--exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gimp/app/tile_swap.c
my-gtk/gimp/app/tile_swap.c
--- from-cvs/gimp/app/tile_swap.c	Sun Feb 04
14:28:44 2001
+++ my-gtk/gimp/app/tile_swap.c	Sun Feb 04 18:59:22 2001
@@
-20,6 +20,7 @@
 
 #include <glib.h>
 
+#include <stdio.h> /* SEEK_SET */

#include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff
--exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/app/tools/path_toolP.h my-gtk/gimp/app/tools/path_toolP.h
---
from-cvs/gimp/app/tools/path_toolP.h	Fri Oct 08 12:22:38 1999
+++
my-gtk/gimp/app/tools/path_toolP.h	Sun Feb 04 17:42:42 2001
@@ -46,7 +46,9
@@
 
 typedef struct _path_segment PathSegment;
 typedef struct _path_curve
  PathCurve;
-typedef struct _path         Path;
+typedef struct _path
   Path2;
+/* resolve namespace conflicts with apptypes.h */
+#define Path
Path2
 
 typedef struct _path_tool    PathTool;
 
diff
--exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/libgimp/gimpcolorselector.h
my-gtk/gimp/libgimp/gimpcolorselector.h
---
from-cvs/gimp/libgimp/gimpcolorselector.h	Sun Feb 04 14:29:08 2001
+++
my-gtk/gimp/libgimp/gimpcolorselector.h	Sun Feb 04 19:14:46 2001
@@ -79,14
+79,17 @@
 
 
 #ifndef __COLOR_NOTEBOOK_C__
-
 /*  Bypass when compiling
the source for these functions.
  */
+#include
<gmodule.h>
+
+G_MODULE_EXPORT
 GimpColorSelectorID

gimp_color_selector_register   (const gchar                 *name,

const gchar                 *help_page,
 				GimpColorSelectorMethods
*methods);
 
+G_MODULE_EXPORT
 gboolean
 gimp_color_selector_unregister
(GimpColorSelectorID          id,
 				GimpColorSelectorFinishedCB
finished_cb,
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gimp/plug-ins/common/gqbist.c
my-gtk/gimp/plug-ins/common/gqbist.c
---
from-cvs/gimp/plug-ins/common/gqbist.c	Sun Feb 04 14:29:36 2001
+++
my-gtk/gimp/plug-ins/common/gqbist.c	Sun Feb 04 23:17:42 2001
@@ -62,6
+62,10 @@
 
 #include "libgimp/stdplugins-intl.h"
 
+#ifndef
PATH_MAX
+#define PATH_MAX 256
+#endif
+
 /** qbist renderer
***********************************************************/
 
 #define
MAX_TRANSFORMS	36
-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux