diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-02-26 20:24:22 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-02-26 23:48:54 +0200 |
commit | dacaa0af5069abc474718eb5f1769898f79be782 (patch) | |
tree | 65cd75f486c4d1c3675959ee644c58bc5fb4e23c /android/experimental | |
parent | 75a2bdea021649a98b3dd009a7bc316bcf173d73 (diff) |
Remove copy-pasted imports and comments
Change-Id: I47e61b4ae7d95797f4d17031e9613bb549eb4813
Diffstat (limited to 'android/experimental')
-rw-r--r-- | android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java | 163 |
1 files changed, 1 insertions, 162 deletions
diff --git a/android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java b/android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java index cb9ce7c138eb..c47aaea346bd 100644 --- a/android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java +++ b/android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java @@ -9,122 +9,28 @@ // This is just a testbed for ideas and implementations. (Still, it might turn // out to be somewhat useful as such while waiting for "real" apps.) -// ================ NOTE ================ -// Note that these comments are copy-pasted from another test app, -// DocumentLoader, and might or might not be much relevant for this -// source file and how it will evolve. - -// Important points: - -// Everything that might take a long time should be done asynchronously: -// - loading the document (loadComponentFromURL()) -// - counting number of pages (getRendererCount()) -// - rendering a page (render()) - -// Unclear whether pages can be rendered in parallel. Probably best to -// serialize all the above in the same worker thread. We use -// AsyncTask.SERIAL_EXECUTOR below. - -// While a page is loading ideally should display some animated spinner (but -// for now just a static "please wait" text). - -// === - -// How should we handle re-rendering at higher resolution when zooming in, and -// then panning around? - -// Hopefully when LO is asked to render just a part of a page (i.e. the -// MapMode of the device rendered to causes significant parts of the page to -// be outside the device) the code is clever enough to quickly skip stuff that -// will be clipped. But I don't hold my breath. - -// How could we do it? - -// 1/ Re-render just the zoomed-in area. Probably not a good idea, as probably -// the user will almost immediately also pan a bit or zoom out a bit, which -// would cause a re-render. - -// 2/ Some kind of tiled approach. Initially just one tile for the whole -// page. When zooming in, at some point (2x?) split the currently visible -// tiles into four sub-tiles, each initially displaying the same resolution as -// the parent tile. Start asynchronous rendering of visible sub-tiles at -// double resolution. Keep the "parent" rendered bitmap but don't keep bitmaps -// that go out of view. (Except perhaps for some caching.) When zooming out, -// at some point (0.5x?) merge four sub-tiles back into one. Hmm. Is this the -// right approach? - -// In any case, also this rendering at higher resolution should be done -// asynchronously, of course. If the user zooms in and pans around, the -// existing bitmap will be shown scaled (and ugly) until required rendering -// has finished and then the affected tiles are replaced with -// higher-resolution ones. - package org.libreoffice.experimental.desktop; import android.app.Activity; -import android.app.AlertDialog; import android.content.Context; -import android.content.DialogInterface; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; -import android.graphics.ColorFilter; -import android.graphics.Matrix; -import android.graphics.PixelFormat; import android.graphics.Paint; import android.graphics.Point; import android.graphics.Rect; -import android.graphics.drawable.BitmapDrawable; -import android.graphics.drawable.ColorDrawable; -import android.graphics.drawable.Drawable; -import android.os.AsyncTask; import android.os.Bundle; import android.text.InputType; import android.util.Log; -import android.view.GestureDetector; -import android.view.Gravity; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; -import android.view.ViewGroup; -import android.view.animation.Animation; -import android.view.animation.AnimationSet; -import android.view.animation.TranslateAnimation; import android.view.inputmethod.BaseInputConnection; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputMethodManager; -import android.widget.ImageView; -import android.widget.NumberPicker; -import android.widget.TextView; -import android.widget.ViewFlipper; -import android.widget.ViewSwitcher; - -import junit.framework.Assert; - -import com.sun.star.awt.Size; -import com.sun.star.awt.XBitmap; -import com.sun.star.awt.XControl; -import com.sun.star.awt.XDevice; -import com.sun.star.awt.XToolkitExperimental; -import com.sun.star.beans.PropertyValue; -import com.sun.star.frame.XComponentLoader; -import com.sun.star.frame.XController; -import com.sun.star.frame.XFrame; -import com.sun.star.frame.XModel; -import com.sun.star.lang.XEventListener; + import com.sun.star.lang.XMultiComponentFactory; -import com.sun.star.lang.XTypeProvider; -import com.sun.star.uno.Type; -import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; -import com.sun.star.view.XRenderable; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.ArrayList; import org.libreoffice.android.Bootstrap; @@ -149,78 +55,11 @@ public class Desktop public long timingOverhead; public XComponentContext componentContext; public XMultiComponentFactory mcf; - public XComponentLoader componentLoader; - public XToolkitExperimental toolkit; - public XDevice dummySmallDevice; } BootstrapContext bootstrapContext; Bundle extras; - class MyXController - implements XController - { - XFrame frame; - XModel model; - - public void attachFrame(XFrame frame) - { - Log.i(TAG, "attachFrame"); - this.frame = frame; - } - - public boolean attachModel(XModel model) - { - Log.i(TAG, "attachModel"); - this.model = model; - return true; - } - - public boolean suspend(boolean doSuspend) - { - Log.i(TAG, "suspend"); - return false; - } - - public Object getViewData() - { - Log.i(TAG, "getViewData"); - return null; - } - - public void restoreViewData(Object data) - { - Log.i(TAG, "restoreViewData"); - } - - public XModel getModel() - { - Log.i(TAG, "getModel"); - return model; - } - - public XFrame getFrame() - { - Log.i(TAG, "getFrame"); - return frame; - } - - public void dispose() - { - Log.i(TAG, "dispose"); - } - - public void addEventListener(XEventListener listener) - { - Log.i(TAG, "addEventListener"); - } - - public void removeEventListener(XEventListener listener) - { - Log.i(TAG, "removeEventListener"); - } - } - // FIXME: we should prolly manage a bitmap buffer here and give it to // VCL to render into ... and pull the WM/stacking pieces up into the Java ... // [ perhaps ;-] |