dash-selector.cpp revision ca9dd8adb8e5d286a925445613608a1be10702a5
/**
* @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 "dialogs/dialog-events.h"
#include "preferences.h"
#include "ui/widget/spinbutton.h"
#include "display/cairo-utils.h"
static double dash_0[] = {-1.0};
: 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);
offset->signal_value_changed().connect(sigc::mem_fun(*this, &SPDashSelector::offset_value_changed));
this->pack_start(*sb, false, false, 0);
for (int i = 0; dashes[i]; i++) {
// Add the dashes to the combobox
}
}
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?
delete offset;
}
}
void SPDashSelector::init_dashes() {
if (!dashes) {
if (!dash_prefs.empty()) {
int pos = 0;
int i = 0;
}
d[i] = -1;
} else {
}
pos += 1;
}
} else {
}
}
}
{
int pos = 0;
if (ndash > 0) {
double delta = 0.0;
for (int i = 0; i < ndash; i++)
delta /= 1000.0;
for (int i = 0; dashes[i]; i++) {
int np = 0;
np += 1;
int j;
for (j = 0; j < ndash; j++) {
break;
}
if (j == ndash) {
pos = i;
break;
}
}
}
}
}
{
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;
}
void SPDashSelector::on_selection ()
{
}
void SPDashSelector::offset_value_changed()
{
}
/*
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 :