krita

kis_selection_options.cc

00001 /*
00002  *  Copyright (c) 2005 Boudewijn Rempt <boud@valdyas.org>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #include <qwidget.h>
00020 #include <qradiobutton.h>
00021 #include <qcombobox.h>
00022 #include <kcolorbtn.h>
00023 #include <qlayout.h>
00024 
00025 #include "kis_canvas_controller.h"
00026 #include "kis_canvas_subject.h"
00027 #include "wdgselectionoptions.h"
00028 #include "kis_selection_options.h"
00029 #include "kis_types.h"
00030 #include "kis_layer.h"
00031 #include "kis_image.h"
00032 #include "kis_selection.h"
00033 #include "kis_paint_device.h"
00034 
00035 KisSelectionOptions::KisSelectionOptions(QWidget *parent, KisCanvasSubject * subject)
00036     : super(parent),
00037       m_subject(subject)
00038 {
00039     m_page = new WdgSelectionOptions(this);
00040     Q_CHECK_PTR(m_page);
00041 
00042     QVBoxLayout * l = new QVBoxLayout(this);
00043     l->addWidget(m_page);
00044 
00045     connect(m_page->cmbAction, SIGNAL(activated(int)), this, SIGNAL(actionChanged(int)));
00046 }
00047 
00048 KisSelectionOptions::~KisSelectionOptions()
00049 {
00050 }
00051 
00052 int KisSelectionOptions::action()
00053 {
00054     return m_page->cmbAction->currentItem();
00055 }
00056 
00057 void KisSelectionOptions::slotActivated()
00058 {
00059     
00060     if (!m_subject) return;
00061     KisImageSP img = m_subject->currentImg();
00062     if (!img) return;
00063     KisPaintDeviceSP dev = img->activeDevice();
00064     if (!dev) return;
00065 
00066     if (dev->hasSelection()) {
00067     }
00068 }
00069 
00070 #include "kis_selection_options.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys