icon-preview.cpp revision f77fbbae517ab9a0c194068e88cbdf0f43b72f9b
/** @file
* @brief A simple dialog for previewing icon representation.
*/
/* Authors:
* Jon A. Cruz
* Bob Jamison
* Other dudes from The Inkscape Organization
*
* Copyright (C) 2004 Bob Jamison
* Copyright (C) 2005 Jon A. Cruz
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtkmm/buttonbox.h>
#include "desktop.h"
#include "desktop-handles.h"
#include "display/nr-arena.h"
#include "document.h"
#include "inkscape.h"
#include "preferences.h"
#include "selection.h"
#include "sp-root.h"
#include "icon-preview.h"
extern "C" {
// takes doc, root, icon, and icon name to produce pixels
guchar *
}
namespace Inkscape {
namespace UI {
namespace Dialogs {
{
return *instance;
}
//#########################################################################
//## E V E N T S
//#########################################################################
{
_getContents()->queue_draw();
}
}
//#########################################################################
//## C O N S T R U C T O R / D E S T R U C T O R
//#########################################################################
/**
* Constructor
*/
hot(1),
refreshButton(0),
{
numEntries = 0;
if (sizeVal > 0) {
}
}
}
sizes = new int[numEntries];
int i = 0;
}
}
if ( numEntries < 1 )
{
numEntries = 5;
sizes = new int[numEntries];
sizes[0] = 16;
}
for ( int i = 0; i < numEntries; i++ ) {
pixMem[i] = 0;
images[i] = 0;
}
for ( int i = 0; i < numEntries; i++ ) {
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 );
buttons[i]->signal_clicked().connect( sigc::bind<int>( sigc::mem_fun(*this, &IconPreviewPanel::on_button_clicked), i) );
}
//## The Refresh button
}
//#########################################################################
//## M E T H O D S
//#########################################################################
void IconPreviewPanel::refreshPreview()
{
if ( desktop ) {
{
if ( sel ) {
//g_message("found a selection to play with");
if ( id ) {
}
}
if ( target ) {
}
}
}
else
{
if ( target ) {
}
}
}
}
void IconPreviewPanel::modeToggled()
{
}
{
// g_message(" setting up to render '%s' as the icon", id );
/* Create new arena */
/* Create ArenaItem and set transform */
for ( int i = 0; i < numEntries; i++ ) {
// g_message( " size %d %s", sizes[i], (px ? "worked" : "failed") );
if ( px ) {
px = 0;
} else {
}
images[i]->queue_draw();
}
}
void IconPreviewPanel::updateMagnify()
{
Glib::RefPtr<Gdk::Pixbuf> buf = images[hot]->get_pixbuf()->scale_simple( 128, 128, Gdk::INTERP_NEAREST );
}
} //namespace Dialogs
} //namespace UI
} //namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :