Link NS_NewTimer() directly into the embedding app.

git-svn-id: svn://10.0.0.236/trunk@44454 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ramiro%netscape.com
1999-08-25 05:06:03 +00:00
parent 5fdc371b7b
commit 0fe84f85d2
3 changed files with 67 additions and 11 deletions

View File

@@ -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@

View File

@@ -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)

View File

@@ -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;
}
//////////////////////////////////////////////////////////////////////////