[glom] Fix the distcheck. Don't use deprecated gtkmm API.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Fix the distcheck. Don't use deprecated gtkmm API.
- Date: Mon, 22 Mar 2010 09:02:01 +0000 (UTC)
commit a8a2cbfd97e3fd23195ec3f1f7537cc7c6779ef5
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Mar 22 10:01:38 2010 +0100
Fix the distcheck. Don't use deprecated gtkmm API.
* glom/utility_widgets/flowtable.cc:
* glom/utility_widgets/flowtable_dnd.cc:
* glom/utility_widgets/placeholder-glom.cc: Adapt to deprecated gtkmm API.
Use get_has_window() and set_has_window() instead of get_flags(),
unset_flags() and set_flags().
ChangeLog | 36 ++++++++++------
glom/utility_widgets/flowtable.cc | 43 +++++++++----------
glom/utility_widgets/flowtable_dnd.cc | 68 +++++++++++++++---------------
glom/utility_widgets/placeholder-glom.cc | 24 +++++-----
4 files changed, 90 insertions(+), 81 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e71235e..712bded 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,17 @@
+2010-03-22 Murray Cumming <murrayc murrayc com>
+
+ Fix the distcheck. Don't use deprecated gtkmm API.
+
+ * glom/utility_widgets/flowtable.cc:
+ * glom/utility_widgets/flowtable_dnd.cc:
+ * glom/utility_widgets/placeholder-glom.cc: Adapt to deprecated gtkmm API.
+ Use get_has_window() and set_has_window() instead of get_flags(),
+ unset_flags() and set_flags().
+
2010-03-19 Daniel Borgmann <danielb openismus com>
* configure.ac: Make Glom build with autoconf 2.65.
- Patch from Fryderyk Dziarmagowski in GNOME bug #613179.
+ Patch from Fryderyk Dziarmagowski in GNOME bug #613179.
2010-03-16 David King <davidk openismus com>
@@ -15,35 +25,35 @@
2010-03-16 Murray Cumming <murrayc murrayc com>
Tests: Check that the .glade files are valid XML.
-
+
* Makefile_tests.am:
- * tests/test_glade_file_validation.sh: Add this text that the .glade files
- are basically valid XML. It would be nice to have a Glade DTD to validate
+ * tests/test_glade_file_validation.sh: Add this text that the .glade files
+ are basically valid XML. It would be nice to have a Glade DTD to validate
them against too.
- We should also check that each top-level widget can be instantiated by
+ We should also check that each top-level widget can be instantiated by
GtkBuilder.
2010-03-16 Murray Cumming <murrayc murrayc com>
Add a startup script feature.
-
+
* libglom/document/document.cc: Added get/set_startup_script().
load_after(), save_before(): Load and save the startup script.
-
+
* glom_developer.glade:
* glom/mode_design/dialog_database_preferences.[h|cc]: Add a startup script tab.
-
- * libglom/python_embed/py_glom_ui.h: Move PythonUICallbacks into its own
+
+ * libglom/python_embed/py_glom_ui.h: Move PythonUICallbacks into its own
py_glom_ui_callbacks.h header.
- * glom/python_embed/python_ui_callbacks.[h|cc]: Add this derived callbacks
+ * glom/python_embed/python_ui_callbacks.[h|cc]: Add this derived callbacks
class that has handlers that call methods in the application.
* glom/mode_data/box_data.cc: execute_button_script(): Use the new callbacks
class instead of using member methods here.
- * glom/application.cc: on_document_load(): Run the startup script, if any,
+ * glom/application.cc: on_document_load(): Run the startup script, if any,
after loading the document, using the new derived callbacks class.
-
+
* Makefile_glom.am, Makefile_libglom.am: Mention the new files.
-
+
2010-03-13 David King <davidk openismus com>
Depend on gtkmm >= 2.19.2, fixing GNOME bug #612796
diff --git a/glom/utility_widgets/flowtable.cc b/glom/utility_widgets/flowtable.cc
index 396f7e4..47d8d0c 100644
--- a/glom/utility_widgets/flowtable.cc
+++ b/glom/utility_widgets/flowtable.cc
@@ -17,7 +17,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-
+
#include "flowtable.h"
#include "layoutwidgetbase.h"
#include <gtk/gtkwidget.h>
@@ -172,7 +172,7 @@ static void container_forall_callback(GtkWidget* widget_gobj, void* data)
#endif //GLIBMM_EXCEPTIONS_ENABLED
}
-
+
FlowTable::FlowTableItem::FlowTableItem(Gtk::Widget* first, FlowTable* /* flowtable */)
: m_first(first),
m_second(0),
@@ -236,7 +236,7 @@ FlowTable::FlowTable()
}
#endif // !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
- set_flags(Gtk::NO_WINDOW);
+ set_has_window(false);
set_redraw_on_allocate(false);
}
@@ -244,8 +244,8 @@ FlowTable::~FlowTable()
{
//Delete managed children.
//(For some reason this is not always happening via Gtk::Container:
- /* Actualy, don't do this because we would then be double-deleting what the
- * Container base class already deleted. We'll have to really find out if/why some
+ /* Actualy, don't do this because we would then be double-deleting what the
+ * Container base class already deleted. We'll have to really find out if/why some
* things are not being deleted. murrayc.
bool one_deleted = true;
while(!m_children.empty() && one_deleted)
@@ -281,7 +281,7 @@ void FlowTable::set_design_mode(bool value)
void FlowTable::add(Gtk::Widget& first, Gtk::Widget& second, bool expand_second)
{
FlowTableItem item(&first, &second, this);
-
+
item.m_expand_second = expand_second; //Expand to fill the width for all of the second item.
m_children.push_back(item);
gtk_widget_set_parent(GTK_WIDGET(item.m_first->gobj()), GTK_WIDGET(gobj()));
@@ -346,9 +346,9 @@ void FlowTable::insert_before(FlowTableItem& item, Gtk::Widget& before)
found = true;
break;
}
- }
+ }
}
-
+
gtk_widget_set_parent(GTK_WIDGET(item.m_first->gobj()), GTK_WIDGET(gobj()));
if(item.m_second)
{
@@ -380,7 +380,7 @@ void FlowTable::get_item_requested_width(const FlowTableItem& item, int& first,
//Initialize output paramters:
first = 0;
second = 0;
-
+
Gtk::Widget* first_widget = item.m_first;
Gtk::Widget* second_widget = item.m_second;
@@ -493,7 +493,7 @@ int FlowTable::get_column_height(guint start_widget, guint widget_count, int& to
total_width += m_column_padding;
return column_height;
-}
+}
int FlowTable::get_minimum_column_height(guint start_widget, guint columns_count, int& total_width) const
{
@@ -544,7 +544,7 @@ int FlowTable::get_minimum_column_height(guint start_widget, guint columns_count
if(minimum_column_height_sofar < minimum_column_height)
{
minimum_column_height = minimum_column_height_sofar;
- width_for_minimum_column_height = first_column_width + others_column_width;
+ width_for_minimum_column_height = first_column_width + others_column_width;
}
}
else
@@ -568,7 +568,7 @@ void FlowTable::on_size_request(Gtk::Requisition* requisition)
// table
const int MIN_HEIGHT = (m_design_mode ? 50 : 0);
const int MIN_WIDTH = (m_design_mode ? 100 : 0);
-
+
//Initialize the output parameter:
*requisition = Gtk::Requisition();
@@ -741,7 +741,7 @@ void FlowTable::on_size_allocate(Gtk::Allocation& allocation)
const int item_height = get_item_requested_height(item);
//Start a new column if necessary:
- int bottom = allocation.get_y() + allocation.get_height();
+ int bottom = allocation.get_y() + allocation.get_height();
if( (column_child_y_start + item_height) > bottom)
{
//start a new column:
@@ -832,7 +832,7 @@ void FlowTable::on_size_allocate(Gtk::Allocation& allocation)
if(something_added)
{
- //Let later code know where the widgets are, and whether the layout has
+ //Let later code know where the widgets are, and whether the layout has
//changed since m_columns_allocated_changed was last set to false.
if(!item.m_has_allocated_column || (item.m_allocated_column != column_number))
{
@@ -840,7 +840,7 @@ void FlowTable::on_size_allocate(Gtk::Allocation& allocation)
item.m_has_allocated_column = true;
m_columns_allocated_changed = true;
}
-
+
//Start the next child below this child, plus the padding
column_child_y_start += item_height;
column_child_y_start += m_row_padding; //Ignored if this is the last item - we will just start a new column when we find that column_child_y_start is too much.
@@ -867,7 +867,7 @@ void FlowTable::on_add(Gtk::Widget* child)
{
FlowTableItem item(child, 0);
m_children.push_back(item);
-
+
gtk_widget_set_parent(GTK_WIDGET(item.m_first->gobj()), GTK_WIDGET(gobj()));
//This is protected, but should be public: child.set_parent(*this);
@@ -937,7 +937,7 @@ void FlowTable::forall(const ForallSlot& slot)
void FlowTable::set_column_padding(guint padding)
{
- m_column_padding = padding;
+ m_column_padding = padding;
}
guint FlowTable::get_column_padding() const
@@ -947,7 +947,7 @@ guint FlowTable::get_column_padding() const
void FlowTable::set_row_padding(guint padding)
{
- m_row_padding = padding;
+ m_row_padding = padding;
}
guint FlowTable::get_row_padding() const
@@ -1011,7 +1011,7 @@ void FlowTable::remove_all()
}
- m_children.clear();
+ m_children.clear();
}
void FlowTable::on_realize()
@@ -1078,7 +1078,7 @@ bool FlowTable::get_column_for_first_widget(const Gtk::Widget& first, guint& col
{
//Initialize output parameter:
column = 0;
-
+
for(type_vecChildren::const_iterator iter = m_children.begin(); iter != m_children.end(); ++iter)
{
const FlowTableItem& item = *iter;
@@ -1089,11 +1089,10 @@ bool FlowTable::get_column_for_first_widget(const Gtk::Widget& first, guint& col
return true;
}
}
-
+
return false;
}
} //namespace Glom
-
diff --git a/glom/utility_widgets/flowtable_dnd.cc b/glom/utility_widgets/flowtable_dnd.cc
index e45f799..325c199 100644
--- a/glom/utility_widgets/flowtable_dnd.cc
+++ b/glom/utility_widgets/flowtable_dnd.cc
@@ -32,7 +32,7 @@ namespace Glom
{
const std::string MOVE_TARGET = "FlowTableMoveTarget";
-
+
FlowTableDnd::FlowTableDnd() :
m_current_dnd_item(0),
m_internal_drag(false)
@@ -50,7 +50,7 @@ FlowTableDnd::FlowTableDnd() :
FlowTableDnd::~FlowTableDnd()
{
-
+
}
void FlowTableDnd::start_dnd(Gtk::Widget& child)
@@ -84,14 +84,14 @@ void FlowTableDnd::start_dnd(Gtk::Widget& child)
child.signal_drag_data_get().connect(sigc::bind<Gtk::Widget*>(sigc::mem_fun(*this, &FlowTableDnd::on_child_drag_data_get), &child), false);
child.signal_drag_data_delete().connect(sigc::bind<Gtk::Widget*>(sigc::mem_fun(*this, &FlowTableDnd::on_child_drag_data_delete), &child), false);
- if(!(child.get_flags() & Gtk::NO_WINDOW))
- {
+ if(child.get_has_window())
+ {
std::list<Gtk::TargetEntry> drag_targets;
const Gtk::TargetEntry toolbar_target = Gtk::ToolPalette::get_drag_target_item();
drag_targets.push_back(toolbar_target);
const Gtk::TargetEntry move_target(MOVE_TARGET);
drag_targets.push_back(move_target);
-
+
Glib::RefPtr<Gtk::TargetList> targets = child.drag_dest_get_target_list();
// The widget has already a default drag destination - add more targets:
@@ -119,7 +119,7 @@ void FlowTableDnd::stop_dnd(Gtk::Widget& child)
if(dynamic_cast<PlaceholderGlom*>(&child) ||
dynamic_cast<FlowTableDnd*>(&child))
return;
-
+
// Call this method recursively for all (real) children:
Gtk::Container* container = dynamic_cast<Gtk::Container*>(&child);
if(container)
@@ -142,8 +142,8 @@ bool FlowTableDnd::on_drag_motion(const Glib::RefPtr<Gdk::DragContext>& /* drag_
// the widget position. We fix this here to match the widget position
x += get_allocation().get_x();
y += get_allocation().get_y();
-
- m_current_dnd_item = dnd_item_at_position(x, y);
+
+ m_current_dnd_item = dnd_item_at_position(x, y);
Gtk::Widget* above = dnd_datawidget_from_item(m_current_dnd_item);
// above might be 0 here...
@@ -185,7 +185,7 @@ void FlowTableDnd::on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& d
palette_candidate = palette_candidate->get_parent();
palette = dynamic_cast<Gtk::ToolPalette*>(palette_candidate);
}
-
+
on_dnd_remove_placeholder();
Gtk::Widget* above = dnd_datawidget_from_item(m_current_dnd_item);
if(palette) //If the item was dragged from the palette.
@@ -205,7 +205,7 @@ void FlowTableDnd::on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& d
Gtk::Widget* widget = static_cast<Gtk::Widget*>(*pdata); //The type that was set in on_child_drag_data_get().
- //A dynamic cast (from Gtk::Widget) is necessary because of the virtual inheritance:
+ //A dynamic cast (from Gtk::Widget) is necessary because of the virtual inheritance:
LayoutWidgetBase* base = dynamic_cast<LayoutWidgetBase*>(widget);
if(base)
{
@@ -240,15 +240,15 @@ void FlowTableDnd::on_drag_leave(const Glib::RefPtr<Gdk::DragContext>& /* drag_c
// Calculate the nearest FlowTableDndItem below the current drag position
FlowTable::FlowTableItem*
FlowTableDnd::dnd_item_at_position(int drag_x, int drag_y)
-{
+{
int column_width = 0;
get_column_height(0, m_children.size(), column_width);
int column = 0;
if(column_width != 0)
column = drag_x / column_width;
-
- for(std::vector<FlowTableItem>::iterator cur_item = m_children.begin(); cur_item != m_children.end();
+
+ for(std::vector<FlowTableItem>::iterator cur_item = m_children.begin(); cur_item != m_children.end();
++cur_item)
{
Gdk::Rectangle rect = cur_item->m_first->get_allocation();
@@ -258,14 +258,14 @@ FlowTableDnd::dnd_item_at_position(int drag_x, int drag_y)
rect.set_height(MAX(rect.get_height(), second_rect.get_height()));
rect.set_width(rect.get_width() + get_column_padding() + second_rect.get_width());
}
-
+
int cur_column = 0;
if(column_width != 0)
cur_column = rect.get_x() / column_width;
-
+
if(cur_column != column)
- continue;
-
+ continue;
+
// Allow dragging at the end
if(cur_item == --m_children.end())
{
@@ -275,11 +275,11 @@ FlowTableDnd::dnd_item_at_position(int drag_x, int drag_y)
return 0;
}
}
-
+
if(drag_y < (rect.get_y() + rect.get_height()))
return &(*cur_item);
}
-
+
return 0;
}
@@ -288,7 +288,7 @@ Gtk::Widget* FlowTableDnd::dnd_datawidget_from_item(FlowTable::FlowTableItem* it
// Test if we have a datawidget below which we want to add
LayoutWidgetBase* above = 0;
FlowTableItem* used_item = item;
-
+
if(used_item)
{
if(used_item->m_first)
@@ -307,11 +307,11 @@ Gtk::Widget* FlowTableDnd::dnd_datawidget_from_item(FlowTable::FlowTableItem* it
// Special case for labels
if(!above)
- {
+ {
Gtk::Alignment* alignment = dynamic_cast <Gtk::Alignment*>(used_item->m_second);
if(alignment)
above = dynamic_cast<LayoutWidgetBase*>(alignment->get_child());
- }
+ }
}
}
@@ -326,7 +326,7 @@ FlowTable::FlowTableItem* FlowTableDnd::find_current_dnd_item(Gtk::Widget* child
cur_child != m_children.end(); ++cur_child)
{
// The widget was added directly to the FlowTableDnd
- if(cur_child->m_first == child ||
+ if(cur_child->m_first == child ||
cur_child->m_second == child)
{
break;
@@ -362,7 +362,7 @@ FlowTable::FlowTableItem* FlowTableDnd::find_current_dnd_item(Gtk::Widget* child
item = &(*cur_child);
else
item = 0;
-
+
// Allow dragging at-the-end
if(cur_child == --m_children.end() && y > 0)
{
@@ -373,7 +373,7 @@ FlowTable::FlowTableItem* FlowTableDnd::find_current_dnd_item(Gtk::Widget* child
item = 0; // means end
}
}
-
+
return item;
}
@@ -381,9 +381,9 @@ bool FlowTableDnd::on_child_drag_motion(const Glib::RefPtr<Gdk::DragContext>& /*
Gtk::Widget* child)
{
m_current_dnd_item = find_current_dnd_item(child, x, y);
-
+
Gtk::Widget* above = dnd_datawidget_from_item(m_current_dnd_item);
-
+
// above might be 0 here...
on_dnd_add_placeholder(above);
return false;
@@ -394,15 +394,15 @@ void FlowTableDnd::on_child_drag_leave(const Glib::RefPtr<Gdk::DragContext>& /*
dnd_remove_placeholder_idle();
}
-void FlowTableDnd::on_child_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& drag_context, int x, int y,
+void FlowTableDnd::on_child_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& drag_context, int x, int y,
const Gtk::SelectionData& selection_data, guint info, guint time,
Gtk::Widget* /* child */)
{
on_drag_data_received(drag_context, x, y, selection_data, info, time);
}
-void FlowTableDnd::on_child_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& /* drag_context */,
- Gtk::SelectionData& selection_data, guint, guint /* time */,
+void FlowTableDnd::on_child_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& /* drag_context */,
+ Gtk::SelectionData& selection_data, guint, guint /* time */,
Gtk::Widget* child)
{
FlowTableItem* item = find_current_dnd_item(child);
@@ -412,7 +412,7 @@ void FlowTableDnd::on_child_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&
if(base)
data = base;
- selection_data.set("Gtk::Widget*", 8, (guint8*)&data,
+ selection_data.set("Gtk::Widget*", 8, (guint8*)&data,
sizeof(gpointer*));
}
@@ -465,7 +465,7 @@ void FlowTableDnd::on_child_drag_end(const Glib::RefPtr<Gdk::DragContext>& /* dr
if(item->m_first)
item->m_first->show();
if(item->m_second)
- item->m_second->show();
+ item->m_second->show();
}
else if(!m_internal_drag)
{
@@ -482,7 +482,7 @@ void FlowTableDnd::on_child_drag_end(const Glib::RefPtr<Gdk::DragContext>& /* dr
void FlowTableDnd::on_child_drag_data_delete(const Glib::RefPtr<Gdk::DragContext>& /* drag_context */,
Gtk::Widget* /* child */)
{
- // Do nothing for now
+ // Do nothing for now
}
void FlowTableDnd::set_design_mode(bool value)
@@ -499,7 +499,7 @@ void FlowTableDnd::set_design_mode(bool value)
/* This is a hack. The problem is that when you move the mouse down to the last
item, the item gets the "drag-motion" signal but in the same moment, the placeholder
is removed and the mouse pointer is no longer over the widget. Thus, it gets
- a "drag-leave" signal and it's impossible to drop an item at the end. Doing
+ a "drag-leave" signal and it's impossible to drop an item at the end. Doing
the removal of the placeholder in an idle handler fixes it. */
void FlowTableDnd::dnd_remove_placeholder_idle()
diff --git a/glom/utility_widgets/placeholder-glom.cc b/glom/utility_widgets/placeholder-glom.cc
index 1041734..aeac536 100644
--- a/glom/utility_widgets/placeholder-glom.cc
+++ b/glom/utility_widgets/placeholder-glom.cc
@@ -2,19 +2,19 @@
/*
* glom
* Copyright (C) Johannes Schmid 2007 <jhs gnome org>
- *
+ *
* glom is free software.
- *
+ *
* You may redistribute it and/or modify it under the terms of the
* GNU General Public License, as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
- *
+ *
* glom is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with glom. If not, write to:
* The Free Software Foundation, Inc.,
@@ -36,14 +36,14 @@ PlaceholderGlom::PlaceholderGlom() :
Glib::ObjectBase("glom_placeholder"),
Gtk::Widget()
{
- set_flags(Gtk::NO_WINDOW);
+ set_has_window(false);
#ifndef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
signal_realize().connect(sigc::mem_fun(*this, &PlaceholderGlom::on_realize));
signal_unrealize().connect(sigc::mem_fun(*this, &PlaceholderGlom::on_unrealize));
signal_expose_event().connect(sigc::mem_fun(*this, &PlaceholderGlom::on_expose_event));
signal_size_request().connect(sigc::mem_fun(*this, &PlaceholderGlom::on_size_request));
signal_size_allocate().connect(sigc::mem_fun(*this, &PlaceholderGlom::on_size_allocate));
-#endif
+#endif
}
PlaceholderGlom::~PlaceholderGlom()
@@ -83,9 +83,9 @@ void PlaceholderGlom::on_size_allocate(Gtk::Allocation& allocation)
void PlaceholderGlom::on_realize()
{
//Call base class:
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
+#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
Gtk::Widget::on_realize();
-#endif
+#endif
ensure_style();
@@ -104,14 +104,14 @@ void PlaceholderGlom::on_realize()
attributes.width = allocation.get_width();
attributes.height = allocation.get_height();
- attributes.event_mask = get_events () | Gdk::EXPOSURE_MASK;
+ attributes.event_mask = get_events () | Gdk::EXPOSURE_MASK;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
m_refGdkWindow = Gdk::Window::create(get_window() /* parent */, &attributes,
GDK_WA_X | GDK_WA_Y);
- unset_flags(Gtk::NO_WINDOW);
+ set_has_window();
set_window(m_refGdkWindow);
//set colors
@@ -125,9 +125,9 @@ void PlaceholderGlom::on_realize()
void PlaceholderGlom::on_unrealize()
{
m_refGdkWindow.reset();
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
+#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
Gtk::Widget::on_unrealize();
-#endif
+#endif
}
bool PlaceholderGlom::on_expose_event(GdkEventExpose* event)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]