diff options
author | noelallen@chromium.org <noelallen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-11 00:32:09 +0000 |
---|---|---|
committer | noelallen@chromium.org <noelallen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-11 00:32:09 +0000 |
commit | a96e1c4acce2799c5739f674ff6d90d49fd25633 (patch) | |
tree | 931f84232b1a98a91f9a92cd18621c50b9363234 /native_client_sdk | |
parent | 36e4151d009b1ae6274f5af9449e49f3b6e2198f (diff) | |
download | chromium_src-a96e1c4acce2799c5739f674ff6d90d49fd25633.zip chromium_src-a96e1c4acce2799c5739f674ff6d90d49fd25633.tar.gz chromium_src-a96e1c4acce2799c5739f674ff6d90d49fd25633.tar.bz2 |
Remove stale files unused by NaCl SDK builder
1- Old scons artifacts
2- Move index_staging -> index
3- Remove stale hello_world_c (now just hello_world)
This CL is part of the NaCl SDK and does not affect Chrome.
BUG= 109207
TBR= bradnelson@xchromium.org
Review URL: http://codereview.chromium.org/9378026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121584 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
8 files changed, 0 insertions, 788 deletions
diff --git a/native_client_sdk/src/examples/build.scons b/native_client_sdk/src/examples/build.scons deleted file mode 100644 index 76ec08a..0000000 --- a/native_client_sdk/src/examples/build.scons +++ /dev/null @@ -1,82 +0,0 @@ -#! -*- python -*- -# -# Copyright (c) 2011 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import os -import shutil -import sys - -""" -Build file for the NaCl SDK Examples - -This file runs all the scons files in the various example sub-directories. -Do not invoke this script directly, but instead use the scons or scons.bat -wrapper function. E.g. - -Linux or Mac: - ./scons [Options...] - -Windows: - scons.bat [Options...] -""" - -#------------------------------------------------------------------------------ -HELP_STRING = """ -=============================================================================== -Help for NaCl SDK Examples -=============================================================================== - -* cleaning: ./scons -c -* build a target: ./scons <target> -* clean a target: ./scons -c <target> - -Supported targets: - * fullscreen_tumbler Build the fullscreen-tumbler example. - * geturl Build the geturl example. - * hello_world Build the hello_world example. - * hello_world_c Build the hello_world_c example. - * input_events Build the input_events example. - * load_progress Build the load_progress example. - * mouselock Build the mouselock example. - * multithreaded_input_events Build the multithreaded input_events example. - * pi_generator Build the pi_generator example. - * pong Build the pong example. - * sine_synth Build the sine_synth example. - * tumbler Build the tumbler example. -""" - -example_directories = [ - 'fullscreen_tumbler', - 'geturl', - 'hello_world', - 'hello_world_c', - 'input_events', - 'load_progress', - 'mouselock', - 'multithreaded_input_events', - 'pi_generator', - 'pong', - 'sine_synth', - 'tumbler', - ] - -Help(HELP_STRING) - -staging_dir = os.path.abspath(os.getenv( - 'NACL_INSTALL_ROOT', os.path.join(os.getenv('NACL_SDK_ROOT', '.'), - 'staging'))) -general_files = Install(staging_dir, ['httpd.py']) -general_files.extend(InstallAs(os.path.join(staging_dir, 'index.html'), - 'index_staging.html')) - -if sys.platform in ['win32', 'cygwin']: - general_files.extend(Install(staging_dir, 'httpd.cmd')) - -SConscript([os.path.join(dir, 'build.scons') for dir in example_directories]) - -Default(['install'] + general_files + example_directories) -if GetOption('clean'): - print "Removing the staging directory at %s" % staging_dir - shutil.rmtree(staging_dir, ignore_errors=True) diff --git a/native_client_sdk/src/examples/hello_world_interactive/test_helper_functions.cc b/native_client_sdk/src/examples/hello_world_interactive/test_helper_functions.cc deleted file mode 100644 index 30d3f27..0000000 --- a/native_client_sdk/src/examples/hello_world_interactive/test_helper_functions.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This is an example of a simple unit test to verify that the logic helper -// functions works as expected. Note that this looks like a 'normal' C++ -// program, with a main function. It is compiled and linked using the NaCl -// toolchain, so in order to run it, you must use 'sel_ldr_x86_32' or -// 'sel_ldr_x86_64' from the toolchain's bin directory. -// -// For example (assuming the toolchain bin directory is in your path): -// sel_ldr_x86_32 test_helper_functions_x86_32_dbg.nexe -// -// You can also use the 'test32', or 'test64' SCons target to run these tests. -// For example, this will run the test in 32-bit mode on Mac or Linux: -// ../scons test32 -// On Windows 64: -// ..\scons test64 - -#include "examples/hello_world/helper_functions.h" - -#include <cassert> -#include <cstdio> -#include <string> - -// A very simple macro to print 'passed' if boolean_expression is true and -// 'FAILED' otherwise. -// This is meant to approximate the functionality you would get from a real test -// framework. You should feel free to build and use the test framework of your -// choice. -#define EXPECT_EQUAL(left, right)\ -printf("Check: \"" #left "\" == \"" #right "\" %s\n", \ - ((left) == (right)) ? "passed" : "FAILED") - -using hello_world::FortyTwo; -using hello_world::ReverseText; - -int main() { - EXPECT_EQUAL(FortyTwo(), 42); - - std::string empty_string; - EXPECT_EQUAL(ReverseText(empty_string), empty_string); - - std::string palindrome("able was i ere i saw elba"); - EXPECT_EQUAL(ReverseText(palindrome), palindrome); - - std::string alphabet("abcdefghijklmnopqrstuvwxyz"); - std::string alphabet_backwards("zyxwvutsrqponmlkjihgfedcba"); - EXPECT_EQUAL(ReverseText(alphabet), alphabet_backwards); - return 0; -} - diff --git a/native_client_sdk/src/examples/hello_world_newlib/hello_world_c.c b/native_client_sdk/src/examples/hello_world_newlib/hello_world_c.c deleted file mode 100644 index 5169514..0000000 --- a/native_client_sdk/src/examples/hello_world_newlib/hello_world_c.c +++ /dev/null @@ -1,289 +0,0 @@ -/* Copyright (c) 2012 The Chromium Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/** @file hello_world.c - * This example demonstrates loading, running and scripting a very simple - * NaCl module. - */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "ppapi/c/pp_errors.h" -#include "ppapi/c/pp_module.h" -#include "ppapi/c/pp_var.h" -#include "ppapi/c/ppb.h" -#include "ppapi/c/ppb_instance.h" -#include "ppapi/c/ppb_messaging.h" -#include "ppapi/c/ppb_var.h" -#include "ppapi/c/ppp.h" -#include "ppapi/c/ppp_instance.h" -#include "ppapi/c/ppp_messaging.h" - -struct MessageInfo { - PP_Instance instance; - struct PP_Var message; -}; - -static const char* const kReverseTextMethodId = "reverseText"; -static const char* const kFortyTwoMethodId = "fortyTwo"; -static const char kMessageArgumentSeparator = ':'; -static const char kNullTerminator = '\0'; - -static PPB_Messaging* ppb_messaging_interface = NULL; -static PPB_Var* ppb_var_interface = NULL; -static PP_Module module_id = 0; - - -/** - * Returns a mutable C string contained in the @a var or NULL if @a var is not - * string. This makes a copy of the string in the @ var and adds a NULL - * terminator. Note that VarToUtf8() does not guarantee the NULL terminator on - * the returned string. See the comments for VatToUtf8() in ppapi/c/ppb_var.h - * for more info. The caller is responsible for freeing the returned memory. - * @param[in] var PP_Var containing string. - * @return a C string representation of @a var. - * @note The caller is responsible for freeing the returned string. - */ -static char* VarToCStr(struct PP_Var var) { - uint32_t len = 0; - if (ppb_var_interface != NULL) { - const char* var_c_str = ppb_var_interface->VarToUtf8(var, &len); - if (len > 0) { - char* c_str = (char*)malloc(len + 1); - memcpy(c_str, var_c_str, len); - c_str[len] = kNullTerminator; - return c_str; - } - } - return NULL; -} - -/** - * Creates new string PP_Var from C string. The resulting object will be a - * refcounted string object. It will be AddRef()ed for the caller. When the - * caller is done with it, it should be Release()d. - * @param[in] str C string to be converted to PP_Var - * @return PP_Var containing string. - */ -static struct PP_Var CStrToVar(const char* str) { - if (ppb_var_interface != NULL) { - return ppb_var_interface->VarFromUtf8(str, strlen(str)); - } - return PP_MakeUndefined(); -} - -/** - * Reverse C string in-place. - * @param[in,out] str C string to be reversed - */ -static void ReverseStr(char* str) { - char* right = str + strlen(str) - 1; - char* left = str; - while (left < right) { - char tmp = *left; - *left++ = *right; - *right-- = tmp; - } -} - -/** - * A simple function that always returns 42. - * @return always returns the integer 42 - */ -static struct PP_Var FortyTwo() { - return PP_MakeInt32(42); -} - -/** - * Called when the NaCl module is instantiated on the web page. The identifier - * of the new instance will be passed in as the first argument (this value is - * generated by the browser and is an opaque handle). This is called for each - * instantiation of the NaCl module, which is each time the <embed> tag for - * this module is encountered. - * - * If this function reports a failure (by returning @a PP_FALSE), the NaCl - * module will be deleted and DidDestroy will be called. - * @param[in] instance The identifier of the new instance representing this - * NaCl module. - * @param[in] argc The number of arguments contained in @a argn and @a argv. - * @param[in] argn An array of argument names. These argument names are - * supplied in the <embed> tag, for example: - * <embed id="nacl_module" dimensions="2"> - * will produce two arguments, one named "id" and one named "dimensions". - * @param[in] argv An array of argument values. These are the values of the - * arguments listed in the <embed> tag. In the above example, there will - * be two elements in this array, "nacl_module" and "2". The indices of - * these values match the indices of the corresponding names in @a argn. - * @return @a PP_TRUE on success. - */ -static PP_Bool Instance_DidCreate(PP_Instance instance, - uint32_t argc, - const char* argn[], - const char* argv[]) { - return PP_TRUE; -} - -/** - * Called when the NaCl module is destroyed. This will always be called, - * even if DidCreate returned failure. This routine should deallocate any data - * associated with the instance. - * @param[in] instance The identifier of the instance representing this NaCl - * module. - */ -static void Instance_DidDestroy(PP_Instance instance) { -} - -/** - * Called when the position, the size, or the clip rect of the element in the - * browser that corresponds to this NaCl module has changed. - * @param[in] instance The identifier of the instance representing this NaCl - * module. - * @param[in] position The location on the page of this NaCl module. This is - * relative to the top left corner of the viewport, which changes as the - * page is scrolled. - * @param[in] clip The visible region of the NaCl module. This is relative to - * the top left of the plugin's coordinate system (not the page). If the - * plugin is invisible, @a clip will be (0, 0, 0, 0). - */ -static void Instance_DidChangeView(PP_Instance instance, - PP_Resource view_resource) { -} - -/** - * Notification that the given NaCl module has gained or lost focus. - * Having focus means that keyboard events will be sent to the NaCl module - * represented by @a instance. A NaCl module's default condition is that it - * will not have focus. - * - * Note: clicks on NaCl modules will give focus only if you handle the - * click event. You signal if you handled it by returning @a true from - * HandleInputEvent. Otherwise the browser will bubble the event and give - * focus to the element on the page that actually did end up consuming it. - * If you're not getting focus, check to make sure you're returning true from - * the mouse click in HandleInputEvent. - * @param[in] instance The identifier of the instance representing this NaCl - * module. - * @param[in] has_focus Indicates whether this NaCl module gained or lost - * event focus. - */ -static void Instance_DidChangeFocus(PP_Instance instance, - PP_Bool has_focus) { -} - -/** - * Handler that gets called after a full-frame module is instantiated based on - * registered MIME types. This function is not called on NaCl modules. This - * function is essentially a place-holder for the required function pointer in - * the PPP_Instance structure. - * @param[in] instance The identifier of the instance representing this NaCl - * module. - * @param[in] url_loader A PP_Resource an open PPB_URLLoader instance. - * @return PP_FALSE. - */ -static PP_Bool Instance_HandleDocumentLoad(PP_Instance instance, - PP_Resource url_loader) { - /* NaCl modules do not need to handle the document load function. */ - return PP_FALSE; -} - -/** - * Handler for messages coming in from the browser via postMessage. Extracts - * the method call from @a message, parses it for method name and value, then - * calls the appropriate function. In the case of the reverseString method, the - * message format is a simple colon-separated string. The first part of the - * string up to the colon is the method name; after that is the string argument. - * @param[in] instance The instance ID. - * @param[in] message The contents, copied by value, of the message sent from - * browser via postMessage. - */ -void Messaging_HandleMessage(PP_Instance instance, struct PP_Var var_message) { - struct PP_Var var_result = PP_MakeUndefined(); - char* message; - - if (var_message.type != PP_VARTYPE_STRING) { - /* Only handle string messages */ - return; - } - message = VarToCStr(var_message); - if (message == NULL) - return; - - if (strncmp(message, kFortyTwoMethodId, strlen(kFortyTwoMethodId)) == 0) { - var_result = FortyTwo(); - } else if (strncmp(message, - kReverseTextMethodId, - strlen(kReverseTextMethodId)) == 0) { - /* Use everything after the ':' in |message| as the string argument. */ - char* string_arg = strchr(message, kMessageArgumentSeparator); - if (string_arg != NULL) { - string_arg += 1; /* Advance past the ':' separator. */ - ReverseStr(string_arg); - var_result = CStrToVar(string_arg); - } - } - free(message); - - /* Echo the return result back to browser. Note that HandleMessage is always - * called on the main thread, so it's OK to post the message back to the - * browser directly from here. This return post is asynchronous. - */ - ppb_messaging_interface->PostMessage(instance, var_result); - /* If the message was created using VarFromUtf8() it needs to be released. - * See the comments about VarFromUtf8() in ppapi/c/ppb_var.h for more - * information. - */ - if (var_result.type == PP_VARTYPE_STRING) { - ppb_var_interface->Release(var_result); - } -} - -/** - * Entry points for the module. - * Initialize needed interfaces: PPB_Core, PPB_Messaging and PPB_Var. - * @param[in] a_module_id module ID - * @param[in] get_browser pointer to PPB_GetInterface - * @return PP_OK on success, any other value on failure. - */ -PP_EXPORT int32_t PPP_InitializeModule(PP_Module a_module_id, - PPB_GetInterface get_browser) { - module_id = a_module_id; - ppb_messaging_interface = - (PPB_Messaging*)(get_browser(PPB_MESSAGING_INTERFACE)); - ppb_var_interface = (PPB_Var*)(get_browser(PPB_VAR_INTERFACE)); - - return PP_OK; -} - -/** - * Returns an interface pointer for the interface of the given name, or NULL - * if the interface is not supported. - * @param[in] interface_name name of the interface - * @return pointer to the interface - */ -PP_EXPORT const void* PPP_GetInterface(const char* interface_name) { - if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0) { - static PPP_Instance instance_interface = { - &Instance_DidCreate, - &Instance_DidDestroy, - &Instance_DidChangeView, - &Instance_DidChangeFocus, - &Instance_HandleDocumentLoad, - }; - return &instance_interface; - } else if (strcmp(interface_name, PPP_MESSAGING_INTERFACE) == 0) { - static PPP_Messaging messaging_interface = { - &Messaging_HandleMessage - }; - return &messaging_interface; - } - return NULL; -} - -/** - * Called before the plugin module is unloaded. - */ -PP_EXPORT void PPP_ShutdownModule() { -} diff --git a/native_client_sdk/src/examples/hello_world_newlib/hello_world_c.html b/native_client_sdk/src/examples/hello_world_newlib/hello_world_c.html deleted file mode 100644 index ff43841..0000000 --- a/native_client_sdk/src/examples/hello_world_newlib/hello_world_c.html +++ /dev/null @@ -1,126 +0,0 @@ -<!DOCTYPE html> -<html> - <!-- - Copyright (c) 2011 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. - --> -<head> - <title>Hello, World!</title> - - <script type="text/javascript"> - helloWorldModule = null; // Global application object. - statusText = 'NO-STATUS'; - - // Indicate success when the NaCl module has loaded. - function moduleDidLoad() { - helloWorldModule = document.getElementById('hello_world'); - updateStatus('SUCCESS'); - } - - // Handle a message coming from the NaCl module. - function handleMessage(message_event) { - alert(message_event.data); - } - - // If the page loads before the Native Client module loads, then set the - // status message indicating that the module is still loading. Otherwise, - // do not change the status message. - function pageDidLoad() { - // Set the focus on the text input box. Doing this means you can press - // return as soon as the page loads, and it will fire the reversetText() - // function. - document.forms.helloForm.inputBox.focus(); - if (helloWorldModule == null) { - updateStatus('LOADING...'); - } else { - // It's possible that the Native Client module onload event fired - // before the page's onload event. In this case, the status message - // will reflect 'SUCCESS', but won't be displayed. This call will - // display the current message. - updateStatus(); - } - } - - function fortyTwo() { - helloWorldModule.postMessage('fortyTwo'); - } - - function reverseText() { - // Grab the text from the text box, pass it into reverseText() - var inputBox = document.forms.helloForm.inputBox; - helloWorldModule.postMessage('reverseText:' + inputBox.value); - // Note: a |false| return tells the <form> tag to cancel the GET action - // when submitting the form. - return false; - } - - // Set the global status message. If the element with id 'statusField' - // exists, then set its HTML to the status message as well. - // opt_message The message test. If this is null or undefined, then - // attempt to set the element with id 'statusField' to the value of - // |statusText|. - function updateStatus(opt_message) { - if (opt_message) - statusText = opt_message; - var statusField = document.getElementById('statusField'); - if (statusField) { - statusField.innerHTML = statusText; - } - } - </script> -</head> -<body onload="pageDidLoad()"> - -<h1>Native Client Simple Module</h1> -<p> - <form name="helloForm" - action="" - method="get" - onsubmit="return reverseText()"> - <input type="text" id="inputBox" name="inputBox" value="Hello world" /><p/> - <input type="button" value="Call fortyTwo()" onclick="fortyTwo()" /> - <input type="submit" value="Call reverseText()" /> - </form> - <!-- Load the published .nexe. This includes the 'src' attribute which - shows how to load multi-architecture modules. Each entry in the "nexes" - object in the .nmf manifest file is a key-value pair: the key is the runtime - ('x86-32', 'x86-64', etc.); the value is a URL for the desired NaCl module. - To load the debug versions of your .nexes, set the 'src' attribute to the - _dbg.nmf version of the manifest file. - - Note: The <EMBED> element is wrapped inside a <DIV>, which has both a 'load' - and a 'message' event listener attached. This wrapping method is used - instead of attaching the event listeners directly to the <EMBED> element to - ensure that the listeners are active before the NaCl module 'load' event - fires. This also allows you to use PPB_Messaging.PostMessage() (in C) or - pp::Instance.PostMessage() (in C++) from within the initialization code in - your NaCl module. - --> - <div id="listener"> - <script type="text/javascript"> - var listener = document.getElementById('listener') - listener.addEventListener('load', moduleDidLoad, true); - listener.addEventListener('message', handleMessage, true); - </script> - - <embed name="nacl_module" - id="hello_world" - width=0 height=0 - src="hello_world_c.nmf" - type="application/x-nacl" /> - </div> - -</p> - -<p>If the module is working correctly, a click on the "Call fortyTwo()" button - should open a popup dialog containing <b>42</b> as its value.</p> - -<p> Clicking on the "Call reverseText()" button - should open a popup dialog containing the textbox contents and its reverse - as its value.</p> - -<h2>Status</h2> -<div id="statusField">NO-STATUS</div> -</body> -</html> diff --git a/native_client_sdk/src/examples/hello_world_newlib/hello_world_c.nmf b/native_client_sdk/src/examples/hello_world_newlib/hello_world_c.nmf deleted file mode 100644 index 377d01e..0000000 --- a/native_client_sdk/src/examples/hello_world_newlib/hello_world_c.nmf +++ /dev/null @@ -1,6 +0,0 @@ -{ - "program": { - "x86-64": {"url": "hello_world_c_x86_64.nexe"}, - "x86-32": {"url": "hello_world_c_x86_32.nexe"} - } -} diff --git a/native_client_sdk/src/examples/index_staging.html b/native_client_sdk/src/examples/index_staging.html deleted file mode 100644 index a3d2a88..0000000 --- a/native_client_sdk/src/examples/index_staging.html +++ /dev/null @@ -1,167 +0,0 @@ -<!-- - Copyright (c) 2011 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. ---> - -<!DOCTYPE html PUBLIC - "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<style type="text/css"> -dt { - font-weight: bold; -} -dd { - margin-bottom: 12pt; - width: 800px; -} -</style> -<link href="http://code.google.com/css/codesite.css" rel="stylesheet" - type="text/css" /> -<title>Native Client Examples</title> -</head> -<body> -<h1>Native Client Examples</h1> -<dd><p>This page lists all of the examples available in the most recent Native - Client SDK bundle. Each example is designed to teach a few specific Native - Client programming concepts. You will need to setup the build environment - including a path to 'make' which can be found in the 'tools' directory for - Windows, and the variable NACL_SDK_ROOT which points to one of the pepper - bundles found under the SDK install location. Calling make from the examples - directory will build all the projects, while calling make from and individual - example directory will build only that example. - </p> -</dd> -<h3>Using the Tools</h3> -<dd><p>The following "hello_world" examples, show the basic outline of a Native -Client application. The make files in each of the examples bellow show a -simple way to build a NaCl application using -<a href="http://www.gnu.org/software/make/manual/make.html">GNU Make</a>. -See the link for further information. -</p></dd> -<dl> - <dt><a href="hello_world_newlib/hello_world.html"> - Hello World (NEWLIB)</a></dt> - <dd>The Hello World In C example demonstrates the basic structure of all - Native Client applications. This example loads a Native Client module. The - page tracks the status of the module as it load. On a successful load, the - module will post a message containing the string "Hello World" back to - JavaScript which will display it as an alert. - <p>Teaching focus: Basic HTML, JavaScript, and module architecture.</p> - </dd> - <dt><a href="hello_world_glibc/hello_world.html"> - Hello World (GLIBC)</a></dt> - <dd>The Hello World (GLIBC) example is identical to the one above, with the - exception that it used the GLIBC toolchain which uses Shared Objects. The use - of Shared Objects means a more complicated manifest file (NMF) which is needed - to allow the application to find the libraries. The NMF is automatically - generated as part of the build process, by scanning the application for - dependencies. - <p>Teaching focus: Basic HTML, JavaScript, Shared Objects, and module - architecture.</p> - </dd> - <dt><a href="hello_world_interactive/hello_world.html"> - Interactive Hello World in C++</a></dt> - <dd>The Interactive Hello World C++ example demonstrates the basic structure - of all Native Client applications. This example loads a Native Client module - which uses two way interaction with JavaScript whenever a button is clicked. - The NaCl module will respond with the number 42 or the reversed version of the - string in the text box when the appropriate button is clicked. - <p>Teaching focus: Basic HTML, JavaScript, C++ PPAPI, and module - architecture; Messaging API.</p> - </dd> - -<h3>Common APIs</h3> -<dd><p>The following set of examples illustrate various Pepper APIs including -audio, 2D, 3D, input and urls.</p></dd> -<dt><a href="sine_synth/sine_synth.html">Sine Wave Synthesizer</a></dt> - <dd> The Sine Wave Synthesizer example demonstrates playing sound (a sine - wave). Enter the desired frequency and hit play to start, stop to end. The - frequency box will display "Loading, please wait." while the module loads. - <p>Teaching focus: Audio.</p> - </dd> -<dt><a href="input_events/input_events.html">Input Events</a></dt> - <dd> The Input Events example demonstrates how to handle events triggered by the user. This example allows a user - to interact with a square representing a module instance. Events are displayed on the screen as the user clicks, scrolls, types, inside or outside - of the square. - - <p>Teaching focus: Keyboard and mouse input, view change, and focus events.</p> - </dd> - <dt><a href="pi_generator/pi_generator.html">Pi Generator</a></dt> - <dd> The Pi Generator example demonstrates creating a helper thread that estimate pi using the Monte Carlo - method while randomly putting 1,000,000,000 points inside a 2D square that shares two - sides with a quarter circle. - - <p>Teaching focus: Thread creation, 2D graphics, view change events.</p> - </dd> - <dt><a href="tumbler/tumbler.html">Tumbler</a></dt> - <dd> The Tumbler example demonstrates how to create a 3D cube that you can rotate with your mouse while pressing the - left mouse button. This example creates a 3D context and draws to it using - OpenGL ES. The JavaScript implements a virtual trackball interface to - map mouse movements into 3D rotations using simple 3D vector math and - quaternions. - - <p>Teaching focus: 3D graphics</p> - </dd> - <dt><a href="geturl/geturl.html">Get URL</a></dt> - <dd> The Get URL example demonstrates fetching an URL and then displaying its contents. - - <p>Teaching focus: URL loading.</p> - </dd> - -<h3>Common Concepts</h3> -<dd><p>The following set of examples illustrate various common concepts such as -showing load progress, using Shared Objects (dynamic libraries), -mulithreading...</p></dd> -<dt><a href="dlopen/dlopen.html">Shared Object Loading (GLIBC)</a></dt> - <dd> The Load Progress example demonstrates how to listen for and handle - events that occur while a NaCl module loads. This example listens for - different load event types and dispatches different events to their - respective handler. This example also checks for valid browser version and - shows how to calculate and display loading progress. - <p>Teaching focus: Using shared objects.</p> - </dd> -<dt><a href="load_progress/load_progress.html">Load Progress</a></dt> - <dd> The Load Progress example demonstrates how to listen for and handle events that occur while a - NaCl module loads. This example listens for different load event types and dispatches different events to their respective handler. This example also checks for valid browser - version and shows how to calculate and display loading progress. - - <p>Teaching focus: Progress event handling.</p> - </dd> -<dt><a href="pong/pong.html">Pong</a></dt> - <dd> The Pong example demonstrates how to create a basic 2D video game and how to store application - information in a local persistent file. This game uses up and - down arrow keyboard input events to move the paddle. - - <p>Teaching focus: File I/O, 2D graphics, input events.</p> - </dd> - <dt><a href="multithreaded_input_events/mt_input_events.html">Multi-threaded Input Events</a></dt> - <dd>The Multithreaded Input Events example combines HTML, Javascript, - and C++ (the C++ is compiled to create a .nexe file). - The C++ shows how to handle input events in a multi-threaded application. - The main thread converts input events to non-pepper events and puts them on - a queue. The worker thread pulls them off of the queue, converts them to a - string, and then uses CallOnMainThread so that PostMessage can be send the - result of the worker thread to the browser. - <p>Teaching focus: Multithreaded event handling.</p> - </dd> - <dt><a href="fullscreen_tumbler/fullscreen_tumbler.html">Full-screen Tumbler</a></dt> - <dd>This is a modified version of the Tumbler example above that supports - full-screen display. It is in every way identical to Tumbler in - functionality, except that it adds the ability to switch to/from - full-screen display by pressing the Enter key. - <p>Teaching focus: Full-screen</p> - </dd> - <dt><a href="mouselock/mouselock.html">Mouse Locker</a></dt> - <dd> The Mouselock example demonstrates how to use the MouseLock API to hide - the mouse cursor. Mouse lock is only available in full-screen mode. You can - lock and unlock the mouse while in full-screen mode by pressing the Enter key. - - <p>Teaching focus: Mouse lock, Full-screen</p> - </dd> -</dl> -</body> -</html> diff --git a/native_client_sdk/src/scons b/native_client_sdk/src/scons deleted file mode 100755 index 63c19d3..0000000 --- a/native_client_sdk/src/scons +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2011 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -readonly SCRIPT_DIR="$(dirname "$0")" -readonly SCRIPT_DIR_ABS="$(cd "${SCRIPT_DIR}" ; pwd -P)" -readonly SRC_DIR="$(dirname $(dirname ${SCRIPT_DIR_ABS}))" - -# Use the batch file as an entry point if on cygwin. -if [ "x${OSTYPE}" = "xcygwin" ]; then - # Use extended globbing (cygwin should always have it). - shopt -s extglob - # Filter out cygwin python (everything under /usr or /bin, or *cygwin*). - export PATH=${PATH/#\/bin*([^:])/} - export PATH=${PATH//:\/bin*([^:])/} - export PATH=${PATH/#\/usr*([^:])/} - export PATH=${PATH//:\/usr*([^:])/} - export PATH=${PATH/#*([^:])cygwin*([^:])/} - export PATH=${PATH//:*([^:])cygwin*([^:])/} - "${SCRIPT_DIR_ABS}/scons.bat" $* - exit -fi - -readonly BASE_SCRIPT="${SRC_DIR}/third_party/scons-2.0.1/script/scons" - -export NACL_SDK_ROOT="${SCRIPT_DIR_ABS}/../../native_client" - -export SCONS_LIB_DIR="${SRC_DIR}/third_party/scons-2.0.1/engine" -export PYTHONPATH="${SCONS_LIB_DIR}:${SRC_DIR}/native_client/build:${SCRIPT_DIR_ABS}" -# We have to do this because scons overrides PYTHONPATH and does not preserve -# what is provided by the OS. The custom variable name won't be overwritten. -export PYMOX="${SRC_DIR}/third_party/pymox/src" - -"${BASE_SCRIPT}" --file=main.scons $* - diff --git a/native_client_sdk/src/scons.bat b/native_client_sdk/src/scons.bat deleted file mode 100755 index e836ad1..0000000 --- a/native_client_sdk/src/scons.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off
-
-:: Copyright (c) 2011 The Chromium Authors. All rights reserved.
-:: Use of this source code is governed by a BSD-style license that can be
-:: found in the LICENSE file.
-
-setlocal
-
-set NACL_SDK_ROOT=%~dp0..\..\native_client
-
-:: Preserve a copy of the PATH (in case we need it later, mainly for cygwin).
-set PRESCONS_PATH=%PATH%
-
-:: Set the PYTHONPATH and SCONS_LIB_DIR so we can import SCons modules
-set SCONS_LIB_DIR=%~dp0..\..\third_party\scons-2.0.1\engine
-set PYTHONPATH=%~dp0..\..\third_party\scons-2.0.1\engine;%~dp0..\..\native_client\build;%~dp0
-
-:: We have to do this because scons overrides PYTHONPATH and does not preserve
-:: what is provided by the OS. The custom variable name won't be overwritten.
-set PYMOX=%~dp0..\..\third_party\pymox\src
-
-:: Stop incessant CYGWIN complains about "MS-DOS style path"
-set CYGWIN=nodosfilewarning %CYGWIN%
-
-:: Run the included copy of scons.
-python -O -OO "%~dp0..\..\third_party\scons-2.0.1\script\scons" --file=main.scons %*
-
-:end
|