Esempio n. 1
0
    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
Esempio n. 2
0
    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
Esempio n. 3
0
    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
Esempio n. 4
0
    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
Esempio n. 5
0
    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
Esempio n. 6
0
    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
Esempio n. 7
0
    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
Esempio n. 8
0
    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
Esempio n. 9
0
    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
Esempio n. 10
0
    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
Esempio n. 11
0
    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
Esempio n. 12
0
    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
Esempio n. 13
0
    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
Esempio n. 14
0
    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
Esempio n. 15
0
    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
Esempio n. 16
0
    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
Esempio n. 17
0
    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
Esempio n. 18
0
    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
Esempio n. 19
0
    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
Esempio n. 20
0
 def __init__(self, hxnode):
     # TODO SFW-2546
     if not hxnode:
         raise TypeError('Node handle is None')
     self.hxnode = acNode(hxnode)
Esempio n. 21
0
 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)