gradient-selector.cpp revision e19707e728f3cfac994e5aca6972ae9fd8afd9d7
/*
* Gradient vector widget
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Jon A. Cruz <jon@joncruz.org>
*
* Copyright (C) 2001-2002 Lauris Kaplinski
* Copyright (C) 2001 Ximian, Inc.
* Copyright (C) 2010 Jon A. Cruz
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "document.h"
#include "../document-undo.h"
#include "../document-private.h"
#include "../gradient-chemistry.h"
#include "inkscape.h"
#include "verbs.h"
#include "preferences.h"
#include "gradient-vector.h"
#include "gradient-selector.h"
#include "paint-selector.h"
#include "style.h"
#include "id-clash.h"
enum {
};
/* Signal handlers */
static void sp_gradient_selector_vector_set (SPGradientVectorSelector *gvs, SPGradient *gr, SPGradientSelector *sel);
static GtkVBoxClass *parent_class;
{
if (!type) {
sizeof(SPGradientSelectorClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof(SPGradientSelector),
0, /* n_preallocs */
0, /* value_table */
};
"SPGradientSelector",
&info,
static_cast< GTypeFlags > (0) );
}
return type;
}
{
G_TYPE_NONE, 0);
G_TYPE_NONE, 0);
G_TYPE_NONE, 0);
G_TYPE_NONE, 0);
}
{
sel->safelyInit = true;
/* Vectors */
icon_column->set_clickable(true);
name_column->set_clickable(true);
name_column->set_resizable(true);
count_column->set_clickable(true);
count_column->set_resizable(true);
icon_column->signal_clicked().connect( sigc::mem_fun(*sel, &SPGradientSelector::onTreeColorColClick) );
name_column->signal_clicked().connect( sigc::mem_fun(*sel, &SPGradientSelector::onTreeNameColClick) );
count_column->signal_clicked().connect( sigc::mem_fun(*sel, &SPGradientSelector::onTreeCountColClick) );
gvs->tree_select_connection = sel->treeview->get_selection()->signal_changed().connect( sigc::mem_fun(*sel, &SPGradientSelector::onTreeSelection) );
sel->text_renderer->signal_edited().connect( sigc::mem_fun(*sel, &SPGradientSelector::onGradientRename) );
/* Create box for buttons */
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
//sel->nonsolid.push_back(hb);
gtk_button_set_image((GtkButton*)sel->add , gtk_image_new_from_stock ( GTK_STOCK_ADD, GTK_ICON_SIZE_SMALL_TOOLBAR ) );
g_signal_connect (G_OBJECT (sel->add), "clicked", G_CALLBACK (sp_gradient_selector_add_vector_clicked), sel);
gtk_button_set_image((GtkButton*)sel->edit , gtk_image_new_from_stock ( GTK_STOCK_EDIT, GTK_ICON_SIZE_SMALL_TOOLBAR ) );
g_signal_connect (G_OBJECT (sel->edit), "clicked", G_CALLBACK (sp_gradient_selector_edit_vector_clicked), sel);
gtk_button_set_image((GtkButton*)sel->del , gtk_image_new_from_stock ( GTK_STOCK_REMOVE, GTK_ICON_SIZE_SMALL_TOOLBAR ) );
g_signal_connect (G_OBJECT (sel->del), "clicked", G_CALLBACK (sp_gradient_selector_delete_vector_clicked), sel);
}
{
if ( sel->safelyInit ) {
sel->safelyInit = false;
}
if (sel->icon_renderer) {
delete sel->icon_renderer;
}
if (sel->text_renderer) {
delete sel->text_renderer;
}
}
}
{
//gtk_combo_box_set_active (GTK_COMBO_BOX(this->spread), gradientSpread);
}
{
}
{
if (mode == MODE_SWATCH) {
{
}
for (std::vector<GtkWidget*>::iterator it = swatch_widgets.begin(); it != swatch_widgets.end(); ++it)
{
}
vs->setSwatched();
} else {
{
}
for (std::vector<GtkWidget*>::iterator it = swatch_widgets.begin(); it != swatch_widgets.end(); ++it)
{
}
}
}
}
{
}
{
return gradientUnits;
}
{
return gradientSpread;
}
void SPGradientSelector::onGradientRename( const Glib::ustring& path_string, const Glib::ustring& new_text)
{
if( iter )
{
if ( row ) {
if ( obj ) {
_("Rename gradient"));
}
}
}
}
}
void SPGradientSelector::onTreeColorColClick() {
}
void SPGradientSelector::onTreeNameColClick() {
}
void SPGradientSelector::onTreeCountColClick() {
}
void SPGradientSelector::onTreeSelection()
{
if (!treeview) {
return;
}
if (blocked) {
return;
}
* When the treeview initially doesn't have focus and is clicked
* sometimes get_selection()->signal_changed() has the wrong selection
*/
treeview->grab_focus();
}
if (!sel) {
return;
}
/* Single selection */
if ( iter ) {
}
if (obj) {
}
}
bool SPGradientSelector::_checkForSelected(const Gtk::TreePath &path, const Gtk::TreeIter& iter, SPGradient *vector)
{
bool found = false;
{
bool wasBlocked = blocked;
blocked = true;
found = true;
}
return found;
}
{
store->foreach( sigc::bind<SPGradient*>(sigc::mem_fun(*this, &SPGradientSelector::_checkForSelected), vector) );
}
{
return;
}
if (vector) {
{
}
} else {
{
}
}
} else if (mode != MODE_SWATCH) {
for (std::vector<GtkWidget*>::iterator it = swatch_widgets.begin(); it != swatch_widgets.end(); ++it)
{
}
{
}
}
if (edit) {
}
if (add) {
}
if (del) {
}
} else {
if (edit) {
}
if (add) {
}
if (del) {
}
}
}
{
/* fixme: */
}
static void
sp_gradient_selector_vector_set (SPGradientVectorSelector *gvs, SPGradient *gr, SPGradientSelector *sel)
{
}
}
static void
{
if (!selection) {
return;
}
/* Single selection */
if ( iter ) {
}
if (obj) {
}
}
static void
{
// Legacy gradient dialog
} else {
// Invoke the gradient tool
if ( verb ) {
if ( action ) {
}
}
}
}
static void
{
SPDocument *doc = sp_gradient_vector_selector_get_document (SP_GRADIENT_VECTOR_SELECTOR (sel->vectors));
if (!doc)
return;
SPGradient *gr = sp_gradient_vector_selector_get_gradient( SP_GRADIENT_VECTOR_SELECTOR (sel->vectors));
if (gr) {
} else {
}
// Rename the new gradients id to be similar to the cloned gradients
}
/*
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 :