Laxkit  0.0.7.1
objectinterface.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-2007,2010-2012 by Tom Lechner
22 //
23 #ifndef _LAX_OBJECTINTERFACE_H
24 #define _LAX_OBJECTINTERFACE_H
25 
26 #include <lax/interfaces/rectinterface.h>
27 #include <lax/interfaces/somedata.h>
28 #include <lax/lists.h>
29 
30 #define OBJECT_SELECT_TOUCHING (1<<16)
31 
32 namespace LaxInterfaces {
33 
34 
35 //-----------------------------
36 
37 enum ObjectInterfaceActions {
38  OIA_Group = RIA_MAX,
39  OIA_MAX
40 };
41 
43 {
44  protected:
46  int dontclear;
47  virtual void Flip(int type);
48  virtual void Rotate(double angle);
49  virtual int PerformAction(int action);
50  public:
51  ObjectInterface(int nid,Laxkit::Displayer *ndp);
52  virtual ~ObjectInterface();
53  virtual Laxkit::ShortcutHandler *GetShortcuts();
54  virtual ObjectContext *Context() { return NULL; }
55  virtual const char *IconId() { return "Object"; }
56  virtual const char *Name();
57  virtual const char *whattype() { return "ObjectInterface"; }
58  virtual const char *whatdatatype() { return "Selection"; }
59  virtual int InterfaceOff();
60  virtual anInterface *duplicate(anInterface *dup);
61  virtual void deletedata();
62  virtual void Clear(SomeData *d=NULL);
63  virtual int UseThis(anObject *newdata,unsigned int);
64  virtual int DrawData(anObject *ndata,anObject *a1,anObject *a2,int);
65  virtual int LBDown(int x,int y,unsigned int state,int count,const Laxkit::LaxMouse *d);
66  virtual int LBUp(int x,int y,unsigned int state,const Laxkit::LaxMouse *d);
67  virtual int MouseMove(int x,int y,unsigned int state,const Laxkit::LaxMouse *d);
68  virtual int CharInput(unsigned int ch, const char *buffer,int len,unsigned int state,const Laxkit::LaxKeyboard *d);
69  virtual int Refresh();
70 
71  virtual void TransformSelection(const double *N, int s=-1, int e=-1);
72  virtual int PointInSelection(int x,int y);
73  virtual int AddToSelection(ObjectContext *oc);
74  virtual int AddToSelection(Laxkit::PtrStack<ObjectContext> &selection);
75  virtual int FreeSelection();
76  virtual void RemapBounds();
77  virtual int GrabSelection(unsigned int state);
78  virtual int ToggleGroup();
79  //virtual void RedoBounds();
80 };
81 
82 } // namespace LaxInterfaces
83 
84 #endif
85 

Mon Feb 17 2014 11:52:57, Laxkit