Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / ui / base / x / root_window_property_watcher_x.h
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
13 template <typename T> struct DefaultSingletonTraits;
14
15 namespace ui {
16 namespace internal {
17
18 // This class keeps track of changes to properties on the root window. This is
19 // not to be used directly. Implement a watcher for the specific property you're
20 // interested in.
21 class RootWindowPropertyWatcherX {
22  public:
23   static RootWindowPropertyWatcherX* GetInstance();
24
25  private:
26   friend struct DefaultSingletonTraits<RootWindowPropertyWatcherX>;
27
28   RootWindowPropertyWatcherX();
29   ~RootWindowPropertyWatcherX();
30
31   // Callback for PropertyChange XEvents.
32   CHROMEG_CALLBACK_1(RootWindowPropertyWatcherX, GdkFilterReturn,
33                      OnWindowXEvent, GdkXEvent*, GdkEvent*);
34
35   DISALLOW_COPY_AND_ASSIGN(RootWindowPropertyWatcherX);
36 };
37
38 }  // namespace internal
39 }  // namespace ui
40
41 #endif  // UI_BASE_X_ROOT_WINDOW_PROPERTY_WATCHER_X_H_