Merge "Make sure the controller will get repositioned after size changing." into gingerbread
diff --git a/api/current.xml b/api/current.xml
index fb3b998..3b9ab1a 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -93863,7 +93863,7 @@
  type="android.net.SSLCertificateSocketFactory"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 <parameter name="handshakeTimeoutMillis" type="int">
@@ -95963,7 +95963,7 @@
  type="android.net.http.SslCertificate"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 <parameter name="issuedTo" type="java.lang.String">
@@ -96030,7 +96030,7 @@
  synchronized="false"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 </method>
@@ -96052,7 +96052,7 @@
  synchronized="false"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 </method>
@@ -172464,7 +172464,7 @@
  abstract="false"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 <constructor name="EventLogTags"
@@ -202795,7 +202795,7 @@
  synchronized="true"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 </method>
@@ -203341,7 +203341,7 @@
  synchronized="true"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 <parameter name="flag" type="boolean">
@@ -205466,7 +205466,7 @@
  synchronized="false"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 <parameter name="view" type="android.webkit.WebView">
@@ -213999,7 +213999,7 @@
  synchronized="false"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 </method>
@@ -411704,7 +411704,7 @@
  abstract="true"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 <method name="getLength"
@@ -412193,7 +412193,7 @@
  abstract="true"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 <method name="characters"
@@ -412408,7 +412408,7 @@
  abstract="false"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 <implements name="org.xml.sax.DTDHandler">
@@ -412875,7 +412875,7 @@
  abstract="true"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 <method name="parse"
@@ -414307,7 +414307,7 @@
  abstract="false"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 <implements name="org.xml.sax.AttributeList">
@@ -415796,7 +415796,7 @@
  abstract="false"
  static="false"
  final="false"
- deprecated="not deprecated"
+ deprecated="deprecated"
  visibility="public"
 >
 <method name="makeParser"
diff --git a/core/java/android/hardware/SensorEvent.java b/core/java/android/hardware/SensorEvent.java
index 98bf632..32ff3b3 100644
--- a/core/java/android/hardware/SensorEvent.java
+++ b/core/java/android/hardware/SensorEvent.java
@@ -111,6 +111,27 @@
      * This can be achieved by applying a <i>high-pass</i> filter. Conversely, a
      * <i>low-pass</i> filter can be used to isolate the force of gravity.
      * </p>
+     *
+     * <pre class="prettyprint">
+     *
+     *     public void onSensorChanged(SensorEvent event)
+     *     {
+     *          // alpha is calculated as t / (t + dT)
+     *          // with t, the low-pass filter's time-constant
+     *          // and dT, the event delivery rate
+     *
+     *          final float alpha = 0.8;
+     *
+     *          gravity[0] = alpha * gravity[0] + (1 - alpha) * event.data[0];
+     *          gravity[1] = alpha * gravity[1] + (1 - alpha) * event.data[1];
+     *          gravity[2] = alpha * gravity[2] + (1 - alpha) * event.data[2];
+     *
+     *          linear_acceleration[0] = event.data[0] - gravity[0];
+     *          linear_acceleration[1] = event.data[1] - gravity[1];
+     *          linear_acceleration[2] = event.data[2] - gravity[2];
+     *     }
+     * </pre>
+     *
      * <p>
      * <u>Examples</u>:
      * <ul>
@@ -143,8 +164,41 @@
      *  standard mathematical definition of positive rotation and does not agree with the
      *  definition of roll given earlier.
      *
