chalk

kis_selection_options.cpp
1/*
2 * Copyright (c) 2005 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#include <tqwidget.h>
20#include <tqradiobutton.h>
21#include <tqcombobox.h>
22#include <kcolorbtn.h>
23#include <tqlayout.h>
24
25#include "kis_canvas_controller.h"
26#include "kis_canvas_subject.h"
27#include "wdgselectionoptions.h"
28#include "kis_selection_options.h"
29#include "kis_types.h"
30#include "kis_layer.h"
31#include "kis_image.h"
32#include "kis_selection.h"
33#include "kis_paint_device.h"
34
35KisSelectionOptions::KisSelectionOptions(TQWidget *parent, KisCanvasSubject * subject)
36 : super(parent),
37 m_subject(subject)
38{
39 m_page = new WdgSelectionOptions(this);
40 TQ_CHECK_PTR(m_page);
41
42 TQVBoxLayout * l = new TQVBoxLayout(this);
43 l->addWidget(m_page);
44
45 connect(m_page->cmbAction, TQ_SIGNAL(activated(int)), this, TQ_SIGNAL(actionChanged(int)));
46}
47
48KisSelectionOptions::~KisSelectionOptions()
49{
50}
51
52int KisSelectionOptions::action()
53{
54 return m_page->cmbAction->currentItem();
55}
56
57void KisSelectionOptions::slotActivated()
58{
59
60 if (!m_subject) return;
61 KisImageSP img = m_subject->currentImg();
62 if (!img) return;
63 KisPaintDeviceSP dev = img->activeDevice();
64 if (!dev) return;
65
66 if (dev->hasSelection()) {
67 }
68}
69
70#include "kis_selection_options.moc"
KisCanvasSubject is part of the Observer pattern.