Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

CWDialog Class Reference

GUI dialog for Color Wheel Plugin. Quite everything in this class is self explanatory (except few things ;)). More...

#include <cwdialog.h>

Collaboration diagram for CWDialog:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CWDialog (QWidget *parent=0, ScribusDoc *doc=0, const char *name=0, bool modal=FALSE, Qt::WFlags fl=0)
 ~CWDialog ()

Private Slots

void colorspaceTab_currentChanged (int)
void angleSpin_valueChanged (int)
void colorWheel_clicked (int, const QPoint &)
void typeCombo_activated (int)
void documentColorList_currentChanged (QListWidgetItem *)
void defectCombo_activated (int)
void addButton_clicked ()
void replaceButton_clicked ()
void cancelButton_clicked ()
void colorList_currentChanged (QListWidgetItem *)
void cSpin_valueChanged (int)
void mSpin_valueChanged (int)
void ySpin_valueChanged (int)
void kSpin_valueChanged (int)
void rSpin_valueChanged (int)
void gSpin_valueChanged (int)
void bSpin_valueChanged (int)
void hSpin_valueChanged (int)
void sSpin_valueChanged (int)
void vSpin_valueChanged (int)

Private Member Functions

void setPreview ()
 Draws a strange colorful things as preview of the color schema. User can see what will see a person with selected kind of color blindness.
QColor computeDefect (QColor c)
 Main color manipulator for preview. It calls transformations for the other vision defects filters.
void fillColorList ()
 It fills colors into list view. It takes colors from ColorWheel widget.
void setupColorComponents ()
 Set the spins with its color component value. It fills recomputed components regarding chosen color model and the changed channel. E.g. if user change R in RGB palette all CMYK channels are recomputed calling setupCMYKComponent().
void setupRGBComponent (ScColor col)
 A GUI setter for all components when is one of CMYK changed.
void setupCMYKComponent (ScColor col)
 A GUI setter for all components when is one of RGB changed.
void setupHSVComponent (ScColor col)
 A GUI setter for all components when is one of HSV changed. It uses a dummy QColor->ScColor conversion.
void updateNamedLabels ()
 Set named colors for labels.
void connectSlots (bool conn=true)
 Connect or disconnect rgbcmyk spinboxes signals.
void processColors (int index, bool updateSpins=true)
 Call main color calculation. It calls a ColorWheel methods to get requested harmonious colors depending on the dialog's settings.
QString getHexHsv (ScColor c)
 Get a hhssvv string for given ScColor.

Private Attributes

PrefsContextprefs
 Configuration structure.
ScribusDocm_Doc
 a parent doc reference


Detailed Description

GUI dialog for Color Wheel Plugin. Quite everything in this class is self explanatory (except few things ;)).

Author:
Petr Vanek <petr@scribus.info>
Date:
April 2005

Definition at line 30 of file cwdialog.h.


Constructor & Destructor Documentation

CWDialog::CWDialog ( QWidget *  parent = 0,
ScribusDoc doc = 0,
const char *  name = 0,
bool  modal = FALSE,
Qt::WFlags  fl = 0 
)

CWDialog::~CWDialog (  ) 

Definition at line 114 of file cwdialog.cpp.

References prefs, and PrefsContext::set().


Member Function Documentation

void CWDialog::setPreview (  )  [private]

Draws a strange colorful things as preview of the color schema. User can see what will see a person with selected kind of color blindness.

Definition at line 249 of file cwdialog.cpp.

References computeDefect(), ScColorEngine::getDisplayColor(), m_Doc, and p.

Referenced by defectCombo_activated(), and processColors().

QColor CWDialog::computeDefect ( QColor  c  )  [private]

Main color manipulator for preview. It calls transformations for the other vision defects filters.

Parameters:
c input color. QColor from sample list.
Return values:
QColor It returns c for chosen defect filter.

Definition at line 283 of file cwdialog.cpp.

References VisionDefectColor::convertDefect(), VisionDefectColor::deficiency, VisionDefectColor::getColor(), and VisionDefectColor::normalVision.

