Laxkit  0.0.7.1
Public Member Functions | Public Attributes | Protected Attributes
LaxInterfaces::EllipseInterface Class Reference

*** fix me!Interface for EllipseData objects. More...

Inheritance diagram for LaxInterfaces::EllipseInterface:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 EllipseInterface (int nid, Laxkit::Displayer *ndp)
 Constructor.
 ~EllipseInterface ()
 Destructor, deletes rinterf.
virtual anInterfaceduplicate (anInterface *dup)
 Return new EllipseInterface.
void deletedata ()
void rectify ()
 Make rdata reflect data.
void erectify ()
 Make data reflect rdata.
virtual int scan (int x, int y)
virtual int LBDown (int x, int y, unsigned int state, int count)
virtual int LBUp (int x, int y, unsigned int state)
virtual int MouseMove (int x, int y, unsigned int state)
virtual int CharInput (unsigned int ch, const char *buffer, int len, unsigned int state)
virtual int CharRelease (unsigned int ch, unsigned int state)
virtual int Refresh ()
virtual int DrawData (Laxkit::anObject *ndata, Laxkit::anObject *a1=NULL, Laxkit::anObject *a2=NULL, int info=0)
virtual int UseThis (Laxkit::anObject *nobj, unsigned int mask=0)
 Accepts LineStyle or EllipseData. For LineStyle, just copies over width and color.
virtual int InterfaceOn ()
virtual int InterfaceOff ()
const charwhattype ()
const charwhatdatatype ()
flatpoint getpoint (int c)
- Public Member Functions inherited from LaxInterfaces::anInterface
 anInterface ()
 This constructor assigns id=getUniqueNumber().
 anInterface (int nid)
 Constructor to assign just the id, set other stuff to 0.
 anInterface (int nid, Laxkit::Displayer *ndp)
 anInterface (anInterface *nowner, int nid)
 Constructor to assign owner and id.
 anInterface (anInterface *nowner, int nid, Laxkit::Displayer *ndp)
virtual Laxkit::ShortcutHandlerGetShortcuts ()
 Return a ShortcutHandler that contains stacks of bound shortcuts and possible actions.
virtual int PerformAction (int actionnumber)
virtual const charIconId ()
virtual const charName ()
virtual int draws (const char *atype)
 Returns !strcmp(whatdatatype(),atype).
virtual void Clear ()
 Default just calls Clear(NULL).
virtual int RemoveChild ()
 If there is a child, do something to remove it.
virtual int AddChild (LaxInterfaces::anInterface *ch, int absorbcount, int addbefore)
virtual int Needtodraw ()
 Must return nonzero if the data needs to be drawn, that is to say Refresh must be called.
virtual int Needtodraw (int n)
virtual int LBDown (int x, int y, unsigned int state, int count, const Laxkit::LaxMouse *d)
virtual int MBDown (int x, int y, unsigned int state, int count, const Laxkit::LaxMouse *d)
virtual int RBDown (int x, int y, unsigned int state, int count, const Laxkit::LaxMouse *d)
virtual int LBUp (int x, int y, unsigned int state, const Laxkit::LaxMouse *d)
virtual int MBUp (int x, int y, unsigned int state, const Laxkit::LaxMouse *d)
virtual int RBUp (int x, int y, unsigned int state, const Laxkit::LaxMouse *d)
virtual int WheelUp (int x, int y, unsigned int state, int count, const Laxkit::LaxMouse *d)
virtual int WheelDown (int x, int y, unsigned int state, int count, const Laxkit::LaxMouse *d)
virtual int MouseMove (int x, int y, unsigned int state, const Laxkit::LaxMouse *d)
virtual int CharInput (unsigned int ch, const char *buffer, int len, unsigned int state, const Laxkit::LaxKeyboard *d)
virtual int KeyUp (unsigned int ch, unsigned int state, const Laxkit::LaxKeyboard *d)
virtual int DeviceChange (const Laxkit::DeviceEventData *e)
virtual int Event (const Laxkit::EventData *e, const char *mes)
 Respond to events, particularly menu events from a menu created from ContextMenu().
