source: issm/oecreview/Archive/13393-13976/ISSM-13837-13838.diff@ 27230

Last change on this file since 27230 was 13980, checked in by Mathieu Morlighem, 12 years ago

preparing oecreview for 13393-13976'

File size: 30.7 KB
  • ../trunk-jpl/src/android/helloworld/ISSM/.classpath

     
    1 <?xml version="1.0" encoding="UTF-8"?>
    2 <classpath>
    3         <classpathentry kind="src" path="src"/>
    4         <classpathentry kind="src" path="gen"/>
    5         <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
    6         <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
    7         <classpathentry kind="output" path="bin/classes"/>
    8 </classpath>
  • ../trunk-jpl/src/android/helloworld/ISSM/project.properties

     
    1 # This file is automatically generated by Android Tools.
    2 # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
    3 #
    4 # This file must be checked in Version Control Systems.
    5 #
    6 # To customize properties used by the Ant build system edit
    7 # "ant.properties", and override values to adapt the script to your
    8 # project structure.
    9 #
    10 # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
    11 #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
    12 
    13 # Project target.
    14 target=android-16
  • ../trunk-jpl/src/android/helloworld/ISSM/.project

     
    1 <?xml version="1.0" encoding="UTF-8"?>
    2 <projectDescription>
    3         <name>ISSM</name>
    4         <comment></comment>
    5         <projects>
    6         </projects>
    7         <buildSpec>
    8                 <buildCommand>
    9                         <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
    10                         <arguments>
    11                         </arguments>
    12                 </buildCommand>
    13                 <buildCommand>
    14                         <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
    15                         <arguments>
    16                         </arguments>
    17                 </buildCommand>
    18                 <buildCommand>
    19                         <name>org.eclipse.jdt.core.javabuilder</name>
    20                         <arguments>
    21                         </arguments>
    22                 </buildCommand>
    23                 <buildCommand>
    24                         <name>com.android.ide.eclipse.adt.ApkBuilder</name>
    25                         <arguments>
    26                         </arguments>
    27                 </buildCommand>
    28         </buildSpec>
    29         <natures>
    30                 <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
    31                 <nature>org.eclipse.jdt.core.javanature</nature>
    32         </natures>
    33 </projectDescription>
  • ../trunk-jpl/src/android/helloworld/ISSM/proguard-project.txt

     
    1 # To enable ProGuard in your project, edit project.properties
    2 # to define the proguard.config property as described in that file.
    3 #
    4 # Add project specific ProGuard rules here.
    5 # By default, the flags in this file are appended to flags specified
    6 # in ${sdk.dir}/tools/proguard/proguard-android.txt
    7 # You can edit the include path and order by changing the ProGuard
    8 # include property in project.properties.
    9 #
    10 # For more details, see
    11 #   http://developer.android.com/guide/developing/tools/proguard.html
    12 
    13 # Add any project specific keep options here:
    14 
    15 # If your project uses WebView with JS, uncomment the following
    16 # and specify the fully qualified class name to the JavaScript interface
    17 # class:
    18 #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
    19 #   public *;
    20 #}
  • ../trunk-jpl/src/android/helloworld/ISSM/AndroidManifest.xml

     
    1 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    2     package="com.example.issm"
    3     android:versionCode="1"
    4     android:versionName="1.0" >
    5 
    6     <uses-sdk
    7         android:minSdkVersion="5"
    8         android:targetSdkVersion="15" />
    9 
    10     <application
    11         android:icon="@drawable/ic_launcher"
    12         android:label="@string/app_name"
    13         android:theme="@style/AppTheme" >
    14         <activity
    15             android:name=".ISSM"
    16             android:label="@string/title_activity_issm" >
    17             <intent-filter>
    18                 <action android:name="android.intent.action.MAIN" />
    19 
    20                 <category android:name="android.intent.category.LAUNCHER" />
    21             </intent-filter>
    22         </activity>
    23     </application>
    24 
    25 </manifest>
    26  No newline at end of file
  • ../trunk-jpl/src/android/helloworld/ISSM/src/com/example/issm/MyGLRenderer.java

     
    1 /*
    2  * Copyright (C) 2012 The Android Open Source Project
    3  *
    4  * Licensed under the Apache License, Version 2.0 (the "License");
    5  * you may not use this file except in compliance with the License.
    6  * You may obtain a copy of the License at
    7  *
    8  *      http://www.apache.org/licenses/LICENSE-2.0
    9  *
    10  * Unless required by applicable law or agreed to in writing, software
    11  * distributed under the License is distributed on an "AS IS" BASIS,
    12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  * See the License for the specific language governing permissions and
    14  * limitations under the License.
    15  */
    16 
    17 package com.example.issm;
    18 import java.nio.ByteBuffer;
    19 import java.nio.ByteOrder;
    20 import java.nio.FloatBuffer;
    21 
    22 import javax.microedition.khronos.egl.EGLConfig;
    23 import javax.microedition.khronos.opengles.GL10;
    24 
    25 import android.opengl.GLES20;
    26 import android.opengl.GLSurfaceView;
    27 
    28 public class MyGLRenderer implements GLSurfaceView.Renderer {
    29 
    30     private Triangle mTriangle;
    31 
    32     @Override
    33     public void onSurfaceCreated(GL10 unused, EGLConfig config) {
    34 
    35         // Set the background frame color
    36         GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
    37 
    38         mTriangle = new Triangle();
    39     }
    40 
    41     @Override
    42     public void onDrawFrame(GL10 unused) {
    43 
    44         // Draw background color
    45         GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
    46 
    47         // Draw triangle
    48         mTriangle.draw();
    49     }
    50 
    51     @Override
    52     public void onSurfaceChanged(GL10 unused, int width, int height) {
    53         // Adjust the viewport based on geometry changes,
    54         // such as screen rotation
    55         GLES20.glViewport(0, 0, width, height);
    56     }
    57 
    58     public static int loadShader(int type, String shaderCode){
    59 
    60         // create a vertex shader type (GLES20.GL_VERTEX_SHADER)
    61         // or a fragment shader type (GLES20.GL_FRAGMENT_SHADER)
    62         int shader = GLES20.glCreateShader(type);
    63 
    64         // add the source code to the shader and compile it
    65         GLES20.glShaderSource(shader, shaderCode);
    66         GLES20.glCompileShader(shader);
    67 
    68         return shader;
    69     }
    70 
    71 }
    72 
    73 class Triangle
    74 {
    75 
    76     private final String vertexShaderCode =
    77         "attribute vec4 vPosition;" +
    78         "void main() {" +
    79         "  gl_Position = vPosition;" +
    80         "}";
    81 
    82     private final String fragmentShaderCode =
    83         "precision mediump float;" +
    84         "uniform vec4 vColor;" +
    85         "void main() {" +
    86         "  gl_FragColor = vColor;" +
    87         "}";
    88 
    89     private final FloatBuffer vertexBuffer;
    90     private final int mProgram;
    91     private int mPositionHandle;
    92     private int mColorHandle;
    93 
    94     // number of coordinates per vertex in this array
    95     static final int COORDS_PER_VERTEX = 3;
    96     static float triangleCoords[] = { // in counterclockwise order:
    97          0.0f,  0.622008459f, 0.0f,   // top
    98         -0.5f, -0.311004243f, 0.0f,   // bottom left
    99          0.5f, -0.311004243f, 0.0f    // bottom right
    100     };
    101     private final int vertexCount = triangleCoords.length / COORDS_PER_VERTEX;
    102     private final int vertexStride = COORDS_PER_VERTEX * 4; // bytes per vertex
    103 
    104     // Set color with red, green, blue and alpha (opacity) values
    105     float color[] = { 0.63671875f, 0.76953125f, 0.22265625f, 1.0f };
    106 
    107     public Triangle() {
    108         // initialize vertex byte buffer for shape coordinates
    109         ByteBuffer bb = ByteBuffer.allocateDirect(
    110                 // (number of coordinate values * 4 bytes per float)
    111                 triangleCoords.length * 4);
    112         // use the device hardware's native byte order
    113         bb.order(ByteOrder.nativeOrder());
    114 
    115         // create a floating point buffer from the ByteBuffer
    116         vertexBuffer = bb.asFloatBuffer();
    117         // add the coordinates to the FloatBuffer
    118         vertexBuffer.put(triangleCoords);
    119         // set the buffer to read the first coordinate
    120         vertexBuffer.position(0);
    121 
    122         // prepare shaders and OpenGL program
    123         int vertexShader = MyGLRenderer.loadShader(GLES20.GL_VERTEX_SHADER,
    124                                                    vertexShaderCode);
    125         int fragmentShader = MyGLRenderer.loadShader(GLES20.GL_FRAGMENT_SHADER,
    126                                                      fragmentShaderCode);
    127 
    128         mProgram = GLES20.glCreateProgram();             // create empty OpenGL Program
    129         GLES20.glAttachShader(mProgram, vertexShader);   // add the vertex shader to program
    130         GLES20.glAttachShader(mProgram, fragmentShader); // add the fragment shader to program
    131         GLES20.glLinkProgram(mProgram);                  // create OpenGL program executables
    132 
    133     }
    134 
    135     public void draw() {
    136         // Add program to OpenGL environment
    137         GLES20.glUseProgram(mProgram);
    138 
    139         // get handle to vertex shader's vPosition member
    140         mPositionHandle = GLES20.glGetAttribLocation(mProgram, "vPosition");
    141 
    142         // Enable a handle to the triangle vertices
    143         GLES20.glEnableVertexAttribArray(mPositionHandle);
    144 
    145         // Prepare the triangle coordinate data
    146         GLES20.glVertexAttribPointer(mPositionHandle, COORDS_PER_VERTEX,
    147                                      GLES20.GL_FLOAT, false,
    148                                      vertexStride, vertexBuffer);
    149 
    150         // get handle to fragment shader's vColor member
    151         mColorHandle = GLES20.glGetUniformLocation(mProgram, "vColor");
    152 
    153         // Set color for drawing the triangle
    154         GLES20.glUniform4fv(mColorHandle, 1, color, 0);
    155 
    156         // Draw the triangle
    157         GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, vertexCount);
    158 
    159         // Disable vertex array
    160         GLES20.glDisableVertexAttribArray(mPositionHandle);
    161     }
    162 }
  • ../trunk-jpl/src/android/helloworld/ISSM/src/com/example/issm/ISSM.java

     
    1 package com.example.issm;
    2 
    3 import android.app.Activity;
    4 import android.content.Context;
    5 import android.opengl.GLES20;
    6 import android.opengl.GLSurfaceView;
    7 import android.opengl.GLSurfaceView.Renderer;
    8 import android.os.Bundle;
    9 import android.util.AttributeSet;
    10 import android.view.Menu;
    11 import android.view.View;
    12 import android.view.View.OnClickListener;
    13 import android.widget.Button;
    14 import android.widget.FrameLayout;
    15 import android.widget.RelativeLayout;
    16 import android.widget.SeekBar;
    17 import android.widget.SeekBar.OnSeekBarChangeListener;
    18 import android.widget.TextView;
    19 import android.widget.Toast;
    20 import java.nio.ByteBuffer;
    21 import java.nio.ByteOrder;
    22 import java.nio.FloatBuffer;     
    23 import java.nio.ShortBuffer;
    24 import javax.microedition.khronos.egl.EGLConfig;
    25 import javax.microedition.khronos.opengles.GL10;
    26 
    27 public class ISSM extends Activity implements OnSeekBarChangeListener
    28 {
    29         private SeekBar bar;
    30     private TextView txtStatus, txtValue;
    31     private GLSurfaceView mGLView;
    32         private FrameLayout frame;
    33     @Override
    34     public void onCreate(Bundle savedInstanceState) {
    35         super.onCreate(savedInstanceState);
    36         setContentView(R.layout.activity_issm);
    37        
    38         bar = (SeekBar)findViewById(R.id.seekBar); // make seekbar object
    39         bar.setOnSeekBarChangeListener(this); // set seekbar listener
    40         txtValue = (TextView)findViewById(R.id.value);
    41         txtStatus = (TextView)findViewById(R.id.status);
    42        
    43         mGLView = new MyGLSurfaceView(this);
    44         frame = (FrameLayout)findViewById(R.id.frame);
    45         frame.addView(mGLView);
    46 
    47     }
    48 
    49 
    50         @Override
    51     public void onProgressChanged(SeekBar seekBar, int val,
    52                 boolean fromUser)
    53     {
    54         // change progress text label with current Seekbar value
    55         txtValue.setText("Value: " + val);
    56         txtStatus.setText("Status: changing");
    57     }
    58     @Override
    59     public void onStartTrackingTouch(SeekBar seekBar)
    60     {
    61         txtStatus.setText("Status: Starting to track touch");
    62 
    63     }
    64     @Override
    65     public void onStopTrackingTouch(SeekBar seekBar)
    66     {
    67         seekBar.setSecondaryProgress(seekBar.getProgress()); // set the shade of the previous value.
    68         txtStatus.setText("Status: Ended tracking touch");
    69     }
    70    
    71     @Override
    72     protected void onPause() {
    73         super.onPause();
    74         // The following call pauses the rendering thread.
    75         // If your OpenGL application is memory intensive,
    76         // you should consider de-allocating objects that
    77         // consume significant memory here.
    78         mGLView.onPause();
    79     }
    80    
    81     @Override
    82     protected void onResume() {
    83         super.onResume();
    84         // The following call resumes a paused rendering thread.
    85         // If you de-allocated graphic objects for onPause()
    86         // this is a good place to re-allocate them.
    87         mGLView.onResume();
    88     }
    89 
    90    
    91     @Override
    92     public boolean onCreateOptionsMenu(Menu menu)
    93     {
    94         getMenuInflater().inflate(R.menu.activity_issm, menu);
    95         return true;
    96     }
    97 }
  • ../trunk-jpl/src/android/helloworld/ISSM/src/com/example/issm/MyGLSurfaceView.java

     
    1 package com.example.issm;
    2 
    3 import android.content.Context;
    4 import android.opengl.GLSurfaceView;
    5 
    6 
    7 class MyGLSurfaceView extends GLSurfaceView {
    8 
    9     public MyGLSurfaceView(Context context) {
    10         super(context);
    11 
    12         // Create an OpenGL ES 2.0 context.
    13         setEGLContextClientVersion(2);
    14 
    15         // Set the Renderer for drawing on the GLSurfaceView
    16         setRenderer(new MyGLRenderer());
    17 
    18         // Render the view only when there is a change in the drawing data
    19         setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
    20     }
    21 }
    22  No newline at end of file
  • ../trunk-jpl/src/android/helloworld/ISSM/bin/AndroidManifest.xml

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    1 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    2     package="com.example.issm"
    3     android:versionCode="1"
    4     android:versionName="1.0" >
    5 
    6     <uses-sdk
    7         android:minSdkVersion="5"
    8         android:targetSdkVersion="15" />
    9 
    10     <application
    11         android:icon="@drawable/ic_launcher"
    12         android:label="@string/app_name"
    13         android:theme="@style/AppTheme" >
    14         <activity
    15             android:name=".ISSM"
    16             android:label="@string/title_activity_issm" >
    17             <intent-filter>
    18                 <action android:name="android.intent.action.MAIN" />
    19 
    20                 <category android:name="android.intent.category.LAUNCHER" />
    21             </intent-filter>
    22         </activity>
    23     </application>
    24 
    25 </manifest>
    26  No newline at end of file
  • ../trunk-jpl/src/android/helloworld/ISSM/bin/jarlist.cache

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    1 # cache for current jar dependecy. DO NOT EDIT.
    2 # format is <lastModified> <length> <SHA-1> <path>
    3 # Encoding is UTF-8
  • ../trunk-jpl/src/android/helloworld/ISSM/gen/com/example/issm/R.java

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    1 /* AUTO-GENERATED FILE.  DO NOT MODIFY.
    2  *
    3  * This class was automatically generated by the
    4  * aapt tool from the resource data it found.  It
    5  * should not be modified by hand.
    6  */
    7 
    8 package com.example.issm;
    9 
    10 public final class R {
    11     public static final class attr {
    12     }
    13     public static final class drawable {
    14         public static final int ic_action_search=0x7f020000;
    15         public static final int ic_launcher=0x7f020001;
    16     }
    17     public static final class id {
    18         public static final int frame=0x7f070004;
    19         public static final int menu_settings=0x7f070005;
    20         public static final int relativeLay=0x7f070000;
    21         public static final int seekBar=0x7f070003;
    22         public static final int status=0x7f070002;
    23         public static final int value=0x7f070001;
    24     }
    25     public static final class layout {
    26         public static final int activity_issm=0x7f030000;
    27     }
    28     public static final class menu {
    29         public static final int activity_issm=0x7f060000;
    30     }
    31     public static final class string {
    32         public static final int app_name=0x7f040000;
    33         public static final int menu_settings=0x7f040001;
    34         public static final int title_activity_issm=0x7f040002;
    35     }
    36     public static final class style {
    37         public static final int AppTheme=0x7f050000;
    38     }
    39 }
  • ../trunk-jpl/src/android/helloworld/ISSM/gen/com/example/issm/BuildConfig.java

     
    1 /** Automatically generated file. DO NOT MODIFY */
    2 package com.example.issm;
    3 
    4 public final class BuildConfig {
    5     public final static boolean DEBUG = true;
    6 }
    7  No newline at end of file
  • ../trunk-jpl/src/android/helloworld/ISSM/res/values/styles.xml

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    1 <resources>
    2 
    3     <style name="AppTheme" parent="android:Theme.Light" />
    4 
    5 </resources>
    6  No newline at end of file
  • ../trunk-jpl/src/android/helloworld/ISSM/res/values/strings.xml

     
    1 <resources>
    2 
    3     <string name="app_name">ISSM</string>
    4     <string name="menu_settings">Settings</string>
    5     <string name="title_activity_issm">ISSM</string>
    6 
    7 </resources>
    8  No newline at end of file
  • ../trunk-jpl/src/android/helloworld/ISSM/res/menu/activity_issm.xml

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    1 <menu xmlns:android="http://schemas.android.com/apk/res/android">
    2     <item android:id="@+id/menu_settings"
    3         android:title="@string/menu_settings"
    4         android:orderInCategory="100"
    5         android:showAsAction="never" />
    6 </menu>
  • ../trunk-jpl/src/android/helloworld/ISSM/res/values-v11/styles.xml

     
    1 <resources>
    2 
    3     <style name="AppTheme" parent="android:Theme.Holo.Light" />
    4 
    5 </resources>
    6  No newline at end of file
  • ../trunk-jpl/src/android/helloworld/ISSM/res/values-v14/styles.xml

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    1 <resources>
    2 
    3     <style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar" />
    4 
    5 </resources>
    6  No newline at end of file
  • ../trunk-jpl/src/android/helloworld/ISSM/res/layout/activity_issm.xml

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    2     xmlns:tools="http://schemas.android.com/tools"
    3     android:id="@+id/relativeLay"
    4     android:layout_width="match_parent"
    5     android:layout_height="match_parent"
    6     android:orientation="horizontal" >
    7 
    8     <SeekBar
    9         android:id="@+id/seekBar"
    10         android:layout_width="match_parent"
    11         android:layout_height="wrap_content"
    12         android:layout_alignParentBottom="true"
    13         android:layout_alignParentLeft="true"
    14         android:layout_marginBottom="41dp" />
    15 
    16     <TextView
    17         android:id="@+id/status"
    18         android:layout_width="wrap_content"
    19         android:layout_height="wrap_content"
    20         android:layout_above="@+id/seekBar"
    21         android:layout_centerHorizontal="true"
    22         android:layout_marginBottom="16dp"
    23         android:text="Status: " />
    24 
    25     <FrameLayout
    26         xmlns:android="http://schemas.android.com/apk/res/android"
    27         xmlns:tools="http://schemas.android.com/tools"
    28         android:id="@+id/frame"
    29         android:layout_width="wrap_content"
    30         android:layout_height="wrap_content"
    31         android:layout_centerHorizontal="true"
    32         android:layout_marginBottom="128dp" >
    33     </FrameLayout>
    34 
    35     <TextView
    36         android:id="@+id/value"
    37         android:layout_width="wrap_content"
    38         android:layout_height="wrap_content"
    39         android:layout_above="@+id/status"
    40         android:layout_alignRight="@+id/status"
    41         android:layout_marginBottom="16dp"
    42         android:text="Value: " />
    43 
    44 </RelativeLayout>
Note: See TracBrowser for help on using the repository browser.