From 9627efa0fdc9e69cd5fe2d4fc534ff1bc242043f Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@18797224-902f-48f8-a5cc-f745e15eee43> Date: Mon, 24 May 1999 21:15:23 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create tag 'XPCOM21_BASE'. git-svn-id: svn://10.0.0.236/tags/XPCOM21_BASE@32539 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/public/nsITimer.h | 96 ++++++ mozilla/gfx/public/nsITimerCallback.h | 43 +++ mozilla/gfx/src/gtk/nsTimer.cpp | 191 ++++++++++++ mozilla/gfx/src/mac/nsTimer.cpp | 357 ++++++++++++++++++++++ mozilla/gfx/src/motif/nsTimer.cpp | 173 +++++++++++ mozilla/gfx/src/photon/nsTimer.cpp | 261 ++++++++++++++++ mozilla/gfx/src/rhapsody/nsTimer.cpp | 200 +++++++++++++ mozilla/gfx/src/windows/nsTimer.cpp | 362 +++++++++++++++++++++++ mozilla/gfx/src/xlib/nsTimer.cpp | 295 ++++++++++++++++++ mozilla/widget/public/nsRepeater.h | 60 ---- mozilla/widget/src/mac/nsRepeater.cpp | 147 --------- mozilla/xpcom/base/MANIFEST | 12 - mozilla/xpcom/components/MANIFEST | 8 - mozilla/xpcom/ds/MANIFEST | 32 -- mozilla/xpcom/idl/nsIFileSpec.idl | 157 ---------- mozilla/xpcom/io/MANIFEST | 13 - mozilla/xpcom/io/nsIFileSpec.idl | 166 ----------- mozilla/xpcom/io/nsIFileWidget.h | 162 ---------- mozilla/xpcom/macbuild/FilesTest.mcp | Bin 83082 -> 0 bytes mozilla/xpcom/macbuild/files.prefix | 19 -- mozilla/xpcom/macbuild/filesDebug.prefix | 19 -- mozilla/xpcom/reflect/Makefile.in | 30 -- mozilla/xpcom/threads/MANIFEST | 4 - 23 files changed, 1978 insertions(+), 829 deletions(-) create mode 100644 mozilla/gfx/public/nsITimer.h create mode 100644 mozilla/gfx/public/nsITimerCallback.h create mode 100644 mozilla/gfx/src/gtk/nsTimer.cpp create mode 100644 mozilla/gfx/src/mac/nsTimer.cpp create mode 100644 mozilla/gfx/src/motif/nsTimer.cpp create mode 100644 mozilla/gfx/src/photon/nsTimer.cpp create mode 100644 mozilla/gfx/src/rhapsody/nsTimer.cpp create mode 100644 mozilla/gfx/src/windows/nsTimer.cpp create mode 100644 mozilla/gfx/src/xlib/nsTimer.cpp delete mode 100644 mozilla/widget/public/nsRepeater.h delete mode 100644 mozilla/widget/src/mac/nsRepeater.cpp delete mode 100644 mozilla/xpcom/base/MANIFEST delete mode 100644 mozilla/xpcom/components/MANIFEST delete mode 100644 mozilla/xpcom/ds/MANIFEST delete mode 100644 mozilla/xpcom/idl/nsIFileSpec.idl delete mode 100644 mozilla/xpcom/io/MANIFEST delete mode 100644 mozilla/xpcom/io/nsIFileSpec.idl delete mode 100644 mozilla/xpcom/io/nsIFileWidget.h delete mode 100644 mozilla/xpcom/macbuild/FilesTest.mcp delete mode 100644 mozilla/xpcom/macbuild/files.prefix delete mode 100644 mozilla/xpcom/macbuild/filesDebug.prefix delete mode 100644 mozilla/xpcom/reflect/Makefile.in delete mode 100644 mozilla/xpcom/threads/MANIFEST diff --git a/mozilla/gfx/public/nsITimer.h b/mozilla/gfx/public/nsITimer.h new file mode 100644 index 00000000000..38874809146 --- /dev/null +++ b/mozilla/gfx/public/nsITimer.h @@ -0,0 +1,96 @@ +/* -*- 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. + */ +#ifndef nsITimer_h___ +#define nsITimer_h___ + +#include "nscore.h" +#include "nsISupports.h" + +class nsITimer; +class nsITimerCallback; + +// Implementations of nsITimer should be written such that there are no limitations +// on what can be called by the TimerCallbackFunc. On platforms like the Macintosh this +// means that callback functions must be called from the main event loop NOT from +// an interrupt. + +/// Signature of timer callback function +typedef void +(*nsTimerCallbackFunc) (nsITimer *aTimer, void *aClosure); + +/// Interface IID for nsITimer +#define NS_ITIMER_IID \ +{ 0x497eed20, 0xb740, 0x11d1, \ +{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } } + +/** + * Timer class, used to invoke a function or method after a fixed + * millisecond interval. Note that this interface is subject to + * change! + */ +class nsITimer : public nsISupports { +public: + NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITIMER_IID) + + /** + * Initialize a timer to fire after the given millisecond interval. + * This version takes a function to call and a closure to pass to + * that function. + * + * @param aFunc - The function to invoke + * @param aClosure - an opaque pointer to pass to that function + * @param aRepeat - (Not yet implemented) One-shot or repeating + * @param aDelay - The millisecond interval + * @result - NS_OK if this operation was successful + */ + virtual nsresult Init(nsTimerCallbackFunc aFunc, + void *aClosure, +// PRBool aRepeat, + PRUint32 aDelay)=0; + + /** + * Initialize a timer to fire after the given millisecond interval. + * This version takes an interface of type nsITimerCallback. + * The Notify method of this method is invoked. + * + * @param aCallback - The interface to notify + * @param aRepeat - (Not yet implemented) One-shot or repeating + * @param aDelay - The millisecond interval + * @result - NS_OK if this operation was successful + */ + virtual nsresult Init(nsITimerCallback *aCallback, +// PRBool aRepeat, + PRUint32 aDelay)=0; + + /// Cancels the timeout + virtual void Cancel()=0; + + /// @return the millisecond delay of the timeout + virtual PRUint32 GetDelay()=0; + + /// Change the millisecond interval for the timeout + virtual void SetDelay(PRUint32 aDelay)=0; + + /// @return the opaque pointer + virtual void* GetClosure()=0; +}; + +/** Factory method for creating an nsITimer */ +extern NS_GFX nsresult NS_NewTimer(nsITimer** aInstancePtrResult); + +#endif diff --git a/mozilla/gfx/public/nsITimerCallback.h b/mozilla/gfx/public/nsITimerCallback.h new file mode 100644 index 00000000000..80127210477 --- /dev/null +++ b/mozilla/gfx/public/nsITimerCallback.h @@ -0,0 +1,43 @@ +/* -*- 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. + */ +#ifndef nsITimerCallback_h___ +#define nsITimerCallback_h___ + +#include "nscore.h" +#include "nsISupports.h" + +class nsITimer; + +/// Interface IID for nsITimerCallback +#define NS_ITIMERCALLBACK_IID \ +{ 0x5079b3a0, 0xb743, 0x11d1, \ +{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } } + +/** + * Interface implemented by users of the nsITimer class. An instance + * of this interface is passed in when creating a timer. The Notify() + * method of that instance is invoked after the specified delay. + */ +class nsITimerCallback : public nsISupports { +public: + NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITIMERCALLBACK_IID) + + virtual void Notify(nsITimer *timer) = 0; +}; + +#endif diff --git a/mozilla/gfx/src/gtk/nsTimer.cpp b/mozilla/gfx/src/gtk/nsTimer.cpp new file mode 100644 index 00000000000..b8ba5c52597 --- /dev/null +++ b/mozilla/gfx/src/gtk/nsTimer.cpp @@ -0,0 +1,191 @@ +/* -*- 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 "nsITimerCallback.h" +#include "nsCRT.h" +#include "prlog.h" +#include +#include +#include + +static NS_DEFINE_IID(kITimerIID, NS_ITIMER_IID); + +extern "C" gint nsTimerExpired(gpointer aCallData); + +/* + * Implementation of timers using Gtk timer facility + */ +class TimerImpl : public nsITimer { +public: + +public: + TimerImpl(); + virtual ~TimerImpl(); + + virtual nsresult Init(nsTimerCallbackFunc aFunc, + void *aClosure, +// PRBool aRepeat, + PRUint32 aDelay); + + virtual nsresult Init(nsITimerCallback *aCallback, +// PRBool aRepeat, + PRUint32 aDelay); + + NS_DECL_ISUPPORTS + + virtual void Cancel(); + virtual PRUint32 GetDelay() { return mDelay; } + virtual void SetDelay(PRUint32 aDelay) { mDelay=aDelay; }; + virtual void* GetClosure() { return mClosure; } + + void FireTimeout(); + +private: + nsresult Init(PRUint32 aDelay); + + PRUint32 mDelay; + nsTimerCallbackFunc mFunc; + void *mClosure; + nsITimerCallback *mCallback; + // PRBool mRepeat; + TimerImpl *mNext; + guint mTimerId; +}; + +void TimerImpl::FireTimeout() +{ + if (mFunc != NULL) { + (*mFunc)(this, mClosure); + } + else if (mCallback != NULL) { + mCallback->Notify(this); // Fire the timer + } + +// Always repeating here + +// if (mRepeat) +// mTimerId = gtk_timeout_add(aDelay, nsTimerExpired, this); +} + + +TimerImpl::TimerImpl() +{ + // printf("TimerImple::TimerImpl called for %p\n", this); + NS_INIT_REFCNT(); + mFunc = NULL; + mCallback = NULL; + mNext = NULL; + mTimerId = 0; + mDelay = 0; + mClosure = NULL; +} + +TimerImpl::~TimerImpl() +{ + //printf("TimerImpl::~TimerImpl called for %p\n", this); + Cancel(); + NS_IF_RELEASE(mCallback); +} + +nsresult +TimerImpl::Init(nsTimerCallbackFunc aFunc, + void *aClosure, +// PRBool aRepeat, + PRUint32 aDelay) +{ + //printf("TimerImpl::Init called with func + closure for %p\n", this); + mFunc = aFunc; + mClosure = aClosure; + // mRepeat = aRepeat; + + if ((aDelay > 10000) || (aDelay < 0)) { + printf("Timer::Init() called with bogus value \"%d\"! Not enabling timer.\n", + aDelay); + return Init(aDelay); + } + + mTimerId = gtk_timeout_add(aDelay, nsTimerExpired, this); + + return Init(aDelay); +} + +nsresult +TimerImpl::Init(nsITimerCallback *aCallback, +// PRBool aRepeat, + PRUint32 aDelay) +{ + //printf("TimerImpl::Init called with callback only for %p\n", this); + mCallback = aCallback; + NS_ADDREF(mCallback); + // mRepeat = aRepeat; + if ((aDelay > 10000) || (aDelay < 0)) { + printf("Timer::Init() called with bogus value \"%d\"! Not enabling timer.\n", + aDelay); + return Init(aDelay); + } + + mTimerId = gtk_timeout_add(aDelay, nsTimerExpired, this); + + return Init(aDelay); +} + +nsresult +TimerImpl::Init(PRUint32 aDelay) +{ + //printf("TimerImpl::Init called with delay %d only for %p\n", aDelay, this); + + mDelay = aDelay; + // NS_ADDREF(this); + + return NS_OK; +} + +NS_IMPL_ISUPPORTS(TimerImpl, kITimerIID) + + +void +TimerImpl::Cancel() +{ + //printf("TimerImpl::Cancel called for %p\n", this); + TimerImpl *me = this; + if (mTimerId) + gtk_timeout_remove(mTimerId); +} + +NS_GFX nsresult NS_NewTimer(nsITimer** aInstancePtrResult) +{ + NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); + if (nsnull == aInstancePtrResult) { + return NS_ERROR_NULL_POINTER; + } + + TimerImpl *timer = new TimerImpl(); + if (nsnull == timer) { + return NS_ERROR_OUT_OF_MEMORY; + } + + return timer->QueryInterface(kITimerIID, (void **) aInstancePtrResult); +} + +gint nsTimerExpired(gpointer aCallData) +{ + //printf("nsTimerExpired for %p\n", aCallData); + TimerImpl* timer = (TimerImpl *)aCallData; + timer->FireTimeout(); + return 0; +} diff --git a/mozilla/gfx/src/mac/nsTimer.cpp b/mozilla/gfx/src/mac/nsTimer.cpp new file mode 100644 index 00000000000..ab16b217fab --- /dev/null +++ b/mozilla/gfx/src/mac/nsTimer.cpp @@ -0,0 +1,357 @@ +/* -*- 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. + */ + +// +// Mac implementation of the nsITimer interface +// + + + +#include "nsITimer.h" +#include "nsITimerCallback.h" +#include "prlog.h" +#include "nsRepeater.h" + +#include +#include + + + +#pragma mark class TimerImpl + +//======================================================================================== +class TimerImpl : public nsITimer +// TimerImpl implements nsITimer API +//======================================================================================== +{ + friend class TimerPeriodical; + + private: + nsTimerCallbackFunc mCallbackFunc; + nsITimerCallback * mCallbackObject; + void * mClosure; + PRUint32 mDelay; + PRUint32 mFireTime; // Timer should fire when TickCount >= this number + TimerImpl * mPrev; + TimerImpl * mNext; + + public: + + // constructors + + TimerImpl(); + + virtual ~TimerImpl(); + + NS_DECL_ISUPPORTS + + PRUint32 GetFireTime() const { return mFireTime; } + + void Fire(); + + // nsITimer overrides + + virtual nsresult Init(nsTimerCallbackFunc aFunc, + void *aClosure, + PRUint32 aDelay); + + virtual nsresult Init(nsITimerCallback *aCallback, + PRUint32 aDelay); + + virtual void Cancel(); + + virtual PRUint32 GetDelay(); + + virtual void SetDelay(PRUint32 aDelay); + + virtual void* GetClosure(); + +#if DEBUG + enum { + eGoodTimerSignature = 'Barf', + eDeletedTimerSignature = 'oops' + }; + + Boolean IsGoodTimer() const { return (mSignature == eGoodTimerSignature); } +#endif + + private: + // Calculates mFireTime too + void SetDelaySelf( PRUint32 aDelay ); + +#if DEBUG + UInt32 mSignature; +#endif + +}; + +#pragma mark class TimerPeriodical + +//======================================================================================== +class TimerPeriodical : public Repeater +// TimerPeriodical is a singleton Repeater subclass that fires +// off TimerImpl. The firing is done on idle. +//======================================================================================== +{ + static TimerPeriodical * gPeriodical; + + TimerImpl* mTimers; + + public: + // Returns the singleton instance + static TimerPeriodical * GetPeriodical(); + + TimerPeriodical(); + + virtual ~TimerPeriodical(); + + virtual void RepeatAction( const EventRecord &inMacEvent); + + nsresult AddTimer( TimerImpl * aTimer); + + nsresult RemoveTimer( TimerImpl * aTimer); + +}; + + +//======================================================================================== +// TimerImpl implementation +//======================================================================================== + +NS_IMPL_ISUPPORTS(TimerImpl, nsITimer::GetIID()) + +//---------------------------------------------------------------------------------------- +TimerImpl::TimerImpl() +//---------------------------------------------------------------------------------------- +: mCallbackFunc(nsnull) +, mCallbackObject(nsnull) +, mClosure(nsnull) +, mDelay(0) +, mFireTime(0) +, mPrev(nsnull) +, mNext(nsnull) +#if DEBUG +, mSignature(eGoodTimerSignature) +#endif +{ + NS_INIT_REFCNT(); +} + +//---------------------------------------------------------------------------------------- +TimerImpl::~TimerImpl() +//---------------------------------------------------------------------------------------- +{ + Cancel(); + NS_IF_RELEASE(mCallbackObject); +#if DEBUG + mSignature = eDeletedTimerSignature; +#endif +} + +//---------------------------------------------------------------------------------------- +nsresult TimerImpl::Init(nsTimerCallbackFunc aFunc, + void *aClosure, + PRUint32 aDelay) +//---------------------------------------------------------------------------------------- +{ + mCallbackFunc = aFunc; + mClosure = aClosure; + SetDelaySelf(aDelay); + return TimerPeriodical::GetPeriodical()->AddTimer(this); +} + +//---------------------------------------------------------------------------------------- +nsresult TimerImpl::Init(nsITimerCallback *aCallback, + PRUint32 aDelay) +//---------------------------------------------------------------------------------------- +{ + NS_ADDREF(aCallback); + mCallbackObject = aCallback; + SetDelaySelf(aDelay); + return TimerPeriodical::GetPeriodical()->AddTimer(this); +} + +//---------------------------------------------------------------------------------------- +void TimerImpl::Cancel() +//---------------------------------------------------------------------------------------- +{ + TimerPeriodical::GetPeriodical()->RemoveTimer(this); +} + +//---------------------------------------------------------------------------------------- +PRUint32 TimerImpl::GetDelay() +//---------------------------------------------------------------------------------------- +{ + return mDelay; +} + +//---------------------------------------------------------------------------------------- +void TimerImpl::SetDelay(PRUint32 aDelay) +//---------------------------------------------------------------------------------------- +{ + SetDelaySelf(aDelay); +} + +//---------------------------------------------------------------------------------------- +void* TimerImpl::GetClosure() +//---------------------------------------------------------------------------------------- +{ + return mClosure; +} + +//---------------------------------------------------------------------------------------- +void TimerImpl::Fire() +//---------------------------------------------------------------------------------------- +{ + NS_PRECONDITION(mRefCnt > 0, "Firing a disposed Timer!"); + if (mCallbackFunc != NULL) { + (*mCallbackFunc)(this, mClosure); + } + else if (mCallbackObject != NULL) { + mCallbackObject->Notify(this); // Fire the timer + } +} + +//---------------------------------------------------------------------------------------- +void TimerImpl::SetDelaySelf( PRUint32 aDelay ) +//---------------------------------------------------------------------------------------- +{ + + mDelay = aDelay; + mFireTime = TickCount() + (mDelay * 3) / 50; // We need mFireTime in ticks (1/60th) + // but aDelay is in 1000th (60/1000 = 3/50) +} + +TimerPeriodical * TimerPeriodical::gPeriodical = nsnull; + +TimerPeriodical * TimerPeriodical::GetPeriodical() +{ + if (gPeriodical == NULL) + gPeriodical = new TimerPeriodical(); + return gPeriodical; +} + +TimerPeriodical::TimerPeriodical() +{ + mTimers = nsnull; +} + +TimerPeriodical::~TimerPeriodical() +{ + PR_ASSERT(mTimers == 0); +} + +nsresult TimerPeriodical::AddTimer( TimerImpl * aTimer) +{ + // make sure it's not already there + RemoveTimer(aTimer); + // keep list sorted by fire time + if (mTimers) + { + if (aTimer->GetFireTime() < mTimers->GetFireTime()) + { + mTimers->mPrev = aTimer; + aTimer->mNext = mTimers; + mTimers = aTimer; + } + else + { + TimerImpl *t = mTimers; + TimerImpl *prevt; + // we know we will enter the while loop at least the first + // time, and thus prevt will be initialized + while (t && (t->GetFireTime() <= aTimer->GetFireTime())) + { + prevt = t; + t = t->mNext; + } + aTimer->mPrev = prevt; + aTimer->mNext = prevt->mNext; + prevt->mNext = aTimer; + if (aTimer->mNext) aTimer->mNext->mPrev = aTimer; + } + } + else mTimers = aTimer; + + StartRepeating(); + return NS_OK; +} + +nsresult TimerPeriodical::RemoveTimer( TimerImpl * aTimer) +{ + TimerImpl* t = mTimers; + TimerImpl* next_t = nsnull; + if (t) next_t = t->mNext; + while (t) + { + if (t == aTimer) + { + if (mTimers == t) mTimers = t->mNext; + if (t->mPrev) t->mPrev->mNext = t->mNext; + if (t->mNext) t->mNext->mPrev = t->mPrev; + t->mNext = nsnull; + t->mPrev = nsnull; + } + t = next_t; + if (t) next_t = t->mNext; + } + + if ( mTimers == nsnull ) + StopRepeating(); + return NS_OK; +} + +// Called through every event loop +// Loops through the list of available timers, and +// fires off the appropriate ones +void TimerPeriodical::RepeatAction( const EventRecord &inMacEvent) +{ + PRBool done = false; + while (!done) + { + TimerImpl* t = mTimers; + while (t) + { + NS_ASSERTION(t->IsGoodTimer(), "Bad timer!"); + + if (t->GetFireTime() <= inMacEvent.when) + { + RemoveTimer(t); + t->Fire(); + break; + } + t = t->mNext; + } + done = true; + } +} + + +NS_GFX nsresult NS_NewTimer(nsITimer** aInstancePtrResult) +{ + NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); + if (nsnull == aInstancePtrResult) { + return NS_ERROR_NULL_POINTER; + } + TimerImpl *timer = new TimerImpl(); + if (nsnull == timer) { + return NS_ERROR_OUT_OF_MEMORY; + } + + return timer->QueryInterface(nsITimer::GetIID(), (void **) aInstancePtrResult); +} diff --git a/mozilla/gfx/src/motif/nsTimer.cpp b/mozilla/gfx/src/motif/nsTimer.cpp new file mode 100644 index 00000000000..418459ae54c --- /dev/null +++ b/mozilla/gfx/src/motif/nsTimer.cpp @@ -0,0 +1,173 @@ +/* -*- 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 "nsITimerCallback.h" +#include "nsCRT.h" +#include "prlog.h" +#include +#include +#include + +static NS_DEFINE_IID(kITimerIID, NS_ITIMER_IID); + +// Hack for now. This is Bad because it creates a dependency between the widget +// library and this library. This needs to be replaced with having code +// to pass an interface which can be queried for the app context. +extern XtAppContext gAppContext; + +extern void nsTimerExpired(XtPointer aCallData); + + +/* + * Implementation of timers using Xt timer facility + */ +class TimerImpl : public nsITimer { +public: + +public: + TimerImpl(); + virtual ~TimerImpl(); + + virtual nsresult Init(nsTimerCallbackFunc aFunc, + void *aClosure, +// PRBool aRepeat, + PRUint32 aDelay); + + virtual nsresult Init(nsITimerCallback *aCallback, +// PRBool aRepeat, + PRUint32 aDelay); + + NS_DECL_ISUPPORTS + + virtual void Cancel(); + virtual PRUint32 GetDelay() { return mDelay; } + virtual void SetDelay(PRUint32 aDelay) { mDelay=aDelay; }; + virtual void* GetClosure() { return mClosure; } + + void FireTimeout(); + +private: + nsresult Init(PRUint32 aDelay); + + PRUint32 mDelay; + nsTimerCallbackFunc mFunc; + void *mClosure; + nsITimerCallback *mCallback; + // PRBool mRepeat; + TimerImpl *mNext; + XtIntervalId mTimerId; +}; + +void TimerImpl::FireTimeout() +{ + if (mFunc != NULL) { + (*mFunc)(this, mClosure); + } + else if (mCallback != NULL) { + mCallback->Notify(this); // Fire the timer + } + +// Always repeating here + +// if (mRepeat) +// mTimerId = XtAppAddTimeOut(gAppContext, GetDelay(),(XtTimerCallbackProc)nsTimerExpired, this); +} + + +TimerImpl::TimerImpl() +{ + NS_INIT_REFCNT(); + mFunc = NULL; + mCallback = NULL; + mNext = NULL; + mTimerId = 0; + mDelay = 0; + mClosure = NULL; +} + +TimerImpl::~TimerImpl() +{ +} + +nsresult +TimerImpl::Init(nsTimerCallbackFunc aFunc, + void *aClosure, +// PRBool aRepeat, + PRUint32 aDelay) +{ + mFunc = aFunc; + mClosure = aClosure; + // mRepeat = aRepeat; + + mTimerId = XtAppAddTimeOut(gAppContext, aDelay,(XtTimerCallbackProc)nsTimerExpired, this); + + return Init(aDelay); +} + +nsresult +TimerImpl::Init(nsITimerCallback *aCallback, +// PRBool aRepeat, + PRUint32 aDelay) +{ + mCallback = aCallback; + // mRepeat = aRepeat; + + mTimerId = XtAppAddTimeOut(gAppContext, aDelay, (XtTimerCallbackProc)nsTimerExpired, this); + + return Init(aDelay); +} + +nsresult +TimerImpl::Init(PRUint32 aDelay) +{ + mDelay = aDelay; + NS_ADDREF(this); + + return NS_OK; +} + +NS_IMPL_ISUPPORTS(TimerImpl, kITimerIID) + + +void +TimerImpl::Cancel() +{ + XtRemoveTimeOut(mTimerId); +} + +NS_GFX nsresult NS_NewTimer(nsITimer** aInstancePtrResult) +{ + NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); + if (nsnull == aInstancePtrResult) { + return NS_ERROR_NULL_POINTER; + } + + TimerImpl *timer = new TimerImpl(); + if (nsnull == timer) { + return NS_ERROR_OUT_OF_MEMORY; + } + + return timer->QueryInterface(kITimerIID, (void **) aInstancePtrResult); +} + + +void nsTimerExpired(XtPointer aCallData) +{ + TimerImpl* timer = (TimerImpl *)aCallData; + timer->FireTimeout(); +} diff --git a/mozilla/gfx/src/photon/nsTimer.cpp b/mozilla/gfx/src/photon/nsTimer.cpp new file mode 100644 index 00000000000..ccb32cfb25a --- /dev/null +++ b/mozilla/gfx/src/photon/nsTimer.cpp @@ -0,0 +1,261 @@ +/* -*- 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 "nsITimerCallback.h" +#include "nsCRT.h" +#include "prlog.h" +#include +#include +#include +#include +#include + +static NS_DEFINE_IID(kITimerIID, NS_ITIMER_IID); + +extern "C" int nsTimerExpired(void *aCallData); + +/* + * Implementation of timers QNX/Neutrino timers. + */ + +class TimerImpl : public nsITimer { +public: + +public: + TimerImpl(); + virtual ~TimerImpl(); + + virtual nsresult Init(nsTimerCallbackFunc aFunc, + void *aClosure, + PRUint32 aDelay); + + virtual nsresult Init(nsITimerCallback *aCallback, + PRUint32 aDelay); + + NS_DECL_ISUPPORTS + + virtual void Cancel(); + virtual PRUint32 GetDelay() { return mDelay; } + virtual void SetDelay(PRUint32 aDelay) { mDelay=aDelay; }; + virtual void* GetClosure() { return mClosure; } + + void FireTimeout(); + +private: + nsresult Init(PRUint32 aDelay); + nsresult SetupTimer(PRUint32 aDelay); + + PRUint32 mDelay; + nsTimerCallbackFunc mFunc; + void *mClosure; + nsITimerCallback *mCallback; + TimerImpl *mNext; + timer_t mTimerId; +}; + +/* + * This method is called when the Delay/Duration expires + */ +void TimerImpl::FireTimeout() +{ + printf("TimerImpl::FireTimeout called for %p. mFunc=<%p> and mCallback=<%p>\n", this, mFunc, mCallback); + if (mFunc != NULL) + { + (*mFunc)(this, mClosure); + } + else if (mCallback != NULL) + { + mCallback->Notify(this); // Fire the timer + } +} + + +TimerImpl::TimerImpl() +{ + printf("TimerImpl::TimerImpl called for %p\n", this); + NS_INIT_REFCNT(); + mFunc = NULL; + mCallback = NULL; + mNext = NULL; + mTimerId = 0; + mDelay = 0; + mClosure = NULL; +} + +TimerImpl::~TimerImpl() +{ + printf("TimerImpl::~TimerImpl called for %p\n", this); + Cancel(); + NS_IF_RELEASE(mCallback); +} + +nsresult +TimerImpl::SetupTimer(PRUint32 aDelay) +{ +struct sigevent event; +struct itimerspec tv; +int err; + + printf("TimerImpl::SetupTimer called with func %p\n", this); + + event.sigev_notify=SIGEV_PULSE; + event.sigev_coid=0; /* REVISIT: Get the global Photon channel ID */ + event.sigev_priority=0; + event.sigev_code=0; + event.sigev_value.sival_int=0; + err = timer_create(CLOCK_SOFTTIME,&event,&mTimerId); + if (err!=0) + { + printf ("Timer::SetupTimer() timer_create error:%d\n",errno); + return NS_ERROR_FAILURE; + } + + printf ("Timer::Init() timer id: %d\n",mTimerId); + + tv.it_interval.tv_sec=0; + tv.it_interval.tv_nsec=0; + tv.it_value.tv_sec=aDelay; + tv.it_value.tv_nsec=0; + err=timer_settime(mTimerId,0,&tv,0); + if (err!=0) + { + printf ("Timer::Init() timer_settime error:%d\n",errno); + return NS_ERROR_FAILURE; + } + + return NS_OK; +} + + +nsresult +TimerImpl::Init(nsTimerCallbackFunc aFunc, + void *aClosure, + PRUint32 aDelay) +{ +nsresult err; + + printf("TimerImpl::Init called with func + closure for %p\n", this); + mFunc = aFunc; + mClosure = aClosure; + + if ((aDelay > 10000) || (aDelay < 0)) + { + printf("Timer::Init() called with bogus value \"%d\"! Not enabling timer.\n", aDelay); + return Init(aDelay); + } + +#if 0 + mTimerId = gtk_timeout_add(aDelay, nsTimerExpired, this); +#else + err = SetupTimer(aDelay); + if (err != NS_OK) + { + printf ("Timer::Init() timer_create error:%d\n",errno); + return NS_ERROR_FAILURE; + } +#endif + + return Init(aDelay); +} + +nsresult +TimerImpl::Init(nsITimerCallback *aCallback, + PRUint32 aDelay) +{ +nsresult err; + + printf("TimerImpl::Init called with callback only for %p\n", this); + + mCallback = aCallback; + if ((aDelay > 10000) || (aDelay < 0)) + { + printf("Timer::Init() called with bogus value \"%d\"! Not enabling timer.\n", + aDelay); + return Init(aDelay); + } + +#if 0 + mTimerId = gtk_timeout_add(aDelay, nsTimerExpired, this); +#else + err = SetupTimer(aDelay); + if (err != NS_OK) + { + printf ("Timer::Init() timer_create error:%d\n",errno); + return NS_ERROR_FAILURE; + } +#endif + + return Init(aDelay); +} + +nsresult +TimerImpl::Init(PRUint32 aDelay) +{ + printf("TimerImpl::Init called with delay %d only for %p\n", aDelay, this); + + mDelay = aDelay; + NS_ADDREF(this); + + return NS_OK; +} + +NS_IMPL_ISUPPORTS(TimerImpl, kITimerIID) + + +void +TimerImpl::Cancel() +{ +int err; + + printf("TimerImpl::Cancel called for %p\n", this); + TimerImpl *me = this; + + if (mTimerId) + { +#if 0 + gtk_timeout_remove(mTimerId); +#else + err = timer_delete(mTimerId); +#endif + } +} + +NS_GFX nsresult NS_NewTimer(nsITimer** aInstancePtrResult) +{ + NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); + if (nsnull == aInstancePtrResult) + { + return NS_ERROR_NULL_POINTER; + } + + TimerImpl *timer = new TimerImpl(); + if (nsnull == timer) + { + return NS_ERROR_OUT_OF_MEMORY; + } + + return timer->QueryInterface(kITimerIID, (void **) aInstancePtrResult); +} + +int nsTimerExpired(void *aCallData) +{ + printf("nsTimerExpired for %p\n", aCallData); + TimerImpl* timer = (TimerImpl *)aCallData; + timer->FireTimeout(); + return 0; +} diff --git a/mozilla/gfx/src/rhapsody/nsTimer.cpp b/mozilla/gfx/src/rhapsody/nsTimer.cpp new file mode 100644 index 00000000000..d93a2bb2804 --- /dev/null +++ b/mozilla/gfx/src/rhapsody/nsTimer.cpp @@ -0,0 +1,200 @@ +/* -*- 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 "nsITimerCallback.h" +#include "nsCRT.h" +#include "prlog.h" +#include +#include + +// +// Copied from the unix version, Rhapsody needs to +// make this work. Stubs to compile things for now. +// + +#if 0 +Michael Hanni suggests: + + I understand that nsTimer.cpp in base/rhapsody/ needs to be completed, + yes? Wouldn't this code just use some NSTimers in the NSRunLoop? + + Timer = [NSTimer timerWithTimeInterval:0.02 //seconds + target:self + selector:@selector(doThis:) + userInfo:nil + repeats:YES]; + [[NSRunLoop currentRunLoop] addTimer:Timer + forMode:NSDefaultRunLoopMode]; + + I only looked at nsTimer.cpp briefly, but could something like this work + if imbedded in all that c++? ;-) + +#endif + +static NS_DEFINE_IID(kITimerIID, NS_ITIMER_IID); + +extern void nsTimerExpired(void *aCallData); + +class TimerImpl : public nsITimer { +public: + +public: + TimerImpl(); + virtual ~TimerImpl(); + + virtual nsresult Init(nsTimerCallbackFunc aFunc, + void *aClosure, +// PRBool aRepeat, + PRUint32 aDelay); + + virtual nsresult Init(nsITimerCallback *aCallback, +// PRBool aRepeat, + PRUint32 aDelay); + + NS_DECL_ISUPPORTS + + virtual void Cancel(); + virtual PRUint32 GetDelay() { return mDelay; } + virtual void SetDelay(PRUint32 aDelay) { mDelay=aDelay; }; + virtual void* GetClosure() { return mClosure; } + + void FireTimeout(); + +private: + nsresult Init(PRUint32 aDelay); + + PRUint32 mDelay; + nsTimerCallbackFunc mFunc; + void *mClosure; + nsITimerCallback *mCallback; + // PRBool mRepeat; + TimerImpl *mNext; + int mTimerId; +}; + +void TimerImpl::FireTimeout() +{ + if (mFunc != NULL) { + (*mFunc)(this, mClosure); + } + else if (mCallback != NULL) { + mCallback->Notify(this); // Fire the timer + } + +// Always repeating here + +// if (mRepeat) +// mTimerId = XtAppAddTimeOut(gAppContext, GetDelay(),(XtTimerCallbackProc)nsTimerExpired, this); +} + + +TimerImpl::TimerImpl() +{ + NS_INIT_REFCNT(); + mFunc = NULL; + mCallback = NULL; + mNext = NULL; + mTimerId = 0; + mDelay = 0; + mClosure = NULL; +} + +TimerImpl::~TimerImpl() +{ +} + +nsresult +TimerImpl::Init(nsTimerCallbackFunc aFunc, + void *aClosure, +// PRBool aRepeat, + PRUint32 aDelay) +{ + mFunc = aFunc; + mClosure = aClosure; + // mRepeat = aRepeat; + + printf("TimerImpl::Init() not implemented\n"); + +#ifdef RHAPSODY_NEEDS_TO_IMPLEMENT_THIS + mTimerId = XtAppAddTimeOut(gAppContext, aDelay,(XtTimerCallbackProc)nsTimerExpired, this); +#endif + + return Init(aDelay); +} + +nsresult +TimerImpl::Init(nsITimerCallback *aCallback, +// PRBool aRepeat, + PRUint32 aDelay) +{ + mCallback = aCallback; + // mRepeat = aRepeat; + +printf("TimerImpl::Init() not implmented.\n"); + +#ifdef RHAPSODY_NEEDS_TO_IMPLEMENT_THIS + mTimerId = XtAppAddTimeOut(gAppContext, aDelay, (XtTimerCallbackProc)nsTimerExpired, this); +#endif + + return Init(aDelay); +} + +nsresult +TimerImpl::Init(PRUint32 aDelay) +{ + mDelay = aDelay; + NS_ADDREF(this); + + return NS_OK; +} + +NS_IMPL_ISUPPORTS(TimerImpl, kITimerIID) + + +void +TimerImpl::Cancel() +{ + + printf("TimerImpl::Cancel() not implemented.\n"); + +#ifdef RHAPSODY_NEEDS_TO_IMPLEMENT_THIS + XtRemoveTimeOut(mTimerId); +#endif +} + +NS_GFX nsresult NS_NewTimer(nsITimer** aInstancePtrResult) +{ + NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); + if (nsnull == aInstancePtrResult) { + return NS_ERROR_NULL_POINTER; + } + + TimerImpl *timer = new TimerImpl(); + if (nsnull == timer) { + return NS_ERROR_OUT_OF_MEMORY; + } + + return timer->QueryInterface(kITimerIID, (void **) aInstancePtrResult); +} + + +void nsTimerExpired(void *aCallData) +{ + TimerImpl* timer = (TimerImpl *)aCallData; + timer->FireTimeout(); +} diff --git a/mozilla/gfx/src/windows/nsTimer.cpp b/mozilla/gfx/src/windows/nsTimer.cpp new file mode 100644 index 00000000000..b652feecb70 --- /dev/null +++ b/mozilla/gfx/src/windows/nsTimer.cpp @@ -0,0 +1,362 @@ +/* -*- 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 "nsITimerCallback.h" +#include "nsCRT.h" +#include "prlog.h" +#include +#include +#include + +static NS_DEFINE_IID(kITimerIID, NS_ITIMER_IID); + +/* + * Implementation of timers lifted from Windows front-end file timer.cpp + */ +class TimerImpl : public nsITimer { +public: + static TimerImpl *gTimerList; + static UINT gWindowsTimer; + static DWORD gNextFire; + + static void ProcessTimeouts(DWORD aNow); + static void SyncTimeoutPeriod(DWORD aTickCount); + +public: + TimerImpl(); + virtual ~TimerImpl(); + + virtual nsresult Init(nsTimerCallbackFunc aFunc, + void *aClosure, +// PRBool aRepeat, + PRUint32 aDelay); + + virtual nsresult Init(nsITimerCallback *aCallback, +// PRBool aRepeat, + PRUint32 aDelay); + + NS_DECL_ISUPPORTS + + virtual void Cancel(); + void Fire(DWORD aNow); + + virtual PRUint32 GetDelay() { return mDelay; } + virtual void SetDelay(PRUint32 aDelay) {}; + + virtual void* GetClosure() { return mClosure; } + +private: + nsresult Init(PRUint32 aDelay); + + PRUint32 mDelay; + nsTimerCallbackFunc mFunc; + void *mClosure; + nsITimerCallback *mCallback; + DWORD mFireTime; + // PRBool mRepeat; + TimerImpl *mNext; +}; + +TimerImpl *TimerImpl::gTimerList = NULL; +UINT TimerImpl::gWindowsTimer = 0; +DWORD TimerImpl::gNextFire = (DWORD)-1; + +void CALLBACK FireTimeout(HWND aWindow, + UINT aMessage, + UINT aTimerID, + DWORD aTime) +{ + static BOOL bCanEnter = TRUE; + + // Don't allow old timer messages in here. + if(aMessage != WM_TIMER) { + PR_ASSERT(0); + return; + } + + if(aTimerID != TimerImpl::gWindowsTimer) { + return; + } + + // Block only one entry into this function, or else. + if(bCanEnter) { + bCanEnter = FALSE; + // see if we need to fork off any timeout functions + if(TimerImpl::gTimerList) { + TimerImpl::ProcessTimeouts(aTime); + } + bCanEnter = TRUE; + } +} + +// Function to correctly have the timer be set. +void +TimerImpl::SyncTimeoutPeriod(DWORD aTickCount) +{ + // May want us to set tick count ourselves. + if(aTickCount == 0) { + aTickCount = ::GetTickCount(); + } + + // If there's no list, we should clear the timer. + if(!gTimerList) { + if(gWindowsTimer) { + ::KillTimer(NULL, gWindowsTimer); + gWindowsTimer = 0; + gNextFire = (DWORD)-1; + } + } + else { + // See if we need to clear the current timer. + // Curcumstances are that if the timer will not + // fire on time for the next timeout. + BOOL bSetTimer = FALSE; + TimerImpl *pTimeout = gTimerList; + if(gWindowsTimer) { + if(pTimeout->mFireTime != gNextFire) { + ::KillTimer(NULL, gWindowsTimer); + gWindowsTimer = 0; + gNextFire = (DWORD)-1; + + // Set the timer. + bSetTimer = TRUE; + } + } + else { + // No timer set, attempt. + bSetTimer = TRUE; + } + + if(bSetTimer) { + DWORD dwFireWhen = pTimeout->mFireTime > aTickCount ? + pTimeout->mFireTime - aTickCount : 0; + if(dwFireWhen > UINT_MAX) { + dwFireWhen = UINT_MAX; + } + UINT uFireWhen = (UINT)dwFireWhen; + + PR_ASSERT(gWindowsTimer == 0); + gWindowsTimer = ::SetTimer(NULL, 0, uFireWhen, (TIMERPROC)FireTimeout); + + if(gWindowsTimer) { + // Set the fire time. + gNextFire = pTimeout->mFireTime; + } + } + } +} + +// Walk down the timeout list and launch anyone appropriate +void +TimerImpl::ProcessTimeouts(DWORD aNow) +{ + TimerImpl *p = gTimerList; + if(aNow == 0) { + aNow = ::GetTickCount(); + } + + BOOL bCalledSync = FALSE; + + // loop over all entries + while(p) { + // send it + if(p->mFireTime < aNow) { + // Make sure that the timer cannot be deleted during the + // Fire(...) call which may release *all* other references + // to p... + NS_ADDREF(p); + p->Fire(aNow); + + // Clear the timer. + // Period synced. + p->Cancel(); + bCalledSync = TRUE; + NS_RELEASE(p); + + // Reset the loop (can't look at p->pNext now, and called + // code may have added/cleared timers). + // (could do this by going recursive and returning). + p = gTimerList; + } else { + // Make sure we fire an timer. + // Also, we need to check to see if things are backing up (they + // may be asking to be fired long before we ever get to them, + // and we don't want to pass in negative values to the real + // timer code, or it takes days to fire.... + if(bCalledSync == FALSE) { + SyncTimeoutPeriod(aNow); + bCalledSync = TRUE; + } + // Get next timer. + p = p->mNext; + } + } +} + + +TimerImpl::TimerImpl() +{ + NS_INIT_REFCNT(); + mFunc = NULL; + mCallback = NULL; + mNext = NULL; + mClosure = nsnull; +} + +TimerImpl::~TimerImpl() +{ + Cancel(); + NS_IF_RELEASE(mCallback); +} + +nsresult +TimerImpl::Init(nsTimerCallbackFunc aFunc, + void *aClosure, +// PRBool aRepeat, + PRUint32 aDelay) +{ + mFunc = aFunc; + mClosure = aClosure; + // mRepeat = aRepeat; + + return Init(aDelay); +} + +nsresult +TimerImpl::Init(nsITimerCallback *aCallback, +// PRBool aRepeat, + PRUint32 aDelay) +{ + mCallback = aCallback; + NS_ADDREF(mCallback); + // mRepeat = aRepeat; + + return Init(aDelay); +} + +nsresult +TimerImpl::Init(PRUint32 aDelay) +{ + DWORD dwNow = ::GetTickCount(); + + mDelay = aDelay; + mFireTime = (DWORD) aDelay + dwNow; + mNext = NULL; + + // add it to the list + if(!gTimerList) { + // no list add it + gTimerList = this; + } + else { + + // is it before everything else on the list? + if(mFireTime < gTimerList->mFireTime) { + + mNext = gTimerList; + gTimerList = this; + + } else { + + TimerImpl * pPrev = gTimerList; + TimerImpl * pCurrent = gTimerList; + + while(pCurrent && (pCurrent->mFireTime <= mFireTime)) { + pPrev = pCurrent; + pCurrent = pCurrent->mNext; + } + + PR_ASSERT(pPrev); + + // insert it after pPrev (this could be at the end of the list) + mNext = pPrev->mNext; + pPrev->mNext = this; + + } + + } + + NS_ADDREF(this); + + // Sync the timer fire period. + SyncTimeoutPeriod(dwNow); + + return NS_OK; +} + +NS_IMPL_ISUPPORTS(TimerImpl, kITimerIID) + +void +TimerImpl::Fire(DWORD aNow) +{ + if (mFunc != NULL) { + (*mFunc)(this, mClosure); + } + else if (mCallback != NULL) { + mCallback->Notify(this); + } +} + +void +TimerImpl::Cancel() +{ + TimerImpl *me = this; + + if(gTimerList == this) { + + // first element in the list lossage + gTimerList = mNext; + + } else { + + // walk until no next pointer + for(TimerImpl * p = gTimerList; p && p->mNext && (p->mNext != this); p = p->mNext) + ; + + // if we found something valid pull it out of the list + if(p && p->mNext && p->mNext == this) { + p->mNext = mNext; + + } else { + // get out before we delete something that looks bogus + return; + } + + } + + // if we got here it must have been a valid element so trash it + NS_RELEASE(me); + + // If there's now no be sure to clear the timer. + SyncTimeoutPeriod(0); +} + +NS_GFX nsresult NS_NewTimer(nsITimer** aInstancePtrResult) +{ + NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); + if (nsnull == aInstancePtrResult) { + return NS_ERROR_NULL_POINTER; + } + + TimerImpl *timer = new TimerImpl(); + if (nsnull == timer) { + return NS_ERROR_OUT_OF_MEMORY; + } + + return timer->QueryInterface(kITimerIID, (void **) aInstancePtrResult); +} diff --git a/mozilla/gfx/src/xlib/nsTimer.cpp b/mozilla/gfx/src/xlib/nsTimer.cpp new file mode 100644 index 00000000000..2fab789ae23 --- /dev/null +++ b/mozilla/gfx/src/xlib/nsTimer.cpp @@ -0,0 +1,295 @@ +/* -*- 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 +#include +#include +#include "nsITimer.h" +#include "nsITimerCallback.h" +#include "prlog.h" + +static NS_DEFINE_IID(kITimerIID, NS_ITIMER_IID); + +extern "C" int NS_TimeToNextTimeout(struct timeval *aTimer); +extern "C" void NS_ProcessTimeouts(void); + +class TimerImpl : public nsITimer +{ +public: + static TimerImpl *gTimerList; + static struct timeval gTimer; + static struct timeval gNextFire; + static void ProcessTimeouts(struct timeval *aNow); + TimerImpl(); + ~TimerImpl(); + + virtual nsresult Init(nsTimerCallbackFunc aFunc, + void *aClosure, + PRUint32 aDelay); + + virtual nsresult Init(nsITimerCallback *aCallback, + PRUint32 aDelay); + + NS_DECL_ISUPPORTS + + virtual void Cancel(); + void Fire(struct timeval *aNow); + + virtual PRUint32 GetDelay() { return 0; }; + virtual void SetDelay(PRUint32 aDelay) {}; + virtual void *GetClosure() { return mClosure; } + + // this needs to be public so that the mainloop can + // find the next fire time... + struct timeval mFireTime; + TimerImpl *mNext; + +private: + nsresult Init(PRUint32 aDelay); + nsTimerCallbackFunc mFunc; + void *mClosure; + PRUint32 mDelay; + nsITimerCallback *mCallback; + +}; + + +TimerImpl *TimerImpl::gTimerList = NULL; +struct timeval TimerImpl::gTimer = {0, 0}; +struct timeval TimerImpl::gNextFire = {0, 0}; + +TimerImpl::TimerImpl() +{ + //printf("TimerImpl::TimerImpl (%p) called.\n", + //this); + NS_INIT_REFCNT(); + mFunc = NULL; + mCallback = NULL; + mNext = NULL; + mClosure = NULL; +} + +TimerImpl::~TimerImpl() +{ + //printf("TimerImpl::~TimerImpl (%p) called.\n", + // this); + Cancel(); + NS_IF_RELEASE(mCallback); +} + +NS_IMPL_ISUPPORTS(TimerImpl, kITimerIID) + +nsresult +TimerImpl::Init(nsTimerCallbackFunc aFunc, + void *aClosure, + PRUint32 aDelay) +{ + mFunc = aFunc; + mClosure = aClosure; + return Init(aDelay); +} + +nsresult +TimerImpl::Init(nsITimerCallback *aCallback, + PRUint32 aDelay) +{ + mCallback = aCallback; + NS_ADDREF(mCallback); + + return Init(aDelay); +} + +nsresult +TimerImpl::Init(PRUint32 aDelay) +{ + struct timeval Now; + // printf("TimerImpl::Init (%p) called with delay %d\n", + //this, aDelay); + // get the cuurent time + gettimeofday(&Now, NULL); + mFireTime.tv_sec = Now.tv_sec + (aDelay / 1000); + mFireTime.tv_usec = Now.tv_usec + (aDelay * 1000); + //printf("fire set to %ld / %ld\n", + //mFireTime.tv_sec, mFireTime.tv_usec); + // set the next pointer to nothing. + mNext = NULL; + // add ourself to the list + if (!gTimerList) { + // no list here. I'm the start! + //printf("This is the beginning of the list..\n"); + gTimerList = this; + } + else { + // is it before everything else on the list? + if ((mFireTime.tv_sec < gTimerList->mFireTime.tv_sec) && + (mFireTime.tv_usec < gTimerList->mFireTime.tv_usec)) { + // printf("This is before the head of the list...\n"); + mNext = gTimerList; + gTimerList = this; + } + else { + TimerImpl *pPrev = gTimerList; + TimerImpl *pCurrent = gTimerList; + while (pCurrent && ((pCurrent->mFireTime.tv_sec <= mFireTime.tv_sec) && + (pCurrent->mFireTime.tv_usec <= mFireTime.tv_usec))) { + pPrev = pCurrent; + pCurrent = pCurrent->mNext; + } + PR_ASSERT(pPrev); + + // isnert it after pPrev ( this could be at the end of the list) + mNext = pPrev->mNext; + pPrev->mNext = this; + } + } + NS_ADDREF(this); + return NS_OK; +} + +void +TimerImpl::Fire(struct timeval *aNow) +{ + // printf("TimerImpl::Fire (%p) called at %ld / %ld\n", + // this, + //aNow->tv_sec, aNow->tv_usec); + if (mFunc != NULL) { + (*mFunc)(this, mClosure); + } + else if (mCallback != NULL) { + mCallback->Notify(this); + } +} + +void +TimerImpl::Cancel() +{ + TimerImpl *me = this; + TimerImpl *p; + // printf("TimerImpl::Cancel (%p) called.\n", + // this); + if (gTimerList == this) { + // first element in the list lossage... + gTimerList = mNext; + } + else { + // walk until there's no next pointer + for (p = gTimerList; p && p->mNext && (p->mNext != this); p = p->mNext) + ; + + // if we found something valid pull it out of the list + if (p && p->mNext && p->mNext == this) { + p->mNext = mNext; + } + else { + // get out before we delete something that looks bogus + return; + } + } + // if we got here it must have been a valid element so trash it + NS_RELEASE(me); + +} + +void +TimerImpl::ProcessTimeouts(struct timeval *aNow) +{ + TimerImpl *p = gTimerList; + if (aNow->tv_sec == 0 && + aNow->tv_usec == 0) { + gettimeofday(aNow, NULL); + } + // printf("TimerImpl::ProcessTimeouts called at %ld / %ld\n", + // aNow->tv_sec, aNow->tv_usec); + while (p) { + if ((p->mFireTime.tv_sec < aNow->tv_sec) || + ((p->mFireTime.tv_sec == aNow->tv_sec) && + (p->mFireTime.tv_usec <= aNow->tv_usec))) { + // Make sure that the timer cannot be deleted during the + // Fire(...) call which may release *all* other references + // to p... + //printf("Firing timeout for (%p)\n", + // p); + NS_ADDREF(p); + p->Fire(aNow); + // Clear the timer. + // Period synced. + p->Cancel(); + NS_RELEASE(p); + // Reset the loop (can't look at p->pNext now, and called + // code may have added/cleared timers). + // (could do this by going recursive and returning). + p = gTimerList; + } + else { + p = p->mNext; + } + } +} + +NS_GFX nsresult NS_NewTimer(nsITimer **aInstancePtrResult) +{ + NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); + if (nsnull == aInstancePtrResult) { + return NS_ERROR_NULL_POINTER; + } + + TimerImpl *timer = new TimerImpl(); + if (nsnull == timer) { + return NS_ERROR_OUT_OF_MEMORY; + } + + return timer->QueryInterface(kITimerIID, (void **) aInstancePtrResult); +} + +int NS_TimeToNextTimeout(struct timeval *aTimer) { + TimerImpl *timer; + timer = TimerImpl::gTimerList; + if (timer) { + if ((timer->mFireTime.tv_sec < aTimer->tv_sec) || + ((timer->mFireTime.tv_sec == aTimer->tv_sec) && + (timer->mFireTime.tv_usec <= aTimer->tv_usec))) { + aTimer->tv_sec = 0; + aTimer->tv_usec = 0; + return 1; + } + else { + aTimer->tv_sec -= timer->mFireTime.tv_sec; + // handle the overflow case + if (aTimer->tv_usec < timer->mFireTime.tv_usec) { + aTimer->tv_usec = timer->mFireTime.tv_usec - aTimer->tv_usec; + // make sure we don't go past zero when we decrement + if (aTimer->tv_sec) + aTimer->tv_sec--; + } + else { + aTimer->tv_usec -= timer->mFireTime.tv_usec; + } + return 1; + } + } + else { + return 0; + } +} + +void NS_ProcessTimeouts(void) { + struct timeval now; + now.tv_sec = 0; + now.tv_usec = 0; + TimerImpl::ProcessTimeouts(&now); +} diff --git a/mozilla/widget/public/nsRepeater.h b/mozilla/widget/public/nsRepeater.h deleted file mode 100644 index d72d45c1f2f..00000000000 --- a/mozilla/widget/public/nsRepeater.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- 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. - */ - -#ifndef nsRepeater_h___ -#define nsRepeater_h___ - -#include "nscore.h" - -class EventRecord; - -class NS_BASE Repeater { - public: - - Repeater(); - virtual ~Repeater(); - - virtual void RepeatAction(const EventRecord &aMacEvent) = 0; - - void StartRepeating(); - void StopRepeating(); - void StartIdling(); - void StopIdling(); - - static void DoRepeaters(const EventRecord &aMacEvent); - static void DoIdlers(const EventRecord &aMacEvent); - - protected: - - void AddToRepeatList(); - void RemoveFromRepeatList(); - void AddToIdleList(); - void RemoveFromIdleList(); - - static Repeater* sRepeaters; - static Repeater* sIdlers; - - bool mRepeating; - bool mIdling; - Repeater* mPrevRptr; - Repeater* mNextRptr; - Repeater* mPrevIdlr; - Repeater* mNextIdlr; -}; - -#endif \ No newline at end of file diff --git a/mozilla/widget/src/mac/nsRepeater.cpp b/mozilla/widget/src/mac/nsRepeater.cpp deleted file mode 100644 index 5a93b4d2970..00000000000 --- a/mozilla/widget/src/mac/nsRepeater.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* -*- 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 "nsRepeater.h" - -Repeater* Repeater::sRepeaters = 0; -Repeater* Repeater::sIdlers = 0; - -Repeater::Repeater() -{ - mRepeating = false; - mIdling = false; - mPrevRptr = 0; - mNextRptr = 0; - mPrevIdlr = 0; - mNextIdlr = 0; -} - -Repeater::~Repeater() -{ - if (mRepeating) RemoveFromRepeatList(); - if (mIdling) RemoveFromIdleList(); -} - -// protected helper functs - -//---------------------------------------------------------------------------- -void Repeater::AddToRepeatList() -{ - if (sRepeaters) - { - sRepeaters->mPrevRptr = this; - mNextRptr = sRepeaters; - } - sRepeaters = this; -} - -//---------------------------------------------------------------------------- -void Repeater::RemoveFromRepeatList() -{ - if (sRepeaters == this) sRepeaters = mNextRptr; - if (mPrevRptr) mPrevRptr->mNextRptr = mNextRptr; - if (mNextRptr) mNextRptr->mPrevRptr = mPrevRptr; - mPrevRptr = 0; - mNextRptr = 0; -} - -//---------------------------------------------------------------------------- -void Repeater::AddToIdleList() -{ - if (sIdlers) - { - sIdlers->mPrevIdlr = this; - mNextIdlr = sIdlers; - } - sIdlers = this; -} - -//---------------------------------------------------------------------------- -void Repeater::RemoveFromIdleList() -{ - if (sIdlers == this) sIdlers = mNextIdlr; - if (mPrevIdlr) mPrevIdlr->mNextIdlr = mNextIdlr; - if (mNextIdlr) mNextIdlr->mPrevIdlr = mPrevIdlr; - mPrevIdlr = 0; - mNextIdlr = 0; -} - -// repeater methods -//---------------------------------------------------------------------------- - -void Repeater::StartRepeating() -{ - if (!mRepeating) - { - AddToRepeatList(); - mRepeating = true; - } -} - -void Repeater::StopRepeating() -{ - if (mRepeating) - { - RemoveFromRepeatList(); - mRepeating = false; - } -} - -void Repeater::DoRepeaters(const EventRecord &aMacEvent) -{ - Repeater* theRepeater = sRepeaters; - while (theRepeater) - { - theRepeater->RepeatAction(aMacEvent); - theRepeater = theRepeater->mNextRptr; - } -} - -// idler methods - -void Repeater::StartIdling() -{ - if (!mIdling) - { - AddToIdleList(); - mIdling = true; - } -} - -void Repeater::StopIdling() -{ - if (mIdling) - { - RemoveFromIdleList(); - mIdling = false; - } -} - -void Repeater::DoIdlers(const EventRecord &aMacEvent) -{ - Repeater* theIdler = sIdlers; - while (theIdler) - { - theIdler->RepeatAction(aMacEvent); - theIdler = theIdler->mNextIdlr; - } -} - - - - diff --git a/mozilla/xpcom/base/MANIFEST b/mozilla/xpcom/base/MANIFEST deleted file mode 100644 index bdea888b0b6..00000000000 --- a/mozilla/xpcom/base/MANIFEST +++ /dev/null @@ -1,12 +0,0 @@ -nsAgg.h -nsIAllocator.h -nsCOMPtr.h -nsCom.h -nsDebug.h -nsError.h -nsID.h -nsIID.h -nsIPtr.h -nsISupportsUtils.h -nsTraceRefcnt.h -nscore.h diff --git a/mozilla/xpcom/components/MANIFEST b/mozilla/xpcom/components/MANIFEST deleted file mode 100644 index 7320b115b61..00000000000 --- a/mozilla/xpcom/components/MANIFEST +++ /dev/null @@ -1,8 +0,0 @@ -nsIComponentManager.h -nsIFactory.h -nsIGenericFactory.h -nsIRegistry.h -nsIServiceManager.h -nsIServiceProvider.h -nsRepository.h -nsXPComFactory.h diff --git a/mozilla/xpcom/ds/MANIFEST b/mozilla/xpcom/ds/MANIFEST deleted file mode 100644 index 19d7ace1828..00000000000 --- a/mozilla/xpcom/ds/MANIFEST +++ /dev/null @@ -1,32 +0,0 @@ -nsBTree.h -nsCRT.h -nsDeque.h -nsEnumeratorUtils.h -nsHashtable.h -nsIArena.h -nsIAtom.h -nsIBuffer.h -nsIByteBuffer.h -nsIObserver.h -nsIObserverList.h -nsIObserverService.h -nsIPageManager.h -nsIProperties.h -nsISimpleEnumerator.h -nsISizeOfHandler.h -nsIString.h -nsISupportsArray.h -nsIUnicharBuffer.h -nsIVariant.h -nsInt64.h -nsQuickSort.h -nsRBTree.h -nsStr.h -nsString.h -nsString2.h -nsTime.h -nsUnitConversion.h -nsVector.h -nsVoidArray.h -nsXPIDLString.h -plvector.h diff --git a/mozilla/xpcom/idl/nsIFileSpec.idl b/mozilla/xpcom/idl/nsIFileSpec.idl deleted file mode 100644 index f3101296473..00000000000 --- a/mozilla/xpcom/idl/nsIFileSpec.idl +++ /dev/null @@ -1,157 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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. - */ - -// This is the only correct cross-platform way to specify a file. -// Strings are not such a way. If you grew up on windows or unix, you -// may think they are. Welcome to reality. - -#include "nsISupports.idl" - -%{C++ -#include "nscore.h" // for NS_BASE - -// Start commenting out the C++ versions of the below in the output header -#if 0 -%} -[ref] native nsStringRef(nsString); -native StandardFilterMask(nsIFileSpec::StandardFilterMask); -%{C++ -// End commenting out the C++ versions of the above in the output header -#endif -%} - -interface nsIFileURL; -interface nsIFilePath; - -[scriptable, uuid(d8c0a080-0868-11d3-915f-d9d889d48e3c)] -interface nsIFileSpec : nsISupports -{ - void fromFileSpec([const] in nsIFileSpec original); -%{C++ - // - // The "choose" functions present the file picker UI in order to set the - // value of the file spec. -%} - void chooseOutputFile(in string windowTitle, in string suggestedLeafName); - -%{C++ - // The mask for standard filters is given as follows: - enum StandardFilterMask - { - eAllReadable = (1<<0) - , eHTMLFiles = (1<<1) - , eXMLFiles = (1<<2) - , eImageFiles = (1<<3) - , eAllFiles = (1<<4) - - // Mask containing all the above default filters - , eAllStandardFilters = ( - eAllReadable - | eHTMLFiles - | eXMLFiles - | eImageFiles - | eAllFiles) - - // The "extra filter" bit should be set if the "extra filter" - // is passed in to chooseInputFile. - , eExtraFilter = (1<<31) - }; - enum { kNumStandardFilters = 5 }; -%} - void chooseInputFile( - in string title - , in StandardFilterMask standardFilterMask - , in string extraFilterTitle - , in string extraFilter - ); - void chooseDirectory(in string title); - - attribute string URLString; - attribute string UnixStyleFilePath; - attribute string PersistentDescriptorString; - attribute string NativePath; - - readonly attribute string NSPRPath; - - void error(); - - boolean isValid(); - boolean failed(); - - attribute string LeafName; - - readonly attribute nsIFileSpec Parent; - - void makeUnique(); - void makeUniqueWithSuggestedName(in string suggestedName); - - readonly attribute unsigned long ModDate; - boolean modDateChanged(in unsigned long oldStamp); - - boolean isDirectory(); - boolean isFile(); - boolean exists(); - - readonly attribute unsigned long FileSize; - readonly attribute unsigned long DiskSpaceAvailable; - - void AppendRelativeUnixPath(in string relativePath); - - void createDir(); - void rename([const] in string newLeafName); - void copyToDir([const] in nsIFileSpec newParentDir); - void moveToDir([const] in nsIFileSpec newParentDir); - void execute([const] in string args); - - void openStreamForReading(); - void openStreamForWriting(); - void openStreamForReadingAndWriting(); - void closeStream(); - boolean isStreamOpen(); - - boolean eof(); - long read(inout string buffer, in long requestedCount); - void readLine(inout string line, in long bufferSize, out boolean wasTruncated); -%{C++ - // Check eof() before each call. - // CAUTION: false result only indicates line was truncated - // to fit buffer, or an error occurred (OTHER THAN eof). -%} - long write(in string data, in long requestedCount); - void flush(); - - void seek(in long offset); - long tell(); - void endline(); - -}; - -[scriptable, uuid(d8c0a083-0868-11d3-915f-d9d889d48e3c)] -interface nsIDirectoryIterator : nsISupports -{ - void Init(in nsIFileSpec parent); - boolean exists(); - void next(); - readonly attribute nsIFileSpec currentSpec; -}; - -%{C++ -// Factory methods -NS_BASE nsresult NS_NewFileSpec(nsIFileSpec** result); -NS_BASE nsresult NS_NewDirectoryIterator(nsIDirectoryIterator** result); -%} diff --git a/mozilla/xpcom/io/MANIFEST b/mozilla/xpcom/io/MANIFEST deleted file mode 100644 index 700dbf1c768..00000000000 --- a/mozilla/xpcom/io/MANIFEST +++ /dev/null @@ -1,13 +0,0 @@ -nsEscape.h -nsFileSpec.h -nsFileSpecStreaming.h -nsFileStream.h -nsIFileWidget.h -nsIBaseStream.h -nsIByteBufferInputStream.h -nsIFileStream.h -nsIInputStream.h -nsIOutputStream.h -nsIStringStream.h -nsIUnicharInputStream.h -nsSpecialSystemDirectory.h diff --git a/mozilla/xpcom/io/nsIFileSpec.idl b/mozilla/xpcom/io/nsIFileSpec.idl deleted file mode 100644 index 8ad2278ab4e..00000000000 --- a/mozilla/xpcom/io/nsIFileSpec.idl +++ /dev/null @@ -1,166 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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. - */ - -// This is the only correct cross-platform way to specify a file. -// Strings are not such a way. If you grew up on windows or unix, you -// may think they are. Welcome to reality. - -#include "nsISupports.idl" - -%{C++ -#include "nscore.h" // for NS_BASE - -// Start commenting out the C++ versions of the below in the output header -#if 0 -%} -[ref] native nsStringRef(nsString); -native StandardFilterMask(nsIFileSpec::StandardFilterMask); -%{C++ -// End commenting out the C++ versions of the above in the output header -#endif -%} - -interface nsIFileURL; -interface nsIFilePath; - -[scriptable, uuid(d8c0a080-0868-11d3-915f-d9d889d48e3c)] -interface nsIFileSpec : nsISupports -{ - void fromFileSpec([const] in nsIFileSpec original); -%{C++ -// File Widget stuff depends on widget/public/nsIWidget.h -// Until the following is moved out of xpcom/ ifdeffing it -// out. -#ifdef FILE_WIDGET_DEPENDENCY -%} -%{C++ - // - // The "choose" functions present the file picker UI in order to set the - // value of the file spec. -%} - void chooseOutputFile(in string windowTitle, in string suggestedLeafName); - -%{C++ - // The mask for standard filters is given as follows: - enum StandardFilterMask - { - eAllReadable = (1<<0) - , eHTMLFiles = (1<<1) - , eXMLFiles = (1<<2) - , eImageFiles = (1<<3) - , eAllFiles = (1<<4) - - // Mask containing all the above default filters - , eAllStandardFilters = ( - eAllReadable - | eHTMLFiles - | eXMLFiles - | eImageFiles - | eAllFiles) - - // The "extra filter" bit should be set if the "extra filter" - // is passed in to chooseInputFile. - , eExtraFilter = (1<<31) - }; - enum { kNumStandardFilters = 5 }; -%} - void chooseInputFile( - in string title - , in StandardFilterMask standardFilterMask - , in string extraFilterTitle - , in string extraFilter - ); - void chooseDirectory(in string title); -%{C++ -#endif /* FILE_WIDGET_DEPENDENCY */ -%} - - attribute string URLString; - attribute string UnixStyleFilePath; - attribute string PersistentDescriptorString; - attribute string NativePath; - - readonly attribute string NSPRPath; - - void error(); - - boolean isValid(); - boolean failed(); - - attribute string LeafName; - - readonly attribute nsIFileSpec Parent; - - void makeUnique(); - void makeUniqueWithSuggestedName(in string suggestedName); - - readonly attribute unsigned long ModDate; - boolean modDateChanged(in unsigned long oldStamp); - - boolean isDirectory(); - boolean isFile(); - boolean exists(); - - readonly attribute unsigned long FileSize; - readonly attribute unsigned long DiskSpaceAvailable; - - void AppendRelativeUnixPath(in string relativePath); - - void createDir(); - void rename([const] in string newLeafName); - void copyToDir([const] in nsIFileSpec newParentDir); - void moveToDir([const] in nsIFileSpec newParentDir); - void execute([const] in string args); - - void openStreamForReading(); - void openStreamForWriting(); - void openStreamForReadingAndWriting(); - void closeStream(); - boolean isStreamOpen(); - - boolean eof(); - long read(inout string buffer, in long requestedCount); - void readLine(inout string line, in long bufferSize, out boolean wasTruncated); -%{C++ - // Check eof() before each call. - // CAUTION: false result only indicates line was truncated - // to fit buffer, or an error occurred (OTHER THAN eof). -%} - long write(in string data, in long requestedCount); - void flush(); - - void seek(in long offset); - long tell(); - void endline(); - -}; - -[scriptable, uuid(d8c0a083-0868-11d3-915f-d9d889d48e3c)] -interface nsIDirectoryIterator : nsISupports -{ - void Init(in nsIFileSpec parent); - boolean exists(); - void next(); - readonly attribute nsIFileSpec currentSpec; -}; - -%{C++ -// Factory methods -NS_BASE nsresult NS_NewFileSpec(nsIFileSpec** result); -NS_BASE nsresult NS_NewDirectoryIterator(nsIDirectoryIterator** result); -%} diff --git a/mozilla/xpcom/io/nsIFileWidget.h b/mozilla/xpcom/io/nsIFileWidget.h deleted file mode 100644 index 5f263eb8498..00000000000 --- a/mozilla/xpcom/io/nsIFileWidget.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -*- 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. - */ - -#ifndef nsIFileWidget_h__ -#define nsIFileWidget_h__ - -#include "nsString.h" -#include "nsFileSpec.h" - -class nsIWidget; -class nsIDeviceContext; -class nsIAppShell; -class nsIToolkit; - -// {F8030015-C342-11d1-97F0-00609703C14E} -#define NS_IFILEWIDGET_IID \ -{ 0xf8030015, 0xc342, 0x11d1, { 0x97, 0xf0, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } } - - -/** - * File selector mode - */ - -enum nsFileDlgMode { - /// Load a file or directory - eMode_load, - /// Save a file or directory - eMode_save, - /// Select a fodler/directory - eMode_getfolder - }; - - -enum nsFileDlgResults { - nsFileDlgResults_Cancel, // User hit cancel, ignore selection - nsFileDlgResults_OK, // User hit Ok, process selection - nsFileDlgResults_Replace // User acknowledged file already exists so ok to replace, process selection -}; - -/** - * File selector widget. - * Modally selects files for loading or saving from a list. - */ - -class nsIFileWidget : public nsISupports -{ - -public: - - - NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFILEWIDGET_IID) - - /** - * Create the file filter. This differs from the standard - * widget Create method because it passes in the mode - * - * @param aParent the parent to place this widget into - * @param aTitle The title for the file widget - * @param aMode load or save - * @return void - * - */ - NS_IMETHOD Create(nsIWidget *aParent, - const nsString& aTitle, - nsFileDlgMode aMode, - nsIDeviceContext *aContext = nsnull, - nsIAppShell *aAppShell = nsnull, - nsIToolkit *aToolkit = nsnull, - void *aInitData = nsnull) = 0; - - - /** - * Set the list of file filters - * - * @param aNumberOfFilter number of filters. - * @param aTitle array of filter titles - * @param aFilter array of filters to associate with titles - * @return void - * - */ - - NS_IMETHOD SetFilterList(PRUint32 aNumberOfFilters,const nsString aTitles[],const nsString aFilters[]) = 0; - - /** - * Show File Dialog. The dialog is displayed modally. - * - * @return PR_TRUE if user selects OK, PR_FALSE if user selects CANCEL - * - */ - - virtual PRBool Show() = 0; - - /** - * Get the nsFileSpec for the file or directory. - * - * @param aFile on exit it contains the file or directory selected - */ - - NS_IMETHOD GetFile(nsFileSpec& aFile) = 0; - - - /** - * Set the default string that appears in file open/save dialog - * - * @param aString the name of the file - * @return void - * - */ - NS_IMETHOD SetDefaultString(const nsString& aString) = 0; - - /** - * Set the directory that the file open/save dialog initially displays - * - * @param aDirectory the name of the directory - * @return void - * - */ - NS_IMETHOD SetDisplayDirectory(const nsFileSpec& aDirectory) = 0; - - /** - * Get the directory that the file open/save dialog was last displaying - * - * @param aDirectory the name of the directory - * @return void - * - */ - NS_IMETHOD GetDisplayDirectory(nsFileSpec& aDirectory) = 0; - - - virtual nsFileDlgResults GetFile( - nsIWidget * aParent, - const nsString & promptString, // Window title for the dialog - nsFileSpec & theFileSpec) = 0; // Populate with initial path for file dialog - - virtual nsFileDlgResults GetFolder( - nsIWidget * aParent, - const nsString & promptString, // Window title for the dialog - nsFileSpec & theFileSpec) = 0; // Populate with initial path for file dialog - - virtual nsFileDlgResults PutFile( - nsIWidget * aParent, - const nsString & promptString, // Window title for the dialog - nsFileSpec & theFileSpec) = 0; // Populate with initial path for file dialog -}; - -#endif // nsIFileWidget_h__ - diff --git a/mozilla/xpcom/macbuild/FilesTest.mcp b/mozilla/xpcom/macbuild/FilesTest.mcp deleted file mode 100644 index a1cd54affd8f7b709c915c623379ba7251fc1fbc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 83082 zcmeI531A&nxyNU2(j;BzMuF0@+_pdqEop(al(4l;7gCxwG%aP7rpav^nkFF&l)dbW zsFY23ZV2wrr-%wFi-@2oqPQT6sKpHxTtHM@`+om9XYQT3cV_Ob&3j^#(|&XQ^PO+b zobxSb=FT~pY3}G~a~!A4aoj16JLe~kTQkIQhHQb?>84yVlWIF!GOL@qx>`HB(hXf5 zXJ?vw{Gxu6r_OYo)EdXBzuj>f=(F~nb&gR{lT+!bVJ+La(0nKbO@peTrO=6x4m=y$ z0JTE(&@yNibQp95bQCljng}h2>YydiCg@;jC^QwC1RVm6ff}I`poP#NXc)8^Iv=_i z!lurl&~#`5q_i7!40JMd3Un&80$L3%fL1~4p>@y&(1p+?ka~PHbQ)9x?FF3<;X}@F zXc4p+ItiKq9S+Te=0Hb6`#@u%~a+5_4XS_!p7ilvL71E2$;4rnyA1-csg|47$xk~?YQ`-~en+Fxb;^JLE} zjg8CT%P*8yeX{lIyKmqA@crOWQbz~UfCkWj3u#P~zYK!PA;q5JPHv)Dl0S(w{%CyB zc%aza*`zwtIterd8VhN^3K|SehQ>n&LHk3)p%Egr_R{S-eZh7&uSdl7y4JQ#_kzsY z-u2a;U72;Q8aPAAbsZNnDzGJk;3%0&1d#D|B)9@id8PIo@Mwri25D=LvQ=3bf6wHS z6`|n~OPbDYs%>lP?#^^qU(l-YCzMXBYe+Adck(=#IxuQdKIq~l5R8XA_$ft~UNOBbKgys@=KcX_KD8)_r2XFKMTJ0`8sWFYlx z4b(T*EgV(X-jnHS&-A1hZtiUB=*sBMa0gOd#vE3i*__#d!v;im84Z|0H@Q2x%VoJ8 zgp=iyOH*7BbfdEKNo|J)HC1;c4(fAtD&2=^WAjz+jqc!-eysT^*UM6LGB5!9dh56O zzyREDP2Yzd-=&AtUHEb_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W8d1Xhf>c!%n?uCljApHYZt#!dJ?}IWX6X( zR$$+hYxqy2w=xr7cPzgfKCz_qoiS`o{dep~45jcnrSGJ3^?a0TTB_V*JKvv@t7q^F z@X?*p^XS2^=d!i%D?GL{>2&h+rk-x~x61Ie{hxa3cQ*BS{SELd4xn%g{BH6fUwRk` zzcr8lDfXvq>S^o9<8Nc%=zr^|cha5{*(d$-O72^J@7Z_jC-CjmQjhHp>T#S3qlc|~ zajq2YBe_GjIL@@Ijr=DW8&b8TTpJEJ5tuXw-kC3l5=RNL7_>G2N*-38VXzQ_0!(VCni^$D5 zv-K%_Ew#$>>94iRjjtRJ|763zWh(h&rvCkP-qnWx?yKq7Si`^VH29|&{(Ig{{vpGE z^Rw_zHT;P`Avf3Yt#6WkI7aDC+LN;Syn-<~B|o6*ITc`UoN=q39SuIi<2#c^l27sK MKlN9VKU4hw1vz$(2><{9 diff --git a/mozilla/xpcom/macbuild/files.prefix b/mozilla/xpcom/macbuild/files.prefix deleted file mode 100644 index e5eda421547..00000000000 --- a/mozilla/xpcom/macbuild/files.prefix +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; 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 "MacPrefix_debug.h" diff --git a/mozilla/xpcom/macbuild/filesDebug.prefix b/mozilla/xpcom/macbuild/filesDebug.prefix deleted file mode 100644 index e5eda421547..00000000000 --- a/mozilla/xpcom/macbuild/filesDebug.prefix +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; 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 "MacPrefix_debug.h" diff --git a/mozilla/xpcom/reflect/Makefile.in b/mozilla/xpcom/reflect/Makefile.in deleted file mode 100644 index 65b7e455ff6..00000000000 --- a/mozilla/xpcom/reflect/Makefile.in +++ /dev/null @@ -1,30 +0,0 @@ -#!gmake -# 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. - -DEPTH = ../.. -topsrcdir = @top_srcdir@ -VPATH = @srcdir@ -srcdir = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -DIRS = xptinfo xptcall - -ifdef ENABLE_TESTS -DIRS += tests -endif - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpcom/threads/MANIFEST b/mozilla/xpcom/threads/MANIFEST deleted file mode 100644 index bd7400d1eed..00000000000 --- a/mozilla/xpcom/threads/MANIFEST +++ /dev/null @@ -1,4 +0,0 @@ -nsAutoLock.h -nsIEventQueue.h -nsIEventQueueService.h -nsIThread.h