Alien-SmokeQt

 view release on metacpan or  search on metacpan

CMakeLists.txt  view on Meta::CPAN

    add_definitions(-DQT3_SUPPORT)
endif(WITH_QT3_SUPPORT)

macro_optional_find_package(QImageBlitz)
macro_log_feature(QIMAGEBLITZ_FOUND "QImageBlitz" "QImageBlitz library" "http://www.kde.org" FALSE "" "Needed to compile QImageBlitz bindings")

macro_optional_find_package(Qwt5)
macro_log_feature(Qwt5_Qt4_FOUND "Qwt5 for Qt4" "Qwt5 libraries for Qt4" "http://qwt.sourceforge.net" FALSE "" "Needed to compile Qwt5 bindings")

macro_optional_find_package(Phonon)
macro_log_feature(PHONON_FOUND "Phonon" "Phonon multimedia framework" "http://www.kde.org" FALSE "" "Needed to compile Phonon bindings")

macro_optional_find_package(QScintilla)
macro_log_feature(QSCINTILLA_FOUND "QScintilla2" "QScintilla2 libraries" "http://www.riverbankcomputing.co.uk/software/qscintilla/intro" FALSE "" "Needed to compile QScintilla2 bindings")

macro_optional_add_subdirectory(smoke)

install( FILES lib/Alien/SmokeQt.pm DESTINATION ${CMAKE_INSTALL_PREFIX}/../ )

ENABLE_TESTING()
macro_display_feature_log()

README  view on Meta::CPAN

This package contains:
* working:
  * smoke: Language independent library for Qt and KDE bindings. Used by QtRuby, 
    PerlQt and Qyoto.
  * kalyptus: a header parser and bindings generator for Qt/KDE. Used for Smoke.
  * qtruby: Qt bindings for Ruby
  * korundum: KDE bindings for ruby
  * Qyoto: Qt bindings for C#
  * Kimono: KDE bindings for C#
  * PyKDE: KDE bindings for python, requires PyQt from riverbankcomputing.co.uk
  * KrossPython is the Python plugin for the kdelibs/kross scripting framework.
  * KrossRuby is the Ruby plugin for the kdelibs/kross scripting framework.
  * KrossJava is the Java plugin for the kdelibs/kross scripting framework.
  * KrossFalcon is the Falcon (http://www.falconpl.org) plugin for the kdelibs/kross scripting framework.

* possibly broken: 
  * xparts: allows you to embed non-KDE apps as a KPart

* obsolete:
  * dcopperl: DCOP bindings for Perl
    => perldbus
  * kjsembed: javascript scripting support library for KDE applications
    => moved to kdelibs
  * qtjava: Qt bindings for Java JNI to use Qt/KDE classes with Java

generator/parser/rpp/pp-macro-expander.cpp  view on Meta::CPAN

  
  int firstValid = 0;
  for(; firstValid < array.size(); ++firstValid)
    if(array[firstValid] != indexFromCharacter(' '))
      break;
  array = array.mid(firstValid);
}

using namespace rpp;              

pp_frame::pp_frame(pp_macro* __expandingMacro, const QList<pp_actual>& __actuals)
  : depth(0)
  , expandingMacro(__expandingMacro)
  , actuals(__actuals)
{
}

pp_actual pp_macro_expander::resolve_formal(IndexedString name, Stream& input)
{
  if (!m_frame)
    return pp_actual();

  Q_ASSERT(m_frame->expandingMacro != 0);

  const QVector<IndexedString>& formals = m_frame->expandingMacro->formals;
  uint formalsSize = formals.size();

  if(name.isEmpty()) {
    Problem *problem = new Problem;
    problem->file = m_engine->currentFileNameString();
    problem->position = input.originalInputPosition();
    problem->description = "Macro error";
    m_engine->problemEncountered(problem);
    return pp_actual();
  }
  
  for (uint index = 0; index < formalsSize; ++index) {
    if (name.index() == formals[index].index()) {
      if (index < (uint)m_frame->actuals.size()) {
        return m_frame->actuals[index];
      }
      else {
        Problem *problem = new Problem;
        problem->file = m_engine->currentFileNameString();
        problem->position = input.originalInputPosition();
        problem->description = QString("Call to macro %1 missing argument number %2").arg(name.str()).arg(index);
        problem->explanation = QString("Formals: %1").arg(joinIndexVector(formals, ", "));
        m_engine->problemEncountered(problem);
      }
    }
  }

  return pp_actual();
}

