Changes

Line 58: Line 58:  
For Sugar:
 
For Sugar:
 
# As the PyGI is introduced PyGTK is no longer maintained and hence it is outdated now, so shifting toward PyGI means shifting towards new technology.
 
# As the PyGI is introduced PyGTK is no longer maintained and hence it is outdated now, so shifting toward PyGI means shifting towards new technology.
# PyGI is better than PYGTK and less maintenance is needed as compared to
+
# PyGI is better than PYGTK and less maintenance is needed as compared to PyGTK.
PyGTK.
   
# Major activities are divided between the recent distributions of GTK, After Migration of all the files of these activities to GTK3/PyGI, every activity will be running on its latest version with fully updated features.
 
# Major activities are divided between the recent distributions of GTK, After Migration of all the files of these activities to GTK3/PyGI, every activity will be running on its latest version with fully updated features.
 
# Move toward GTK3 will guarantee faster processing and lower memory usage.
 
# Move toward GTK3 will guarantee faster processing and lower memory usage.
Line 73: Line 72:  
activities from Gtk2 to Gtk3. Although there are many more changes which will be
 
activities from Gtk2 to Gtk3. Although there are many more changes which will be
 
implemented but these are the major ones.
 
implemented but these are the major ones.
* HippoCanvas removal​ - As HippoCanvas library is no longer maintained, the
+
* HippoCanvas removal​ - As HippoCanvas library is no longer maintained, the first thing to be done before porting to GTK3 is to remove from all the activities the use of HippoCanvas library. It would be very difficult to port to GTK3 with HippoCanvas. And HippoCanvas users can easily switch to custom GTK container widgets. There are many activities like chat that uses HippoCanvas so it must be removed from these activities.
first thing to be done before porting to GTK3 is to remove from all the
+
* Adopting the API changes in sugar-toolkit-gtk3 ​- The old API is removed in sugar-toolkit-gtk3. So the activities will be adjusted accordingly, for example the keep button and the old style toolbar has been removed completely, so the activities should not use these.
activities the use of HippoCanvas library. It would be very difficult to port to
+
* Porting the activity from GTK2 to GTK3 ​- Starting from changing the import statement, every call using GTK2 will be changed. All the calls for accessing services and widgets in the sugar-toolkit-gtk3 will be changed. For example: “from sugar.activity import activity” will be changed to “From sugar3.activity import activity”. Setup.py will also point to the new sugar-toolkit-gtk3.
GTK3 with HippoCanvas. And HippoCanvas users can easily switch to custom
+
* Constructor considerations ​- Now it is possible with PyGI to use python-like constructors. And now names must be given to the constructors if they takes parameters. Eg : button = Gtk.button(label=”foo”).
GTK container widgets. There are many activities like chat that uses
+
* Using GtkBox directly than using Vbox and Hbox ​- Hbox and Vbox have been deprecated in GTK3 instead of this, GtkBox should be used directly, as Hbox and Vbox may get removed in GTK4.
HippoCanvas so it must be removed from these activities.
+
* GTK Alignment considerations ​- although the alignment constructor in GTK3 takes optional parameters only, x,y; align,scale, but the default values of the parameters are changed in GTK3, so according to the changed values of the parameters the codes of different activities will be changed.
* Adopting the API changes in sugar-toolkit-gtk3 ​- The old API is removed
+
* Using cairo for drawing ​- In GTK3 Gtk drawable objects are not supported, the GDK drawing API has been removed so all the drawing are done with the help of cairo. So the idea is to run the activity under cairo. It also includes changes when pango is used with cairo, changes when drawing a bitmap and when reading pixel from xlib.
in sugar-toolkit-gtk3. So the activities will be adjusted accordingly, for
  −
example the keep button and the old style toolbar has been removed
  −
completely, so the activities should not use these.
  −
* Porting the activity from GTK2 to GTK3 ​- Starting from changing the
  −
import statement, every call using GTK2 will be changed. All the calls for
  −
