Browse Source

TQt4 port kdegraphics

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1237557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
tags/v3.5.13
tpearson 8 years ago
parent
commit
e69e8b1d09
100 changed files with 948 additions and 916 deletions
  1. 25
    25
      kamera/kcontrol/kamera.cpp
  2. 2
    1
      kamera/kcontrol/kamera.h
  3. 18
    18
      kamera/kcontrol/kameraconfigdialog.cpp
  4. 3
    2
      kamera/kcontrol/kameraconfigdialog.h
  5. 14
    14
      kamera/kcontrol/kameradevice.cpp
  6. 4
    2
      kamera/kcontrol/kameradevice.h
  7. 8
    8
      kamera/kioslave/kamera.cpp
  8. 8
    8
      kcoloredit/colorselector.cpp
  9. 2
    1
      kcoloredit/colorselector.h
  10. 2
    2
      kcoloredit/editablestreamhistory.h
  11. 8
    8
      kcoloredit/gradientselection.cpp
  12. 2
    1
      kcoloredit/gradientselection.h
  13. 1
    1
      kcoloredit/imageselection.cpp
  14. 2
    1
      kcoloredit/imageselection.h
  15. 2
    2
      kcoloredit/kcolorchooser.cpp
  16. 15
    15
      kcoloredit/kcoloredit.cpp
  17. 3
    2
      kcoloredit/kcoloredit.h
  18. 9
    9
      kcoloredit/kcoloreditdoc.cpp
  19. 4
    3
      kcoloredit/kcoloreditdoc.h
  20. 10
    10
      kcoloredit/kcoloreditview.cpp
  21. 4
    3
      kcoloredit/kcoloreditview.h
  22. 22
    22
      kcoloredit/kxycolorselector.cpp
  23. 2
    1
      kcoloredit/kxycolorselector.h
  24. 21
    21
      kcoloredit/kzcolorselector.cpp
  25. 2
    1
      kcoloredit/kzcolorselector.h
  26. 3
    3
      kcoloredit/loadpalettedlg.cpp
  27. 2
    1
      kcoloredit/loadpalettedlg.h
  28. 4
    4
      kcoloredit/palette.cpp
  29. 3
    3
      kcoloredit/paletteview.cpp
  30. 3
    2
      kcoloredit/paletteview.h
  31. 12
    12
      kcoloredit/paletteviewscrolledarea.cpp
  32. 5
    4
      kcoloredit/paletteviewscrolledarea.h
  33. 5
    5
      kcoloredit/texteditselection.cpp
  34. 3
    2
      kcoloredit/texteditselection.h
  35. 1
    1
      kcoloredit/textselection.cpp
  36. 5
    5
      kdvi/TeXFont.h
  37. 8
    8
      kdvi/TeXFontDefinition.cpp
  38. 7
    7
      kdvi/TeXFontDefinition.h
  39. 32
    32
      kdvi/TeXFont_PFB.cpp
  40. 3
    3
      kdvi/TeXFont_PFB.h
  41. 53
    53
      kdvi/TeXFont_PK.cpp
  42. 2
    2
      kdvi/TeXFont_PK.h
  43. 12
    12
      kdvi/TeXFont_TFM.cpp
  44. 5
    5
      kdvi/TeXFont_TFM.h
  45. 14
    14
      kdvi/bigEndianByteReader.cpp
  46. 8
    8
      kdvi/bigEndianByteReader.h
  47. 22
    22
      kdvi/dviFile.cpp
  48. 14
    14
      kdvi/dviFile.h
  49. 1
    0
      kdvi/dviPageCache.h
  50. 55
    55
      kdvi/dviRenderer.cpp
  51. 14
    13
      kdvi/dviRenderer.h
  52. 13
    13
      kdvi/dviRenderer_draw.cpp
  53. 37
    37
      kdvi/dviRenderer_export.cpp
  54. 66
    66
      kdvi/dviRenderer_prescan.cpp
  55. 7
    7
      kdvi/dviWidget.cpp
  56. 2
    1
      kdvi/dviWidget.h
  57. 2
    2
      kdvi/dvisourcesplitter.cpp
  58. 2
    2
      kdvi/dvisourcesplitter.h
  59. BIN
      kdvi/examples/dvistd0.dvi
  60. 2
    2
      kdvi/fontEncoding.cpp
  61. 2
    2
      kdvi/fontEncoding.h
  62. 1
    1
      kdvi/fontEncodingPool.cpp
  63. 11
    11
      kdvi/fontMap.cpp
  64. 5
    5
      kdvi/fontMap.h
  65. 41
    41
      kdvi/fontpool.cpp
  66. 6
    5
      kdvi/fontpool.h
  67. 7
    7
      kdvi/fontprogress.cpp
  68. 3
    2
      kdvi/fontprogress.h
  69. 3
    3
      kdvi/glyph.h
  70. 16
    16
      kdvi/infodialog.cpp
  71. 2
    1
      kdvi/infodialog.h
  72. 13
    13
      kdvi/kdvi_multipage.cpp
  73. 2
    1
      kdvi/kdvi_multipage.h
  74. 3
    3
      kdvi/main.cpp
  75. 3
    3
      kdvi/optionDialogFontsWidget.cpp
  76. 2
    1
      kdvi/optionDialogFontsWidget.h
  77. 7
    7
      kdvi/optionDialogFontsWidget_base.ui
  78. 3
    3
      kdvi/optionDialogSpecialWidget.cpp
  79. 2
    1
      kdvi/optionDialogSpecialWidget.h
  80. 10
    10
      kdvi/optionDialogSpecialWidget_base.ui
  81. 3
    3
      kdvi/prebookmark.h
  82. 33
    33
      kdvi/psgs.cpp
  83. 2
    1
      kdvi/psgs.h
  84. 3
    3
      kdvi/psheader.txt
  85. 1
    0
      kdvi/renderedDviPagePixmap.h
  86. 30
    30
      kdvi/special.cpp
  87. 8
    8
      kdvi/vf.cpp
  88. 7
    7
      kfax/faxinput.cpp
  89. 58
    58
      kfax/kfax.cpp
  90. 3
    2
      kfax/kfax.h
  91. 2
    2
      kfax/kfax_printsettings.cpp
  92. 5
    4
      kfax/kfax_printsettings.h
  93. 9
    9
      kfax/options.cpp
  94. 4
    3
      kfax/options.h
  95. 2
    2
      kfaxview/faxmultipage.cpp
  96. 2
    1
      kfaxview/faxmultipage.h
  97. 10
    10
      kfaxview/faxrenderer.cpp
  98. 2
    1
      kfaxview/faxrenderer.h
  99. 2
    2
      kfaxview/libkfaximage/faxexpand.h
  100. 0
    0
      kfaxview/libkfaximage/kfaximage.cpp

+ 25
- 25
kamera/kcontrol/kamera.cpp View File

@@ -48,8 +48,8 @@ K_EXPORT_COMPONENT_FACTORY( kcm_kamera, KKameraConfigFactory( "kcmkamera" ) )

KKameraConfig *KKameraConfig::m_instance = NULL;

