/** * mypaint_brush_new: * * Create a new MyPaint brush engine instance. * Initial reference count is 1. Release references using mypaint_brush_unref() */ MyPaintBrush * mypaint_brush_new(void) { MyPaintBrush *self = (MyPaintBrush *)malloc(sizeof(MyPaintBrush)); self->refcount = 1; int i=0; for (i=0; i<MYPAINT_BRUSH_SETTINGS_COUNT; i++) { self->settings[i] = mypaint_mapping_new(MYPAINT_BRUSH_INPUTS_COUNT); } self->rng = rng_double_new(1000); self->print_inputs = FALSE; for (i=0; i<MYPAINT_BRUSH_STATES_COUNT; i++) { self->states[i] = 0; } mypaint_brush_new_stroke(self); settings_base_values_have_changed(self); self->reset_requested = TRUE; #ifdef HAVE_JSON_C self->brush_json = json_object_new_object(); #endif return self; }
void new_stroke() { mypaint_brush_new_stroke(c_brush); }