Javascript documentation

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon

Javascript documentation

Postby gfreeau on Mon Feb 20, 2012 5:16 pm

Is there any javascript documentation for clutter etc that cinnamon applets and themes use?
Image
gfreeau
Level 1
Level 1
 
Posts: 32
Joined: Wed Nov 30, 2011 5:49 pm

Linux Mint is funded by ads and donations.
 

Re: Javascript documentation

Postby xenopeek on Mon Feb 20, 2012 5:36 pm

There are examples and information here http://cinnamon.linuxmint.com/?cat=1, but you probably found those all already. I'm not sure I fully understand the Cinnamon (Shell fork), Muffin (Mutter fork) and Clutter interaction (Cinnamon is a plugin on Muffin, and that uses Clutter?), but I think Cinnamon uses Clutter unmodified so you can probably refer to the Gnome documentation on that, see links here: https://en.wikipedia.org/wiki/Clutter_%28toolkit%29 I don't know about Muffin/Mutter.

I hope somebody has a better answer :wink:
Image
Linux Mint 14 Nadia / 64-bit / Cinnamon
User avatar
xenopeek
Level 20
Level 20
 
Posts: 10523
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Javascript documentation

Postby gfreeau on Mon Feb 20, 2012 5:51 pm

I'm in the same place as you right now. I've been able to learn a lot by looking at all the javascript in /usr/share/cinnamon/js. However some kind of guide or visualization of how this all works together would be really helpful for me. I know cinnamon is a new project and still developing, but I feel like if there was more documentation like this, improvements and more applets would come to cinnamon from more 3rd party developers. Why the gnome team didn't make good documentation initially is beyond me.

I looked at clutter-project.org and the examples seem to be in C.

I would just like the core parts summarized, for example what exactly are Actors (I believe in cinnamon they are containers for drawing), I wasn't able to find where Cinnamon.GenericContainer was defined either. I assume it's because it's just inherited.
Image
gfreeau
Level 1
Level 1
 
Posts: 32
Joined: Wed Nov 30, 2011 5:49 pm

Re: Javascript documentation

Postby gfreeau on Mon Feb 20, 2012 8:16 pm

Just a quick update on what I've learned today.

There is a project called gjs or seed that allows you to call C library API's in other languages, in this case javascript. Looks like gnome 3 / cinnamon uses gjs.

So for example on line 179 of /usr/share/cinnamon/js/ui/windowManager.js we have

Code: Select all
actor.move_anchor_point_from_gravity(Clutter.Gravity.CENTER);


and here is the C documention on that: http://developer.gnome.org/clutter/1.8/ ... om-gravity

So GjS enchances javascript to allow it's use outside of a browser language.

Other sources: (these seem a bit dated)
http://townx.org/blog/elliot/introducti ... nd-clutter
http://wiki.clutter-project.org/wiki/Ja ... ter_and_Mx

Just posting this here if other people ever have the same question.

I think this is the general breakdown:

Muffin - Window Manager - fork of Mutter
Cinnamon - Plugin for Muffin?
Cairo - 2D Drawing Library
Clutter - Creating GUI Elements (most applet development deals with clutter?)

Anyone want to pitch in the confirm/change this?
Image
gfreeau
Level 1
Level 1
 
Posts: 32
Joined: Wed Nov 30, 2011 5:49 pm

Re: Javascript documentation

Postby xenopeek on Thu Feb 23, 2012 8:45 am

Hi Greg, I've noticed a lot of applet, extension and theme developers hang out with the Cinnamon developers in the #linuxmint-dev. You should go over there and chat a little to get some better info (but don't keep Clem from his work :wink:).

To connect, in the Mint Menu, in the Internet section, start the application XChat IRC. You will automatically get connected to #linuxmint-chat for general chat and #linuxmint-help for support with other Linux Mint users. In either, type:
Code: Select all
/join #linuxmint-dev

This should open that channel. Please share any new insight back here!
Image
Linux Mint 14 Nadia / 64-bit / Cinnamon
User avatar
xenopeek
Level 20
Level 20
 
Posts: 10523
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Javascript documentation

Postby RHTopics on Thu Feb 23, 2012 3:03 pm

This is an interesting topic and would also like to know how all the pieces to Cinnamon fit together.

One thing I wonder about, how dependent is Cinnamon on the underlying Gnome 3.x library routines? Will the APIs or interfaces that Cinnamon uses be broken in the future due to changes to the Gnome 3.x libraries?
RHTopics
Level 1
Level 1
 
Posts: 34
Joined: Fri Sep 10, 2010 2:32 pm

Re: Javascript documentation

Postby dalcde on Mon Mar 05, 2012 6:43 am

dalcde
Level 4
Level 4
 
Posts: 211
Joined: Fri May 13, 2011 8:15 am

Re: Javascript documentation

Postby gfreeau on Sat Mar 10, 2012 12:58 am

Thanks for this dalcde.
Image
gfreeau
Level 1
Level 1
 
Posts: 32
Joined: Wed Nov 30, 2011 5:49 pm

Re: Javascript documentation

Postby fcole90 on Sun Apr 14, 2013 12:35 pm

I think that this gives an idea of the relations, even if it's designed for Gnome Shell:
http://blog.fpmurphy.com/2011/05/more-gnome-shell-customization.html
User avatar
fcole90
Level 1
Level 1
 
Posts: 9
Joined: Thu Jun 23, 2011 10:42 am
Location: Italy

Linux Mint is funded by ads and donations.
 

Return to Cinnamon

Who is online

Users browsing this forum: No registered users and 7 guests