About   |   Getting Started   |   Downloads   |   Documentation   |   Forum


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pass-through SDK function access
07-08-2017, 10:43 AM
Post: #1
pass-through SDK function access
Would it be practical to add a pass-through function to classes to allow access to SDK functions that don't have an explicit interface in the CORE header, as a simple alternative to building a hybrid project to access a few simple functions?

For example, hdicoreDocument.h offers activate() const while the underlying AIDocumentList.h has (*Activate)( AIDocumentHandle document, ASBoolean bSetFocus ); I'd like to use CORE to get the relevant DocumentHandle(s) and, for example, Activate with bSetFocus set to false, access the dictionary, the modified state, file path, or other document criteria without bringing that window frontmost (don't want to frighten users with screens suddenly flashing). I would imagine that our IDE's autocomplete would help show a list of available options as well as the Adobe SDK itself so a simple boilerplate disclaimer may suffice for documentation.
Find all posts by this user
Quote this message in a reply
07-09-2017, 07:42 PM
Post: #2
RE: pass-through SDK function access
In a strongly-typed language there is no reasonable way to do this; you would need to know the types that the underlying SDK function accepts, in which order, and hence need the true function declaration. At that point, you basically have a "hybrid" hdi_core and Ai SDK project.

In this case, if you need the argument for AIDocumentSuite::Activate() exposed, I'll try to get it into the next release of the lib.
Find all posts by this user
Quote this message in a reply
07-10-2017, 05:09 PM
Post: #3
RE: pass-through SDK function access
Thanks, Garrett. I was sure it'd be a long shot, but a killer class if it could work.

At this point, I don't personally need additional document class functions since I've already gone the hybrid route, but it may be helpful for others since, at least in the SDK, some functions work correctly only when the document is active. If you do update hdicoreDocument, I suspect others could use functions to retrieve properties such as modified, or the file's path and display name.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)