Browse files

[GTK][Win] Add UI API implementation stub.

  • Loading branch information...
1 parent 74e4029 commit 5a8178cc526eaca7a146ba721397d2f69cfac90c @zcbenz zcbenz committed Sep 20, 2012
View
4 nw.gypi
@@ -55,12 +55,16 @@
'src/api/menu/menu_win.cc',
'src/api/menuitem/menuitem.cc',
'src/api/menuitem/menuitem.h',
+ 'src/api/menuitem/menuitem_gtk.cc',
'src/api/menuitem/menuitem_mac.mm',
+ 'src/api/menuitem/menuitem_win.cc',
'src/api/menuitem/menuitem_delegate_mac.h',
'src/api/menuitem/menuitem_delegate_mac.mm',
'src/api/tray/tray.cc',
'src/api/tray/tray.h',
+ 'src/api/tray/tray_gtk.cc',
'src/api/tray/tray_mac.mm',
+ 'src/api/tray/tray_win.cc',
'src/browser/app_controller_mac.h',
'src/browser/app_controller_mac.mm',
'src/browser/file_select_helper.cc',
View
7 src/api/menu/menu.h
@@ -33,8 +33,10 @@
@class NSMenu;
#else
class NSMenu;
-#endif
-#endif
+#endif // __OBJC__
+#elif defined(TOOLKIT_GTK)
+struct GtkMenu;
+#endif // defined(OS_MACOSX)
namespace api {
@@ -83,6 +85,7 @@ class Menu : node::ObjectWrap {
#if defined(OS_MACOSX)
typedef NSMenu* NativeType;
#elif defined(TOOLKIT_GTK)
+ typedef GtkMenu* NativeType;
#elif defined(OS_WIN)
#endif
View
24 src/api/menu/menu_gtk.cc
@@ -20,14 +20,36 @@
#include "content/nw/src/api/menu/menu.h"
+#include "content/nw/src/api/menuitem/menuitem.h"
+
namespace api {
using namespace v8;
-Menu::Menu(CreationOptions options) {
+Menu::Menu(CreationOption option) {
}
Menu::~Menu() {
}
+void Menu::SetTitle(const std::string& title) {
+}
+
+std::string Menu::GetTitle() {
+ return std::string();
+}
+
+void Menu::Append(MenuItem* menu_item) {
+}
+
+void Menu::Insert(MenuItem* menu_item, int pos) {
+}
+
+void Menu::Remove(MenuItem* menu_item) {
+}
+
+void Menu::Remove(int pos) {
+}
+
} // namespace api
+
View
25 src/api/menu/menu_win.cc
@@ -20,14 +20,37 @@
#include "content/nw/src/api/menu/menu.h"
+#include "content/nw/src/api/menuitem/menuitem.h"
+
namespace api {
using namespace v8;
-Menu::Menu(CreationOptions options) {
+Menu::Menu(CreationOption option) {
}
Menu::~Menu() {
}
+void Menu::SetTitle(const std::string& title) {
+}
+
+std::string Menu::GetTitle() {
+ return std::string();
+}
+
+void Menu::Append(MenuItem* menu_item) {
+}
+
+void Menu::Insert(MenuItem* menu_item, int pos) {
+}
+
+void Menu::Remove(MenuItem* menu_item) {
+}
+
+void Menu::Remove(int pos) {
+}
+
} // namespace api
+
+
View
3 src/api/menuitem/menuitem.h
@@ -35,6 +35,8 @@
class NSMenuItem;
class MenuItemDelegate;
#endif // __OBJC__
+#elif defined(TOOLKIT_GTK)
+class GtkMenuItem;
#endif // defined(OS_MACOSX)
namespace api {
@@ -100,6 +102,7 @@ class MenuItem : node::ObjectWrap {
#if defined(OS_MACOSX)
typedef NSMenuItem* NativeType;
#elif defined(TOOLKIT_GTK)
+ typedef GtkMenuItem* NativeType;
#elif defined(OS_WIN)
#endif
View
69 src/api/menuitem/menuitem_gtk.cc
@@ -0,0 +1,69 @@
+// Copyright (c) 2012 Intel Corp
+// Copyright (c) 2012 The Chromium Authors
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell co
+// pies of the Software, and to permit persons to whom the Software is furnished
+// to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in al
+// l copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IM
+// PLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNES
+// S FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+// OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WH
+// ETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#include "content/nw/src/api/menuitem/menuitem.h"
+
+#include "content/nw/src/api/menu/menu.h"
+
+namespace api {
+
+using namespace v8;
+
+MenuItem::MenuItem(CreationOption option) {
+}
+
+MenuItem::~MenuItem() {
+}
+
+void MenuItem::SetLabel(const std::string& label) {
+}
+
+std::string MenuItem::GetLabel() {
+ return std::string();
+}
+
+void MenuItem::SetIcon(const std::string& icon) {
+}
+
+void MenuItem::SetTooltip(const std::string& tooltip) {
+}
+
+std::string MenuItem::GetTooltip() {
+ return std::string();
+}
+
+void MenuItem::SetEnabled(bool enabled) {
+}
+
+bool MenuItem::GetEnabled() {
+ return true;
+}
+
+void MenuItem::SetChecked(bool checked) {
+}
+
+bool MenuItem::GetChecked() {
+ return false;
+}
+
+void MenuItem::SetSubmenu(Menu* sub_menu) {
+}
+
+} // namespace api
View
69 src/api/menuitem/menuitem_win.cc
@@ -0,0 +1,69 @@
+// Copyright (c) 2012 Intel Corp
+// Copyright (c) 2012 The Chromium Authors
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell co
+// pies of the Software, and to permit persons to whom the Software is furnished
+// to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in al
+// l copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IM
+// PLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNES
+// S FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+// OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WH
+// ETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#include "content/nw/src/api/menuitem/menuitem.h"
+
+#include "content/nw/src/api/menu/menu.h"
+
+namespace api {
+
+using namespace v8;
+
+MenuItem::MenuItem(CreationOption option) {
+}
+
+MenuItem::~MenuItem() {
+}
+
+void MenuItem::SetLabel(const std::string& label) {
+}
+
+std::string MenuItem::GetLabel() {
+ return std::string();
+}
+
+void MenuItem::SetIcon(const std::string& icon) {
+}
+
+void MenuItem::SetTooltip(const std::string& tooltip) {
+}
+
+std::string MenuItem::GetTooltip() {
+ return std::string();
+}
+
+void MenuItem::SetEnabled(bool enabled) {
+}
+
+bool MenuItem::GetEnabled() {
+ return true;
+}
+
+void MenuItem::SetChecked(bool checked) {
+}
+
+bool MenuItem::GetChecked() {
+ return false;
+}
+
+void MenuItem::SetSubmenu(Menu* sub_menu) {
+}
+
+} // namespace api
View
7 src/api/tray/tray.h
@@ -32,8 +32,10 @@
@class NSStatusItem;
#else
class NSStatusItem;
-#endif
-#endif
+#endif // __OBJC__
+#elif defined(TOOLKIT_GTK)
+class GtkStatusIcon;
+#endif // defined(OS_MACOSX)
namespace api {
@@ -76,6 +78,7 @@ class Tray : node::ObjectWrap {
#if defined(OS_MACOSX)
typedef NSStatusItem* NativeType;
#elif defined(TOOLKIT_GTK)
+ typedef GtkStatusIcon* NativeType;
#elif defined(OS_WIN)
#endif
View
56 src/api/tray/tray_gtk.cc
@@ -0,0 +1,56 @@
+// Copyright (c) 2012 Intel Corp
+// Copyright (c) 2012 The Chromium Authors
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell co
+// pies of the Software, and to permit persons to whom the Software is furnished
+// to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in al
+// l copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IM
+// PLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNES
+// S FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+// OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WH
+// ETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#include "content/nw/src/api/tray/tray.h"
+
+#include "content/nw/src/api/menu/menu.h"
+
+namespace api {
+
+Tray::Tray(CreationOption option) {
+}
+
+Tray::~Tray() {
+}
+
+void Tray::SetTitle(const std::string& title) {
+}
+
+std::string Tray::GetTitle() {
+ return std::string();
+}
+
+void Tray::SetIcon(const std::string& path) {
+}
+
+void Tray::SetTooltip(const std::string& tooltip) {
+}
+
+std::string Tray::GetTooltip() {
+ return std::string();
+}
+
+void Tray::SetMenu(Menu* menu) {
+}
+
+void Tray::Remove() {
+}
+
+} // namespace api
View
56 src/api/tray/tray_win.cc
@@ -0,0 +1,56 @@
+// Copyright (c) 2012 Intel Corp
+// Copyright (c) 2012 The Chromium Authors
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell co
+// pies of the Software, and to permit persons to whom the Software is furnished
+// to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in al
+// l copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IM
+// PLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNES
+// S FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+// OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WH
+// ETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#include "content/nw/src/api/tray/tray.h"
+
+#include "content/nw/src/api/menu/menu.h"
+
+namespace api {
+
+Tray::Tray(CreationOption option) {
+}
+
+Tray::~Tray() {
+}
+
+void Tray::SetTitle(const std::string& title) {
+}
+
+std::string Tray::GetTitle() {
+ return std::string();
+}
+
+void Tray::SetIcon(const std::string& path) {
+}
+
+void Tray::SetTooltip(const std::string& tooltip) {
+}
+
+std::string Tray::GetTooltip() {
+ return std::string();
+}
+
+void Tray::SetMenu(Menu* menu) {
+}
+
+void Tray::Remove() {
+}
+
+} // namespace api

0 comments on commit 5a8178c

Please sign in to comment.