summaryrefslogtreecommitdiffstats
path: root/addon/doxywizard
diff options
context:
space:
mode:
Diffstat (limited to 'addon/doxywizard')
-rw-r--r--addon/doxywizard/Makefile.in32
-rw-r--r--addon/doxywizard/doxywizard.cpp540
-rw-r--r--addon/doxywizard/doxywizard.h111
-rw-r--r--addon/doxywizard/doxywizard.pro.in7
-rw-r--r--addon/doxywizard/input.h14
-rw-r--r--addon/doxywizard/inputbool.cpp8
-rw-r--r--addon/doxywizard/inputbool.h10
-rw-r--r--addon/doxywizard/inputint.cpp2
-rw-r--r--addon/doxywizard/inputint.h7
-rw-r--r--addon/doxywizard/inputstring.cpp2
-rw-r--r--addon/doxywizard/inputstring.h8
-rw-r--r--addon/doxywizard/inputstrlist.cpp2
-rw-r--r--addon/doxywizard/inputstrlist.h7
-rw-r--r--addon/doxywizard/pagewidget.cpp2
-rw-r--r--addon/doxywizard/pagewidget.h2
-rw-r--r--addon/doxywizard/pixmaps.cpp2
-rw-r--r--addon/doxywizard/pixmaps.h2
-rw-r--r--addon/doxywizard/qtbc.h45
18 files changed, 760 insertions, 43 deletions
diff --git a/addon/doxywizard/Makefile.in b/addon/doxywizard/Makefile.in
index 249190a..65995b5 100644
--- a/addon/doxywizard/Makefile.in
+++ b/addon/doxywizard/Makefile.in
@@ -1,5 +1,5 @@
#
-#
+# $Id$
#
# Copyright (C) 1997-2001 by Dimitri van Heesch.
#
@@ -10,30 +10,17 @@
# See the GNU General Public License for more details.
#
-CFGGENBIN_DIR = ../configgen/bin
-CFGGENSRC_DIR = ../configgen
-
-all: $(CFGGENBIN_DIR)/configgen config.h config.l doxywizard.cpp doxywizard.h \
- Makefile.doxywizard
+all: config.l config.h Makefile.doxywizard
$(MAKE) -f Makefile.doxywizard $@
-Makefile.doxywizard: doxywizard.pro doxywizard.t
- $(ENV) $(PERL) $(TMAKE) doxywizard.pro >Makefile.doxywizard
-
-config.l: $(CFGGENBIN_DIR)/configgen $(CFGGENSRC_DIR)/config_templ.l
- $(CFGGENBIN_DIR)/configgen $(CFGGENSRC_DIR)/config_templ.l >config.l
+config.l:
+ $(CP) ../../src/config.l config.l
-config.h: $(CFGGENBIN_DIR)/configgen $(CFGGENSRC_DIR)/config_templ.h
- $(CFGGENBIN_DIR)/configgen $(CFGGENSRC_DIR)/config_templ.h >config.h
+config.h:
+ $(CP) ../../src/config.h config.h
-doxywizard.cpp: $(CFGGENBIN_DIR)/configgen doxywizard_templ.cpp
- $(CFGGENBIN_DIR)/configgen doxywizard_templ.cpp >doxywizard.cpp
-
-doxywizard.h: $(CFGGENBIN_DIR)/configgen doxywizard_templ.h
- $(CFGGENBIN_DIR)/configgen doxywizard_templ.h >doxywizard.h
-
-$(CFGGENBIN_DIR)/configgen: $(CFGGENSRC_DIR)/configgen.cpp
- $(MAKE) -C $(CFGGENSRC_DIR)
+Makefile.doxywizard: doxywizard.pro
+ $(ENV) $(PERL) $(TMAKE) doxywizard.pro >Makefile.doxywizard
tmake:
$(ENV) $(PERL) $(TMAKE) doxywizard.pro >Makefile.doxywizard
@@ -42,8 +29,7 @@ clean: Makefile.doxywizard
$(MAKE) -f Makefile.doxywizard clean
distclean: clean
- $(RM) doxywizard.cpp doxywizard.h \
- config.l config.h config.cpp Makefile.doxywizard
+ $(RM) Makefile.doxywizard config.l config.h config.cpp
install:
$(INSTTOOL) -d $(INSTALL)/bin
diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp
new file mode 100644
index 0000000..8ceecbb
--- /dev/null
+++ b/addon/doxywizard/doxywizard.cpp
@@ -0,0 +1,540 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ * Copyright (C) 1997-2001 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <qmainwindow.h>
+#include <qpopupmenu.h>
+#include <qfileinfo.h>
+#include <qmenubar.h>
+#include <qstatusbar.h>
+#include <qfiledialog.h>
+#include <qmessagebox.h>
+#include <qapplication.h>
+#include <qwhatsthis.h>
+#include <qlayout.h>
+#include <qtabwidget.h>
+#include <qtoolbar.h>
+#include <qtoolbutton.h>
+
+#include "doxywizard.h"
+#include "pagewidget.h"
+#include "inputbool.h"
+#include "inputstring.h"
+#include "inputstrlist.h"
+#include "inputint.h"
+#include "config.h"
+#include "version.h"
+#include "pixmaps.h"
+
+QString configFileName;
+
+const int messageTimeout = 4000; //!< status bar message timeout in millisec.
+
+//-------------------------------------------------------------------------
+
+static bool loadConfig( QString loadFile )
+{
+ QFileInfo fi( loadFile );
+ if ( !fi.exists() )
+ {
+ QMessageBox::warning(0,
+ "Warning","Input file "+loadFile+
+ " does not exist! Starting new file.",
+ "ok"
+ );
+ return FALSE;
+ }
+ QFile f( loadFile );
+ if ( !f.open(IO_ReadOnly) )
+ {
+ QMessageBox::warning(0,
+ "Warning","Cannot open input "+loadFile+
+ " for reading!.",
+ "abort"
+ );
+ exit(1);
+ }
+
+ // set config values to their defaults
+ Config::instance()->init();
+
+ // read file into a string buffer
+ int fsize = fi.size();
+ QCString contents(fsize+1); // add room for \0 terminator
+ f.readBlock(contents.data(),fsize);
+ contents[fsize]='\0';
+
+ // parse the config file
+ // this will initialize the various Config data members
+ Config::instance()->parse(contents,loadFile);
+ Config::instance()->convertStrToVal();
+
+ f.close();
+ return TRUE;
+}
+
+static bool saveConfig( QString saveFile )
+{
+ QFile f( saveFile );
+ if ( !f.open(IO_WriteOnly) )
+ {
+ QMessageBox::warning(0,
+ "Warning","Cannot open file "+saveFile+
+ " for writing. Nothing saved!.",
+ "ok"
+ );
+ return FALSE; // failure
+ }
+
+ Config::instance()->writeTemplate(&f,TRUE); // write brief config file
+
+ return TRUE; // success
+}
+
+//--------------------------------------------------------------------------
+
+Wizard::Wizard(int argc,char **argv) :
+ QMainWindow( 0, (QCString)"DoxyWizard v"+versionString )
+{
+ // File popupmenu
+
+ hasChanged=FALSE;
+
+ fileTools = new QToolBar( this, "file operations" );
+ fileTools->setLabel( "File Operations" );
+
+ new QToolButton( QPixmap( file_xpm ), "New File", QString::null,
+ this, SLOT(newFile()), fileTools, "new file" );
+
+ //QToolButton * fileOpen =
+ new QToolButton( QPixmap( fileopen_xpm ), "Open File", QString::null,
+ this, SLOT(loadFile()), fileTools, "open file" );
+
+ //QToolButton * fileSave =
+ new QToolButton( QPixmap( filesave_xpm ), "Save File", QString::null,
+ this, SLOT(saveFile()), fileTools, "save file" );
+
+ //Micha: QToolButton * =
+ new QToolButton( QPixmap( rundoxygen_xpm ), "Save and Run doxygen", QString::null,
+ this, SLOT(runDoxygen()), fileTools, "save and run doxygen" );
+
+
+ QWhatsThis::whatsThisButton( fileTools );
+
+ QPopupMenu* file = new QPopupMenu;
+ file->insertItem( QIconSet(QPixmap(file_xpm)),
+ "&New", this, SLOT(newFile()), CTRL+Key_N );
+ file->insertItem( QIconSet(QPixmap(fileopen_xpm)),
+ "&Load", this, SLOT(loadFile()), CTRL+Key_O );
+ file->insertSeparator();
+ file->insertItem( QIconSet(QPixmap(filesave_xpm)),
+ "&Save", this, SLOT(saveFile()), CTRL+Key_S );
+ file->insertItem( "&Save as ...", this, SLOT(saveAsFile()) );
+ file->insertSeparator();
+ file->insertItem( "&Quit", this, SLOT(quit()), CTRL+Key_Q );
+
+ // Doxygen popupmenu
+ QPopupMenu* doxygen = new QPopupMenu;
+ int itemIndex = doxygen->insertItem( QIconSet(QPixmap(rundoxygen_xpm)),
+ "&Run", this, SLOT(runDoxygen()), CTRL+Key_R );
+ doxygen->setWhatsThis ( itemIndex, "Run doxygen with the current configuration file..." );
+
+ // Help popupmenu
+ QPopupMenu* help = new QPopupMenu;
+ help->insertItem( "&About", this, SLOT(about()), Key_F1 );
+ help->insertItem( "What's &This", this , SLOT(whatsThis()), SHIFT+Key_F1);
+
+ // menubar definition
+ menuBar()->insertItem( "&File", file );
+ menuBar()->insertItem( "&Doxygen", doxygen );
+ menuBar()->insertSeparator();
+ menuBar()->insertItem( "&Help", help );
+
+ statusBar()->message("Welcome to DoxyWizard",messageTimeout);
+
+ cw = new ConfigFile( this );
+ connect(cw,SIGNAL(changed()),this,SLOT(changed()));
+ setCentralWidget( cw );
+ cw->show();
+
+ if (argc==2)
+ {
+ loadFile(argv[1]);
+ }
+ else
+ {
+ newFile();
+ }
+ refreshCaption();
+
+ resize( 640, 480 );
+
+}
+
+void Wizard::newFile()
+{
+ if (hasChanged)
+ {
+ switch( QMessageBox::warning( this, "DoxyWizard",
+ "Start a new file and lose changes?\n",
+ "Yes", "No", 0, 0, 1 ))
+ {
+ case 0:
+ break;
+ default: // command aborted by the user
+ return;
+ }
+ }
+ Config::instance()->init();
+ configFileName="Doxyfile";
+ cw->init();
+}
+
+void Wizard::loadFile(const char *fileName)
+{
+ if (fileName==0)
+ {
+ configFileName = QFileDialog::getOpenFileName();
+ }
+ else
+ {
+ configFileName = fileName;
+ }
+
+ if ( !configFileName.isNull() )
+ {
+ //initData( configFileName );
+ loadConfig(configFileName);
+ cw->init();
+
+ statusBar()->message(configFileName, messageTimeout);
+ }
+}
+
+void Wizard::loadFile()
+{
+ if (hasChanged)
+ {
+ switch( QMessageBox::warning(
+ this, "DoxyWizard", "Load a new file and lose changes?\n",
+ "Yes", "No", 0, 0, 1 ))
+ {
+ case 0:
+ break;
+ default: // command aborted by the user
+ return;
+ }
+ }
+ loadFile(0);
+}
+
+void Wizard::saveFile()
+{
+ //printf("configFileName=`%s'\n",configFileName.data());
+ if (configFileName.isEmpty())
+ {
+ saveAsFile();
+ return;
+ }
+ else
+ {
+ saveConfig(configFileName);
+ statusBar()->message(configFileName + " saved", messageTimeout);
+ }
+ hasChanged = FALSE;
+ refreshCaption();
+}
+
+void Wizard::saveAsFile()
+{
+ configFileName = QFileDialog::getSaveFileName();
+ if (configFileName.isNull())
+ {
+ statusBar()->message("Save aborted", messageTimeout );
+ return; // operation cancelled by the user
+ }
+
+ saveConfig(configFileName);
+ statusBar()->message("Saved as "+ configFileName, messageTimeout );
+}
+
+//Micha
+// TODO: Use QProcess to show the output in a window
+void Wizard::runDoxygen()
+{
+ saveFile();
+ QString s = "doxygen " + configFileName;
+ system((const char*)s);
+ statusBar()->message("doxygen completed: "+ configFileName, messageTimeout );
+ hasChanged = FALSE;
+ refreshCaption();
+}
+
+
+void Wizard::quit()
+{
+ if (hasChanged)
+ {
+ switch( QMessageBox::warning( this, "DoxyWizard", "Quit and lose changes?\n",
+ "Yes", "No", 0, 0, 1 ))
+ {
+ case 0:
+ qApp->quit();
+ break;
+ case 1:
+ break;
+ }
+ }
+ else
+ {
+ qApp->quit();
+ }
+}
+
+void Wizard::changed()
+{
+ hasChanged = TRUE;
+ refreshCaption();
+}
+
+void Wizard::refreshCaption()
+{
+ QString s;
+ if (hasChanged) s=" *";
+ setCaption("Doxywizard - ["+configFileName+s+"]");
+}
+
+void Wizard::about()
+{
+ QMessageBox::about(this, "DoxyWizard",
+ "<qt><center>A tool to create and edit configuration files "
+ "that can be read by doxygen.</center><p>"
+ "<center>Written by Dimitri van Heesch</center><p>"
+ "<center>(c) 2000</center></qt>"
+ );
+}
+
+//----------------------------------------------------------------------
+
+
+ConfigFile::ConfigFile( QWidget *parent ) : QWidget( parent )
+{
+
+ m_dependencies = new QDict< QList<IInput> >(257);
+ m_dependencies->setAutoDelete(TRUE);
+ m_inputWidgets = new QDict< IInput >;
+ m_switches = new QDict< QObject >;
+
+ QVBoxLayout *layout = new QVBoxLayout( this );
+
+ // QTabWidget definition
+ QTabWidget *tab = new QTabWidget( this );
+ layout->addWidget( tab );
+
+ QListIterator<ConfigOption> options = Config::instance()->iterator();
+ PageWidget *page = 0;
+ ConfigOption *option = 0;
+ for (options.toFirst();(option=options.current());++options)
+ {
+ switch(option->kind())
+ {
+ case ConfigOption::O_Info:
+ if (page) page->addStretch(1);
+ page = new PageWidget( tab, option->name() );
+ QWhatsThis::add(page, option->docs().simplifyWhiteSpace() );
+ break;
+ case ConfigOption::O_String:
+ {
+ ASSERT(page!=0);
+ InputString::StringMode sm;
+ switch(((ConfigString *)option)->widgetType())
+ {
+ case ConfigString::String: sm=InputString::StringFree; break;
+ case ConfigString::File: sm=InputString::StringFile; break;
+ case ConfigString::Dir: sm=InputString::StringDir; break;
+ }
+ InputString *inputString = new InputString(
+ option->name(), // name
+ page, // widget
+ *((ConfigString *)option)->valueRef(), // variable
+ sm // type
+ );
+ QWhatsThis::add(inputString, option->docs().simplifyWhiteSpace() );
+ connect(inputString,SIGNAL(changed()),SIGNAL(changed()));
+ m_inputWidgets->insert(option->name(),inputString);
+ addDependency(m_switches,option->dependsOn(),option->name());
+ }
+ break;
+ case ConfigOption::O_Enum:
+ {
+ ASSERT(page!=0);
+ InputString *inputString = new InputString(
+ option->name(), // name
+ page, // widget
+ *((ConfigEnum *)option)->valueRef(), // variable
+ InputString::StringFixed // type
+ );
+ QStrListIterator sli=((ConfigEnum *)option)->iterator();
+ for (sli.toFirst();sli.current();++sli)
+ {
+ inputString->addValue(sli.current());
+ }
+ QWhatsThis::add(inputString, option->docs().simplifyWhiteSpace() );
+ connect(inputString,SIGNAL(changed()),SIGNAL(changed()));
+ m_inputWidgets->insert(option->name(),inputString);
+ addDependency(m_switches,option->dependsOn(),option->name());
+ }
+ break;
+ case ConfigOption::O_List:
+ {
+ ASSERT(page!=0);
+ InputStrList::ListMode lm;
+ switch(((ConfigList *)option)->widgetType())
+ {
+ case ConfigList::String: lm=InputStrList::ListString; break;
+ case ConfigList::File: lm=InputStrList::ListFile; break;
+ case ConfigList::Dir: lm=InputStrList::ListDir; break;
+ case ConfigList::FileAndDir: lm=InputStrList::ListFileDir; break;
+ }
+ InputStrList *inputStrList = new InputStrList(
+ option->name(), // name
+ page, // widget
+ *((ConfigList *)option)->valueRef(), // variable
+ lm // type
+ );
+ QWhatsThis::add(inputStrList, option->docs().simplifyWhiteSpace() );
+ connect(inputStrList,SIGNAL(changed()),SIGNAL(changed()));
+ m_inputWidgets->insert(option->name(),inputStrList);
+ addDependency(m_switches,option->dependsOn(),option->name());
+ }
+ break;
+ break;
+ case ConfigOption::O_Bool:
+ {
+ ASSERT(page!=0);
+ InputBool *inputBool = new InputBool(
+ option->name(), // name
+ page, // widget
+ *((ConfigBool *)option)->valueRef() // variable
+ );
+ QWhatsThis::add(inputBool, option->docs().simplifyWhiteSpace() );
+ connect(inputBool,SIGNAL(changed()),SIGNAL(changed()));
+ m_inputWidgets->insert(option->name(),inputBool);
+ addDependency(m_switches,option->dependsOn(),option->name());
+ }
+ break;
+ case ConfigOption::O_Int:
+ {
+ ASSERT(page!=0);
+ InputInt *inputInt = new InputInt(
+ option->name(), // name
+ page, // widget
+ *((ConfigInt *)option)->valueRef(), // variable
+ ((ConfigInt *)option)->minVal(), // min value
+ ((ConfigInt *)option)->maxVal() // max value
+ );
+ QWhatsThis::add(inputInt, option->docs().simplifyWhiteSpace() );
+ connect(inputInt,SIGNAL(changed()),SIGNAL(changed()));
+ m_inputWidgets->insert(option->name(),inputInt);
+ addDependency(m_switches,option->dependsOn(),option->name());
+ }
+ break;
+ }
+ }
+ if (page) page->addStretch(1);
+
+ QDictIterator<QObject> di(*m_switches);
+ QObject *obj = 0;
+ for (di.toFirst();(obj=di.current());++di)
+ {
+ connect(obj,SIGNAL(toggle(const char *,bool)),SLOT(toggle(const char *,bool)));
+ // UGLY HACK: assumes each item depends on a boolean without checking!
+ emit toggle(di.currentKey(),((InputBool *)obj)->getState());
+ }
+
+}
+
+ConfigFile::~ConfigFile()
+{
+ delete m_dependencies;
+ delete m_inputWidgets;
+ delete m_switches;
+}
+
+void ConfigFile::addDependency(QDict<QObject> *switches,
+ const QCString &dep,const QCString &name)
+{
+ if (!dep.isEmpty())
+ {
+ IInput *parent = m_inputWidgets->find(dep);
+ ASSERT(parent!=0);
+ IInput *child = m_inputWidgets->find(name);
+ ASSERT(child!=0);
+ if (switches->find(dep)==0)
+ {
+ switches->insert(dep,parent->qobject());
+ }
+ QList<IInput> *list = m_dependencies->find(dep);
+ if (list==0)
+ {
+ list = new QList<IInput>;
+ m_dependencies->insert(dep,list);
+ }
+ list->append(child);
+ }
+}
+
+void ConfigFile::toggle(const char *name,bool state)
+{
+ QList<IInput> *inputs = m_dependencies->find(name);
+ ASSERT(inputs!=0);
+ IInput *input = inputs->first();
+ while (input)
+ {
+ input->setEnabled(state);
+ input = inputs->next();
+ }
+}
+
+void ConfigFile::init()
+{
+ QDictIterator<IInput> di(*m_inputWidgets);
+ IInput *input = 0;
+ for (di.toFirst();(input=di.current());++di)
+ {
+ input->init();
+ }
+ QDictIterator<QObject> dio(*m_switches);
+ QObject *obj = 0;
+ for (dio.toFirst();(obj=dio.current());++dio)
+ {
+ connect(obj,SIGNAL(toggle(const char *,bool)),SLOT(toggle(const char *,bool)));
+ // UGLY HACK: assumes each item depends on a boolean without checking!
+ emit toggle(dio.currentKey(),((InputBool *)obj)->getState());
+ }
+
+}
+
+//----------------------------------------------------------------------
+
+int main(int argc,char **argv)
+{
+ QApplication::setColorSpec( QApplication::NormalColor );
+ QApplication app(argc,argv);
+ Wizard wizard(argc,argv);
+ app.setMainWidget( &wizard );
+ wizard.show();
+ return app.exec();
+}
diff --git a/addon/doxywizard/doxywizard.h b/addon/doxywizard/doxywizard.h
new file mode 100644
index 0000000..f78733e
--- /dev/null
+++ b/addon/doxywizard/doxywizard.h
@@ -0,0 +1,111 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ * Copyright (C) 1997-2001 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
+#ifndef _DOXWIZARD_H
+#define _DOXWIZARD_H
+
+#include <qmainwindow.h>
+#include <qlist.h>
+#include <qdict.h>
+
+class IInput;
+class QToolBar;
+class QWidget;
+class QObject;
+class ConfigFile;
+class InputBool;
+class InputString;
+class InputStrList;
+class InputFile;
+class InputDir;
+class InputInt;
+
+class Wizard : public QMainWindow
+{
+ Q_OBJECT
+
+ public:
+ Wizard(int argc,char **argv);
+ ~Wizard(){};
+ void loadFile(const char *s);
+
+ private slots:
+ void newFile();
+ void loadFile();
+ void saveFile();
+ void saveAsFile();
+ void quit();
+ void changed();
+ void about();
+ void runDoxygen(); // Micha
+
+ signals:
+
+ private:
+ void refreshCaption();
+ QToolBar *fileTools;
+ bool hasChanged;
+ ConfigFile *cw;
+};
+
+class ConfigWidget
+{
+ public:
+ enum Kind { Int, String, StrList, Bool };
+
+ ConfigWidget(QWidget *w,Kind k) : m_widget(w), m_kind(k) {}
+
+ Kind kind() const { return m_kind; }
+
+ InputString *getString() const
+ { return m_kind==String ? (InputString *)m_widget : 0; }
+
+ InputBool *getBool() const
+ { return m_kind==Bool ? (InputBool *)m_widget : 0; }
+
+ InputStrList *getStrList() const
+ { return m_kind==StrList ? (InputStrList *)m_widget : 0; }
+
+ InputInt *getInt() const
+ { return m_kind==Int ? (InputInt *)m_widget : 0; }
+
+ private:
+ QWidget *m_widget;
+ Kind m_kind;
+};
+
+class ConfigFile : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ ConfigFile(QWidget *parent=0);
+ ~ConfigFile();
+ void init();
+ void addDependency(QDict<QObject> *switches,
+ const QCString &dep,const QCString &name);
+
+ signals:
+ void changed();
+
+ private slots:
+ void toggle(const char *,bool);
+
+ private:
+ QDict<IInput> *m_inputWidgets;
+ QDict< QList<IInput> > *m_dependencies;
+ QDict<QObject> *m_switches;
+};
+
+#endif
diff --git a/addon/doxywizard/doxywizard.pro.in b/addon/doxywizard/doxywizard.pro.in
index b7a690f..649c395 100644
--- a/addon/doxywizard/doxywizard.pro.in
+++ b/addon/doxywizard/doxywizard.pro.in
@@ -1,5 +1,5 @@
#
-#
+# $Id$
#
# Copyright (C) 1997-2001 by Dimitri van Heesch.
#
@@ -22,24 +22,24 @@ CONFIG = qt warn_on $extraopts
# header file for the project
HEADERS = doxywizard.h \
- config.h \
version.h \
pagewidget.h \
inputstring.h \
inputbool.h \
inputstrlist.h \
inputint.h \
+ config.h \
pixmaps.h
# source flle for the project
SOURCES = doxywizard.cpp \
- config.cpp \
version.cpp \
pagewidget.cpp \
inputstring.cpp \
inputbool.cpp \
inputstrlist.cpp \
inputint.cpp \
+ config.cpp \
pixmaps.cpp
# where to put the objects
@@ -50,3 +50,4 @@ MOC_DIR = moc
# extra C++ compiler options
TMAKE_CXXFLAGS += -DDOXYWIZARD
+
diff --git a/addon/doxywizard/input.h b/addon/doxywizard/input.h
new file mode 100644
index 0000000..ab9bcf5
--- /dev/null
+++ b/addon/doxywizard/input.h
@@ -0,0 +1,14 @@
+#ifndef _INPUT_H
+#define _INPUT_H
+
+class QObject;
+
+class IInput
+{
+ public:
+ virtual void init() = 0;
+ virtual void setEnabled(bool) = 0;
+ virtual QObject *qobject() = 0;
+};
+
+#endif
diff --git a/addon/doxywizard/inputbool.cpp b/addon/doxywizard/inputbool.cpp
index c63696a..4ac2f8a 100644
--- a/addon/doxywizard/inputbool.cpp
+++ b/addon/doxywizard/inputbool.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
@@ -36,7 +36,11 @@ void InputBool::init()
void InputBool::setState( bool s )
{
- if (state!=s) emit changed();
+ if (state!=s)
+ {
+ emit changed();
+ emit toggle(text(),s);
+ }
state=s;
}
diff --git a/addon/doxywizard/inputbool.h b/addon/doxywizard/inputbool.h
index 2bd8d7a..9c2511f 100644
--- a/addon/doxywizard/inputbool.h
+++ b/addon/doxywizard/inputbool.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
@@ -17,9 +17,11 @@
#include <qcheckbox.h>
+#include "input.h"
+
class PageWidget;
-class InputBool : public QCheckBox
+class InputBool : public QCheckBox, public IInput
{
Q_OBJECT
@@ -27,9 +29,13 @@ class InputBool : public QCheckBox
InputBool( const QString &text, PageWidget *parent, bool &flag );
~InputBool(){};
void init();
+ void setEnabled(bool b) { QCheckBox::setEnabled(b); }
+ QObject *qobject() { return this; }
+ bool getState() const { return state; }
signals:
void changed();
+ void toggle(const char *,bool);
private slots:
void setState(bool);
diff --git a/addon/doxywizard/inputint.cpp b/addon/doxywizard/inputint.cpp
index 702988c..d6173c4 100644
--- a/addon/doxywizard/inputint.cpp
+++ b/addon/doxywizard/inputint.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
diff --git a/addon/doxywizard/inputint.h b/addon/doxywizard/inputint.h
index 434cb39..28da9cf 100644
--- a/addon/doxywizard/inputint.h
+++ b/addon/doxywizard/inputint.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
@@ -18,11 +18,13 @@
#include <qwidget.h>
#include <qstring.h>
+#include "input.h"
+
class QLabel;
class QSpinBox;
class PageWidget;
-class InputInt : public QWidget
+class InputInt : public QWidget, public IInput
{
Q_OBJECT
@@ -32,6 +34,7 @@ class InputInt : public QWidget
~InputInt(){};
void setEnabled(bool);
void init();
+ QObject *qobject() { return this; }
private:
QLabel *lab;
diff --git a/addon/doxywizard/inputstring.cpp b/addon/doxywizard/inputstring.cpp
index a20ba68..e43fc93 100644
--- a/addon/doxywizard/inputstring.cpp
+++ b/addon/doxywizard/inputstring.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
diff --git a/addon/doxywizard/inputstring.h b/addon/doxywizard/inputstring.h
index e1b42cf..794f93e 100644
--- a/addon/doxywizard/inputstring.h
+++ b/addon/doxywizard/inputstring.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
@@ -19,13 +19,16 @@
#include <qstring.h>
#include <qdict.h>
+#include "qtbc.h"
+#include "input.h"
+
class QLabel;
class QLineEdit;
class QPushButton;
class QComboBox;
class PageWidget;
-class InputString : public QWidget
+class InputString : public QWidget, public IInput
{
Q_OBJECT
@@ -42,6 +45,7 @@ class InputString : public QWidget
void setEnabled(bool);
void addValue(const char *s);
void init();
+ QObject *qobject() { return this; }
private:
QLabel *lab;
diff --git a/addon/doxywizard/inputstrlist.cpp b/addon/doxywizard/inputstrlist.cpp
index 9ab9a5b..c6c34f4 100644
--- a/addon/doxywizard/inputstrlist.cpp
+++ b/addon/doxywizard/inputstrlist.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
diff --git a/addon/doxywizard/inputstrlist.h b/addon/doxywizard/inputstrlist.h
index 3bf6371..e60b036 100644
--- a/addon/doxywizard/inputstrlist.h
+++ b/addon/doxywizard/inputstrlist.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
@@ -18,6 +18,8 @@
#include <qwidget.h>
#include <qstring.h>
+#include "input.h"
+
class QLabel;
class QLineEdit;
class QPushButton;
@@ -25,7 +27,7 @@ class QListBox;
class PageWidget;
class QStrList;
-class InputStrList : public QWidget
+class InputStrList : public QWidget, public IInput
{
Q_OBJECT
@@ -41,6 +43,7 @@ class InputStrList : public QWidget
~InputStrList() {};
void setEnabled(bool);
void init();
+ QObject *qobject() { return this; }
private:
QLabel *lab;
diff --git a/addon/doxywizard/pagewidget.cpp b/addon/doxywizard/pagewidget.cpp
index 7e6920b..67d4d57 100644
--- a/addon/doxywizard/pagewidget.cpp
+++ b/addon/doxywizard/pagewidget.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
diff --git a/addon/doxywizard/pagewidget.h b/addon/doxywizard/pagewidget.h
index 6d238df..266fcc4 100644
--- a/addon/doxywizard/pagewidget.h
+++ b/addon/doxywizard/pagewidget.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
diff --git a/addon/doxywizard/pixmaps.cpp b/addon/doxywizard/pixmaps.cpp
index 5f2497b..6c7199b 100644
--- a/addon/doxywizard/pixmaps.cpp
+++ b/addon/doxywizard/pixmaps.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
diff --git a/addon/doxywizard/pixmaps.h b/addon/doxywizard/pixmaps.h
index 7ec854e..144fee3 100644
--- a/addon/doxywizard/pixmaps.h
+++ b/addon/doxywizard/pixmaps.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- *
+ * $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
diff --git a/addon/doxywizard/qtbc.h b/addon/doxywizard/qtbc.h
new file mode 100644
index 0000000..13b6fea
--- /dev/null
+++ b/addon/doxywizard/qtbc.h
@@ -0,0 +1,45 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ * Copyright (C) 1997-2001 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#ifndef QTBC_H
+#define QTBC_H
+
+/*! This file contains some hacks to make Doxygen work with
+ * Qt version 2.00 and Qt version 1.xx
+ */
+
+#include <qglobal.h>
+
+#if QT_VERSION >= 200
+
+#include <locale.h>
+
+#define GCI QCollection::Item
+
+#include <qcstring.h>
+#include <qstring.h>
+inline QCString convertToQCString(const QString &s) { return s.latin1(); }
+
+#else /* QT_VERSION < 200 */
+
+#include <qstring.h>
+#define QCString QString
+inline QCString convertToQCString(const QCString &s) { return s; }
+
+#endif
+
+#endif