/**
* @file
* Combobox for selecting dash patterns - implementation.
*/
/* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Maximilian Albert <maximilian.albert@gmail.com>
*
* Copyright (C) 2002 Lauris Kaplinski
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "dash-selector.h"
#include <cstring>
#include <string>
#include <gtkmm/adjustment.h>
#include "style.h"
#include "ui/dialog-events.h"
#include "preferences.h"
#include "ui/widget/spinbutton.h"
#include "display/cairo-utils.h"
: preview_width(80),
preview_height(16),
{
// TODO: find something more sensible here!!
init_dashes();
dash_combo.set_cell_data_func(image_renderer, sigc::mem_fun(*this, &SPDashSelector::prepareImageRenderer));
dash_combo.show();
this->pack_start(dash_combo, false, false, 0);
#if WITH_GTKMM_3_0
#else
#endif
offset->signal_value_changed().connect(sigc::mem_fun(*this, &SPDashSelector::offset_value_changed));
#if WITH_GTKMM_3_0
#else
#endif
this->pack_start(*sb, false, false, 0);
int np=0;
// Add the dashes to the combobox
}
// add the custom one
}
SPDashSelector::~SPDashSelector() {
// FIXME: for some reason this doesn't get called; does the call to manage() in
// sp_stroke_style_line_widget_new() not processed correctly?
#if !WITH_GTKMM_3_0
delete offset;
#endif
}
}
if (!dashes) {
int pos = 0;
if (!dash_prefs.empty()) {
style.readFromPrefs( *i );
unsigned i = 0;
}
d[i] = -1;
} else {
}
pos += 1;
}
} else { // This code may never execute - a new preferences.xml is created for a new user. Maybe if the user deletes dashes from preferences.xml?
unsigned i;
for(i=0;i<BD_LEN;i++) {
dashes[i] = builtin_dashes[i];
}
}
// make a place to hold the custom dashes, up to 15 positions long (+ terminator)
int i=0;
for(i=0;i<15;i++){ d[i]=i; } // have to put something in there, this is a pattern hopefully nobody would choose
d[15]=-1.0;
// final terminator
}
}
{
if (ndash > 0) {
for (int i = 0; i < ndash; i++)
delta /= 1000.0;
int np = 0;
np += 1;
int j;
for (j = 0; j < ndash; j++) {
break;
}
if (j == ndash) {
pos = i;
break;
}
}
}
}
else if(ndash==0) {
pos = 0;
}
if(pos>=0){
}
else { // Hit a custom pattern in the SVG, write it into the combobox.
count--; // the one slot for custom patterns
int i=0;
d[i]=dash[i];
} // store the custom pattern
}
}
{
int nd = 0;
nd += 1;
if (nd > 0) {
if (ndash)
if (dash) {
}
if (off)
} else {
if (ndash)
*ndash = 0;
if (dash)
if (off)
*off = 0.0;
}
}
/**
* Fill a pixbuf with the dash pattern using standard cairo drawing
*/
{
int n_dashes;
cairo_surface_t *s = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, preview_width, preview_height);
//cairo_set_source_rgb (ct, 0, 0, 0);
cairo_stroke (ct);
return pixbuf;
}
/**
* Fill a pixbuf with a text label using standard cairo drawing
*/
{
cairo_surface_t *s = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, preview_width, preview_height);
cairo_stroke (ct);
return pixbuf;
}
{
}
{
}
/*
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:fileencoding=utf-8:textwidth=99 :