[Geesas-Devs] SF.net SVN: geesas:[48] QScintillAS/Qt4
Status: Abandoned
Brought to you by:
creek23
From: <cr...@us...> - 2010-07-16 13:27:11
|
Revision: 48 http://geesas.svn.sourceforge.net/geesas/?rev=48&view=rev Author: creek23 Date: 2010-07-16 13:27:05 +0000 (Fri, 16 Jul 2010) Log Message: ----------- QScintilla2 headers Added Paths: ----------- QScintillAS/Qt4/ListBoxQt.h QScintillAS/Qt4/SciClasses.h QScintillAS/Qt4/ScintillaQt.h Added: QScintillAS/Qt4/ListBoxQt.h =================================================================== --- QScintillAS/Qt4/ListBoxQt.h (rev 0) +++ QScintillAS/Qt4/ListBoxQt.h 2010-07-16 13:27:05 UTC (rev 48) @@ -0,0 +1,82 @@ +// This defines the specialisation of QListBox that handles the Scintilla +// double-click callback. +// +// Copyright (c) 2008 Riverbank Computing Limited <in...@ri...> +// +// This file is part of QScintilla. +// +// This file may be used under the terms of the GNU General Public +// License versions 2.0 or 3.0 as published by the Free Software +// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 +// included in the packaging of this file. Alternatively you may (at +// your option) use any later version of the GNU General Public +// License if such license has been publicly approved by Riverbank +// Computing Limited (or its successors, if any) and the KDE Free Qt +// Foundation. In addition, as a special exception, Riverbank gives you +// certain additional rights. These rights are described in the Riverbank +// GPL Exception version 1.1, which can be found in the file +// GPL_EXCEPTION.txt in this package. +// +// Please review the following information to ensure GNU General +// Public Licensing requirements will be met: +// http://trolltech.com/products/qt/licenses/licensing/opensource/. If +// you are unsure which license is appropriate for your use, please +// review the following information: +// http://trolltech.com/products/qt/licenses/licensing/licensingoverview +// or contact the sales department at sa...@ri.... +// +// This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly +// granted herein. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + + +#include <qmap.h> +#include <qpixmap.h> +#include <qstring.h> + +#include "Platform.h" + + +class SciListBox; + + +class ListBoxQt : public ListBox +{ +public: + ListBoxQt(); + + CallBackAction cb_action; + void *cb_data; + + virtual void SetFont(Font &font); + virtual void Create(Window &parent, int, Point, int, bool unicodeMode); + virtual void SetAverageCharWidth(int); + virtual void SetVisibleRows(int); + virtual int GetVisibleRows() const; + virtual PRectangle GetDesiredRect(); + virtual int CaretFromEdge(); + virtual void Clear(); + virtual void Append(char *s, int type = -1); + virtual int Length(); + virtual void Select(int n); + virtual int GetSelection(); + virtual int Find(const char *prefix); + virtual void GetValue(int n, char *value, int len); + virtual void Sort(); + virtual void RegisterImage(int type, const char *xpm_data); + virtual void ClearRegisteredImages(); + virtual void SetDoubleClickAction(CallBackAction action, void *data); + virtual void SetList(const char *list, char separator, char typesep); + +private: + SciListBox *slb; + int visible_rows; + bool utf8; + + typedef QMap<int, QPixmap> xpmMap; + xpmMap xset; +}; Added: QScintillAS/Qt4/SciClasses.h =================================================================== --- QScintillAS/Qt4/SciClasses.h (rev 0) +++ QScintillAS/Qt4/SciClasses.h 2010-07-16 13:27:05 UTC (rev 48) @@ -0,0 +1,124 @@ +// The definition of various Qt version independent classes used by the rest of +// the port. +// +// Copyright (c) 2008 Riverbank Computing Limited <in...@ri...> +// +// This file is part of QScintilla. +// +// This file may be used under the terms of the GNU General Public +// License versions 2.0 or 3.0 as published by the Free Software +// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 +// included in the packaging of this file. Alternatively you may (at +// your option) use any later version of the GNU General Public +// License if such license has been publicly approved by Riverbank +// Computing Limited (or its successors, if any) and the KDE Free Qt +// Foundation. In addition, as a special exception, Riverbank gives you +// certain additional rights. These rights are described in the Riverbank +// GPL Exception version 1.1, which can be found in the file +// GPL_EXCEPTION.txt in this package. +// +// Please review the following information to ensure GNU General +// Public Licensing requirements will be met: +// http://trolltech.com/products/qt/licenses/licensing/opensource/. If +// you are unsure which license is appropriate for your use, please +// review the following information: +// http://trolltech.com/products/qt/licenses/licensing/licensingoverview +// or contact the sales department at sa...@ri.... +// +// This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly +// granted herein. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + + +#ifndef _SCICLASSES_H +#define _SCICLASSES_H + +#include <qglobal.h> +#include <qwidget.h> + + +class QMouseEvent; +class QPaintEvent; +class ScintillaQt; + + +// A simple QWidget sub-class to implement a call tip. +class SciCallTip : public QWidget +{ + Q_OBJECT + +public: + SciCallTip(QWidget *parent, ScintillaQt *sci_); + ~SciCallTip(); + +protected: + void paintEvent(QPaintEvent *e); + void mousePressEvent(QMouseEvent *e); + +private: + ScintillaQt *sci; +}; + + +// A popup menu where options correspond to a numeric command. + +#include <QMenu> +#include <QSignalMapper> + +class SciPopup : public QMenu +{ + Q_OBJECT + +public: + SciPopup(); + + void addItem(const QString &label, int cmd, bool enabled, + ScintillaQt *sci_); + +private slots: + void on_triggered(int cmd); + +private: + ScintillaQt *sci; + QSignalMapper mapper; +}; + + + +// This sub-class of QListBox is needed to provide slots from which we can call +// ListBox's double-click callback. (And you thought this was a C++ program.) + +class ListBoxQt; + + +#include <QListWidget> + +class SciListBox : public QListWidget +{ + Q_OBJECT + +public: + SciListBox(QWidget *parent, ListBoxQt *lbx_); + virtual ~SciListBox(); + + void addItemPixmap(const QPixmap &pm, const QString &txt); + + int find(const QString &prefix); + QString text(int n); + +protected: + void keyPressEvent(QKeyEvent *e); + +private slots: + void handleSelection(); + +private: + ListBoxQt *lbx; +}; + + +#endif Added: QScintillAS/Qt4/ScintillaQt.h =================================================================== --- QScintillAS/Qt4/ScintillaQt.h (rev 0) +++ QScintillAS/Qt4/ScintillaQt.h 2010-07-16 13:27:05 UTC (rev 48) @@ -0,0 +1,130 @@ +// The definition of the Qt specific subclass of ScintillaBase. +// +// Copyright (c) 2008 Riverbank Computing Limited <in...@ri...> +// +// This file is part of QScintilla. +// +// This file may be used under the terms of the GNU General Public +// License versions 2.0 or 3.0 as published by the Free Software +// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 +// included in the packaging of this file. Alternatively you may (at +// your option) use any later version of the GNU General Public +// License if such license has been publicly approved by Riverbank +// Computing Limited (or its successors, if any) and the KDE Free Qt +// Foundation. In addition, as a special exception, Riverbank gives you +// certain additional rights. These rights are described in the Riverbank +// GPL Exception version 1.1, which can be found in the file +// GPL_EXCEPTION.txt in this package. +// +// Please review the following information to ensure GNU General +// Public Licensing requirements will be met: +// http://trolltech.com/products/qt/licenses/licensing/opensource/. If +// you are unsure which license is appropriate for your use, please +// review the following information: +// http://trolltech.com/products/qt/licenses/licensing/licensingoverview +// or contact the sales department at sa...@ri.... +// +// This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly +// granted herein. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + + +#ifndef SCINTILLAQT_H +#define SCINTILLAQT_H + + +#include <qtimer.h> +#include <qclipboard.h> + +// These are needed because scintilla class header files don't seem to manage +// their own dependencies properly. +#include <ctype.h> +#include <stdlib.h> +#include "Platform.h" +#include "Scintilla.h" +#include "SVector.h" +#include "SplitVector.h" +#include "Partitioning.h" +#include "CellBuffer.h" +#include "CharClassify.h" +#include "RunStyles.h" +#include "Decoration.h" +#include "Document.h" +#include "Style.h" +#include "XPM.h" +#include "LineMarker.h" +#include "Indicator.h" +#include "ViewStyle.h" +#include "KeyMap.h" +#include "ContractionState.h" +#include "PositionCache.h" +#include "Editor.h" +#include "AutoComplete.h" +#include "CallTip.h" +#include "SString.h" +#include "PropSet.h" +#include "Accessor.h" +#include "KeyWords.h" + +#include "ScintillaBase.h" + + +class QPaintEvent; +class QDropEvent; + +class QsciScintillaBase; +class SciCallTip; +class SciPopup; + + +class ScintillaQt : public ScintillaBase +{ + friend class QsciScintillaBase; + friend class SciCallTip; + friend class SciPopup; + +public: + ScintillaQt(QsciScintillaBase *qsb_); + virtual ~ScintillaQt(); + + virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, + sptr_t lParam); + +private: + void Initialise(); + void Finalise(); + void StartDrag(); + sptr_t DefWndProc(unsigned int, uptr_t, sptr_t); + void SetTicking(bool); + void SetMouseCapture(bool on); + bool HaveMouseCapture(); + void SetVerticalScrollPos(); + void SetHorizontalScrollPos(); + bool ModifyScrollBars(int nMax, int nPage); + void ReconfigureScrollBars(); + void NotifyChange(); + void NotifyParent(SCNotification scn); + void CopyToClipboard(const SelectionText &selectedText); + void Copy(); + void Paste(); + void CreateCallTipWindow(PRectangle rc); + void AddToPopUp(const char *label, int cmd = 0, bool enabled = true); + void ClaimSelection(); + void UnclaimSelection(); + static sptr_t DirectFunction(ScintillaQt *sci, unsigned int iMessage, + uptr_t wParam,sptr_t lParam); + + QString textRange(const SelectionText *text); + void paintEvent(QPaintEvent *e); + void pasteFromClipboard(QClipboard::Mode mode); + + bool capturedMouse; + QsciScintillaBase *qsb; + QTimer qtimer; +}; + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |