Guest User

QtActivity.java

a guest
Oct 6th, 2013
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 38.21 KB | None | 0 0
  1. package org.kde.necessitas.origo;
  2.  
  3. import android.app.Activity;
  4. import android.app.AlertDialog;
  5. import android.app.AlertDialog.Builder;
  6. import android.app.Dialog;
  7. import android.content.ComponentName;
  8. import android.content.Context;
  9. import android.content.DialogInterface;
  10. import android.content.DialogInterface.OnClickListener;
  11. import android.content.Intent;
  12. import android.content.ServiceConnection;
  13. import android.content.pm.ActivityInfo;
  14. import android.content.pm.PackageManager;
  15. import android.content.pm.PackageManager.NameNotFoundException;
  16. import android.content.res.Configuration;
  17. import android.content.res.Resources;
  18. import android.content.res.Resources.Theme;
  19. import android.graphics.Bitmap;
  20. import android.graphics.Canvas;
  21. import android.net.Uri;
  22. import android.os.Bundle;
  23. import android.os.IBinder;
  24. import android.os.RemoteException;
  25. import android.util.AttributeSet;
  26. import android.util.Log;
  27. import android.view.ContextMenu;
  28. import android.view.ContextMenu.ContextMenuInfo;
  29. import android.view.KeyEvent;
  30. import android.view.Menu;
  31. import android.view.MenuItem;
  32. import android.view.MotionEvent;
  33. import android.view.View;
  34. import android.view.WindowManager.LayoutParams;
  35. import android.view.accessibility.AccessibilityEvent;
  36. import dalvik.system.DexClassLoader;
  37. import java.io.File;
  38. import java.lang.reflect.Method;
  39. import java.util.ArrayList;
  40. import java.util.Arrays;
  41. import org.kde.necessitas.ministro.IMinistro;
  42. import org.kde.necessitas.ministro.IMinistro.Stub;
  43. import org.kde.necessitas.ministro.IMinistroCallback;
  44. import org.kde.necessitas.ministro.IMinistroCallback.Stub;
  45.  
  46. public class QtActivity extends Activity
  47. {
  48.   private static final String APPLICATION_PARAMETERS = null;
  49.   private static final String APPLICATION_PARAMETERS_KEY = "application.parameters";
  50.   private static final String APPLICATION_TITLE_KEY = "application.title";
  51.   private static final String BUNDLED_LIBRARIES_KEY = "bundled.libraries";
  52.   private static final String DEX_PATH_KEY = "dex.path";
  53.   private static final String ENVIRONMENT_VARIABLES = "QT_USE_ANDROID_NATIVE_STYLE=1\t";
  54.   private static final String ENVIRONMENT_VARIABLES_KEY = "environment.variables";
  55.   private static final String ERROR_CODE_KEY = "error.code";
  56.   private static final String ERROR_MESSAGE_KEY = "error.message";
  57.   private static final int INCOMPATIBLE_MINISTRO_VERSION = 1;
  58.   private static final String LIB_PATH_KEY = "lib.path";
  59.   private static final String LOADER_CLASS_NAME_KEY = "loader.class.name";
  60.   private static final String MAIN_LIBRARY_KEY = "main.library";
  61.   private static final String MINIMUM_MINISTRO_API_KEY = "minimum.ministro.api";
  62.   private static final String MINIMUM_QT_VERSION_KEY = "minimum.qt.version";
  63.   private static final int MINISTRO_API_LEVEL = 2;
  64.   private static final int MINISTRO_INSTALL_REQUEST_CODE = 62446;
  65.   private static final String NATIVE_LIBRARIES_KEY = "native.libraries";
  66.   private static final int NECESSITAS_API_LEVEL = 2;
  67.   private static final String NECESSITAS_API_LEVEL_KEY = "necessitas.api.level";
  68.   private static final String QT_PROVIDER = "necessitas";
  69.   private static final String QT_PROVIDER_KEY = "qt.provider";
  70.   private static final int QT_VERSION = 264193;
  71.   private static final String REQUIRED_MODULES_KEY = "required.modules";
  72.   private ActivityInfo m_activityInfo = null;
  73.   private DexClassLoader m_classLoader = null;
  74.   private ServiceConnection m_ministroConnection = new ServiceConnection()
  75.   {
  76.     private IMinistroCallback m_ministroCallback = new IMinistroCallback.Stub()
  77.     {
  78.       public void loaderReady(final Bundle paramAnonymous2Bundle)
  79.         throws RemoteException
  80.       {
  81.         QtActivity.this.runOnUiThread(new Runnable()
  82.         {
  83.           public void run()
  84.           {
  85.             QtActivity.this.unbindService(QtActivity.this.m_ministroConnection);
  86.             QtActivity.this.loadApplication(paramAnonymous2Bundle);
  87.           }
  88.         });
  89.       }
  90.     };
  91.     private IMinistro m_service = null;
  92.  
  93.     public void onServiceConnected(ComponentName paramAnonymousComponentName, IBinder paramAnonymousIBinder)
  94.     {
  95.       this.m_service = IMinistro.Stub.asInterface(paramAnonymousIBinder);
  96.       try
  97.       {
  98.         if (this.m_service != null)
  99.         {
  100.           Bundle localBundle = new Bundle();
  101.           localBundle.putStringArray("required.modules", QtActivity.this.m_qtLibs);
  102.           localBundle.putString("application.title", (String)QtActivity.this.getTitle());
  103.           localBundle.putInt("minimum.ministro.api", 2);
  104.           localBundle.putString("qt.provider", "necessitas");
  105.           localBundle.putInt("minimum.qt.version", 264193);
  106.           localBundle.putString("environment.variables", "QT_USE_ANDROID_NATIVE_STYLE=1\t");
  107.           if (QtActivity.APPLICATION_PARAMETERS != null)
  108.             localBundle.putString("application.parameters", QtActivity.APPLICATION_PARAMETERS);
  109.           this.m_service.requestLoader(this.m_ministroCallback, localBundle);
  110.         }
  111.         return;
  112.       }
  113.       catch (RemoteException localRemoteException)
  114.       {
  115.         localRemoteException.printStackTrace();
  116.       }
  117.     }
  118.  
  119.     public void onServiceDisconnected(ComponentName paramAnonymousComponentName)
  120.     {
  121.       this.m_service = null;
  122.     }
  123.   };
  124.   private String[] m_qtLibs = null;
  125.  
  126.   private void downloadUpgradeMinistro(String paramString)
  127.   {
  128.     AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
  129.     localBuilder.setMessage(paramString);
  130.     localBuilder.setPositiveButton(17039379, new DialogInterface.OnClickListener()
  131.     {
  132.       public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
  133.       {
  134.         try
  135.         {
  136.           Intent localIntent = new Intent("android.intent.action.VIEW", Uri.parse("market://search?q=pname:org.kde.necessitas.ministro"));
  137.           QtActivity.this.startActivityForResult(localIntent, 62446);
  138.           return;
  139.         }
  140.         catch (Exception localException)
  141.         {
  142.           localException.printStackTrace();
  143.           QtActivity.this.ministroNotFound();
  144.         }
  145.       }
  146.     });
  147.     localBuilder.setNegativeButton(17039369, new DialogInterface.OnClickListener()
  148.     {
  149.       public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
  150.       {
  151.         QtActivity.this.finish();
  152.       }
  153.     });
  154.     localBuilder.show();
  155.   }
  156.  
  157.   private void loadApplication(Bundle paramBundle)
  158.   {
  159.     AlertDialog localAlertDialog1;
  160.     try
  161.     {
  162.       int i = paramBundle.getInt("error.code");
  163.       if (i == 0)
  164.         break label163;
  165.       if (i == 1)
  166.       {
  167.         downloadUpgradeMinistro(paramBundle.getString("error.message"));
  168.         return;
  169.       }
  170.       AlertDialog localAlertDialog2 = new AlertDialog.Builder(this).create();
  171.       localAlertDialog2.setMessage(paramBundle.getString("error.message"));
  172.       localAlertDialog2.setButton(getResources().getString(17039370), new DialogInterface.OnClickListener()
  173.       {
  174.         public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
  175.         {
  176.           QtActivity.this.finish();
  177.         }
  178.       });
  179.       localAlertDialog2.show();
  180.       return;
  181.     }
  182.     catch (Exception localException)
  183.     {
  184.       localException.printStackTrace();
  185.       localAlertDialog1 = new AlertDialog.Builder(this).create();
  186.       if (this.m_activityInfo == null)
  187.         break label495;
  188.     }
  189.     label163: String str1;
  190.     String str2;
  191.     String str3;
  192.     if (this.m_activityInfo.metaData.containsKey("android.app.fatal_error_msg"))
  193.     {
  194.       localAlertDialog1.setMessage(this.m_activityInfo.metaData.getString("android.app.fatal_error_msg"));
  195.       localAlertDialog1.setButton(getResources().getString(17039370), new DialogInterface.OnClickListener()
  196.       {
  197.         public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
  198.         {
  199.           QtActivity.this.finish();
  200.         }
  201.       });
  202.       localAlertDialog1.show();
  203.       return;
  204.       ArrayList localArrayList = new ArrayList();
  205.       if (this.m_activityInfo.metaData.containsKey("android.app.bundled_libs_resource_id"))
  206.         localArrayList.addAll(Arrays.asList(getResources().getStringArray(this.m_activityInfo.metaData.getInt("android.app.bundled_libs_resource_id"))));
  207.       boolean bool = this.m_activityInfo.metaData.containsKey("android.app.lib_name");
  208.       str1 = null;
  209.       if (bool)
  210.       {
  211.         str1 = this.m_activityInfo.metaData.getString("android.app.lib_name");
  212.         paramBundle.putString("main.library", str1);
  213.       }
  214.       paramBundle.putStringArrayList("bundled.libraries", localArrayList);
  215.       paramBundle.putInt("necessitas.api.level", 2);
  216.       str2 = paramBundle.getString("dex.path");
  217.       str3 = getDir("outdex", 0).getAbsolutePath();
  218.       if (!paramBundle.containsKey("lib.path"))
  219.         break label506;
  220.     }
  221.     label495: label506: for (String str4 = paramBundle.getString("lib.path"); ; str4 = null)
  222.     {
  223.       this.m_classLoader = new DexClassLoader(str2, str3, str4, getClassLoader());
  224.       Object localObject = this.m_classLoader.loadClass(paramBundle.getString("loader.class.name")).newInstance();
  225.       Method localMethod = localObject.getClass().getMethod("loadApplication", new Class[] { Activity.class, ClassLoader.class, Bundle.class });
  226.       Object[] arrayOfObject = new Object[3];
  227.       arrayOfObject[0] = this;
  228.       arrayOfObject[1] = this.m_classLoader;
  229.       arrayOfObject[2] = paramBundle;
  230.       if (!((Boolean)localMethod.invoke(localObject, arrayOfObject)).booleanValue())
  231.         throw new Exception("");
  232.       QtApplication.setQtActivityDelegate(localObject);
  233.       if (str1 != null)
  234.         System.loadLibrary(str1);
  235.       if (!((Boolean)localObject.getClass().getMethod("startApplication", new Class[0]).invoke(localObject, new Object[0])).booleanValue())
  236.       {
  237.         throw new Exception("");
  238.         localAlertDialog1.setMessage("Fatal error, your application can't be started.");
  239.         break;
  240.       }
  241.       return;
  242.     }
  243.   }
  244.  
  245.   private void ministroNotFound()
  246.   {
  247.     AlertDialog localAlertDialog = new AlertDialog.Builder(this).create();
  248.     if ((this.m_activityInfo != null) && (this.m_activityInfo.metaData.containsKey("android.app.ministro_not_found_msg")))
  249.       localAlertDialog.setMessage(this.m_activityInfo.metaData.getString("android.app.ministro_not_found_msg"));
  250.     while (true)
  251.     {
  252.       localAlertDialog.setButton(getResources().getString(17039370), new DialogInterface.OnClickListener()
  253.       {
  254.         public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
  255.         {
  256.           QtActivity.this.finish();
  257.         }
  258.       });
  259.       localAlertDialog.show();
  260.       return;
  261.       localAlertDialog.setMessage("Can't find Ministro service.\nThe application can't start.");
  262.     }
  263.   }
  264.  
  265.   private void startApp(boolean paramBoolean)
  266.   {
  267.     while (true)
  268.     {
  269.       int n;
  270.       int k;
  271.       try
  272.       {
  273.         ActivityInfo localActivityInfo = getPackageManager().getActivityInfo(getComponentName(), 128);
  274.         if (localActivityInfo.metaData.containsKey("android.app.qt_libs_resource_id"))
  275.         {
  276.           int i1 = localActivityInfo.metaData.getInt("android.app.qt_libs_resource_id");
  277.           this.m_qtLibs = getResources().getStringArray(i1);
  278.         }
  279.         if ((getIntent().getExtras() != null) && (getIntent().getExtras().containsKey("use_local_qt_libs")) && (getIntent().getExtras().getString("use_local_qt_libs").equals("true")))
  280.         {
  281.           ArrayList localArrayList = new ArrayList();
  282.           String str2 = "/data/local/qt/";
  283.           if (getIntent().getExtras().containsKey("libs_prefix"))
  284.             str2 = getIntent().getExtras().getString("libs_prefix");
  285.           if (this.m_qtLibs != null)
  286.           {
  287.             int i = 0;
  288.             if (i < this.m_qtLibs.length)
  289.             {
  290.               localArrayList.add(str2 + "lib/lib" + this.m_qtLibs[i] + ".so");
  291.               i++;
  292.               continue;
  293.             }
  294.           }
  295.           if (getIntent().getExtras().containsKey("load_local_libs"))
  296.           {
  297.             String[] arrayOfString2 = getIntent().getExtras().getString("load_local_libs").split(":");
  298.             int m = arrayOfString2.length;
  299.             n = 0;
  300.             if (n < m)
  301.             {
  302.               String str7 = arrayOfString2[n];
  303.               if (str7.length() <= 0)
  304.                 break label716;
  305.               localArrayList.add(str2 + str7);
  306.               break label716;
  307.             }
  308.           }
  309.           String str3 = new String();
  310.           String str4 = System.getProperty("path.separator", ":");
  311.           if (getIntent().getExtras().containsKey("load_local_jars"))
  312.           {
  313.             String[] arrayOfString1 = getIntent().getExtras().getString("load_local_jars").split(":");
  314.             int j = arrayOfString1.length;
  315.             k = 0;
  316.             if (k < j)
  317.             {
  318.               String str6 = arrayOfString1[k];
  319.               if (str6.length() <= 0)
  320.                 break label722;
  321.               if (str3.length() > 0)
  322.                 str3 = str3 + str4;
  323.               str3 = str3 + str2 + str6;
  324.               break label722;
  325.             }
  326.           }
  327.           Bundle localBundle = new Bundle();
  328.           localBundle.putInt("error.code", 0);
  329.           localBundle.putString("dex.path", str3);
  330.           if (getIntent().getExtras().containsKey("loader_class_name"))
  331.           {
  332.             str5 = getIntent().getExtras().getString("loader_class_name");
  333.             localBundle.putString("loader.class.name", str5);
  334.             localBundle.putStringArrayList("native.libraries", localArrayList);
  335.             localBundle.putString("environment.variables", "QML_IMPORT_PATH=" + str2 + "/imports\tQT_PLUGIN_PATH=" + str2 + "/plugins");
  336.             localBundle.putString("application.parameters", "-platform\tandroid");
  337.             loadApplication(localBundle);
  338.             return;
  339.           }
  340.           String str5 = "org.kde.necessitas.industrius.QtActivityDelegate";
  341.           continue;
  342.         }
  343.         try
  344.         {
  345.           if (bindService(new Intent(IMinistro.class.getCanonicalName()), this.m_ministroConnection, 1))
  346.             break;
  347.           throw new SecurityException("");
  348.         }
  349.         catch (Exception localException2)
  350.         {
  351.           if (!paramBoolean)
  352.             break label711;
  353.         }
  354.         String str1 = "This application requires Ministro service. Would you like to install it?";
  355.         if ((this.m_activityInfo != null) && (this.m_activityInfo.metaData.containsKey("android.app.ministro_needed_msg")))
  356.           str1 = this.m_activityInfo.metaData.getString("android.app.ministro_needed_msg");
  357.         downloadUpgradeMinistro(str1);
  358.         return;
  359.       }
  360.       catch (Exception localException1)
  361.       {
  362.         Log.e("Qt", "Can't create main activity", localException1);
  363.         return;
  364.       }
  365.       label711: ministroNotFound();
  366.       return;
  367.       label716: n++;
  368.       continue;
  369.       label722: k++;
  370.     }
  371.   }
  372.  
  373.   public boolean dispatchKeyEvent(KeyEvent paramKeyEvent)
  374.   {
  375.     if ((QtApplication.m_delegateObject != null) && (QtApplication.dispatchKeyEvent != null))
  376.       return ((Boolean)QtApplication.invokeDelegateMethod(QtApplication.dispatchKeyEvent, new Object[] { paramKeyEvent })).booleanValue();
  377.     return super.dispatchKeyEvent(paramKeyEvent);
  378.   }
  379.  
  380.   public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent paramAccessibilityEvent)
  381.   {
  382.     if ((QtApplication.m_delegateObject != null) && (QtApplication.dispatchPopulateAccessibilityEvent != null))
  383.       return ((Boolean)QtApplication.invokeDelegateMethod(QtApplication.dispatchPopulateAccessibilityEvent, new Object[] { paramAccessibilityEvent })).booleanValue();
  384.     return super.dispatchPopulateAccessibilityEvent(paramAccessibilityEvent);
  385.   }
  386.  
  387.   public boolean dispatchTouchEvent(MotionEvent paramMotionEvent)
  388.   {
  389.     if ((QtApplication.m_delegateObject != null) && (QtApplication.dispatchTouchEvent != null))
  390.       return ((Boolean)QtApplication.invokeDelegateMethod(QtApplication.dispatchTouchEvent, new Object[] { paramMotionEvent })).booleanValue();
  391.     return super.dispatchTouchEvent(paramMotionEvent);
  392.   }
  393.  
  394.   public boolean dispatchTrackballEvent(MotionEvent paramMotionEvent)
  395.   {
  396.     if ((QtApplication.m_delegateObject != null) && (QtApplication.dispatchTrackballEvent != null))
  397.       return ((Boolean)QtApplication.invokeDelegateMethod(QtApplication.dispatchTrackballEvent, new Object[] { paramMotionEvent })).booleanValue();
  398.     return super.dispatchTrackballEvent(paramMotionEvent);
  399.   }
  400.  
  401.   protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  402.   {
  403.     if ((QtApplication.m_delegateObject != null) && (QtApplication.onActivityResult != null))
  404.     {
  405.       Method localMethod = QtApplication.onActivityResult;
  406.       Object[] arrayOfObject = new Object[3];
  407.       arrayOfObject[0] = Integer.valueOf(paramInt1);
  408.       arrayOfObject[1] = Integer.valueOf(paramInt2);
  409.       arrayOfObject[2] = paramIntent;
  410.       QtApplication.invokeDelegateMethod(localMethod, arrayOfObject);
  411.       return;
  412.     }
  413.     if (paramInt1 == 62446)
  414.       startApp(false);
  415.     super.onActivityResult(paramInt1, paramInt2, paramIntent);
  416.   }
  417.  
  418.   protected void onApplyThemeResource(Resources.Theme paramTheme, int paramInt, boolean paramBoolean)
  419.   {
  420.     Object[] arrayOfObject = new Object[3];
  421.     arrayOfObject[0] = paramTheme;
  422.     arrayOfObject[1] = Integer.valueOf(paramInt);
  423.     arrayOfObject[2] = Boolean.valueOf(paramBoolean);
  424.     if (!QtApplication.invokeDelegate(arrayOfObject).invoked)
  425.       super.onApplyThemeResource(paramTheme, paramInt, paramBoolean);
  426.   }
  427.  
  428.   public void onAttachedToWindow()
  429.   {
  430.     if (!QtApplication.invokeDelegate(new Object[0]).invoked)
  431.       super.onAttachedToWindow();
  432.   }
  433.  
  434.   public void onBackPressed()
  435.   {
  436.     if (!QtApplication.invokeDelegate(new Object[0]).invoked)
  437.       super.onBackPressed();
  438.   }
  439.  
  440.   protected void onChildTitleChanged(Activity paramActivity, CharSequence paramCharSequence)
  441.   {
  442.     if (!QtApplication.invokeDelegate(new Object[] { paramActivity, paramCharSequence }).invoked)
  443.       super.onChildTitleChanged(paramActivity, paramCharSequence);
  444.   }
  445.  
  446.   public void onConfigurationChanged(Configuration paramConfiguration)
  447.   {
  448.     if (!QtApplication.invokeDelegate(new Object[] { paramConfiguration }).invoked)
  449.       super.onConfigurationChanged(paramConfiguration);
  450.   }
  451.  
  452.   public void onContentChanged()
  453.   {
  454.     if (!QtApplication.invokeDelegate(new Object[0]).invoked)
  455.       super.onContentChanged();
  456.   }
  457.  
  458.   public boolean onContextItemSelected(MenuItem paramMenuItem)
  459.   {
  460.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(new Object[] { paramMenuItem });
  461.     if (localInvokeResult.invoked)
  462.       return ((Boolean)localInvokeResult.methodReturns).booleanValue();
  463.     return super.onContextItemSelected(paramMenuItem);
  464.   }
  465.  
  466.   public void onContextMenuClosed(Menu paramMenu)
  467.   {
  468.     if (!QtApplication.invokeDelegate(new Object[] { paramMenu }).invoked)
  469.       super.onContextMenuClosed(paramMenu);
  470.   }
  471.  
  472.   public void onCreate(Bundle paramBundle)
  473.   {
  474.     super.onCreate(paramBundle);
  475.     if ((QtApplication.m_delegateObject != null) && (QtApplication.onCreate != null))
  476.       QtApplication.invokeDelegateMethod(QtApplication.onCreate, new Object[] { paramBundle });
  477.     while (true)
  478.     {
  479.       return;
  480.       requestWindowFeature(1);
  481.       try
  482.       {
  483.         this.m_activityInfo = getPackageManager().getActivityInfo(getComponentName(), 128);
  484.         if (getLastNonConfigurationInstance() == null)
  485.         {
  486.           if (this.m_activityInfo.metaData.containsKey("android.app.splash_screen"))
  487.             setContentView(this.m_activityInfo.metaData.getInt("android.app.splash_screen"));
  488.           startApp(true);
  489.           return;
  490.         }
  491.       }
  492.       catch (PackageManager.NameNotFoundException localNameNotFoundException)
  493.       {
  494.         localNameNotFoundException.printStackTrace();
  495.         finish();
  496.       }
  497.     }
  498.   }
  499.  
  500.   public void onCreateContextMenu(ContextMenu paramContextMenu, View paramView, ContextMenu.ContextMenuInfo paramContextMenuInfo)
  501.   {
  502.     if (!QtApplication.invokeDelegate(new Object[] { paramContextMenu, paramView, paramContextMenuInfo }).invoked)
  503.       super.onCreateContextMenu(paramContextMenu, paramView, paramContextMenuInfo);
  504.   }
  505.  
  506.   public CharSequence onCreateDescription()
  507.   {
  508.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(new Object[0]);
  509.     if (localInvokeResult.invoked)
  510.       return (CharSequence)localInvokeResult.methodReturns;
  511.     return super.onCreateDescription();
  512.   }
  513.  
  514.   protected Dialog onCreateDialog(int paramInt)
  515.   {
  516.     Object[] arrayOfObject = new Object[1];
  517.     arrayOfObject[0] = Integer.valueOf(paramInt);
  518.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(arrayOfObject);
  519.     if (localInvokeResult.invoked)
  520.       return (Dialog)localInvokeResult.methodReturns;
  521.     return super.onCreateDialog(paramInt);
  522.   }
  523.  
  524.   public boolean onCreateOptionsMenu(Menu paramMenu)
  525.   {
  526.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(new Object[] { paramMenu });
  527.     if (localInvokeResult.invoked)
  528.       return ((Boolean)localInvokeResult.methodReturns).booleanValue();
  529.     return super.onCreateOptionsMenu(paramMenu);
  530.   }
  531.  
  532.   public boolean onCreatePanelMenu(int paramInt, Menu paramMenu)
  533.   {
  534.     Object[] arrayOfObject = new Object[2];
  535.     arrayOfObject[0] = Integer.valueOf(paramInt);
  536.     arrayOfObject[1] = paramMenu;
  537.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(arrayOfObject);
  538.     if (localInvokeResult.invoked)
  539.       return ((Boolean)localInvokeResult.methodReturns).booleanValue();
  540.     return super.onCreatePanelMenu(paramInt, paramMenu);
  541.   }
  542.  
  543.   public View onCreatePanelView(int paramInt)
  544.   {
  545.     Object[] arrayOfObject = new Object[1];
  546.     arrayOfObject[0] = Integer.valueOf(paramInt);
  547.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(arrayOfObject);
  548.     if (localInvokeResult.invoked)
  549.       return (View)localInvokeResult.methodReturns;
  550.     return super.onCreatePanelView(paramInt);
  551.   }
  552.  
  553.   public boolean onCreateThumbnail(Bitmap paramBitmap, Canvas paramCanvas)
  554.   {
  555.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(new Object[] { paramBitmap, paramCanvas });
  556.     if (localInvokeResult.invoked)
  557.       return ((Boolean)localInvokeResult.methodReturns).booleanValue();
  558.     return super.onCreateThumbnail(paramBitmap, paramCanvas);
  559.   }
  560.  
  561.   public View onCreateView(String paramString, Context paramContext, AttributeSet paramAttributeSet)
  562.   {
  563.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(new Object[] { paramString, paramContext, paramAttributeSet });
  564.     if (localInvokeResult.invoked)
  565.       return (View)localInvokeResult.methodReturns;
  566.     return super.onCreateView(paramString, paramContext, paramAttributeSet);
  567.   }
  568.  
  569.   protected void onDestroy()
  570.   {
  571.     super.onDestroy();
  572.     QtApplication.invokeDelegate(new Object[0]);
  573.   }
  574.  
  575.   public void onDetachedFromWindow()
  576.   {
  577.     if (!QtApplication.invokeDelegate(new Object[0]).invoked)
  578.       super.onDetachedFromWindow();
  579.   }
  580.  
  581.   public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  582.   {
  583.     if ((QtApplication.m_delegateObject != null) && (QtApplication.onKeyDown != null))
  584.     {
  585.       Method localMethod = QtApplication.onKeyDown;
  586.       Object[] arrayOfObject = new Object[2];
  587.       arrayOfObject[0] = Integer.valueOf(paramInt);
  588.       arrayOfObject[1] = paramKeyEvent;
  589.       return ((Boolean)QtApplication.invokeDelegateMethod(localMethod, arrayOfObject)).booleanValue();
  590.     }
  591.     return super.onKeyDown(paramInt, paramKeyEvent);
  592.   }
  593.  
  594.   public boolean onKeyLongPress(int paramInt, KeyEvent paramKeyEvent)
  595.   {
  596.     if ((QtApplication.m_delegateObject != null) && (QtApplication.onKeyLongPress != null))
  597.     {
  598.       Method localMethod = QtApplication.onKeyLongPress;
  599.       Object[] arrayOfObject = new Object[2];
  600.       arrayOfObject[0] = Integer.valueOf(paramInt);
  601.       arrayOfObject[1] = paramKeyEvent;
  602.       return ((Boolean)QtApplication.invokeDelegateMethod(localMethod, arrayOfObject)).booleanValue();
  603.     }
  604.     return super.onKeyLongPress(paramInt, paramKeyEvent);
  605.   }
  606.  
  607.   public boolean onKeyMultiple(int paramInt1, int paramInt2, KeyEvent paramKeyEvent)
  608.   {
  609.     if ((QtApplication.m_delegateObject != null) && (QtApplication.onKeyMultiple != null))
  610.     {
  611.       Method localMethod = QtApplication.onKeyMultiple;
  612.       Object[] arrayOfObject = new Object[3];
  613.       arrayOfObject[0] = Integer.valueOf(paramInt1);
  614.       arrayOfObject[1] = Integer.valueOf(paramInt2);
  615.       arrayOfObject[2] = paramKeyEvent;
  616.       return ((Boolean)QtApplication.invokeDelegateMethod(localMethod, arrayOfObject)).booleanValue();
  617.     }
  618.     return super.onKeyMultiple(paramInt1, paramInt2, paramKeyEvent);
  619.   }
  620.  
  621.   public boolean onKeyUp(int paramInt, KeyEvent paramKeyEvent)
  622.   {
  623.     if ((QtApplication.m_delegateObject != null) && (QtApplication.onKeyDown != null))
  624.     {
  625.       Method localMethod = QtApplication.onKeyUp;
  626.       Object[] arrayOfObject = new Object[2];
  627.       arrayOfObject[0] = Integer.valueOf(paramInt);
  628.       arrayOfObject[1] = paramKeyEvent;
  629.       return ((Boolean)QtApplication.invokeDelegateMethod(localMethod, arrayOfObject)).booleanValue();
  630.     }
  631.     return super.onKeyUp(paramInt, paramKeyEvent);
  632.   }
  633.  
  634.   public void onLowMemory()
  635.   {
  636.     if (!QtApplication.invokeDelegate(new Object[0]).invoked)
  637.       super.onLowMemory();
  638.   }
  639.  
  640.   public boolean onMenuItemSelected(int paramInt, MenuItem paramMenuItem)
  641.   {
  642.     Object[] arrayOfObject = new Object[2];
  643.     arrayOfObject[0] = Integer.valueOf(paramInt);
  644.     arrayOfObject[1] = paramMenuItem;
  645.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(arrayOfObject);
  646.     if (localInvokeResult.invoked)
  647.       return ((Boolean)localInvokeResult.methodReturns).booleanValue();
  648.     return super.onMenuItemSelected(paramInt, paramMenuItem);
  649.   }
  650.  
  651.   public boolean onMenuOpened(int paramInt, Menu paramMenu)
  652.   {
  653.     Object[] arrayOfObject = new Object[2];
  654.     arrayOfObject[0] = Integer.valueOf(paramInt);
  655.     arrayOfObject[1] = paramMenu;
  656.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(arrayOfObject);
  657.     if (localInvokeResult.invoked)
  658.       return ((Boolean)localInvokeResult.methodReturns).booleanValue();
  659.     return super.onMenuOpened(paramInt, paramMenu);
  660.   }
  661.  
  662.   protected void onNewIntent(Intent paramIntent)
  663.   {
  664.     if (!QtApplication.invokeDelegate(new Object[] { paramIntent }).invoked)
  665.       super.onNewIntent(paramIntent);
  666.   }
  667.  
  668.   public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  669.   {
  670.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(new Object[] { paramMenuItem });
  671.     if (localInvokeResult.invoked)
  672.       return ((Boolean)localInvokeResult.methodReturns).booleanValue();
  673.     return super.onOptionsItemSelected(paramMenuItem);
  674.   }
  675.  
  676.   public void onOptionsMenuClosed(Menu paramMenu)
  677.   {
  678.     if (!QtApplication.invokeDelegate(new Object[] { paramMenu }).invoked)
  679.       super.onOptionsMenuClosed(paramMenu);
  680.   }
  681.  
  682.   public void onPanelClosed(int paramInt, Menu paramMenu)
  683.   {
  684.     Object[] arrayOfObject = new Object[2];
  685.     arrayOfObject[0] = Integer.valueOf(paramInt);
  686.     arrayOfObject[1] = paramMenu;
  687.     if (!QtApplication.invokeDelegate(arrayOfObject).invoked)
  688.       super.onPanelClosed(paramInt, paramMenu);
  689.   }
  690.  
  691.   protected void onPause()
  692.   {
  693.     super.onPause();
  694.     QtApplication.invokeDelegate(new Object[0]);
  695.   }
  696.  
  697.   protected void onPostCreate(Bundle paramBundle)
  698.   {
  699.     super.onPostCreate(paramBundle);
  700.     QtApplication.invokeDelegate(new Object[] { paramBundle });
  701.   }
  702.  
  703.   protected void onPostResume()
  704.   {
  705.     super.onPostResume();
  706.     QtApplication.invokeDelegate(new Object[0]);
  707.   }
  708.  
  709.   protected void onPrepareDialog(int paramInt, Dialog paramDialog)
  710.   {
  711.     Object[] arrayOfObject = new Object[2];
  712.     arrayOfObject[0] = Integer.valueOf(paramInt);
  713.     arrayOfObject[1] = paramDialog;
  714.     if (!QtApplication.invokeDelegate(arrayOfObject).invoked)
  715.       super.onPrepareDialog(paramInt, paramDialog);
  716.   }
  717.  
  718.   public boolean onPrepareOptionsMenu(Menu paramMenu)
  719.   {
  720.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(new Object[] { paramMenu });
  721.     if (localInvokeResult.invoked)
  722.       return ((Boolean)localInvokeResult.methodReturns).booleanValue();
  723.     return super.onPrepareOptionsMenu(paramMenu);
  724.   }
  725.  
  726.   public boolean onPreparePanel(int paramInt, View paramView, Menu paramMenu)
  727.   {
  728.     Object[] arrayOfObject = new Object[3];
  729.     arrayOfObject[0] = Integer.valueOf(paramInt);
  730.     arrayOfObject[1] = paramView;
  731.     arrayOfObject[2] = paramMenu;
  732.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(arrayOfObject);
  733.     if (localInvokeResult.invoked)
  734.       return ((Boolean)localInvokeResult.methodReturns).booleanValue();
  735.     return super.onPreparePanel(paramInt, paramView, paramMenu);
  736.   }
  737.  
  738.   protected void onRestart()
  739.   {
  740.     super.onRestart();
  741.     QtApplication.invokeDelegate(new Object[0]);
  742.   }
  743.  
  744.   protected void onRestoreInstanceState(Bundle paramBundle)
  745.   {
  746.     if (!QtApplication.invokeDelegate(new Object[] { paramBundle }).invoked)
  747.       super.onRestoreInstanceState(paramBundle);
  748.   }
  749.  
  750.   protected void onResume()
  751.   {
  752.     super.onResume();
  753.     QtApplication.invokeDelegate(new Object[0]);
  754.   }
  755.  
  756.   public Object onRetainNonConfigurationInstance()
  757.   {
  758.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(new Object[0]);
  759.     if (localInvokeResult.invoked)
  760.       return localInvokeResult.methodReturns;
  761.     return super.onRetainNonConfigurationInstance();
  762.   }
  763.  
  764.   protected void onSaveInstanceState(Bundle paramBundle)
  765.   {
  766.     if (!QtApplication.invokeDelegate(new Object[] { paramBundle }).invoked)
  767.       super.onSaveInstanceState(paramBundle);
  768.   }
  769.  
  770.   public boolean onSearchRequested()
  771.   {
  772.     QtApplication.InvokeResult localInvokeResult = QtApplication.invokeDelegate(new Object[0]);
  773.     if (localInvokeResult.invoked)
  774.       return ((Boolean)localInvokeResult.methodReturns).booleanValue();
  775.     return super.onSearchRequested();
  776.   }
  777.  
  778.   protected void onStart()
  779.   {
  780.     super.onStart();
  781.     QtApplication.invokeDelegate(new Object[0]);
  782.   }
  783.  
  784.   protected void onStop()
  785.   {
  786.     super.onStop();
  787.     QtApplication.invokeDelegate(new Object[0]);
  788.   }
  789.  
  790.   protected void onTitleChanged(CharSequence paramCharSequence, int paramInt)
  791.   {
  792.     Object[] arrayOfObject = new Object[2];
  793.     arrayOfObject[0] = paramCharSequence;
  794.     arrayOfObject[1] = Integer.valueOf(paramInt);
  795.     if (!QtApplication.invokeDelegate(arrayOfObject).invoked)
  796.       super.onTitleChanged(paramCharSequence, paramInt);
  797.   }
  798.  
  799.   public boolean onTouchEvent(MotionEvent paramMotionEvent)
  800.   {
  801.     if ((QtApplication.m_delegateObject != null) && (QtApplication.onTouchEvent != null))
  802.       return ((Boolean)QtApplication.invokeDelegateMethod(QtApplication.onTouchEvent, new Object[] { paramMotionEvent })).booleanValue();
  803.     return super.onTouchEvent(paramMotionEvent);
  804.   }
  805.  
  806.   public boolean onTrackballEvent(MotionEvent paramMotionEvent)
  807.   {
  808.     if ((QtApplication.m_delegateObject != null) && (QtApplication.onTrackballEvent != null))
  809.       return ((Boolean)QtApplication.invokeDelegateMethod(QtApplication.onTrackballEvent, new Object[] { paramMotionEvent })).booleanValue();
  810.     return super.onTrackballEvent(paramMotionEvent);
  811.   }
  812.  
  813.   public void onUserInteraction()
  814.   {
  815.     if (!QtApplication.invokeDelegate(new Object[0]).invoked)
  816.       super.onUserInteraction();
  817.   }
  818.  
  819.   protected void onUserLeaveHint()
  820.   {
  821.     if (!QtApplication.invokeDelegate(new Object[0]).invoked)
  822.       super.onUserLeaveHint();
  823.   }
  824.  
  825.   public void onWindowAttributesChanged(WindowManager.LayoutParams paramLayoutParams)
  826.   {
  827.     if (!QtApplication.invokeDelegate(new Object[] { paramLayoutParams }).invoked)
  828.       super.onWindowAttributesChanged(paramLayoutParams);
  829.   }
  830.  
  831.   public void onWindowFocusChanged(boolean paramBoolean)
  832.   {
  833.     Object[] arrayOfObject = new Object[1];
  834.     arrayOfObject[0] = Boolean.valueOf(paramBoolean);
  835.     if (!QtApplication.invokeDelegate(arrayOfObject).invoked)
  836.       super.onWindowFocusChanged(paramBoolean);
  837.   }
  838.  
  839.   public boolean super_dispatchKeyEvent(KeyEvent paramKeyEvent)
  840.   {
  841.     return super.dispatchKeyEvent(paramKeyEvent);
  842.   }
  843.  
  844.   public boolean super_dispatchPopulateAccessibilityEvent(AccessibilityEvent paramAccessibilityEvent)
  845.   {
  846.     return super_dispatchPopulateAccessibilityEvent(paramAccessibilityEvent);
  847.   }
  848.  
  849.   public boolean super_dispatchTouchEvent(MotionEvent paramMotionEvent)
  850.   {
  851.     return super.dispatchTouchEvent(paramMotionEvent);
  852.   }
  853.  
  854.   public boolean super_dispatchTrackballEvent(MotionEvent paramMotionEvent)
  855.   {
  856.     return super.dispatchTrackballEvent(paramMotionEvent);
  857.   }
  858.  
  859.   public void super_onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  860.   {
  861.     super.onActivityResult(paramInt1, paramInt2, paramIntent);
  862.   }
  863.  
  864.   public void super_onApplyThemeResource(Resources.Theme paramTheme, int paramInt, boolean paramBoolean)
  865.   {
  866.     super.onApplyThemeResource(paramTheme, paramInt, paramBoolean);
  867.   }
  868.  
  869.   public void super_onAttachedToWindow()
  870.   {
  871.     super.onAttachedToWindow();
  872.   }
  873.  
  874.   public void super_onBackPressed()
  875.   {
  876.     super.onBackPressed();
  877.   }
  878.  
  879.   public void super_onChildTitleChanged(Activity paramActivity, CharSequence paramCharSequence)
  880.   {
  881.     super.onChildTitleChanged(paramActivity, paramCharSequence);
  882.   }
  883.  
  884.   public void super_onConfigurationChanged(Configuration paramConfiguration)
  885.   {
  886.     super.onConfigurationChanged(paramConfiguration);
  887.   }
  888.  
  889.   public void super_onContentChanged()
  890.   {
  891.     super.onContentChanged();
  892.   }
  893.  
  894.   public boolean super_onContextItemSelected(MenuItem paramMenuItem)
  895.   {
  896.     return super.onContextItemSelected(paramMenuItem);
  897.   }
  898.  
  899.   public void super_onContextMenuClosed(Menu paramMenu)
  900.   {
  901.     super.onContextMenuClosed(paramMenu);
  902.   }
  903.  
  904.   public void super_onCreateContextMenu(ContextMenu paramContextMenu, View paramView, ContextMenu.ContextMenuInfo paramContextMenuInfo)
  905.   {
  906.     super.onCreateContextMenu(paramContextMenu, paramView, paramContextMenuInfo);
  907.   }
  908.  
  909.   public CharSequence super_onCreateDescription()
  910.   {
  911.     return super.onCreateDescription();
  912.   }
  913.  
  914.   public Dialog super_onCreateDialog(int paramInt)
  915.   {
  916.     return super.onCreateDialog(paramInt);
  917.   }
  918.  
  919.   public boolean super_onCreateOptionsMenu(Menu paramMenu)
  920.   {
  921.     return super.onCreateOptionsMenu(paramMenu);
  922.   }
  923.  
  924.   public boolean super_onCreatePanelMenu(int paramInt, Menu paramMenu)
  925.   {
  926.     return super.onCreatePanelMenu(paramInt, paramMenu);
  927.   }
  928.  
  929.   public View super_onCreatePanelView(int paramInt)
  930.   {
  931.     return super.onCreatePanelView(paramInt);
  932.   }
  933.  
  934.   public boolean super_onCreateThumbnail(Bitmap paramBitmap, Canvas paramCanvas)
  935.   {
  936.     return super.onCreateThumbnail(paramBitmap, paramCanvas);
  937.   }
  938.  
  939.   public View super_onCreateView(String paramString, Context paramContext, AttributeSet paramAttributeSet)
  940.   {
  941.     return super.onCreateView(paramString, paramContext, paramAttributeSet);
  942.   }
  943.  
  944.   public void super_onDetachedFromWindow()
  945.   {
  946.     super.onDetachedFromWindow();
  947.   }
  948.  
  949.   public boolean super_onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  950.   {
  951.     return super.onKeyDown(paramInt, paramKeyEvent);
  952.   }
  953.  
  954.   public boolean super_onKeyLongPress(int paramInt, KeyEvent paramKeyEvent)
  955.   {
  956.     return super.onKeyLongPress(paramInt, paramKeyEvent);
  957.   }
  958.  
  959.   public boolean super_onKeyMultiple(int paramInt1, int paramInt2, KeyEvent paramKeyEvent)
  960.   {
  961.     return super.onKeyMultiple(paramInt1, paramInt2, paramKeyEvent);
  962.   }
  963.  
  964.   public boolean super_onKeyUp(int paramInt, KeyEvent paramKeyEvent)
  965.   {
  966.     return super.onKeyUp(paramInt, paramKeyEvent);
  967.   }
  968.  
  969.   public boolean super_onMenuItemSelected(int paramInt, MenuItem paramMenuItem)
  970.   {
  971.     return super.onMenuItemSelected(paramInt, paramMenuItem);
  972.   }
  973.  
  974.   public boolean super_onMenuOpened(int paramInt, Menu paramMenu)
  975.   {
  976.     return super.onMenuOpened(paramInt, paramMenu);
  977.   }
  978.  
  979.   public void super_onNewIntent(Intent paramIntent)
  980.   {
  981.     super.onNewIntent(paramIntent);
  982.   }
  983.  
  984.   public boolean super_onOptionsItemSelected(MenuItem paramMenuItem)
  985.   {
  986.     return super.onOptionsItemSelected(paramMenuItem);
  987.   }
  988.  
  989.   public void super_onOptionsMenuClosed(Menu paramMenu)
  990.   {
  991.     super.onOptionsMenuClosed(paramMenu);
  992.   }
  993.  
  994.   public void super_onPanelClosed(int paramInt, Menu paramMenu)
  995.   {
  996.     super.onPanelClosed(paramInt, paramMenu);
  997.   }
  998.  
  999.   public void super_onPrepareDialog(int paramInt, Dialog paramDialog)
  1000.   {
  1001.     super.onPrepareDialog(paramInt, paramDialog);
  1002.   }
  1003.  
  1004.   public boolean super_onPrepareOptionsMenu(Menu paramMenu)
  1005.   {
  1006.     return super.onPrepareOptionsMenu(paramMenu);
  1007.   }
  1008.  
  1009.   public boolean super_onPreparePanel(int paramInt, View paramView, Menu paramMenu)
  1010.   {
  1011.     return super.onPreparePanel(paramInt, paramView, paramMenu);
  1012.   }
  1013.  
  1014.   public void super_onRestoreInstanceState(Bundle paramBundle)
  1015.   {
  1016.     super.onRestoreInstanceState(paramBundle);
  1017.   }
  1018.  
  1019.   public Object super_onRetainNonConfigurationInstance()
  1020.   {
  1021.     return super.onRetainNonConfigurationInstance();
  1022.   }
  1023.  
  1024.   public void super_onSaveInstanceState(Bundle paramBundle)
  1025.   {
  1026.     super.onSaveInstanceState(paramBundle);
  1027.   }
  1028.  
  1029.   public boolean super_onSearchRequested()
  1030.   {
  1031.     return super.onSearchRequested();
  1032.   }
  1033.  
  1034.   public void super_onTitleChanged(CharSequence paramCharSequence, int paramInt)
  1035.   {
  1036.     super.onTitleChanged(paramCharSequence, paramInt);
  1037.   }
  1038.  
  1039.   public boolean super_onTouchEvent(MotionEvent paramMotionEvent)
  1040.   {
  1041.     return super.onTouchEvent(paramMotionEvent);
  1042.   }
  1043.  
  1044.   public boolean super_onTrackballEvent(MotionEvent paramMotionEvent)
  1045.   {
  1046.     return super.onTrackballEvent(paramMotionEvent);
  1047.   }
  1048.  
  1049.   public void super_onUserInteraction()
  1050.   {
  1051.     super.onUserInteraction();
  1052.   }
  1053.  
  1054.   public void super_onUserLeaveHint()
  1055.   {
  1056.     super.onUserLeaveHint();
  1057.   }
  1058.  
  1059.   public void super_onWindowAttributesChanged(WindowManager.LayoutParams paramLayoutParams)
  1060.   {
  1061.     super.onWindowAttributesChanged(paramLayoutParams);
  1062.   }
  1063.  
  1064.   public void super_onWindowFocusChanged(boolean paramBoolean)
  1065.   {
  1066.     super.onWindowFocusChanged(paramBoolean);
  1067.   }
  1068. }
Advertisement
Add Comment
Please, Sign In to add comment