gtk: Add dummy implementation of Menu.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 14 Feb 2014 13:41:20 +0000 (13:41 +0000)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 14 Feb 2014 13:41:20 +0000 (13:41 +0000)
atom.gyp
browser/api/atom_api_menu.h
browser/api/atom_api_menu_gtk.cc [new file with mode: 0644]
browser/api/atom_api_menu_gtk.h [new file with mode: 0644]

index 4ff70a6..6c795a2 100644 (file)
--- a/atom.gyp
+++ b/atom.gyp
@@ -51,6 +51,8 @@
       'browser/api/atom_api_event.h',
       'browser/api/atom_api_menu.cc',
       'browser/api/atom_api_menu.h',
+      'browser/api/atom_api_menu_gtk.cc',
+      'browser/api/atom_api_menu_gtk.h',
       'browser/api/atom_api_menu_mac.h',
       'browser/api/atom_api_menu_mac.mm',
       'browser/api/atom_api_menu_win.cc',
index d642892..25f94b8 100644 (file)
@@ -69,7 +69,7 @@ class Menu : public EventEmitter,
 
   static void Popup(const v8::FunctionCallbackInfo<v8::Value>& args);
 
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(TOOLKIT_GTK)
   static void AttachToWindow(const v8::FunctionCallbackInfo<v8::Value>& args);
 #elif defined(OS_MACOSX)
   static void SetApplicationMenu(
diff --git a/browser/api/atom_api_menu_gtk.cc b/browser/api/atom_api_menu_gtk.cc
new file mode 100644 (file)
index 0000000..041c9f2
--- /dev/null
@@ -0,0 +1,32 @@
+// Copyright (c) 2014 GitHub, Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "browser/api/atom_api_menu_gtk.h"
+
+namespace atom {
+
+namespace api {
+
+MenuGtk::MenuGtk(v8::Handle<v8::Object> wrapper)
+    : Menu(wrapper) {
+}
+
+MenuGtk::~MenuGtk() {
+}
+
+void MenuGtk::Popup(NativeWindow* native_window) {
+}
+
+// static
+void Menu::AttachToWindow(const v8::FunctionCallbackInfo<v8::Value>& args) {
+}
+
+// static
+Menu* Menu::Create(v8::Handle<v8::Object> wrapper) {
+  return new MenuGtk(wrapper);
+}
+
+}  // namespace api
+
+}  // namespace atom
diff --git a/browser/api/atom_api_menu_gtk.h b/browser/api/atom_api_menu_gtk.h
new file mode 100644 (file)
index 0000000..88e0510
--- /dev/null
@@ -0,0 +1,30 @@
+// Copyright (c) 2014 GitHub, Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ATOM_BROWSER_API_ATOM_API_MENU_GTK_H_
+#define ATOM_BROWSER_API_ATOM_API_MENU_GTK_H_
+
+#include "browser/api/atom_api_menu.h"
+
+namespace atom {
+
+namespace api {
+
+class MenuGtk : public Menu {
+ public:
+  explicit MenuGtk(v8::Handle<v8::Object> wrapper);
+  virtual ~MenuGtk();
+
+ protected:
+  virtual void Popup(NativeWindow* window) OVERRIDE;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(MenuGtk);
+};
+
+}  // namespace api
+
+}  // namespace atom
+
+#endif  // ATOM_BROWSER_API_ATOM_API_MENU_GTK_H_