comparison src/xs_curve.c @ 702:b5b6b13a6d85

Renamed some types.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 25 May 2008 01:38:48 +0300
parents b0743dc9165d
children 9321ffa2ea7e
comparison
equal deleted inserted replaced
701:f2037b4d2c23 702:b5b6b13a6d85
208 { 208 {
209 gfloat res = 5.0f; 209 gfloat res = 5.0f;
210 GtkStateType state; 210 GtkStateType state;
211 GtkStyle *style; 211 GtkStyle *style;
212 gint i, ox = -1, oy = -1; 212 gint i, ox = -1, oy = -1;
213 t_xs_point *p0, *p1, *p2, *p3; 213 xs_point_t *p0, *p1, *p2, *p3;
214 214
215 if (!curve->pixmap) 215 if (!curve->pixmap)
216 return; 216 return;
217 217
218 state = GTK_STATE_NORMAL; 218 state = GTK_STATE_NORMAL;
566 566
567 gboolean xs_curve_realloc_data(XSCurve *curve, gint npoints) 567 gboolean xs_curve_realloc_data(XSCurve *curve, gint npoints)
568 { 568 {
569 if (npoints != curve->nctlpoints) { 569 if (npoints != curve->nctlpoints) {
570 curve->nctlpoints = npoints; 570 curve->nctlpoints = npoints;
571 curve->ctlpoints = (t_xs_point *) g_realloc(curve->ctlpoints, 571 curve->ctlpoints = (xs_point_t *) g_realloc(curve->ctlpoints,
572 curve->nctlpoints * sizeof(*curve->ctlpoints)); 572 curve->nctlpoints * sizeof(*curve->ctlpoints));
573 573
574 if (curve->ctlpoints == NULL) 574 if (curve->ctlpoints == NULL)
575 return FALSE; 575 return FALSE;
576 } 576 }
577 577
578 return TRUE; 578 return TRUE;
579 } 579 }
580 580
581 581
582 void xs_curve_get_data(XSCurve *curve, t_xs_point ***points, gint **npoints) 582 void xs_curve_get_data(XSCurve *curve, xs_point_t ***points, gint **npoints)
583 { 583 {
584 *points = &(curve->ctlpoints); 584 *points = &(curve->ctlpoints);
585 *npoints = &(curve->nctlpoints); 585 *npoints = &(curve->nctlpoints);
586 } 586 }
587 587
588 588
589 gboolean xs_curve_set_points(XSCurve *curve, t_xs_int_point *points, gint npoints) 589 gboolean xs_curve_set_points(XSCurve *curve, xs_int_point_t *points, gint npoints)
590 { 590 {
591 gint i; 591 gint i;
592 592
593 if (!xs_curve_realloc_data(curve, npoints + 4)) 593 if (!xs_curve_realloc_data(curve, npoints + 4))
594 return FALSE; 594 return FALSE;
611 xs_curve_update(curve); 611 xs_curve_update(curve);
612 return TRUE; 612 return TRUE;
613 } 613 }
614 614
615 615
616 gboolean xs_curve_get_points(XSCurve *curve, t_xs_int_point **points, gint *npoints) 616 gboolean xs_curve_get_points(XSCurve *curve, xs_int_point_t **points, gint *npoints)
617 { 617 {
618 gint i, n; 618 gint i, n;
619 619
620 n = curve->nctlpoints - 4; 620 n = curve->nctlpoints - 4;
621 621
622 *points = g_malloc(n * sizeof(t_xs_int_point)); 622 *points = g_malloc(n * sizeof(xs_int_point_t));
623 if (*points == NULL) 623 if (*points == NULL)
624 return FALSE; 624 return FALSE;
625 625
626 *npoints = n; 626 *npoints = n;
627 for (i = 2; i < curve->nctlpoints - 2; i++) { 627 for (i = 2; i < curve->nctlpoints - 2; i++) {