Laxkit  0.0.7.1
textxeditbase-utf8.h
1 //
2 //
3 // The Laxkit, a windowing toolkit
4 // Please consult http://laxkit.sourceforge.net about where to send any
5 // correspondence about this software.
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Library General Public
9 // License as published by the Free Software Foundation; either
10 // version 2 of the License, or (at your option) any later version.
11 //
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Library General Public License for more details.
16 //
17 // You should have received a copy of the GNU Library General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 //
21 // Copyright (C) 2004-2013 by Tom Lechner
22 //
23 #ifndef _LAX_TEXTXEDITBASE_UTF8_H
24 #define _LAX_TEXTXEDITBASE_UTF8_H
25 
26 
27 
28 #include <lax/anxapp.h>
29 #include <lax/texteditbase-utf8.h>
30 #include <lax/rectangles.h>
31 
32 #include <lax/fontmanager.h>
33 
34 
35 namespace Laxkit {
36 
37 
39 {
40  protected:
42  int padx,pady;
43  char firsttime,con;
44  long dpos,nlines;
46  int textascent,textheight,textdescent;
47  unsigned long curtextcolor,textbgcolor;
48  unsigned long curbkcolor,bkwrongcolor,wscolor;
49  LaxFont *thefont;
50  int valid;
52  virtual void docaret(int w=1);
53  virtual void settextrect();
54  virtual int selectionDropped(unsigned char *data,unsigned long len,Atom actual_type,Atom which);
55  virtual char *getSelectionData(int *len,Atom property,Atom targettype,Atom selection);
56  public:
57  TextXEditBaseUtf8(anXWindow *parnt,const char *nname,const char *ntitle,unsigned long nstyle,
58  int xx,int yy,int ww,int hh,int brder,
59  anXWindow *prev,unsigned long nowner,const char *nsend,
60  const char *newtext=NULL,unsigned long ntstyle=0,int ncntlchar=0);
61  virtual ~TextXEditBaseUtf8();
62  virtual int init();
63  virtual void Refresh();
64  virtual int MBUp(int x,int y,unsigned int state, const LaxMouse *d);
65  virtual int FocusOn(const FocusChangeData *e);
66  virtual int FocusOff(const FocusChangeData *e);
67  virtual int MoveResize(int nx,int ny,int nw,int nh);
68  virtual int Resize(int nw,int nh);
69 
70  virtual int charwidth(int ch,int r=0);
71  virtual int Cut();
72  virtual int Copy();
73  virtual int Paste();
74  virtual void Colors(int hl);
75  virtual void Black(int x,int y,int w,int h);
76  virtual int DrawTabLine();
77  virtual void DrawCaret(int flag=0,int on=1); // flag=0,on=1
78  virtual void DrawText(int black=-1) = 0;
79  virtual int DrawLineOfText(int x,int y,long pos,long len,char &check,long eof=-1);
80  virtual int TextOut(int x,int y,char *str,long len,long eof);
81  virtual int ExtentAndStr(char *str,long len,char *&blah,long &p);
82  virtual int GetExtent(long pos,long end,int lsofar=0,long eof=-1); //lsofar=0,eof=-1
83  virtual long GetPos(long pos,int pix,int lsofar=0,long eof=-1); //lsofar=0,eof=-1
84  virtual int SetupMetrics();
85  virtual int UseThisFont(LaxFont *newfont);
86 };
87 
88 } // namespace Laxkit
89 
90 
91 
92 #endif

Mon Feb 17 2014 11:52:57, Laxkit