Changes to access XP-COM interface.

This commit is contained in:
rhp%netscape.com 1999-02-02 01:09:05 +00:00
Родитель 6cc17f7e9b
Коммит ae73ba46b3
2 изменённых файлов: 26 добавлений и 21 удалений

Просмотреть файл

@ -51,11 +51,12 @@ DEFINES= -DEBUG_rhp -D_IMPL_NS_HTML
#// #//
#//------------------------------------------------------------------------ #//------------------------------------------------------------------------
OBJS= \ OBJS= \
.\$(OBJDIR)\mimevcrd.obj \ .\$(OBJDIR)\mimevcrd.obj \
.\$(OBJDIR)\mimexpcom.obj \
.\$(OBJDIR)\oldvcc.obj \ .\$(OBJDIR)\oldvcc.obj \
.\$(OBJDIR)\oldvobj.obj \ .\$(OBJDIR)\oldvobj.obj \
.\$(OBJDIR)\oldxp.obj \ .\$(OBJDIR)\oldxp.obj \
.\$(OBJDIR)\oldi18n.obj \ .\$(OBJDIR)\oldi18n.obj \
.\$(OBJDIR)\comi18n.obj \ .\$(OBJDIR)\comi18n.obj \
.\$(OBJDIR)\oldnet.obj \ .\$(OBJDIR)\oldnet.obj \
@ -104,17 +105,17 @@ LLIBS= \
$(DIST)\lib\xplib.lib \ $(DIST)\lib\xplib.lib \
$(DIST)\lib\raptorbase.lib \ $(DIST)\lib\raptorbase.lib \
$(DIST)\lib\xpcom32.lib \ $(DIST)\lib\xpcom32.lib \
$(DIST)\lib\mime.lib \
$(NULL) $(NULL)
LINCS=$(LINCS) -I. \ LINCS=$(LINCS) -I. \
-I$(PUBLIC)\pref \ -I$(PUBLIC)\pref \
-I$(PUBLIC)\js \ -I$(PUBLIC)\js \
-I$(PUBLIC)\security \ -I$(PUBLIC)\security \
-I$(PUBLIC)\netlib \ -I$(PUBLIC)\netlib \
-I$(PUBLIC)\xpcom \ -I$(PUBLIC)\xpcom \
-I$(PUBLIC)\raptor \ -I$(PUBLIC)\raptor \
-I..\..\src \ -I$(PUBLIC)\mime \
-I..\..\src \
$(NULL) $(NULL)
#//------------------------------------------------------------------------ #//------------------------------------------------------------------------

Просмотреть файл

