Laxkit
0.0.7.1
|
Interface for manipulating ImageData objects. More...
Public Member Functions | |
ImageInterface (int nid, Laxkit::Displayer *ndp, int nstyle=IMAGEI_POPUP_INFO) | |
virtual const char * | IconId () |
virtual const char * | Name () |
virtual const char * | whattype () |
virtual const char * | whatdatatype () |
virtual Laxkit::ShortcutHandler * | GetShortcuts () |
virtual int | Event (const Laxkit::EventData *data, const char *mes) |
virtual anInterface * | duplicate (anInterface *dup) |
Return new ImageInterface. | |
virtual void | deletedata () |
Decs count of data, and Sets to NULL. | |
virtual int | InterfaceOn () |
Sets showdecs=1, and needtodraw=1. | |
virtual int | InterfaceOff () |
Calls Clear(), sets showdecs=0, and needtodraw=1. | |
virtual void | Clear (SomeData *d) |
virtual ObjectContext * | Context () |
virtual int | UseThis (Laxkit::anObject *nobj, unsigned int mask=0) |
Check out nobj and use it as the data if possible. | |
virtual int | UseThisObject (ObjectContext *oc) |
Use the object at oc if it is an ImageData. | |
virtual int | DrawData (Laxkit::anObject *ndata, Laxkit::anObject *a1=NULL, Laxkit::anObject *a2=NULL, int info=0) |
Draw ndata, but remember that data should still be the resident data. | |
virtual int | LBDown (int x, int y, unsigned int state, int count, const Laxkit::LaxMouse *d) |
If !data on LBDown, then make a new one... | |
virtual int | LBUp (int x, int y, unsigned int state, const Laxkit::LaxMouse *d) |
If data, then call viewport->ObjectMoved(data). | |
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 | Refresh () |
virtual ImageData * | newData () |
Create and return new data, also calls viewport->NewData(newdata). | |
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 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 | 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 | 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 | KeyUp (unsigned int ch, unsigned int state, const Laxkit::LaxKeyboard *d) |
virtual int | DeviceChange (const Laxkit::DeviceEventData *e) |
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::MenuInfo * | ContextMenu (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 Laxkit::anXWindow * | CurrentWindow (Laxkit::anXWindow *ncur) |
Set the window the interface works on to ncur. Returns ncur. If ncur==NULL, then just return current viewport. | |
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 Attribute * | dump_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 int | controlcolor |
int | showdecs |
char | showfile |
Public Attributes inherited from LaxInterfaces::anInterface | |
char * | name |
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::anXApp * | app |
The application this interface works with. | |
Laxkit::anXWindow * | curwindow |
The window the interface currently works on. | |
anInterface * | owner |
The interface that owns this one. | |
anInterface * | child |
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 Member Functions | |
virtual void | runImageDialog () |
virtual int | PerformAction (int action) |
Protected Attributes | |
int | mode |
int | mousedragged |
flatpoint | leftp |
int | mx |
int | my |
int | lx |
int | ly |
int | max_preview_x |
int | max_preview_y |
ImageData * | data |
ObjectContext * | ioc |
Laxkit::ShortcutHandler * | sc |
Protected Attributes inherited from LaxInterfaces::anInterface | |
Laxkit::ButtonDownInfo | buttondown |
ViewportWindow * | viewport |
curwindow dynamically cast to ViewportWindow. Thus, it will be NULL if it is not a ViewportWindow. | |
Laxkit::Displayer * | dp |
The Displayer used by the controlling window. |
Interface for manipulating ImageData objects.
If (style&IMAGEI_POPUP_INFO) then when double clicking on an image, pop up an ImageDialog to allow editing of file, preview, description, and title. Because of the unsatisfactory limitations of the current Laxkit event system, the interface cannot receive the results of the dialog directly. It has to be dispatched by the viewportwindow.
|
virtual |
Return new ImageInterface.
If dup!=NULL and it cannot be cast to ImageInterface, then return NULL.
Reimplemented from LaxInterfaces::anInterface.
|
virtual |
Intercept "image properties" events, passing in ImageInfo objects.
Reimplemented from LaxInterfaces::anInterface.
References LaxInterfaces::anInterface::needtodraw, and UseThis().
|
virtual |
Create and return new data, also calls viewport->NewData(newdata).
Please note that this function is not a redefinition of anything. It is used internally to get a new instance of ImageData and also tell the viewport about it.
This function causes a new ImageData to be created and to have a count of 1 for the interface, and whatever the viewport tacks on. Currently, new ImageData makes the maxx/maxy be the image pixel width/height..
References LaxInterfaces::ObjectContext::duplicate(), LaxInterfaces::ImageData::LoadImage(), LaxInterfaces::ViewportWindow::NewData(), LaxInterfaces::SomeDataFactory::newObject(), LaxInterfaces::somedatafactory, and LaxInterfaces::anInterface::viewport.
Referenced by LBDown().
|
virtual |
Returns 1 if no data, -1 if thing was offscreen, or 0 if thing drawn.
Reimplemented from LaxInterfaces::anInterface.
References LaxInterfaces::anInterface::dp, Laxkit::Displayer::drawline(), Laxkit::Displayer::drawlines(), Laxkit::Displayer::DrawReal(), Laxkit::Displayer::DrawScreen(), Laxkit::Displayer::imageout(), Laxkit::DoubleBBox::intersect(), Laxkit::Displayer::LineAttributes(), Laxkit::Displayer::Maxx, Laxkit::Displayer::Maxy, Laxkit::Displayer::Minx, Laxkit::Displayer::Miny, LaxInterfaces::anInterface::needtodraw, Laxkit::Displayer::NewBG(), Laxkit::Displayer::NewFG(), Laxkit::Displayer::realtoscreen(), Laxkit::rgbcolor(), Laxkit::Displayer::righthanded(), and Laxkit::Displayer::textout().
Referenced by DrawData().
|
protectedvirtual |
This should result in an image properties dialog of some kind being run. This function is called in response to an image being double clicked on. It calls new ImageDialog with ANXWIN_REMEMBER.
It is assumed that data and curwindow both exist.
References LaxInterfaces::anInterface::curwindow, Laxkit::anObject::dec_count(), and Laxkit::anXApp::rundialog().
Referenced by LBDown().