KKameraConfig::KKameraConfig(TQWidget *parent, const char *name, const TQStringList &)
: KCModule(KKameraConfigFactory::instance(), parent, name)
KKameraConfig::KKameraConfig(TQWidget *tqparent, const char *name, const TQStringList &)
: KCModule(KKameraConfigFactory::instance(), tqparent, name)
{
m_devicePopup = new KPopupMenu(this);
m_actions = new KActionCollection(this);
@@ -96,7 +96,7 @@ void KKameraConfig::displayGPSuccessDialogue(void)
// set the kcontrol module buttons
setButtons(Help | Apply | Cancel | Ok);

// create a layout with two vertical boxes
// create a tqlayout with two vertical boxes
TQVBoxLayout *topLayout = new TQVBoxLayout(this, 0, 0);
topLayout->setAutoAdd(true);
@@ -113,29 +113,29 @@ void KKameraConfig::displayGPSuccessDialogue(void)
connect(m_deviceSel, TQT_SIGNAL(selectionChanged(TQIconViewItem *)),
TQT_SLOT(slot_deviceSelected(TQIconViewItem *)));

m_deviceSel->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding));
m_deviceSel->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding));
// create actions
KAction *act;
act = new KAction(i18n("Add"), "camera", 0, this, TQT_SLOT(slot_addCamera()), m_actions, "camera_add");
act = new KAction(i18n("Add"), "camera", 0, TQT_TQOBJECT(this), TQT_SLOT(slot_addCamera()), m_actions, "camera_add");
act->setWhatsThis(i18n("Click this button to add a new camera."));
act->plug(m_toolbar);
m_toolbar->insertLineSeparator();
act = new KAction(i18n("Test"), "camera_test", 0, this, TQT_SLOT(slot_testCamera()), m_actions, "camera_test");
act = new KAction(i18n("Test"), "camera_test", 0, TQT_TQOBJECT(this), TQT_SLOT(slot_testCamera()), m_actions, "camera_test");
act->setWhatsThis(i18n("Click this button to remove the selected camera from the list."));
act->plug(m_toolbar);
act = new KAction(i18n("Remove"), "edittrash", 0, this, TQT_SLOT(slot_removeCamera()), m_actions, "camera_remove");
act = new KAction(i18n("Remove"), "edittrash", 0, TQT_TQOBJECT(this), TQT_SLOT(slot_removeCamera()), m_actions, "camera_remove");
act->setWhatsThis(i18n("Click this button to remove the selected camera from the list."));
act->plug(m_toolbar);
act = new KAction(i18n("Configure..."), "configure", 0, this, TQT_SLOT(slot_configureCamera()), m_actions, "camera_configure");
act = new KAction(i18n("Configure..."), "configure", 0, TQT_TQOBJECT(this), TQT_SLOT(slot_configureCamera()), m_actions, "camera_configure");
act->setWhatsThis(i18n("Click this button to change the configuration of the selected camera.<br><br>The availability of this feature and the contents of the Configuration dialog depend on the camera model."));
act->plug(m_toolbar);
act = new KAction(i18n("Information"), "hwinfo", 0, this, TQT_SLOT(slot_cameraSummary()), m_actions, "camera_summary");
act = new KAction(i18n("Information"), "hwinfo", 0, TQT_TQOBJECT(this), TQT_SLOT(slot_cameraSummary()), m_actions, "camera_summary");
act->setWhatsThis(i18n("Click this button to view a summary of the current status of the selected camera.<br><br>The availability of this feature and the contents of the Configuration dialog depend on the camera model."));
act->plug(m_toolbar);
m_toolbar->insertLineSeparator();
act = new KAction(i18n("Cancel"), "stop", 0, this, TQT_SLOT(slot_cancelOperation()), m_actions, "camera_cancel");
act = new KAction(i18n("Cancel"), "stop", 0, TQT_TQOBJECT(this), TQT_SLOT(slot_cancelOperation()), m_actions, "camera_cancel");
act->setWhatsThis(i18n("Click this button to cancel the current camera operation."));
act->setEnabled(false);
act->plug(m_toolbar);
@@ -184,7 +184,7 @@ void KKameraConfig::load(bool useDefaults )
for (it = groupList.begin(); it != groupList.end(); it++) {
if (*it != "<default>") {
m_config->setGroup(*it);
if (m_config->readEntry("Path").contains("usb:"))
if (m_config->readEntry("Path").tqcontains("usb:"))
continue;

kcamera = new KCamera(*it,m_config->readEntry("Path"));
@@ -218,7 +218,7 @@ void KKameraConfig::load(bool useDefaults )
if (!strcmp(value,"usb:"))
names[model] = value;
}
if (ports.contains("usb:") && names[ports["usb:"]]!="usb:")
if (ports.tqcontains("usb:") && names[ports["usb:"]]!="usb:")
ports.remove("usb:");

TQMap<TQString,TQString>::iterator portit;
@@ -256,7 +256,7 @@ void KKameraConfig::afterCameraOperation(void)

// if we're regaining control after a Cancel...
if (m_cancelPending) {
qApp->restoreOverrideCursor();
tqApp->restoreOverrideCursor();
m_cancelPending = false;
}
@@ -268,23 +268,23 @@ void KKameraConfig::afterCameraOperation(void)
TQString KKameraConfig::suggestName(const TQString &name)
{
TQString new_name = name;
new_name.replace("/", ""); // we cannot have a slash in a URI's host
new_name.tqreplace("/", ""); // we cannot have a slash in a URI's host

if (!m_devices.contains(new_name)) return new_name;
if (!m_devices.tqcontains(new_name)) return new_name;
// try new names with a number appended until we find a free one
int i = 1;
while (i++ < 0xffff) {
new_name = name + " (" + TQString::number(i) + ")";
if (!m_devices.contains(new_name)) return new_name;
if (!m_devices.tqcontains(new_name)) return new_name;
}

return TQString::null;
return TQString();
}

void KKameraConfig::slot_addCamera()
{
KCamera *m_device = new KCamera(TQString::null,TQString::null);
KCamera *m_device = new KCamera(TQString(),TQString());
connect(m_device, TQT_SIGNAL(error(const TQString &)), TQT_SLOT(slot_error(const TQString &)));
connect(m_device, TQT_SIGNAL(error(const TQString &, const TQString &)), TQT_SLOT(slot_error(const TQString &, const TQString &)));
KameraDeviceSelectDialog dialog(this, m_device);
@@ -302,7 +302,7 @@ void KKameraConfig::slot_addCamera()
void KKameraConfig::slot_removeCamera()
{
TQString name = m_deviceSel->currentItem()->text();
if (m_devices.contains(name)) {
if (m_devices.tqcontains(name)) {
KCamera *m_device = m_devices[name];
m_devices.remove(name);
delete m_device;
@@ -317,7 +317,7 @@ void KKameraConfig::slot_testCamera()
beforeCameraOperation();

TQString name = m_deviceSel->currentItem()->text();
if (m_devices.contains(name)) {
if (m_devices.tqcontains(name)) {
KCamera *m_device = m_devices[name];
if (m_device->test())
KMessageBox::information(this, i18n("Camera test was successful."));
@@ -329,7 +329,7 @@ void KKameraConfig::slot_testCamera()
void KKameraConfig::slot_configureCamera()
{
TQString name = m_deviceSel->currentItem()->text();
if (m_devices.contains(name)) {
if (m_devices.tqcontains(name)) {
KCamera *m_device = m_devices[name];
m_device->configure();
}
@@ -339,7 +339,7 @@ void KKameraConfig::slot_cameraSummary()
{
TQString summary;
TQString name = m_deviceSel->currentItem()->text();
if (m_devices.contains(name)) {
if (m_devices.tqcontains(name)) {
KCamera *m_device = m_devices[name];
summary = m_device->summary();
if (!summary.isNull()) {
@@ -354,7 +354,7 @@ void KKameraConfig::slot_cancelOperation()
// Prevent the user from keeping clicking Cancel
m_actions->action("camera_cancel")->setEnabled(false);
// and indicate that the click on Cancel did have some effect
qApp->setOverrideCursor(Qt::WaitCursor);
tqApp->setOverrideCursor(TQt::WaitCursor);
}

void KKameraConfig::slot_deviceMenu(TQIconViewItem *item, const TQPoint &point)
@@ -381,7 +381,7 @@ void KKameraConfig::cbGPIdle(GPContext * /*context*/, void * /*data*/)
{
/*KKameraConfig *self( reinterpret_cast<KKameraConfig*>(data) );*/

qApp->processEvents();
tqApp->processEvents();
}

GPContextFeedback KKameraConfig::cbGPCancel(GPContext * /*context*/, void *data)
@@ -390,7 +390,7 @@ GPContextFeedback KKameraConfig::cbGPCancel(GPContext * /*context*/, void *data)

// Since in practice no camera driver supports idle callbacks yet,
// we'll use the cancel callback as opportunity to process events
qApp->processEvents();
tqApp->processEvents();

// If a cancel request is pending, ask gphoto to cancel
if (self->m_cancelPending)

+ 2
- 1
kamera/kcontrol/kamera.h View File

@@ -47,10 +47,11 @@ class KPopupMenu;
class KKameraConfig : public KCModule
{
Q_OBJECT
TQ_OBJECT
friend class KameraDeviceSelectDialog;

public:
KKameraConfig(TQWidget *parent, const char *name, const TQStringList &);
KKameraConfig(TQWidget *tqparent, const char *name, const TQStringList &);
virtual ~KKameraConfig();

// KCModule interface methods

+ 18
- 18
kamera/kcontrol/kameraconfigdialog.cpp View File

@@ -42,9 +42,9 @@

KameraConfigDialog::KameraConfigDialog(Camera */*camera*/,
CameraWidget *widget,
TQWidget *parent,
TQWidget *tqparent,
const char *name) :
KDialogBase(parent, name, true, TQString::null, Ok|Cancel, Ok ),
KDialogBase(tqparent, name, true, TQString(), Ok|Cancel, Ok ),
m_widgetRoot(widget)
{
TQFrame *main = makeMainWidget();
@@ -56,9 +56,9 @@ m_widgetRoot(widget)
appendWidget(main, widget);
}

void KameraConfigDialog::appendWidget(TQWidget *parent, CameraWidget *widget)
void KameraConfigDialog::appendWidget(TQWidget *tqparent, CameraWidget *widget)
{
TQWidget *newParent = parent;
TQWidget *newParent = tqparent;
CameraWidgetType widget_type;
const char *widget_name;
@@ -74,7 +74,7 @@ void KameraConfigDialog::appendWidget(TQWidget *parent, CameraWidget *widget)
TQString whats_this = TQString::fromLocal8Bit(widget_info); // gphoto2 doesn't seem to have any standard for i18n

// Add this widget to parent
// Add this widget to tqparent
switch(widget_type) {
case GP_WIDGET_WINDOW:
{
@@ -85,7 +85,7 @@ void KameraConfigDialog::appendWidget(TQWidget *parent, CameraWidget *widget)
case GP_WIDGET_SECTION:
{
if (!m_tabWidget)
m_tabWidget = new TQTabWidget(parent);
m_tabWidget = new TQTabWidget(tqparent);
TQWidget *tab = new TQWidget(m_tabWidget);
// widgets are to be aligned vertically in the tab
TQVBoxLayout *tabLayout = new TQVBoxLayout(tab, marginHint(),
@@ -104,7 +104,7 @@ void KameraConfigDialog::appendWidget(TQWidget *parent, CameraWidget *widget)
{
gp_widget_get_value(widget, &widget_value_string);

TQGrid *grid = new TQGrid(2, Horizontal, parent);
TQGrid *grid = new TQGrid(2,Qt::Horizontal, tqparent);
grid->setSpacing(spacingHint());
new TQLabel(TQString::fromLocal8Bit( widget_label )+":", grid);
TQLineEdit *lineEdit = new TQLineEdit(widget_value_string, grid);
@@ -123,13 +123,13 @@ void KameraConfigDialog::appendWidget(TQWidget *parent, CameraWidget *widget)
gp_widget_get_range(widget, &widget_low, &widget_high, &widget_increment);
gp_widget_get_value(widget, &widget_value_float);
TQGroupBox *groupBox = new TQVGroupBox(widget_label, parent);
TQGroupBox *groupBox = new TQVGroupBox(widget_label, tqparent);
TQSlider *slider = new TQSlider(
( int )widget_low,
( int )widget_high,
( int )widget_increment,
( int )widget_value_float,
TQSlider::Horizontal,
Qt::Horizontal,
groupBox );
m_wmap.insert(widget, slider);
@@ -142,7 +142,7 @@ void KameraConfigDialog::appendWidget(TQWidget *parent, CameraWidget *widget)
{
gp_widget_get_value(widget, &widget_value_int);
TQCheckBox *checkBox = new TQCheckBox(widget_label, parent);
TQCheckBox *checkBox = new TQCheckBox(widget_label, tqparent);
checkBox->setChecked(widget_value_int);
m_wmap.insert(widget, checkBox);

@@ -160,9 +160,9 @@ void KameraConfigDialog::appendWidget(TQWidget *parent, CameraWidget *widget)
// for less than 5 options, align them horizontally
TQButtonGroup *buttonGroup;
if (count > 4)
buttonGroup = new TQVButtonGroup(widget_label, parent);
buttonGroup = new TQVButtonGroup(widget_label, tqparent);
else
buttonGroup = new TQHButtonGroup(widget_label, parent);
buttonGroup = new TQHButtonGroup(widget_label, tqparent);
for(int i = 0; i < count; ++i) {
const char *widget_choice;
@@ -183,7 +183,7 @@ void KameraConfigDialog::appendWidget(TQWidget *parent, CameraWidget *widget)
{
gp_widget_get_value(widget, &widget_value_string);
TQComboBox *comboBox = new TQComboBox(FALSE, parent);
TQComboBox *comboBox = new TQComboBox(FALSE, tqparent);
comboBox->clear();
for(int i = 0; i < gp_widget_count_choices(widget); ++i) {
const char *widget_choice;
@@ -206,14 +206,14 @@ void KameraConfigDialog::appendWidget(TQWidget *parent, CameraWidget *widget)
// I can't see a way of implementing this. Since there is
// no way of telling which button sent you a signal, we
// can't map to the appropriate widget->callback
new TQLabel(i18n("Button (not supported by KControl)"), parent);
new TQLabel(i18n("Button (not supported by KControl)"), tqparent);
break;
}
case GP_WIDGET_DATE:
{
// TODO
new TQLabel(i18n("Date (not supported by KControl)"), parent);
new TQLabel(i18n("Date (not supported by KControl)"), tqparent);

break;
}
@@ -221,14 +221,14 @@ void KameraConfigDialog::appendWidget(TQWidget *parent, CameraWidget *widget)
return;
}

// Append all this widgets children
// Append all this widgets tqchildren
for(int i = 0; i < gp_widget_count_children(widget); ++i) {
CameraWidget *widget_child;
gp_widget_get_child(widget, i, &widget_child);
appendWidget(newParent, widget_child);
}
// Things that must be done after all children were added
// Things that must be done after all tqchildren were added
/*
switch (widget_type) {
case GP_WIDGET_SECTION:
@@ -309,7 +309,7 @@ void KameraConfigDialog::updateWidgetValue(CameraWidget *widget)

void KameraConfigDialog::slotOk()
{
// Copy Qt widget values into CameraWidget hierarchy
// Copy TQt widget values into CameraWidget hierarchy
updateWidgetValue(m_widgetRoot);

// 'ok' dialog

+ 3
- 2
kamera/kcontrol/kameraconfigdialog.h View File

@@ -34,15 +34,16 @@ extern "C" {
class KameraConfigDialog : public KDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
KameraConfigDialog(Camera *camera, CameraWidget *widget,
TQWidget *parent = 0, const char *name = 0);
TQWidget *tqparent = 0, const char *name = 0);

private slots:
void slotOk();

private:
void appendWidget(TQWidget *parent, CameraWidget *widget);
void appendWidget(TQWidget *tqparent, CameraWidget *widget);
void updateWidgetValue(CameraWidget *widget);
TQMap<CameraWidget *, TQWidget *> m_wmap;

+ 14
- 14
kamera/kcontrol/kameradevice.cpp View File

@@ -86,7 +86,7 @@ bool KCamera::initInformation()
int index = gp_abilities_list_lookup_model(m_abilitylist, m_model.local8Bit().data());
if(index < 0) {
emit error(i18n("Description of abilities for camera %1 is not available."
" Configuration options may be incorrect.").arg(m_model));
" Configuration options may be incorrect.").tqarg(m_model));
return false;
}
gp_abilities_list_get_abilities(m_abilitylist, index, &m_abilities);
@@ -197,7 +197,7 @@ void KCamera::load(KConfig *config)
m_model = config->readEntry("Model");
if (m_path.isNull())
m_path = config->readEntry("Path");
invalidateCamera();
tqinvalidateCamera();
}

void KCamera::save(KConfig *config)
@@ -209,7 +209,7 @@ void KCamera::save(KConfig *config)

TQString KCamera::portName()
{
TQString port = m_path.left(m_path.find(":")).lower();
TQString port = m_path.left(m_path.tqfind(":")).lower();
if (port == "serial") return i18n("Serial");
if (port == "usb") return i18n("USB");
return i18n("Unknown port");
@@ -223,17 +223,17 @@ void KCamera::setName(const TQString &name)
void KCamera::setModel(const TQString &model)
{
m_model = model;
invalidateCamera();
tqinvalidateCamera();
initInformation();
}

void KCamera::setPath(const TQString &path)
{
m_path = path;
invalidateCamera();
tqinvalidateCamera();
}

void KCamera::invalidateCamera()
void KCamera::tqinvalidateCamera()
{
if (m_camera) {
gp_camera_free(m_camera);
@@ -270,8 +270,8 @@ CameraAbilities KCamera::abilities()

// ---------- KameraSelectCamera ------------

KameraDeviceSelectDialog::KameraDeviceSelectDialog(TQWidget *parent, KCamera *device)
: KDialogBase(parent, "kkameradeviceselect", true, i18n("Select Camera Device"), Ok | Cancel, Ok, true)
KameraDeviceSelectDialog::KameraDeviceSelectDialog(TQWidget *tqparent, KCamera *device)
: KDialogBase(tqparent, "kkameradeviceselect", true, i18n("Select Camera Device"), Ok | Cancel, Ok, true)
{
m_device = device;
connect(m_device, TQT_SIGNAL(error(const TQString &)),
@@ -282,7 +282,7 @@ KameraDeviceSelectDialog::KameraDeviceSelectDialog(TQWidget *parent, KCamera *de
TQWidget *page = new TQWidget( this );
setMainWidget(page);

// a layout with vertical boxes
// a tqlayout with vertical boxes
TQHBoxLayout *topLayout = new TQHBoxLayout(page, 0, KDialog::spacingHint());

// the models list
@@ -293,7 +293,7 @@ KameraDeviceSelectDialog::KameraDeviceSelectDialog(TQWidget *parent, KCamera *de
connect(m_modelSel, TQT_SIGNAL(selectionChanged(TQListViewItem *)),
TQT_SLOT(slot_setModel(TQListViewItem *)));
// make sure listview only as wide as it needs to be
m_modelSel->setSizePolicy(TQSizePolicy(TQSizePolicy::Maximum,
m_modelSel->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Maximum,
TQSizePolicy::Preferred));

TQVBoxLayout *rightLayout = new TQVBoxLayout(0L, 0, KDialog::spacingHint());
@@ -347,7 +347,7 @@ KameraDeviceSelectDialog::KameraDeviceSelectDialog(TQWidget *parent, KCamera *de
for (int i = 0; i < gphoto_ports; i++) {
if (gp_port_info_list_get_info(list, i, &info) >= 0) {
if (strncmp(info.path, "serial:", 7) == 0)
m_serialPortCombo->insertItem(TQString::fromLatin1(info.path).mid(7));
m_serialPortCombo->insertItem(TQString::tqfromLatin1(info.path).mid(7));
}
}
gp_port_info_list_free(list);
@@ -403,7 +403,7 @@ void KameraDeviceSelectDialog::save()
void KameraDeviceSelectDialog::load()
{
TQString path = m_device->path();
TQString port = path.left(path.find(":")).lower();
TQString port = path.left(path.tqfind(":")).lower();

if (port == "serial") setPortType(INDEX_SERIAL);
if (port == "usb") setPortType(INDEX_USB);
@@ -432,7 +432,7 @@ void KameraDeviceSelectDialog::slot_setModel(TQListViewItem *item)
int index = gp_abilities_list_lookup_model(m_device->m_abilitylist, model.local8Bit().data());
if(index < 0) {
slot_error(i18n("Description of abilities for camera %1 is not available."
" Configuration options may be incorrect.").arg(model));
" Configuration options may be incorrect.").tqarg(model));
}
int result = gp_abilities_list_get_abilities(m_device->m_abilitylist, index, &abilities);
if (result == GP_OK) {
@@ -452,7 +452,7 @@ void KameraDeviceSelectDialog::slot_setModel(TQListViewItem *item)
setPortType(INDEX_USB);
} else {
slot_error(i18n("Description of abilities for camera %1 is not available."
" Configuration options may be incorrect.").arg(model));
" Configuration options may be incorrect.").tqarg(model));
}
}


+ 4
- 2
kamera/kcontrol/kameradevice.h View File

@@ -40,10 +40,11 @@ class TQRadioButton;
class KCamera : public TQObject {
friend class KameraDeviceSelectDialog;
Q_OBJECT
TQ_OBJECT
public:
KCamera(const TQString &name, const TQString &path);
~KCamera();
void invalidateCamera();
void tqinvalidateCamera();
bool configure();
void load(KConfig *m_config);
void save(KConfig *m_config);
@@ -88,8 +89,9 @@ protected:
class KameraDeviceSelectDialog : public KDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
KameraDeviceSelectDialog(TQWidget *parent, KCamera *device);
KameraDeviceSelectDialog(TQWidget *tqparent, KCamera *device);
void save();
void load();
protected slots:

+ 8
- 8
kamera/kioslave/kamera.cpp View File

@@ -55,7 +55,7 @@ extern "C"
{
KDE_EXPORT int kdemain(int argc, char **argv);

static void frontendCameraStatus(GPContext *context, const char *format, va_list args, void *data);
static void frontendCameratqStatus(GPContext *context, const char *format, va_list args, void *data);
static unsigned int frontendProgressStart(
GPContext *context, float totalsize, const char *format,
va_list args, void *data
@@ -242,7 +242,7 @@ void KameraProtocol::get(const KURL &url)

#undef GPHOTO_TEXT_FILE
// emit info message
infoMessage( i18n("Retrieving data from camera <b>%1</b>").arg(url.user()) );
infoMessage( i18n("Retrieving data from camera <b>%1</b>").tqarg(url.user()) );

// Note: There's no need to re-read directory for each get() anymore
gp_file_new(&m_file);
@@ -574,7 +574,7 @@ void KameraProtocol::listDir(const KURL &url)
gp_list_free (list);

/* Avoid duplicated entry for usb: and usb:001,042 entries. */
if (ports.contains("usb:") && names[ports["usb:"]]!="usb:")
if (ports.tqcontains("usb:") && names[ports["usb:"]]!="usb:")
ports.remove("usb:");

for (it = groupList.begin(); it != groupList.end(); it++) {
@@ -606,7 +606,7 @@ void KameraProtocol::listDir(const KURL &url)
xurl.setProtocol("camera");
xurl.setUser(*it);
/* Avoid setting usb:xxx,yyy. */
if (m_cfgPath.contains("usb:")>0) {
if (m_cfgPath.tqcontains("usb:")>0) {
names[*it] = "usb:";
xurl.setHost("usb:");
} else {
@@ -795,7 +795,7 @@ void KameraProtocol::setHost(const TQString& host, int port, const TQString& use
}

// register gphoto2 callback functions
gp_context_set_status_func(m_context, frontendCameraStatus, this);
gp_context_set_status_func(m_context, frontendCameratqStatus, this);
gp_context_set_progress_funcs(m_context, frontendProgressStart, frontendProgressUpdate, NULL, this);
// gp_camera_set_message_func(m_camera, ..., this)

@@ -881,7 +881,7 @@ void KameraProtocol::translateFileToUDS(UDSEntry &udsEntry, const CameraFileInfo

if (info.file.fields & GP_FILE_INFO_TYPE) {
atom.m_uds = UDS_MIME_TYPE;
atom.m_str = TQString::fromLatin1(info.file.type);
atom.m_str = TQString::tqfromLatin1(info.file.type);
udsEntry.append(atom);
}

@@ -890,7 +890,7 @@ void KameraProtocol::translateFileToUDS(UDSEntry &udsEntry, const CameraFileInfo
atom.m_long = 0;
atom.m_long |= (info.file.permissions & GP_FILE_PERM_READ) ? (S_IRUSR | S_IRGRP | S_IROTH) : 0;
// we cannot represent individual FP_FILE_PERM_DELETE permission in the Unix access scheme
// since the parent directory's write permission defines that
// since the tqparent directory's write permission defines that
udsEntry.append(atom);
} else {
// basic permissions, in case the camera doesn't provide permissions info
@@ -1028,7 +1028,7 @@ unsigned int frontendProgressStart(
}

// this callback function is activated on every status message from gphoto2
static void frontendCameraStatus(GPContext * /*context*/, const char *format, va_list args, void *data)
static void frontendCameratqStatus(GPContext * /*context*/, const char *format, va_list args, void *data)
{
KameraProtocol *object = (KameraProtocol*)data;
char *status;

+ 8
- 8
kcoloredit/colorselector.cpp View File

@@ -30,7 +30,7 @@
#include "texteditselection.h"
#include "colorselector.h"

ColorSelector::ColorSelector(TQWidget *parent, const char *name ) : TQWidget(parent, name) {
ColorSelector::ColorSelector(TQWidget *tqparent, const char *name ) : TQWidget(tqparent, name) {
fComponentsMode = false;
TQVBoxLayout* topLayout = new TQVBoxLayout(this, 4);
/*
@@ -53,7 +53,7 @@ ColorSelector::ColorSelector(TQWidget *parent, const char *name ) : TQWidget(par
topLayout->addWidget(gradientSelection, 10);
KSeparator* hLine = new KSeparator(KSeparator::HLine, this);
topLayout->addWidget(hLine);
TQHBoxLayout* layout = new TQHBoxLayout();
TQHBoxLayout* tqlayout = new TQHBoxLayout();
TextEditSelection* textEditSelection = new TextEditSelection(this);
connect(textEditSelection, TQT_SIGNAL( valueChanged(Color*) ), TQT_SLOT( slotSetColor(Color*) ));
connect(this, TQT_SIGNAL( valueChanged(Color*) ), textEditSelection, TQT_SLOT( slotSetValue(Color*) ));
@@ -73,7 +73,7 @@ ColorSelector::ColorSelector(TQWidget *parent, const char *name ) : TQWidget(par
TQVBoxLayout* colorChangeSliderLayout = new TQVBoxLayout(colorChangeSliderWidget, 1);
colorChangeSliderLayout->setMargin(0);
TQSlider* colorChangeSlider = new TQSlider(0, MAX_COLOR_CHANGE_VALUE,
MAX_COLOR_CHANGE_VALUE/4, colorChangeValue, TQSlider::Horizontal, colorChangeSliderWidget);
MAX_COLOR_CHANGE_VALUE/4, colorChangeValue, Qt::Horizontal, colorChangeSliderWidget);
colorChangeSlider->setTickInterval(colorChangeSlider->pageStep());
colorChangeSlider->setTickmarks(TQSlider::Above);
connect(colorChangeSlider, TQT_SIGNAL( valueChanged(int) ), TQT_SLOT( slotColorChangeValueChanged(int) ));
@@ -88,17 +88,17 @@ ColorSelector::ColorSelector(TQWidget *parent, const char *name ) : TQWidget(par
colorChangeLayout->addStretch(10);
colorChangeLayout->addWidget(colorChangeSliderWidget);
colorChangeLayout->addStretch(10);
layout->addLayout(colorChangeLayout, 10);
tqlayout->addLayout(colorChangeLayout, 10);
m_color.setComponents(RGB_MAX_COMPONENT_VALUE, RGB_MAX_COMPONENT_VALUE, RGB_MAX_COMPONENT_VALUE);
slotColorReplace();
KSeparator* vLine = new KSeparator(KSeparator::VLine, this);
layout->addWidget(vLine);
layout->addWidget(textEditSelection, 1);
tqlayout->addWidget(vLine);
tqlayout->addWidget(textEditSelection, 1);
colorPatch = new KColorPatch(this);
connect(colorPatch, TQT_SIGNAL( colorChanged(const TQColor&) ), TQT_SLOT( slotSetColor(const TQColor&) ));
colorPatch->setMinimumSize(80, 64);
layout->addWidget(colorPatch, 10);
topLayout->addLayout(layout);
tqlayout->addWidget(colorPatch, 10);
topLayout->addLayout(tqlayout);
}
ColorSelector::~ColorSelector() {
}

+ 2
- 1
kcoloredit/colorselector.h View File

@@ -31,10 +31,11 @@
*/
class ColorSelector : public TQWidget {
Q_OBJECT
TQ_OBJECT

public:
/** constructs a color selector widget */
ColorSelector(TQWidget *parent=0, const char *name=0);
ColorSelector(TQWidget *tqparent=0, const char *name=0);
~ColorSelector();
/** @return the selected color */
const Color& color();

+ 2
- 2
kcoloredit/editablestreamhistory.h View File

@@ -37,7 +37,7 @@ public:
/** Pastes a stream at index. Uses undo/redo history */
void paste(const int index, EDITABLE_STREAM& pasteStream);
/** Replaces a stream at index. Uses undo/redo history */
void replace(const int index, EDITABLE_STREAM& replaceStream);
void tqreplace(const int index, EDITABLE_STREAM& replaceStream);
/** @return Whether undo possible */
bool undoPossible();
/** @return Whether redo possible */
@@ -76,7 +76,7 @@ template <class EDITABLE_STREAM> void
}

template <class EDITABLE_STREAM> void
EditableStreamHistory<EDITABLE_STREAM>::replace(const int index, EDITABLE_STREAM& replaceStream) {
EditableStreamHistory<EDITABLE_STREAM>::tqreplace(const int index, EDITABLE_STREAM& replaceStream) {
m_editableStream->cut(index, replaceStream.length());
m_editableStream->paste(index, replaceStream);
}

+ 8
- 8
kcoloredit/gradientselection.cpp View File

@@ -24,15 +24,15 @@
#include "main.h"
#include "gradientselection.h"

GradientSelection::GradientSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) {
GradientSelection::GradientSelection(TQWidget *tqparent, const char *name ) : TQWidget(tqparent,name) {
TQGridLayout* topLayout = new TQGridLayout(this, 2, 2, 0);
TQHBoxLayout* layout = new TQHBoxLayout(0);
layout->setMargin(3);
TQHBoxLayout* tqlayout = new TQHBoxLayout(0);
tqlayout->setMargin(3);
xyColorSelector = new KXYColorSelector(this);
connect(xyColorSelector, TQT_SIGNAL( valueChanged(int, int) ),
TQT_SLOT( slotXyColorSelectorPosChanged(int, int) ));
layout->addWidget(xyColorSelector);
topLayout->addLayout(layout, 0, 0);
tqlayout->addWidget(xyColorSelector);
topLayout->addLayout(tqlayout, 0, 0);
topLayout->setRowStretch(0, 10);
topLayout->setRowStretch(1, 0);
TQVBoxLayout* xyColorSelectorLayout = new TQVBoxLayout();
@@ -54,7 +54,7 @@ GradientSelection::GradientSelection(TQWidget *parent, const char *name ) : TQWi
xyColorSelectorLayout->addLayout(buttonsLayout);
xyColorSelectorLayout->addSpacing(2);
topLayout->addLayout(xyColorSelectorLayout, 1, 0);
zColorSelector = new KZColorSelector(KZColorSelector::Vertical, this);
zColorSelector = new KZColorSelector(Qt::Vertical, this);
connect(zColorSelector, TQT_SIGNAL( valueChanged(int) ),
TQT_SLOT( slotZColorSelectorPosChanged(int) ));
zColorSelector->setFixedWidth(36);
@@ -218,7 +218,7 @@ void GradientSelection::slotXyColorSelectorPosChanged(int x, int y) {
}

void GradientSelection::slotZColorSelectorPosChanged(int y) {
bool repaintZColorSelector = false;
bool tqrepaintZColorSelector = false;
switch(zColorSelectorComponentIndex) {
case H_COMPONENT:
hComponent = y;
@@ -237,7 +237,7 @@ void GradientSelection::slotZColorSelectorPosChanged(int y) {
rgbColor.setHsv(hComponent, sComponent, vComponent);
color.setComponents(rgbColor.red(), rgbColor.green(), rgbColor.blue());
updateXyColorSelector(false);
if(repaintZColorSelector)
if(tqrepaintZColorSelector)
updateZColorSelector();
emit valueChanged(&color);
}

+ 2
- 1
kcoloredit/gradientselection.h View File

@@ -32,10 +32,11 @@
*/
class GradientSelection : public TQWidget {
Q_OBJECT
TQ_OBJECT

public:
/** Constructs the widget */
GradientSelection(TQWidget *parent=0, const char *name=0);
GradientSelection(TQWidget *tqparent=0, const char *name=0);
~GradientSelection();
/** Enables or disables the color synchronize button */
void enableSynchronizeColorButton(bool enable);

+ 1
- 1
kcoloredit/imageselection.cpp View File

@@ -17,7 +17,7 @@

#include "imageselection.h"

ImageSelection::ImageSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) {
ImageSelection::ImageSelection(TQWidget *tqparent, const char *name ) : TQWidget(tqparent,name) {
}
ImageSelection::~ImageSelection(){
}

+ 2
- 1
kcoloredit/imageselection.h View File

@@ -27,10 +27,11 @@
*/
class ImageSelection : public TQWidget {
Q_OBJECT
TQ_OBJECT

public:
/** constructs the widget */
ImageSelection(TQWidget *parent=0, const char *name=0);
ImageSelection(TQWidget *tqparent=0, const char *name=0);
~ImageSelection();
signals:

+ 2
- 2
kcoloredit/kcolorchooser.cpp View File

@@ -55,7 +55,7 @@ int main(int argc, char *argv[])
KColorDialog dlg;

dlg.setColor(Qt::blue); // Just a color
dlg.setColor(TQt::blue); // Just a color

app.connect(&dlg, TQT_SIGNAL(finished()), TQT_SLOT(quit()));

@@ -65,6 +65,6 @@ int main(int argc, char *argv[])
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
const TQColor c = dlg.color();
if ( args->isSet("print") && c.isValid() ) {
std::cout << c.name().utf8().data() << std::endl;
std::cout << TQString(c.name()).utf8().data() << std::endl;
}
}

+ 15
- 15
kcoloredit/kcoloredit.cpp View File

@@ -64,39 +64,39 @@ KColorEditApp::~KColorEditApp() {
void KColorEditApp::initActions()
{
// File actiojns
KStdAction::openNew( this, TQT_SLOT( slotFileNew() ), actionCollection() );
KStdAction::open( this, TQT_SLOT( slotFileOpen() ), actionCollection() );
KStdAction::saveAs( this, TQT_SLOT( slotFileSaveAs() ), actionCollection() );
KStdAction::close( this, TQT_SLOT( slotClose() ), actionCollection() );
KStdAction::quit( this, TQT_SLOT( slotQuit() ), actionCollection() );
m_actSave = KStdAction::save( this, TQT_SLOT( slotFileSave() ),
KStdAction::openNew( TQT_TQOBJECT(this), TQT_SLOT( slotFileNew() ), actionCollection() );
KStdAction::open( TQT_TQOBJECT(this), TQT_SLOT( slotFileOpen() ), actionCollection() );
KStdAction::saveAs( TQT_TQOBJECT(this), TQT_SLOT( slotFileSaveAs() ), actionCollection() );
KStdAction::close( TQT_TQOBJECT(this), TQT_SLOT( slotClose() ), actionCollection() );
KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT( slotQuit() ), actionCollection() );
m_actSave = KStdAction::save( TQT_TQOBJECT(this), TQT_SLOT( slotFileSave() ),
actionCollection() );
m_actRecent = KStdAction::openRecent( this,
m_actRecent = KStdAction::openRecent( TQT_TQOBJECT(this),
TQT_SLOT( slotFileOpenRecent( const KURL& ) ), actionCollection() );

( void ) new KAction( i18n("New &Window"), kapp->miniIcon(), KShortcut(),
this, TQT_SLOT( slotFileNewWindow() ), actionCollection(),
TQT_TQOBJECT(this), TQT_SLOT( slotFileNewWindow() ), actionCollection(),
"file_new_window" );

// Edit actions
m_actCut = KStdAction::cut( this, TQT_SLOT( slotEditCut() ),
m_actCut = KStdAction::cut( TQT_TQOBJECT(this), TQT_SLOT( slotEditCut() ),
actionCollection() );
m_actCopy = KStdAction::copy( this, TQT_SLOT( slotEditCopy() ),
m_actCopy = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT( slotEditCopy() ),
actionCollection() );
m_actPaste = KStdAction::paste( this, TQT_SLOT( slotEditPaste() ),
m_actPaste = KStdAction::paste( TQT_TQOBJECT(this), TQT_SLOT( slotEditPaste() ),
actionCollection() );

m_actPaste->setEnabled( false );

// Color Menu
m_actNames = new KToggleAction( i18n("Show &Color Names"), KShortcut(), this,
m_actNames = new KToggleAction( i18n("Show &Color Names"), KShortcut(), TQT_TQOBJECT(this),
TQT_SLOT( slotViewColorNames() ), actionCollection(),
"color_view_names" );
m_actNames->setCheckedState(i18n("Hide &Color Names"));
m_actPalette = new KAction( i18n("From &Palette"), KShortcut(), this,
m_actPalette = new KAction( i18n("From &Palette"), KShortcut(), TQT_TQOBJECT(this),
TQT_SLOT( slotColorFromPalette() ), actionCollection(),
"color_from_palette" );
( void ) new KAction( i18n("From &Screen"), KShortcut(), this,
( void ) new KAction( i18n("From &Screen"), KShortcut(), TQT_TQOBJECT(this),
TQT_SLOT( slotColorFromScreen() ), actionCollection(),
"color_from_screen" );
}
@@ -104,7 +104,7 @@ void KColorEditApp::initActions()
void KColorEditApp::initStatusBar()
{
statusBar()->insertItem(i18n("Ready."), ID_STATUS_MSG, 1);
statusBar()->setItemAlignment( ID_STATUS_MSG, Qt::AlignLeft );
statusBar()->setItemAlignment( ID_STATUS_MSG, TQt::AlignLeft );
}

void KColorEditApp::initDocument()

+ 3
- 2
kcoloredit/kcoloredit.h View File

@@ -21,7 +21,7 @@

#include <config.h>

// include files for Qt
// include files for TQt
#include <tqevent.h>
#include <tqstringlist.h>

@@ -54,6 +54,7 @@ class KColorEditView;
class KColorEditApp : public KMainWindow
{
Q_OBJECT
TQ_OBJECT

friend class KColorEditView;

@@ -73,7 +74,7 @@ class KColorEditApp : public KMainWindow
KColorEditDoc *document() const;

protected:
/** save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration
/** save general Options like all bar positions and status as well as the tqgeometry and the recent file list to the configuration
* file
*/
void saveOptions();

+ 9
- 9
kcoloredit/kcoloreditdoc.cpp View File

@@ -15,7 +15,7 @@
* *
***************************************************************************/

// include files for Qt
// include files for TQt
#include <tqdir.h>
#include <tqfileinfo.h>
#include <tqwidget.h>
@@ -31,7 +31,7 @@
#include "kcoloreditview.h"
#include "resource.h"

KColorEditDoc::KColorEditDoc(TQWidget *parent, const char *name) : TQObject(parent, name),
KColorEditDoc::KColorEditDoc(TQWidget *tqparent, const char *name) : TQObject(tqparent, name),
m_palette(), m_paletteHistory(&m_palette, 0) {
m_pViewList = new TQPtrList<KColorEditView>();
m_pViewList->setAutoDelete(true);
@@ -106,10 +106,10 @@ bool KColorEditDoc::saveModified()

if(m_modified)
{
KColorEditApp *window=(KColorEditApp *) parent();
KColorEditApp *window=(KColorEditApp *) tqparent();
int want_save = KMessageBox::warningYesNoCancel(window,
i18n("The current file has been modified.\n"
"Do you want to save it?"), TQString::null, KStdGuiItem::save(), i18n("Do Not Save"));
"Do you want to save it?"), TQString(), KStdGuiItem::save(), i18n("Do Not Save"));
switch(want_save)
{
case KMessageBox::Yes:
@@ -175,7 +175,7 @@ bool KColorEditDoc::openDocument(const TQString& filename) {
setPaletteCursorPos(m_palette.length());
setPaletteSelection(0, 0);
slotRedrawAllViews(0, true);
KColorEditApp *window=(KColorEditApp*)parent();
KColorEditApp *window=(KColorEditApp*)tqparent();
window->setCaption(m_title);
}
return true;
@@ -235,7 +235,7 @@ void KColorEditDoc::copyToClipboard(Palette& palette) {
TQString text;
TQTextOStream stream(&text);
palette.save(stream, 0, false);
KApplication::clipboard()->setText(text);
KApplication::tqclipboard()->setText(text);

emit clipboardChanged();
}
@@ -260,7 +260,7 @@ void KColorEditDoc::paste() {
Palette palettePaste;
TQString text;
TQTextIStream stream(&text);
text = KApplication::clipboard()->text();
text = KApplication::tqclipboard()->text();
if(palettePaste.load( stream, false )) {
m_paletteHistory.paste(paletteCursorPos(), palettePaste);
setPaletteSelection(paletteCursorPos(), paletteCursorPos() +
@@ -281,11 +281,11 @@ void KColorEditDoc::insert(int index, const Color& color) {
slotRedrawAllViews(0);
}

void KColorEditDoc::replace(int index, const Color& color) {
void KColorEditDoc::tqreplace(int index, const Color& color) {
Palette paletteReplace;
Color* replaceColor = new Color(color);
paletteReplace.append(replaceColor);
m_paletteHistory.replace(index, paletteReplace);
m_paletteHistory.tqreplace(index, paletteReplace);
setPaletteSelection(0, 0);
setModified(true);
slotRedrawAllViews(0);

+ 4
- 3
kcoloredit/kcoloreditdoc.h View File

@@ -44,13 +44,14 @@ class KColorEditView;
* @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
* @version KDevelop version 0.4 code generation
*/
class KColorEditDoc : public QObject
class KColorEditDoc : public TQObject
{
Q_OBJECT
TQ_OBJECT

public:
/** Constructor for the fileclass of the application */
KColorEditDoc(TQWidget *parent, const char *name=0);
KColorEditDoc(TQWidget *tqparent, const char *name=0);
/** Destructor for the fileclass of the application */
~KColorEditDoc();

@@ -111,7 +112,7 @@ class KColorEditDoc : public QObject
/** Inserts a color at index */
void insert(int index, const Color& color);
/** Replaces a color at index */
void replace(int index, const Color& color);
void tqreplace(int index, const Color& color);

protected:
/** Sets an error string if an IO operation was unsuccesfull */

+ 10
- 10
kcoloredit/kcoloreditview.cpp View File

@@ -15,7 +15,7 @@
* *
***************************************************************************/

// include files for Qt
// include files for TQt
#include <tqpainter.h>
#include <tqlayout.h>
#include <tqpushbutton.h>
@@ -35,7 +35,7 @@
#include "kcoloredit.h"
#include "palette.h"

KColorEditView::KColorEditView(TQWidget *parent, const char *name) : TQSplitter(parent, name) {
KColorEditView::KColorEditView(TQWidget *tqparent, const char *name) : TQSplitter(tqparent, name) {
colorSelector = new ColorSelector(this);
colorSelector->slotSetColor(
Color( RGB_MAX_COMPONENT_VALUE, RGB_MAX_COMPONENT_VALUE, RGB_MAX_COMPONENT_VALUE, "" ));
@@ -43,7 +43,7 @@ KColorEditView::KColorEditView(TQWidget *parent, const char *name) : TQSplitter(
TQVBoxLayout* paletteLayout = new TQVBoxLayout(paletteViewArea);
paletteView = new PaletteView(16, 16, 2, this, paletteViewArea);
paletteLayout->addWidget(paletteView, 10);
TQHBoxLayout* layout = new TQHBoxLayout();
TQHBoxLayout* tqlayout = new TQHBoxLayout();
TQVBoxLayout* addColorLayout = new TQVBoxLayout(4);
addColorLayout->setMargin(8);
TQHBoxLayout* buttonsLayout = new TQHBoxLayout(4);
@@ -70,7 +70,7 @@ KColorEditView::KColorEditView(TQWidget *parent, const char *name) : TQSplitter(
// paletteView, TQT_SLOT( slotCursorFollowsChosenColor(bool) ));
//cursorFollowsChosenColor->toggle();
paletteView->slotCursorFollowsChosenColor(true);
layout->addLayout(addColorLayout, 0);
tqlayout->addLayout(addColorLayout, 0);
TQVGroupBox* colorAtCursorFrame = new TQVGroupBox(i18n("Color at Cursor"), paletteViewArea);
TQWidget* colorAtCursorFrameArea = new TQWidget(colorAtCursorFrame);
TQVBoxLayout* colorAtCursorLayout = new TQVBoxLayout(colorAtCursorFrameArea, 4);
@@ -127,10 +127,10 @@ KColorEditView::KColorEditView(TQWidget *parent, const char *name) : TQSplitter(
colorAtCursorRgbStringLayout->addWidget(colorAtCursorRgbStringValueLabel);
colorAtCursorRgbStringLayout->addStretch();
colorAtCursorLayout->addLayout(colorAtCursorRgbStringLayout);
layout->addWidget(colorAtCursorFrame, 10);
layout->addSpacing(8);
tqlayout->addWidget(colorAtCursorFrame, 10);
tqlayout->addSpacing(8);
paletteLayout->addSpacing(4);
paletteLayout->addLayout(layout);
paletteLayout->addLayout(tqlayout);
paletteLayout->addSpacing(4);
inColorNameChanging = false;
doNotUpdateColorLabels = false;
@@ -145,7 +145,7 @@ void KColorEditView::setColorAtCursorComponentValueLabelSizes(TQLabel* const lab
}

KColorEditDoc *KColorEditView::document() const {
KColorEditApp *theApp=(KColorEditApp *) parentWidget();
KColorEditApp *theApp=(KColorEditApp *) tqparentWidget();

return theApp->document();
}
@@ -234,7 +234,7 @@ void KColorEditView::slotAddColor() {

case REPLACE_COLOR:
if(index < palette->length())
document()->replace(index, color);
document()->tqreplace(index, color);
else
document()->insert(index, color);
break;
@@ -274,7 +274,7 @@ void KColorEditView::slotSetColorName(const TQString& name) {
palette->color(cursorPos)->component(Color::BLUE_INDEX),
name);
doNotUpdateColorLabels = true;
document()->replace(cursorPos, newColor);
document()->tqreplace(cursorPos, newColor);
doNotUpdateColorLabels = false;
}
}

+ 4
- 3
kcoloredit/kcoloreditview.h View File

@@ -22,7 +22,7 @@
#include <config.h>
#endif

// include files for Qt
// include files for TQt
#include <tqsplitter.h>
#include <tqcheckbox.h>
#include <tqlabel.h>
@@ -43,14 +43,15 @@ class KColorEditDoc;
*/
class KColorEditView : public TQSplitter {
Q_OBJECT
TQ_OBJECT

public:
/** Constructor for the main view */
KColorEditView(TQWidget *parent = 0, const char *name = 0);
KColorEditView(TQWidget *tqparent = 0, const char *name = 0);
/** Destructor for the main view */
~KColorEditView();

/** returns a pointer to the document connected to the view instance. Mind that this method requires a KColorEditApp instance as a parent
/** returns a pointer to the document connected to the view instance. Mind that this method requires a KColorEditApp instance as a tqparent
* widget to get to the window document pointer by calling the KColorEditApp::getDocument() method.
*
* @see KColorEditApp#getDocument

+ 22
- 22
kcoloredit/kxycolorselector.cpp View File

@@ -23,7 +23,7 @@

#include "kxycolorselector.h"

KXYColorSelector::KXYColorSelector(TQWidget *parent, const char *name) : KXYSelector(parent,name) {
KXYColorSelector::KXYColorSelector(TQWidget *tqparent, const char *name) : KXYSelector(tqparent,name) {
setBackgroundMode(NoBackground);
setRange(0, 0, COMPONENT_SELECTION_RESOLUTION - 1, COMPONENT_SELECTION_RESOLUTION - 1);
setType(TYPE_NONE);
@@ -42,7 +42,7 @@ void KXYColorSelector::setType(const int type) {

void KXYColorSelector::updateContents() {
drawPalette(&pixmap);
repaint();
tqrepaint();
}

void KXYColorSelector::resizeEvent(TQResizeEvent*) {
@@ -70,9 +70,9 @@ void KXYColorSelector::drawCursor(TQPainter* painter, int x, int y) {
TQColor cursorColor;
if(( 2*color.red() + 4*color.green() + 1*color.blue() )*1.0/
( 2*255 + 4*255 + 1*255 ) > 0.65)
cursorColor = Qt::black;
cursorColor = TQt::black;
else
cursorColor = Qt::white;
cursorColor = TQt::white;
painter->setPen(TQPen( cursorColor ));
const int lineBegin = 2;
const int lineEnd = 6;
@@ -132,25 +132,25 @@ void KXYColorSelector::setColor(TQColor* const color, const int x, const int y)
}

TQColor* KXYColorSelector::standardColorsPalette() {
TQColor* palette = new QColor[STANDARD_PALETTE_SIZE];
TQColor* palette = new TQColor[STANDARD_PALETTE_SIZE];
int i = 0;
palette[i++] = Qt::red;
palette[i++] = Qt::green;
palette[i++] = Qt::blue;
palette[i++] = Qt::cyan;
palette[i++] = Qt::magenta;
palette[i++] = Qt::yellow;
palette[i++] = Qt::darkRed;
palette[i++] = Qt::darkGreen;
palette[i++] = Qt::darkBlue;
palette[i++] = Qt::darkCyan;
palette[i++] = Qt::darkMagenta;
palette[i++] = Qt::darkYellow;
palette[i++] = Qt::white;
palette[i++] = Qt::lightGray;
palette[i++] = Qt::gray;
palette[i++] = Qt::darkGray;
palette[i++] = Qt::black;
palette[i++] = TQt::red;
palette[i++] = TQt::green;
palette[i++] = TQt::blue;
palette[i++] = TQt::cyan;
palette[i++] = TQt::magenta;
palette[i++] = TQt::yellow;
palette[i++] = TQt::darkRed;
palette[i++] = TQt::darkGreen;
palette[i++] = TQt::darkBlue;
palette[i++] = TQt::darkCyan;
palette[i++] = TQt::darkMagenta;
palette[i++] = TQt::darkYellow;
palette[i++] = TQt::white;
palette[i++] = TQt::lightGray;
palette[i++] = TQt::gray;
palette[i++] = TQt::darkGray;
palette[i++] = TQt::black;
return palette;
}


+ 2
- 1
kcoloredit/kxycolorselector.h View File

@@ -28,6 +28,7 @@
*/
class KXYColorSelector : public KXYSelector {
Q_OBJECT
TQ_OBJECT

public:
/** The types of the selector. They specify a color component subset */
@@ -46,7 +47,7 @@ public:
/** Constructs a two-dimensional color component selector widget,
* with a type TYPE_NONE and ranges 0 .. MAX_COLOR_COMPONENT_VALUE
*/
KXYColorSelector(TQWidget *parent=0, const char *name=0);
KXYColorSelector(TQWidget *tqparent=0, const char *name=0);
~KXYColorSelector();
/** Set the type of the selector */
void setType(const int type);

+ 21
- 21
kcoloredit/kzcolorselector.cpp View File

@@ -23,8 +23,8 @@
#include "main.h"
#include "kzcolorselector.h"

KZColorSelector::KZColorSelector(Orientation o, TQWidget *parent, const char *name) :
KSelector(o, parent, name) {
KZColorSelector::KZColorSelector(Qt::Orientation o, TQWidget *tqparent, const char *name) :
KSelector(o, tqparent, name) {
baseColorH = -1;
baseColorS = 0;
baseColorV = 0;
@@ -53,7 +53,7 @@ void KZColorSelector::setType(const int type) {

void KZColorSelector::updateContents() {
drawPalette(&pixmap);
repaint(false);
tqrepaint(false);
}

void KZColorSelector::resizeEvent(TQResizeEvent*) {
@@ -119,25 +119,25 @@ void KZColorSelector::setColor(TQColor* const color, const int y) {
}

TQColor* KZColorSelector::getStandardColorsPalette() {
TQColor* palette = new QColor[( int )STANDARD_PALETTE_SIZE];
TQColor* palette = new TQColor[( int )STANDARD_PALETTE_SIZE];
int i = 0;
palette[i++] = Qt::red;
palette[i++] = Qt::green;
palette[i++] = Qt::blue;
palette[i++] = Qt::cyan;
palette[i++] = Qt::magenta;
palette[i++] = Qt::yellow;
palette[i++] = Qt::darkRed;
palette[i++] = Qt::darkGreen;
palette[i++] = Qt::darkBlue;
palette[i++] = Qt::darkCyan;
palette[i++] = Qt::darkMagenta;
palette[i++] = Qt::darkYellow;
palette[i++] = Qt::white;
palette[i++] = Qt::lightGray;
palette[i++] = Qt::gray;
palette[i++] = Qt::darkGray;
palette[i++] = Qt::black;
palette[i++] = TQt::red;
palette[i++] = TQt::green;
palette[i++] = TQt::blue;
palette[i++] = TQt::cyan;
palette[i++] = TQt::magenta;
palette[i++] = TQt::yellow;
palette[i++] = TQt::darkRed;
palette[i++] = TQt::darkGreen;
palette[i++] = TQt::darkBlue;
palette[i++] = TQt::darkCyan;
palette[i++] = TQt::darkMagenta;
palette[i++] = TQt::darkYellow;
palette[i++] = TQt::white;
palette[i++] = TQt::lightGray;
palette[i++] = TQt::gray;
palette[i++] = TQt::darkGray;
palette[i++] = TQt::black;
return palette;
}


+ 2
- 1
kcoloredit/kzcolorselector.h View File

@@ -29,6 +29,7 @@
*/
class KZColorSelector : public KSelector {
Q_OBJECT
TQ_OBJECT
public:
/** Selector type constants */
@@ -37,7 +38,7 @@ public:
TYPE_V = 2 };

/** Constructs the widget */
KZColorSelector(Orientation o, TQWidget *parent=0, const char *name=0);
KZColorSelector(Qt::Orientation o, TQWidget *tqparent=0, const char *name=0);
~KZColorSelector();
/** Sets the selector type */
void setType(const int type);

+ 3
- 3
kcoloredit/loadpalettedlg.cpp View File

@@ -31,8 +31,8 @@
#include "palette.h"
#include "loadpalettedlg.h"

LoadPaletteDlg::LoadPaletteDlg(TQWidget *parent, const char *name)
: KDialogBase(parent, name, true, i18n( "Load Palette" ),
LoadPaletteDlg::LoadPaletteDlg(TQWidget *tqparent, const char *name)
: KDialogBase(tqparent, name, true, i18n( "Load Palette" ),
Ok|Cancel, Ok, true) {
fileName = "";
TQWidget *mainWidget = new TQWidget( this );
@@ -45,7 +45,7 @@ LoadPaletteDlg::LoadPaletteDlg(TQWidget *parent, const char *name)
TQStringList palettesList = Palette::kdePalettes();
for(TQStringList::Iterator palette = palettesList.begin();
palette != palettesList.end(); ++palette) {
bool prepend = (*palette).contains( "colors/Custom_Colors" );
bool prepend = (*palette).tqcontains( "colors/Custom_Colors" );
TQString fileName = locate("config", (*palette));
if(prepend) {
palettesFileNames.prepend(fileName);

+ 2
- 1
kcoloredit/loadpalettedlg.h View File

@@ -27,11 +27,12 @@
*/
class LoadPaletteDlg : public KDialogBase {
Q_OBJECT
TQ_OBJECT
public:
/** constructs the dialog
*/
LoadPaletteDlg(TQWidget *parent = 0, const char *name = 0);
LoadPaletteDlg(TQWidget *tqparent = 0, const char *name = 0);
~LoadPaletteDlg();
/** @return the fetched file name
*/

+ 4
- 4
kcoloredit/palette.cpp View File

@@ -108,14 +108,14 @@ bool Palette::load(TQTextStream& stream, bool loadName /* = true */) {
int lineNum = 0;
while (!stream.atEnd()) {
TQString string = stream.readLine().append(' ');
if(string.find( TQRegExp("[^\\s]") ) == -1 ||
if(string.tqfind( TQRegExp("[^\\s]") ) == -1 ||
string.stripWhiteSpace().at( 0 ) == '#' ||
( loadName && lineNum == 0 )) {
if(loadName && lineNum == 0)
setName(string.stripWhiteSpace());
} else {
Color* newColor = new Color();
int position = string.find(TQRegExp( "[^\\s]" ));
int position = string.tqfind(TQRegExp( "[^\\s]" ));
for(int componentIndex = 0; componentIndex < Color::COMPONENTS_NUM;
++componentIndex) {
if(position == -1) {
@@ -123,7 +123,7 @@ bool Palette::load(TQTextStream& stream, bool loadName /* = true */) {
result = false;
break;
}
int endPosition = string.find(TQRegExp( "\\s" ), position);
int endPosition = string.tqfind(TQRegExp( "\\s" ), position);
if(endPosition == -1) {
m_errorString = i18n("Invalid format");
result = false;
@@ -139,7 +139,7 @@ bool Palette::load(TQTextStream& stream, bool loadName /* = true */) {
break;
}
newColor->setComponent(componentIndex, componentValue);
position = string.find(TQRegExp( "[^\\s]" ), endPosition);
position = string.tqfind(TQRegExp( "[^\\s]" ), endPosition);
}
if(!result) {
delete newColor;

+ 3
- 3
kcoloredit/paletteview.cpp View File

@@ -21,8 +21,8 @@
#include "paletteview.h"

PaletteView::PaletteView(const int defaultCellWidth, const int defaultCellHeight, const int cellSpacing,
KColorEditView* view, TQWidget *parent, const char *name) :
TQFrame(parent, name, TQWidget::WResizeNoErase*0) {
KColorEditView* view, TQWidget *tqparent, const char *name) :
TQFrame(tqparent, name, TQWidget::WResizeNoErase*0) {
setFrameStyle(StyledPanel|Sunken);
setLineWidth(2);
TQGridLayout* topLayout = new TQGridLayout(this, 2, 2);
@@ -32,7 +32,7 @@ PaletteView::PaletteView(const int defaultCellWidth, const int defaultCellHeight
topLayout->setColStretch(0, 10);
topLayout->setColStretch(1, 0);
scrollBar = new TQScrollBar(this);
hScrollBar = new TQScrollBar(0, 1, 1, 1, 0, TQScrollBar::Horizontal, this);
hScrollBar = new TQScrollBar(0, 1, 1, 1, 0, Qt::Horizontal, this);
scrolledArea = new PaletteViewScrolledArea(defaultCellWidth,
defaultCellHeight, cellSpacing, scrollBar, hScrollBar, view, this);
connect(scrollBar, TQT_SIGNAL( valueChanged(int) ),

+ 3
- 2
kcoloredit/paletteview.h View File

@@ -26,18 +26,19 @@
class KColorEditView;

/** This is a Palette class view widget.
* Its parent is KColorEditView
* Its tqparent is KColorEditView
* @author Artur Rataj
*/
class PaletteView : public TQFrame {
Q_OBJECT
TQ_OBJECT

public:
/** Constructs a palette view widget, with a default cells sizes and spacing.
* The effective cell sizes may be adjusted to fit the widget sizes.
*/
PaletteView(const int defaultCellWidth, const int defaultCellHeight, const int cellSpacing,
KColorEditView* view, TQWidget *parent = 0, const char *name=0);
KColorEditView* view, TQWidget *tqparent = 0, const char *name=0);
~PaletteView();
/** Calls redraw() in scrolledArea */
void redraw();

+ 12
- 12
kcoloredit/paletteviewscrolledarea.cpp View File

@@ -38,8 +38,8 @@

PaletteViewScrolledArea::PaletteViewScrolledArea(const int defaultCellWidth,
const int defaultCellHeight, const int cellSpacing, TQScrollBar* scrollBar,
TQScrollBar* hScrollBar, KColorEditView* view, TQWidget* parent, const char* name)
: TQFrame(parent, name) {
TQScrollBar* hScrollBar, KColorEditView* view, TQWidget* tqparent, const char* name)
: TQFrame(tqparent, name) {
this->defaultCellWidth = defaultCellWidth;
this->defaultCellHeight = defaultCellHeight;
this->cellSpacing = cellSpacing;
@@ -73,11 +73,11 @@ void PaletteViewScrolledArea::slotViewColorNames(bool viewColorNames) {

void PaletteViewScrolledArea::redraw() {
//setCellsSizes();
repaintPalette();
tqrepaintPalette();
}

void PaletteViewScrolledArea::repaintPalette() {
repaint(false);
void PaletteViewScrolledArea::tqrepaintPalette() {
tqrepaint(false);
}

void PaletteViewScrolledArea::checkSelectionAutoScroll(const int mousePosY) {
@@ -106,7 +106,7 @@ void PaletteViewScrolledArea::slotScrollTimeout() {
else
setSelection(selectionEnd, selectionBegin);
checkSelectionAutoScroll(cursorPoint.y());
repaintPalette();
tqrepaintPalette();
}
}

@@ -220,7 +220,7 @@ void PaletteViewScrolledArea::paintEvent(TQPaintEvent* /*event*/) {
setCellsSizes();
TQPixmap pixmap(size());
TQPainter painter;
painter.begin(&pixmap, this);
painter.tqbegin(TQT_TQPAINTDEVICE(&pixmap), this);
TQFontMetrics fontMetrics = painter.fontMetrics();
int maxLineWidth;
if(viewColorNames) {
@@ -249,12 +249,12 @@ void PaletteViewScrolledArea::paintEvent(TQPaintEvent* /*event*/) {
int lastRow = (posY + height() - 1 + rowHeight - 1)/rowHeight;
if(viewColorNames)
painter.fillRect(0, 0, rowWidth, height(),
TQBrush( TQFrame::palette().active().base() ));
TQBrush normalBackgroundBrush(TQFrame::palette().active().background());
TQBrush selectedBackgroundBrush(TQFrame::palette().active().highlight());
TQBrush( TQFrame::tqpalette().active().base() ));
TQBrush normalBackgroundBrush(TQFrame::tqpalette().active().background());
TQBrush selectedBackgroundBrush(TQFrame::tqpalette().active().highlight());
TQBrush foregroundBrush;
TQBrush cursorBrush(TQFrame::palette().active().foreground());
TQPen backgroundPen(TQFrame::palette().active().foreground());
TQBrush cursorBrush(TQFrame::tqpalette().active().foreground());
TQPen backgroundPen(TQFrame::tqpalette().active().foreground());
int min = selectionMin();
int max = selectionMax();
int fontAscent = fontMetrics.ascent();

+ 5
- 4
kcoloredit/paletteviewscrolledarea.h View File

@@ -33,15 +33,16 @@ class TQScrollBar;
*/
class PaletteViewScrolledArea : public TQFrame {
Q_OBJECT
TQ_OBJECT

public:
/** Constructs the widget */
PaletteViewScrolledArea(const int defaultCellWidth, const int defaultCellHeight,
const int cellSpacing, TQScrollBar* scrollBar,
TQScrollBar* hScrollBar, KColorEditView* view,
TQWidget* parent = 0, const char* name = 0);
TQWidget* tqparent = 0, const char* name = 0);
~PaletteViewScrolledArea();
/** Sets cells sizes and then calls repaintPalette() */
/** Sets cells sizes and then calls tqrepaintPalette() */
void redraw();

public slots:
@@ -105,8 +106,8 @@ protected:
* visible area width
*/
void setCellsSizes();
/** repaints the palette */
void repaintPalette();
/** tqrepaints the palette */
void tqrepaintPalette();
/** @return A color index at a given position, -1 if none */
int colorIndex(const TQPoint& point) const;
/** @return A color at a given position */

+ 5
- 5
kcoloredit/texteditselection.cpp View File

@@ -24,7 +24,7 @@
#include "main.h"
#include "texteditselection.h"

TextEditSelection::TextEditSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) {
TextEditSelection::TextEditSelection(TQWidget *tqparent, const char *name ) : TQWidget(tqparent,name) {
inChangingComponents = false;
TQVBoxLayout* topLayout = new TQVBoxLayout(this, 4);
TQGridLayout* componentsLayout = new TQGridLayout(3, 5, 2);
@@ -59,14 +59,14 @@ TextEditSelection::~TextEditSelection(){
}

void TextEditSelection::addComponent(const int index, TQLineEdit* lineEdit, const int maxValue,
const TQString& labelString, const int row, const int column, TQGridLayout* layout) {
const TQString& labelString, const int row, const int column, TQGridLayout* tqlayout) {
TQLabel* label = new TQLabel(labelString, this);
lineEdit->setValidator(new TQIntValidator( 0, maxValue, lineEdit ));
lineEdit->setValidator(new TQIntValidator( 0, maxValue, TQT_TQOBJECT(lineEdit) ));
lineEditTable[index] = lineEdit;
lineEdit->setMinimumWidth(lineEdit->fontMetrics().width( TQString("8888") ));
lineEdit->setMaximumWidth(lineEdit->fontMetrics().width( TQString("8888888") ));
layout->addWidget(label, row, column*3);
layout->addWidget(lineEdit, row, column*3 + 1);
tqlayout->addWidget(label, row, column*3);
tqlayout->addWidget(lineEdit, row, column*3 + 1);
}

void TextEditSelection::setRgbString(const int red, const int green, const int blue) {

+ 3
- 2
kcoloredit/texteditselection.h View File

@@ -30,10 +30,11 @@
*/
class TextEditSelection : public TQWidget {
Q_OBJECT
TQ_OBJECT

public:
/** Constructs the widget */
TextEditSelection(TQWidget *parent=0, const char *name=0);
TextEditSelection(TQWidget *tqparent=0, const char *name=0);
~TextEditSelection();
signals:
@@ -47,7 +48,7 @@ public slots:
protected:
/** Adds a component line edit */
void addComponent(const int index, TQLineEdit* lineEdit, const int maxValue, const TQString& labelString,
const int row, const int column, TQGridLayout* layout);
const int row, const int column, TQGridLayout* tqlayout);
/** sets RGB string in rgbStringLineEdit */
void setRgbString(const int red, const int green, const int blue);

+ 1
- 1
kcoloredit/textselection.cpp View File

@@ -17,7 +17,7 @@

#include "textselection.h"

TextSelection::TextSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) {
TextSelection::TextSelection(TQWidget *tqparent, const char *name ) : TQWidget(tqparent,name) {
}
TextSelection::~TextSelection(){

+ 5
- 5
kdvi/TeXFont.h View File

@@ -17,8 +17,8 @@ class TeXFont {
public:
TeXFont(TeXFontDefinition *_parent)
{
parent = _parent;
errorMessage = TQString::null;
tqparent = _parent;
errorMessage = TQString();
};
virtual ~TeXFont();
@@ -29,12 +29,12 @@ class TeXFont {
glyphtable[i].shrunkenCharacter.resize(0, 0);
};
virtual glyph* getGlyph(Q_UINT16 character, bool generateCharacterPixmap=false, const TQColor& color=Qt::black) = 0;
virtual glyph* getGlyph(TQ_UINT16 character, bool generateCharacterPixmap=false, const TQColor& color=TQt::black) = 0;

// Checksum of the font. Used e.g. by PK fonts. This field is filled
// in by the constructor, or set to 0.0, if the font format does not
// contain checksums.
Q_UINT32 checksum;
TQ_UINT32 checksum;

// If the font or if some glyphs could not be loaded, error messages
// will be put here.
@@ -42,7 +42,7 @@ class TeXFont {
protected:
glyph glyphtable[TeXFontDefinition::max_num_of_chars_in_font];
TeXFontDefinition *parent;
TeXFontDefinition *tqparent;
};

#endif

+ 8
- 8
kdvi/TeXFontDefinition.cpp View File

@@ -31,7 +31,7 @@ extern const int MFResolutions[];
// #define DEBUG_FONT


TeXFontDefinition::TeXFontDefinition(TQString nfontname, double _displayResolution_in_dpi, Q_UINT32 chk, Q_INT32 _scaled_size_in_DVI_units,
TeXFontDefinition::TeXFontDefinition(TQString nfontname, double _displayResolution_in_dpi, TQ_UINT32 chk, TQ_INT32 _scaled_size_in_DVI_units,
class fontPool *pool, double _enlargement)
{
#ifdef DEBUG_FONT
@@ -46,7 +46,7 @@ TeXFontDefinition::TeXFontDefinition(TQString nfontname, double _displayResoluti
checksum = chk;
flags = TeXFontDefinition::FONT_IN_USE;
file = 0;
filename = TQString::null;
filename = TQString();
scaled_size_in_DVI_units = _scaled_size_in_DVI_units;
macrotable = 0;
@@ -93,8 +93,8 @@ void TeXFontDefinition::fontNameReceiver(const TQString& fname)
flags |= TeXFontDefinition::FONT_LOADED;
filename = fname;
#ifdef HAVE_FREETYPE
fullFontName = TQString::null;
fullEncodingName = TQString::null;
fullFontName = TQString();
fullEncodingName = TQString();
#endif

file = fopen(TQFile::encodeName(filename), "r");
@@ -105,7 +105,7 @@ void TeXFontDefinition::fontNameReceiver(const TQString& fname)
TQString filename_test(font_pool->getExtraSearchPath() + "/" + filename);
file = fopen( TQFile::encodeName(filename_test), "r");
if (file == 0) {
kdError(4300) << i18n("Cannot find font %1, file %2.").arg(fontname).arg(filename) << endl;
kdError(4300) << i18n("Cannot find font %1, file %2.").tqarg(fontname).tqarg(filename) << endl;
return;
} else
filename = filename_test;
@@ -121,7 +121,7 @@ void TeXFontDefinition::fontNameReceiver(const TQString& fname)
font = new TeXFont_PK(this);
set_char_p = &dviRenderer::set_char;
if ((checksum != 0) && (checksum != font->checksum))
kdWarning(4300) << i18n("Checksum mismatch for font file %1").arg(filename) << endl;
kdWarning(4300) << i18n("Checksum mismatch for font file %1").tqarg(filename) << endl;
fontTypeName = "TeX PK";
return;
}
@@ -169,7 +169,7 @@ void TeXFontDefinition::fontNameReceiver(const TQString& fname)
#else
// If we don't have the FreeType library, we should never have
// reached this point. Complain, and leave this font blank
kdError(4300) << i18n("Cannot recognize format for font file %1").arg(filename) << endl;
kdError(4300) << i18n("Cannot recognize format for font file %1").tqarg(filename) << endl;
#endif
}

@@ -195,7 +195,7 @@ void TeXFontDefinition::reset()
vf_table.clear();
}
filename = TQString::null;
filename = TQString();
flags = TeXFontDefinition::FONT_IN_USE;
set_char_p = &dviRenderer::set_empty_char;
}

+ 7
- 7
kdvi/TeXFontDefinition.h View File

@@ -1,6 +1,6 @@
// -*- C++ -*-
/*
* The layout of a font information block.
* The tqlayout of a font information block.
* There is one of these for every loaded font or magnification thereof.
* Duplicates are eliminated: this is necessary because of possible recursion
* in virtual fonts.
@@ -35,7 +35,7 @@ class macro {

unsigned char *pos; /* address of first byte of macro */
unsigned char *end; /* address of last+1 byte */
Q_INT32 dvi_advance_in_units_of_design_size_by_2e20; /* DVI units to move reference point */
TQ_INT32 dvi_advance_in_units_of_design_size_by_2e20; /* DVI units to move reference point */
bool free_me; // if memory at pos should be returned on destruction
};

@@ -56,7 +56,7 @@ class TeXFontDefinition {
};

TeXFontDefinition(TQString nfontname, double _displayResolution_in_dpi, Q_UINT32 chk, Q_INT32 _scaled_size_in_DVI_units,
TeXFontDefinition(TQString nfontname, double _displayResolution_in_dpi, TQ_UINT32 chk, TQ_INT32 _scaled_size_in_DVI_units,
class fontPool *pool, double _enlargement);
~TeXFontDefinition();

@@ -74,7 +74,7 @@ class TeXFontDefinition {
TQString fontname; // name of font, such as "cmr10"
unsigned char flags; // flags byte (see values below)
double enlargement;
Q_INT32 scaled_size_in_DVI_units; // Scaled size from the font definition command; in DVI units
TQ_INT32 scaled_size_in_DVI_units; // Scaled size from the font definition command; in DVI units
set_char_proc set_char_p; // proc used to set char
// Resolution of the display device (resolution will usually be
@@ -100,20 +100,20 @@ class TeXFontDefinition {
/** For FREETYPE fonts, which use a map file, this field will
contain the full name of the font (e.g. 'Computer Modern'). If
the name does not exist, or cannot be found, this field will be
TQString::null. Only subclasses of TeXFont should write into this
TQString(). Only subclasses of TeXFont should write into this
field. */
TQString fullFontName;

/** For FREETYPE fonts, which use a map file, this field will
contain the full name of the font encoding (e.g. 'TexBase1'). If
the encoding name does not exist, or cannot be found, this field
will be TQString::null. Only subclasses of TeXFont should write
will be TQString(). Only subclasses of TeXFont should write
into this field. */
TQString fullEncodingName;
#endif

private:
Q_UINT32 checksum;
TQ_UINT32 checksum;

/** This will be set to a human-readable description of the font,
e.g. "virtual" or "TeX PK", or "Type 1" */

+ 32
- 32
kdvi/TeXFont_PFB.cpp View File

@@ -26,28 +26,28 @@
//#define DEBUG_PFB 1


TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double slant)
: TeXFont(parent)
TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *tqparent, fontEncoding *enc, double slant)
: TeXFont(tqparent)
{
#ifdef DEBUG_PFB
if (enc != 0)
kdDebug(4300) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=" << enc->encodingFullName << " )" << endl;
kdDebug(4300) << "TeXFont_PFB::TeXFont_PFB( tqparent=" << tqparent << ", encoding=" << enc->encodingFullName << " )" << endl;
else
kdDebug(4300) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=0 )" << endl;
kdDebug(4300) << "TeXFont_PFB::TeXFont_PFB( tqparent=" << tqparent << ", encoding=0 )" << endl;
#endif

fatalErrorInFontLoading = false;

int error = FT_New_Face( parent->font_pool->FreeType_library, parent->filename.local8Bit(), 0, &face );
int error = FT_New_Face( tqparent->font_pool->FreeType_library, tqparent->filename.local8Bit(), 0, &face );
if ( error == FT_Err_Unknown_File_Format ) {
errorMessage = i18n("The font file %1 could be opened and read, but its font format is unsupported.").arg(parent->filename);
errorMessage = i18n("The font file %1 could be opened and read, but its font format is unsupported.").tqarg(tqparent->filename);
kdError(4300) << errorMessage << endl;
fatalErrorInFontLoading = true;
return;
} else
if ( error ) {
errorMessage = i18n("The font file %1 is broken, or it could not be opened or read.").arg(parent->filename);
errorMessage = i18n("The font file %1 is broken, or it could not be opened or read.").tqarg(tqparent->filename);
kdError(4300) << errorMessage << endl;
fatalErrorInFontLoading = true;
return;
@@ -66,7 +66,7 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
}
if (face->family_name != 0)
parent->fullFontName = face->family_name;
tqparent->fullFontName = face->family_name;

// Finally, we need to set up the charMap array, which maps TeX
// character codes to glyph indices in the font. (Remark: the
@@ -74,8 +74,8 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
// TeX is only able to address character codes 0-255 while
// e.g. Type1 fonts may contain several thousands of characters)
if (enc != 0) {
parent->fullEncodingName = enc->encodingFullName.remove(TQString::fromLatin1( "Encoding" ));
parent->fullEncodingName = enc->encodingFullName.remove(TQString::fromLatin1( "encoding" ));
tqparent->fullEncodingName = enc->encodingFullName.remove(TQString::tqfromLatin1( "Encoding" ));
tqparent->fullEncodingName = enc->encodingFullName.remove(TQString::tqfromLatin1( "encoding" ));

// An encoding vector is given for this font, i.e. an array of
// character names (such as: 'parenleft' or 'dotlessj'). We use
@@ -138,7 +138,7 @@ TeXFont_PFB::~TeXFont_PFB()
}


glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQColor& color)
glyph *TeXFont_PFB::getGlyph(TQ_UINT16 ch, bool generateCharacterPixmap, const TQColor& color)
{
#ifdef DEBUG_PFB
kdDebug(4300) << "TeXFont_PFB::getGlyph( ch=" << ch << ", '" << (char)(ch) << "', generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl;
@@ -159,16 +159,16 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQ
if ((generateCharacterPixmap == true) && ((g->shrunkenCharacter.isNull()) || (color != g->color)) ) {
int error;
unsigned int res = (unsigned int)(parent->displayResolution_in_dpi/parent->enlargement +0.5);
unsigned int res = (unsigned int)(tqparent->displayResolution_in_dpi/tqparent->enlargement +0.5);
g->color = color;

// Character height in 1/64th of points (reminder: 1 pt = 1/72 inch)
// Only approximate, may vary from file to file!!!! @@@@@

long int characterSize_in_printers_points_by_64 = (long int)((64.0*72.0*parent->scaled_size_in_DVI_units*parent->font_pool->getCMperDVIunit())/2.54 + 0.5 );
long int characterSize_in_printers_points_by_64 = (long int)((64.0*72.0*tqparent->scaled_size_in_DVI_units*tqparent->font_pool->getCMperDVIunit())/2.54 + 0.5 );
error = FT_Set_Char_Size(face, 0, characterSize_in_printers_points_by_64, res, res );
if (error) {
TQString msg = i18n("FreeType reported an error when setting the character size for font file %1.").arg(parent->filename);
TQString msg = i18n("FreeType reported an error when setting the character size for font file %1.").tqarg(tqparent->filename);
if (errorMessage.isEmpty())
errorMessage = msg;
kdError(4300) << msg << endl;
@@ -178,13 +178,13 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQ
}
// load glyph image into the slot and erase the previous one
if (parent->font_pool->getUseFontHints() == true)
if (tqparent->font_pool->getUseFontHints() == true)
error = FT_Load_Glyph(face, charMap[ch], FT_LOAD_DEFAULT );
else
error = FT_Load_Glyph(face, charMap[ch], FT_LOAD_NO_HINTING );

if (error) {
TQString msg = i18n("FreeType is unable to load glyph #%1 from font file %2.").arg(ch).arg(parent->filename);
TQString msg = i18n("FreeType is unable to load glyph #%1 from font file %2.").tqarg(ch).tqarg(tqparent->filename);
if (errorMessage.isEmpty())
errorMessage = msg;
kdError(4300) << msg << endl;
@@ -196,7 +196,7 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQ
// convert to an anti-aliased bitmap
error = FT_Render_Glyph( face->glyph, ft_render_mode_normal );
if (error) {
TQString msg = i18n("FreeType is unable to render glyph #%1 from font file %2.").arg(ch).arg(parent->filename);
TQString msg = i18n("FreeType is unable to render glyph #%1 from font file %2.").tqarg(ch).tqarg(tqparent->filename);
if (errorMessage.isEmpty())
errorMessage = msg;
kdError(4300) << msg << endl;
@@ -209,8 +209,8 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQ

if ((slot->bitmap.width == 0) || (slot->bitmap.rows == 0)) {
if (errorMessage.isEmpty())
errorMessage = i18n("Glyph #%1 is empty.").arg(ch);
kdError(4300) << i18n("Glyph #%1 from font file %2 is empty.").arg(ch).arg(parent->filename) << endl;
errorMessage = i18n("Glyph #%1 is empty.").tqarg(ch);
kdError(4300) << i18n("Glyph #%1 from font file %2 is empty.").tqarg(ch).tqarg(tqparent->filename) << endl;
g->shrunkenCharacter.resize( 15, 15 );
g->shrunkenCharacter.fill(TQColor(255, 0, 0));
g->x2 = 0;
@@ -219,9 +219,9 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQ
TQImage imgi(slot->bitmap.width, slot->bitmap.rows, 32);
imgi.setAlphaBuffer(true);

// Do QPixmaps fully support the alpha channel? If yes, we use
// Do TQPixmaps fully support the alpha channel? If yes, we use
// that. Otherwise, use other routines as a fallback
if (parent->font_pool->QPixmapSupportsAlpha) {
if (tqparent->font_pool->TQPixmapSupportsAlpha) {
// If the alpha channel is properly supported, we set the
// character glyph to a colored rectangle, and define the
// character outline only using the alpha channel. That
@@ -239,7 +239,7 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQ
}
} else {
// If the alpha channel is not supported... QT seems to turn
// the alpha channel into a crude bitmap which is used to mask
// the alpha channel into a crude bitmap which is used to tqmask
// the resulting TQPixmap. In this case, we define the
// character outline using the image data, and use the alpha
// channel only to store "maximally opaque" or "completely
@@ -248,18 +248,18 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQ
// quality is still sufficient for most purposes. One notable
// exception is output from the gftodvi program, which will be
// partially unreadable.
Q_UINT16 rInv = 0xFF - color.red();
Q_UINT16 gInv = 0xFF - color.green();
Q_UINT16 bInv = 0xFF - color.blue();
TQ_UINT16 rInv = 0xFF - color.red();
TQ_UINT16 gInv = 0xFF - color.green();
TQ_UINT16 bInv = 0xFF - color.blue();
for(Q_UINT16 y=0; y<slot->bitmap.rows; y++) {
Q_UINT8 *srcScanLine = slot->bitmap.buffer + y*slot->bitmap.pitch;
for(TQ_UINT16 y=0; y<slot->bitmap.rows; y++) {
TQ_UINT8 *srcScanLine = slot->bitmap.buffer + y*slot->bitmap.pitch;
unsigned int *destScanLine = (unsigned int *)imgi.scanLine(y);
for(Q_UINT16 col=0; col<slot->bitmap.width; col++) {
Q_UINT16 data = *srcScanLine;
for(TQ_UINT16 col=0; col<slot->bitmap.width; col++) {
TQ_UINT16 data = *srcScanLine;
// The value stored in "data" now has the following meaning:
// data = 0 -> white; data = 0xff -> use "color"
*destScanLine = qRgba(0xFF - (rInv*data + 0x7F) / 0xFF,
*destScanLine = tqRgba(0xFF - (rInv*data + 0x7F) / 0xFF,
0xFF - (gInv*data + 0x7F) / 0xFF,
0xFF - (bInv*data + 0x7F) / 0xFF,
(data > 0x03) ? 0xff : 0x00);
@@ -279,13 +279,13 @@ glyph *TeXFont_PFB::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQ
if (g->dvi_advance_in_units_of_design_size_by_2e20 == 0) {
int error = FT_Load_Glyph(face, charMap[ch], FT_LOAD_NO_SCALE);
if (error) {
TQString msg = i18n("FreeType is unable to load metric for glyph #%1 from font file %2.").arg(ch).arg(parent->filename);
TQString msg = i18n("FreeType is unable to load metric for glyph #%1 from font file %2.").tqarg(ch).tqarg(tqparent->filename);
if (errorMessage.isEmpty())
errorMessage = msg;
kdError(4300) << msg << endl;
g->dvi_advance_in_units_of_design_size_by_2e20 = 1;
}
g->dvi_advance_in_units_of_design_size_by_2e20 = (Q_INT32)(((Q_INT64)(1<<20) * (Q_INT64)face->glyph->metrics.horiAdvance) / (Q_INT64)face->units_per_EM);
g->dvi_advance_in_units_of_design_size_by_2e20 = (TQ_INT32)(((TQ_INT64)(1<<20) * (TQ_INT64)face->glyph->metrics.horiAdvance) / (TQ_INT64)face->units_per_EM);
}
return g;

+ 3
- 3
kdvi/TeXFont_PFB.h View File

@@ -23,15 +23,15 @@ class glyph;

class TeXFont_PFB : public TeXFont {
public:
TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc=0, double slant=0.0 );
TeXFont_PFB(TeXFontDefinition *tqparent, fontEncoding *enc=0, double slant=0.0 );
~TeXFont_PFB();
glyph* getGlyph(Q_UINT16 character, bool generateCharacterPixmap=false, const TQColor& color=Qt::black);
glyph* getGlyph(TQ_UINT16 character, bool generateCharacterPixmap=false, const TQColor& color=TQt::black);

private:
FT_Face face;
bool fatalErrorInFontLoading;
Q_UINT16 charMap[256];
TQ_UINT16 charMap[256];

// This matrix is used internally to describes the slant, if
// nonzero. Otherwise, this is undefined.

+ 53
- 53
kdvi/TeXFont_PK.cpp View File

@@ -80,18 +80,18 @@ extern void oops(TQString message);



TeXFont_PK::TeXFont_PK(TeXFontDefinition *parent)
: TeXFont(parent)
TeXFont_PK::TeXFont_PK(TeXFontDefinition *tqparent)
: TeXFont(tqparent)
{
#ifdef DEBUG_PK
kdDebug(4300) << "TeXFont_PK::TeXFont_PK( parent=" << parent << ")" << endl;
kdDebug(4300) << "TeXFont_PK::TeXFont_PK( tqparent=" << tqparent << ")" << endl;
#endif

for(unsigned int i=0; i<TeXFontDefinition::max_num_of_chars_in_font; i++)
characterBitmaps[i] = 0;
file = fopen(TQFile::encodeName(parent->filename), "r");
file = fopen(TQFile::encodeName(tqparent->filename), "r");
if (file == 0)
kdError(4300) << i18n("Cannot open font file %1.").arg(parent->filename) << endl;
kdError(4300) << i18n("Cannot open font file %1.").tqarg(tqparent->filename) << endl;
#ifdef DEBUG_PK
else
kdDebug(4300) << "TeXFont_PK::TeXFont_PK(): file opened successfully" << endl;
@@ -116,7 +116,7 @@ TeXFont_PK::~TeXFont_PK()
}


glyph* TeXFont_PK::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQColor& color)
glyph* TeXFont_PK::getGlyph(TQ_UINT16 ch, bool generateCharacterPixmap, const TQColor& color)
{
#ifdef DEBUG_PK
kdDebug(4300) << "TeXFont_PK::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl;
@@ -136,7 +136,7 @@ glyph* TeXFont_PK::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQC
// If the character is not defined in the PK file, mark the
// character as missing, and print an error message
if (g->addr == 0) {
kdError(4300) << i18n("TexFont_PK::operator[]: Character %1 not defined in font %2").arg(ch).arg(parent->filename) << endl;
kdError(4300) << i18n("TexFont_PK::operator[]: Character %1 not defined in font %2").tqarg(ch).tqarg(tqparent->filename) << endl;
g->addr = -1;
return g;
}
@@ -163,7 +163,7 @@ glyph* TeXFont_PK::getGlyph(Q_UINT16 ch, bool generateCharacterPixmap, const TQC
((g->shrunkenCharacter.isNull()) || (color != g->color)) &&
(characterBitmaps[ch]->w != 0)) {
g->color = color;
double shrinkFactor = 1200 / parent->displayResolution_in_dpi;
double shrinkFactor = 1200 / tqparent-&