Compare commits

...

51 Commits

Author SHA1 Message Date
Arfon Smith
78d4abe808 Merge pull request #2295 from github/cut-release-v4.5.4
Bumping version to v4.5.4
2015-03-31 20:16:53 -05:00
Arfon Smith
cb97417af8 Bumping version to v4.5.4 2015-03-31 19:48:34 -05:00
Arfon Smith
d1c94c75ea Merge pull request #2294 from github/grammars
Grammars update
2015-03-31 19:45:16 -05:00
Arfon Smith
0c8c6c9814 Merge pull request #2293 from github/sphinx-docs-tests
Some tests to go with #2290
2015-03-31 19:39:45 -05:00
Arfon Smith
3270a8896d Grammars update 2015-03-31 19:37:08 -05:00
Arfon Smith
20f19bf049 Some tests to go with #2290 2015-03-31 19:33:50 -05:00
Arfon Smith
0cc33fd560 Merge pull request #2290 from untitaker/patch-1
Ignore assets from Sphinx docs
2015-03-31 19:29:23 -05:00
Arfon Smith
fa54fc2735 Merge pull request #2233 from tesch1/tesch1-emacs-patch-1
fix emacs modeline parsing
2015-03-31 19:27:33 -05:00
Arfon Smith
216e0457ff Merge pull request #2291 from iFarbod/patch-1
Added Color for the Squirrel Language
2015-03-31 19:25:40 -05:00
iFarbod
678f90acf7 Added Color for the Squirrel Language
Picked the color from the Squirrel Language's website.
2015-04-01 01:23:59 +04:30
Arfon Smith
dd0d5c08bb Merge pull request #2289 from lepture/patch-fixtures
add tests/fixtures to vendor.yml
2015-03-31 11:43:39 -05:00
Markus Unterwaditzer
3837fed59e Ignore assets from Sphinx docs 2015-03-31 15:21:40 +02:00
Hsiaoming Yang
e4ce4edd5c add tests/fixtures to vendor.yml 2015-03-31 20:08:18 +08:00
Arfon Smith
a0fb54fe70 Merge pull request #2286 from github/puphpet
Adding puphpet to vendored list
2015-03-30 16:57:43 -05:00
Arfon Smith
e946ceaa6f Grammar 2015-03-30 16:24:55 -05:00
Arfon Smith
285af6512e Adding puphpet to vendored list 2015-03-30 16:24:11 -05:00
Arfon Smith
5ae5108a69 Merge pull request #2247 from larsbrinkhoff/renderscript
Add RenderScript and Filterscript
2015-03-30 16:08:42 -05:00
Lars Brinkhoff
02ae60f434 Samples for RenderScript and Filterscript.
All files are from The Android Open Source Project; license APL 2.0.
2015-03-28 12:34:20 +01:00
Lars Brinkhoff
03dc4e1ff4 Add RenderScript and Filterscript. 2015-03-28 12:34:20 +01:00
Arfon Smith
c39b42abba Merge pull request #2075 from philix/patch-1
Add cpplint.py to vendor.yml
2015-03-27 11:02:36 -07:00
Arfon Smith
661972f585 Merge pull request #2275 from github/bump-escape-utils
Bump escape-utils to 1.1.0
2015-03-27 09:25:29 -07:00
Arfon Smith
078aff6ee3 Merge pull request #2276 from MakeNowJust/patch-1
Fix ada aliases
2015-03-27 09:24:31 -07:00
Arfon Smith
4fed108b2c Merge pull request #2279 from joewiz/patch-1
Add .odd to XML extensions
2015-03-26 11:21:47 -07:00
Joe Wicentowski
fc9beb58aa Add sample TEI ODD file (.odd) 2015-03-26 14:00:17 -04:00
Joe Wicentowski
4623b4a83e Add .odd to XML extensions
See discussion at #2238. 

