1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef UI_BASE_X_ROOT_WINDOW_PROPERTY_WATCHER_X_H_ 6 #define UI_BASE_X_ROOT_WINDOW_PROPERTY_WATCHER_X_H_ 7 8 #include <gdk/gdk.h> 9 10 #include "base/basictypes.h" 11 #include "ui/base/gtk/gtk_signal.h" 12 #include "ui/base/ui_export.h" 13 14 template <typename T> struct DefaultSingletonTraits; 15 16 namespace ui { 17 18 namespace internal { 19 20 // This class keeps track of changes to properties on the root window. This is 21 // not to be used directly. Implement a watcher for the specific property you're 22 // interested in. 23 class RootWindowPropertyWatcherX { 24 public: 25 static RootWindowPropertyWatcherX* GetInstance(); 26 27 private: 28 friend struct DefaultSingletonTraits<RootWindowPropertyWatcherX>; 29 30 RootWindowPropertyWatcherX(); 31 ~RootWindowPropertyWatcherX(); 32 33 // Callback for PropertyChange XEvents. 34 CHROMEG_CALLBACK_1(RootWindowPropertyWatcherX, GdkFilterReturn, 35 OnWindowXEvent, GdkXEvent*, GdkEvent*); 36 37 DISALLOW_COPY_AND_ASSIGN(RootWindowPropertyWatcherX); 38 }; 39 40 } // namespace internal 41 42 } // namespace ui 43 44 #endif // UI_BASE_X_ROOT_WINDOW_PROPERTY_WATCHER_X_H_ 45