pnacl

module pnacl

Provides PNaCl support for Nit.

To use this module and compile for PNaCl, you must install the NaCl SDK (This file is based on Pepper 33). If NACL_SDK_ROOT is not set in your PATH, you have to work in 'nacl_sdk/pepper_your_pepper_version/getting_started/your_project_folder'.

Dependencies

dep_module_pnacl-pnaclpnaclcorecorepnacl->coreconverterconverterconverter->pnacl

Imports

  • core: Standard classes and methods used by default by Nit programs and libraries.

Concerns

  • pnacl: Provides PNaCl support for Nit.
    • pnacl: Provides PNaCl support for Nit.
  • core: Nit common library of core classes and methods
    • kernel: Most basic classes and methods.
    • text: All the classes and methods related to the manipulation of text entities
      • abstract_text: Abstract class for manipulation of sequences of characters

in pnacl::pnacl

PepperArray

extern class PepperArray

in pnacl::pnacl

Nit class representing a Pepper C API PP_Var typed as an Array.

Introduces
  • new
  • native_get:  Returns the element at the specified position as a PepperVar.
  • []: Returns the element at the specified position.
  • length: Returns an int containing the length of the PepperArray.
  • native_set: Takes a PepperVar for the 'value' param.
  • []=: Sets the value of an element in the array at indicated index.
  • length=: Sets the array length.
Redefines
  • SELF: Type of this instance, automatically specialized in every class

PepperDictionary

extern class PepperDictionary

in pnacl::pnacl

Nit class representing a Pepper C API PP_Var typed as a Dictionary.

Introduces
  • new
  • native_get: Get fonction using PepperVars.
  • []: Returns the value associated with 'key'.
  • native_set: Set function using PepperVars.
  • []=: Sets the value associated with the specified key.
  • native_delete: Deletes the specified key and its associated value, if the key exists.
  • delete: Deletes the specified key and its associated value, if the key exists.
  • native_has_key: Checks whether a key exists.
  • has_key: Checks whether a key exists.
  • get_keys: Gets all the keys in a dictionary.
  • copy: Use this function to copy a dictionary.
Redefines
  • SELF: Type of this instance, automatically specialized in every class

PnaclApp

class PnaclApp

in pnacl::pnacl

 Class that provides the tools to interact with PNaCl.

Introduces
  • initialize:  Sets everything up to work, need to be called at first.
  • post_message: Posts a message to JS.
  • post_dictionary: Posts a dictionary to JS.
  • handle_message: Is called when a message is received from JS.
  • handle_dictionary: Is called when a Dictionary is received from JS.
  • check_dictionary:  Checks if there is a dictionary in the queue, and if so the dictionary is handled automatically.
  • run:  Infinite loop on check_dictionary
Redefines
  • SELF: Type of this instance, automatically specialized in every class

PnaclStream

class PnaclStream

in pnacl::pnacl

A stream for PNaCl, redefines basic input and output methods.

Introduces
Redefines
  • SELF: Type of this instance, automatically specialized in every class
  • init
  • end_reached: Has the last fill_buffer reached the end
  • eof: Is there something to read.
  • write:  Redefintion of 'write' to send messages to the browser.
  • is_writable: Can the stream be used to write
  • fill_buffer: fill_buffer now checks for a message in the message queue which is filled by user inputs.

from core::kernel

Sys

from core::text::abstract_text