summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/libgtk2ui/gtk2_event_loop.h
blob: 0bd2a219ae2724166dba8f738a844818a7e05374 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_EVENT_LOOP_H_
#define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_EVENT_LOOP_H_

#include "base/macros.h"
#include "ui/base/glib/glib_integers.h"

typedef union _GdkEvent GdkEvent;
typedef struct _GdkEventKey GdkEventKey;

template<typename Type> struct DefaultSingletonTraits;

namespace libgtk2ui {

class Gtk2EventLoop {
 public:
  static Gtk2EventLoop* GetInstance();

 private:
  friend struct DefaultSingletonTraits<Gtk2EventLoop>;

  Gtk2EventLoop();
  ~Gtk2EventLoop();

  static void DispatchGdkEvent(GdkEvent* gdk_event, gpointer);
  static void ProcessGdkEventKey(const GdkEventKey& gdk_event_key);

  DISALLOW_COPY_AND_ASSIGN(Gtk2EventLoop);
};

}  // namespace libgtk2ui

#endif  // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_EVENT_LOOP_H_