Results 1 to 2 of 2

Thread: eyecandy-filled crossplatform Mobile toolkit in C++

  1. #1
    licensed to kill - FKA kev000
    Auto Apps:loading...
    tripzero's Avatar
    Join Date
    Aug 2006
    Location
    16.40618, 120.61106
    Posts
    2,560

    eyecandy-filled crossplatform Mobile toolkit in C++

    While I'm working on the nghost3 toolkit, I'm wondering if it'd be useful for windows developers as well as us Linux guys. Clutter and Qt are crossplatform, so in theory, it will run on Macs, Linux, and Windows.

    If anyone is interested in using it, feel free (under the LGPL). Here is a simple example of an application:

    Code:
    int main(int argc, char** argv)
    {
    	NClutterStage *stage = new NClutterStage();
    	
    	stage->init(&argc, &argv);
    	
    	stage->setSize(640,480);
    	
    	NClutterTexture * texture = new NClutterTexture(stage);
    	
    	if(!texture->loadFromRectangle(205,205,205,128)) ///r,g,b,a
    		cout<<"failed to create texture from regct"<<endl;
    	
    	texture->setSize(40,40);
    	
    	texture->move(0,0);
    		
    	stage->add(texture);
    	
    	stage->showAll();
    	
    	texture->smoothMove(3000,1,600,400);
    	texture->animate(1,3000,Effect::SpinY360);
    	texture->animate(1,3000,Effect::FadeToTwentyPercent);
    	//texture->animate(1,1000,Effect::FadeBack);
    	stage->main();
    }
    That will move a spinning, fading, growing rectangle across the screen. It follows both Gtk and Qt's object design which allows you to inherit from base class and do you own widget magic:

    Code:
    class MyWidget: NClutterContainer
    {
    	public:
    		MyWidget() 
    		{
    			Button mybutton("filename");
    			mybutton.showAll();
    			this.add(mybutton);
    			///do more stuff
    		}
    };
    
    int main(...)
    {
    	...
    	MyWidget *myWidget =  new MyWidget();
    	NMain->stage()->add(myWidget);
    	NMain->stage()->showAll();
    	
    	return NMain->stage()->run();
    }
    Here's a visual example of what you can do:

    http://www.youtube.com/v/BvAyKoRyeh4

    I figure the more people that use it, the more robust and useful it will become.

    You can check out the code here: https://nghost.svn.sourceforge.net/svnroot/nghost/ng3

    It doesn't compile for windows right now, but if there is enough interest, why not? It makes more sense to concentrate on a really great mobile toolkit rather than each app create its own...

    Comments? Questions?
    Former author of LinuxICE, nghost, nobdy.
    Current author of Automotive Message Broker (AMB).
    Works on Tizen IVI. Does not represent anyone or anything but himself.

  2. #2
    North of the land of Hey Huns
    Auto Apps:loading...

    Join Date
    Jun 2004
    Location
    Westminster, MD
    Posts
    2,144
    I do plan on writing a WindowManager replacement plugin for CarPal that uses this eventually Kudos for this!
    "stop with the REINSTALLS, what do you think we got some lame-o installer!!!" - mitchjs
    RevFE
    My Shop

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •