mirror of
https://github.com/frida/frida-python
synced 2026-06-08 14:16:17 +00:00
Wire up some more
This commit is contained in:
committed by
Ole André Vadla Ravnås
parent
8527e5f830
commit
bbea00ce9f
@@ -6,7 +6,7 @@ from typing import Dict, List, Optional
|
||||
|
||||
from .model import (ClassObjectType, CustomTypeKind, Enumeration,
|
||||
InterfaceObjectType, Method, Model, ObjectType, Parameter,
|
||||
Procedure, Property, Signal, Tuple, to_pascal_case)
|
||||
Procedure, Property, Signal, Tuple, to_pascal_case, to_snake_case)
|
||||
|
||||
ASSETS_DIR = Path(__file__).resolve().parent / "assets"
|
||||
CODEGEN_HELPERS_TS = (ASSETS_DIR / "codegen_helpers.ts").read_text(encoding="utf-8")
|
||||
@@ -1563,7 +1563,8 @@ def generate_abstract_base_type_declarations(model: Model) -> str:
|
||||
for itype in model.interface_types_with_abstract_base:
|
||||
ctype = itype.abstract_base_c_type
|
||||
cprefix = itype.abstract_base_c_symbol_prefix
|
||||
module_upper, obj_name_upper = cprefix.upper().split("_", maxsplit=1)
|
||||
module_upper = "PY"
|
||||
obj_name_upper = "ABSTRACT_" + to_snake_case(itype.name).upper()
|
||||
decls.append(
|
||||
f"""G_DECLARE_FINAL_TYPE ({ctype}, {cprefix}, {module_upper}, {obj_name_upper}, GObject)
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ class ObjectType:
|
||||
|
||||
@cached_property
|
||||
def abstract_base_c_type(self) -> str:
|
||||
return f"FdnAbstract{self.name}"
|
||||
return f"PyAbstract{self.name}"
|
||||
|
||||
@cached_property
|
||||
def parent(self) -> ObjectType:
|
||||
@@ -184,11 +184,11 @@ class ObjectType:
|
||||
|
||||
@cached_property
|
||||
def c_symbol_prefix(self) -> str:
|
||||
return f"fdn_{to_snake_case(self.name)}"
|
||||
return f"Py{self.name}"
|
||||
|
||||
@cached_property
|
||||
def abstract_base_c_symbol_prefix(self) -> str:
|
||||
return f"fdn_abstract_{to_snake_case(self.name)}"
|
||||
return f"PyAbstract{self.name}"
|
||||
|
||||
@cached_property
|
||||
def c_cast_macro(self) -> str:
|
||||
@@ -537,11 +537,11 @@ class Method(Procedure):
|
||||
|
||||
@cached_property
|
||||
def operation_type_name(self) -> str:
|
||||
return f"Fdn{self.object_type.name}{to_pascal_case(self.name)}Operation"
|
||||
return f"Py{self.object_type.name}{to_pascal_case(self.name)}Operation"
|
||||
|
||||
@cached_property
|
||||
def abstract_base_operation_type_name(self) -> str:
|
||||
return f"FdnAbstract{self.object_type.name}{to_pascal_case(self.name)}Operation"
|
||||
return f"PyAbstract{self.object_type.name}{to_pascal_case(self.name)}Operation"
|
||||
|
||||
@cached_property
|
||||
def is_select_method(self) -> bool:
|
||||
@@ -801,7 +801,7 @@ class Enumeration:
|
||||
|
||||
@cached_property
|
||||
def c_symbol_prefix(self) -> str:
|
||||
return f"fdn_{to_snake_case(self.name)}"
|
||||
return f"Py{self.name}"
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
Reference in New Issue
Block a user