Removed Windows-style line breaks (^M) from all .cc and .h source files.
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
/*
|
||||
* This file is part of RawTherapee.
|
||||
*
|
||||
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
||||
*
|
||||
* RawTherapee is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* RawTherapee is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <filebrowserentry.h>
|
||||
/*
|
||||
* This file is part of RawTherapee.
|
||||
*
|
||||
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
||||
*
|
||||
* RawTherapee is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* RawTherapee is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <filebrowserentry.h>
|
||||
#include <thumbbrowserbase.h>
|
||||
#include <cursormanager.h>
|
||||
#include <iomanip>
|
||||
@@ -25,34 +25,34 @@
|
||||
|
||||
#define CROPRESIZEBORDER 4
|
||||
|
||||
bool FileBrowserEntry::iconsLoaded = false;
|
||||
Glib::RefPtr<Gdk::Pixbuf> FileBrowserEntry::editedIcon;
|
||||
Glib::RefPtr<Gdk::Pixbuf> FileBrowserEntry::recentlySavedIcon;
|
||||
Glib::RefPtr<Gdk::Pixbuf> FileBrowserEntry::enqueuedIcon;
|
||||
|
||||
FileBrowserEntry::FileBrowserEntry (Thumbnail* thm, const Glib::ustring& fname)
|
||||
: ThumbBrowserEntryBase (fname), thumbnail(thm), iatlistener(NULL), state(SNormal), cropgl(NULL) {
|
||||
bool FileBrowserEntry::iconsLoaded = false;
|
||||
Glib::RefPtr<Gdk::Pixbuf> FileBrowserEntry::editedIcon;
|
||||
Glib::RefPtr<Gdk::Pixbuf> FileBrowserEntry::recentlySavedIcon;
|
||||
Glib::RefPtr<Gdk::Pixbuf> FileBrowserEntry::enqueuedIcon;
|
||||
|
||||
FileBrowserEntry::FileBrowserEntry (Thumbnail* thm, const Glib::ustring& fname)
|
||||
: ThumbBrowserEntryBase (fname), thumbnail(thm), iatlistener(NULL), state(SNormal), cropgl(NULL) {
|
||||
|
||||
feih = new FileBrowserEntryIdleHelper;
|
||||
feih->fbentry = this;
|
||||
feih->destroyed = false;
|
||||
feih->pending = 0;
|
||||
|
||||
italicstyle = thumbnail->getType() != FT_Raw;
|
||||
datetimeline = thumbnail->getDateTimeString ();
|
||||
|
||||
italicstyle = thumbnail->getType() != FT_Raw;
|
||||
datetimeline = thumbnail->getDateTimeString ();
|
||||
exifline = thumbnail->getExifString ();
|
||||
|
||||
scale = 1;
|
||||
|
||||
if (!iconsLoaded) {
|
||||
editedIcon = safe_create_from_file (argv0+"/images/edited.png");
|
||||
recentlySavedIcon = safe_create_from_file (argv0+"/images/saved.png");
|
||||
enqueuedIcon = safe_create_from_file (argv0+"/images/processing.png");
|
||||
editedIcon = safe_create_from_file (argv0+"/images/edited.png");
|
||||
recentlySavedIcon = safe_create_from_file (argv0+"/images/saved.png");
|
||||
enqueuedIcon = safe_create_from_file (argv0+"/images/processing.png");
|
||||
}
|
||||
|
||||
if (thm)
|
||||
thm->addThumbnailListener (this);
|
||||
}
|
||||
thm->addThumbnailListener (this);
|
||||
}
|
||||
|
||||
FileBrowserEntry::~FileBrowserEntry () {
|
||||
|
||||
@@ -64,8 +64,8 @@ FileBrowserEntry::~FileBrowserEntry () {
|
||||
feih->destroyed = true;
|
||||
else
|
||||
delete feih;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FileBrowserEntry::refreshThumbnailImage () {
|
||||
|
||||
if (!thumbnail)
|
||||
@@ -73,30 +73,30 @@ void FileBrowserEntry::refreshThumbnailImage () {
|
||||
|
||||
thumbImageUpdater.add (thumbnail, thumbnail->getProcParams(), preh, &updatepriority, this);
|
||||
thumbImageUpdater.process ();
|
||||
}
|
||||
|
||||
void FileBrowserEntry::calcThumbnailSize () {
|
||||
|
||||
if (thumbnail)
|
||||
thumbnail->getThumbnailSize (prew, preh);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<Glib::RefPtr<Gdk::Pixbuf> > FileBrowserEntry::getIconsOnImageArea () {
|
||||
|
||||
std::vector<Glib::RefPtr<Gdk::Pixbuf> > ret;
|
||||
|
||||
if (!thumbnail)
|
||||
return ret;
|
||||
|
||||
if (thumbnail->hasProcParams() && editedIcon)
|
||||
ret.push_back (editedIcon);
|
||||
if (thumbnail->isRecentlySaved() && recentlySavedIcon)
|
||||
ret.push_back (recentlySavedIcon);
|
||||
if (thumbnail->isEnqueued () && enqueuedIcon)
|
||||
ret.push_back (enqueuedIcon);
|
||||
|
||||
return ret;
|
||||
}
|
||||
void FileBrowserEntry::calcThumbnailSize () {
|
||||
|
||||
if (thumbnail)
|
||||
thumbnail->getThumbnailSize (prew, preh);
|
||||
}
|
||||
|
||||
std::vector<Glib::RefPtr<Gdk::Pixbuf> > FileBrowserEntry::getIconsOnImageArea () {
|
||||
|
||||
std::vector<Glib::RefPtr<Gdk::Pixbuf> > ret;
|
||||
|
||||
if (!thumbnail)
|
||||
return ret;
|
||||
|
||||
if (thumbnail->hasProcParams() && editedIcon)
|
||||
ret.push_back (editedIcon);
|
||||
if (thumbnail->isRecentlySaved() && recentlySavedIcon)
|
||||
ret.push_back (recentlySavedIcon);
|
||||
if (thumbnail->isEnqueued () && enqueuedIcon)
|
||||
ret.push_back (enqueuedIcon);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void FileBrowserEntry::customBackBufferUpdate (Cairo::RefPtr<Cairo::Context> c) {
|
||||
|
||||
@@ -113,17 +113,17 @@ void FileBrowserEntry::getIconSize (int& w, int& h) {
|
||||
|
||||
w = editedIcon->get_width ();
|
||||
h = editedIcon->get_height ();
|
||||
}
|
||||
|
||||
FileThumbnailButtonSet* FileBrowserEntry::getThumbButtonSet () {
|
||||
|
||||
return (FileThumbnailButtonSet*)buttonSet;
|
||||
}
|
||||
}
|
||||
|
||||
FileThumbnailButtonSet* FileBrowserEntry::getThumbButtonSet () {
|
||||
|
||||
return (FileThumbnailButtonSet*)buttonSet;
|
||||
}
|
||||
|
||||
void FileBrowserEntry::procParamsChanged (Thumbnail* thm, int whoChangedIt) {
|
||||
|
||||
refreshThumbnailImage ();
|
||||
}
|
||||
}
|
||||
|
||||
struct tiupdate {
|
||||
FileBrowserEntryIdleHelper* feih;
|
||||
@@ -315,17 +315,17 @@ bool FileBrowserEntry::pressNotify (int button, int type, int bstate, int x, i
|
||||
}
|
||||
else if (onArea (CropImage, ix, iy)) {
|
||||
if (tm == TMStraighten) {
|
||||
state = SRotateSelecting;
|
||||
press_x = x;
|
||||
press_y = y;
|
||||
action_x = x;
|
||||
state = SRotateSelecting;
|
||||
press_x = x;
|
||||
press_y = y;
|
||||
action_x = x;
|
||||
action_y = y;
|
||||
rot_deg = 0;
|
||||
b = true;
|
||||
b = true;
|
||||
}
|
||||
else if (tm == TMSpotWB) {
|
||||
iatlistener->spotWBselected ((ix-prex)/scale, (iy-prey)/scale, thumbnail);
|
||||
b = true;
|
||||
b = true;
|
||||
}
|
||||
else if (tm == TMCropSelect) {
|
||||
cropgl = iatlistener->startCropEditing (thumbnail);
|
||||
@@ -471,41 +471,41 @@ void FileBrowserEntry::draw () {
|
||||
|
||||
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;
|
||||
if (press_y>action_y) {
|
||||
sol1 = acos(arg)*180/pi;
|
||||
sol2 = -acos(-arg)*180/pi;
|
||||
}
|
||||
else {
|
||||
sol1 = acos(-arg)*180/pi;
|
||||
sol2 = -acos(arg)*180/pi;
|
||||
}
|
||||
if (fabs(sol1)<fabs(sol2))
|
||||
rot_deg = sol1;
|
||||
else
|
||||
rot_deg = sol2;
|
||||
|
||||
if (rot_deg<-45)
|
||||
rot_deg = 90.0 + rot_deg;
|
||||
else if (rot_deg>45)
|
||||
rot_deg = - 90.0 + rot_deg;
|
||||
}
|
||||
else
|
||||
rot_deg = 0;
|
||||
|
||||
Glib::RefPtr<Pango::Context> context = parent->getDrawingArea()->get_pango_context () ;
|
||||
Pango::FontDescription fontd = context->get_font_description ();
|
||||
fontd.set_weight (Pango::WEIGHT_BOLD);
|
||||
fontd.set_size (8*Pango::SCALE);
|
||||
context->set_font_description (fontd);
|
||||
Glib::RefPtr<Pango::Layout> deglayout = parent->getDrawingArea()->create_pango_layout(Glib::ustring::compose ("%1 deg", Glib::ustring::format(std::setprecision(2), rot_deg)));
|
||||
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;
|
||||
if (press_y>action_y) {
|
||||
sol1 = acos(arg)*180/pi;
|
||||
sol2 = -acos(-arg)*180/pi;
|
||||
}
|
||||
else {
|
||||
sol1 = acos(-arg)*180/pi;
|
||||
sol2 = -acos(arg)*180/pi;
|
||||
}
|
||||
if (fabs(sol1)<fabs(sol2))
|
||||
rot_deg = sol1;
|
||||
else
|
||||
rot_deg = sol2;
|
||||
|
||||
int x1 = press_x;
|
||||
int y1 = press_y;
|
||||
int y2 = action_y;
|
||||
if (rot_deg<-45)
|
||||
rot_deg = 90.0 + rot_deg;
|
||||
else if (rot_deg>45)
|
||||
rot_deg = - 90.0 + rot_deg;
|
||||
}
|
||||
else
|
||||
rot_deg = 0;
|
||||
|
||||
Glib::RefPtr<Pango::Context> context = parent->getDrawingArea()->get_pango_context () ;
|
||||
Pango::FontDescription fontd = context->get_font_description ();
|
||||
fontd.set_weight (Pango::WEIGHT_BOLD);
|
||||
fontd.set_size (8*Pango::SCALE);
|
||||
context->set_font_description (fontd);
|
||||
Glib::RefPtr<Pango::Layout> deglayout = parent->getDrawingArea()->create_pango_layout(Glib::ustring::compose ("%1 deg", Glib::ustring::format(std::setprecision(2), rot_deg)));
|
||||
|
||||
int x1 = press_x;
|
||||
int y1 = press_y;
|
||||
int y2 = action_y;
|
||||
int x2 = action_x;
|
||||
|
||||
if (x2<prex+ofsX+startx) {
|
||||
@@ -525,20 +525,20 @@ void FileBrowserEntry::drawStraightenGuide (Cairo::RefPtr<Cairo::Context> cr) {
|
||||
y2 = preh+prey+ofsY+starty-1;
|
||||
}
|
||||
|
||||
cr->set_line_width (1.5);
|
||||
cr->set_source_rgb (1.0, 1.0, 1.0);
|
||||
cr->move_to (x1, y1);
|
||||
cr->line_to (x2, y2);
|
||||
cr->stroke ();
|
||||
cr->set_source_rgb (0.0, 0.0, 0.0);
|
||||
std::valarray<double> ds (1);
|
||||
ds[0] = 4;
|
||||
cr->set_dash (ds, 0);
|
||||
cr->move_to (x1, y1);
|
||||
cr->line_to (x2, y2);
|
||||
cr->stroke ();
|
||||
|
||||
if (press_x!=action_x && press_y!=action_y) {
|
||||
cr->set_line_width (1.5);
|
||||
cr->set_source_rgb (1.0, 1.0, 1.0);
|
||||
cr->move_to (x1, y1);
|
||||
cr->line_to (x2, y2);
|
||||
cr->stroke ();
|
||||
cr->set_source_rgb (0.0, 0.0, 0.0);
|
||||
std::valarray<double> ds (1);
|
||||
ds[0] = 4;
|
||||
cr->set_dash (ds, 0);
|
||||
cr->move_to (x1, y1);
|
||||
cr->line_to (x2, y2);
|
||||
cr->stroke ();
|
||||
|
||||
if (press_x!=action_x && press_y!=action_y) {
|
||||
cr->set_source_rgb (0.0, 0.0, 0.0);
|
||||
cr->move_to ((x1+x2)/2+1, (y1+y2)/2+1);
|
||||
deglayout->add_to_cairo_context (cr);
|
||||
@@ -553,6 +553,6 @@ void FileBrowserEntry::drawStraightenGuide (Cairo::RefPtr<Cairo::Context> cr) {
|
||||
cr->move_to ((x1+x2)/2, (y1+y2)/2);
|
||||
deglayout->add_to_cairo_context (cr);
|
||||
cr->fill ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user