mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-24 10:09:20 +01:00
kernwin.i: added add_menu_item to ignore list (it was being wrapped twice (as overloaded function))
This commit is contained in:
parent
4e02442b9a
commit
8bf3e2054d
@ -3,6 +3,7 @@
|
|||||||
%ignore close_form;
|
%ignore close_form;
|
||||||
%ignore vaskstr;
|
%ignore vaskstr;
|
||||||
%ignore vasktext;
|
%ignore vasktext;
|
||||||
|
%ignore add_menu_item;
|
||||||
%ignore vwarning;
|
%ignore vwarning;
|
||||||
%ignore vinfo;
|
%ignore vinfo;
|
||||||
%ignore vnomem;
|
%ignore vnomem;
|
||||||
@ -33,9 +34,9 @@
|
|||||||
%rename (_askseg) askseg;
|
%rename (_askseg) askseg;
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
void refresh_lists(void)
|
void refresh_lists(void)
|
||||||
{
|
{
|
||||||
callui(ui_list);
|
callui(ui_list);
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
@ -77,28 +78,28 @@ bool idaapi py_menu_item_callback(void *userdata)
|
|||||||
{
|
{
|
||||||
PyObject *func, *args, *result;
|
PyObject *func, *args, *result;
|
||||||
bool ret = 0;
|
bool ret = 0;
|
||||||
|
|
||||||
// userdata is a tuple of ( func, args )
|
// userdata is a tuple of ( func, args )
|
||||||
// func and args are borrowed references from userdata
|
// func and args are borrowed references from userdata
|
||||||
func = PyTuple_GET_ITEM(userdata, 0);
|
func = PyTuple_GET_ITEM(userdata, 0);
|
||||||
args = PyTuple_GET_ITEM(userdata, 1);
|
args = PyTuple_GET_ITEM(userdata, 1);
|
||||||
|
|
||||||
// call the python function
|
// call the python function
|
||||||
result = PyEval_CallObject(func, args);
|
result = PyEval_CallObject(func, args);
|
||||||
|
|
||||||
// we cannot raise an exception in the callback, just print it.
|
// we cannot raise an exception in the callback, just print it.
|
||||||
if (!result) {
|
if (!result) {
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the function returned a non-false value, then return 1 to ida,
|
// if the function returned a non-false value, then return 1 to ida,
|
||||||
// overwise return 0
|
// overwise return 0
|
||||||
if (PyObject_IsTrue(result)) {
|
if (PyObject_IsTrue(result)) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
Py_DECREF(result);
|
Py_DECREF(result);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
@ -114,11 +115,11 @@ bool wrap_add_menu_item (
|
|||||||
PyObject *args) {
|
PyObject *args) {
|
||||||
// FIXME: probably should keep track of this data, and destroy it when the menu item is removed
|
// FIXME: probably should keep track of this data, and destroy it when the menu item is removed
|
||||||
PyObject *cb_data;
|
PyObject *cb_data;
|
||||||
|
|
||||||
if (args == Py_None) {
|
if (args == Py_None) {
|
||||||
Py_DECREF(Py_None);
|
Py_DECREF(Py_None);
|
||||||
args = PyTuple_New( 0 );
|
args = PyTuple_New( 0 );
|
||||||
if (!args)
|
if (!args)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +223,7 @@ uint32 choose_choose(void *self,
|
|||||||
&choose_enter,
|
&choose_enter,
|
||||||
NULL, /* destroy */
|
NULL, /* destroy */
|
||||||
NULL, /* popup_names */
|
NULL, /* popup_names */
|
||||||
NULL /* get_icon */
|
NULL /* get_icon */
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
@ -249,7 +250,7 @@ class Choose:
|
|||||||
# that the class will never be collected, unless refhack is set to None explicitly.
|
# that the class will never be collected, unless refhack is set to None explicitly.
|
||||||
if (flags & 1) == 0:
|
if (flags & 1) == 0:
|
||||||
self.refhack = self
|
self.refhack = self
|
||||||
|
|
||||||
def sizer(self):
|
def sizer(self):
|
||||||
"""
|
"""
|
||||||
Callback: sizer - returns the length of the list
|
Callback: sizer - returns the length of the list
|
||||||
@ -284,7 +285,7 @@ class Choose:
|
|||||||
|
|
||||||
def get_icon(self, n):
|
def get_icon(self, n):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def choose(self):
|
def choose(self):
|
||||||
"""
|
"""
|
||||||
choose - Display the choose dialogue
|
choose - Display the choose dialogue
|
||||||
|
Loading…
Reference in New Issue
Block a user