Hi

Attaching some patches to let abiword compile on QNX.

/Johan

? qnx_patch
? mepp
? ac-helpers/glib.m4
? src/QNX_6.2.0_x86pc_OBJ
? src/QNX_6.2.0_x86pc_DBG
? src/wp/impexp/qnx
? src/wp/main/qnx/test
Index: src/af/ev/qnx/ev_QNXToolbar.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/ev/qnx/ev_QNXToolbar.cpp,v
retrieving revision 1.21
diff -u -r1.21 ev_QNXToolbar.cpp
--- src/af/ev/qnx/ev_QNXToolbar.cpp     23 Mar 2001 01:36:12 -0000      1.21
+++ src/af/ev/qnx/ev_QNXToolbar.cpp     21 Mar 2002 10:55:50 -0000
@@ -587,7 +587,7 @@
                                        //printf("State [%s] \n", (szState) ? szState 
: "NULL");
                                        if (szState && !(top = 
PtListItemPos(tcb->m_widget, szState))) {
                                                //Assume this is the case of Times New 
Roman not being found
-                                               FontID *id = PfFindFont((const uchar_t 
*)szState, 0, 10);
+                                               FontID *id = PfFindFont((const char 
+*)szState, 0, 10);
                                                if (id) {
                                                        top = 
PtListItemPos(tcb->m_widget, (char *)PfFontDescription(id));
                                                        PfFreeFont(id);
Index: src/af/ev/xp/ev_Keyboard.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/ev/xp/ev_Keyboard.cpp,v
retrieving revision 1.10
diff -u -r1.10 ev_Keyboard.cpp
--- src/af/ev/xp/ev_Keyboard.cpp        6 Feb 2001 22:53:56 -0000       1.10
+++ src/af/ev/xp/ev_Keyboard.cpp        21 Mar 2002 10:55:50 -0000
@@ -70,7 +70,7 @@
                return false;
        }
 
-       EV_EditMethodCallData emcd(pData,dataLength);
+       EV_EditMethodCallData emcd((const unsigned short *)pData,(unsigned 
+int)dataLength);
        (*pEM->getFn())(pView,&emcd);
 
        return true;
Index: src/af/ev/xp/ev_Menu.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/ev/xp/ev_Menu.cpp,v
retrieving revision 1.27
diff -u -r1.27 ev_Menu.cpp
--- src/af/ev/xp/ev_Menu.cpp    6 Dec 2001 07:00:13 -0000       1.27
+++ src/af/ev/xp/ev_Menu.cpp    21 Mar 2002 10:55:50 -0000
@@ -163,7 +163,7 @@
                return false;
        }
 
-       EV_EditMethodCallData emcd(pData,dataLength);
+       EV_EditMethodCallData emcd((const unsigned short*)pData,(unsigned 
+int)dataLength);
        (*pEM->getFn())(pView,&emcd);
 
        return true;
Index: src/af/ev/xp/ev_Toolbar.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/ev/xp/ev_Toolbar.cpp,v
retrieving revision 1.13
diff -u -r1.13 ev_Toolbar.cpp
--- src/af/ev/xp/ev_Toolbar.cpp 9 Nov 2001 02:27:09 -0000       1.13
+++ src/af/ev/xp/ev_Toolbar.cpp 21 Mar 2002 10:55:50 -0000
@@ -85,7 +85,7 @@
                return false;
        }
 
-       EV_EditMethodCallData emcd(pData,dataLength);
+       EV_EditMethodCallData emcd((const unsigned short *)pData,(unsigned 
+int)dataLength);
        (*pEM->getFn())(pView,&emcd);
 
        return true;
Index: src/af/gr/qnx/gr_QNXGraphics.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/gr/qnx/gr_QNXGraphics.cpp,v
retrieving revision 1.40
diff -u -r1.40 gr_QNXGraphics.cpp
--- src/af/gr/qnx/gr_QNXGraphics.cpp    20 Mar 2002 17:44:09 -0000      1.40
+++ src/af/gr/qnx/gr_QNXGraphics.cpp    21 Mar 2002 10:55:51 -0000
@@ -339,8 +339,8 @@
        }
 
 //     printf("Looking for font [%s]@%d w/0x%x\n", pszFontFamily, size, style); 