+     * <ul>
+     * <p>
+     * values[0]: Angular speed around the x-axis
+     * </p>
+     * <p>
+     * values[1]: Angular speed around the y-axis
+     * </p>
+     * <p>
+     * values[2]: Angular speed around the z-axis
+     * </p>
+     * </ul>
+     * <p>
+     * Typically the output of the gyroscope is integrated over time to calculate
+     * an angle, for example:
+     * </p>
+     * <pre class="prettyprint">
+     *     private static final float NS2S = 1.0f / 1000000000.0f;
+     *     private float timestamp;
+     *     public void onSensorChanged(SensorEvent event)
+     *     {
+     *          if (timestamp != 0) {
+     *              final float dT = (event.timestamp - timestamp) * NS2S;
+     *              angle[0] += event.data[0] * dT;
+     *              angle[1] += event.data[1] * dT;
+     *              angle[2] += event.data[2] * dT;
+     *          }
+     *          timestamp = event.timestamp;
+     *     }
+     * </pre>
+     *
+     * <p>In practice, the gyroscope noise and offset will introduce some errors which need
+     * to be compensated for. This is usually done using the information from other
+     * sensors, but is beyond the scope of this document.</p>
+     *
      * <h4>{@link android.hardware.Sensor#TYPE_LIGHT Sensor.TYPE_LIGHT}:</h4>
-     * 
      * <ul>
      * <p>
      * values[0]: Ambient light level in SI lux units
diff --git a/core/java/android/net/SSLCertificateSocketFactory.java b/core/java/android/net/SSLCertificateSocketFactory.java
index b822b27..63ac21f 100644
--- a/core/java/android/net/SSLCertificateSocketFactory.java
+++ b/core/java/android/net/SSLCertificateSocketFactory.java
@@ -102,6 +102,7 @@
     private final boolean mSecure;
 
     /** @deprecated Use {@link #getDefault(int)} instead. */
+    @Deprecated
     public SSLCertificateSocketFactory(int handshakeTimeoutMillis) {
         this(handshakeTimeoutMillis, null, true);
     }
diff --git a/core/java/android/net/http/SslCertificate.java b/core/java/android/net/http/SslCertificate.java
index c29926c..30f25a2 100644
--- a/core/java/android/net/http/SslCertificate.java
+++ b/core/java/android/net/http/SslCertificate.java
@@ -112,6 +112,7 @@
      * @param validNotAfter The not-after date from the certificate validity period in ISO 8601 format
      * @deprecated Use {@link #SslCertificate(String, String, Date, Date)}
      */
+    @Deprecated
     public SslCertificate(
             String issuedTo, String issuedBy, String validNotBefore, String validNotAfter) {
         this(issuedTo, issuedBy, parseDate(validNotBefore), parseDate(validNotAfter));
@@ -157,6 +158,7 @@
      *
      * @deprecated Use {@link #getValidNotBeforeDate()}
      */
+    @Deprecated
     public String getValidNotBefore() {
         return formatDate(mValidNotBefore);
     }
@@ -175,6 +177,7 @@
      *
      * @deprecated Use {@link #getValidNotAfterDate()}
      */
+    @Deprecated
     public String getValidNotAfter() {
         return formatDate(mValidNotAfter);
     }
diff --git a/core/java/android/util/EventLogTags.java b/core/java/android/util/EventLogTags.java
index 5cf5332..8c18417 100644
--- a/core/java/android/util/EventLogTags.java
+++ b/core/java/android/util/EventLogTags.java
@@ -29,6 +29,7 @@
  * @deprecated This class is no longer functional.
  * Use {@link android.util.EventLog} instead.
  */
+@Deprecated
 public class EventLogTags {
     public static class Description {
         public final int mTag;
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index da0c61b..4d70e7c 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -1029,6 +1029,7 @@
      * @deprecated This method has been deprecated in favor of
      *             {@link #setPluginState}
      */
+    @Deprecated
     public synchronized void setPluginsEnabled(boolean flag) {
         setPluginState(PluginState.ON);
     }
@@ -1211,6 +1212,7 @@
      * @return True if plugins are enabled.
      * @deprecated This method has been replaced by {@link #getPluginState}
      */
+    @Deprecated
     public synchronized boolean getPluginsEnabled() {
         return mPluginState == PluginState.ON;
     }
diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java
index 02c7210..1f8eeba 100644
--- a/core/java/android/webkit/WebViewClient.java
+++ b/core/java/android/webkit/WebViewClient.java
@@ -89,6 +89,7 @@
      * @deprecated This method is no longer called. When the WebView encounters
      *             a redirect loop, it will cancel the load.
      */
+    @Deprecated
     public void onTooManyRedirects(WebView view, Message cancelMsg,
             Message continueMsg) {
         cancelMsg.sendToTarget();
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index 82b7c4f..e1a1894 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -3626,6 +3626,7 @@
      *         
      * @deprecated Use {@link #getCheckedItemIds()} instead.
      */
+    @Deprecated
     public long[] getCheckItemIds() {
         // Use new behavior that correctly handles stable ID mapping.
         if (mAdapter != null && mAdapter.hasStableIds()) {
diff --git a/core/jni/android_nfc.h b/core/jni/android_nfc.h
index df660f2..de0ddde 100644
--- a/core/jni/android_nfc.h
+++ b/core/jni/android_nfc.h
@@ -22,8 +22,17 @@
 #ifndef __ANDROID_NFC_H__
 #define __ANDROID_NFC_H__
 
+#define LOG_TAG "NdefMessage"
+#include <utils/Log.h>
+
 extern "C" {
 
+#if 0
+  #define TRACE(...) LOG(LOG_DEBUG, "NdefMessage", __VA_ARGS__)
+#else
+  #define TRACE(...)
+#endif
+
 typedef struct phFriNfc_NdefRecord {
     uint8_t                 Flags;
     uint8_t                 Tnf;
diff --git a/core/jni/android_nfc_NdefMessage.cpp b/core/jni/android_nfc_NdefMessage.cpp
index eaf989d..9beef2a 100644
--- a/core/jni/android_nfc_NdefMessage.cpp
+++ b/core/jni/android_nfc_NdefMessage.cpp
@@ -14,8 +14,6 @@
  * limitations under the License.
  */
 
-#define LOG_TAG "NdefMessage"
-
 #include <stdlib.h>
 
 #include "jni.h"
@@ -23,8 +21,6 @@
 
 #include "android_nfc.h"
 
-#include <utils/Log.h>
-
 namespace android {
 
 static jint android_nfc_NdefMessage_parseNdefMessage(JNIEnv *e, jobject o,
@@ -53,7 +49,7 @@
         return -1;
 
     /* Get the number of records in the message so we can allocate buffers */
-    LOGD("phFriNfc_NdefRecord_GetRecords(NULL)");
+    TRACE("phFriNfc_NdefRecord_GetRecords(NULL)");
 
     status = phFriNfc_NdefRecord_GetRecords((uint8_t *)raw_msg,
             (uint32_t)raw_msg_size, NULL, NULL, &num_of_records);
@@ -62,9 +58,7 @@
         LOGE("phFriNfc_NdefRecord_GetRecords(NULL) returned 0x%04x", status);
         goto end;
     }
-    LOGD("phFriNfc_NdefRecord_GetRecords(NULL) returned 0x%04x", status);
-
-    LOGD("found %d records in message", num_of_records);
+    TRACE("phFriNfc_NdefRecord_GetRecords(NULL) returned 0x%04x, with %d records", status, num_of_records);
 
     is_chunked = (uint8_t*)malloc(num_of_records);
     if (is_chunked == NULL)
@@ -74,7 +68,7 @@
         goto end;
 
     /* Now, actually retrieve records position in message */
-    LOGD("phFriNfc_NdefRecord_GetRecords()");
+    TRACE("phFriNfc_NdefRecord_GetRecords()");
 
     status = phFriNfc_NdefRecord_GetRecords((uint8_t *)raw_msg,
             (uint32_t)raw_msg_size, records, is_chunked, &num_of_records);
@@ -83,7 +77,7 @@
         LOGE("phFriNfc_NdefRecord_GetRecords() returned 0x%04x", status);
         goto end;
     }
-    LOGD("phFriNfc_NdefRecord_GetRecords() returned 0x%04x", status);
+    TRACE("phFriNfc_NdefRecord_GetRecords() returned 0x%04x, with %d records", status, num_of_records);
 
     /* Build NDEF records array */
     record_cls = e->FindClass("android/nfc/NdefRecord");
@@ -94,13 +88,11 @@
 
     ctor = e->GetMethodID(record_cls, "<init>", "(S[B[B[B)V");
 
-    LOGD("NFC_Number of records = %d\n", num_of_records);
-
     for (i = 0; i < num_of_records; i++) {
         jbyteArray type, id, payload;
         jobject new_record;
 
-        LOGD("phFriNfc_NdefRecord_Parse()");
+        TRACE("phFriNfc_NdefRecord_Parse()");
 
         status = phFriNfc_NdefRecord_Parse(&record, records[i]);
 
@@ -108,7 +100,7 @@
             LOGE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status);
             goto end;
         }
-        LOGD("phFriNfc_NdefRecord_Parse() returned 0x%04x", status);
+        TRACE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status);
 
         type = e->NewByteArray(record.TypeLength);
         if (type == NULL) {
diff --git a/core/jni/android_nfc_NdefRecord.cpp b/core/jni/android_nfc_NdefRecord.cpp
index 0a3a519..a7a80c8 100644
--- a/core/jni/android_nfc_NdefRecord.cpp
+++ b/core/jni/android_nfc_NdefRecord.cpp
@@ -54,7 +54,7 @@
     if (buf == NULL)
         goto end;
 
-    LOGD("phFriNfc_NdefRecord_Generate()");
+    TRACE("phFriNfc_NdefRecord_Generate()");
 
     status = phFriNfc_NdefRecord_Generate(&record, buf, buf_size,
             &record_size);
@@ -63,7 +63,7 @@
         LOGE("phFriNfc_NdefRecord_Generate() returned 0x%04x", status);
         goto end;
     }
-    LOGD("phFriNfc_NdefRecord_Generate() returned 0x%04x", status);
+    TRACE("phFriNfc_NdefRecord_Generate() returned 0x%04x", status);
 
     result = e->NewByteArray(record_size);
     if (result == NULL)
@@ -104,13 +104,13 @@
         goto clean_and_return;
     }
 
-    LOGD("phFriNfc_NdefRecord_Parse()");
+    TRACE("phFriNfc_NdefRecord_Parse()");
     status = phFriNfc_NdefRecord_Parse(&record, (uint8_t *)raw_record);
     if (status) {
         LOGE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status);
         goto clean_and_return;
     }
-    LOGD("phFriNfc_NdefRecord_Parse() returned 0x%04x", status);
+    TRACE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status);
 
     /* Set TNF field */
     mTnf = e->GetFieldID(record_cls, "mTnf", "S");
diff --git a/docs/html/sdk/eclipse-adt.jd b/docs/html/sdk/eclipse-adt.jd
index 632fa4b..350f2b0 100644
--- a/docs/html/sdk/eclipse-adt.jd
+++ b/docs/html/sdk/eclipse-adt.jd
@@ -103,12 +103,54 @@
 <div class="toggleable opened">
   <a href="#" onclick="return toggleDiv(this)">
         <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" />
-ADT 0.9.9</a> <em>(September 2010)</em>
+ADT 8.0</a> <em>(November 2010)</em>
   <div class="toggleme">
 
+<dl>
 
+<dt>Dependencies:</dt>
+
+<p><p>ADT 8.0 is designed for use with SDK Tools r8. If you haven't
+already installed SDK Tools r8 into your SDK, use the Android SDK and AVD Manager to do
+so.</p></dd>
+
+<dt>General notes:</dt>
+<dd>
+<ul>
+  <li>New version number scheme that follows the SDK Tools revision number. The major version
+number for your ADT plugin should now always match the revision number of your SDK Tools. For
+example, ADT 8.x is for SDK Tools r8.</li>
+  <li>Support for true debug build. You no longer need to change the value of the
+   <code>debuggable</code> attribute in the Android Manifest.
+  <p>Incremental builds automatically insert <code>debuggable="true"</code>, but if you perform
+  "export signed/unsigned application package", ADT does <em>not</em> insert it.
+  If you manually set <code>debuggable="true"</code> in the manifest file, then release builds will
+  actually create a debug build (it does not remove it if you placed it there).</p></li>
+  <li>Automatic <a href="{@docRoot}guide/developing/tools/proguard.html">Proguard</a> support in
+release builds. For it to work, you need to have a <code>proguard.config</code>
+  property in the <code>default.properties</code> file that points to a proguard config file.</li>
+  <li>Completely rewritten Visual Layout Editor. (This is still a work in progress.) Now includes:
+    <ul>
+      <li>Full drag and drop from palette to layout for all Layout classes.</li>
+      <li>Move widgets inside a Layout view, from one Layout view to another and from one layout file to another.</li>
+      <li>Contextual menu with enum/flag type properties.</li>
+      <li>New zoom controls.</li>
+    </ul></li>
+  <li>New HierarchyViewer plug-in integrated in Eclipse.</li>
+  <li>Android launch configurations don't recompile the whole workspace on launch anymore.</li>
+  <li><code>android.jar</code> source and javadoc location can now be configured.</li>
 </ul>
 </dd>
+</dl>
+ </div>
+</div>
+
+
+<div class="toggleable closed">
+  <a href="#" onclick="return toggleDiv(this)">
+        <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
+ADT 0.9.9</a> <em>(September 2010)</em>
+  <div class="toggleme">
 
 <dl>
 
diff --git a/docs/html/sdk/ndk/index.jd b/docs/html/sdk/ndk/index.jd
index 11e6642..0f36345 100644
--- a/docs/html/sdk/ndk/index.jd
+++ b/docs/html/sdk/ndk/index.jd
@@ -84,34 +84,56 @@
 
         <dd>
           <ul>
+          
+            <li>A new toolchain (based on GCC 4.4.3), which generates better code, and can also now
+be used as a standalone cross-compiler, for people who want to build their stuff with
+<code>./configure &amp;&amp; make</code>. See
+docs/STANDALONE-TOOLCHAIN.html for the details. The binaries for GCC 4.4.0 are still provided,
+but the 4.2.1 binaries were removed.</li>
+
+            <li>Support for prebuilt static and shared libraries (docs/PREBUILTS.html), module
+exports and imports to make sharing and reuse of third-party modules much easier
+(docs/IMPORT-MODULE.html explains why).</li>
+
+            <li>A C++ STL implementation (based on STLport) is now provided as a helper module. It
+can be used either as a static or shared library (details and usage exemple under
+sources/android/stlport/README). <strong>Note:</strong> For now, C++ Exceptions and RTTI are still
+not supported.</li>
+
+            <li>Improvements to the <code>cpufeatures</code> helper library to deal with buggy
+kernel that incorrectly report they run on an ARMv7 CPU (while the device really is an ARMv6). We
+recommend developers that use it to simply rebuild their applications to benefit from it, then
+upload to Market.</li>
+
             <li>Adds support for native activities, which allows you to write completely native
             applications.</li>
 
             <li>Adds an EGL library that lets you create and manage OpenGL ES textures and
             services.</li>
 
-            <li>Provides an interface that lets you write a native text-to-speech engine.</li>
-
             <li>Adds native support for the following:
 
               <ul>
-                <li>the input subsystem (such as the keyboard and touch screen)</li>
+                <li>Input subsystem (such as the keyboard and touch screen)</li>
 
-                <li>the window and surface subsystem.</li>
+                <li>Window and surface subsystem</li>
 
-                <li>audio APIs based on the OpenSL ES standard that support playback and recording
-                as well as control over platform audio effects.</li>
+                <li>Audio APIs based on the OpenSL ES standard that support playback and recording
+                as well as control over platform audio effects</li>
 
-                <li>event loop APIs to wait for things such as input and sensor events.</li>
+                <li>Event loop APIs to wait for things such as input and sensor events</li>
 
-                <li>accessing assets packaged in an <code>.apk</code> file.</li>
+                <li>Access to assets packaged in the <code>.apk</code></li>
 
-                <li>accessing sensor data (accelerometer, compass, gyroscope, etc).</li>
-
-                <li>provides sample applications, <code>native-plasma</code> and
-                <code>native-activity</code>, to demonstrate how to write a native activity.</li>
+                <li>Access to sensor data (accelerometer, compass, gyroscope, etc.)</li>
               </ul>
             </li>
+
+            <li>New sample applications, <code>native-plasma</code> and
+              <code>native-activity</code>, to demonstrate how to write a native activity.</li>
+            
+            <li>Plus many bugfixes and other small improvements; see docs/CHANGES.html for a more
+detailed list of changes.</li>
           </ul>
         </dd>
       </dl>
diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs
index ecc69c2..7ccb7a0 100644
--- a/docs/html/sdk/sdk_toc.cs
+++ b/docs/html/sdk/sdk_toc.cs
@@ -93,7 +93,7 @@
       <span style="display:none" class="zh-TW"></span>
       </h2>
     <ul>
-      <li><a href="<?cs var:toroot ?>sdk/eclipse-adt.html">ADT 0.9.9
+      <li><a href="<?cs var:toroot ?>sdk/eclipse-adt.html">ADT 8.0
       <span style="display:none" class="de"></span>
       <span style="display:none" class="es"></span>
       <span style="display:none" class="fr"></span>
@@ -115,7 +115,8 @@
       <span style="display:none" class="zh-TW"></span>
     </h2>
     <ul>
-      <li><a href="<?cs var:toroot ?>sdk/ndk/index.html">Download the Android NDK, r5</a></li>
+      <li><a href="<?cs var:toroot ?>sdk/ndk/index.html">Download the Android NDK, r5</a>
+        <span class="new">new!</span></li>
       <li><a href="<?cs var:toroot ?>sdk/ndk/overview.html">What is the NDK?</a></li>
     </ul>
   </li>
diff --git a/opengl/include/EGL/eglplatform.h b/opengl/include/EGL/eglplatform.h
index 25d7697..bfac71b 100644
--- a/opengl/include/EGL/eglplatform.h
+++ b/opengl/include/EGL/eglplatform.h
@@ -78,18 +78,7 @@
 typedef void *EGLNativeWindowType;
 typedef void *EGLNativePixmapType;
 
-#elif defined(__unix__) && !defined(ANDROID)
-
-/* X11 (tentative)  */
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-typedef Display *EGLNativeDisplayType;
-typedef Pixmap   EGLNativePixmapType;
-typedef Window   EGLNativeWindowType;
-
-
-#elif defined(ANDROID)
+#elif defined(__ANDROID__) || defined(ANDROID)
 
 #include <android/native_window.h>
 
@@ -99,6 +88,16 @@
 typedef struct egl_native_pixmap_t*     EGLNativePixmapType;
 typedef void*                           EGLNativeDisplayType;
 
+#elif defined(__unix__)
+
+/* X11 (tentative)  */
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+typedef Display *EGLNativeDisplayType;
+typedef Pixmap   EGLNativePixmapType;
+typedef Window   EGLNativeWindowType;
+
 #else
 #error "Platform not recognized"
 #endif