def xNodeGetCastAlias(self): alias_node = acNode(None) # AC_ERROR acNodeGetCastAlias( # acNode hNode, # acNode* phAliasNode) harenac.acNodeGetCastAlias(self.hxnode, byref(alias_node)) return alias_node.value
def xEnumerationGetCurrentEntry(self): current_entry_node = acNode(None) # AC_ERROR acEnumerationGetCurrentEntry( # acNode hNode, # acNode* phEntryNode) harenac.acEnumerationGetCurrentEntry(self.hxnode, byref(current_entry_node)) return current_entry_node.value
def xNodeGetParent(self, index): index = size_t(index) parent_node = acNode(None) # AC_ERROR acNodeGetParent( # acNode hNode, # size_t index, # acNode* phParentNode) harenac.acNodeGetParent(self.hxnode, index, byref(parent_node)) return parent_node.value
def xIsReadable(h_node): node = acNode(h_node) is_readable = bool8_t(False) # AC_ERROR acIsReadable( # acNode hNode, # bool8_t* pIsReadable) harenac.acIsReadable( node, byref(is_readable)) return is_readable.value
def xNodeGetChild(self, index): child_node = acNode(None) index = size_t(index) # AC_ERROR acNodeGetChild( # acNode hNode, # size_t index, # acNode* phChildNode) harenac.acNodeGetChild(self.hxnode, index, byref(child_node)) return child_node.value
def xCategoryGetFeature(self, index): index = size_t(index) feature_node = acNode(None) # AC_ERROR acCategoryGetFeature( # acNode hNode, # size_t index, # acNode* phFeatureNode) harenac.acCategoryGetFeature(self.hxnode, index, byref(feature_node)) return feature_node.value
def xSelectorGetSelectedFeature(self, index): index = size_t(index) selected_feature_node = acNode(None) # AC_ERROR acSelectorGetSelectedFeature( # acNode hNode, # size_t index, # acNode* phSelectedFeatureNode) harenac.acSelectorGetSelectedFeature(self.hxnode, index, byref(selected_feature_node)) return selected_feature_node.value
def xEnumerationGetEntryByName(self, name): name_p = create_string_buffer(name.encode()) entry_node = acNode(None) # AC_ERROR acEnumerationGetEntryByName( # acNode hNode, # const char* pEntryName, # acNode* phEntryNode) harenac.acEnumerationGetEntryByName(self.hxnode, name_p, byref(entry_node)) return entry_node.value
def xEnumerationGetEntryByIndex(self, index): index = size_t(index) entry_node = acNode(None) # AC_ERROR acEnumerationGetEntryByIndex( # acNode hNode, # size_t index, # acNode* phEntryNode) harenac.acEnumerationGetEntryByIndex(self.hxnode, index, byref(entry_node)) return entry_node.value
def xEnumerationGetCurrentEntryAndAccessMode(self): current_entry_node = acNode(None) access_mode = ac_access_mode(0) # AC_ERROR acEnumerationGetCurrentEntryAndAccessMode( # acNode hNode, # acNode* phEntryNode, # AC_ACCESS_MODE* pAccessMode) harenac.acEnumerationGetCurrentEntryAndAccessMode( self.hxnode, byref(current_entry_node), byref(access_mode)) return current_entry_node.value, access_mode.value
def xEnumerationGetEntryAndAccessModeByName(self, name): name_p = create_string_buffer(name.encode()) entry_node = acNode(None) access_mode = ac_access_mode(0) # AC_ERROR acEnumerationGetEntryAndAccessModeByName( # acNode hNode, # char* pEntryName, # acNode* phEntryNode, # AC_ACCESS_MODE* pAccessMode) harenac.acEnumerationGetEntryAndAccessModeByName( self.hxnode, name_p, byref(entry_node), byref(access_mode)) return entry_node.value, access_mode.value
def xEnumerationGetEntryAndAccessModeByIndex(self, index): index = size_t(index) entry_node = acNode(None) access_mode = ac_access_mode(0) # AC_ERROR acEnumerationGetEntryAndAccessModeByIndex( # acNode hNode, # size_t index, # acNode* phEntryNode, # AC_ACCESS_MODE* pAccessMode) harenac.acEnumerationGetEntryAndAccessModeByIndex( self.hxnode, index, byref(entry_node), byref(access_mode)) return entry_node.value, access_mode.value
def xChunkDataGetChunk(self, name): name_p = char_ptr(name.encode()) hchunk_node = acNode(None) # AC_ERROR acChunkDataGetChunk( # acBuffer hBuffer, # const char* pName, # acNode* phChunkNode) harenac.acChunkDataGetChunk( self.hxbuffer, name_p, byref(hchunk_node) ) return hchunk_node.value
def xSelectorGetSelectedFeatureAndAccessMode(self, index): index = size_t(index) selected_feature_node = acNode(None) access_mode = ac_access_mode(0) # AC_ERROR acSelectorGetSelectedFeatureAndAccessMode( # acNode hNode, # size_t index, # acNode* phSelectedFeatureNode, # AC_ACCESS_MODE* pAccessMode) harenac.acSelectorGetSelectedFeatureAndAccessMode( self.hxnode, index, byref(selected_feature_node), byref(access_mode)) return selected_feature_node.value, access_mode.value
def xNodeGetParentAndAccessMode(self, index): index = size_t(index) parent_node = acNode(None) access_mode = ac_access_mode(0) # AC_ERROR acNodeGetParentAndAccessMode( # acNode hNode, # size_t index, # acNode* phParentNode, # AC_ACCESS_MODE* pAccessMode) harenac.acNodeGetParentAndAccessMode(self.hxnode, index, byref(parent_node), byref(access_mode)) return parent_node.value, access_mode.value
def xNodeGetChildAndAccessMode(self, index): child_node = acNode(None) index = size_t(index) access_mode = ac_access_mode(0) # AC_ERROR acNodeGetChildAndAccessMode( # acNode hNode, # size_t index, # acNode* phChildNode, # AC_ACCESS_MODE* pAccessMode) harenac.acNodeGetChildAndAccessMode(self.hxnode, index, byref(child_node), byref(access_mode)) return child_node.value, access_mode.value
def xCategoryGetFeatureAndAccessMode(self, index): index = size_t(index) feature_node = acNode(None) access_mode = ac_access_mode(0) # AC_ERROR acCategoryGetFeatureAndAccessMode( # acNode hNode, # size_t index, # acNode* phFeatureNode, # AC_ACCESS_MODE* pAccessMode) harenac.acCategoryGetFeatureAndAccessMode(self.hxnode, index, byref(feature_node), byref(access_mode)) return feature_node.value, access_mode.value
def xChunkDataGetChunkAndAccessMode(self, name): name_p = char_ptr(name.encode()) hchunk_node = acNode(None) access_mode = ac_access_mode(0) # AC_ERROR acChunkDataGetChunkAndAccessMode( # acBuffer hBuffer, # char* pName, # acNode* phChunkNode, # AC_ACCESS_MODE* pAccessMode) harenac.acChunkDataGetChunkAndAccessMode( self.hxbuffer, name_p, byref(hchunk_node), byref(access_mode) ) return hchunk_node.value, access_mode.value
def xCallbackRegister(self, h_node, py_callback_function, args_and_kwargs): handle = acCallback(None) node = acNode(h_node) c_callback_function = acCallbackFunction(py_callback_function) args_and_kwargs_as_py_object = py_object(args_and_kwargs) # # arenac dll # # AC_ERROR acCallbackRegister( # acCallback* phCallback, # acNode hNode, # acCallbackFunction callbackFunction, # void* pUserData) # # configured # # harenac.acCallbackRegister.argtypes = [ # POINTER(acCallback), # acNode, # acCallbackFunction, # # ArenaC API takes void* but we pass a py_object to # # receive it in the callback. # py_object] harenac.acCallbackRegister(byref(handle), node, c_callback_function, args_and_kwargs_as_py_object) # needs to be taken out because ref count must stay positive until # the callback is called to_add_to_registry_entry = { '_c_callback_function': c_callback_function, '_args_and_kwargs_as_py_object': args_and_kwargs_as_py_object } return handle.value, to_add_to_registry_entry
def __init__(self, hxnode): # TODO SFW-2546 if not hxnode: raise TypeError('Node handle is None') self.hxnode = acNode(hxnode)
def __init__(self, hxnode): # TODO SFW-2546 if not hxnode: # shouldi check the type here ? raise TypeError('Node handle is None') self.hxnode = acNode(hxnode)