Closed thelink2012 closed 9 years ago
Thoughts @dcampbell24?
EDIT:
Oh, the callbacks system don't work very well either using the Ihandle methodology.
For instance IupText action callback receives (Ihandle *ih, int c, char *new_value)
meanwhile the button action callback receives (Ihandle* ih)
.
I was very neutral + a little bit inclined to the Ihandle model, but now I think the struct/trait model is the way to go.
I like the struct / trait approach even though I think it will require more work to implement. Unfortunately, I am probably not going to have very much free time for a while to help with this.
A step to the a high-level binding is to decide the object model to be used, each has pros and cons, mainly because of the C model used in IUP.
Note: The pros and cons lists are not exhaustive, please consider adding more if any comes to mind.
Terminology:
IupGetAttribute
andIupSetAttribute
which gets and sets a string instead of a well specified object type.Ihandle and Functions (using string attributes)
This is the current model in the library, all the IUP objects are described with a
Ihandle
structure and passed to functions as the first argument.Pros:
Cons:
&mut handle
on each function call.Ihandle and Functions (using functions for attributes)
Pros
Cons:
&mut handle
on each function call.Ihandle and Methods
Mirror Ihandle and Functions (using string attributes) and Ihandle and Functions (using functions for attributes) here by excluding the Annoying
&mut handle
on each function call cons.Structs/Traits and Methods (using methods for attributes)
Pros:
Cons:
Issues:
IupGetHandle
)?