#define RETURN_IF_INPUT_BROKEN    if(input.atEnd()) { qDebug() << "too early end while expanding" << macro->name.str(); return; }


pp_macro_expander::pp_macro_expander(pp* engine, pp_frame* frame, bool inHeaderSection)
  : m_engine(engine)
  , m_frame(frame)
  , m_in_header_section(inHeaderSection)
  , m_search_significant_content(false)
  , m_found_significant_content(false)
{
  if(m_in_header_section)
    m_search_significant_content = true; //Find the end of the header section
}

//A header-section ends when the first non-directive and non-comment occurs
#define check_header_section \

generator/parser/rpp/pp-macro-expander.cpp  view on Meta::CPAN

          
          PreprocessedContents newExpanded;
          
          {
            //Expand "add", so it is eventually replaced by an actual
            PreprocessedContents actualText;
            actualText.append(add.index());

            {
              Stream as(&actualText);
              pp_macro_expander expand_actual(m_engine, m_frame);
              Stream nas(&newExpanded);
              expand_actual(as, nas);
            }
          }
          
          if(!newExpanded.isEmpty()) {
            IndexedString first = IndexedString::fromIndex(newExpanded.first());
            if(!isCharacter(first.index()) || QChar(characterFromIndex(first.index())).isLetterOrNumber() || characterFromIndex(first.index()) == '_') {
              //Merge the tokens
              newExpanded.first() = IndexedString(previous.byteArray() + first.byteArray()).index();
            }else{
              //Cannot merge, prepend the previous text
              newExpanded.prepend(previous.index());
            }
          }else{
            newExpanded.append(previous.index());
          }
          
          //Now expand the merged text completely into the output.
          pp_macro_expander final_expansion(m_engine, m_frame);
          Stream nas(&newExpanded, output.currentOutputAnchor());
          final_expansion(nas, output);
          continue;
        }
        
        skip_blanks(input, output);

        IndexedString identifier = IndexedString::fromIndex( skip_identifier(input) );

        Anchor inputPosition = input.inputPosition();

generator/parser/rpp/pp-macro-expander.cpp  view on Meta::CPAN

        
        //In case expansion fails, we can skip back to this position
        int openingPosition = input.offset();
        Anchor openingPositionCursor = input.inputPosition();
        
        QList<pp_actual> actuals;
        ++input; // skip '('
        
        RETURN_IF_INPUT_BROKEN

        pp_macro_expander expand_actual(m_engine, m_frame);

        {
          PreprocessedContents actualText;
          skip_whitespaces(input, devnull());
          Anchor actualStart = input.inputPosition();
          {
            Stream as(&actualText);
            skip_argument_variadics(actuals, macro, input, as);
          }
          trim(actualText);

generator/parser/rpp/pp-macro-expander.cpp  view on Meta::CPAN

        //Q_ASSERT(!input.atEnd() && input == ')');

        ++input; // skip ')'
        
#if 0 // ### enable me
        assert ((macro->variadics && macro->formals.size () >= actuals.size ())
                    || macro->formals.size() == actuals.size());
#endif
        EnableMacroExpansion enable(output, input.inputPosition()); //Configure the output-stream so it marks all stored input-positions as transformed through a macro

        pp_frame frame(macro, actuals);
        if(m_frame)
          frame.depth = m_frame->depth + 1;
        
        if(frame.depth >= maxMacroExpansionDepth) 
        {
          qDebug() << "reached maximum macro-expansion depth while expanding" << macro->name.str();
          RETURN_IF_INPUT_BROKEN
          
          output << input;
          ++input;
        }else{
          pp_macro_expander expand_macro(m_engine, &frame);
          macro->hidden = true;
          ///@todo UGLY conversion
          Stream ms((uint*)macro->definition.constData(), macro->definition.size(), Anchor(input.inputPosition(), true));
          ms.setOriginalInputPosition(input.originalInputPosition());
          expand_macro(ms, output);
          output << ' '; //Prevent implicit token merging
          macro->hidden = false;
        }
      } else {
        output << input;

generator/parser/rpp/pp-macro-expander.cpp.orig  view on Meta::CPAN

  
  int firstValid = 0;
  for(; firstValid < array.size(); ++firstValid)
    if(array[firstValid] != indexFromCharacter(' '))
      break;
  array = array.mid(firstValid);
}

