[goocanvasmm] gtkmm4: Adapt to new-style enums.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goocanvasmm] gtkmm4: Adapt to new-style enums.
- Date: Sat, 15 Apr 2017 13:36:34 +0000 (UTC)
commit c5e9cbf93c99f5acd5a1327acd601859307ad588
Author: Murray Cumming <murrayc murrayc com>
Date: Sat Apr 15 15:28:06 2017 +0200
gtkmm4: Adapt to new-style enums.
examples/coordinates/window.cc | 4 +-
examples/demo/primitives.cc | 32 +++++++++++++++---------------
examples/drag_to_canvas/examplewindow.cc | 14 ++++++------
examples/simple/examplewindow.cc | 2 +-
examples/tablemodel/examplewindow.cc | 2 +-
examples/text/window.cc | 8 +++---
goocanvas/src/table.hg | 2 +-
goocanvas/src/tablemodel.hg | 2 +-
goocanvas/src/text.hg | 4 +-
goocanvas/src/textmodel.hg | 4 +-
10 files changed, 37 insertions(+), 37 deletions(-)
---
diff --git a/examples/coordinates/window.cc b/examples/coordinates/window.cc
index 20ffc69..f081579 100644
--- a/examples/coordinates/window.cc
+++ b/examples/coordinates/window.cc
@@ -19,8 +19,8 @@
#include <sstream>
ExampleWindow::ExampleWindow()
-: m_box(Gtk::ORIENTATION_VERTICAL, 6),
- m_button_box(Gtk::ORIENTATION_HORIZONTAL, 6),
+: m_box(Gtk::Orientation::VERTICAL, 6),
+ m_button_box(Gtk::Orientation::HORIZONTAL, 6),
m_label_origin("origin (0, 0)"),
m_button_translate("translate(20, 20)"),
m_button_scale("scale(1.2, 1.2)"),
diff --git a/examples/demo/primitives.cc b/examples/demo/primitives.cc
index 6ccabd2..ecee9ab 100644
--- a/examples/demo/primitives.cc
+++ b/examples/demo/primitives.cc
@@ -24,7 +24,7 @@
Primitives::Primitives()
: _name("Primitives")
{
- _vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
+ _vbox = Gtk::manage(new Gtk::Box(Gtk::Orientation::VERTICAL));
auto lbl = Gtk::manage(new Gtk::Label("Drag an item with button 1. Click button 2 on an item to lower it,
or button 3 to raise it."));
_vbox->pack_start(*lbl, Gtk::PACK_SHRINK);
@@ -98,7 +98,7 @@ Primitives::_setup_heading(const Glib::ustring& heading, int pos)
double x = (pos%3) * 200 + 100 ;
double y = (pos/3) * 150 + 5 ;
- auto text = Goocanvas::Text::create(heading, x, y, -1, Goocanvas::ANCHOR_N);
+ auto text = Goocanvas::Text::create(heading, x, y, -1, Goocanvas::AnchorType::N);
_canvas->get_root_item()->add_child(text);
#ifdef GLIBMM_PROPERTIES_ENABLED
text->property_font() = "Sans 12" ;
@@ -301,7 +301,7 @@ Primitives::_setup_texts()
Glib::RefPtr<Goocanvas::Item> anchor
= _create_anchor(420, 20);
Glib::RefPtr<Goocanvas::Text> text
- = Goocanvas::Text::create("Anchor NW", 0, 0, -1, Goocanvas::ANCHOR_NW);
+ = Goocanvas::Text::create("Anchor NW", 0, 0, -1, Goocanvas::AnchorType::NW);
anchor->add_child(text);
//ellipse->property_fill_pattern() = _create_stipple("blue");
@@ -309,25 +309,25 @@ Primitives::_setup_texts()
g_object_set(text->gobj(), "fill-pattern", p->cobj(), (void*)0);
#ifdef GLIBMM_PROPERTIES_ENABLED
text->property_font() = "Sans Bold 24" ;
- text->property_alignment() = Pango::ALIGN_CENTER ;
+ text->property_alignment() = Pango::Alignment::CENTER ;
text->property_fill_color() = "firebrick" ;
#else
text->set_property("font", Glib::ustring("Sans Bold 24"));
- text->set_property("alignment", Pango::ALIGN_CENTER);
+ text->set_property("alignment", Pango::Alignment::CENTER);
text->set_property("fill_color", Glib::ustring("firebrick"));
#endif
_setup_signals(text);
anchor = _create_anchor(470, 75);
- text = Goocanvas::Text::create("Anchor center\nJustify center\nMultiline text\n8bit text 'gibberish'", 0,
0, -1, Goocanvas::ANCHOR_CENTER);
+ text = Goocanvas::Text::create("Anchor center\nJustify center\nMultiline text\n8bit text 'gibberish'", 0,
0, -1, Goocanvas::AnchorType::CENTER);
anchor->add_child(text);
#ifdef GLIBMM_PROPERTIES_ENABLED
text->property_font() = "monospace bold 14" ;
- text->property_alignment() = Pango::ALIGN_CENTER ;
+ text->property_alignment() = Pango::Alignment::CENTER ;
text->property_fill_color() = "firebrick" ;
#else
text->set_property("font", Glib::ustring("monospace bold 14"));
- text->set_property("alignment", Pango::ALIGN_CENTER);
+ text->set_property("alignment", Pango::Alignment::CENTER);
text->set_property("fill_color", Glib::ustring("firebrick"));
#endif
_setup_signals(text);
@@ -335,7 +335,7 @@ Primitives::_setup_texts()
anchor = _create_anchor(420, 240);
text = Goocanvas::Text::create(
"This is a very long paragraph that will need to be wrapped over several lines so we can see what
happens to line-breaking as the view is zoomed in and out.",
- 0, 0, 180, Goocanvas::ANCHOR_W);
+ 0, 0, 180, Goocanvas::AnchorType::W);
anchor->add_child(text);
#ifdef GLIBMM_PROPERTIES_ENABLED
text->property_font() = "Sans 12" ;
@@ -346,16 +346,16 @@ Primitives::_setup_texts()
#endif
_setup_signals(text);
- text = Goocanvas::Text::create("Ellipsized text.", 20, 420, 115, Goocanvas::ANCHOR_W);
+ text = Goocanvas::Text::create("Ellipsized text.", 20, 420, 115, Goocanvas::AnchorType::W);
_canvas->get_root_item()->add_child(text);
#ifdef GLIBMM_PROPERTIES_ENABLED
text->property_font() = "Sans 12" ;
text->property_fill_color() = "blue" ;
- text->property_ellipsize() = Pango::ELLIPSIZE_END ;
+ text->property_ellipsize() = Pango::EllipsizeMode::END ;
#else
text->set_property("font", Glib::ustring("Sans 12"));
text->set_property("fill_color", Glib::ustring("blue"));
- text->set_property("ellipsize", Pango::ELLIPSIZE_END);
+ text->set_property("ellipsize", Pango::EllipsizeMode::END);
#endif
_setup_signals(text);
}
@@ -396,10 +396,10 @@ Primitives::_setup_images()
#endif
_setup_signals(img);
- _create_flower(20.0, 170.0, Goocanvas::ANCHOR_NW);
- _create_flower(180.0, 170.0, Goocanvas::ANCHOR_NE);
- _create_flower(20.0, 280.0, Goocanvas::ANCHOR_SW);
- _create_flower(180.0, 280.0, Goocanvas::ANCHOR_SE);
+ _create_flower(20.0, 170.0, Goocanvas::AnchorType::NW);
+ _create_flower(180.0, 170.0, Goocanvas::AnchorType::NE);
+ _create_flower(20.0, 280.0, Goocanvas::AnchorType::SW);
+ _create_flower(180.0, 280.0, Goocanvas::AnchorType::SE);
}
void
diff --git a/examples/drag_to_canvas/examplewindow.cc b/examples/drag_to_canvas/examplewindow.cc
index 4395986..eeda711 100644
--- a/examples/drag_to_canvas/examplewindow.cc
+++ b/examples/drag_to_canvas/examplewindow.cc
@@ -21,15 +21,15 @@
const int DRAG_DATA_FORMAT = 8; // 8 bits format
ExampleWindow::ExampleWindow()
-: m_vbox(Gtk::ORIENTATION_VERTICAL, 6),
- m_hbox(Gtk::ORIENTATION_HORIZONTAL, 6),
+: m_vbox(Gtk::Orientation::VERTICAL, 6),
+ m_hbox(Gtk::Orientation::HORIZONTAL, 6),
m_button_rect("Rectangle"),
m_button_ellipse("Ellipse"),
m_drag_preview_requested(false)
{
set_title("goocanvasmm - Simple Example");
- m_drag_targets.push_back( Gtk::TargetEntry("goocanvasmm_example_drag_item", Gtk::TARGET_SAME_APP) );
+ m_drag_targets.push_back( Gtk::TargetEntry("goocanvasmm_example_drag_item", Gtk::TargetFlags::SAME_APP) );
add(m_vbox);
m_vbox.pack_start(m_hbox, Gtk::PACK_SHRINK);
@@ -53,7 +53,7 @@ ExampleWindow::ExampleWindow()
// drag_dest_set for details. It would be nice if Gtk::DestDefaults did
// contain a GTK_DEST_DEFAULT_NONE, but short of that we can still brute
// force it to 0.
- m_canvas.drag_dest_set(m_drag_targets, (Gtk::DestDefaults)0, Gdk::ACTION_COPY);
+ m_canvas.drag_dest_set(m_drag_targets, (Gtk::DestDefaults)0, Gdk::DragAction::COPY);
m_canvas.signal_drag_motion().connect(
sigc::mem_fun(*this, &ExampleWindow::on_canvas_drag_motion) );
m_canvas.signal_drag_drop().connect(
@@ -65,7 +65,7 @@ ExampleWindow::ExampleWindow()
void ExampleWindow::make_widget_draggable(Gtk::Widget& widget, DragItem drag_item)
{
- widget.drag_source_set(m_drag_targets, Gdk::BUTTON1_MASK, Gdk::ACTION_COPY);
+ widget.drag_source_set(m_drag_targets, Gdk::ModifierType::BUTTON1_MASK, Gdk::DragAction::COPY);
//Set the icon to be shown when dragging:
//Glib::RefPtr<Gdk::Pixbuf> pixbuf = get_icon_for_toolbar_item(*item);
@@ -123,7 +123,7 @@ bool ExampleWindow::on_canvas_drag_motion(const Glib::RefPtr<Gdk::DragContext>&
std::cout << " ExampleWindow::on_canvas_drag_motion(): item already created." << std::endl;
- drag_context->drag_status(Gdk::ACTION_COPY, timestamp);
+ drag_context->drag_status(Gdk::DragAction::COPY, timestamp);
//Move the temporary canvas item to the new position:
double item_x = x;
@@ -179,7 +179,7 @@ void ExampleWindow::on_canvas_drag_data_received(const Glib::RefPtr<Gdk::DragCon
{
std::cout << "ExampleWindow::on_canvas_drag_data_received: m_drag_preview_requested" << std::endl;
- drag_context->drag_status(Gdk::ACTION_COPY, timestamp);
+ drag_context->drag_status(Gdk::DragAction::COPY, timestamp);
m_drag_preview_requested = false;
}
else
diff --git a/examples/simple/examplewindow.cc b/examples/simple/examplewindow.cc
index f502ca9..a1d8c17 100644
--- a/examples/simple/examplewindow.cc
+++ b/examples/simple/examplewindow.cc
@@ -46,7 +46,7 @@ ExampleWindow::ExampleWindow()
rect->signal_button_press_event ().connect (sigc::mem_fun(*this,
&ExampleWindow::on_rect_button_press));
- auto text = Goocanvas::Text::create("Hello World", 300, 300, -1, Goocanvas::ANCHOR_CENTER);
+ auto text = Goocanvas::Text::create("Hello World", 300, 300, -1, Goocanvas::AnchorType::CENTER);
root->add_child(text);
#ifdef GLIBMM_PROPERTIES_ENABLED
text->property_font() = "Sans 24";
diff --git a/examples/tablemodel/examplewindow.cc b/examples/tablemodel/examplewindow.cc
index e974926..9a2a03a 100644
--- a/examples/tablemodel/examplewindow.cc
+++ b/examples/tablemodel/examplewindow.cc
@@ -63,7 +63,7 @@ ExampleWindow::ExampleWindow()
auto sw2 = Gtk::manage(new Gtk::ScrolledWindow());
sw2->add(m_second_canvas);
- auto box = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 6));
+ auto box = Gtk::manage(new Gtk::Box(Gtk::Orientation::VERTICAL, 6));
box->pack_start(*sw1, Gtk::PACK_EXPAND_WIDGET);
box->pack_start(*sw2, Gtk::PACK_EXPAND_WIDGET);
add(*box);
diff --git a/examples/text/window.cc b/examples/text/window.cc
index 9fbe1aa..a1e7d29 100644
--- a/examples/text/window.cc
+++ b/examples/text/window.cc
@@ -19,9 +19,9 @@
#include <sstream>
ExampleWindow::ExampleWindow()
-: m_box(Gtk::ORIENTATION_VERTICAL, 6),
- m_button_box1(Gtk::ORIENTATION_HORIZONTAL, 6),
- m_button_box2(Gtk::ORIENTATION_HORIZONTAL, 6),
+: m_box(Gtk::Orientation::VERTICAL, 6),
+ m_button_box1(Gtk::Orientation::HORIZONTAL, 6),
+ m_button_box2(Gtk::Orientation::HORIZONTAL, 6),
m_label_origin("origin (0, 0)"),
m_button_translate("translate(20, 20)"),
m_button_scale("scale(1.2, 1.2)"),
@@ -37,7 +37,7 @@ ExampleWindow::ExampleWindow()
m_canvas.set_size_request(640, 480);
#ifdef GLIBMM_PROPERTIES_ENABLED
- m_canvas.property_units() = Gtk::UNIT_MM;
+ m_canvas.property_units() = Gtk::Unit::MM;
#else
m_canvas.set_property("units", Gtk::UNIT_MM);
#endif
diff --git a/goocanvas/src/table.hg b/goocanvas/src/table.hg
index 1e7a255..3958d8d 100644
--- a/goocanvas/src/table.hg
+++ b/goocanvas/src/table.hg
@@ -56,7 +56,7 @@ public:
// TODO: We should get rid of this overload with the next gtkmm API/ABI break.
// See http://bugzilla.gnome.org/show_bug.cgi?id=142849.
void set_align(const Glib::RefPtr<Item>& child, double xalign = 0.0, double yalign = 0.0);
- void set_align(const Glib::RefPtr<Item>& child, Gtk::Align xalign = Gtk::ALIGN_START, Gtk::Align yalign =
Gtk::ALIGN_START);
+ void set_align(const Glib::RefPtr<Item>& child, Gtk::Align xalign = Gtk::Align::START, Gtk::Align yalign =
Gtk::Align::START);
//We put these in item.hg instead.
//See the comment there.
diff --git a/goocanvas/src/tablemodel.hg b/goocanvas/src/tablemodel.hg
index 2efb88e..61a101d 100644
--- a/goocanvas/src/tablemodel.hg
+++ b/goocanvas/src/tablemodel.hg
@@ -39,7 +39,7 @@ public:
void attach(const Glib::RefPtr<ItemModel>& item, guint left_attach, guint right_attach, guint top_attach,
guint bottom_attach, Gtk::PackOptions xoptions = Gtk::PACK_EXPAND_WIDGET, Gtk::PackOptions yoptions =
Gtk::PACK_EXPAND_WIDGET, double left_padding = 0.0, double right_padding = 0.0, double top_padding = 0.0,
double bottom_padding = 0.0);
void set_align(const Glib::RefPtr<ItemModel>& child, double xalign = 0.0, double yalign = 0.0);
- void set_align(const Glib::RefPtr<ItemModel>& child, Gtk::Align xalign = Gtk::ALIGN_START, Gtk::Align
yalign = Gtk::ALIGN_START);
+ void set_align(const Glib::RefPtr<ItemModel>& child, Gtk::Align xalign = Gtk::Align::START, Gtk::Align
yalign = Gtk::Align::START);
//We put these in item.hg instead.
//See the comment there.
diff --git a/goocanvas/src/text.hg b/goocanvas/src/text.hg
index eea07f2..96855d4 100644
--- a/goocanvas/src/text.hg
+++ b/goocanvas/src/text.hg
@@ -32,12 +32,12 @@ class Text : public Goocanvas::ItemSimple
_CLASS_GOBJECT(Text,GooCanvasText,GOO_CANVAS_TEXT,Goocanvas::ItemSimple,GooCanvasItemSimple)
protected:
- explicit Text(const Glib::ustring& text = Glib::ustring(), double x = 0.0, double y = 0.0, double width =
-1, AnchorType anchor = ANCHOR_NORTH_WEST);
+ explicit Text(const Glib::ustring& text = Glib::ustring(), double x = 0.0, double y = 0.0, double width =
-1, AnchorType anchor = AnchorType::NORTH_WEST);
_IGNORE(goo_canvas_text_new)
public:
- _WRAP_CREATE(const Glib::ustring& text = Glib::ustring(), double x = 0.0, double y = 0.0, double width =
0.0, AnchorType anchor = ANCHOR_NORTH_WEST)
+ _WRAP_CREATE(const Glib::ustring& text = Glib::ustring(), double x = 0.0, double y = 0.0, double width =
0.0, AnchorType anchor = AnchorType::NORTH_WEST)
#m4 _CONVERSION(`Pango::Rectangle&',`PangoRectangle*',`($3).gobj()')
_WRAP_METHOD(void get_natural_extents(Pango::Rectangle& ink_rect, Pango::Rectangle& logical_rect) const,
goo_canvas_text_get_natural_extents)
diff --git a/goocanvas/src/textmodel.hg b/goocanvas/src/textmodel.hg
index 53a34f2..7b00059 100644
--- a/goocanvas/src/textmodel.hg
+++ b/goocanvas/src/textmodel.hg
@@ -32,12 +32,12 @@ class TextModel : public Goocanvas::ItemModelSimple
_CLASS_GOBJECT(TextModel,GooCanvasTextModel,GOO_CANVAS_TEXT_MODEL,Goocanvas::ItemModelSimple,GooCanvasItemModelSimple)
protected:
- TextModel(const Glib::ustring& string = Glib::ustring(), double x = 0.0, double y = 0.0, double width =
-1, AnchorType anchor = ANCHOR_NORTH_WEST);
+ TextModel(const Glib::ustring& string = Glib::ustring(), double x = 0.0, double y = 0.0, double width =
-1, AnchorType anchor = AnchorType::NORTH_WEST);
_IGNORE(goo_canvas_text_model_new)
public:
- _WRAP_CREATE(const Glib::ustring& string = Glib::ustring(), double x = 0.0, double y = 0.0, double width =
-1, AnchorType anchor = ANCHOR_NORTH_WEST)
+ _WRAP_CREATE(const Glib::ustring& string = Glib::ustring(), double x = 0.0, double y = 0.0, double width =
-1, AnchorType anchor = AnchorType::NORTH_WEST)
_WRAP_PROPERTY("alignment", Pango::Alignment)
_WRAP_PROPERTY("anchor", AnchorType)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]