[clutter] Help for MX using clutter

2010-04-21 Thread Rakesh Kumar
Hi List,

  I have just downloaded current version of MX GUI tool KIT and I don't 
know
  How to compile it on linux. Please help me on this issue. I have 
searched in clutter
  Archive mail but I didn't get any info .I am a newbie for clutter 
using MX.

Regards,
RK.



Re: [clutter] Help for MX using clutter

2010-04-21 Thread Ashish Kumar
Hi Rakesh,

I have compiled mx using clutter.
After git clone git://git.moblin.org/mx
do
./autogen

( May be u have to also build clutter-gesture, clutter-imcontext,
startup-notification, dbus-glib)
Or you may give --without-clutter-gesture option etc etc


Regards,
Ashish

On Wed, Apr 21, 2010 at 6:17 PM, Rakesh Kumar
rakesh.ku...@kpitcummins.comwrote:

  Hi List,



   I have just downloaded current version of MX GUI tool KIT and I
 don’t know

   How to compile it on linux. Please help me on this issue. I have
 searched in clutter

   Archive mail but I didn’t get any info .I am a newbie for clutter
 using MX.



 Regards,

 RK.





Re: [clutter] Help for MX using clutter

2010-04-21 Thread Ashish Kumar
Rakesh,

To run mx tests I can give you steps what all I have done
After git clone mx.
r...@ubuntu:/media/moblin/# cd mx
r...@ubuntu:/media/moblin/mx/# ./autogen.sh --without-dbus
--without-clutter-gesture --without-startup-notification
r...@ubuntu:/media/moblin/mx/# make
r...@ubuntu:/media/moblin/mx/# ./tests/test-mx

I hope above setup gives you an example how to build mx.
Rest you can always mail back if you face any issues.
For mx API documentation look
http://moblin.org/sites/all/files/moblin2.1api/html/mx4/index.html


On Wed, Apr 21, 2010 at 9:08 AM, Rakesh Kumar
rakesh.ku...@kpitcummins.comwrote:

  Thanks for your quick reply.

 I am very new to clutter can you

 Elaborate more on that. I wanted to run all the sample in the

 Test folder of MX.


  --

 *From:* Ashish Kumar [mailto:ashish8...@gmail.com]
 *Sent:* Wednesday, April 21, 2010 6:34 PM
 *To:* Rakesh Kumar
 *Cc:* clutter@o-hand.com
 *Subject:* Re: [clutter] Help for MX using clutter



 Hi Rakesh,

 I have compiled mx using clutter.
 After git clone git://git.moblin.org/mx
 do
 ./autogen

 ( May be u have to also build clutter-gesture, clutter-imcontext,
 startup-notification, dbus-glib)
 Or you may give --without-clutter-gesture option etc etc


 Regards,
 Ashish

 On Wed, Apr 21, 2010 at 6:17 PM, Rakesh Kumar 
 rakesh.ku...@kpitcummins.com wrote:

 Hi List,



   I have just downloaded current version of MX GUI tool KIT and I
 don’t know

   How to compile it on linux. Please help me on this issue. I have
 searched in clutter

   Archive mail but I didn’t get any info .I am a newbie for clutter
 using MX.



 Regards,

 RK.







[clutter] switched colour channels

2010-04-21 Thread Phil
Hello,

I have compiled Clutter 1.2.5 with the eglnative/gles backend. The colour
channels of textures seem to be switched when the format is not RGBA.
I have noticed the following:
* if the texture is loaded from a file (e.g. PNG) it works fine (gdk-pixbuf
is
  used). gdk-pixbuf uses RGBA as internal format. Thus, I think it works in
  contrast to the other cases below.
* If I load data from memory using clutter_texture_set_from_rgb_data () the
  issue with the switched red and blue colour channel appears. The flag
  CLUTTER_TEXTURE_RGB_FLAG_BGR does not seem to have an effect.
* If the texture is a cairo texture (cairo uses ARGB internally) the same
  problem is present.

You may also compare an open bug report, where a code example is provided:
http://bugzilla.openedhand.com/show_bug.cgi?id=2059

I had a look at the source code and I assume that at some point the
_cogl_bitmap_fallback_convert () function should be invoked, because OpenGL
ES
does only accept the GL_RGBA format type (and does not provide convertion
facilities). However, the function is not called.
I am wondering if other people experience similar problems like me and the
person who opened the bug report?

