hackathon-dev #1
|
@ -1,6 +1,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#define PY_SSIZE_T_CLEAN
|
#define PY_SSIZE_T_CLEAN
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
#include "scode.h"
|
||||||
#include "gfxobj.h"
|
#include "gfxobj.h"
|
||||||
#include "bitmap.h"
|
#include "bitmap.h"
|
||||||
#include "ep_types.h"
|
#include "ep_types.h"
|
||||||
|
@ -48,7 +49,7 @@ static int bitmap_init(BitmapObject *self, PyObject *args, PyObject *kwds)
|
||||||
width = MAX(1, width);
|
width = MAX(1, width);
|
||||||
height = MAX(1, height);
|
height = MAX(1, height);
|
||||||
self->pbmp = BMP_Create(width, height, NULL);
|
self->pbmp = BMP_Create(width, height, NULL);
|
||||||
if (!(self->bmp))
|
if (!(self->pbmp))
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_RuntimeError, "unable to create bitmap");
|
PyErr_SetString(PyExc_RuntimeError, "unable to create bitmap");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -165,14 +165,12 @@ static PyObject *devctxt_select_bitmap(DevCtxtObject *self, BitmapObject *newbmp
|
||||||
Py_DECREF(self->selected_bitmap);
|
Py_DECREF(self->selected_bitmap);
|
||||||
self->selected_bitmap = newbmp;
|
self->selected_bitmap = newbmp;
|
||||||
Py_INCREF(self->selected_bitmap);
|
Py_INCREF(self->selected_bitmap);
|
||||||
return old_bitmap;
|
return (PyObject *)old_bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *devctxt_select_object(DevCtxtObject *self, PyObject *args)
|
static PyObject *devctxt_select_object(DevCtxtObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
PyObject *obj;
|
PyObject *obj;
|
||||||
PBITMAP old_bitmap;
|
|
||||||
BitmapObject *old_bmp_object, *new_bmp_object;
|
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "O", &obj))
|
if (!PyArg_ParseTuple(args, "O", &obj))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user