index b3ea55df333085e363c3080482b1912d58027878..d0b8b4a8fff87510715f38e8c9b195346085dd9d 100644 (file)
#include <gtk/gtk.h>
#include <gtk/gtk.h>
+#include <glib/gmem.h>
#include <gtk/gtkdialog.h> //for GTK_RESPONSE* types
#include <glibmm/i18n.h>
#include <gtkmm/buttonbox.h>
#include <gtk/gtkdialog.h> //for GTK_RESPONSE* types
#include <glibmm/i18n.h>
#include <gtkmm/buttonbox.h>
IconPreviewPanel* IconPreviewPanel::instance = 0;
IconPreviewPanel* IconPreviewPanel::instance = 0;
-
-IconPreviewPanel& IconPreviewPanel::getInstance()
+IconPreviewPanel*
+IconPreviewPanel::create(Inkscape::UI::Dialog::Behavior::BehaviorFactory behavior_factory)
{
if ( !instance ) {
{
if ( !instance ) {
- instance = new IconPreviewPanel();
+ instance = new IconPreviewPanel(behavior_factory);
}
instance->refreshPreview();
}
instance->refreshPreview();
- return *instance;
+ return instance;
}
//#########################################################################
}
//#########################################################################
hot = which;
updateMagnify();
hot = which;
updateMagnify();
- queue_draw();
+ get_vbox()->queue_draw();
}
}
}
}
/**
* Constructor
*/
/**
* Constructor
*/
-IconPreviewPanel::IconPreviewPanel() :
- Panel(),
+IconPreviewPanel::IconPreviewPanel(Inkscape::UI::Dialog::Behavior::BehaviorFactory behavior_factory) :
+ Inkscape::UI::Dialog::Dialog(behavior_factory, "dialogs.iconpreview", SP_VERB_VIEW_ICON_PREVIEW),
hot(1),
refreshButton(0),
selectionButton(0)
hot(1),
refreshButton(0),
selectionButton(0)
pixMem[i] = new guchar[4 * sizes[i] * sizes[i]];
memset( pixMem[i], 0x00, 4 * sizes[i] * sizes[i] );
pixMem[i] = new guchar[4 * sizes[i] * sizes[i]];
memset( pixMem[i], 0x00, 4 * sizes[i] * sizes[i] );
- GdkPixbuf *pb = gdk_pixbuf_new_from_data( pixMem[i], GDK_COLORSPACE_RGB, TRUE, 8, sizes[i], sizes[i], sizes[i] * 4, /*(GdkPixbufDestroyNotify)nr_free*/NULL, NULL );
+ GdkPixbuf *pb = gdk_pixbuf_new_from_data( pixMem[i], GDK_COLORSPACE_RGB, TRUE, 8, sizes[i], sizes[i], sizes[i] * 4, /*(GdkPixbufDestroyNotify)g_free*/NULL, NULL );
GtkImage* img = GTK_IMAGE( gtk_image_new_from_pixbuf( pb ) );
images[i] = Glib::wrap(img);
Glib::ustring label(*labels[i]);
GtkImage* img = GTK_IMAGE( gtk_image_new_from_pixbuf( pb ) );
images[i] = Glib::wrap(img);
Glib::ustring label(*labels[i]);
Gtk::HButtonBox* holder = new Gtk::HButtonBox( Gtk::BUTTONBOX_END );
Gtk::HButtonBox* holder = new Gtk::HButtonBox( Gtk::BUTTONBOX_END );
- pack_end( *holder, false, false );
+ get_vbox()->pack_end( *holder, false, false );
selectionButton = new Gtk::ToggleButton(_("Selection")); // , GTK_RESPONSE_APPLY
holder->pack_start( *selectionButton, false, false );
selectionButton = new Gtk::ToggleButton(_("Selection")); // , GTK_RESPONSE_APPLY
holder->pack_start( *selectionButton, false, false );
refreshButton->signal_clicked().connect( sigc::mem_fun(*this, &IconPreviewPanel::refreshPreview) );
refreshButton->signal_clicked().connect( sigc::mem_fun(*this, &IconPreviewPanel::refreshPreview) );
- pack_start(iconBox, Gtk::PACK_EXPAND_WIDGET);
+ get_vbox()->pack_start(iconBox, Gtk::PACK_EXPAND_WIDGET);
show_all_children();
}
show_all_children();
}
if ( selectionButton && selectionButton->get_active() )
{
if ( selectionButton && selectionButton->get_active() )
{
- Inkscape::Selection * sel = SP_DT_SELECTION(desktop);
+ Inkscape::Selection * sel = sp_desktop_selection(desktop);
if ( sel ) {
//g_message("found a selection to play with");
if ( sel ) {
//g_message("found a selection to play with");