using namespace rpp;              

pp_frame::pp_frame(pp_macro* __expandingMacro, const QList<pp_actual>& __actuals)
  : depth(0)
  , expandingMacro(__expandingMacro)
  , actuals(__actuals)
{
}

pp_actual pp_macro_expander::resolve_formal(IndexedString name, Stream& input)
{
  if (!m_frame)
    return pp_actual();

  Q_ASSERT(m_frame->expandingMacro != 0);

  const QVector<IndexedString>& formals = m_frame->expandingMacro->formals;
  uint formalsSize = formals.size();

  if(name.isEmpty()) {
    Problem *problem = new Problem;
    problem->file = m_engine->currentFileNameString();
    problem->position = input.originalInputPosition();
    problem->description = "Macro error";
    m_engine->problemEncountered(problem);
    return pp_actual();
  }
  
  for (uint index = 0; index < formalsSize; ++index) {
    if (name.index() == formals[index].index()) {
      if (index < (uint)m_frame->actuals.size()) {
        return m_frame->actuals[index];
      }
      else {
        Problem *problem = new Problem;
        problem->file = m_engine->currentFileNameString();
        problem->position = input.originalInputPosition();
        problem->description = QString("Call to macro %1 missing argument number %2").arg(name.str()).arg(index);
        problem->explanation = QString("Formals: %1").arg(joinIndexVector(formals, ", "));
        m_engine->problemEncountered(problem);
      }
    }
  }

  return pp_actual();
}

pp_macro_expander::pp_macro_expander(pp* engine, pp_frame* frame, bool inHeaderSection)
  : m_engine(engine)
  , m_frame(frame)
  , m_in_header_section(inHeaderSection)
  , m_search_significant_content(false)
  , m_found_significant_content(false)
{
  if(m_in_header_section)
    m_search_significant_content = true; //Find the end of the header section
}

//A header-section ends when the first non-directive and non-comment occurs
#define check_header_section \

generator/parser/rpp/pp-macro-expander.cpp.orig  view on Meta::CPAN

          
          PreprocessedContents newExpanded;
          
          {
            //Expand "add", so it is eventually replaced by an actual
            PreprocessedContents actualText;
            actualText.append(add.index());

            {
              Stream as(&actualText);
              pp_macro_expander expand_actual(m_engine, m_frame);
              Stream nas(&newExpanded);
              expand_actual(as, nas);
            }
          }
          
          if(!newExpanded.isEmpty()) {
            IndexedString first = IndexedString::fromIndex(newExpanded.first());
            if(!isCharacter(first.index()) || QChar(characterFromIndex(first.index())).isLetterOrNumber() || characterFromIndex(first.index()) == '_') {
              //Merge the tokens
              newExpanded.first() = IndexedString(previous.byteArray() + first.byteArray()).index();
            }else{
              //Cannot merge, prepend the previous text
              newExpanded.prepend(previous.index());
            }
          }else{
            newExpanded.append(previous.index());
          }
          
          //Now expand the merged text completely into the output.
          pp_macro_expander final_expansion(m_engine, m_frame);
          Stream nas(&newExpanded, output.currentOutputAnchor());
          final_expansion(nas, output);
          continue;
        }
        
        skip_blanks(input, output);

        IndexedString identifier = IndexedString::fromIndex( skip_identifier(input) );

        Anchor inputPosition = input.inputPosition();