Referenced by setPreview().

void CWDialog::fillColorList (  )  [private]

It fills colors into list view. It takes colors from ColorWheel widget.

Definition at line 294 of file cwdialog.cpp.

References ColorListBox::fancyPixmap.

Referenced by processColors().

void CWDialog::setupColorComponents (  )  [private]

Set the spins with its color component value. It fills recomputed components regarding chosen color model and the changed channel. E.g. if user change R in RGB palette all CMYK channels are recomputed calling setupCMYKComponent().

Definition at line 445 of file cwdialog.cpp.

References colorModelCMYK, colorModelRGB, ScColorEngine::convertToModel(), ScColor::fromQColor(), m_Doc, ScribusDoc::PageColors, processColors(), setupCMYKComponent(), setupHSVComponent(), setupRGBComponent(), tr(), and updateNamedLabels().

Referenced by bSpin_valueChanged(), cSpin_valueChanged(), documentColorList_currentChanged(), gSpin_valueChanged(), hSpin_valueChanged(), kSpin_valueChanged(), mSpin_valueChanged(), rSpin_valueChanged(), sSpin_valueChanged(), vSpin_valueChanged(), and ySpin_valueChanged().

void CWDialog::setupRGBComponent ( ScColor  col  )  [private]

A GUI setter for all components when is one of CMYK changed.

Definition at line 410 of file cwdialog.cpp.

References RGBColor::b, connectSlots(), RGBColor::g, ScColorEngine::getRGBValues(), m_Doc, and RGBColor::r.

Referenced by processColors(), and setupColorComponents().

void CWDialog::setupCMYKComponent ( ScColor  col  )  [private]

A GUI setter for all components when is one of RGB changed.

Definition at line 421 of file cwdialog.cpp.

References CMYKColor::c, connectSlots(), ScColorEngine::getCMYKValues(), CMYKColor::k, CMYKColor::m, m_Doc, and CMYKColor::y.

Referenced by processColors(), and setupColorComponents().

void CWDialog::setupHSVComponent ( ScColor  col  )  [private]

A GUI setter for all components when is one of HSV changed. It uses a dummy QColor->ScColor conversion.

Definition at line 433 of file cwdialog.cpp.

References connectSlots(), ScColorEngine::getRGBColor(), and m_Doc.

Referenced by processColors(), and setupColorComponents().

void CWDialog::updateNamedLabels (  )  [private]

Set named colors for labels.

Definition at line 493 of file cwdialog.cpp.

References getHexHsv(), and m_Doc.

Referenced by processColors(), and setupColorComponents().

void CWDialog::connectSlots ( bool  conn = true  )  [private]

Connect or disconnect rgbcmyk spinboxes signals.

Parameters:
conn if true perform connect. Disconnect in the case of false

Definition at line 131 of file cwdialog.cpp.

References bSpin_valueChanged(), cSpin_valueChanged(), gSpin_valueChanged(), hSpin_valueChanged(), kSpin_valueChanged(), mSpin_valueChanged(), rSpin_valueChanged(), sSpin_valueChanged(), vSpin_valueChanged(), and ySpin_valueChanged().

Referenced by CWDialog(), setupCMYKComponent(), setupHSVComponent(), and setupRGBComponent().

void CWDialog::processColors ( int  index,
bool  updateSpins = true 
) [private]

Call main color calculation. It calls a ColorWheel methods to get requested harmonious colors depending on the dialog's settings.

Parameters:
index an index of the typeCombo (Color Scheme Method)
updateSpins if true call setupCMYKComponent() and setupRGBComponent() methods. if false don't reset any of these component spins - it's used for colorWheel mouse clicked/released events.

Definition at line 194 of file cwdialog.cpp.

References colorList_currentChanged(), fillColorList(), setPreview(), setupCMYKComponent(), setupHSVComponent(), setupRGBComponent(), and updateNamedLabels().

Referenced by angleSpin_valueChanged(), colorspaceTab_currentChanged(), colorWheel_clicked(), setupColorComponents(), and typeCombo_activated().

