diff --git a/mozilla/webshell/embed/gtk/lib/Makefile.am b/mozilla/webshell/embed/gtk/lib/Makefile.am index 953321f33e9..9742c9c4d11 100644 --- a/mozilla/webshell/embed/gtk/lib/Makefile.am +++ b/mozilla/webshell/embed/gtk/lib/Makefile.am @@ -9,6 +9,7 @@ libgtkmozilla_la_SOURCES = \ GtkMozillaContainer.cpp \ GtkMozillaInputStream.h \ GtkMozillaInputStream.cpp \ + nsNewTimer.cpp \ nsSetupRegistry.cpp MOZILLA_INCLUDES = -I@MOZILLA_DIR@/dist/include @@ -17,11 +18,8 @@ MOZILLA_INCLUDES = -I@MOZILLA_DIR@/dist/include NULL = NSPR_LIBS = -lplds3 -lplc3 -lnspr3 -lpthread -TIMER_LIBS = -ltimer_s - BASE_LIBS = \ -lmozjs \ - $(TIMER_LIBS) \ -lxpcom \ -lmozutil \ $(NULL) @@ -54,5 +52,3 @@ INCLUDES = $(MOZILLA_INCLUDES) @GTK_CFLAGS@ @DEBUG_FLAGS@ CPPFLAGS = -DXP_UNIX -DMOZ_DLL_SUFFIX=\".so\" -DNECKO -fno-rtti -fno-exceptions libgtkmozilla_la_LIBADD = $(MOZILLA_LIBS) @GTK_LIBS@ - - diff --git a/mozilla/webshell/embed/gtk/lib/Makefile.in b/mozilla/webshell/embed/gtk/lib/Makefile.in index d3bd3fdf4d8..8ae65e9f00d 100644 --- a/mozilla/webshell/embed/gtk/lib/Makefile.in +++ b/mozilla/webshell/embed/gtk/lib/Makefile.in @@ -82,7 +82,7 @@ VERSION = @VERSION@ lib_LTLIBRARIES = libgtkmozilla.la include_HEADERS = gtkmozilla.h -libgtkmozilla_la_SOURCES = gtkmozilla.cpp gtkmozilla.h GtkMozillaContainer.h GtkMozillaContainer.cpp GtkMozillaInputStream.h GtkMozillaInputStream.cpp nsSetupRegistry.cpp +libgtkmozilla_la_SOURCES = gtkmozilla.cpp gtkmozilla.h GtkMozillaContainer.h GtkMozillaContainer.cpp GtkMozillaInputStream.h GtkMozillaInputStream.cpp nsNewTimer.cpp nsSetupRegistry.cpp MOZILLA_INCLUDES = -I@MOZILLA_DIR@/dist/include @@ -91,9 +91,7 @@ MOZILLA_INCLUDES = -I@MOZILLA_DIR@/dist/include NULL = NSPR_LIBS = -lplds3 -lplc3 -lnspr3 -lpthread -TIMER_LIBS = -ltimer_s - -BASE_LIBS = -lmozjs $(TIMER_LIBS) -lxpcom -lmozutil $(NULL) +BASE_LIBS = -lmozjs -lxpcom -lmozutil $(NULL) GECKO_LIBS = -lraptorgfx $(NULL) @@ -128,7 +126,7 @@ LIBS = @LIBS@ libgtkmozilla_la_LDFLAGS = libgtkmozilla_la_DEPENDENCIES = libgtkmozilla_la_OBJECTS = gtkmozilla.lo GtkMozillaContainer.lo \ -GtkMozillaInputStream.lo nsSetupRegistry.lo +GtkMozillaInputStream.lo nsNewTimer.lo nsSetupRegistry.lo CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) @@ -149,7 +147,7 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best DEP_FILES = .deps/GtkMozillaContainer.P .deps/GtkMozillaInputStream.P \ -.deps/gtkmozilla.P .deps/nsSetupRegistry.P +.deps/gtkmozilla.P .deps/nsNewTimer.P .deps/nsSetupRegistry.P SOURCES = $(libgtkmozilla_la_SOURCES) OBJECTS = $(libgtkmozilla_la_OBJECTS) diff --git a/mozilla/webshell/embed/gtk/lib/nsNewTimer.cpp b/mozilla/webshell/embed/gtk/lib/nsNewTimer.cpp new file mode 100644 index 00000000000..c3f762d0d5b --- /dev/null +++ b/mozilla/webshell/embed/gtk/lib/nsNewTimer.cpp @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ +#include "nsITimer.h" +#include "nsUnixTimerCIID.h" +#include "nsIComponentManager.h" + +static NS_DEFINE_IID(kITimerIID, NS_ITIMER_IID); +static NS_DEFINE_CID(kCTimerGtkCID, NS_TIMER_GTK_CID); + +////////////////////////////////////////////////////////////////////////// +nsresult NS_NewTimer(nsITimer ** aInstancePtrResult) +{ + NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); + + if (nsnull == aInstancePtrResult) + return NS_ERROR_NULL_POINTER; + + nsresult rv = NS_ERROR_FAILURE; + + nsITimer * timer = nsnull; + + static nsIFactory * factory = nsnull; + + if (nsnull == factory) + { + nsresult frv = nsComponentManager::FindFactory(kCTimerGtkCID,&factory); + + NS_ASSERTION(NS_SUCCEEDED(frv),"Could not find timer factory."); + NS_ASSERTION(nsnull != factory,"Could not instanciate timer factory."); + + return NS_ERROR_FAILURE; + } + + rv = factory->CreateInstance(NULL, + kITimerIID, + (void **)& timer); + + NS_ASSERTION(NS_SUCCEEDED(rv),"Could not instanciate a timer."); + + if (nsnull == timer) + return NS_ERROR_OUT_OF_MEMORY; + + *aInstancePtrResult = timer; + + return rv; +} +//////////////////////////////////////////////////////////////////////////