Make RT build without __USE_MISC and __USE_XOPEN

This commit is contained in:
Flössie
2017-01-28 19:03:59 +01:00
parent 9c9ac0d589
commit 88336cb897
24 changed files with 276 additions and 242 deletions

View File

@@ -2320,7 +2320,7 @@ void CropWindow::drawStraightenGuide (Cairo::RefPtr<Cairo::Context> cr)
if (action_x != press_x || action_y != press_y) {
double arg = (press_x - action_x) / sqrt(double((press_x - action_x) * (press_x - action_x) + (press_y - action_y) * (press_y - action_y)));
double sol1, sol2;
double pi = M_PI;
double pi = rtengine::RT_PI;
if (press_y > action_y) {
sol1 = acos(arg) * 180 / pi;

View File

@@ -191,7 +191,7 @@ void Circle::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer
center_ += objectBuffer->getDataProvider()->posScreen + objectBuffer->getDataProvider()->deltaScreen;
}
cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0., 2.*M_PI);
cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0., 2.*rtengine::RT_PI);
cr->stroke();
}
}
@@ -225,7 +225,7 @@ void Circle::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer
}
if (filled && state != INSENSITIVE) {
cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0., 2.*M_PI);
cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0., 2.*rtengine::RT_PI);
if (innerLineWidth > 0.) {
cr->fill_preserve();
@@ -234,7 +234,7 @@ void Circle::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer
cr->fill();
}
} else if (innerLineWidth > 0.) {
cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0., 2.*M_PI);
cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0., 2.*rtengine::RT_PI);
if (state == INSENSITIVE) {
std::valarray<double> ds(1);
@@ -274,7 +274,7 @@ void Circle::drawToMOChannel (Cairo::RefPtr<Cairo::Context> &cr, unsigned short
} else {
cr->set_source_rgba (0., 0., 0., (id + 1) / 65535.);
}
cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0, 2.*M_PI);
cr->arc(center_.x + 0.5, center_.y + 0.5, radius_, 0, 2.*rtengine::RT_PI);
if (filled) {
if (innerLineWidth > 0.) {

View File

@@ -719,7 +719,7 @@ void FileBrowserEntry::drawStraightenGuide (Cairo::RefPtr<Cairo::Context> cr)
if (action_x != press_x || action_y != press_y) {
double arg = (press_x - action_x) / sqrt(double((press_x - action_x) * (press_x - action_x) + (press_y - action_y) * (press_y - action_y)));
double sol1, sol2;
double pi = M_PI;
double pi = rtengine::RT_PI;
if (press_y > action_y) {
sol1 = acos(arg) * 180 / pi;

View File

@@ -424,7 +424,7 @@ bool Gradient::button1Pressed(const int modifierKey)
draggedPoint = currPos - centerPos;
// compute the projected value of the dragged point
draggedFeatherOffset = draggedPoint.radius * sin((draggedPoint.angle - degree->getValue()) / 180.*M_PI);
draggedFeatherOffset = draggedPoint.radius * sin((draggedPoint.angle - degree->getValue()) / 180.*rtengine::RT_PI);
if (lastObject == 3) {
draggedFeatherOffset = -draggedFeatherOffset;
@@ -526,7 +526,7 @@ bool Gradient::drag1(const int modifierKey)
currPos.y = p;
draggedPoint = currPos - centerPos;
double currDraggedFeatherOffset = draggedPoint.radius * sin((draggedPoint.angle - degree->getValue()) / 180.*M_PI);
double currDraggedFeatherOffset = draggedPoint.radius * sin((draggedPoint.angle - degree->getValue()) / 180.*rtengine::RT_PI);
if (lastObject == 2)
// Dragging the upper feather bar

View File

@@ -127,13 +127,13 @@ void LockableColorPicker::updateBackBuffer ()
// black background of the whole color picker
bbcr->set_line_width (0.);
bbcr->set_source_rgba (0., 0., 0., opacity);
bbcr->arc_negative (center, center, center, 0., (double)M_PI);
bbcr->arc_negative (center, center, center, 0., (double)rtengine::RT_PI);
bbcr->line_to (0, 2. * center + textHeight);
bbcr->arc_negative (2. * textPadding, 2. * center + textHeight, 2. * textPadding, (double)M_PI, (double)M_PI / 2.);
bbcr->arc_negative (2. * textPadding, 2. * center + textHeight, 2. * textPadding, (double)rtengine::RT_PI, (double)rtengine::RT_PI / 2.);
bbcr->line_to (textWidth, 2. * center + textHeight + 2. * textPadding);
bbcr->arc_negative (textWidth, 2. * center + textHeight, 2. * textPadding, (double)M_PI / 2., 0.);
bbcr->arc_negative (textWidth, 2. * center + textHeight, 2. * textPadding, (double)rtengine::RT_PI / 2., 0.);
bbcr->line_to (textWidth + 2. * textPadding, 2. * center + 2. * textPadding);
bbcr->arc_negative (textWidth, 2. * center + 2. * textPadding, 2. * textPadding, 0., (double)M_PI * 1.5);
bbcr->arc_negative (textWidth, 2. * center + 2. * textPadding, 2. * textPadding, 0., (double)rtengine::RT_PI * 1.5);
bbcr->line_to (2. * center, 2. * center);
bbcr->close_path();
bbcr->set_line_join (Cairo::LINE_JOIN_BEVEL);
@@ -141,13 +141,13 @@ void LockableColorPicker::updateBackBuffer ()
bbcr->fill ();
// light grey circle around the color mark
bbcr->arc (center, center, center - circlePadding / 2., 0., 2. * (double)M_PI);
bbcr->arc (center, center, center - circlePadding / 2., 0., 2. * (double)rtengine::RT_PI);
bbcr->set_source_rgb (0.75, 0.75, 0.75);
bbcr->set_line_width (circlePadding - 2.);
bbcr->stroke ();
// spot disc with picked color
bbcr->arc (center, center, center - circlePadding, 0., 2. * (double)M_PI);
bbcr->arc (center, center, center - circlePadding, 0., 2. * (double)rtengine::RT_PI);
bbcr->set_source_rgb (rpreview, gpreview, bpreview); // <- set the picker color here
bbcr->set_line_width (0.);
bbcr->fill();
@@ -226,7 +226,7 @@ void LockableColorPicker::updateBackBuffer ()
float center = (float)size / 2.f + circlePadding;
// light grey circle around the color mark
bbcr->arc (center, center, center - circlePadding / 2., 0., 2. * (double)M_PI);
bbcr->arc (center, center, center - circlePadding / 2., 0., 2. * (double)rtengine::RT_PI);
bbcr->set_source_rgba (0., 0., 0., opacity);
bbcr->set_line_width(circlePadding);
bbcr->stroke_preserve();

View File

@@ -481,12 +481,12 @@ void MyDiagonalCurve::draw (int handle)
double x = double(graphX + 1) + double((graphW - 2) * curve.x.at(i)); // project (curve.x.at(i), 0, 1, graphW);
double y = double(graphY - 1) - double((graphH - 2) * curve.y.at(i)); // project (curve.y.at(i), 0, 1, graphH);
cr->arc (x, y, RADIUS + 0.5, 0, 2 * M_PI);
cr->arc (x, y, RADIUS + 0.5, 0, 2 * rtengine::RT_PI);
cr->fill ();
if (i == edited_point) {
cr->set_line_width(2.);
cr->arc (x, y, RADIUS + 3.5, 0, 2 * M_PI);
cr->arc (x, y, RADIUS + 3.5, 0, 2 * rtengine::RT_PI);
cr->stroke();
cr->set_line_width(1.);
}

View File

@@ -456,13 +456,13 @@ void MyFlatCurve::draw ()
double x = double(graphX + 1) + innerW * curve.x.at(i); // project (curve.x.at(i), 0, 1, graphW);
double y = double(graphY - 1) - innerH * curve.y.at(i); // project (curve.y.at(i), 0, 1, graphH);
cr->arc (x, y, (double)RADIUS, 0, 2 * M_PI);
cr->arc (x, y, (double)RADIUS, 0, 2 * rtengine::RT_PI);
cr->fill ();
if (i == edited_point) {
cr->set_source_rgb (1.0, 0.0, 0.0);
cr->set_line_width(2.);
cr->arc (x, y, RADIUS + 3.5, 0, 2 * M_PI);
cr->arc (x, y, RADIUS + 3.5, 0, 2 * rtengine::RT_PI);
cr->stroke();
cr->set_line_width(1.);
}

View File

@@ -434,10 +434,10 @@ void ThumbBrowserEntryBase::drawFrame (Cairo::RefPtr<Cairo::Context> cc, const G
if (selected || framed) {
cc->move_to (radius, 0);
cc->arc (exp_width - 1 - radius, radius, radius, -M_PI / 2, 0);
cc->arc (exp_width - 1 - radius, exp_height - 1 - radius, radius, 0, M_PI / 2);
cc->arc (radius, exp_height - 1 - radius, radius, M_PI / 2, M_PI);
cc->arc (radius, radius, radius, M_PI, -M_PI / 2);
cc->arc (exp_width - 1 - radius, radius, radius, -rtengine::RT_PI / 2, 0);
cc->arc (exp_width - 1 - radius, exp_height - 1 - radius, radius, 0, rtengine::RT_PI / 2);
cc->arc (radius, exp_height - 1 - radius, radius, rtengine::RT_PI / 2, rtengine::RT_PI);
cc->arc (radius, radius, radius, rtengine::RT_PI, -rtengine::RT_PI / 2);
cc->close_path ();
if (selected) {
@@ -452,10 +452,10 @@ void ThumbBrowserEntryBase::drawFrame (Cairo::RefPtr<Cairo::Context> cc, const G
if (framed) {
cc->move_to (+2 + 0.5 + radius, +2 + 0.5);
cc->arc (-2 + 0.5 + exp_width - 1 - radius, +2 + 0.5 + radius, radius, -M_PI / 2, 0);
cc->arc (-2 + 0.5 + exp_width - 1 - radius, -2 + 0.5 + exp_height - 1 - radius, radius, 0, M_PI / 2);
cc->arc (+2 + 0.5 + radius, -2 + exp_height - 1 - radius, radius, M_PI / 2, M_PI);
cc->arc (+2 + 0.5 + radius, +2 + radius, radius, M_PI, -M_PI / 2);
cc->arc (-2 + 0.5 + exp_width - 1 - radius, +2 + 0.5 + radius, radius, -rtengine::RT_PI / 2, 0);
cc->arc (-2 + 0.5 + exp_width - 1 - radius, -2 + 0.5 + exp_height - 1 - radius, radius, 0, rtengine::RT_PI / 2);
cc->arc (+2 + 0.5 + radius, -2 + exp_height - 1 - radius, radius, rtengine::RT_PI / 2, rtengine::RT_PI);
cc->arc (+2 + 0.5 + radius, +2 + radius, radius, rtengine::RT_PI, -rtengine::RT_PI / 2);
cc->close_path ();
cc->set_source_rgb (fg.get_red(), fg.get_green(), fg.get_blue());
cc->set_line_width (2.0);