[ODD](http://en.wikipedia.org/wiki/Text_Encoding_Initiative#ODD) is an XML-based vocabulary for defining schemas for Text Encoding Initiative (TEI) projects, used widely in the humanities.  ODD should be rendered using XML syntax but is currently displayed as plain text (see [this example](https://github.com/wolfgangmm/tei-simple-pm/blob/master/odd/teisimple.odd)).  There are [nearly 500 ODD files](https://github.com/search?q=extension%3Aodd+NOT+djfhdirijdskqdhd&type=Code&utf8=%E2%9C%93) in GitHub, and this number is projected to grow.
2015-03-26 13:18:49 -04:00
TSUYUSATO Kitsune
2ba6ecefe5 Fix ada aliases 2015-03-26 12:08:46 +09:00
Garen Torikian
91c2a4682d Merge pull request #2274 from csimons/master
intro.wisp: Fixed typographical error ('rather then' -> 'rather than').
2015-03-25 13:24:10 -07:00
Patrick Toomey
738be195ef Bump escape-utils to 1.1.0 2015-03-25 14:18:46 -06:00
Christopher L. Simons
5dcc4d74ec intro.wisp: Fixed typographical error ('rather then' -> 'rather than'). 2015-03-25 14:35:16 -04:00
Arfon Smith
4213bec62a Merge pull request #2272 from lpil/master
Elixir: Add mix.lock filename
2015-03-25 09:04:07 -05:00
Louis Pilfold
babe733bf4 Elixir: Add mix.lock filename 2015-03-25 13:52:52 +00:00
Arfon Smith
ab5f60555e Merge pull request #2270 from larsbrinkhoff/ocaml
Add interpreters for OCaml.
2015-03-25 08:39:49 -05:00
Lars Brinkhoff
b61e33a49e Add interpreters for OCaml. 2015-03-25 08:11:40 +01:00
Arfon Smith
a0d5a8338b Merge pull request #2269 from stuartpb/patch-2
Use #000080 for Lua color
2015-03-24 19:24:34 -05:00
Arfon Smith
eec321f013 Merge pull request #2265 from github/cut-release-v4.5.3
Bumping to v4.5.3
2015-03-24 19:08:59 -05:00
Stuart P. Bentley
e538f72b63 Use #000080 for Lua color
This is the color of the official Lua logo, as seen at http://www.lua.org/images/
2015-03-24 14:34:13 -07:00
Arfon Smith
44c3d47b30 Bumping to v4.5.3 2015-03-24 12:33:35 -05:00
michael tesch
a5b0b333b0 Merge branch 'master' into tesch1-emacs-patch-1 2015-03-24 09:44:08 +01:00
michael tesch
5f647f2236 more realistic emacs modeline for dtrace sample 2015-03-16 19:56:06 +01:00
michael tesch
50db5c012e disable modelines strategy for webidl sample 2015-03-15 20:18:57 +01:00
michael tesch
dcb14d0fc7 disable modelines strategy for webidl sample 2015-03-15 20:06:41 +01:00
michael tesch
419cfe54e0 disable modelines strategy match for dtrace sample 2015-03-15 13:05:43 +01:00
michael tesch
ce1f51a34f forgot a | 2015-03-15 12:51:14 +01:00
michael tesch
5fd7992f98 dont save useless matches, thanks to pchaigno 2015-03-15 12:40:31 +01:00
michael tesch
fda0f2a042 detect emacs modeline for fundamental as Text 2015-03-14 23:53:17 +01:00
michael tesch
6af4ab6db1 harder test 2015-03-14 23:26:08 +01:00
michael tesch
6aab682728 fixed case with multiple other file vars before and after mode: 2015-03-14 23:24:41 +01:00
michael tesch
a364e4a2dc tests for emacs modeline regex 2015-03-14 23:13:59 +01:00
Michael Tesch
1bb639617c Create seeplusplusEmacs1
one type of emacs modeline
2015-03-14 22:44:02 +01:00
Michael Tesch
068c8a341d better regex for matching emacs modeline
the emacs modeline is actually a per-file variable setting mechanism, which means it can have other flags in it.

this regex extracts the part that corresponds to the file's language ("mode:" - ie emacs major mode)

http://ergoemacs.org/emacs_manual/emacs/Specifying-File-Variables.html
2015-03-14 18:35:57 +01:00
Felipe Oliveira Carvalho
96c2f86613 Add cpplint.py to vendor.yml
`cpplint.py` is Google's Python script used for linting C++ files.
I have a small C++ project with `cpplint.py` included mistakenly making
Python the main language of my project.
2015-02-04 02:22:08 -03:00
46 changed files with 1885 additions and 31 deletions

View File

@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.executables << 'linguist' s.executables << 'linguist'
s.add_dependency 'charlock_holmes', '~> 0.7.3' s.add_dependency 'charlock_holmes', '~> 0.7.3'
s.add_dependency 'escape_utils', '~> 1.0.1' s.add_dependency 'escape_utils', '~> 1.1.0'
s.add_dependency 'mime-types', '>= 1.19' s.add_dependency 'mime-types', '>= 1.19'
s.add_dependency 'rugged', '~> 0.23.0b1' s.add_dependency 'rugged', '~> 0.23.0b1'

View File

@@ -172,13 +172,15 @@ module Linguist
end end
end end
disambiguate "F#", "Forth", "GLSL" do |data| disambiguate "F#", "Forth", "GLSL", "Filterscript" do |data|
if /^(: |new-device)/.match(data) if /^(: |new-device)/.match(data)
Language["Forth"] Language["Forth"]
elsif /^\s*(#light|import|let|module|namespace|open|type)/.match(data) elsif /^\s*(#light|import|let|module|namespace|open|type)/.match(data)
Language["F#"] Language["F#"]
elsif /^\s*(#include|#pragma|precision|uniform|varying|void)/.match(data) elsif /^\s*(#version|precision|uniform|varying|vec[234])/.match(data)
Language["GLSL"] Language["GLSL"]
elsif /#include|#pragma\s+(rs|version)|__attribute__/.match(data)
Language["Filterscript"]
end end
end end
@@ -278,5 +280,12 @@ module Linguist
end end
end end
disambiguate "Rust", "RenderScript" do |data|
if data.include?("^(use |fn |mod |pub |macro_rules|impl|#!?\[)")
Language["Rust"]
elsif /#include|#pragma\s+(rs|version)|__attribute__/.match(data)
Language["RenderScript"]
end
end
end end
end end

View File

@@ -118,7 +118,8 @@ Ada:
- .ada - .ada
- .ads - .ads
aliases: aliases:
- ada95ada2005 - ada95
- ada2005
ace_mode: ada ace_mode: ada
Agda: Agda:
@@ -824,6 +825,8 @@ Elixir:
- .ex - .ex
- .exs - .exs
ace_mode: elixir ace_mode: elixir
filenames:
- mix.lock
Elm: Elm:
type: programming type: programming
@@ -935,6 +938,14 @@ Fantom:
tm_scope: source.fan tm_scope: source.fan
ace_mode: text ace_mode: text
Filterscript:
type: programming
group: RenderScript
extensions:
- .fs
tm_scope: none
ace_mode: text
Formatted: Formatted:
type: data type: data
extensions: extensions:
@@ -1730,7 +1741,7 @@ LoomScript:
Lua: Lua:
type: programming type: programming
ace_mode: lua ace_mode: lua
color: "#fa1fa1" color: "#000080"
extensions: extensions:
- .lua - .lua
- .fcgi - .fcgi
@@ -2075,6 +2086,10 @@ OCaml:
- .mli - .mli
- .mll - .mll
- .mly - .mly
interpreters:
- ocaml
- ocamlrun
tm_scope: source.ocaml
ObjDump: ObjDump:
type: data type: data
@@ -2670,6 +2685,14 @@ Redcode:
tm_scope: none tm_scope: none
ace_mode: text ace_mode: text
RenderScript:
type: programming
extensions:
- .rs
- .rsh
tm_scope: none
ace_mode: text
RobotFramework: RobotFramework:
type: programming type: programming
extensions: extensions:
@@ -2978,6 +3001,7 @@ SourcePawn:
Squirrel: Squirrel:
type: programming type: programming
color: "#800000"
extensions: extensions:
- .nut - .nut
tm_scope: source.c++ tm_scope: source.c++
@@ -3110,6 +3134,8 @@ Tea:
Text: Text:
type: prose type: prose
wrap: true wrap: true
aliases:
- fundamental
extensions: extensions:
- .txt - .txt
- .fr - .fr
@@ -3320,6 +3346,7 @@ XML:
- .mxml - .mxml
- .nproj - .nproj
- .nuspec - .nuspec
- .odd
- .osm - .osm
- .plist - .plist
- .pluginspec - .pluginspec

View File

@@ -1,7 +1,7 @@
module Linguist module Linguist
module Strategy module Strategy
class Modeline class Modeline
EmacsModeline = /-\*-\s*mode:\s*(\w+);?\s*-\*-/i EmacsModeline = /-\*-\s*(?:(?!mode)[\w-]+\s*:\s*(?:[\w+-]+)\s*;?\s*)*(?:mode\s*:)?\s*([\w+-]+)\s*(?:;\s*(?!mode)[\w-]+\s*:\s*[\w+-]+\s*)*;?\s*-\*-/i
VimModeline = /\/\*\s*vim:\s*set\s*(?:ft|filetype)=(\w+):\s*\*\//i VimModeline = /\/\*\s*vim:\s*set\s*(?:ft|filetype)=(\w+):\s*\*\//i
# Public: Detects language based on Vim and Emacs modelines # Public: Detects language based on Vim and Emacs modelines

View File

@@ -24,6 +24,9 @@
- (^|/)config.guess$ - (^|/)config.guess$
- (^|/)config.sub$ - (^|/)config.sub$
# Linters
- cpplint.py
# Node dependencies # Node dependencies
- node_modules/ - node_modules/
@@ -143,6 +146,9 @@
## Python ## ## Python ##
# Sphinx
- (^|/)docs?/_?(build|themes?|templates?|static)/
# django # django
- (^|/)admin_media/ - (^|/)admin_media/
@@ -221,7 +227,7 @@
- ^readme$ - ^readme$
# Test fixtures # Test fixtures
- ^[Tt]est/fixtures/ - ^[Tt]ests?/fixtures/
# PhoneGap/Cordova # PhoneGap/Cordova
- (^|/)cordova([^.]*)\.js$ - (^|/)cordova([^.]*)\.js$
@@ -233,7 +239,7 @@
# Vagrant # Vagrant
- ^Vagrantfile$ - ^Vagrantfile$
# .DS_Store's # .DS_Stores
- .[Dd][Ss]_[Ss]tore$ - .[Dd][Ss]_[Ss]tore$
# R packages # R packages
@@ -252,5 +258,8 @@
- proguard.pro - proguard.pro
- proguard-rules.pro - proguard-rules.pro
# PuPHPet
- ^puphpet/
# Android Google APIs # Android Google APIs
- (^|/)\.google_apis/ - (^|/)\.google_apis/

View File

@@ -1,3 +1,3 @@
module Linguist module Linguist
VERSION = "4.5.2" VERSION = "4.5.4"
end end

View File

@@ -0,0 +1,10 @@
%{"cowboy": {:hex, :cowboy, "1.0.0"},
"cowlib": {:hex, :cowlib, "1.0.1"},
"hackney": {:hex, :hackney, "0.14.3"},
"hound": {:hex, :hound, "0.6.0"},
"httpoison": {:hex, :httpoison, "0.5.0"},
"idna": {:hex, :idna, "1.0.1"},
"phoenix": {:hex, :phoenix, "0.10.0"},
"plug": {:hex, :plug, "0.11.1"},
"poison": {:hex, :poison, "1.3.1"},
"ranch": {:hex, :ranch, "1.0.0"}}

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "ip.rsh"
static rs_matrix4x4 Mat;
void init() {
rsMatrixLoadIdentity(&Mat);
}
void setMatrix(rs_matrix4x4 m) {
Mat = m;
}
uchar4 __attribute__((kernel)) root(uchar4 in) {
float4 f = convert_float4(in);
f = rsMatrixMultiply(&Mat, f);
f = clamp(f, 0.f, 255.f);
return convert_uchar4(f);
}

View File

@@ -0,0 +1,18 @@
#pragma version(1)
#pragma rs java_package_name(foo)
int __attribute__((kernel)) root(uint32_t ain) {
return 0;
}
void __attribute__((kernel)) in_only(uint32_t ain) {
}
int __attribute__((kernel)) out_only() {
return 0;
}
int __attribute__((kernel)) everything(uint32_t ain, uint32_t x, uint32_t y) {
return 0;
}

View File

@@ -0,0 +1,67 @@
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma version(1)
#pragma rs java_package_name(com.android.gallery3d.filtershow.filters)
#pragma rs_fp_relaxed
int32_t gWidth;
int32_t gHeight;
const uchar4 *gPixels;
rs_allocation gIn;
float gCoeffs[9];
void root(const uchar4 *in, uchar4 *out, const void *usrData, uint32_t x, uint32_t y) {
uint32_t x1 = min((int32_t)x+1, gWidth-1);
uint32_t x2 = max((int32_t)x-1, 0);
uint32_t y1 = min((int32_t)y+1, gHeight-1);
uint32_t y2 = max((int32_t)y-1, 0);
float4 p00 = rsUnpackColor8888(gPixels[x1 + gWidth * y1]);
float4 p01 = rsUnpackColor8888(gPixels[x + gWidth * y1]);
float4 p02 = rsUnpackColor8888(gPixels[x2 + gWidth * y1]);
float4 p10 = rsUnpackColor8888(gPixels[x1 + gWidth * y]);
float4 p11 = rsUnpackColor8888(gPixels[x + gWidth * y]);
float4 p12 = rsUnpackColor8888(gPixels[x2 + gWidth * y]);
float4 p20 = rsUnpackColor8888(gPixels[x1 + gWidth * y2]);
float4 p21 = rsUnpackColor8888(gPixels[x + gWidth * y2]);
float4 p22 = rsUnpackColor8888(gPixels[x2 + gWidth * y2]);
p00 *= gCoeffs[0];
p01 *= gCoeffs[1];
p02 *= gCoeffs[2];
p10 *= gCoeffs[3];
p11 *= gCoeffs[4];
p12 *= gCoeffs[5];
p20 *= gCoeffs[6];
p21 *= gCoeffs[7];
p22 *= gCoeffs[8];
p00 += p01;
p02 += p10;
p11 += p12;
p20 += p21;
p22 += p00;
p02 += p11;
p20 += p22;
p20 += p02;
p20 = clamp(p20, 0.f, 1.f);
*out = rsPackColorTo8888(p20.r, p20.g, p20.b);
}

View File

@@ -0,0 +1,323 @@
// Copyright (C) 2011-2012 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma version(1)
#pragma rs java_package_name(com.android.scenegraph)
#ifndef _TRANSFORM_DEF_
#define _TRANSFORM_DEF_
#include "rs_graphics.rsh"
#define TRANSFORM_NONE 0
#define TRANSFORM_TRANSLATE 1
#define TRANSFORM_ROTATE 2
#define TRANSFORM_SCALE 3
#define CULL_FRUSTUM 0
#define CULL_ALWAYS 2
#define LIGHT_POINT 0
#define LIGHT_DIRECTIONAL 1
// Shader params that involve only data
#define SHADER_PARAM_DATA_ONLY 10000
#define SHADER_PARAM_FLOAT4_DATA 10001
#define SHADER_PARAM_TRANSFORM_DATA 10002
#define SHADER_PARAM_TRANSFORM_MODEL 10003
// Shader params that involve camera
#define SHADER_PARAM_CAMERA 1000
#define SHADER_PARAM_FLOAT4_CAMERA_POS 1001
#define SHADER_PARAM_FLOAT4_CAMERA_DIR 1002
#define SHADER_PARAM_TRANSFORM_VIEW 1003
#define SHADER_PARAM_TRANSFORM_PROJ 1004
#define SHADER_PARAM_TRANSFORM_VIEW_PROJ 1005
#define SHADER_PARAM_TRANSFORM_MODEL_VIEW 1006
#define SHADER_PARAM_TRANSFORM_MODEL_VIEW_PROJ 1007
// Shader Params that only involve lights
#define SHADER_PARAM_LIGHT 100
#define SHADER_PARAM_FLOAT4_LIGHT_COLOR 103
#define SHADER_PARAM_FLOAT4_LIGHT_POS 104
#define SHADER_PARAM_FLOAT4_LIGHT_DIR 105
#define SHADER_PARAM_TEXTURE 10
#define TEXTURE_NONE 0
#define TEXTURE_2D 1
#define TEXTURE_CUBE 2
#define TEXTURE_RENDER_TARGET 3
typedef struct TransformComponent_s {
float4 value;
int type;
rs_allocation name;
} SgTransformComponent;
typedef struct __attribute__((packed, aligned(4))) SgTransform {
rs_matrix4x4 globalMat;
rs_matrix4x4 localMat;
rs_allocation components;
int isDirty;
rs_allocation children;
rs_allocation name;
// Used to check whether transform params need to be updated
uint32_t timestamp;
} SgTransform;
typedef struct VertexShader_s {
rs_program_vertex program;
// Buffer with vertex constant data
rs_allocation shaderConst;
// ShaderParam's that populate data
rs_allocation shaderConstParams;
// location of the per object constants on the buffer
int objectConstIndex;
} SgVertexShader;
typedef struct FragmentShader_s {
rs_program_fragment program;
// Buffer with vertex constant data
rs_allocation shaderConst;
// ShaderParam's that populate data
rs_allocation shaderConstParams;
// ShaderParam's that set textures
rs_allocation shaderTextureParams;
// location of the per object constants on the buffer
int objectConstIndex;
} SgFragmentShader;
typedef struct RenderState_s {
rs_allocation pv; // VertexShader struct
rs_allocation pf; // FragmentShader struct
rs_program_store ps;
rs_program_raster pr;
} SgRenderState;
typedef struct Renderable_s {
rs_allocation render_state;
// Buffer with vertex constant data
rs_allocation pv_const;
// ShaderParam's that populate data
rs_allocation pv_constParams;
// Buffer with fragment constant data
rs_allocation pf_const;
// ShaderParam's that populate data
rs_allocation pf_constParams;
rs_allocation pf_textures[8];
int pf_num_textures;
rs_mesh mesh;
int meshIndex;
rs_allocation transformMatrix;
rs_allocation name;
float4 boundingSphere;
float4 worldBoundingSphere;
int bVolInitialized;
int cullType; // specifies whether to frustum cull
int isVisible;
} SgRenderable;
typedef struct RenderPass_s {
rs_allocation color_target;
rs_allocation depth_target;
rs_allocation camera;
rs_allocation objects;
float4 clear_color;
float clear_depth;
bool should_clear_color;
bool should_clear_depth;
} SgRenderPass;
typedef struct Camera_s {
rs_matrix4x4 proj;
rs_matrix4x4 view;
rs_matrix4x4 viewProj;
float4 position;
float near;
float far;
float horizontalFOV;
float aspect;
rs_allocation name;
rs_allocation transformMatrix;
float4 frustumPlanes[6];
int isDirty;
// Timestamp of the camera itself to signal params if anything changes
uint32_t timestamp;
// Timestamp of our transform
uint32_t transformTimestamp;
} SgCamera;
typedef struct Light_s {
float4 position;
float4 color;
float intensity;
int type;
rs_allocation name;
rs_allocation transformMatrix;
} SgLight;
// This represents the shader parameter data needed to set a float or transform data
typedef struct ShaderParamData_s {
int type;
float4 float_value;
uint32_t timestamp;
rs_allocation paramName;
rs_allocation camera;
rs_allocation light;
rs_allocation transform;
rs_allocation texture;
} SgShaderParamData;
// This represents a shader parameter that knows how to update itself for a given
// renderable or shader and contains a timestamp for the last time this buffer was updated
typedef struct ShaderParam_s {
// Used to check whether transform params need to be updated
uint32_t transformTimestamp;
// Used to check whether data params need to be updated
// These are used when somebody set the matrix of float value directly in java
uint32_t dataTimestamp;
// Specifies where in the constant buffer data gets written to
int bufferOffset;
// An instance of SgShaderParamData that could be shared by multiple objects
rs_allocation data;
// How many components of the vector we need to write
int float_vecSize;
} SgShaderParam;
// This represents a texture object
typedef struct Texture_s {
uint32_t type;
rs_allocation texture;
} SgTexture;
static void printName(rs_allocation name) {
if (!rsIsObject(name)) {
rsDebug("no name", 0);
return;
}
rsDebug((const char*)rsGetElementAt(name, 0), 0);
}
static void printCameraInfo(const SgCamera *cam) {
rsDebug("***** Camera information. ptr:", cam);
printName(cam->name);
const SgTransform *camTransform = (const SgTransform *)rsGetElementAt(cam->transformMatrix, 0);
rsDebug("Transform name:", camTransform);
printName(camTransform->name);
rsDebug("Aspect: ", cam->aspect);
rsDebug("Near: ", cam->near);
rsDebug("Far: ", cam->far);
rsDebug("Fov: ", cam->horizontalFOV);
rsDebug("Position: ", cam->position);
rsDebug("Proj: ", &cam->proj);
rsDebug("View: ", &cam->view);
}
static void printLightInfo(const SgLight *light) {
rsDebug("***** Light information. ptr:", light);
printName(light->name);
const SgTransform *lTransform = (const SgTransform *)rsGetElementAt(light->transformMatrix, 0);
rsDebug("Transform name:", lTransform);
printName(lTransform->name);
rsDebug("Position: ", light->position);
rsDebug("Color : ", light->color);
rsDebug("Intensity: ", light->intensity);
rsDebug("Type: ", light->type);
}
static void getCameraRay(const SgCamera *cam, int screenX, int screenY, float3 *pnt, float3 *vec) {
rsDebug("=================================", screenX);
rsDebug("Point X", screenX);
rsDebug("Point Y", screenY);
rs_matrix4x4 mvpInv;
rsMatrixLoad(&mvpInv, &cam->viewProj);
rsMatrixInverse(&mvpInv);
float width = (float)rsgGetWidth();
float height = (float)rsgGetHeight();
float4 pos = {(float)screenX, height - (float)screenY, 0.0f, 1.0f};
pos.x /= width;
pos.y /= height;
rsDebug("Pre Norm X", pos.x);
rsDebug("Pre Norm Y", pos.y);
pos.xy = pos.xy * 2.0f - 1.0f;
rsDebug("Norm X", pos.x);
rsDebug("Norm Y", pos.y);
pos = rsMatrixMultiply(&mvpInv, pos);
float oneOverW = 1.0f / pos.w;
pos.xyz *= oneOverW;
rsDebug("World X", pos.x);
rsDebug("World Y", pos.y);
rsDebug("World Z", pos.z);
rsDebug("Cam X", cam->position.x);
rsDebug("Cam Y", cam->position.y);
rsDebug("Cam Z", cam->position.z);
*vec = normalize(pos.xyz - cam->position.xyz);
rsDebug("Vec X", vec->x);
rsDebug("Vec Y", vec->y);
rsDebug("Vec Z", vec->z);
*pnt = cam->position.xyz;
}
static bool intersect(const SgRenderable *obj, float3 pnt, float3 vec) {
// Solving for t^2 + Bt + C = 0
float3 originMinusCenter = pnt - obj->worldBoundingSphere.xyz;
float B = dot(originMinusCenter, vec) * 2.0f;
float C = dot(originMinusCenter, originMinusCenter) -
obj->worldBoundingSphere.w * obj->worldBoundingSphere.w;
float discriminant = B * B - 4.0f * C;
if (discriminant < 0.0f) {
return false;
}
discriminant = sqrt(discriminant);
float t0 = (-B - discriminant) * 0.5f;
float t1 = (-B + discriminant) * 0.5f;
if (t0 > t1) {
float temp = t0;
t0 = t1;
t1 = temp;
}
// The sphere is behind us
if (t1 < 0.0f) {
return false;
}
return true;
}
#endif // _TRANSFORM_DEF_

View File

@@ -1,4 +1,4 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: linguist-disable-strategy-modeline-IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. * You can obtain one at http://mozilla.org/MPL/2.0/.

View File

@@ -1,4 +1,4 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: linguist-disable-strategy-modeline-IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. * You can obtain one at http://mozilla.org/MPL/2.0/.

View File

@@ -258,7 +258,7 @@ My name is wisp!"
;; evaluating the reference to the value of the corresponding variable. ;; evaluating the reference to the value of the corresponding variable.
foo foo
;; If you wish to refer to the literal symbol, rather then reference you ;; If you wish to refer to the literal symbol, rather than reference you
;; could use ;; could use
(quote foo) (quote foo)
;; or more usually ;; or more usually

1304
tei-odd-sample.odd Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
// -*- fundamental -*-
int main(int argc, char * argc[])
{
this should not be syntax highlighted, even though it looks like c.
}

View File

@@ -0,0 +1,2 @@
// -*-c++-*-
template <typename X> class { X i; };

View File

@@ -0,0 +1,2 @@
// -*- c++ -*-
template <typename X> class { X i; };

View File

@@ -0,0 +1,2 @@
// -*- mode:C++ -*-
template <typename X> class { X i; };

View File

@@ -0,0 +1,2 @@
// -*- font:bar;mode:c++ -*-
template <typename X> class { X i; };

View File

@@ -0,0 +1,2 @@
// -*-foo:bar;mode:c++;bar:foo-*-
template <typename X> class { X i; };

View File

@@ -0,0 +1,2 @@
// -*- foo : bar ; mode : c++ ; bar : foo -*-
template <typename X> class { X i; };

View File

@@ -0,0 +1,2 @@
// -*- mode : c++ ; bar : foo -*-
template <typename X> class { X i; };

View File

@@ -0,0 +1,2 @@
// -*- font:x;foo : bar ; mode : C++ ; bar : foo ; foooooo:baaaaar;fo:ba-*-
template <typename X> class { X i; };

View File

@@ -0,0 +1,2 @@
// -*-foo:bar;mode:c++;bar:foo;tyrell:corp-*-
template <typename X> class { X i; };

View File

@@ -421,6 +421,7 @@ class TestBlob < Minitest::Test
# Test fixtures # Test fixtures
assert sample_blob("test/fixtures/random.rkt").vendored? assert sample_blob("test/fixtures/random.rkt").vendored?
assert sample_blob("Test/fixtures/random.rkt").vendored? assert sample_blob("Test/fixtures/random.rkt").vendored?
assert sample_blob("tests/fixtures/random.rkt").vendored?
# Cordova/PhoneGap # Cordova/PhoneGap
assert sample_blob("cordova.js").vendored? assert sample_blob("cordova.js").vendored?
@@ -457,6 +458,13 @@ class TestBlob < Minitest::Test
assert_predicate fixture_blob(".google_apis/bar.jar"), :vendored? assert_predicate fixture_blob(".google_apis/bar.jar"), :vendored?
assert_predicate fixture_blob("foo/.google_apis/bar.jar"), :vendored? assert_predicate fixture_blob("foo/.google_apis/bar.jar"), :vendored?
# Sphinx docs
assert sample_blob("docs/_build/asset.doc").vendored?
assert sample_blob("docs/theme/file.css").vendored?
# Vagrant
assert sample_blob("puphpet/file.pp").vendored?
end end
def test_documentation def test_documentation

View File

@@ -10,6 +10,16 @@ class TestModelines < Minitest::Test
def test_modeline_strategy def test_modeline_strategy
assert_modeline Language["Ruby"], fixture_blob("Data/Modelines/ruby") assert_modeline Language["Ruby"], fixture_blob("Data/Modelines/ruby")
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplus") assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplus")
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs1")
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs2")
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs3")
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs4")
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs5")
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs6")
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs7")
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs8")
assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs9")
assert_modeline Language["Text"], fixture_blob("Data/Modelines/fundamentalEmacs.c")
assert_modeline Language["Prolog"], fixture_blob("Data/Modelines/not_perl.pl") assert_modeline Language["Prolog"], fixture_blob("Data/Modelines/not_perl.pl")
assert_modeline Language["Smalltalk"], fixture_blob("Data/Modelines/example_smalltalk.md") assert_modeline Language["Smalltalk"], fixture_blob("Data/Modelines/example_smalltalk.md")
assert_modeline Language["PHP"], fixture_blob("Data/Modelines/iamphp.inc") assert_modeline Language["PHP"], fixture_blob("Data/Modelines/iamphp.inc")
@@ -18,6 +28,16 @@ class TestModelines < Minitest::Test
def test_modeline_languages def test_modeline_languages
assert_equal Language["Ruby"], fixture_blob("Data/Modelines/ruby").language assert_equal Language["Ruby"], fixture_blob("Data/Modelines/ruby").language
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplus").language assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplus").language
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs1").language
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs2").language
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs3").language
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs4").language
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs5").language
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs6").language
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs7").language
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs8").language
assert_equal Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs9").language
assert_equal Language["Text"], fixture_blob("Data/Modelines/fundamentalEmacs.c").language
assert_equal Language["Prolog"], fixture_blob("Data/Modelines/not_perl.pl").language assert_equal Language["Prolog"], fixture_blob("Data/Modelines/not_perl.pl").language
assert_equal Language["Smalltalk"], fixture_blob("Data/Modelines/example_smalltalk.md").language assert_equal Language["Smalltalk"], fixture_blob("Data/Modelines/example_smalltalk.md").language
assert_equal Language["PHP"], fixture_blob("Data/Modelines/iamphp.inc").language assert_equal Language["PHP"], fixture_blob("Data/Modelines/iamphp.inc").language