EventQueue.h revision 10a17670b96a3e6ddaa9ffe524882f600bd41259
7568150a58e78021968b6c22bc28e9787b33496agwr * MS COM / XPCOM Abstraction Layer:
7568150a58e78021968b6c22bc28e9787b33496agwr * Event and EventQueue class declaration
7568150a58e78021968b6c22bc28e9787b33496agwr * Copyright (C) 2006-2007 innotek GmbH
7568150a58e78021968b6c22bc28e9787b33496agwr * This file is part of VirtualBox Open Source Edition (OSE), as
7568150a58e78021968b6c22bc28e9787b33496agwr * available from http://www.virtualbox.org. This file is free software;
7568150a58e78021968b6c22bc28e9787b33496agwr * you can redistribute it and/or modify it under the terms of the GNU
7568150a58e78021968b6c22bc28e9787b33496agwr * General Public License as published by the Free Software Foundation,
7568150a58e78021968b6c22bc28e9787b33496agwr * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
7568150a58e78021968b6c22bc28e9787b33496agwr * distribution. VirtualBox OSE is distributed in the hope that it will
7568150a58e78021968b6c22bc28e9787b33496agwr * be useful, but WITHOUT ANY WARRANTY of any kind.
7568150a58e78021968b6c22bc28e9787b33496agwr#if defined (RT_OS_WINDOWS)
7568150a58e78021968b6c22bc28e9787b33496agwr * Base class for all events. Intended to be subclassed to introduce new events
7568150a58e78021968b6c22bc28e9787b33496agwr * and handlers for them.
7568150a58e78021968b6c22bc28e9787b33496agwr * Subclasses usually reimplement virtual #handler() (that does nothing by
7568150a58e78021968b6c22bc28e9787b33496agwr * default) and add new data members describing the event.
7568150a58e78021968b6c22bc28e9787b33496agwr * Event handler. Called in the context of the event queue's thread.
7568150a58e78021968b6c22bc28e9787b33496agwr * Always reimplemented by subclasses
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * @return reserved, should be NULL.
7568150a58e78021968b6c22bc28e9787b33496agwr * Simple event queue.
7568150a58e78021968b6c22bc28e9787b33496agwr * On Linux, if this queue is created on the main thread, it automatically
7568150a58e78021968b6c22bc28e9787b33496agwr * processes XPCOM/IPC events while waiting for its own (Event) events.
7568150a58e78021968b6c22bc28e9787b33496agwr#if defined (RT_OS_WINDOWS)
7568150a58e78021968b6c22bc28e9787b33496agwr static void * PR_CALLBACK plEventHandler (PLEvent* self)
7568150a58e78021968b6c22bc28e9787b33496agwr // nsIEventQueue doesn't expose PL_GetEventOwner(), so use an internal
7568150a58e78021968b6c22bc28e9787b33496agwr // field of PLEvent directly (hackish, but doesn' require an extra lib)
7568150a58e78021968b6c22bc28e9787b33496agwr static void PR_CALLBACK plEventDestructor (PLEvent* self) { delete self; }
7568150a58e78021968b6c22bc28e9787b33496agwr} /* namespace com */