Bug 307168 - Use the XPCOM (NS_COM) declarations for plevent symbols, instead of the NSPR declarations, since NSPR has different configure tests and compile flags r=darin

This commit is contained in:
bsmedberg%covad.net 2005-09-15 18:29:21 +00:00
parent c798a330a8
commit 3c7a35a01a
2 changed files with 54 additions and 52 deletions

View File

@ -73,8 +73,8 @@
#include <CoreFoundation/CoreFoundation.h>
#define MAC_USE_CFRUNLOOPSOURCE
#elif defined(TARGET_CARBON)
// #include <CarbonEvents.h>
// #define MAC_USE_CARBON_EVENT
/* #include <CarbonEvents.h> */
/* #define MAC_USE_CARBON_EVENT */
#include <CoreFoundation/CoreFoundation.h>
#define MAC_USE_CFRUNLOOPSOURCE
#endif
@ -278,7 +278,7 @@ static PLEventQueue * _pl_CreateEventQueue(const char *name,
return NULL;
}
PR_IMPLEMENT(PLEventQueue*)
PLEventQueue*
PL_CreateEventQueue(const char* name, PRThread* handlerThread)
{
return( _pl_CreateEventQueue( name, handlerThread, EventQueueIsNative ));
@ -296,7 +296,7 @@ PL_CreateMonitoredEventQueue(const char *name, PRThread *handlerThread)
return( _pl_CreateEventQueue( name, handlerThread, EventQueueIsMonitored ));
}
PR_IMPLEMENT(PRMonitor*)
PRMonitor*
PL_GetEventQueueMonitor(PLEventQueue* self)
{
return self->monitor;
@ -309,7 +309,7 @@ _pl_destroyEvent(PLEvent* event, void* data, PLEventQueue* queue)
PL_DestroyEvent(event);
}
PR_IMPLEMENT(void)
void
PL_DestroyEventQueue(PLEventQueue* self)
{
PR_EnterMonitor(self->monitor);
@ -327,7 +327,7 @@ PL_DestroyEventQueue(PLEventQueue* self)
}
PR_IMPLEMENT(PRStatus)
PRStatus
PL_PostEvent(PLEventQueue* self, PLEvent* event)
{
PRStatus err = PR_SUCCESS;
@ -369,7 +369,7 @@ error:
return err;
}
PR_IMPLEMENT(void*)
void*
PL_PostSynchronousEvent(PLEventQueue* self, PLEvent* event)
{
void* result;
@ -439,7 +439,7 @@ PL_PostSynchronousEvent(PLEventQueue* self, PLEvent* event)
return result;
}
PR_IMPLEMENT(PLEvent*)
PLEvent*
PL_GetEvent(PLEventQueue* self)
{
PLEvent* event = NULL;
@ -472,7 +472,7 @@ PL_GetEvent(PLEventQueue* self)
return event;
}
PR_IMPLEMENT(PRBool)
PRBool
PL_EventAvailable(PLEventQueue* self)
{
PRBool result = PR_FALSE;
@ -489,7 +489,7 @@ PL_EventAvailable(PLEventQueue* self)
return result;
}
PR_IMPLEMENT(void)
void
PL_MapEvents(PLEventQueue* self, PLEventFunProc fun, void* data)
{
PRCList* qp;
@ -533,7 +533,7 @@ _pl_DestroyEventForOwner(PLEvent* event, void* owner, PLEventQueue* queue)
}
}
PR_IMPLEMENT(void)
void
PL_RevokeEvents(PLEventQueue* self, void* owner)
{
if (self == NULL)
@ -588,7 +588,7 @@ _pl_GetEventCount(PLEventQueue* self)
return count;
}
PR_IMPLEMENT(void)
void
PL_ProcessPendingEvents(PLEventQueue* self)
{
PRInt32 count;
@ -648,7 +648,7 @@ PL_ProcessPendingEvents(PLEventQueue* self)
* Event Operations
******************************************************************************/
PR_IMPLEMENT(void)
void
PL_InitEvent(PLEvent* self, void* owner,
PLHandleEventProc handler,
PLDestroyEventProc destructor)
@ -669,13 +669,13 @@ PL_InitEvent(PLEvent* self, void* owner,
#endif
}
PR_IMPLEMENT(void*)
void*
PL_GetEventOwner(PLEvent* self)
{
return self->owner;
}
PR_IMPLEMENT(void)
void
PL_HandleEvent(PLEvent* self)
{
void* result;
@ -704,7 +704,7 @@ static long s_eventCount = 0;
static long s_totalTime = 0;
#endif
PR_IMPLEMENT(void)
void
PL_DestroyEvent(PLEvent* self)
{
if (self == NULL)
@ -727,7 +727,7 @@ PL_DestroyEvent(PLEvent* self)
self->destructor(self);
}
PR_IMPLEMENT(void)
void
PL_DequeueEvent(PLEvent* self, PLEventQueue* queue)
{
if (self == NULL)
@ -758,7 +758,7 @@ PL_DequeueEvent(PLEvent* self, PLEventQueue* queue)
PR_ExitMonitor(queue->monitor);
}
PR_IMPLEMENT(void)
void
PL_FavorPerformanceHint(PRBool favorPerformanceOverEventStarvation,
PRUint32 starvationDelay)
{
@ -790,7 +790,7 @@ PL_FavorPerformanceHint(PRBool favorPerformanceOverEventStarvation,
* select, thread messages, or AppleEvents.
******************************************************************************/
PR_IMPLEMENT(PLEvent*)
PLEvent*
PL_WaitForEvent(PLEventQueue* self)
{
PLEvent* event;
@ -814,7 +814,7 @@ PL_WaitForEvent(PLEventQueue* self)
return event;
}
PR_IMPLEMENT(void)
void
PL_EventLoop(PLEventQueue* self)
{
if (self == NULL)
@ -1364,7 +1364,7 @@ _pl_AcknowledgeNativeNotify(PLEventQueue* self)
#endif
}
PR_IMPLEMENT(PRInt32)
PRInt32
PL_GetEventQueueSelectFD(PLEventQueue* self)
{
if (self == NULL)
@ -1379,7 +1379,7 @@ PL_GetEventQueueSelectFD(PLEventQueue* self)
#endif
}
PR_IMPLEMENT(PRBool)
PRBool
PL_IsQueueOnCurrentThread( PLEventQueue *queue )
{
PRThread *me = PR_GetCurrentThread();
@ -1642,7 +1642,7 @@ static void _md_CreateEventQueue( PLEventQueue *eventQueue )
#if defined(XP_UNIX) && !defined(XP_MACOSX)
PR_IMPLEMENT(PRInt32)
PRInt32
PL_ProcessEventsBeforeID(PLEventQueue *aSelf, unsigned long aID)
{
PRInt32 count = 0;
@ -1716,7 +1716,7 @@ PL_ProcessEventsBeforeID(PLEventQueue *aSelf, unsigned long aID)
return count;
}
PR_IMPLEMENT(void)
void
PL_RegisterEventIDFunc(PLEventQueue *aSelf, PLGetEventIDFunc aFunc,
void *aClosure)
{
@ -1724,7 +1724,7 @@ PL_RegisterEventIDFunc(PLEventQueue *aSelf, PLGetEventIDFunc aFunc,
aSelf->idFuncClosure = aClosure;
}
PR_IMPLEMENT(void)
void
PL_UnregisterEventIDFunc(PLEventQueue *aSelf)
{
aSelf->idFunc = 0;

View File

@ -191,6 +191,8 @@ and to ensure that no more events will be delivered for that owner.
#include "prcvar.h"
#include "prmon.h"
#include "nscore.h"
/* For HWND */
#if defined(XP_WIN32)
#include <windef.h>
@ -216,7 +218,7 @@ typedef struct PLEventQueue PLEventQueue;
/*
** Creates a new event queue. Returns NULL on failure.
*/
PR_EXTERN(PLEventQueue*)
NS_COM PLEventQueue*
PL_CreateEventQueue(const char* name, PRThread* handlerThread);
@ -248,7 +250,7 @@ PL_CreateEventQueue(const char* name, PRThread* handlerThread);
** A pointer to a PLEventQueue structure or NULL.
**
*/
PR_EXTERN(PLEventQueue *)
NS_COM PLEventQueue *
PL_CreateNativeEventQueue(
const char *name,
PRThread *handlerThread
@ -277,7 +279,7 @@ PR_EXTERN(PLEventQueue *)
** A pointer to a PLEventQueue structure or NULL.
**
*/
PR_EXTERN(PLEventQueue *)
NS_COM PLEventQueue *
PL_CreateMonitoredEventQueue(
const char *name,
PRThread *handlerThread
@ -286,7 +288,7 @@ PR_EXTERN(PLEventQueue *)
/*
** Destroys an event queue.
*/
PR_EXTERN(void)
NS_COM void
PL_DestroyEventQueue(PLEventQueue* self);
/*
@ -295,7 +297,7 @@ PL_DestroyEventQueue(PLEventQueue* self);
** calling PL_RevokeEvents while the event is trying to be constructed
** and delivered.
*/
PR_EXTERN(PRMonitor*)
NS_COM PRMonitor*
PL_GetEventQueueMonitor(PLEventQueue* self);
#define PL_ENTER_EVENT_QUEUE_MONITOR(queue) \
@ -312,7 +314,7 @@ PL_GetEventQueueMonitor(PLEventQueue* self);
** Any events delivered by this routine will be destroyed by PL_HandleEvent
** when it is called (by the event-handling thread).
*/
PR_EXTERN(PRStatus)
NS_COM PRStatus
PL_PostEvent(PLEventQueue* self, PLEvent* event);
/*
@ -324,20 +326,20 @@ PL_PostEvent(PLEventQueue* self, PLEvent* event);
** PL_HandleEvent, but instead will be destroyed just before the result is
** returned (by the current thread).
*/
PR_EXTERN(void*)
NS_COM void*
PL_PostSynchronousEvent(PLEventQueue* self, PLEvent* event);
/*
** Gets an event from an event queue. Returns NULL if no event is
** available.
*/
PR_EXTERN(PLEvent*)
NS_COM PLEvent*
PL_GetEvent(PLEventQueue* self);
/*
** Returns true if there is an event available for PL_GetEvent.
*/
PR_EXTERN(PRBool)
NS_COM PRBool
PL_EventAvailable(PLEventQueue* self);
/*
@ -352,14 +354,14 @@ typedef void
** to selectively handle, filter, or remove events. The data pointer is
** passed to each invocation of the function fun.
*/
PR_EXTERN(void)
NS_COM void
PL_MapEvents(PLEventQueue* self, PLEventFunProc fun, void* data);
/*
** This routine walks an event queue and destroys any event whose owner is
** the owner specified. The == operation is used to compare owners.
*/
PR_EXTERN(void)
NS_COM void
PL_RevokeEvents(PLEventQueue* self, void* owner);
/*
@ -367,7 +369,7 @@ PL_RevokeEvents(PLEventQueue* self, void* owner);
** called from the thread's main event-processing loop whenever the event
** queue's selectFD is ready (returned by PL_GetEventQueueSelectFD).
*/
PR_EXTERN(void)
NS_COM void
PL_ProcessPendingEvents(PLEventQueue* self);
/*******************************************************************************
@ -381,7 +383,7 @@ PL_ProcessPendingEvents(PLEventQueue* self);
** Blocks until an event can be returned from the event queue. This routine
** may return NULL if the current thread is interrupted.
*/
PR_EXTERN(PLEvent*)
NS_COM PLEvent*
PL_WaitForEvent(PLEventQueue* self);
/*
@ -389,7 +391,7 @@ PL_WaitForEvent(PLEventQueue* self);
** call this and it loops forever processing events as they arrive. It will
** terminate when your thread is interrupted or dies.
*/
PR_EXTERN(void)
NS_COM void
PL_EventLoop(PLEventQueue* self);
/*******************************************************************************
@ -404,7 +406,7 @@ PL_EventLoop(PLEventQueue* self);
** event queue and use it in the readFD set of select. Useful for platforms
** that support select, and must wait on other things besides just PLEvents.
*/
PR_EXTERN(PRInt32)
NS_COM PRInt32
PL_GetEventQueueSelectFD(PLEventQueue* self);
/*
@ -412,13 +414,13 @@ PL_GetEventQueueSelectFD(PLEventQueue* self);
** on the current thread. It will return PR_TRUE if so, else it will return
** PR_FALSE
*/
PR_EXTERN(PRBool)
NS_COM PRBool
PL_IsQueueOnCurrentThread( PLEventQueue *queue );
/*
** Returns whether the queue is native (true) or monitored (false)
*/
PR_EXTERN(PRBool)
NS_COM PRBool
PL_IsQueueNative(PLEventQueue *queue);
/*******************************************************************************
@ -447,7 +449,7 @@ typedef void
** structure which holds event-specific data, so this is an initializer
** for that embedded part of the structure.
*/
PR_EXTERN(void)
NS_COM void
PL_InitEvent(PLEvent* self, void* owner,
PLHandleEventProc handler,
PLDestroyEventProc destructor);
@ -455,25 +457,25 @@ PL_InitEvent(PLEvent* self, void* owner,
/*
** Returns the owner of an event.
*/
PR_EXTERN(void*)
NS_COM void*
PL_GetEventOwner(PLEvent* self);
/*
** Handles an event, calling the event's handler routine.
*/
PR_EXTERN(void)
NS_COM void
PL_HandleEvent(PLEvent* self);
/*
** Destroys an event, calling the event's destructor.
*/
PR_EXTERN(void)
NS_COM void
PL_DestroyEvent(PLEvent* self);
/*
** Removes an event from an event queue.
*/
PR_EXTERN(void)
NS_COM void
PL_DequeueEvent(PLEvent* self, PLEventQueue* queue);
@ -493,7 +495,7 @@ PL_DequeueEvent(PLEvent* self, PLEventQueue* queue);
* amount of time in milliseconds to wait before the PR_FALSE actually
* takes effect.
*/
PR_EXTERN(void)
NS_COM void
PL_FavorPerformanceHint(PRBool favorPerformanceOverEventStarvation, PRUint32 starvationDelay);
@ -543,7 +545,7 @@ struct PLEvent {
** RESTRICTIONS: MS-Windows ONLY.
**
*/
PR_EXTERN(HWND)
NS_COM HWND
PL_GetNativeEventReceiverWindow(
PLEventQueue *eqp
);
@ -567,7 +569,7 @@ PR_EXTERN(HWND)
**
** RESTRICTIONS: Unix only (well, X based unix only)
*/
PR_EXTERN(PRInt32)
NS_COM PRInt32
PL_ProcessEventsBeforeID(PLEventQueue *aSelf, unsigned long aID);
/* This prototype is a function that can be called when an event is
@ -594,7 +596,7 @@ typedef unsigned long
** void
**
** RESTRICTIONS: Unix only (well, X based unix only) */
PR_EXTERN(void)
NS_COM void
PL_RegisterEventIDFunc(PLEventQueue *aSelf, PLGetEventIDFunc aFunc,
void *aClosure);
@ -613,7 +615,7 @@ PL_RegisterEventIDFunc(PLEventQueue *aSelf, PLGetEventIDFunc aFunc,
** void
**
** RESTRICTIONS: Unix only (well, X based unix only) */
PR_EXTERN(void)
NS_COM void
PL_UnregisterEventIDFunc(PLEventQueue *aSelf);
#endif /* XP_UNIX */