OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium OS 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 #include <gdk/gdk.h> | |
6 #include <gflags/gflags.h> | |
7 #include <glib.h> | |
8 #include <inttypes.h> | |
9 | |
10 #include <cstdio> | |
11 | |
12 #include "base/logging.h" | |
13 #include "base/scoped_ptr.h" | |
14 #include "base/string_util.h" | |
15 #include "power_manager/udev_listener.h" | |
16 | |
17 // drm-tool: A simple tool to monitor drm hotplug events with udev. | |
18 | |
19 class DrmCallBack : public power_manager::UdevCallBack { | |
Daniel Erat
2011/04/13 23:33:26
nit: i think that i've typically seen this written
marcheu
2011/04/14 02:23:55
Done.
| |
20 public: | |
21 void CallBack(GIOChannel* source, GIOCondition condition) { | |
22 (void) source; | |
23 (void) condition; | |
24 printf("Udev drm callback\n"); | |
25 } | |
26 }; | |
27 | |
28 int main(int argc, char* argv[]) { | |
29 google::ParseCommandLineFlags(&argc, &argv, true); | |
30 DrmCallBack callback; | |
31 power_manager::UdevListener drm_listener(&callback, "drm"); | |
32 if (!drm_listener.Init()) | |
33 LOG(WARNING) << "Cannot initialize drm listener"; | |
34 GMainLoop* loop = g_main_loop_new(NULL, false); | |
35 g_main_loop_run(loop); | |
36 return 0; | |
37 } | |
38 | |
OLD | NEW |