From 6a4938e4ee7070c8603c073fd003204228e93a21 Mon Sep 17 00:00:00 2001 From: Amy Bowersox Date: Wed, 11 Dec 2019 14:27:14 -0700 Subject: [PATCH] finished disco debugging --- scripts/demo1.py | 3 --- src/ep_bitmap.c | 7 ------- src/ep_devctxt.c | 9 --------- 3 files changed, 19 deletions(-) diff --git a/scripts/demo1.py b/scripts/demo1.py index 767f327..3c3c5cd 100755 --- a/scripts/demo1.py +++ b/scripts/demo1.py @@ -107,11 +107,8 @@ hdc.rectangle(cmd2_rect[0], cmd2_rect[1], cmd2_rect[2], cmd2_rect[3]) hdc.rectangle(cmd3_rect[0], cmd3_rect[1], cmd3_rect[2], cmd3_rect[3]) hdc.rectangle(cmd4_rect[0], cmd4_rect[1], cmd4_rect[2], cmd4_rect[3]) -print('GOT HERE 1') hdc_bits.select_object(bmp_freehand) -print('GOT HERE 2') hdc.bitblt(cmd1_rect[0] + 6, cmd1_rect[1] + 6, cmd1_rect[0] + 54, cmd1_rect[1] + 54, hdc_bits, 0, 0, 0) -print('GOT HERE 3') # Main message loop msg = {} diff --git a/src/ep_bitmap.c b/src/ep_bitmap.c index 160ada9..fbc6da6 100755 --- a/src/ep_bitmap.c +++ b/src/ep_bitmap.c @@ -45,13 +45,11 @@ static int bitmap_init(BitmapObject *self, PyObject *args, PyObject *kwds) const char *stock; int width = 0, height = 0; - Log(LDEBUG, "Bitmap init entry"); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|$sii", kwlist, &stock, &width, &height)) return -1; if (stock) { - Log(LDEBUG, "stock bitmap"); self->pbmp = _BMP_GetStock(stock); if (!(self->pbmp)) { @@ -61,7 +59,6 @@ static int bitmap_init(BitmapObject *self, PyObject *args, PyObject *kwds) } else { - Log(LDEBUG, "basic bitmap"); width = MAX(1, width); height = MAX(1, height); self->pbmp = BMP_Create(width, height, NULL); @@ -119,16 +116,12 @@ PyObject *Epython_wrap_bitmap(PBITMAP pbmp) kwargs = PyDict_New(); if (kwargs) { - Log(LDEBUG, "gonna create it"); rc = PyType_GenericNew(&BitmapType, args, kwargs); - Log(LDEBUG, "created it"); if (rc) { pbitmapobj = (BitmapObject *)rc; - Log(LDEBUG, "gonna delete bitmap"); if (pbitmapobj->pbmp) BMP_Delete(pbitmapobj->pbmp); - Log(LDEBUG, "deleted bitmap"); pbitmapobj->pbmp = pbmp; } Py_DECREF(kwargs); diff --git a/src/ep_devctxt.c b/src/ep_devctxt.c index 33d6913..070a2b6 100755 --- a/src/ep_devctxt.c +++ b/src/ep_devctxt.c @@ -144,24 +144,18 @@ static PyObject *devctxt_select_bitmap(DevCtxtObject *self, BitmapObject *newbmp BitmapObject *old_bitmap = NULL; PBITMAP old_pbmp; - Log(LDEBUG, "select_bitmap entry"); if ((self->pdctxt->flags & DCFLG_TYPES) != DCFLG_IS_MEMORY) { PyErr_SetString(PyExc_RuntimeError, "must select bitmap into memory device context"); return NULL; } - Log(LDEBUG, "verified 1"); old_bitmap = self->selected_bitmap; old_pbmp = (PBITMAP)DC_SelectObject(self->pdctxt, (PGFXOBJECT)(newbmp->pbmp)); - Log(LDEBUG, "old_bitmap present=%d, old_pbmp present=%d", !!old_bitmap, !!old_pbmp); if (!old_bitmap) { - Log(LDEBUG, "need to wrap old bitmap"); old_bitmap = (BitmapObject *)Epython_wrap_bitmap(old_pbmp); - Log(LDEBUG, "wrapper finished"); if (!old_bitmap) { - Log(LDEBUG, "wrapper failed"); DC_SelectObject(self->pdctxt, (PGFXOBJECT)old_pbmp); return NULL; } @@ -171,7 +165,6 @@ static PyObject *devctxt_select_bitmap(DevCtxtObject *self, BitmapObject *newbmp self->selected_bitmap = old_bitmap; } } - Log(LDEBUG, "replacement sequence"); ASSERT(old_bitmap); ASSERT(self->selected_bitmap); ASSERT(newbmp); @@ -185,7 +178,6 @@ static PyObject *devctxt_select_object(DevCtxtObject *self, PyObject *args) { PyObject *obj; - Log(LDEBUG, "select_object entry"); if (!PyArg_ParseTuple(args, "O", &obj)) return NULL; if (!obj) @@ -193,7 +185,6 @@ static PyObject *devctxt_select_object(DevCtxtObject *self, PyObject *args) PyErr_SetString(PyExc_RuntimeError, "bad object selected"); return NULL; } - Log(LDEBUG, "ready to comb objects"); if (PyObject_TypeCheck(obj, &BitmapType)) return devctxt_select_bitmap(self, (BitmapObject *)obj); PyErr_SetString(PyExc_RuntimeError, "unknown type of object selected");