generator/parser/rpp/pp-macro-expander.cpp.orig  view on Meta::CPAN

          continue;
        }
        
        //In case expansion fails, we can skip back to this position
        int openingPosition = input.offset();
        Anchor openingPositionCursor = input.inputPosition();
        
        QList<pp_actual> actuals;
        ++input; // skip '('

        pp_macro_expander expand_actual(m_engine, m_frame);

        {
          PreprocessedContents actualText;
          skip_whitespaces(input, devnull());
          Anchor actualStart = input.inputPosition();
          {
            Stream as(&actualText);
            skip_argument_variadics(actuals, macro, input, as);
          }
          trim(actualText);

generator/parser/rpp/pp-macro-expander.cpp.orig  view on Meta::CPAN

        //Q_ASSERT(!input.atEnd() && input == ')');

        ++input; // skip ')'

#if 0 // ### enable me
        assert ((macro->variadics && macro->formals.size () >= actuals.size ())
                    || macro->formals.size() == actuals.size());
#endif
        EnableMacroExpansion enable(output, input.inputPosition()); //Configure the output-stream so it marks all stored input-positions as transformed through a macro

        pp_frame frame(macro, actuals);
        if(m_frame)
          frame.depth = m_frame->depth + 1;
        
        if(frame.depth >= maxMacroExpansionDepth) 
        {
          qDebug() << "reached maximum macro-expansion depth while expanding" << macro->name.str();
          output << input;
          ++input;
        }else{
          pp_macro_expander expand_macro(m_engine, &frame);
          macro->hidden = true;
          ///@todo UGLY conversion
          Stream ms((uint*)macro->definition.constData(), macro->definition.size(), Anchor(input.inputPosition(), true));
          ms.setOriginalInputPosition(input.originalInputPosition());
          expand_macro(ms, output);
          output << ' '; //Prevent implicit token merging
          macro->hidden = false;
        }
      } else {
        output << input;

generator/parser/rpp/pp-macro-expander.h  view on Meta::CPAN

      return text.at(0);
    
    PreprocessedContents ret;
    
    foreach(const PreprocessedContents& t, text)
      ret += t;
    return ret;
  }
};

class pp_frame
{
public:
  pp_frame (pp_macro* __expandingMacro, const QList<pp_actual>& __actuals);

  int depth;
  pp_macro* expandingMacro;
  QList<pp_actual> actuals;
};

class pp_macro_expander
{
public:
  explicit pp_macro_expander(pp* engine, pp_frame* frame = 0, bool inHeaderSection = false);

  pp_actual resolve_formal(IndexedString name, Stream& input);

  /// Expands text with the known macros. Continues until it finds a new text line
  /// beginning with #, at which point control is returned.
  void operator()(Stream& input, Stream& output);

  void skip_argument_variadics (const QList<pp_actual>& __actuals, pp_macro *__macro,
                                Stream& input, Stream& output);

generator/parser/rpp/pp-macro-expander.h  view on Meta::CPAN

  bool foundSignificantContent() const {
    return m_found_significant_content;
  }
  
  void startSignificantContentSearch() {
    m_search_significant_content = true;
  }
  
private:
  pp* m_engine;
  pp_frame* m_frame;

  pp_skip_number skip_number;
  pp_skip_identifier skip_identifier;
  pp_skip_string_literal skip_string_literal;
  pp_skip_char_literal skip_char_literal;
  pp_skip_argument skip_argument;
  pp_skip_comment_or_divop skip_comment_or_divop;
  pp_skip_blanks skip_blanks;
  pp_skip_whitespaces skip_whitespaces;

smoke/qt/qtcore/tests/test.cpp  view on Meta::CPAN

#include "QtGui/qfontdialog.h"

int main(int argc, char ** argv)
{
  QFontDialog::getFont( (bool *)NULL );
}

#endif

#ifdef TEST_QT_NO_FRAME
#include "QtGui/qframe.h"

int main(int argc, char ** argv)
{
  QFrame foo;
}

#endif

#ifdef TEST_QT_NO_FTP
#include "QtNetwork/qftp.h"



( run in 0.787 second using v1.01-cache-2.11-cpan-df04353d9ac )