virtual void ExposeChange (Laxkit::ScreenEventData *e)
virtual void ViewportResized ()
 Called after the parent viewport gets resized.
virtual void Mapped ()
 Called after the parent viewport gets mapped (made visible).
virtual void Unmapped ()
 Called after the parent viewport gets mapped (made invisible, such as offscreen, not merely obscured).
virtual void PostMessage (const char *message)
 If viewport, use that, else app->postmessage().
virtual Laxkit::MenuInfoContextMenu (int x, int y, int deviceid)
 Return a context sensitive menu for screen position (x,y).
virtual int UseThis (int id, int ndata)
 Return 1 if the id/ndata is used, otherwise zero.
virtual int UseThisObject (ObjectContext *oc)
virtual Laxkit::anXWindowCurrentWindow (Laxkit::anXWindow *ncur)
 Set the window the interface works on to ncur. Returns ncur. If ncur==NULL, then just return current viewport.
virtual void Clear (SomeData *d)=0
 Clear the data from the interface only if d is the interface's current data.
virtual ObjectContextContext ()
virtual void Dp (Laxkit::Displayer *ndp)
 Set the dp to ndp, and update curwindow/viewport.
virtual int DrawDataDp (Laxkit::Displayer *tdp, SomeData *tdata, Laxkit::anObject *a1=NULL, Laxkit::anObject *a2=NULL, int info=1)
 Use a different dp to draw data with.
virtual flatpoint realtoscreen (flatpoint r)
 Do a little extra checking to find what point r should correspond to.
virtual flatpoint screentoreal (int x, int y)
 Do a little extra checking to find what point (x,y) should correspond to.
virtual double Getmag (int c=0)
 Do a little extra checking to find what the magnification is.
virtual double GetVMag (int x, int y)
 Do a little extra checking to find what the magnification is.
virtual void dump_out (FILE *f, int indent, int what, Laxkit::anObject *savecontext)
 Default settings saving is to output nothing.
virtual void dump_in_atts (LaxFiles::Attribute *att, int flag, Laxkit::anObject *loadcontext)
 Placeholder for dumping in settings.
- Public Member Functions inherited from LaxFiles::DumpUtility
virtual Attributedump_out_atts (Attribute *att, int what, Laxkit::anObject *savecontext)
 Default is return NULL. what==0 means write out normal Attribute formatted things.
virtual void dump_in (FILE *f, int indent, int what, Laxkit::anObject *loadcontext, Attribute **att)
 Read in a file segment as an Attribute, and pass parsing duties to dump_in_atts.
virtual ~DumpUtility ()
 Empty virtual destructor.

Public Attributes

unsigned long controlcolor
int creationstyle
int createfrompoint
int createangle
int showdecs
EllipseDatadata
RectInterfacerinterf
RectData rdata
LineStyle linestyle
- Public Attributes inherited from LaxInterfaces::anInterface
charname
 An instance name.. ***don't think this is used anywhere at the moment.
int id
 Must be positive, other values are reserved for internal use.
unsigned long style
 Style flags for the interface. Meaning depends on the interface.
int interface_type
 What sort of interface this is. Default is INTERFACE_Tool.
Laxkit::anXAppapp
 The application this interface works with.
Laxkit::anXWindowcurwindow
 The window the interface currently works on.
anInterfaceowner
 The interface that owns this one.
anInterfacechild
 The child of this interface. See anInterface::owner. This is dec_counted in destructor.
int primary
 Whether this is supposed to be a 'main' interface, or merely a helper.
int needtodraw
 Whether the interface thinks it has to refresh.

Protected Attributes