QString CWDialog::getHexHsv ( ScColor  c  )  [private]

Get a hhssvv string for given ScColor.

Definition at line 554 of file cwdialog.cpp.

References ScColorEngine::getRGBColor(), and m_Doc.

Referenced by colorList_currentChanged(), and updateNamedLabels().

void CWDialog::colorspaceTab_currentChanged ( int  index  )  [private, slot]

Definition at line 170 of file cwdialog.cpp.

References colorModelCMYK, colorModelRGB, documentColorList_currentChanged(), and processColors().

Referenced by CWDialog().

void CWDialog::angleSpin_valueChanged ( int  value  )  [private, slot]

Definition at line 243 of file cwdialog.cpp.

References processColors().

Referenced by CWDialog().

void CWDialog::colorWheel_clicked ( int  ,
const QPoint &   
) [private, slot]

Definition at line 238 of file cwdialog.cpp.

References processColors().

Referenced by CWDialog().

void CWDialog::typeCombo_activated ( int  index  )  [private, slot]

Definition at line 189 of file cwdialog.cpp.

References processColors().

Referenced by CWDialog().

void CWDialog::documentColorList_currentChanged ( QListWidgetItem *  item  )  [private, slot]

Definition at line 161 of file cwdialog.cpp.

References m_Doc, ScribusDoc::PageColors, and setupColorComponents().

Referenced by colorspaceTab_currentChanged(), and CWDialog().

void CWDialog::defectCombo_activated ( int   )  [private, slot]

Definition at line 312 of file cwdialog.cpp.

References setPreview().

Referenced by CWDialog().

void CWDialog::addButton_clicked (  )  [private, slot]

void CWDialog::replaceButton_clicked (  )  [private, slot]

void CWDialog::cancelButton_clicked (  )  [private, slot]

Definition at line 355 of file cwdialog.cpp.

Referenced by CWDialog().

void CWDialog::colorList_currentChanged ( QListWidgetItem *  item  )  [private, slot]

void CWDialog::cSpin_valueChanged ( int   )  [private, slot]

Definition at line 360 of file cwdialog.cpp.

References setupColorComponents().

Referenced by connectSlots().

void CWDialog::mSpin_valueChanged ( int   )  [private, slot]

Definition at line 365 of file cwdialog.cpp.

References setupColorComponents().

Referenced by connectSlots().

void CWDialog::ySpin_valueChanged ( int   )  [private, slot]

Definition at line 370 of file cwdialog.cpp.

References setupColorComponents().

Referenced by connectSlots().

void CWDialog::kSpin_valueChanged ( int   )  [private, slot]

Definition at line 375 of file cwdialog.cpp.

References setupColorComponents().

Referenced by connectSlots().

void CWDialog::rSpin_valueChanged ( int   )  [private, slot]

Definition at line 380 of file cwdialog.cpp.

References setupColorComponents().

Referenced by connectSlots().

void CWDialog::gSpin_valueChanged ( int   )  [private, slot]

Definition at line 385 of file cwdialog.cpp.

References setupColorComponents().

Referenced by connectSlots().

void CWDialog::bSpin_valueChanged ( int   )  [private, slot]

Definition at line 390 of file cwdialog.cpp.

References setupColorComponents().

Referenced by connectSlots().

void CWDialog::hSpin_valueChanged ( int   )  [private, slot]

Definition at line 395 of file cwdialog.cpp.

References setupColorComponents().

Referenced by connectSlots().

void CWDialog::sSpin_valueChanged ( int   )  [private, slot]

Definition at line 400 of file cwdialog.cpp.

References setupColorComponents().

Referenced by connectSlots().

void CWDialog::vSpin_valueChanged ( int   )  [private, slot]

Definition at line 405 of file cwdialog.cpp.

References setupColorComponents().

Referenced by connectSlots().


Member Data Documentation

Configuration structure.

Definition at line 38 of file cwdialog.h.

Referenced by CWDialog(), and ~CWDialog().


The documentation for this class was generated from the following files:
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.