diff --git a/atom.gyp b/atom.gyp index 4ff70a69bb9..6c795a25817 100644 --- 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', diff --git a/browser/api/atom_api_menu.h b/browser/api/atom_api_menu.h index d642892f576..25f94b83548 100644 --- a/browser/api/atom_api_menu.h +++ b/browser/api/atom_api_menu.h @@ -69,7 +69,7 @@ class Menu : public EventEmitter, static void Popup(const v8::FunctionCallbackInfo& args); -#if defined(OS_WIN) +#if defined(OS_WIN) || defined(TOOLKIT_GTK) static void AttachToWindow(const v8::FunctionCallbackInfo& 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 index 00000000000..041c9f282bf --- /dev/null +++ b/browser/api/atom_api_menu_gtk.cc @@ -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 wrapper) + : Menu(wrapper) { +} + +MenuGtk::~MenuGtk() { +} + +void MenuGtk::Popup(NativeWindow* native_window) { +} + +// static +void Menu::AttachToWindow(const v8::FunctionCallbackInfo& args) { +} + +// static +Menu* Menu::Create(v8::Handle 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 index 00000000000..88e05105a7f --- /dev/null +++ b/browser/api/atom_api_menu_gtk.h @@ -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 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_