Commit Graph

14 Commits

Author SHA1 Message Date
Luca Bacci 74bb981ed2 Use Gdk::RGBA (!25)
The Gdk::RGBA data type was introduced to replace Gdk::Color in
Gtkmm 3.0 [1], with Gdk::Color being deprecated in Gtkmm 3.10 [2].

With this commit we make the change to Gdk::RGBA data type which is the
modern replacement to Gdk::Color.  Gdk::RGBA can be used almost as a
drop in replacement because it keeps most of the Gdk::Color interface.

Also, this commit removes the C Gtk call introduced during the
port-to-gtk3 patchset by commit:
    5379352766
    repare-for-gtk3: Prepare for removal of Gtk::Widget::modify_fg() (#7)

[1] Gtkmm 3.0.1 NEWS file
    https://gitlab.gnome.org/GNOME/gtkmm/blob/3.0.1/NEWS#L48
        * RGBA replaces Color, though Color still exists because it is
          used by TextView.  We hope to deprecated Color completely in
          gtkmm 3.2.

[2] Gtkmm 3.10.0 NEWS file
    https://gitlab.gnome.org/GNOME/gtkmm/blob/3.10.0/NEWS#L127
        Gdk:
        * Deprecate Color.

Closes !25 - Modern Gtk3 - part 1
2019-04-27 12:03:04 +01:00
Luca Bacci 93b1425549 port-to-gtk3: Use draw signal in the partition visualizer (#7)
In Gtk2 widgets draw themselves in response to the expose event signal.
In Gtk3 widgets draw themselves in response to the GtkWidget::draw
signal, and the signal handler gets a Cairo context as an argument.

Convert Gtk::DrawingArea rendering code to respond to the
GtkWidget::draw signal.

This commit is specific to the drawing area contained in the main
application window (also called the DrawingAreaVisualDisk).

Reference:

[1] Migrating from GTK+ 2.x to GTK+ 3 - "The GtkWidget::draw signal":
    https://developer.gnome.org/gtk3/stable/ch26s02.html#id-1.6.3.4.11

Closes #7 - Port to Gtk3
2019-02-11 08:57:18 +00:00
Luca Bacci 2fad309601 modern-gtk2: Use Cairo for drawing the partition visualizer (!17)
Third commit in a series to convert Gdk::GC based drawing to Cairo based
drawing.  This specific commit makes the transition for the graphical
partition visualizer widget that is used in the main application window.

Closed !17 - Gtk2 modernisation
2018-11-12 21:50:42 +00:00
Mike Fleetwood 8979913a3f Remove "../include/" from GParted header #includes
It made the code look a little messy, is easily resolved in the build
system and made the dependencies more complicated than needed.  Each
GParted header was tracked via multiple different names (different
numbers of "../include/" prefixes).  For example just looking at how
DialogFeatures.o depends on Utils.h:

    $ cd src
    $ make DialogFeatures.o
    $ egrep ' [^ ]*Utils.h' .deps/DialogFeatures.Po
     ../include/DialogFeatures.h ../include/../include/Utils.h \
     ../include/../include/../include/../include/../include/../include/Utils.h \
     ../include/../include/../include/Utils.h \

After removing "../include/" from the GParted header #includes, just
need to add "-I../include" to the compile command via the AM_CPPFLAGS in
src/Makefile.am.  Now the dependencies on GParted header files are
tracked under a single name (with a single "../include/" prefix).  Now
DialogFeatures.o only depends on a single name to Utils.h:

    $ make DialogFeatures.o
    $ egrep ' [^ ]*Utils.h' .deps/DialogFeatures.Po
     ../include/DialogFeatures.h ../include/Utils.h ../include/i18n.h \
2016-12-12 13:15:34 -07:00
Mike Fleetwood fae909897e Use PartitionVector class throughout the code (#759726)
Replace all occurrences of std::vector<Partition> with PartitionVector.

Bug 759726 - Implement Partition object polymorphism
2016-01-26 10:11:35 -07:00
Mike Fleetwood cc1448abd2 Store pointers to partition objects in DrawingAreaVisualDisk (#750168)
This stops copying of each displayed partition object into the
DrawingAreaVisualDisk class.

Bug 750168 - Reduce the amount of copying of partition objects
2015-06-10 10:43:14 -06:00
Mike Fleetwood c430acf52a Pass by pointer in the signal_partition_selected callbacks (#750168)
Change from passing a reference to the selected partition, to passing a
pointer to the selected partition in the signal_partition_selected
callbacks between the disk graphic, partition list and core GUI modules.

This is an enabler for the following patches.

Bug 750168 - Reduce the amount of copying of partition objects
2015-06-10 10:43:14 -06:00
Daniel Mustieles 3861b9257b Replace obsolete FSF postal address in copyright notices (#721565)
This is part of parent bug:
    Bug #721455 - Obsolete info in license text on multiple modules

and GNOME Goal:
    https://wiki.gnome.org/Initiatives/GnomeGoals/Proposals

    * verify all source files to make sure they have a license and a
      copyright, and that both are up-to-date

Bug #721565 -  License text contains obsolete FSF postal address
2014-01-26 10:53:23 +00:00
Mike Fleetwood 2b51d87147 Make include guards unique (#539297)
Include guards need to be unique within GParted code and all included
library header files.
    http://en.wikipedia.org/wiki/Include_guard#Difficulties

Use this model for all include guards:
    #ifndef GPARTED_FILE_NAME_H
    #define GPARTED_FILE_NAME_H
    ...
    #endif /* GPARTED_FILE_NAME_H */

Closes Bug #539297 - Make include guards unique
2013-06-05 10:57:39 -06:00
Mike Fleetwood ac3ce5ec2b Simplify main window partition usage graphic code
Stop using fraction_unallocated and fraction_used member variables of
the DrawingAreaVisualDisk class as intermediate storage of partition
usage fractions.  Instead get the figures straight from the partition
class and use the new calc_usage_triple() to directly set pixels widths
for the partition usage graphic.
2012-06-26 14:13:31 -06:00
Mike Fleetwood 2b9c6425b5 Display unallocated space in the main window (#499202)
Display the unallocated space within a partition in the main window's
graphical disk representation.

Bug #499202 - gparted does not see the difference if partition size
              differs from filesystem size
2012-06-18 10:24:28 -06:00
Bart Hakvoort c3c5f189ed fixed a few issues with selecting/activating partitions. improved support
* include/DrawingAreaVisualDisk.h,
  src/DrawingAreaVisualDisk.cc: fixed a few issues with
  selecting/activating partitions.
* include/Utils.h,
  src/Utils.cc,
  src/Dialog_Disklabel.cc,
  src/Dialog_Partition_Info.cc (mk_label): improved support for
  aligment.
* src/Win_GParted.cc: fixed a small alignmentissue in the devices
  submenu.
2006-03-20 10:12:55 +00:00
Bart Hakvoort 4e57356c34 another change to highlighting of selected partition. deal properly with
* include/DrawingAreaVisualDisk.h,
  src/DrawingAreaVisualDisk.cc: another change to highlighting of
  selected partition.
* include/Partition.h,
  src/Win_GParted.cc: deal properly with just formatted partitions
* src/Operation.cc: added FIXME
2006-03-18 21:38:19 +00:00
Bart Hakvoort 8777cbd125 removed the frame from the visualdiskwidget and changed some visual
* include/DrawingAreaVisualDisk.h,
  include/Makefile.am,
  include/Win_GParted.h
  src/DrawingAreaVisualDisk.cc,
  src/Makefile.am
  src/Win_GParted.cc: removed the frame from the visualdiskwidget and
  changed some visual details. Also changed visual representation of
  selected partition. The latter might be considered as a work in
  progress.
* include/FrameVisualDisk.h,
  src/FrameVisualDisk.cc: Removed.
2006-03-09 13:12:44 +00:00