diff --git a/src/UIEntity.cpp b/src/UIEntity.cpp index 01ebd83..57aeeae 100644 --- a/src/UIEntity.cpp +++ b/src/UIEntity.cpp @@ -163,15 +163,3 @@ PyGetSetDef UIEntity::getsetters[] = { {"sprite_number", (getter)UIEntity::get_spritenumber, (setter)UIEntity::set_spritenumber, "Sprite number (index) on the texture on the display", NULL}, {NULL} /* Sentinel */ }; - -PyObject* UIEntity::repr(PyUIEntityObject* self) { - std::ostringstream ss; - if (!self->data) ss << ""; - else { - auto ent = self->data; - ss << ""; - } - std::string repr_str = ss.str(); - return PyUnicode_DecodeUTF8(repr_str.c_str(), repr_str.size(), "replace"); -} diff --git a/src/UIEntity.h b/src/UIEntity.h index b5050ff..852cbb3 100644 --- a/src/UIEntity.h +++ b/src/UIEntity.h @@ -55,7 +55,6 @@ public: static int set_spritenumber(PyUIEntityObject* self, PyObject* value, void* closure); static PyMethodDef methods[]; static PyGetSetDef getsetters[]; - static PyObject* repr(PyUIEntityObject* self); }; namespace mcrfpydef { @@ -64,7 +63,7 @@ namespace mcrfpydef { .tp_name = "mcrfpy.Entity", .tp_basicsize = sizeof(PyUIEntityObject), .tp_itemsize = 0, - .tp_repr = (reprfunc)UIEntity::repr, + // Methods omitted for brevity .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = "UIEntity objects", .tp_methods = UIEntity::methods, diff --git a/src/UIFrame.cpp b/src/UIFrame.cpp index 42adc47..8c9561c 100644 --- a/src/UIFrame.cpp +++ b/src/UIFrame.cpp @@ -225,7 +225,7 @@ PyObject* UIFrame::repr(PyUIFrameObject* self) auto box = self->data->box; auto fc = box.getFillColor(); auto oc = box.getOutlineColor(); - ss << "data->box.setPosition(val, self->data->box.getPosition().y); -// else if (member_ptr == 1) // y -// self->data->box.setPosition(self->data->box.getPosition().x, val); -// else if (member_ptr == 2) // w -// self->data->box.setSize(sf::Vector2f(val, self->data->box.getSize().y)); -// else if (member_ptr == 3) // h -// self->data->box.setSize(sf::Vector2f(self->data->box.getSize().x, val)); -// else if (member_ptr == 4) // center_x -// self->data->center_x = val; -// else if (member_ptr == 5) // center_y -// self->data->center_y = val; -// else if (member_ptr == 6) // zoom -// self->data->zoom = val; - - std::ostringstream ss; - if (!self->data) ss << ""; - else { - auto grid = self->data; - auto box = grid->box; - ss << "center_x << ", " << grid->center_y << "), zoom=" << grid->zoom << - ")>"; - } - std::string repr_str = ss.str(); - return PyUnicode_DecodeUTF8(repr_str.c_str(), repr_str.size(), "replace"); -} - /* // TODO standard pointer would need deleted, but I opted for a shared pointer. tp_dealloc currently not even defined in the PyTypeObject void PyUIGrid_dealloc(PyUIGridObject* self) { delete self->data; // Clean up the allocated UIGrid object diff --git a/src/UIGrid.h b/src/UIGrid.h index bb09152..8804705 100644 --- a/src/UIGrid.h +++ b/src/UIGrid.h @@ -58,7 +58,6 @@ public: static PyMethodDef methods[]; static PyGetSetDef getsetters[]; static PyObject* get_children(PyUIGridObject* self, void* closure); - static PyObject* repr(PyUIGridObject* self); }; @@ -110,7 +109,7 @@ namespace mcrfpydef { // Py_TYPE(self)->tp_free(self); //}, //TODO - PyUIGrid REPR def: - .tp_repr = (reprfunc)UIGrid::repr, + // .tp_repr = (reprfunc)UIGrid::repr, //.tp_hash = NULL, //.tp_iter //.tp_iternext diff --git a/src/UIGridPoint.cpp b/src/UIGridPoint.cpp index e255c3a..b30d493 100644 --- a/src/UIGridPoint.cpp +++ b/src/UIGridPoint.cpp @@ -98,19 +98,6 @@ PyGetSetDef UIGridPoint::getsetters[] = { {NULL} /* Sentinel */ }; -PyObject* UIGridPoint::repr(PyUIGridPointObject* self) { - std::ostringstream ss; - if (!self->data) ss << ""; - else { - auto gp = self->data; - ss << ""; - } - std::string repr_str = ss.str(); - return PyUnicode_DecodeUTF8(repr_str.c_str(), repr_str.size(), "replace"); -} - PyObject* UIGridPointState::get_bool_member(PyUIGridPointStateObject* self, void* closure) { if (reinterpret_cast(closure) == 0) { // visible return PyBool_FromLong(self->data->visible); @@ -145,14 +132,3 @@ PyGetSetDef UIGridPointState::getsetters[] = { {NULL} /* Sentinel */ }; -PyObject* UIGridPointState::repr(PyUIGridPointStateObject* self) { - std::ostringstream ss; - if (!self->data) ss << ""; - else { - auto gps = self->data; - ss << ""; - } - std::string repr_str = ss.str(); - return PyUnicode_DecodeUTF8(repr_str.c_str(), repr_str.size(), "replace"); -} diff --git a/src/UIGridPoint.h b/src/UIGridPoint.h index 627c3d6..8161df8 100644 --- a/src/UIGridPoint.h +++ b/src/UIGridPoint.h @@ -49,7 +49,6 @@ public: static int set_bool_member(PyUIGridPointObject* self, PyObject* value, void* closure); static PyObject* get_bool_member(PyUIGridPointObject* self, void* closure); static int set_color(PyUIGridPointObject* self, PyObject* value, void* closure); - static PyObject* repr(PyUIGridPointObject* self); }; // UIGridPointState - entity-specific info for each cell @@ -61,7 +60,6 @@ public: static PyObject* get_bool_member(PyUIGridPointStateObject* self, void* closure); static int set_bool_member(PyUIGridPointStateObject* self, PyObject* value, void* closure); static PyGetSetDef getsetters[]; - static PyObject* repr(PyUIGridPointStateObject* self); }; namespace mcrfpydef { @@ -70,7 +68,7 @@ namespace mcrfpydef { .tp_name = "mcrfpy.GridPoint", .tp_basicsize = sizeof(PyUIGridPointObject), .tp_itemsize = 0, - .tp_repr = (reprfunc)UIGridPoint::repr, + // Methods omitted for brevity .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = "UIGridPoint object", .tp_getset = UIGridPoint::getsetters, @@ -83,7 +81,7 @@ namespace mcrfpydef { .tp_name = "mcrfpy.GridPointState", .tp_basicsize = sizeof(PyUIGridPointStateObject), .tp_itemsize = 0, - .tp_repr = (reprfunc)UIGridPointState::repr, + // Methods omitted for brevity .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = "UIGridPointState object", // TODO: Add PyUIGridPointState tp_init .tp_getset = UIGridPointState::getsetters,