-       if (PfGenerateFontName((const uchar_t *)pszFontFamily, 
-                                                       style, size, (uchar_t *)fname) 
== NULL) {
+       if (PfGenerateFontName((const char *)pszFontFamily, 
+                                                       style, size, (char *)fname) == 
+NULL) {
                //Punt ... give us another chance with a default font
                sprintf(fname, "%s%d", "helv", size); 
                switch (style & (PF_STYLE_BOLD | PF_STYLE_ITALIC)) {
Index: src/af/util/qnx/ut_path.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/util/qnx/ut_path.cpp,v
retrieving revision 1.3
diff -u -r1.3 ut_path.cpp
--- src/af/util/qnx/ut_path.cpp 17 Dec 2001 16:16:25 -0000      1.3
+++ src/af/util/qnx/ut_path.cpp 21 Mar 2002 10:55:52 -0000
@@ -20,7 +20,7 @@
 
 #include "ut_path.h"
 #include <string.h>
-
+#include <sys/stat.h>
 /*!    This function takes a char* representing a path to a file and returns
        the pointer to the string which represents the base portion of the path.
        
@@ -38,4 +38,26 @@
 
        return str;
 }
+bool UT_directoryExists(const char* dir)
+{ 
+   struct stat buf;
+
+    if (stat(dir, &buf) != -1)
+    {
+    return S_ISDIR (buf.st_mode);
+    }
+
+    return false;
+}
 
+bool UT_isRegularFile(const char* filename)
+{
+    struct stat buf;
+
+    if (stat(filename, &buf) != -1)
+    {
+    return S_ISREG (buf.st_mode);
+    }
+
+    return false;
+}
Index: src/af/util/qnx/ut_qnxString.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/util/qnx/ut_qnxString.cpp,v
retrieving revision 1.4
diff -u -r1.4 ut_qnxString.cpp
--- src/af/util/qnx/ut_qnxString.cpp    20 Mar 2002 17:44:18 -0000      1.4
+++ src/af/util/qnx/ut_qnxString.cpp    21 Mar 2002 10:55:52 -0000
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 #include <math.h>
 #include <ctype.h>
 
@@ -49,3 +50,8 @@
   return tmpnam(base);
 }
 
+void UT_unlink(const char*base)
+{
+
+unlink(base);
+}
Index: src/af/xap/qnx/xap_QNXFrame.h
===================================================================
RCS file: /cvsroot/abi/src/af/xap/qnx/xap_QNXFrame.h,v
retrieving revision 1.16
diff -u -r1.16 xap_QNXFrame.h
--- src/af/xap/qnx/xap_QNXFrame.h       1 Feb 2002 00:17:05 -0000       1.16
+++ src/af/xap/qnx/xap_QNXFrame.h       21 Mar 2002 10:55:54 -0000
@@ -65,7 +65,7 @@
        virtual bool                            updateTitle(void);
        virtual UT_sint32                       setInputMode(const char * szName);
        virtual void                            nullUpdate () const {}
-       virtual void                setCursor(GR_Graphics::Cursor c) {}
+       virtual void                setCursor(GR_Graphics::Cursor c);
 
        PtWidget_t *                            getTopLevelWindow(void) const;  //Get 
the Window widget
        PtWidget_t *                            getVBoxWidget(void) const;             
 //Less than usefull 
Index: src/config/platforms/nto.mk
===================================================================
RCS file: /cvsroot/abi/src/config/platforms/nto.mk,v
retrieving revision 1.8
diff -u -r1.8 nto.mk
--- src/config/platforms/nto.mk 11 Nov 2001 14:59:26 -0000      1.8
+++ src/config/platforms/nto.mk 21 Mar 2002 10:55:57 -0000
@@ -40,7 +40,7 @@
 
 # Define tools (should gcc be cc/qcc ... same for ar?)
 CC             = qcc
-CCC            = qcc
+CCC            = QCC 
 RANLIB         = touch
 
 # Suffixes
Index: src/wp/ap/qnx/ap_QNXDialog_HdrFtr.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/qnx/ap_QNXDialog_HdrFtr.cpp,v
retrieving revision 1.1
diff -u -r1.1 ap_QNXDialog_HdrFtr.cpp
--- src/wp/ap/qnx/ap_QNXDialog_HdrFtr.cpp       16 Oct 2001 05:57:52 -0000      1.1
+++ src/wp/ap/qnx/ap_QNXDialog_HdrFtr.cpp       21 Mar 2002 10:56:17 -0000
@@ -17,8 +17,6 @@
  * 02111-1307, USA.
  */
 
-#include <windows.h>
-
 #include "ut_string.h"
 #include "ut_assert.h"
 #include "ut_debugmsg.h"
Index: src/wp/ap/qnx/ap_QNXDialog_HdrFtr.h
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/qnx/ap_QNXDialog_HdrFtr.h,v
retrieving revision 1.1
diff -u -r1.1 ap_QNXDialog_HdrFtr.h
--- src/wp/ap/qnx/ap_QNXDialog_HdrFtr.h 16 Oct 2001 05:57:52 -0000      1.1
+++ src/wp/ap/qnx/ap_QNXDialog_HdrFtr.h 21 Mar 2002 10:56:17 -0000
@@ -25,7 +25,7 @@
 
 /*****************************************************************/
 
-class AP_QNXDialog_HdrFtr: public AP_Dialog_Stub
+class AP_QNXDialog_HdrFtr: public AP_Dialog_HdrFtr
 {
 public:
        AP_QNXDialog_HdrFtr(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
Index: src/wp/ap/qnx/ap_QNXDialog_New.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/qnx/ap_QNXDialog_New.cpp,v
retrieving revision 1.6
diff -u -r1.6 ap_QNXDialog_New.cpp
--- src/wp/ap/qnx/ap_QNXDialog_New.cpp  20 Mar 2002 17:45:05 -0000      1.6
+++ src/wp/ap/qnx/ap_QNXDialog_New.cpp  21 Mar 2002 10:56:17 -0000
@@ -111,11 +111,13 @@
        }
        else if (PtGetResource(m_radioNew, Pt_ARG_FLAGS, &flags, 0) == 0 && *flags & 
Pt_SET)
        {
-               setOpenType(AP_Dialog_New::open_Template);
                /*Not in unix version */
                PtTreeItem_t *item;
                item = PtTreeGetCurrent(m_tree);
-               setTemplateName(item->string);
+//             setTemplateName(item->string); //XXX: was it right to change this?
+               setFileName(item->string);
+               setOpenType(AP_Dialog_New::open_Template);
+
        }
        else
        {
@@ -134,7 +136,8 @@
 
 void AP_QNXDialog_New::event_ToggleUseTemplate (const char * name)
 {
-       setTemplateName (name);
+       setFileName(name); 
+//     setTemplateName (name); XXX: correct or not? 
 }
 
 void AP_QNXDialog_New::event_ToggleOpenExisting ()
Index: src/wp/ap/qnx/ap_QNXDialog_Options.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/qnx/ap_QNXDialog_Options.cpp,v
retrieving revision 1.17
diff -u -r1.17 ap_QNXDialog_Options.cpp
--- src/wp/ap/qnx/ap_QNXDialog_Options.cpp      8 Jul 2001 20:48:26 -0000       1.17
+++ src/wp/ap/qnx/ap_QNXDialog_Options.cpp      21 Mar 2002 10:56:17 -0000
@@ -158,6 +158,25 @@
        return Pt_CONTINUE;
 }
 
+bool AP_QNXDialog_Options::_gatherAllowCustomToolbars(void)
+{
+       return false;
+}
+
+void AP_QNXDialog_Options::_setAllowCustomToolbars(const bool b)
+{
+}
+
+// TODO:  Add these item to dialog and impliment
+bool AP_QNXDialog_Options::_gatherAutoLoadPlugins(void)
+{
+       return false;
+}
+
+void AP_QNXDialog_Options::_setAutoLoadPlugins(const bool b)
+{
+}
+
 
 /*****************************************************************/
 
Index: src/wp/ap/qnx/ap_QNXDialog_PageSetup.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/qnx/ap_QNXDialog_PageSetup.cpp,v
retrieving revision 1.9
diff -u -r1.9 ap_QNXDialog_PageSetup.cpp
--- src/wp/ap/qnx/ap_QNXDialog_PageSetup.cpp    2 Jan 2002 19:45:03 -0000       1.9
+++ src/wp/ap/qnx/ap_QNXDialog_PageSetup.cpp    21 Mar 2002 10:56:18 -0000
@@ -162,7 +162,7 @@
        double *d;
 
        index = UT_QNXComboGetPos(m_optionPageSize);
-       fp_PageSize::Predefined pd = 
(fp_PageSize::Predefined)((int)m_vecsize.getNthItem(index - 1));
+       fp_PageSize pd = (fp_PageSize::Predefined)((int)m_vecsize.getNthItem(index - 
+1));
        
        if(pd.Width(DIM_IN) < 1.0 || pd.Height(DIM_IN) < 1.0)
        {
@@ -289,14 +289,14 @@
        header = *d;
        PtGetResource(m_spinMarginFooter, Pt_ARG_NUMERIC_VALUE, &d, 0);
        footer = *d;
-
+/* //XXX: FIND OUT WHAT THIS IS..
        CONVERT_DIMENSIONS (top,    last_margin_unit, mu);
        CONVERT_DIMENSIONS (bottom, last_margin_unit, mu);
        CONVERT_DIMENSIONS (left,   last_margin_unit, mu);
        CONVERT_DIMENSIONS (right,  last_margin_unit, mu);
        CONVERT_DIMENSIONS (header, last_margin_unit, mu);
        CONVERT_DIMENSIONS (footer, last_margin_unit, mu);
-
+*/
        PtSetResource(m_spinMarginTop, Pt_ARG_NUMERIC_VALUE, &top, 0);
        PtSetResource(m_spinMarginBottom, Pt_ARG_NUMERIC_VALUE, &bottom, 0);
        PtSetResource(m_spinMarginLeft, Pt_ARG_NUMERIC_VALUE, &left, 0);
Index: src/wp/ap/qnx/ap_QNXFrame.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/qnx/ap_QNXFrame.cpp,v
retrieving revision 1.33
diff -u -r1.33 ap_QNXFrame.cpp
--- src/wp/ap/qnx/ap_QNXFrame.cpp       1 Feb 2002 00:17:12 -0000       1.33
+++ src/wp/ap/qnx/ap_QNXFrame.cpp       21 Mar 2002 10:56:19 -0000
@@ -588,6 +588,7 @@
 
 XAP_Frame * AP_QNXFrame::buildFrame(XAP_Frame * pF)
 {
+       UT_Error error = UT_OK;
        AP_QNXFrame * pClone = static_cast<     AP_QNXFrame *>(pF);
        ENSUREP(pClone);
        if (!pClone->initialize())
@@ -981,6 +982,12 @@
 void AP_QNXFrame::setDocumentFocus() {
        PtContainerGiveFocus(m_dArea, NULL);
 }
+void XAP_QNXFrame::setCursor(GR_Graphics::Cursor c)
+{
+//XXX: gotta add content.
+}
+
+
 
 /*** THIS CODE WILL GO AWAY WITH AN INTELLIGENT LAYOUT THINGY ***/
 void AP_QNXFrame::_reflowLayout(int loweradj, int upperadj, int topruleradj, int 
leftruleradj) {
Index: src/wp/impexp/xp/ie_imp_WordPerfect.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/impexp/xp/ie_imp_WordPerfect.cpp,v
retrieving revision 1.25
diff -u -r1.25 ie_imp_WordPerfect.cpp
--- src/wp/impexp/xp/ie_imp_WordPerfect.cpp     19 Mar 2002 17:31:28 -0000      1.25
+++ src/wp/impexp/xp/ie_imp_WordPerfect.cpp     21 Mar 2002 10:56:20 -0000
@@ -1336,7 +1336,7 @@
    UT_DEBUGMSG(("WordPerfect: Got this font face change info: (num PIDS: %i, font 
descriptor PID: %i, old matched point size: %i, hash: %i, matched font index: %i, 
matched font point size: %i)\n",
                (int) numPIDs, (int) fontDescriptorPID, (int) oldMatchedPointSize, 
(int) hash, (int) matchedFontIndex, (int) matchedFontPointSize));
 
-   m_textAttributes.m_fontSize = (UT_uint16) 
rint((double)((((float)matchedFontPointSize)/100.0f)*2.0f)); // fixme: ghastly magic 
numbers;
+   m_textAttributes.m_fontSize = (UT_uint16) 
+std::rint((double)((((float)matchedFontPointSize)/100.0f)*2.0f)); // fixme: ghastly 
+magic numbers;
    X_CheckWordPerfectError(_flushText());
    X_CheckWordPerfectError(_appendCurrentTextProperties());
 
@@ -1366,7 +1366,7 @@
    UT_DEBUGMSG(("WordPerfect: Got this font size change info: (num PIDS: %i, old 
typeface PID: %i, desired point size: %i, hash: %i, matched font index: %i, matched 
font point size: %i)\n",
                (int) numPIDs, (int) oldDesiredDescriptorPID, (int) desiredPointSize, 
(int) hash, (int) matchedFontIndex, (int) matchedFontPointSize));
    
-   m_textAttributes.m_fontSize = (UT_uint16) 
rint((double)((((float)desiredPointSize)/100.0f)*2.0f)); // fixme: ghastly magic 
numbers;
+   m_textAttributes.m_fontSize = (UT_uint16) 
+std::rint((double)((((float)desiredPointSize)/100.0f)*2.0f)); // fixme: ghastly magic 
+numbers;
    X_CheckWordPerfectError(_flushText());
    X_CheckWordPerfectError(_appendCurrentTextProperties());
    
Index: src/wp/impexp/xp/ie_impexp_MSWrite.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/impexp/xp/ie_impexp_MSWrite.cpp,v
retrieving revision 1.2
diff -u -r1.2 ie_impexp_MSWrite.cpp
--- src/wp/impexp/xp/ie_impexp_MSWrite.cpp      24 Oct 2001 23:20:16 -0000      1.2
+++ src/wp/impexp/xp/ie_impexp_MSWrite.cpp      21 Mar 2002 10:56:21 -0000
@@ -22,6 +22,7 @@
 
 #include <stdlib.h>
 #include <png.h>
+#include <string.h>
 #include "ie_impexp_MSWrite.h"
 
 #include "ut_debugmsg.h"

Reply via email to