You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
127 lines
3.2 KiB
127 lines
3.2 KiB
15 years ago
|
/**************************************************************************
|
||
|
|
||
|
kdisptext.h - The widget that displays the karaoke/lyrics text
|
||
|
Copyright (C) 1997,98 Antonio Larrosa Jimenez
|
||
|
|
||
|
This program is free software; you can redistribute it and/or modify
|
||
|
it under the terms of the GNU General Public License as published by
|
||
|
the Free Software Foundation; either version 2 of the License, or
|
||
|
(at your option) any later version.
|
||
|
|
||
|
This program is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
GNU General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this program; if not, write to the Free Software
|
||
15 years ago
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
15 years ago
|
|
||
|
Send comments and bug fixes to larrosa@kde.org
|
||
|
or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain
|
||
|
|
||
|
***************************************************************************/
|
||
|
#ifndef _kdisptext_h_
|
||
|
#define _kdisptext_h_
|
||
|
|
||
15 years ago
|
#include <tqwidget.h>
|
||
|
#include <tqscrollview.h>
|
||
12 years ago
|
#include <libtdemid/player.h>
|
||
15 years ago
|
|
||
|
struct kdispt_ev
|
||
|
{
|
||
|
SpecialEvent *spev;
|
||
|
int xpos;
|
||
15 years ago
|
class TQRect r;
|
||
15 years ago
|
kdispt_ev *next;
|
||
|
};
|
||
|
|
||
|
struct kdispt_line
|
||
|
{
|
||
|
kdispt_ev *ev;
|
||
|
int num;
|
||
|
int ypos;
|
||
|
kdispt_line *next;
|
||
|
};
|
||
|
|
||
14 years ago
|
class TQFont;
|
||
|
class TQFontMetrics;
|
||
|
class TQScrollBar;
|
||
15 years ago
|
|
||
15 years ago
|
class KDisplayText : public TQScrollView
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
private:
|
||
15 years ago
|
TQTextCodec *lyrics_codec;
|
||
15 years ago
|
|
||
15 years ago
|
TQFontMetrics *qfmetr;
|
||
|
TQFont *qtextfont;
|
||
15 years ago
|
|
||
|
int typeoftextevents;
|
||
|
|
||
|
kdispt_line *linked_list_[2];
|
||
|
int nlines_[2];
|
||
|
kdispt_line *first_line_[2];
|
||
|
kdispt_line *cursor_line_[2];
|
||
|
kdispt_ev *cursor_[2];
|
||
|
|
||
|
kdispt_line *linked_list;
|
||
|
kdispt_line *cursor_line;
|
||
|
kdispt_ev *cursor;
|
||
|
|
||
|
kdispt_line *first_line; // Pointer to first text at first visible line
|
||
|
|
||
|
int nlines; // Total number of lines
|
||
|
int nvisiblelines; // Number of visible lines
|
||
|
|
||
|
void RemoveLine(kdispt_line *tmpl);
|
||
|
void RemoveLinkedList(void);
|
||
|
|
||
|
int IsLineFeed(char c,int type=0);
|
||
15 years ago
|
virtual void drawContents(TQPainter *qpaint,int clipx,int clipy,int clipw,int cliph);
|
||
15 years ago
|
|
||
|
kdispt_line * searchYOffset(int y, kdispt_line *start);
|
||
|
|
||
|
int maxX[2];
|
||
|
int maxY[2];
|
||
|
int autoscrollv;
|
||
|
|
||
|
protected:
|
||
15 years ago
|
virtual void resizeEvent(TQResizeEvent *qre);
|
||
|
virtual void timerEvent(TQTimerEvent *e);
|
||
15 years ago
|
|
||
|
public:
|
||
13 years ago
|
KDisplayText(TQWidget *parent,const char *name);
|
||
15 years ago
|
virtual ~KDisplayText();
|
||
|
|
||
|
void ClearEv(bool totally=true);
|
||
|
void AddEv(SpecialEvent *ev);
|
||
|
void calculatePositions(void);
|
||
|
|
||
|
void CursorToHome(void);
|
||
|
|
||
|
void ChangeTypeOfTextEvents(int type);
|
||
|
int ChooseTypeOfTextEvents(void);
|
||
|
void PaintIn(int type);
|
||
|
void gotomsec(ulong i);
|
||
|
|
||
15 years ago
|
TQFont *getFont(void);
|
||
15 years ago
|
void fontChanged(void);
|
||
|
|
||
|
void saveLyrics(FILE *fh);
|
||
|
|
||
15 years ago
|
void setLyricsEncoding(const TQString &enc);
|
||
15 years ago
|
|
||
13 years ago
|
// TQSize sizeHint();
|
||
15 years ago
|
|
||
|
public slots:
|
||
|
void ScrollDown();
|
||
|
void ScrollUp();
|
||
|
void ScrollPageDown();
|
||
|
void ScrollPageUp();
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif
|