accessing services and widgets in the sugar-toolkit-gtk3 will be changed. For example: “from sugar.activity import activity” will be changed to
  −
“From sugar3.activity import activity”. Setup.py will also point to the new sugar-toolkit-gtk3.
  −
* Constructor considerations ​- Now it is possible with PyGI to use
  −
python-like constructors. And now names must be given to the constructors if
  −
they takes parameters. Eg : button = Gtk.button(label=”foo”).
  −
* Using GtkBox directly than using Vbox and Hbox ​- Hbox and Vbox have
  −
been deprecated in GTK3 instead of this, GtkBox should be used directly, as
  −
Hbox and Vbox may get removed in GTK4.
  −
* GTK Alignment considerations ​- although the alignment constructor in
  −
GTK3 takes optional parameters only, x,y; align,scale, but the default values
  −
of the parameters are changed in GTK3, so according to the changed values
  −
of the parameters the codes of different activities will be changed.
  −
* Using cairo for drawing ​- In GTK3 Gtk drawable objects are not supported,
  −
the GDK drawing API has been removed so all the drawing are done with the
  −
help of cairo. So the idea is to run the activity under cairo. It also includes
  −
changes when pango is used with cairo, changes when drawing a bitmap and
  −
when reading pixel from xlib.
   
* Gtk Widget::draw signal ​- A new draw signal has replaced GtkWidget
 
* Gtk Widget::draw signal ​- A new draw signal has replaced GtkWidget
 
expose-event signal, and now the Widget will draw itself using its allocated
 
expose-event signal, and now the Widget will draw itself using its allocated
 
size. And all the GtkStyle drawing functions are now changed which will take
 
size. And all the GtkStyle drawing functions are now changed which will take
 
a cairo_t instead of a window, and many more. So these changes will all be implemented in the activities proposed.
 
a cairo_t instead of a window, and many more. So these changes will all be implemented in the activities proposed.
* Gtk ProgressBar orientation​ - in Gtk3 both the cell renderer and the
+
* Gtk ProgressBar orientation​ - in Gtk3 both the cell renderer and the widget will implement the GtkOrientable with additional features. There will be a minute change in the set orientation call. Instead of one call there will be two calls now.
widget will implement the GtkOrientable with additional features. There will
  −
be a minute change in the set orientation call. Instead of one call there will be
  −
two calls now.
   
* No GtkObject​ - GtkObject will not be used in GTK3, as it is removed. The
 
* No GtkObject​ - GtkObject will not be used in GTK3, as it is removed. The
 
remaining functionality ”destroy signal” will be now a part of GtkWidgetClass. So changes will be there wherever the Gtk object class is used.
 
remaining functionality ”destroy signal” will be now a part of GtkWidgetClass. So changes will be there wherever the Gtk object class is used.
* Other changes ​- It includes changing the syntax for drag and drop and
+
* Other changes ​- It includes changing the syntax for drag and drop and clipboard. GdkColormap will be replaced by GdkVisual. For using GtkPlug and GtkSocket widgets, different headers will be used i.e. (<gtk/gtk3.h>). Scrolling changes will be there. Replacement of size_request By get_preffered_width/height. Constants will be having a different format, allocation property will be Changed, import method for Pixbuff will also change.
clipboard. GdkColormap will be replaced by GdkVisual. For using GtkPlug and GtkSocket widgets, different headers will be used i.e. (<gtk/gtk3.h>). Scrolling changes will be there. Replacement of size_request By get_preffered_width/height.
+
 
Constants will be having a different format, allocation property will be
  −
Changed, import method for Pixbuff will also change.
   
Many changes will be implemented for porting to Gst1.0​ like changes in; Imports,
 
Many changes will be implemented for porting to Gst1.0​ like changes in; Imports,
 
Gst.init(), element _factory_make(), element_link_many(), Pipeline.add(),
 
Gst.init(), element _factory_make(), element_link_many(), Pipeline.add(),