michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* vim:expandtab:shiftwidth=4:tabstop=4: michael@0: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GTKTOOLKIT_H michael@0: #define GTKTOOLKIT_H michael@0: michael@0: #include "nsString.h" michael@0: #include michael@0: michael@0: /** michael@0: * Wrapper around the thread running the message pump. michael@0: * The toolkit abstraction is necessary because the message pump must michael@0: * execute within the same thread that created the widget under Win32. michael@0: */ michael@0: michael@0: class nsGTKToolkit michael@0: { michael@0: public: michael@0: nsGTKToolkit(); michael@0: michael@0: static nsGTKToolkit* GetToolkit(); michael@0: michael@0: static void Shutdown() { michael@0: delete gToolkit; michael@0: gToolkit = nullptr; michael@0: } michael@0: michael@0: /** michael@0: * Get/set our value of DESKTOP_STARTUP_ID. When non-empty, this is applied michael@0: * to the next toplevel window to be shown or focused (and then immediately michael@0: * cleared). michael@0: */ michael@0: void SetDesktopStartupID(const nsACString& aID) { mDesktopStartupID = aID; } michael@0: void GetDesktopStartupID(nsACString* aID) { *aID = mDesktopStartupID; } michael@0: michael@0: /** michael@0: * Get/set the timestamp value to be used, if non-zero, to focus the michael@0: * next top-level window to be shown or focused (upon which it is cleared). michael@0: */ michael@0: void SetFocusTimestamp(uint32_t aTimestamp) { mFocusTimestamp = aTimestamp; } michael@0: uint32_t GetFocusTimestamp() { return mFocusTimestamp; } michael@0: michael@0: private: michael@0: static nsGTKToolkit* gToolkit; michael@0: michael@0: nsCString mDesktopStartupID; michael@0: uint32_t mFocusTimestamp; michael@0: }; michael@0: michael@0: #endif // GTKTOOLKIT_H