Furthermore, can anybody tell me where the convertion should be triggered
ideally? As far as I have seen, the _cogl_texture_prepare_for_upload ()
seems to
be the right place. There also, the GL pixel format conversion is invoked,
which
in turn is performed by the gles specific function. However, I am wondering
why
no conversion is triggered there when the CoglPixelFormat does not match the
GL
internal format (since the OpenGL ES does not provide the necessary
conversion)?

I would be glad for any help!
Phil


[clutter] Clutter gradient and text

2010-04-21 Thread Sam Wilson
Hello, I hate to bother you all with trivial stuff like this, but I am
having some serious trouble finding the error in my program.

Essentially, I want to render a shape with a gradient background and a
text label, so I created an actor that has a single Text actor as a
child.

The gradient is rendered using a method similar to
http://lists.o-hand.com/clutter/1787.html written in vala and adapted to
handle angles.  (Any improvements to this function would also be welcome
C: )

A screenshot of the incorrect behaviour is located at
http://sellyourvote.ca/Screenshot-test.png

I know it has something to do with the Text actor, since both rectangles
render properly if the text is turned off in both of them.

Thanks,
Sam



// test.vala - Problem clutter file
// Should render two rounded rectangles with gradients,
// the left one without text, and the right one with text

// On my machine left box only has border, but right box
// is correct.

// Compile with valac --pkg=clutter-1.0 test.vala

using Clutter;
using Cogl;

struct Point
{
float x;
float y;

}

public class TestActor : Actor
{
Text t = new Text.with_text(null, Test);
bool _text;

construct
{
t.set_parent(this);
t.set_size(40, 40);
t.set_position(10, 10);
}

public TestActor(bool draw_text)
{
_text = draw_text;
}

private inline static void rotate_point(ref Point p,
float angle)
{
float oldx = p.x, oldy = p.y;
p.x = oldx*Math.cosf(angle) - oldy*Math.sinf(angle);
p.y = oldy*Math.cosf(angle) + oldx*Math.sinf(angle);
}

private static void draw_gradient(float width,
  float height,
  Cogl.Color c1,
  Cogl.Color c2,
  float angle)
{
if (angle = Math.PI)
{
Cogl.Color temp = c1;
c1 = c2;
c2 = temp;
}

float sin_a = Math.sinf(angle);
float cos_a = Math.cosf(angle);

float A = sin_a*width;
float B = cos_a*width;

float C = sin_a*height;
float D = cos_a*height;

float s1 = A+D;
float s2 = B+C;

float x0 = -s2/2f, x1 = x0 + s2;
float y0 = -s1/2f, y1 = y0 + s1;

Point p[4];

p[0] = {x0, y0};
p[1] = {x0, y1};
p[2] = {x1, y1};
p[3] = {x1, y0};

for (int i = 0; i  p.length; i++)
{
rotate_point(ref p[i], angle);
p[i].x += width/2f;
p[i].y += height/2f;
}

TextureVertex v[4];

v[0] = {p[0].x, p[0].y, 0, 0, 0, c1};
v[1] = {p[1].x, p[1].y, 0, 0, 0, c1};
v[2] = {p[2].x, p[2].y, 0, 0, 0, c2};
v[3] = {p[3].x, p[3].y, 0, 0, 0, c2}; 

Cogl.polygon(v, true);
}

protected override void paint()
{
Geometry geom;
get_allocation_geometry(out geom);

Cogl.Color pri = {0, 255, 0, 255};
Cogl.Color sec = {0, 0, 255, 255};

Cogl.path_round_rectangle(0,
  0,
  geom.width,
  geom.height,
  5,
  (float)Math.PI_4/4f);

Cogl.clip_push_from_path();

draw_gradient(geom.width, geom.height,
  pri,
  sec,
  (float)Math.PI/4);

Cogl.clip_pop();

Cogl.path_round_rectangle(0,
  0,
  geom.width,
  geom.height,
  5,
  (float)Math.PI_4/4f);
  
Cogl.set_source_color({128, 128, 128, 255});
Cogl.path_stroke();

if (_text)
t.paint();
}

protected override void