Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* vim:expandtab:shiftwidth=4:tabstop=4: |
michael@0 | 3 | */ |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef GTKTOOLKIT_H |
michael@0 | 9 | #define GTKTOOLKIT_H |
michael@0 | 10 | |
michael@0 | 11 | #include "nsString.h" |
michael@0 | 12 | #include <gtk/gtk.h> |
michael@0 | 13 | |
michael@0 | 14 | /** |
michael@0 | 15 | * Wrapper around the thread running the message pump. |
michael@0 | 16 | * The toolkit abstraction is necessary because the message pump must |
michael@0 | 17 | * execute within the same thread that created the widget under Win32. |
michael@0 | 18 | */ |
michael@0 | 19 | |
michael@0 | 20 | class nsGTKToolkit |
michael@0 | 21 | { |
michael@0 | 22 | public: |
michael@0 | 23 | nsGTKToolkit(); |
michael@0 | 24 | |
michael@0 | 25 | static nsGTKToolkit* GetToolkit(); |
michael@0 | 26 | |
michael@0 | 27 | static void Shutdown() { |
michael@0 | 28 | delete gToolkit; |
michael@0 | 29 | gToolkit = nullptr; |
michael@0 | 30 | } |
michael@0 | 31 | |
michael@0 | 32 | /** |
michael@0 | 33 | * Get/set our value of DESKTOP_STARTUP_ID. When non-empty, this is applied |
michael@0 | 34 | * to the next toplevel window to be shown or focused (and then immediately |
michael@0 | 35 | * cleared). |
michael@0 | 36 | */ |
michael@0 | 37 | void SetDesktopStartupID(const nsACString& aID) { mDesktopStartupID = aID; } |
michael@0 | 38 | void GetDesktopStartupID(nsACString* aID) { *aID = mDesktopStartupID; } |
michael@0 | 39 | |
michael@0 | 40 | /** |
michael@0 | 41 | * Get/set the timestamp value to be used, if non-zero, to focus the |
michael@0 | 42 | * next top-level window to be shown or focused (upon which it is cleared). |
michael@0 | 43 | */ |
michael@0 | 44 | void SetFocusTimestamp(uint32_t aTimestamp) { mFocusTimestamp = aTimestamp; } |
michael@0 | 45 | uint32_t GetFocusTimestamp() { return mFocusTimestamp; } |
michael@0 | 46 | |
michael@0 | 47 | private: |
michael@0 | 48 | static nsGTKToolkit* gToolkit; |
michael@0 | 49 | |
michael@0 | 50 | nsCString mDesktopStartupID; |
michael@0 | 51 | uint32_t mFocusTimestamp; |
michael@0 | 52 | }; |
michael@0 | 53 | |
michael@0 | 54 | #endif // GTKTOOLKIT_H |