Ejemplo n.º 1
0
void
mouse_mkregion(int y, int x, int height, int width, int code)
{
    mseRegion *butPtr;

    if (find_region_by_code(code) == 0
     && (butPtr = malloc(sizeof(mseRegion))) != 0) {
	butPtr->y = basey + y;
	butPtr->Y = basey + y + height;
	butPtr->x = basex + x;
	butPtr->X = basex + x + width;
	butPtr->code = code;
	butPtr->next = regionList;
	regionList = butPtr;
    }
}
Ejemplo n.º 2
0
mseRegion *
dlg_mouse_mkregion(int y, int x, int height, int width, int code)
{
    mseRegion *butPtr;

    if ((butPtr = find_region_by_code(code)) == 0) {
	butPtr = dlg_malloc(mseRegion, 1);
	assert_ptr(butPtr, "dlg_mouse_mkregion");
	butPtr->next = regionList;
	regionList = butPtr;
    }
    if (butPtr != 0) {
	butPtr->mode = -1;
	butPtr->step_x = 0;
	butPtr->step_y = 0;
	butPtr->y = basey + y;
	butPtr->Y = basey + y + height;
	butPtr->x = basex + x;
	butPtr->X = basex + x + width;
	butPtr->code = code;
    }
    return butPtr;
}