@ -23,6 +23,7 @@
#include "vobject.h" #include "vobject.h"
#include "libi18n.h" #include "libi18n.h"
#include "mimecth.h" #include "mimecth.h"
#include "mimexpcom.h"
#include "prmem.h" #include "prmem.h"
#include "plstr.h" #include "plstr.h"
@ -162,7 +163,10 @@ MIME_CreateContentTypeHandlerClass(const char *content_type,
/* /*
* Must set the superclass by hand. * Must set the superclass by hand.
*/ */
class->superclass = (MimeObjectClass *)MIME_GetmimeInlineTextClass(); if (!COM_GetmimeInlineTextClass())
return NULL;
class->superclass = (MimeObjectClass *)COM_GetmimeInlineTextClass();
initStruct->force_inline_display = PR_TRUE; initStruct->force_inline_display = PR_TRUE;
return class; return class;
} }
@ -186,7 +190,7 @@ static int
MimeInlineTextVCard_parse_begin (MimeObject *obj) MimeInlineTextVCard_parse_begin (MimeObject *obj)
{ {
// int status = ((MimeObjectClass*)&mimeLeafClass)->parse_begin(obj); // int status = ((MimeObjectClass*)&mimeLeafClass)->parse_begin(obj);
int status = ((MimeObjectClass*)MIME_GetmimeLeafClass())->parse_begin(obj); int status = ((MimeObjectClass*)COM_GetmimeLeafClass())->parse_begin(obj);
MimeInlineTextVCardClass *class; MimeInlineTextVCardClass *class;
if (status < 0) return status; if (status < 0) return status;
@ -217,7 +221,7 @@ MimeInlineTextVCard_parse_line (char *line, PRInt32 length, MimeObject *obj)
if (!obj->output_p) return 0; if (!obj->output_p) return 0;
if (!obj->options || !obj->options->output_fn) return 0; if (!obj->options || !obj->options->output_fn) return 0;
if (!obj->options->write_html_p) { if (!obj->options->write_html_p) {
return MIME_MimeObject_write(obj, line, length, PR_TRUE); return COM_MimeObject_write(obj, line, length, PR_TRUE);
} }
linestring = (char *) PR_MALLOC (length + 1); linestring = (char *) PR_MALLOC (length + 1);
@ -243,7 +247,7 @@ MimeInlineTextVCard_parse_eof (MimeObject *obj, PRBool abort_p)
/* Run parent method first, to flush out any buffered data. */ /* Run parent method first, to flush out any buffered data. */
// status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_eof(obj, abort_p); // status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_eof(obj, abort_p);
status = ((MimeObjectClass*)MIME_GetmimeInlineTextClass())->parse_eof(obj, abort_p); status = ((MimeObjectClass*)COM_GetmimeInlineTextClass())->parse_eof(obj, abort_p);
if (status < 0) return status; if (status < 0) return status;
if (!class->vCardString) return 0; if (!class->vCardString) return 0;
@ -287,7 +291,7 @@ static int WriteEachLineToStream (MimeObject *obj, const char *line)
{ {
htmlLine[0] = '\0'; htmlLine[0] = '\0';
PL_strcat (htmlLine, line); PL_strcat (htmlLine, line);
status = MIME_MimeObject_write(obj, htmlLine, PL_strlen(htmlLine), PR_TRUE); status = COM_MimeObject_write(obj, htmlLine, PL_strlen(htmlLine), PR_TRUE);
PR_Free ((void*) htmlLine); PR_Free ((void*) htmlLine);
} }
else else
@ -347,7 +351,7 @@ static int OutputTable (MimeObject *obj, PRBool endTable, PRBool border, char *c
PL_strcat (htmlLine, ">"); PL_strcat (htmlLine, ">");
status = MIME_MimeObject_write(obj, htmlLine, PL_strlen(htmlLine), PR_TRUE); status = COM_MimeObject_write(obj, htmlLine, PL_strlen(htmlLine), PR_TRUE);
PR_Free ((void*) htmlLine); PR_Free ((void*) htmlLine);
} }
else else
@ -416,7 +420,7 @@ static int OutputTableRowOrData(MimeObject *obj, PRBool outputRow,
PL_strcat (htmlLine, ">"); PL_strcat (htmlLine, ">");
status = MIME_MimeObject_write(obj, htmlLine, PL_strlen(htmlLine), PR_TRUE); status = COM_MimeObject_write(obj, htmlLine, PL_strlen(htmlLine), PR_TRUE);
PR_Free ((void*) htmlLine); PR_Free ((void*) htmlLine);
} }
else else
@ -464,7 +468,7 @@ static int OutputFont(MimeObject *obj, PRBool endFont, char * size, char* color)
PL_strcat (htmlLine, ">"); PL_strcat (htmlLine, ">");
status = MIME_MimeObject_write(obj, htmlLine, PL_strlen(htmlLine), PR_TRUE); status = COM_MimeObject_write(obj, htmlLine, PL_strlen(htmlLine), PR_TRUE);
PR_Free ((void*) htmlLine); PR_Free ((void*) htmlLine);
} }
else else
@ -1205,7 +1209,7 @@ static int EndVCard (MimeObject *obj)
/* Scribble HTML-ending stuff into the stream */ /* Scribble HTML-ending stuff into the stream */
char htmlFooters[32]; char htmlFooters[32];
PR_snprintf (htmlFooters, sizeof(htmlFooters), "</BODY>%s</HTML>%s", LINEBREAK, LINEBREAK); PR_snprintf (htmlFooters, sizeof(htmlFooters), "</BODY>%s</HTML>%s", LINEBREAK, LINEBREAK);
status = MIME_MimeObject_write(obj, htmlFooters, PL_strlen(htmlFooters), PR_FALSE); status = COM_MimeObject_write(obj, htmlFooters, PL_strlen(htmlFooters), PR_FALSE);
if (status < 0) return status; if (status < 0) return status;
@ -1237,7 +1241,7 @@ static int BeginVCard (MimeObject *obj)
unique++; unique++;
PR_snprintf (htmlHeaders, sizeof(htmlHeaders), "<HTML>%s<BODY>%s", LINEBREAK, LINEBREAK); PR_snprintf (htmlHeaders, sizeof(htmlHeaders), "<HTML>%s<BODY>%s", LINEBREAK, LINEBREAK);
status = MIME_MimeObject_write(obj, htmlHeaders, PL_strlen(htmlHeaders), PR_TRUE); status = COM_MimeObject_write(obj, htmlHeaders, PL_strlen(htmlHeaders), PR_TRUE);
if (status < 0) return status; if (status < 0) return status;
@ -1738,7 +1742,7 @@ static int WriteLineToStream (MimeObject *obj, const char *line)
PL_strcat (htmlLine, "<DT>"); PL_strcat (htmlLine, "<DT>");
PL_strcat (htmlLine, line); PL_strcat (htmlLine, line);
PL_strcat (htmlLine, "</DT>"); PL_strcat (htmlLine, "</DT>");
status = MIME_MimeObject_write(obj, htmlLine, PL_strlen(htmlLine), PR_TRUE); status = COM_MimeObject_write(obj, htmlLine, PL_strlen(htmlLine), PR_TRUE);
PR_Free ((void*) htmlLine); PR_Free ((void*) htmlLine);
} }
else else