object-properties.cpp revision 94d7884e56192ef3d558038ccced5c74a24a8174
#define __OBJECT_PROPERTIES_C__
/**
* \brief Fill, stroke, and stroke style dialog
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Frank Felfe <innerspace@iname.com>
* bulia byak <buliabyak@users.sf.net>
*
* Copyright (C) 1999-2005 authors
* Copyright (C) 2001-2002 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "widgets/sp-widget.h"
#include "macros.h"
#include "inkscape.h"
#include "fill-style.h"
#include "stroke-style.h"
#include "dialog-events.h"
#include "verbs.h"
#include "interface.h"
#include "style.h"
#include "inkscape-stock.h"
#include "prefs-utils.h"
#include "svg/css-ostringstream.h"
#include "sp-gaussian-blur.h"
#include "sp-filter.h"
#include "desktop-handles.h"
#include "desktop-style.h"
#include "document.h"
#include "document-private.h"
#include <selection.h>
// impossible original values to make sure they are read from prefs
static void sp_fillstroke_selection_modified ( Inkscape::Application *inkscape, Inkscape::Selection *selection, guint flags, GtkObject *base );
static void sp_fillstroke_selection_changed ( Inkscape::Application *inkscape, Inkscape::Selection *selection, GtkObject *base );
static void
{
}
static gboolean
{
if (x<0) x=0;
if (y<0) y=0;
return FALSE; // which means, go ahead and destroy it
}
void
char *label,
char *dlg_name,
char *label_image )
{
l = gtk_label_new_with_mnemonic (label);
gtk_widget_show (l);
}
void
sp_object_properties_dialog (void)
{
if (!dlg) {
if (x == -1000 || y == -1000) {
}
if (w ==0 || h == 0) {
}
if (x<0) x=0;
if (y<0) y=0;
if (x != 0 || y != 0)
else
g_signal_connect ( G_OBJECT (INKSCAPE), "activate_desktop", G_CALLBACK (sp_transientize_callback), &wd );
gtk_signal_connect ( GTK_OBJECT (dlg), "destroy", G_CALLBACK (sp_object_properties_dialog_destroy), dlg );
gtk_signal_connect ( GTK_OBJECT (dlg), "delete_event", G_CALLBACK (sp_object_properties_dialog_delete), dlg );
g_signal_connect ( G_OBJECT (INKSCAPE), "shut_down", G_CALLBACK (sp_object_properties_dialog_delete), dlg );
/* Fill page */
{
}
/* Stroke paint page */
{
}
/* Stroke style page */
{
}
/* Blur */
dlg );
/* Opacity */
gtk_label_set_mnemonic_widget (GTK_LABEL(l), s);
gtk_signal_connect ( a, "value_changed",
dlg );
// these callbacks are only for the master opacity update; the tabs above take care of themselves
g_signal_connect ( G_OBJECT (INKSCAPE), "change_selection", G_CALLBACK (sp_fillstroke_selection_changed), dlg );
g_signal_connect ( G_OBJECT (INKSCAPE), "modify_selection", G_CALLBACK (sp_fillstroke_selection_modified), dlg );
g_signal_connect ( G_OBJECT (INKSCAPE), "activate_desktop", G_CALLBACK (sp_fillstroke_selection_changed), dlg );
} else {
}
} // end of sp_object_properties_dialog()
void sp_object_properties_fill (void)
{
}
void sp_object_properties_stroke (void)
{
}
void sp_object_properties_stroke_style (void)
{
}
static void
{
}
static void
{
return;
GtkAdjustment *a = GTK_ADJUSTMENT(gtk_object_get_data(GTK_OBJECT(dlg), "master_opacity_adjustment"));
// create temporary style
// query style from desktop into it. This returns a result flag and fills query with the style of subselection, if any, or selection
switch (result) {
case QUERY_STYLE_NOTHING:
break;
case QUERY_STYLE_SINGLE:
case QUERY_STYLE_MULTIPLE_AVERAGED: // TODO: treat this slightly differently
break;
}
GtkAdjustment *bluradjustment = GTK_ADJUSTMENT(gtk_object_get_data(GTK_OBJECT(dlg), "blur_adjustment"));
//query now for current average blurring of selection
switch (blur_result) {
case QUERY_STYLE_NOTHING: //no blurring
break;
case QUERY_STYLE_SINGLE:
gtk_widget_set_sensitive (b, TRUE);
//update blur widget value
// TODO: divide by bbox diagonal
break;
}
}
static void
{
return;
sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "fillstroke:opacity", SP_VERB_NONE,
/* TODO: annotate */ "object-properties.cpp:311");
}
/**
* Creates a filter with blur primitive of specified stdDeviation
*/
static SPFilter *
{
// create a new private filter
//create feGaussianBlur node
//set stdDeviation attribute
os << stdDeviation;
//set feGaussianBlur as child of filter node
// Append the new filter node to defs
// get corresponding object
g_assert(SP_IS_FILTER(f));
return f;
}
static void
{
//if dialog is locked, return
return;
//lock dialog
//get desktop
if (!desktop) {
return;
}
//get current selection
//get list of selected items
//get current document
//create new filter with feGaussianBlur primitive
//apply created filter to every selected item
{
//if there is a filter attached, remove it
}/* else if( style->filter.filter ) { //item has a filter assigned
Inkscape::XML::Node *repr = SP_OBJECT_REPR ( style->filter.filter );
Inkscape::CSSOStringStream os;
os << a->value;
repr->firstChild()->setAttribute("stdDeviation", os.str().c_str());
}*/ else {
//add new filter attribute to object style
}
//request update
}
sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "fillstroke:blur", SP_VERB_NONE, "object-properties.cpp:467");
}
/*
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 :