diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..2d10981957 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +build/ +*.xcodeproj diff --git a/.gitmodules b/.gitmodules index f2878f5ead..eef6c657dc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "vendor/ninja"] - path = vendor/ninja - url = https://github.com/martine/ninja.git [submodule "vendor/brightray"] path = vendor/brightray url = git@github.com:aroben/brightray.git diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..961499775e --- /dev/null +++ b/LICENSE @@ -0,0 +1,28 @@ +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000000..22b533564a --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# Atom Shell + +Experimental native layer for the [Atom](https://github.com/github/atom). + +## Development + +### One-time setup + +You must previously have built and uploaded libchromiumcontent using its +`script/upload` script. + + $ script/bootstrap http://base.url.com/used/by/script/upload + +### Building + + $ script/build + +This will build the app into the `build` directory. + +## License + +See the [`LICENSE`](LICENSE) file. diff --git a/app/atom_library_main.cc b/app/atom_library_main.cc new file mode 100644 index 0000000000..459bb724ff --- /dev/null +++ b/app/atom_library_main.cc @@ -0,0 +1,13 @@ +// Copyright (c) 2013 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 "app/atom_library_main.h" + +#include "app/atom_main_delegate.h" +#include "content/public/app/content_main.h" + +int AtomMain(int argc, const char* argv[]) { + atom::AtomMainDelegate delegate; + return content::ContentMain(argc, argv, &delegate); +} diff --git a/app/atom_library_main.h b/app/atom_library_main.h new file mode 100644 index 0000000000..adbe25bda5 --- /dev/null +++ b/app/atom_library_main.h @@ -0,0 +1,15 @@ +// Copyright (c) 2013 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_APP_ATOM_LIBRARY_MAIN_ +#define ATOM_APP_ATOM_LIBRARY_MAIN_ + +extern "C" { + +__attribute__ ((visibility ("default"))) +int AtomMain(int argc, const char* argv[]); + +} + +#endif // ATOM_APP_ATOM_LIBRARY_MAIN_ diff --git a/app/atom_main.cc b/app/atom_main.cc new file mode 100644 index 0000000000..01dbdf03b9 --- /dev/null +++ b/app/atom_main.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2013 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 "app/atom_library_main.h" + +int main(int argc, const char* argv[]) { + return AtomMain(argc, argv); +} diff --git a/app/atom_main_delegate.cc b/app/atom_main_delegate.cc new file mode 100644 index 0000000000..3bf4249923 --- /dev/null +++ b/app/atom_main_delegate.cc @@ -0,0 +1,29 @@ +// Copyright (c) 2013 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 "app/atom_main_delegate.h" + +#include "browser/atom_browser_client.h" +#include "renderer/atom_renderer_client.h" + +namespace atom { + +AtomMainDelegate::AtomMainDelegate() { +} + +AtomMainDelegate::~AtomMainDelegate() { +} + +content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() { + browser_client_.reset(new AtomBrowserClient); + return browser_client_.get(); +} + +content::ContentRendererClient* + AtomMainDelegate::CreateContentRendererClient() { + renderer_client_.reset(new AtomRendererClient); + return renderer_client_.get(); +} + +} // namespace atom diff --git a/app/atom_main_delegate.h b/app/atom_main_delegate.h new file mode 100644 index 0000000000..5fcf708ccd --- /dev/null +++ b/app/atom_main_delegate.h @@ -0,0 +1,30 @@ +// Copyright (c) 2013 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_APP_ATOM_MAIN_DELEGATE_ +#define ATOM_APP_ATOM_MAIN_DELEGATE_ + +#include "brightray/common/main_delegate.h" + +namespace atom { + +class AtomMainDelegate : public brightray::MainDelegate { +public: + AtomMainDelegate(); + ~AtomMainDelegate(); + +private: + virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; + virtual content::ContentRendererClient* + CreateContentRendererClient() OVERRIDE; + + scoped_ptr browser_client_; + scoped_ptr renderer_client_; + + DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate); +}; + +} // namespace atom + +#endif // ATOM_APP_ATOM_MAIN_DELEGATE_ diff --git a/atom.gyp b/atom.gyp new file mode 100644 index 0000000000..756a140c0b --- /dev/null +++ b/atom.gyp @@ -0,0 +1,165 @@ +{ + 'variables': { + 'project_name': 'atom', + 'product_name': 'Atom', + 'app_sources': [ + 'app/atom_main.cc', + ], + 'lib_sources': [ + 'app/atom_main_delegate.cc', + 'app/atom_main_delegate.h', + 'browser/atom_browser_client.cc', + 'browser/atom_browser_client.h', + 'browser/atom_browser_main_parts.cc', + 'browser/atom_browser_main_parts.h', + 'browser/atom_browser_main_parts_mac.mm', + 'renderer/atom_render_view_observer.cc', + 'renderer/atom_render_view_observer.h', + 'renderer/atom_renderer_client.cc', + 'renderer/atom_renderer_client.h', + ], + 'framework_sources': [ + 'app/atom_library_main.cc', + 'app/atom_library_main.h', + ], + }, + 'includes': [ + 'vendor/brightray/brightray.gypi', + ], + 'targets': [ + { + 'target_name': '<(project_name)', + 'type': 'executable', + 'dependencies': [ + '<(project_name)_lib', + ], + 'sources': [ + '<@(app_sources)', + ], + 'include_dirs': [ + '.', + ], + 'conditions': [ + ['OS=="mac"', { + 'product_name': '<(product_name)', + 'mac_bundle': 1, + 'dependencies!': [ + '<(project_name)_lib', + ], + 'dependencies': [ + '<(project_name)_framework', + '<(project_name)_helper', + ], + 'xcode_settings': { + 'INFOPLIST_FILE': 'browser/mac/Info.plist', + 'LD_RUNPATH_SEARCH_PATHS': '@executable_path/../Frameworks', + }, + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/<(product_name).app/Contents/Frameworks', + 'files': [ + '<(PRODUCT_DIR)/<(product_name) Helper.app', + '<(PRODUCT_DIR)/<(product_name).framework', + ], + }, + ], + 'postbuilds': [ + { + # This postbuid step is responsible for creating the following + # helpers: + # + # <(product_name) EH.app and <(product_name) NP.app are created + # from <(product_name).app. + # + # The EH helper is marked for an executable heap. The NP helper + # is marked for no PIE (ASLR). + 'postbuild_name': 'Make More Helpers', + 'action': [ + 'vendor/brightray/tools/mac/make_more_helpers.sh', + 'Frameworks', + '<(product_name)', + ], + }, + ] + }], + ], + }, + { + 'target_name': '<(project_name)_lib', + 'type': 'static_library', + 'dependencies': [ + 'vendor/brightray/brightray.gyp:brightray', + ], + 'sources': [ + '<@(lib_sources)', + ], + 'include_dirs': [ + '.', + 'vendor', + ], + }, + ], + 'conditions': [ + ['OS=="mac"', { + 'targets': [ + { + 'target_name': '<(project_name)_framework', + 'product_name': '<(product_name)', + 'type': 'shared_library', + 'dependencies': [ + '<(project_name)_lib', + ], + 'sources': [ + '<@(framework_sources)', + ], + 'include_dirs': [ + '.', + 'vendor', + '<(libchromiumcontent_include_dir)', + ], + 'mac_bundle': 1, + 'mac_bundle_resources': [ + 'browser/mac/MainMenu.xib', + '<(libchromiumcontent_resources_dir)/content_shell.pak', + ], + 'xcode_settings': { + 'LIBRARY_SEARCH_PATHS': '<(libchromiumcontent_library_dir)', + 'LD_DYLIB_INSTALL_NAME': '@rpath/<(product_name).framework/<(product_name)', + 'LD_RUNPATH_SEARCH_PATHS': '@loader_path/Libraries', + 'OTHER_LDFLAGS': [ + '-ObjC', + ], + }, + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/<(product_name).framework/Versions/A/Libraries', + 'files': [ + '<(libchromiumcontent_library_dir)/ffmpegsumo.so', + '<(libchromiumcontent_library_dir)/libchromiumcontent.dylib', + ], + }, + ], + }, + { + 'target_name': '<(project_name)_helper', + 'product_name': '<(product_name) Helper', + 'type': 'executable', + 'dependencies': [ + '<(project_name)_framework', + ], + 'sources': [ + '<@(app_sources)', + ], + 'include_dirs': [ + '.', + ], + 'mac_bundle': 1, + 'xcode_settings': { + 'INFOPLIST_FILE': 'renderer/mac/Info.plist', + 'LD_RUNPATH_SEARCH_PATHS': '@executable_path/../../../../Frameworks', + }, + }, + ], + }], + ], +} diff --git a/browser/atom_browser_client.cc b/browser/atom_browser_client.cc new file mode 100644 index 0000000000..5093064993 --- /dev/null +++ b/browser/atom_browser_client.cc @@ -0,0 +1,22 @@ +// Copyright (c) 2013 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/atom_browser_client.h" + +#include "browser/atom_browser_main_parts.h" + +namespace atom { + +AtomBrowserClient::AtomBrowserClient() { +} + +AtomBrowserClient::~AtomBrowserClient() { +} + +brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts( + const content::MainFunctionParams&) { + return new AtomBrowserMainParts; +} + +} // namespace atom diff --git a/browser/atom_browser_client.h b/browser/atom_browser_client.h new file mode 100644 index 0000000000..21aa157293 --- /dev/null +++ b/browser/atom_browser_client.h @@ -0,0 +1,26 @@ +// Copyright (c) 2013 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_ATOM_BROWSER_CLIENT_ +#define ATOM_BROWSER_ATOM_BROWSER_CLIENT_ + +#include "brightray/browser/browser_client.h" + +namespace atom { + +class AtomBrowserClient : public brightray::BrowserClient { +public: + AtomBrowserClient(); + ~AtomBrowserClient(); + +private: + virtual brightray::BrowserMainParts* OverrideCreateBrowserMainParts( + const content::MainFunctionParams&) OVERRIDE; + + DISALLOW_COPY_AND_ASSIGN(AtomBrowserClient); +}; + +} // namespace atom + +#endif // ATOM_BROWSER_ATOM_BROWSER_CLIENT_ diff --git a/browser/atom_browser_main_parts.cc b/browser/atom_browser_main_parts.cc new file mode 100644 index 0000000000..63c50768d5 --- /dev/null +++ b/browser/atom_browser_main_parts.cc @@ -0,0 +1,15 @@ +// Copyright (c) 2013 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/atom_browser_main_parts.h" + +namespace atom { + +AtomBrowserMainParts::AtomBrowserMainParts() { +} + +AtomBrowserMainParts::~AtomBrowserMainParts() { +} + +} // namespace atom diff --git a/browser/atom_browser_main_parts.h b/browser/atom_browser_main_parts.h new file mode 100644 index 0000000000..5dde2cb8bb --- /dev/null +++ b/browser/atom_browser_main_parts.h @@ -0,0 +1,25 @@ +// Copyright (c) 2013 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_ATOM_BROWSER_MAIN_PARTS_ +#define ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_ + +#include "brightray/browser/browser_main_parts.h" + +namespace atom { + +class AtomBrowserMainParts : public brightray::BrowserMainParts { +public: + AtomBrowserMainParts(); + ~AtomBrowserMainParts(); + +protected: + virtual void PreMainMessageLoopRun() OVERRIDE; + + DISALLOW_COPY_AND_ASSIGN(AtomBrowserMainParts); +}; + +} // namespace atom + +#endif // ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_ diff --git a/browser/atom_browser_main_parts_mac.mm b/browser/atom_browser_main_parts_mac.mm new file mode 100644 index 0000000000..f62ae7be71 --- /dev/null +++ b/browser/atom_browser_main_parts_mac.mm @@ -0,0 +1,51 @@ +// Copyright (c) 2013 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/atom_browser_main_parts.h" + +#import + +#include "brightray/browser/browser_context.h" +#include "brightray/browser/default_web_contents_delegate.h" +#include "brightray/browser/inspectable_web_contents.h" +#include "brightray/browser/inspectable_web_contents_view.h" + +namespace atom { + +void AtomBrowserMainParts::PreMainMessageLoopRun() { + brightray::BrowserMainParts::PreMainMessageLoopRun(); + + auto contentRect = NSMakeRect(0, 0, 800, 600); + auto styleMask = NSTitledWindowMask | + NSClosableWindowMask | + NSMiniaturizableWindowMask | + NSResizableWindowMask; + auto window = [[NSWindow alloc] initWithContentRect:contentRect + styleMask:styleMask + backing:NSBackingStoreBuffered + defer:YES]; + window.title = @"Atom"; + + // FIXME: We're leaking this object (see #3). + auto contents = brightray::InspectableWebContents::Create(content::WebContents::CreateParams(browser_context())); + // FIXME: And this one! + contents->GetWebContents()->SetDelegate( + new brightray::DefaultWebContentsDelegate()); + auto contentsView = contents->GetView()->GetNativeView(); + + contentsView.frame = [window.contentView bounds]; + contentsView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; + + [window.contentView addSubview:contentsView]; + [window makeFirstResponder:contentsView]; + [window makeKeyAndOrderFront:nil]; + + contents->GetWebContents()->GetController().LoadURL( + GURL("http://adam.roben.org/brightray_example/start.html"), + content::Referrer(), + content::PAGE_TRANSITION_AUTO_TOPLEVEL, + std::string()); +} + +} // namespace atom diff --git a/browser/mac/Info.plist b/browser/mac/Info.plist new file mode 100644 index 0000000000..0056061c7d --- /dev/null +++ b/browser/mac/Info.plist @@ -0,0 +1,14 @@ + + + + + CFBundleIdentifier + com.github.atom + CFBundleName + ${PRODUCT_NAME} + NSMainNibFile + MainMenu + NSPrincipalClass + BRYApplication + + diff --git a/browser/mac/MainMenu.xib b/browser/mac/MainMenu.xib new file mode 100644 index 0000000000..6874c5afb5 --- /dev/null +++ b/browser/mac/MainMenu.xib @@ -0,0 +1,3148 @@ + + + + 1070 + 12C60 + 3084 + 1187.34 + 625.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 3084 + + + NSCustomObject + NSMenu + NSMenuItem + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + BRYApplication + + + FirstResponder + + + NSApplication + + + NSFontManager + + + Main Menu + + + + Brightray Example + + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + Brightray Example + + + + About Brightray Example + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Services + + 2147483647 + + + submenuAction: + + Services + + _NSServicesMenu + + + + + YES + YES + + + 2147483647 + + + + + + Hide Brightray Example + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Quit Brightray Example + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 2147483647 + + + submenuAction: + + File + + + + New + n + 1048576 + 2147483647 + + + + + + Open… + o + 1048576 + 2147483647 + + + + + + Open Recent + + 2147483647 + + + submenuAction: + + Open Recent + + + + Clear Menu + + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Save… + s + 1048576 + 2147483647 + + + + + + Revert to Saved + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Page Setup... + P + 1179648 + 2147483647 + + + + + + + Print… + p + 1048576 + 2147483647 + + + + + + + + + Edit + + 2147483647 + + + submenuAction: + + Edit + + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Paste and Match Style + V + 1572864 + 2147483647 + + + + + + Delete + + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Find + + 2147483647 + + + submenuAction: + + Find + + + + Find… + f + 1048576 + 2147483647 + + + 1 + + + + Find and Replace… + f + 1572864 + 2147483647 + + + 12 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1048576 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling and Grammar + + 2147483647 + + + submenuAction: + + Spelling + + + + Show Spelling and Grammar + : + 1048576 + 2147483647 + + + + + + Check Document Now + ; + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Check Spelling While Typing + + 2147483647 + + + + + + Check Grammar With Spelling + + 2147483647 + + + + + + Correct Spelling Automatically + + 2147483647 + + + + + + + + + Substitutions + + 2147483647 + + + submenuAction: + + Substitutions + + + + Show Substitutions + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Smart Copy/Paste + + 2147483647 + + + + + + Smart Quotes + + 2147483647 + + + + + + Smart Dashes + + 2147483647 + + + + + + Smart Links + + 2147483647 + + + + + + Data Detectors + + 2147483647 + + + + + + Text Replacement + + 2147483647 + + + + + + + + + Transformations + + 2147483647 + + + submenuAction: + + Transformations + + + + Make Upper Case + + 2147483647 + + + + + + Make Lower Case + + 2147483647 + + + + + + Capitalize + + 2147483647 + + + + + + + + + Speech + + 2147483647 + + + submenuAction: + + Speech + + + + Start Speaking + + 2147483647 + + + + + + Stop Speaking + + 2147483647 + + + + + + + + + + + + Format + + 2147483647 + + + submenuAction: + + Format + + + + Font + + 2147483647 + + + submenuAction: + + Font + + + + Show Fonts + t + 1048576 + 2147483647 + + + + + + Bold + b + 1048576 + 2147483647 + + + 2 + + + + Italic + i + 1048576 + 2147483647 + + + 1 + + + + Underline + u + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Bigger + + + 1048576 + 2147483647 + + + 3 + + + + Smaller + - + 1048576 + 2147483647 + + + 4 + + + + YES + YES + + + 2147483647 + + + + + + Kern + + 2147483647 + + + submenuAction: + + Kern + + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Tighten + + 2147483647 + + + + + + Loosen + + 2147483647 + + + + + + + + + Ligatures + + 2147483647 + + + submenuAction: + + Ligatures + + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Use All + + 2147483647 + + + + + + + + + Baseline + + 2147483647 + + + submenuAction: + + Baseline + + + + Use Default + + 2147483647 + + + + + + Superscript + + 2147483647 + + + + + + Subscript + + 2147483647 + + + + + + Raise + + 2147483647 + + + + + + Lower + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Colors + C + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Copy Style + c + 1572864 + 2147483647 + + + + + + Paste Style + v + 1572864 + 2147483647 + + + + + _NSFontMenu + + + + + Text + + 2147483647 + + + submenuAction: + + Text + + + + Align Left + { + 1048576 + 2147483647 + + + + + + Center + | + 1048576 + 2147483647 + + + + + + Justify + + 2147483647 + + + + + + Align Right + } + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Writing Direction + + 2147483647 + + + submenuAction: + + Writing Direction + + + + YES + Paragraph + + 2147483647 + + + + + + CURlZmF1bHQ + + 2147483647 + + + + + + CUxlZnQgdG8gUmlnaHQ + + 2147483647 + + + + + + CVJpZ2h0IHRvIExlZnQ + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + YES + Selection + + 2147483647 + + + + + + CURlZmF1bHQ + + 2147483647 + + + + + + CUxlZnQgdG8gUmlnaHQ + + 2147483647 + + + + + + CVJpZ2h0IHRvIExlZnQ + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Ruler + + 2147483647 + + + + + + Copy Ruler + c + 1310720 + 2147483647 + + + + + + Paste Ruler + v + 1310720 + 2147483647 + + + + + + + + + + + + View + + 2147483647 + + + submenuAction: + + View + + + + Show Toolbar + t + 1572864 + 2147483647 + + + + + + Customize Toolbar… + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Show Developer Tools + i + 1572864 + 2147483647 + + + + + + + + + Window + + 2147483647 + + + submenuAction: + + Window + + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Bring All to Front + + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + + + Brightray Example Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + print: + + + + 86 + + + + runPageLayout: + + + + 87 + + + + clearRecentDocuments: + + + + 127 + + + + performClose: + + + + 193 + + + + performZoom: + + + + 240 + + + + showHelp: + + + + 360 + + + + saveDocument: + + + + 362 + + + + revertDocumentToSaved: + + + + 364 + + + + runToolbarCustomizationPalette: + + + + 365 + + + + toggleToolbarShown: + + + + 366 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + terminate: + + + + 369 + + + + unhideAllApplications: + + + + 370 + + + + raiseBaseline: + + + + 423 + + + + lowerBaseline: + + + + 424 + + + + copyFont: + + + + 425 + + + + subscript: + + + + 426 + + + + superscript: + + + + 427 + + + + tightenKerning: + + + + 428 + + + + underline: + + + + 429 + + + + orderFrontColorPanel: + + + + 430 + + + + useAllLigatures: + + + + 431 + + + + loosenKerning: + + + + 432 + + + + pasteFont: + + + + 433 + + + + unscript: + + + + 434 + + + + useStandardKerning: + + + + 435 + + + + useStandardLigatures: + + + + 436 + + + + turnOffLigatures: + + + + 437 + + + + turnOffKerning: + + + + 438 + + + + alignLeft: + + + + 439 + + + + alignJustified: + + + + 440 + + + + copyRuler: + + + + 441 + + + + alignCenter: + + + + 442 + + + + toggleRuler: + + + + 443 + + + + alignRight: + + + + 444 + + + + pasteRuler: + + + + 445 + + + + capitalizeWord: + + + + 737 + + + + cut: + + + + 738 + + + + paste: + + + + 739 + + + + toggleSmartInsertDelete: + + + + 740 + + + + toggleAutomaticQuoteSubstitution: + + + + 741 + + + + redo: + + + + 742 + + + + toggleAutomaticDashSubstitution: + + + + 743 + + + + toggleContinuousSpellChecking: + + + + 744 + + + + toggleAutomaticDataDetection: + + + + 745 + + + + undo: + + + + 746 + + + + toggleGrammarChecking: + + + + 747 + + + + startSpeaking: + + + + 748 + + + + showGuessPanel: + + + + 749 + + + + checkSpelling: + + + + 750 + + + + pasteAsPlainText: + + + + 751 + + + + copy: + + + + 752 + + + + delete: + + + + 753 + + + + lowercaseWord: + + + + 754 + + + + selectAll: + + + + 755 + + + + stopSpeaking: + + + + 756 + + + + orderFrontSubstitutionsPanel: + + + + 757 + + + + toggleAutomaticTextReplacement: + + + + 758 + + + + toggleAutomaticLinkDetection: + + + + 759 + + + + toggleAutomaticSpellingCorrection: + + + + 760 + + + + uppercaseWord: + + + + 761 + + + + performFindPanelAction: + + + + 768 + + + + performFindPanelAction: + + + + 769 + + + + performFindPanelAction: + + + + 770 + + + + centerSelectionInVisibleArea: + + + + 771 + + + + performFindPanelAction: + + + + 772 + + + + makeBaseWritingDirectionNatural: + + + + 785 + + + + makeBaseWritingDirectionLeftToRight: + + + + 786 + + + + makeBaseWritingDirectionRightToLeft: + + + + 787 + + + + makeTextWritingDirectionNatural: + + + + 788 + + + + makeTextWritingDirectionLeftToRight: + + + + 789 + + + + makeTextWritingDirectionRightToLeft: + + + + 790 + + + + performFindPanelAction: + + + + 792 + + + + showDevTools: + + + + 801 + + + + addFontTrait: + + + + 418 + + + + addFontTrait: + + + + 419 + + + + modifyFont: + + + + 420 + + + + orderFrontFontPanel: + + + + 421 + + + + modifyFont: + + + + 422 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + + + + + + + + + + + + 19 + + + + + + + + 56 + + + + + + + + 103 + + + + + + + + 83 + + + + + + + + 81 + + + + + + + + + + + + + + + + + 75 + + + + + 78 + + + + + 72 + + + + + 82 + + + + + 124 + + + + + + + + 77 + + + + + 73 + + + + + 79 + + + + + 112 + + + + + 74 + + + + + 125 + + + + + + + + 126 + + + + + 106 + + + + + + + + 111 + + + + + 57 + + + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + + + + + + 296 + + + + + + + + + + + 297 + + + + + 298 + + + + + 371 + + + + + 373 + + + + + + + + 374 + + + + + + + + + 375 + + + + + + + + 376 + + + + + + + + 377 + + + + + + + + + + + + + + + + + 378 + + + + + 379 + + + + + 380 + + + + + 381 + + + + + 382 + + + + + 383 + + + + + 384 + + + + + 385 + + + + + 386 + + + + + + + + + + + + + + + + + + + + + + + 387 + + + + + 388 + + + + + 389 + + + + + 390 + + + + + 391 + + + + + 392 + + + + + 393 + + + + + 394 + + + + + 395 + + + + + + + + 396 + + + + + + + + 397 + + + + + + + + 398 + + + + + 399 + + + + + 400 + + + + + 401 + + + + + 402 + + + + + 403 + + + + + + + + + + + + 404 + + + + + 405 + + + + + 406 + + + + + 407 + + + + + 408 + + + + + 409 + + + + + + + + + + 410 + + + + + 411 + + + + + 412 + + + + + 413 + + + + + + + + + + + 414 + + + + + 415 + + + + + 416 + + + + + 417 + + + + + 681 + + + + + + + + 682 + + + + + + + + + + + + + + + + + + + + + + 683 + + + + + 684 + + + + + 685 + + + + + 686 + + + + + 687 + + + + + 688 + + + + + 689 + + + + + 690 + + + + + 691 + + + + + 692 + + + + + 693 + + + + + + + + 694 + + + + + + + + 695 + + + + + + + + 696 + + + + + + + + 697 + + + + + + + + 708 + + + + + + + + + 709 + + + + + 710 + + + + + 711 + + + + + + + + + + 712 + + + + + 713 + + + + + 714 + + + + + 715 + + + + + + + + + + + + + + + 716 + + + + + 717 + + + + + 718 + + + + + 719 + + + + + 720 + + + + + 721 + + + + + 722 + + + + + 723 + + + + + 724 + + + + + + + + + + + + + 725 + + + + + 726 + + + + + 727 + + + + + 728 + + + + + 729 + + + + + 730 + + + + + 731 + + + + + + + + + + + + + 732 + + + + + 733 + + + + + 734 + + + + + 735 + + + + + 736 + + + + + 773 + + + + + 774 + + + + + + + + 775 + + + + + + + + + + + + + + + + 776 + + + + + 777 + + + + + 778 + + + + + 779 + + + + + 780 + + + + + 781 + + + + + 782 + + + + + 783 + + + + + 784 + + + + + 791 + + + + + 798 + + + + + 799 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 801 + + + + + FirstResponder + + showDevTools: + id + + + showDevTools: + + showDevTools: + id + + + + IBUserSource + + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + YES + 3 + + {11, 11} + {10, 3} + + YES + + diff --git a/renderer/atom_render_view_observer.cc b/renderer/atom_render_view_observer.cc new file mode 100644 index 0000000000..3f9ace15c0 --- /dev/null +++ b/renderer/atom_render_view_observer.cc @@ -0,0 +1,24 @@ +// Copyright (c) 2013 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 "renderer/atom_render_view_observer.h" + +#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" +#include "v8/include/v8.h" + +namespace atom { + +AtomRenderViewObserver::AtomRenderViewObserver( + content::RenderView *render_view) + : content::RenderViewObserver(render_view) { +} + +AtomRenderViewObserver::~AtomRenderViewObserver() { +} + +void AtomRenderViewObserver::DidClearWindowObject(WebKit::WebFrame* frame) { +} + +} // namespace atom diff --git a/renderer/atom_render_view_observer.h b/renderer/atom_render_view_observer.h new file mode 100644 index 0000000000..f3f20fe0c7 --- /dev/null +++ b/renderer/atom_render_view_observer.h @@ -0,0 +1,26 @@ +// Copyright (c) 2013 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_RENDERER_ATOM_RENDER_VIEW_OBSERVER_ +#define ATOM_RENDERER_ATOM_RENDER_VIEW_OBSERVER_ + +#include "content/public/renderer/render_view_observer.h" + +namespace atom { + +class AtomRenderViewObserver : content::RenderViewObserver { +public: + explicit AtomRenderViewObserver(content::RenderView*); + +private: + ~AtomRenderViewObserver(); + + virtual void DidClearWindowObject(WebKit::WebFrame*) OVERRIDE; + + DISALLOW_COPY_AND_ASSIGN(AtomRenderViewObserver); +}; + +} // namespace atom + +#endif // ATOM_RENDERER_ATOM_RENDER_VIEW_OBSERVER_ diff --git a/renderer/atom_renderer_client.cc b/renderer/atom_renderer_client.cc new file mode 100644 index 0000000000..7f15a6a393 --- /dev/null +++ b/renderer/atom_renderer_client.cc @@ -0,0 +1,21 @@ +// Copyright (c) 2013 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 "renderer/atom_renderer_client.h" + +#include "renderer/atom_render_view_observer.h" + +namespace atom { + +AtomRendererClient::AtomRendererClient() { +} + +AtomRendererClient::~AtomRendererClient() { +} + +void AtomRendererClient::RenderViewCreated(content::RenderView* render_view) { + new AtomRenderViewObserver(render_view); +} + +} // namespace atom diff --git a/renderer/atom_renderer_client.h b/renderer/atom_renderer_client.h new file mode 100644 index 0000000000..75901cfcf1 --- /dev/null +++ b/renderer/atom_renderer_client.h @@ -0,0 +1,25 @@ +// Copyright (c) 2013 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_RENDERER_ATOM_RENDERER_CLIENT_ +#define ATOM_RENDERER_ATOM_RENDERER_CLIENT_ + +#include "content/public/renderer/content_renderer_client.h" + +namespace atom { + +class AtomRendererClient : public content::ContentRendererClient { +public: + AtomRendererClient(); + ~AtomRendererClient(); + +private: + virtual void RenderViewCreated(content::RenderView*) OVERRIDE; + + DISALLOW_COPY_AND_ASSIGN(AtomRendererClient); +}; + +} // namespace atom + +#endif // ATOM_RENDERER_ATOM_RENDERER_CLIENT_ diff --git a/renderer/mac/Info.plist b/renderer/mac/Info.plist new file mode 100644 index 0000000000..3a4d0b3cb8 --- /dev/null +++ b/renderer/mac/Info.plist @@ -0,0 +1,12 @@ + + + + + CFBundleIdentifier + com.github.atom.helper + CFBundleName + ${PRODUCT_NAME} + LSUIElement + + + diff --git a/script/bootstrap b/script/bootstrap new file mode 100755 index 0000000000..dd77b1a433 --- /dev/null +++ b/script/bootstrap @@ -0,0 +1,28 @@ +#!/bin/sh +#/ Usage: bootstrap https://base.url.com/from/libchromiumcontent/script/upload +#/ Bootstrap this project. + +set -e + +usage() { + grep '^#/' <"$0"| cut -c4- +} + +BASE_URL="${1}" + +if [ -z "${BASE_URL}" ]; then + usage + exit 1 +fi + +cd "$(dirname "$0")/.." +SOURCE_ROOT=$(pwd -P) +VENDOR_DIR="${SOURCE_ROOT}/vendor" +BRIGHTRAY_DIR="${VENDOR_DIR}/brightray" + +git submodule sync --quiet +git submodule update --init --recursive + +"${BRIGHTRAY_DIR}/script/bootstrap" "${BASE_URL}" + +"${SOURCE_ROOT}/script/update" diff --git a/script/build b/script/build new file mode 100755 index 0000000000..06a34af1a1 --- /dev/null +++ b/script/build @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +MODE=Release +if [ ! -z $1 ]; then + MODE=$1 +fi + +cd "$(dirname "$0")/.." + +xcodebuild -configuration ${MODE} -target atom diff --git a/script/update b/script/update new file mode 100755 index 0000000000..6b81680eee --- /dev/null +++ b/script/update @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +cd "$(dirname "$0")/.." + +gyp --depth . atom.gyp