Index: wysiwyg.controller.inc
===================================================================
RCS file: wysiwyg.controller.inc
diff -N wysiwyg.controller.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ wysiwyg.controller.inc	31 Jan 2011 23:09:20 -0000
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * Controller class for Wysiwyg profiles.
+ */
+class WysiwygProfileController extends DrupalDefaultEntityController {
+  /**
+   * Overrides DrupalDefaultEntityController::attachLoad().
+   */
+  function attachLoad(&$queried_entities, $revision_id = FALSE) {
+    // Unserialize the profile settings.
+    foreach ($queried_entities as $key => $record) {
+      $queried_entities[$key]->settings = unserialize($record->settings);
+    }
+    // Call the default attachLoad() method.
+    parent::attachLoad($queried_entities, $revision_id);
+  }
+}
Index: wysiwyg.entity-controller.inc
===================================================================
RCS file: wysiwyg.entity-controller.inc
diff -N wysiwyg.entity-controller.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ wysiwyg.entity-controller.inc	31 Jan 2011 23:09:20 -0000
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * Controller class for Wysiwyg profiles for use with the Entity API module.
+ */
+class WysiwygProfileController extends EntityAPIController {
+  /**
+   * Overrides EntityAPIController::attachLoad().
+   */
+  function attachLoad(&$queried_entities, $revision_id = FALSE) {
+    // Unserialize the profile settings.
+    foreach ($queried_entities as $key => $record) {
+      $queried_entities[$key]->settings = unserialize($record->settings);
+    }
+    // Call the default attachLoad() method.
+    parent::attachLoad($queried_entities, $revision_id);
+  }
+}
Index: wysiwyg.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.install,v
retrieving revision 1.13
diff -u -p -r1.13 wysiwyg.install
--- wysiwyg.install	23 Jan 2011 01:58:34 -0000	1.13
+++ wysiwyg.install	31 Jan 2011 23:09:20 -0000
@@ -32,6 +32,22 @@ function wysiwyg_schema() {
         'type' => 'text',
         'size' => 'normal',
       ),
+      // The following two fields are used in exportables functionality via the Entity API module.
+      // See http://drupal.org/node/1021526.
+      'status' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        // Hard code the value of ENTITY_CUSTOM in case entity.module is not present.
+        'default' => defined('ENTITY_CUSTOM') ? ENTITY_CUSTOM : 0x01,
+        'size' => 'tiny',
+        'description' => 'The exportable status of the entity.',
+      ),
+      'module' => array(
+        'description' => 'The name of the providing module if the entity has been defined in code.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => FALSE,
+      ),
     ),
     'primary key' => array('format'),
     'foreign keys' => array(
@@ -311,3 +327,24 @@ function wysiwyg_update_7200() {
     ));
   }
 }
+
+/**
+ * Add fields used for Entity API module exportables.
+ */
+function wysiwyg_update_7201() {
+  // Create a created column.
+  db_add_field('wysiwyg', 'status', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => ENTITY_CUSTOM,
+    'size' => 'tiny',
+    'description' => 'The exportable status of the entity.',
+  ));
+
+  db_add_field('wysiwyg', 'module', array(
+    'description' => 'The name of the providing module if the entity has been defined in code.',
+    'type' => 'varchar',
+    'length' => 255,
+    'not null' => FALSE,
+  ));
+}
Index: wysiwyg.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.module,v
retrieving revision 1.54
diff -u -p -r1.54 wysiwyg.module
--- wysiwyg.module	30 Jan 2011 04:06:47 -0000	1.54
+++ wysiwyg.module	31 Jan 2011 23:09:21 -0000
@@ -19,28 +19,22 @@ function wysiwyg_entity_info() {
     // its static cache. Therefore, wysiwyg_profile_load_all() implements a
     // custom static cache.
     'static cache' => FALSE,
+    // Make exportable if the Entity API module is enabled.
+    'exportable' => TRUE,
     'entity keys' => array(
       'id' => 'format',
+      // Provides the label in e.g. features export.
+      'label' => 'format',
     ),
   );
   return $types;
 }
 
-/**
- * Controller class for Wysiwyg profiles.
- */
-class WysiwygProfileController extends DrupalDefaultEntityController {
-  /**
-   * Overrides DrupalDefaultEntityController::attachLoad().
-   */
-  function attachLoad(&$queried_entities, $revision_id = FALSE) {
-    // Unserialize the profile settings.
-    foreach ($queried_entities as $key => $record) {
-      $queried_entities[$key]->settings = unserialize($record->settings);
-    }
-    // Call the default attachLoad() method.
-    parent::attachLoad($queried_entities, $revision_id);
-  }
+if (module_exists('entity')) {
+  include_once('wysiwyg.entity-controller.inc');
+}
+else {
+  include_once('wysiwyg.controller.inc');
 }
 
 /**
