<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='rstudio'>

   <!-- GWT module dependencies                                    -->
   <inherits name='com.google.gwt.user.User'/>
   
   <inherits name='com.google.gwt.widgetideas.SliderBar'/>
    
   <!-- Gin module dependencies                                    -->
   <inherits name="com.google.gwt.inject.Inject"/>
    
   <!-- Use default GWT style sheet                                -->
   <!--<inherits name='com.google.gwt.user.theme.standard.Standard'/>-->

   <define-property name="rstudio.desktop" values="true,false"/>
   <property-provider name="rstudio.desktop"><![CDATA[
      return window.desktop ? "true" : "false";
   ]]></property-provider>
   <set-property name="user.agent" value="safari">
      <when-property-is name="rstudio.desktop" value="true"/>
   </set-property>
   <collapse-property name="rstudio.desktop" values="*"/>
    
   <define-property name="rstudio.cocoa" values="true,false"/>
   <property-provider name="rstudio.cocoa"><![CDATA[
      return window.desktop && window.desktop.isCocoa() ? "true" : "false";
   ]]></property-provider>
   <collapse-property name="rstudio.cocoa" values="*"/>

   <!-- RStudio module dependencies                                -->
   <inherits name='org.rstudio.core.Core' />
   
   <!-- Specify the app entry point class.                         -->
   <entry-point class='org.rstudio.studio.client.RStudio'/>

   <set-property name="user.agent" value="safari,gecko1_8,ie10" />
   <collapse-property name="user.agent" values="*" />

   <replace-with class="org.rstudio.studio.client.common.impl.WebWindowOpener">
      <when-type-is class="org.rstudio.studio.client.common.WindowOpener" />
   </replace-with>
   <replace-with class="org.rstudio.studio.client.common.impl.DesktopWindowOpener">
      <when-type-is class="org.rstudio.studio.client.common.WindowOpener" />
      <when-property-is name="rstudio.desktop" value="true"/>
   </replace-with>

   <replace-with class="org.rstudio.studio.client.common.impl.WebFileDialogs">
      <when-type-is class="org.rstudio.studio.client.common.FileDialogs" />
   </replace-with>
   <replace-with class="org.rstudio.studio.client.common.impl.DesktopFileDialogs">
      <when-type-is class="org.rstudio.studio.client.common.FileDialogs" />
      <when-property-is name="rstudio.desktop" value="true"/>
   </replace-with>
 
   <replace-with class="org.rstudio.studio.client.application.ui.impl.WebApplicationHeader">
      <when-type-is class="org.rstudio.studio.client.application.ui.ApplicationHeader" />
   </replace-with>
   <replace-with class="org.rstudio.studio.client.application.ui.impl.DesktopApplicationHeader">
      <when-type-is class="org.rstudio.studio.client.application.ui.ApplicationHeader" />
      <when-property-is name="rstudio.desktop" value="true"/>
   </replace-with>

   <replace-with class="org.rstudio.studio.client.workbench.views.packages.impl.WebCRANChooser">
      <when-type-is class="org.rstudio.studio.client.workbench.views.packages.CRANChooser"/>
   </replace-with>
   <replace-with class="org.rstudio.studio.client.workbench.views.packages.impl.DesktopCRANChooser">
      <when-type-is class="org.rstudio.studio.client.workbench.views.packages.CRANChooser"/>
      <when-property-is name="rstudio.desktop" value="true"/>
   </replace-with>
   <replace-with class="org.rstudio.studio.client.workbench.views.packages.impl.WebCRANChooser">
      <when-type-is class="org.rstudio.studio.client.workbench.views.packages.CRANChooser"/>
      <when-property-is name="rstudio.cocoa" value="true"/>
   </replace-with>

   <replace-with class="org.rstudio.studio.client.workbench.views.plots.ui.impl.WebActionsWidget">
      <when-type-is class="org.rstudio.studio.client.workbench.views.plots.ui.ActionsWidget"/>
   </replace-with>
   <replace-with class="org.rstudio.studio.client.workbench.views.plots.ui.impl.DesktopActionsWidget">
      <when-type-is class="org.rstudio.studio.client.workbench.views.plots.ui.ActionsWidget"/>
      <when-property-is name="rstudio.desktop" value="true"/>
   </replace-with>

    <replace-with class="org.rstudio.studio.client.workbench.views.plots.ui.export.impl.ExportPlotWeb">
       <when-type-is class="org.rstudio.studio.client.workbench.views.plots.ui.export.ExportPlot"/>
    </replace-with>
    <replace-with class="org.rstudio.studio.client.workbench.views.plots.ui.export.impl.ExportPlotDesktop">
       <when-type-is class="org.rstudio.studio.client.workbench.views.plots.ui.export.ExportPlot"/>
       <when-property-is name="rstudio.desktop" value="true"/>
    </replace-with>

   <replace-with class="org.rstudio.studio.client.common.dialog.WebDialogBuilderFactory">
      <when-type-is class="org.rstudio.studio.client.common.dialog.DialogBuilderFactory"/>
   </replace-with>
   <replace-with class="org.rstudio.studio.client.common.dialog.DesktopDialogBuilderFactory">
      <when-type-is class="org.rstudio.studio.client.common.dialog.DialogBuilderFactory"/>
      <when-property-is name="rstudio.desktop" value="true"/>
   </replace-with>
  
   <replace-with class="org.rstudio.studio.client.common.impl.WebTextInput">
      <when-type-is class="org.rstudio.studio.client.common.TextInput"/>
   </replace-with>
   <replace-with class="org.rstudio.studio.client.common.impl.DesktopTextInput">
      <when-type-is class="org.rstudio.studio.client.common.TextInput"/>
      <when-property-is name="rstudio.desktop" value="true"/>
   </replace-with>
   <replace-with class="org.rstudio.studio.client.common.impl.WebTextInput">
      <when-type-is class="org.rstudio.studio.client.common.TextInput"/>
      <when-property-is name="rstudio.cocoa" value="true"/>
   </replace-with>

   <!-- define permutations for emulated and native stack modes -->
   <set-property name="compiler.stackMode" value="emulated,native"/>
   <set-configuration-property name="compiler.emulatedStack.recordLineNumbers" value="true" />

   <!--<set-configuration-property name="CssResource.style" value="pretty" />-->
   <set-configuration-property name="UiBinder.useSafeHtmlTemplates" value="true" />
</module>
