Commit Graph

21 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 21d8ad218e port-to-gtk3: Use draw signal in the partition resizer (#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 in the Create new Partition
dialog and the Resize/Move dialog.

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 5fb58f8877 port-to-gtk3: Use Gdk::Cursor via Glib::RefPtr<> (#7)
Starting from Gtkmm3 Gdk::Cursor objects cannot be constructed directly,
but instead you have to get a smart pointer to an instance by calling
the static member function Gdk::Cursor::create().

Gdk::Cursor::create() returns a Glib::RefPtr<Gdk::Cursor> object.

Gtkmm3 always uses Glib::RefPtr<Gdk::Cursor> in its interface and never
plain Gdk::Cursor.

Reference:

[1] Programming with gtkmm3, Changes in gtkmm3:
    https://developer.gnome.org/gtkmm-tutorial/3.24/changes-gtkmm3.html.en
    "... Gdk::Cursor are now used via Glib::RefPtr."

Closes #7 - Port to Gtk3
2019-02-11 08:57:18 +00:00
Mike Fleetwood 2c10dd2caa Put Frame_Resizer_{Base,Extended} modules into GParted namespace (!20)
All the other modules are in the GParted namespace, except for main()
which has to be in the global namespace, so put these in the GParted
namespace too.

Closes !20 - Minor namespace and scope operator tidy-ups
2018-11-26 17:56:32 +00:00
Luca Bacci d17d129044 modern-gtk2: Use Cairo for drawing the partition resizer (!17)
GdkGC has been deprecated in the underlying C / GTK+ 2.22 library.  It
is less clearly stated but Gdk::GC is also deprecated in C++ / gtkmm.
Cairo based rendering should be used instead.
https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html
https://gitlab.gnome.org/GNOME/gtk/blob/2.22.0/NEWS#L124
https://developer.gnome.org/gtkmm/2.24/classGdk_1_1GC.html

First commit in a series to convert Gdk::GC based drawing to Cairo based
drawing.  This specific commit makes the transition for the graphical
partition resizing widget that is used in the "Create New Partition",
"Paste" creating new partition and "Resize/Move" dialogs.

Cairo is not pixel based but instead uses a continuous coordinate space.
To draw in a pixel aligned way follow the guidance in the Cairo FAQ.
https://www.cairographics.org/FAQ/#sharp_lines

Additional references:
https://developer.gnome.org/gdk2/stable/gdk2-Drawing-Primitives.html#gdk-draw-line
https://developer.gnome.org/gdk2/stable/gdk2-Drawing-Primitives.html#gdk-draw-rectangle

Closes !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
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 7f5ac07c3a Stop using deprecated method free_colors() (#652044)
Gtkmm releases 2.7.1 in July 2005 and 2.8 in September 2005 deprecated
Gdk::Colormap::free_colors() and replaced it with
Gdk::Colormap::free_color().  The oldest distribution currently
supported is RHEL / CentOS 5.9 with gtkmm 2.10 so just unconditionally
replace.

    ANNOUNCE: gtkmm 2.7.1
    https://mail.gnome.org/archives/gnome-announce-list/2005-July/msg00025.html

    ANNOUNCE: gtkmm and glibmm 2.8
    https://mail.gnome.org/archives/gnome-announce-list/2005-September/msg00026.html

Bug #652044 - uses deprecated APIs
2013-10-15 10:09:15 -06:00
Markus Elfring 1e2562adda Bug #539092: Deletion of unnecessary null pointer checks
A few null pointer checks were deleted because they were not needed any more.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2010-10-06 12:24:51 -06:00
Curtis Gedak 95c9577d8f Limit graphic movement according to required boot record space
Also respect minimum size for extended partition in graphical
representation.

This change is part of adding the option to align to MiB (#617409).
2010-05-25 16:26:08 -06:00
Bart Hakvoort 52eb5545ec trivial 'breakfast cleanups' :)
* include/Frame_Resizer_Base.h,
  src/Frame_Resizer_Base.cc,
  src/Frame_Resizer_Extended.cc,
  src/GParted_Core.cc: trivial 'breakfast cleanups' :)
2006-09-09 07:09:13 +00:00
Bart Hakvoort 9830c8f63e did lots of work on the resizer, it's behaviour should be more natural and
* include/Frame_Resizer_Base.h,
  include/Frame_Resizer_Extended.h,
  src/Dialog_Base_Partition.cc,
  src/Dialog_Partition_Copy.cc,
  src/Dialog_Partition_New.cc,
  src/Dialog_Partition_Resize_Move.cc,
  src/Frame_Resizer_Base.cc,
  src/Frame_Resizer_Extended.cc: did lots of work on the resizer, it's
  behaviour should be more natural and satisfying now. (see also
  #331591)
* src/Win_GParted.cc: extended partition was resizable even when it's
  busy. fixed.
* src/ntfs.cc: made scan output more readable.
* src/FrameVisualDisk.cc: added FIXME
2006-03-01 19:16:13 +00:00
Bart Hakvoort e0ae266bcc hmmz, i forgot to remove one unnecessary check.
* src/Frame_Resizer_Base.cc: hmmz, i forgot to remove one unnecessary check.
2005-01-25 14:45:15 +00:00
Bart Hakvoort d375f5bf4e finally got around to fix this annoying 'flickering' while using the
* include/Frame_Resizer_Base.h,
  include/Frame_Resizer_Extended.h,
  src/Frame_Resizer_Base.cc,
  src/Frame_Resizer_Extended.cc: finally got around to fix this annoying 'flickering' while using the resizer :)
2005-01-25 14:26:54 +00:00
Bart Hakvoort fa255c48de removed sleep( 1 ). This isn't needed anymore now the layout is scanned
* src/GParted_Core.cc: removed sleep( 1 ). This isn't needed anymore now the layout is scanned before the re-readtest. (saves seconds at scantime :) )
* replaced C-style typeconversion with static_casts throughout the project.
2005-01-19 20:01:39 +00:00
Bart Hakvoort e3a9b2d14c The fixes from 12-09 unearthed a number of long forgotten issues and
* The fixes from 12-09 unearthed a number of long forgotten issues and annoyances. Hopefully they're all resolved now.
2004-12-12 14:57:04 +00:00
Bart Hakvoort 587c4af200 Fixed a crasher with the New Partition Dialog (thanks to Tino for
* src/Dialog_Partition_New.cc,
  src/Frame_Resizer_Base.cc: Fixed a crasher with the New Partition Dialog (thanks to Tino for reporting)
2004-12-01 21:31:59 +00:00
Bart Hakvoort 067c1154aa make use of reference arguments instead of return values in some
* include/Operation.h,
  src/Operation.cc: make use of reference arguments instead of return values in some functions.
  Also fixed a small bug with deletion of a virtual (new) logical partition.
* include/VBox_VisualDisk.h,
  src/VBox_VisualDisk.cc: logical filesystems weren't shown in the legend, fixed.
* src/Frame_Resizer_Base.cc: fixed small bug with custom cursors.
* src/TreeView_Detail.cc: removed obsolete, already commented code.
* src/Win_GParted.cc: make use of reference arguments instead of return values in some functions. (see Operation)
2004-11-07 13:13:11 +00:00
Bart Hakvoort bcb05b8540 removed inheritance from sigc::trackable. (this is already done by
* include/Frame_Resizer_Base.h: removed inheritance from sigc::trackable. (this is already done by Glib::Object). * src/Dialog_Partition_Copy.cc, src/Frame_Resizer_Base.cc: fixed issues with resizing reiserfs filesystems.
2004-10-08 19:53:35 +00:00
Bart Hakvoort a1dfbee2b3 cosmetics (mostly tabfixes)
* almost all files: cosmetics (mostly tabfixes)
2004-10-01 21:09:19 +00:00
Bart Hakvoort 26d433260d Initial revision 2004-09-19 20:24:53 +00:00