patch from Owen Taylor <otaylor@redhat.com> that allows you to draw on the
drawing area. git-svn-id: svn://10.0.0.236/trunk@14277 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -24,76 +24,108 @@ include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
TOOLKIT_GFX_LIB = -lgfx$(MOZ_TOOLKIT)
|
||||
TOOLKIT_WIDGET_LIB = -lwidget$(MOZ_TOOLKIT)
|
||||
TOOLKIT_BASE_LIB = -lgmbase$(MOZ_TOOLKIT)
|
||||
|
||||
ifneq (,$(filter gtk, $(MOZ_TOOLKIT)))
|
||||
TOOLKIT_CFLAGS = \
|
||||
-DWIDGET_DLL=\"libwidgetgtk.so\" \
|
||||
-DGFXWIN_DLL=\"libgfxgtk.so\" \
|
||||
$(TK_GTK_CFLAGS)
|
||||
|
||||
TOOLKIT_CPPSRCS = \
|
||||
nsGTKMain.cpp \
|
||||
nsGTKMenu.cpp
|
||||
|
||||
TOOLKIT_LIBS = $(TK_GTK_LIBS)
|
||||
else
|
||||
ifneq (,$(filter motif, $(MOZ_TOOLKIT)))
|
||||
TOOLKIT_CFLAGS = \
|
||||
-DWIDGET_DLL=\"libwidgetmotif.so\" \
|
||||
-DGFXWIN_DLL=\"libgfxmotif.so\" \
|
||||
$(TK_MOTIF_CFLAGS)
|
||||
|
||||
TOOLKIT_CPPSRCS = \
|
||||
nsMotifMenu.cpp \
|
||||
nsUnixMain.cpp
|
||||
|
||||
TOOLKIT_LIBS = $(TK_MOTIF_LIBS) $(XLDFLAGS) $(XLIBS)
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
CPPSRCS = \
|
||||
Scribble.cpp \
|
||||
main.cpp \
|
||||
$(NULL)
|
||||
|
||||
CFLAGS += $(TOOLKIT_CFLAGS)
|
||||
|
||||
INCLUDES+= -I$(PUBLIC)/raptor -I$(PUBLIC)/xpcom -I$(PUBLIC)/shell
|
||||
|
||||
DIRS =
|
||||
|
||||
ifdef MOZ_OJI
|
||||
JSJ_LIB = -ljsj
|
||||
endif
|
||||
|
||||
OBJS = $(CPPSRCS:.cpp=.o)
|
||||
|
||||
EX_LIBS = \
|
||||
$(DIST)/bin/libraptorbase.so \
|
||||
$(DIST)/bin/libpng.so \
|
||||
$(DIST)/bin/libpref.so \
|
||||
$(DIST)/bin/libraptorbase.so \
|
||||
$(DIST)/bin/libwidgetunix.so \
|
||||
$(DIST)/bin/libraptorgfx.so \
|
||||
$(DIST)/bin/libgfxunix.so \
|
||||
$(DIST)/bin/libraptorhtml.so \
|
||||
$(DIST)/bin/libgmbaseunix.so \
|
||||
$(DIST)/bin/libraptorhtmlbase_s.so \
|
||||
$(DIST)/bin/libraptorhtmldoc_s.so \
|
||||
$(DIST)/bin/libraptorhtmlforms_s.so \
|
||||
$(DIST)/bin/libraptorhtmlpars.so \
|
||||
$(DIST)/bin/libraptorhtmlstyle_s.so \
|
||||
$(DIST)/bin/libraptorhtmltable_s.so \
|
||||
$(DIST)/bin/libraptorlayout_s.so \
|
||||
$(DIST)/bin/libraptorevents_s.so \
|
||||
$(DIST)/bin/libraptorview.so \
|
||||
$(DIST)/bin/libreg.so \
|
||||
$(DIST)/bin/libabouturl.so \
|
||||
$(DIST)/bin/libfileurl.so \
|
||||
$(DIST)/bin/libftpurl.so \
|
||||
$(DIST)/bin/libgophurl.so \
|
||||
$(DIST)/bin/libhttpurl.so \
|
||||
$(DIST)/bin/libimg.so \
|
||||
$(DIST)/bin/libjpeg.so \
|
||||
$(DIST)/bin/libjs.so \
|
||||
$(DIST)/bin/libjsdom.so \
|
||||
$(DIST)/bin/libjsj.so \
|
||||
$(DIST)/bin/libmimetype.so \
|
||||
$(DIST)/bin/libmsgc21.so \
|
||||
$(DIST)/bin/libnetcache.so \
|
||||
$(DIST)/bin/libnetcnvts.so \
|
||||
$(DIST)/bin/libnetlib.so \
|
||||
$(DIST)/bin/libnetutil.so \
|
||||
$(DIST)/bin/libnetwork.so \
|
||||
$(DIST)/bin/libraptorwebwidget.so \
|
||||
$(DIST)/bin/libreg.so \
|
||||
$(DIST)/bin/libremoturl.so \
|
||||
$(DIST)/bin/libsecfree.so \
|
||||
$(DIST)/bin/libstubnj.so \
|
||||
$(DIST)/bin/libstubsj.so \
|
||||
$(DIST)/bin/libtestdynamic.so \
|
||||
$(DIST)/bin/libutil.so \
|
||||
$(DIST)/bin/libxp.so \
|
||||
$(DIST)/bin/libxpcom.so \
|
||||
$(DIST)/bin/libzlib.so \
|
||||
$(DIST)/bin/libutil.so \
|
||||
$(DIST)/bin/libxp.so \
|
||||
$(DIST)/bin/libxpcom.so \
|
||||
$(DIST)/bin/libzlib.so \
|
||||
$(DIST)/bin/libnglcsslay_s.so \
|
||||
$(DIST)/bin/libnglhtmlcon_s.so \
|
||||
-L$(DIST)/bin \
|
||||
-lraptorbase \
|
||||
-lpng \
|
||||
-lpref \
|
||||
-lraptorbase \
|
||||
$(TOOLKIT_WIDGET_LIB) \
|
||||
-lraptorgfx \
|
||||
$(TOOLKIT_GFX_LIB) \
|
||||
-lraptorhtml \
|
||||
$(DIST)/lib/libraptorhtmlforms_s.a \
|
||||
$(TOOLKIT_BASE_LIB) \
|
||||
-lraptorhtmlpars \
|
||||
-lraptorview \
|
||||
-lreg \
|
||||
-labouturl \
|
||||
-lfileurl \
|
||||
-lftpurl \
|
||||
-lgophurl \
|
||||
-lhttpurl \
|
||||
-limg \
|
||||
-ljpeg \
|
||||
-ljs \
|
||||
-ljsdom \
|
||||
$(DIST)/lib/libjsdomcore_s.a \
|
||||
$(JSJ_LIB) \
|
||||
-lmimetype \
|
||||
-lnetcache \
|
||||
-lnetcnvts \
|
||||
-lnetlib \
|
||||
-lnetutil \
|
||||
-lnetwork \
|
||||
-lraptorwebwidget \
|
||||
-lreg \
|
||||
-lremoturl \
|
||||
-lsecfree \
|
||||
-lstubnj \
|
||||
-lstubsj \
|
||||
-ltestdynamic \
|
||||
-lutil \
|
||||
-lxp \
|
||||
-lxpcom \
|
||||
-lzlib \
|
||||
-lutil \
|
||||
-lxp \
|
||||
-lxpcom \
|
||||
-lzlib \
|
||||
-lraptorplugin \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(OS_ARCH),Linux)
|
||||
ifneq (,$(filter Linux SunOS,$(OS_ARCH)))
|
||||
EX_LIBS += \
|
||||
$(DIST)/bin/libpwcac.so \
|
||||
$(DIST)/bin/libdbm.so \
|
||||
-lpwcac \
|
||||
-ldbm \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
@@ -103,22 +135,30 @@ TARGETS = $(PROGS)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
$(OBJDIR)/Scribble.o:: Scribble.cpp
|
||||
$(CCC) -o $@ -c $(CFLAGS) Scribble.cpp $(LDFLAGS)
|
||||
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
@$(MAKE_OBJDIR)
|
||||
$(CCC) -o $@ $(CFLAGS) -c $*.cpp
|
||||
|
||||
$(PROGS):$(OBJDIR)/%: $(OBJDIR)/%.o $(OBJDIR)/Scribble.o $(EX_LIBS)
|
||||
$(PROGS): $(OBJS) # $(EX_LIBS)
|
||||
@$(MAKE_OBJDIR)
|
||||
ifeq ($(OS_ARCH),Linux)
|
||||
$(CCC) -rdynamic -o $@ $@.o $(OBJDIR)/Scribble.o $(LDFLAGS) $(EX_LIBS) $(NSPR_LIBS) $(OS_LIBS)
|
||||
$(CCC) -rdynamic -o $@ $(OBJS) $(LDFLAGS) $(EX_LIBS) $(NSPR_LIBS) $(TOOLKIT_LIBS) $(OS_LIBS)
|
||||
else
|
||||
$(CCC) -o $@ $@.o -woff 84,85 $(LDFLAGS) $(OBJDIR)/Scribble.o $(EX_LIBS) $(NSPR_LIBS) $(OS_LIBS)
|
||||
$(CCC) -o $@ -woff 84,85 $(LDFLAGS) $(OBJS) $(EX_LIBS) $(NSPR_LIBS) $(TOOLKIT_LIBS) $(OS_LIBS)
|
||||
endif
|
||||
|
||||
#$(OBJDIR)/Scribble.o:: Scribble.cpp
|
||||
# $(CCC) -o $@ -c $(CFLAGS) Scribble.cpp $(LDFLAGS)
|
||||
|
||||
|
||||
#$(OBJDIR)/%.o: %.cpp
|
||||
# @$(MAKE_OBJDIR)
|
||||
# $(CCC) -o $@ $(CFLAGS) -c $*.cpp
|
||||
|
||||
#$(PROGS):$(OBJDIR)/%: $(OBJDIR)/%.o $(OBJDIR)/Scribble.o $(EX_LIBS)
|
||||
# @$(MAKE_OBJDIR)
|
||||
#ifeq ($(OS_ARCH),Linux)
|
||||
# $(CCC) -rdynamic -o $@ $@.o $(OBJDIR)/Scribble.o $(LDFLAGS) $(EX_LIBS) $(NSPR_LIBS) $(OS_LIBS)
|
||||
#else
|
||||
# $(CCC) -o $@ $@.o -woff 84,85 $(LDFLAGS) $(OBJDIR)/Scribble.o $(EX_LIBS) $(NSPR_LIBS) $(OS_LIBS)
|
||||
#endif
|
||||
|
||||
export::
|
||||
|
||||
|
||||
|
||||
@@ -53,21 +53,19 @@ static nsIImageRequest *gImageReq = nsnull;
|
||||
|
||||
#ifdef XP_PC
|
||||
#define WIDGET_DLL "raptorwidget.dll"
|
||||
#define GFX_DLL "raptorgfxwin.dll"
|
||||
#define GFXWIN_DLL "raptorgfxwin.dll"
|
||||
#define TEXT_HEIGHT 25
|
||||
#define FILE_URL_PREFIX "file://"
|
||||
#endif
|
||||
|
||||
#ifdef XP_UNIX
|
||||
#define WIDGET_DLL "libwidgetunix.so"
|
||||
#define GFX_DLL "libgfxunix.so"
|
||||
#define TEXT_HEIGHT 30
|
||||
#define FILE_URL_PREFIX "file://"
|
||||
#endif
|
||||
|
||||
#ifdef XP_MAC
|
||||
#define WIDGET_DLL "WIDGET_DLL"
|
||||
#define GFX_DLL "GFXWIN_DLL"
|
||||
#define GFXWIN_DLL "GFXWIN_DLL"
|
||||
#define TEXT_HEIGHT 30
|
||||
#define FILE_URL_PREFIX "file:///"
|
||||
#endif
|
||||
@@ -460,10 +458,10 @@ nsresult CreateApplication(int * argc, char ** argv)
|
||||
static NS_DEFINE_IID(kCFontMetricsIID, NS_FONT_METRICS_CID);
|
||||
static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID);
|
||||
|
||||
nsRepository::RegisterFactory(kCRenderingContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
|
||||
nsRepository::RegisterFactory(kCDeviceContextIID, GFX_DLL, PR_FALSE, PR_FALSE);
|
||||
nsRepository::RegisterFactory(kCFontMetricsIID, GFX_DLL, PR_FALSE, PR_FALSE);
|
||||
nsRepository::RegisterFactory(kCImageIID, GFX_DLL, PR_FALSE, PR_FALSE);
|
||||
nsRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
nsRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
nsRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
nsRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
|
||||
// register widget classes
|
||||
static NS_DEFINE_IID(kCWindowCID, NS_WINDOW_CID);
|
||||
@@ -503,12 +501,6 @@ nsresult CreateApplication(int * argc, char ** argv)
|
||||
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
|
||||
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
|
||||
|
||||
res = nsRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&scribbleData.mContext);
|
||||
|
||||
if (NS_OK == res)
|
||||
scribbleData.mContext->Init(nsnull);
|
||||
|
||||
|
||||
// Create an application shell
|
||||
nsIAppShell *appShell = nsnull;
|
||||
nsRepository::CreateInstance(kCAppShellCID, nsnull, kIAppShellIID,
|
||||
@@ -516,6 +508,11 @@ nsresult CreateApplication(int * argc, char ** argv)
|
||||
appShell->Create(argc, argv);
|
||||
|
||||
|
||||
res = nsRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&scribbleData.mContext);
|
||||
|
||||
if (NS_OK == res)
|
||||
scribbleData.mContext->Init(nsnull);
|
||||
|
||||
|
||||
//nsILookAndFeel *laf;
|
||||
//nsRepository::CreateInstance(kCLookAndFeelCID, nsnull, kILookAndFeelIID,(void**)&laf);
|
||||
|
||||
@@ -40,6 +40,38 @@ void main(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
#ifdef XP_UNIX
|
||||
|
||||
#include "xp_mcom.h"
|
||||
#include "net.h"
|
||||
#include "xp_linebuf.h"
|
||||
#include "mkbuf.h"
|
||||
|
||||
extern "C" XP_Bool ValidateDocData(MWContext *window_id)
|
||||
{
|
||||
printf("ValidateDocData not implemented, stubbed in widget/tests/scribble/main.cpp\n");
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
extern "C" char *fe_GetConfigDir(void)
|
||||
{
|
||||
printf("fe_GetConfigDir() not implemented, stubbed in widget/tests/scribble/main.cpp\n");
|
||||
return strdup("/tmp");
|
||||
}
|
||||
|
||||
/* dist/public/xp/xp_linebuf.h */
|
||||
int XP_ReBuffer (const char *net_buffer, int32 net_buffer_size,
|
||||
uint32 desired_buffer_size,
|
||||
char **bufferP, uint32 *buffer_sizeP,
|
||||
uint32 *buffer_fpP,
|
||||
int32 (*per_buffer_fn) (char *buffer,
|
||||
uint32 buffer_size,
|
||||
void *closure),
|
||||
void *closure)
|
||||
{
|
||||
printf("XP_ReBuffer not implemented, stubbed in widget/tests/scribble/main.cpp\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
void main(int argc, char **argv)
|
||||
{
|
||||
int argC = argc;
|
||||
|
||||
Reference in New Issue
Block a user