int mx
int my
char dataislocal
int curpoint
flatpoint createp
flatpoint createx
flatpoint createy
- Protected Attributes inherited from LaxInterfaces::anInterface
Laxkit::ButtonDownInfo buttondown
ViewportWindowviewport
 curwindow dynamically cast to ViewportWindow. Thus, it will be NULL if it is not a ViewportWindow.
Laxkit::Displayerdp
 The Displayer used by the controlling window.

Detailed Description

*** fix me!Interface for EllipseData objects.

  old:
   TO DO:
   draw only whats necessary
   ellipses start==end==0 means whole
   start/end angles
   move focus don't work circle kind of flaky/ out of phase with rect
   from inkscape/sodipodi:
    move start/end inside makes chord, outside makes pie
 
Todo:

*** totally broken, needs some serious rewrite..

*** must be able to fill also?


Constructor & Destructor Documentation

LaxInterfaces::EllipseInterface::EllipseInterface ( int  nid,
Laxkit::Displayer ndp 
)

Constructor.

*** this keeps an internal RectInterface. Does not push onto viewport.

References LaxInterfaces::anInterface::app, LaxInterfaces::anInterface::dp, LaxInterfaces::anInterface::needtodraw, and LaxInterfaces::RectInterface::UseThis().

Referenced by duplicate().


Member Function Documentation

int LaxInterfaces::EllipseInterface::CharInput ( unsigned int  ch,
const char buffer,
int  len,
unsigned int  state 
)
virtual
 Shift    edit start instead
 Control  edit end instead
 Del/Bksp deletes a focus point (makes a circle)
 'c'      center the thing
 'd'      toggle decorations
 

References LaxInterfaces::anInterface::app, getpoint(), MouseMove(), LaxInterfaces::anInterface::needtodraw, LaxInterfaces::anInterface::realtoscreen(), rectify(), and rotate().

anInterface * LaxInterfaces::EllipseInterface::duplicate ( anInterface dup)
virtual

Return new EllipseInterface.

If dup!=NULL and it cannot be cast to ImageInterface, then return NULL.

Reimplemented from LaxInterfaces::anInterface.

References EllipseInterface().

flatpoint LaxInterfaces::EllipseInterface::getpoint ( int  c)
   0=none
   1=-x-y 
   2=-x
   3=-xy
   4=y
   5=xy
   6=x
   7=x-y
   8=-y
   9=0
   10=f1
   11=f2
   12=s
   13=e
   14=wp 
  

References LaxInterfaces::anInterface::dp, LaxInterfaces::RectInterface::getpoint(), rotate(), and Laxkit::Displayer::screentoreal().

Referenced by CharInput(), MouseMove(), and scan().

int LaxInterfaces::EllipseInterface::InterfaceOff ( )
virtual

should Pop the RectInterface onto the viewport interfaces stack.

Reimplemented from LaxInterfaces::anInterface.

References LaxInterfaces::anInterface::Clear(), and LaxInterfaces::anInterface::needtodraw.

int LaxInterfaces::EllipseInterface::InterfaceOn ( )
virtual
Todo:
*** should push the RectInterface onto the viewport interfaces stack...

Reimplemented from LaxInterfaces::anInterface.

References LaxInterfaces::anInterface::needtodraw.

int LaxInterfaces::EllipseInterface::MouseMove ( int  x,
int  y,
unsigned int  state 
)
virtual
int LaxInterfaces::EllipseInterface::scan ( int  x,
int  y 
)
virtual
int LaxInterfaces::EllipseInterface::UseThis ( Laxkit::anObject nobj,
unsigned int  mask = 0 
)
virtual

Accepts LineStyle or EllipseData. For LineStyle, just copies over width and color.

Todo:
**** returns 1 with LineStyle, but does not take over it.. is that ok??

Reimplemented from LaxInterfaces::anInterface.

References LaxInterfaces::anInterface::needtodraw, rectify(), and LaxInterfaces::anInterface::viewport.


The documentation for this class was generated from the following files:

Mon Feb 17 2014 11:52:58, Laxkit