Kaydet (Commit) eb37322f authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Temporary (one hopes) hack to get the actual view size down to SvpSalFrame

Change-Id: I0c2a2301de1b0de71fc6724ff2af73fbf6b406ef
üst 320571bf
......@@ -132,6 +132,7 @@ public class Desktop
/* implementend by vcl */
public static native void renderVCL(Bitmap bitmap);
public static native void setViewSize(int width, int height);
/**
* This class contains the state that is initialized once and never changes
......@@ -278,15 +279,15 @@ public class Desktop
if (bootstrapContext == null)
initBootstrapContext();
Log.i(TAG, "onCreate - set content view\n");
setContentView(new BitmapView());
spawnMain();
}
catch (Exception e) {
e.printStackTrace(System.err);
finish();
}
Log.i(TAG, "onCreate - set content view\n");
setContentView(new BitmapView());
}
class BitmapView extends android.view.View
......@@ -305,6 +306,7 @@ public class Desktop
if (mBitmap == null) {
Log.i(TAG, "calling Bitmap.createBitmap(" + getWidth() + ", " + getHeight() + ", Bitmap.Config.ARGB_8888)");
mBitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
setViewSize(getWidth(), getHeight());
}
renderVCL(mBitmap);
canvas.drawBitmap(mBitmap, 0, 0, null);
......
......@@ -43,6 +43,9 @@
static bool bHitIdle = false;
// Horrible hack
static int viewWidth = 1, viewHeight = 1;
class AndroidSalData : public SalGenericData
{
public:
......@@ -735,6 +738,8 @@ public:
pSysParent )
{
enableDamageTracker();
if (pParent == NULL && viewWidth > 1 && viewHeight > 1)
SetPosSize(0, 0, viewWidth, viewHeight, SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT);
}
virtual void GetWorkArea( Rectangle& rRect )
......@@ -962,4 +967,15 @@ typedef struct ANativeWindow_Buffer {
AndroidBitmap_unlockPixels(env, bitmap);
}
extern "C" SAL_JNI_EXPORT void JNICALL
Java_org_libreoffice_experimental_desktop_Desktop_setViewSize(JNIEnv * /* env */,
jobject /* object */,
jint width,
jint height)
{
// Horrible
viewWidth = width;
viewHeight = height;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment