[glom] Removed unused method.



commit 30ce6528a39094ef6ebdbe05f6886ffedc0c7571
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Aug 10 14:40:38 2011 +0200

    Removed unused method.

 .../print_layouts/window_print_layout_edit.cc      |   99 --------------------
 .../print_layouts/window_print_layout_edit.h       |    3 -
 glom/utility_widgets/canvas/canvas_group_grid.cc   |    2 +-
 3 files changed, 1 insertions(+), 103 deletions(-)
---
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.cc b/glom/mode_design/print_layouts/window_print_layout_edit.cc
index 269d019..2b50891 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -297,105 +297,6 @@ void Window_PrintLayout_Edit::init_menu()
   add_accel_group(m_uimanager->get_accel_group());
 }
 
-Glib::RefPtr<Gdk::Pixbuf> Window_PrintLayout_Edit::get_icon_for_toolbar_item(Gtk::ToolItem& item)
-{
-  Glib::RefPtr<Gdk::Pixbuf> result;
-
-  //Set the icon to show when dragging:
-  Glib::RefPtr<Gtk::Action> action = item.get_related_action();
-  if(!action)
-    return result;
-
-  const Gtk::StockID stock_id = action->property_stock_id();
-  if(stock_id)
-  {
-    result = item.render_icon_pixbuf(stock_id, Gtk::ICON_SIZE_LARGE_TOOLBAR);
-  }
-  else
-  {
-    const Glib::ustring icon_name = action->property_icon_name();
-
-    Glib::RefPtr<Gdk::Screen> screen = item.get_screen();
-    if(!screen)
-      return result;
-
-    int width = 0;
-    int height = 0;
-    if(!Gtk::IconSize::lookup(Gtk::ICON_SIZE_LARGE_TOOLBAR, width, height))
-    {
-      //An arbitrary default:
-      width = height = 24;
-    }
-
-    Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_for_screen(screen);
-    if(!icon_theme)
-      return result;
-
-    result = icon_theme->load_icon(icon_name, MIN(width, height), (Gtk::IconLookupFlags)0);
-  }
-
-  return result;
-}
-
-/*
-void Window_PrintLayout_Edit::make_toolbar_items_draggable()
-{
-  const int count = m_toolbar->get_n_items();
-  for(int i = 0; i < count; ++i)
-  {
-    Gtk::ToolItem* item = m_toolbar->get_nth_item(i);
-    if(!item)
-      continue;
-
-    //Allow this widget to be dragged:
-    item->set_use_drag_window();
-    item->drag_source_set(m_drag_targets, Gdk::BUTTON1_MASK, Gdk::ACTION_COPY);
-
-    //Set the icon to be shown when dragging:
-    Glib::RefPtr<Gdk::Pixbuf> pixbuf = get_icon_for_toolbar_item(*item);
-    if(pixbuf)
-      item->drag_source_set_icon(pixbuf);
-
-    //item->signal_drag_begin().connect(
-    //  sigc::mem_fun(*this, &Window_PrintLayout_Edit::on_toolbar_item_drag_begin) );
-
-    //item->signal_drag_end().connect(
-    //  sigc::mem_fun(*this, &Window_PrintLayout_Edit::on_toolbar_item_drag_end) );
-
-    //Let the item supply some data when the destination asks for it:
-    Glib::RefPtr<Gtk::Action> action = item->get_action();
-    item->signal_drag_data_get().connect(
-      sigc::bind( sigc::mem_fun(*this, &Window_PrintLayout_Edit::on_toolbar_item_drag_data_get), action) );
-  }
-}
-*/
-
-/*
-void Window_PrintLayout_Edit::on_toolbar_item_drag_begin(const Glib::RefPtr<Gdk::DragContext>& drag_context)
-{
-  std::cout << "Window_PrintLayout_Edit::on_toolbar_item_drag_begin" << std::endl;
-}
-
-void Window_PrintLayout_Edit::on_toolbar_item_drag_end(const Glib::RefPtr<Gdk::DragContext>& drag_context)
-{
-  std::cout << "Window_PrintLayout_Edit::on_toolbar_item_drag_end" << std::endl;
-}
-*/
-
-
-//TODO: I don't know what this really means. murrayc.
-const int DRAG_DATA_FORMAT = 8; // 8 bits format
-
-void Window_PrintLayout_Edit::on_toolbar_item_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& drag_context, Gtk::SelectionData& selection_data, guint /* info */, guint /* time */)
-{
-  PrintLayoutToolbarButton::enumItems type = PrintLayoutToolbarButton::get_item_type_from_selection_data(drag_context, selection_data);
-
-  selection_data.set(selection_data.get_target(), DRAG_DATA_FORMAT,
-          (const guchar*)&type,
-          1 /* 1 byte */);
-}
-
-
 bool Window_PrintLayout_Edit::on_canvas_drag_drop(const Glib::RefPtr<Gdk::DragContext>& drag_context, int /* x */, int /* y */, guint timestamp)
 {
   const Glib::ustring target = m_canvas.drag_dest_find_target(drag_context);
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.h b/glom/mode_design/print_layouts/window_print_layout_edit.h
index 325b9b6..395b2b6 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.h
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.h
@@ -92,7 +92,6 @@ private:
 
   //void on_toolbar_item_drag_begin(const Glib::RefPtr<Gdk::DragContext>& drag_context);
   //void on_toolbar_item_drag_end(const Glib::RefPtr<Gdk::DragContext>& drag_context);
-  void on_toolbar_item_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& drag_context, Gtk::SelectionData& selection_data, guint info, guint time);
   bool on_canvas_drag_drop(const Glib::RefPtr<Gdk::DragContext>& drag_context, int x, int y, guint timestamp);
   bool on_canvas_drag_motion(const Glib::RefPtr<Gdk::DragContext>& drag_context, int x, int y, guint timestamp);
   void on_canvas_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& drag_context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint timestamp);
@@ -109,8 +108,6 @@ private:
   //override:
   virtual bool on_configure_event(GdkEventConfigure* event);
 
-  Glib::RefPtr<Gdk::Pixbuf> get_icon_for_toolbar_item(Gtk::ToolItem& item);
-
   void update_table_title();
   void setup_context_menu();
   void set_ruler_sizes();
diff --git a/glom/utility_widgets/canvas/canvas_group_grid.cc b/glom/utility_widgets/canvas/canvas_group_grid.cc
index 2e2b1d8..fd07e22 100644
--- a/glom/utility_widgets/canvas/canvas_group_grid.cc
+++ b/glom/utility_widgets/canvas/canvas_group_grid.cc
@@ -1,6 +1,6 @@
 /* Glom
  *
- * Copyright (C) 2007 Murray Cumming
+ * Copyright (C) 2007-2011 Murray Cumming
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]