1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00

Changes to Image::BitmapData constructors, replacing the bool with a more explicit enum for the read/write mode. Some win32 dLL declarator changes. Android work. Small Quicktime fix.

This commit is contained in:
Julian Storer 2011-02-09 10:50:19 +00:00
parent 1d215fa865
commit 3dfbb0d713
37 changed files with 1216 additions and 431 deletions

View file

@ -31,10 +31,16 @@ import android.graphics.*;
//==============================================================================
public class ComponentPeerView extends View
implements View.OnFocusChangeListener
{
public ComponentPeerView (Context context)
public ComponentPeerView (Context context, boolean opaque_)
{
super (context);
opaque = opaque_;
setFocusable (true);
setFocusableInTouchMode (true);
setOnFocusChangeListener (this);
requestFocus();
}
//==============================================================================
@ -46,6 +52,14 @@ public class ComponentPeerView extends View
handlePaint (canvas);
}
@Override
public boolean isOpaque()
{
return opaque;
}
private boolean opaque;
//==============================================================================
private native void handleMouseDown (float x, float y, long time);
private native void handleMouseDrag (float x, float y, long time);
@ -70,6 +84,7 @@ public class ComponentPeerView extends View
@Override
protected void onSizeChanged (int w, int h, int oldw, int oldh)
{
viewSizeChanged();
}
@Override
@ -77,16 +92,33 @@ public class ComponentPeerView extends View
{
}
private native void viewSizeChanged();
@Override
public void onFocusChange (View v, boolean hasFocus)
{
if (v == this)
focusChanged (hasFocus);
}
private native void focusChanged (boolean hasFocus);
public void setViewName (String newName)
{
}
public boolean isVisible()
{
return true;
return getVisibility() == VISIBLE;
}
public void setVisible (boolean b)
{
setVisibility (b ? VISIBLE : INVISIBLE);
}
public boolean containsPoint (int x, int y)
{
return true; //xxx needs to check overlapping views
}
}

View file

@ -27,11 +27,16 @@ package com.juce;
import android.app.Activity;
import android.os.Bundle;
import android.content.*;
import android.view.*;
import android.content.Context;
import android.view.ViewGroup;
import android.view.Display;
import android.view.WindowManager;
import android.graphics.Paint;
import android.graphics.Path;
import android.text.ClipboardManager;
import com.juce.ComponentPeerView;
//==============================================================================
public class JuceAppActivity extends Activity
{
@ -106,9 +111,9 @@ public class JuceAppActivity extends Activity
//==============================================================================
private ViewHolder viewHolder;
public ComponentPeerView createNewView()
public ComponentPeerView createNewView (boolean opaque)
{
ComponentPeerView v = new ComponentPeerView (this);
ComponentPeerView v = new ComponentPeerView (this, opaque);
viewHolder.addView (v);
return v;
}
@ -123,6 +128,8 @@ public class JuceAppActivity extends Activity
public ViewHolder (Context context)
{
super (context);
setDescendantFocusability (ViewGroup.FOCUS_AFTER_DESCENDANTS);
setFocusable (false);
}
protected void onLayout (boolean changed, int left, int top, int right, int bottom)
@ -130,6 +137,11 @@ public class JuceAppActivity extends Activity
}
}
public void excludeClipRegion (android.graphics.Canvas canvas, float left, float top, float right, float bottom)
{
canvas.clipRect (left, top, right, bottom, android.graphics.Region.Op.DIFFERENCE);
}
//==============================================================================
public String getClipboardContent()
{
@ -142,4 +154,97 @@ public class JuceAppActivity extends Activity
ClipboardManager clipboard = (ClipboardManager) getSystemService (CLIPBOARD_SERVICE);
clipboard.setText (newText);
}
//==============================================================================
/*class PathGrabber extends Path
{
public PathGrabber()
{
pathString = new StringBuilder();
}
@Override
public void addPath (Path src)
{
}
@Override
public void addPath (Path src, float dx, float dy)
{
}
@Override
public void close()
{
pathString.append ('c');
}
@Override
public void moveTo (float x, float y)
{
pathString.append ('m');
pathString.append (String.valueOf (x));
pathString.append (String.valueOf (y));
}
@Override
public void lineTo (float x, float y)
{
pathString.append ('l');
pathString.append (String.valueOf (x));
pathString.append (String.valueOf (y));
}
@Override
public void quadTo (float x1, float y1, float x2, float y2)
{
pathString.append ('q');
pathString.append (String.valueOf (x1));
pathString.append (String.valueOf (y1));
pathString.append (String.valueOf (x2));
pathString.append (String.valueOf (y2));
}
@Override
public void cubicTo (float x1, float y1, float x2, float y2, float x3, float y3)
{
pathString.append ('b');
pathString.append (String.valueOf (x1));
pathString.append (String.valueOf (y1));
pathString.append (String.valueOf (x2));
pathString.append (String.valueOf (y2));
pathString.append (String.valueOf (x3));
pathString.append (String.valueOf (y3));
}
@Override
public void reset()
{
rewind();
}
@Override
public void rewind()
{
pathString.setLength (0);
}
public String getJucePath()
{
if (getFillType() == FillType.EVEN_ODD)
return "z" + pathString.toString();
else
return "n" + pathString.toString();
}
private StringBuilder pathString;
}*/
public String createPathForGlyph (Paint paint, char c)
{
/*PathGrabber pg = new PathGrabber();
paint.getTextPath (String.valueOf (c), 0, 1, 0, 0, pg);
return pg.getJucePath();*/
return "";
}
}