View Issue Details

IDProjectCategoryView StatusLast Update
0002799ScribusOS-Win32public2005-11-10 15:30
Reporterjghali Assigned Tosubik  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindowsOS Version2000 SP4
Product Version1.3.2cvs 
Fixed in Version1.3.2cvs 
Summary0002799: Scripter : msvc compatibility patch
DescriptionHere is a patch which provide msvc compatiliby for scripter :
- add required SCRIBUS_API declaration (needed for linking)
- remove some wrong PyAPI_DATA declarations (symbols not imported from python)
- include some moc file (for convenience)
- minor tweaks
TagsNo tags attached.
Patch

Relationships

child of 0002398 closedjghali Get plugins to compile on Windows (win32) 
child of 0003813 acknowledged Metabug: Scripter 

Activities

2005-11-06 21:34

 

scripter_msvc_compat.diff (6,016 bytes)   
Index: objimageexport.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/objimageexport.h,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 objimageexport.h
--- objimageexport.h	3 Feb 2005 18:48:39 -0000	1.1.2.1
+++ objimageexport.h	6 Nov 2005 14:51:24 -0000
@@ -4,7 +4,7 @@
 // Pulls in <Python.h> first
 #include "cmdvar.h"
 
-PyAPI_DATA(PyTypeObject) ImageExport_Type;
+extern PyTypeObject ImageExport_Type;
 
 // docstrings
 PyDoc_STRVAR(imgexp__doc__,"Image export\n\
Index: objpdffile.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp,v
retrieving revision 1.3.2.18
diff -u -r1.3.2.18 objpdffile.cpp
--- objpdffile.cpp	7 Oct 2005 10:38:14 -0000	1.3.2.18
+++ objpdffile.cpp	6 Nov 2005 14:21:59 -0000
@@ -9,12 +9,12 @@
 #include <vector>
 
 // these functions are located at utils.cpp
-void ReOrderText(ScribusDoc *doc, ScribusView *view);
+void SCRIBUS_API ReOrderText(ScribusDoc *doc, ScribusView *view);
 // end of utils.cpp
 //this is in file scribus.cpp
 
 #ifdef HAVE_CMS
-extern bool CMSuse;
+extern bool SCRIBUS_API CMSuse;
 #endif
 //
 
@@ -238,6 +238,7 @@
 
 static int PDFfile_init(PDFfile *self, PyObject */*args*/, PyObject */*kwds*/)
 {
+	int i;
 	if (!ScApp->HaveDoc) {
 		PyErr_SetString(PyExc_SystemError, "Must open doc first");
 		return -1;
@@ -303,7 +304,7 @@
 		PyErr_SetString(PyExc_SystemError, "Can not initialize 'pages' attribute");
 		return -1;
 	}
-	for (int i = 0; i<num; ++i) {
+	for (i = 0; i<num; ++i) {
 		PyObject *tmp;
 		tmp = PyInt_FromLong((long)i+1L);
 		if (tmp)
@@ -361,7 +362,6 @@
 		return -1;
 	}
 	int num2 = ScApp->doc->PDF_Options.PresentVals.count();
-	int i;
 	for (i = 0; i<num2; ++i) {
 		PyObject *tmp;
 		PDFPresentationData t = ScApp->doc->PDF_Options.PresentVals[i];
Index: objpdffile.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/objpdffile.h,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 objpdffile.h
--- objpdffile.h	20 Mar 2005 16:17:16 -0000	1.1.2.2
+++ objpdffile.h	6 Nov 2005 14:51:23 -0000
@@ -4,7 +4,7 @@
 // Pulls in <Python.h> first
 #include "cmdvar.h"
 
-PyAPI_DATA(PyTypeObject) PDFfile_Type;
+extern PyTypeObject PDFfile_Type;
 
 // Nest items are not needed but are here for me to exercise
 // writing complete python objects
Index: objprinter.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/objprinter.cpp,v
retrieving revision 1.4.2.18
diff -u -r1.4.2.18 objprinter.cpp
--- objprinter.cpp	7 Oct 2005 10:38:14 -0000	1.4.2.18
+++ objprinter.cpp	2 Nov 2005 22:44:39 -0000
@@ -12,11 +12,11 @@
 #include <cups/cups.h>
 #endif
 #ifdef HAVE_CMS
-extern bool CMSuse;
+extern bool SCRIBUS_API CMSuse;
 #endif
 // these functions are located at utils.cpp
-bool loadText(QString nam, QString *Buffer);
-void ReOrderText(ScribusDoc *doc, ScribusView *view);
+bool SCRIBUS_API loadText(QString nam, QString *Buffer);
+void SCRIBUS_API ReOrderText(ScribusDoc *doc, ScribusView *view);
 // end of utils.cpp
 
 
Index: objprinter.h
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/objprinter.h,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 objprinter.h
--- objprinter.h	20 Mar 2005 16:17:16 -0000	1.1.2.2
+++ objprinter.h	6 Nov 2005 14:51:24 -0000
@@ -4,7 +4,7 @@
 // Pulls in <Python.h> first
 #include "cmdvar.h"
 
-PyAPI_DATA(PyTypeObject) Printer_Type;
+extern PyTypeObject Printer_Type;
 
 // Nest items are not needed but are here for me to exercise
 // writing complete python objects
Index: pconsole.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/pconsole.cpp,v
retrieving revision 1.3.2.12
diff -u -r1.3.2.12 pconsole.cpp
--- pconsole.cpp	30 Oct 2005 21:19:44 -0000	1.3.2.12
+++ pconsole.cpp	6 Nov 2005 14:11:18 -0000
@@ -25,7 +25,7 @@
 #include "prefsfile.h"
 #include "prefscontext.h"
 
-extern QPixmap loadIcon(QString nam);
+extern QPixmap SCRIBUS_API loadIcon(QString nam);
 
 
 PythonConsole::PythonConsole( QWidget* parent)
@@ -248,7 +248,7 @@
 int SyntaxHighlighter::highlightParagraph(const QString &text, int endStateOfLastPara)
 {
 	// position in the text
-	unsigned long i = 0;
+	unsigned int i = 0;
 
 	/* ! ! signals error message, which we want in red */
 	if (text.length() >= 3 && text[0] == '!' && text[1] == ' ' && text[2] == '!')
Index: runscriptdialog.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/Attic/runscriptdialog.cpp,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 runscriptdialog.cpp
--- runscriptdialog.cpp	25 Jul 2005 22:28:45 -0000	1.1.2.3
+++ runscriptdialog.cpp	1 Nov 2005 01:36:26 -0000
@@ -1,4 +1,5 @@
 #include "runscriptdialog.h"
+#include "runscriptdialog.moc"
 #include "qdir.h"
 #include "prefsmanager.h"
 
Index: scriptplugin.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp,v
retrieving revision 1.33.2.78
diff -u -r1.33.2.78 scriptplugin.cpp
--- scriptplugin.cpp	16 Oct 2005 18:19:39 -0000	1.33.2.78
+++ scriptplugin.cpp	1 Nov 2005 01:38:18 -0000
@@ -30,6 +30,7 @@
 #include "cmdmisc.h"
 #include "cmdgetsetprop.h"
 #include "scriptplugin.h"
+#include "scriptplugin.moc"
 #include "cmdutil.h"
 #include "objprinter.h"
 #include "objpdffile.h"
@@ -63,7 +64,7 @@
 #include <cstdlib>
 #include <iostream>
 
-extern QPixmap loadIcon(QString nam);
+extern QPixmap SCRIBUS_API loadIcon(QString nam);
 
 // Exceptions; visible from cmdvar.h, set up in initscribus()
 PyObject* ScribusException;
scripter_msvc_compat.diff (6,016 bytes)   

subik

2005-11-06 21:53

manager   ~0007361

patch applied. There are 2 issues with non existing moc files. I've commented out moc in runscriptdialog.cpp and scriptplugin.cpp. I'll look at it later.

Issue History

Date Modified Username Field Change
2005-11-06 21:34 jghali New Issue
2005-11-06 21:34 jghali File Added: scripter_msvc_compat.diff
2005-11-06 21:35 jghali Relationship added child of 0002398
2005-11-06 21:53 subik Note Added: 0007361
2005-11-09 20:09 subik Status assigned => resolved
2005-11-09 20:09 subik Fixed in Version => 1.3.2cvs
2005-11-09 20:09 subik Resolution open => fixed
2005-11-10 15:30 cbradney Status resolved => closed
2006-05-13 21:23 christoph_s Relationship added child of 0003813
2014-10-08 18:38 Kunda Category Win32 => OS-Win32