illumination-commit Mailing List for Illumination
Status: Beta
Brought to you by:
tteuling
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(100) |
Aug
(37) |
Sep
(64) |
Oct
(104) |
Nov
(68) |
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(23) |
Feb
(9) |
Mar
(21) |
Apr
(53) |
May
(113) |
Jun
(35) |
Jul
(107) |
Aug
(224) |
Sep
(74) |
Oct
(93) |
Nov
(115) |
Dec
(111) |
2006 |
Jan
(85) |
Feb
(113) |
Mar
(66) |
Apr
(18) |
May
(21) |
Jun
(39) |
Jul
(50) |
Aug
(19) |
Sep
(14) |
Oct
(34) |
Nov
(15) |
Dec
(46) |
2007 |
Jan
(86) |
Feb
(65) |
Mar
(42) |
Apr
(21) |
May
(32) |
Jun
(80) |
Jul
(52) |
Aug
(144) |
Sep
(57) |
Oct
(74) |
Nov
(131) |
Dec
(26) |
2008 |
Jan
(3) |
Feb
(30) |
Mar
(28) |
Apr
(16) |
May
(37) |
Jun
(65) |
Jul
(58) |
Aug
(71) |
Sep
(54) |
Oct
(123) |
Nov
(94) |
Dec
(84) |
2009 |
Jan
(104) |
Feb
(114) |
Mar
(95) |
Apr
(32) |
May
(61) |
Jun
(7) |
Jul
(63) |
Aug
(32) |
Sep
(58) |
Oct
(117) |
Nov
(88) |
Dec
(135) |
2010 |
Jan
(91) |
Feb
(62) |
Mar
(31) |
Apr
(4) |
May
(41) |
Jun
(28) |
Jul
(65) |
Aug
(45) |
Sep
(137) |
Oct
(208) |
Nov
(50) |
Dec
(98) |
2011 |
Jan
(13) |
Feb
(19) |
Mar
(2) |
Apr
(4) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(5) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <tte...@us...> - 2012-03-24 15:03:12
|
Revision: 4138 http://illumination.svn.sourceforge.net/illumination/?rev=4138&view=rev Author: tteuling Date: 2012-03-24 15:03:06 +0000 (Sat, 24 Mar 2012) Log Message: ----------- Added missing include. Modified Paths: -------------- trunk/Illumination/src/Lum/OS/EventLoopUnix.cpp Modified: trunk/Illumination/src/Lum/OS/EventLoopUnix.cpp =================================================================== --- trunk/Illumination/src/Lum/OS/EventLoopUnix.cpp 2012-03-24 13:31:03 UTC (rev 4137) +++ trunk/Illumination/src/Lum/OS/EventLoopUnix.cpp 2012-03-24 15:03:06 UTC (rev 4138) @@ -23,6 +23,7 @@ #include <iostream> #include <sys/types.h> +#include <unistd.h> namespace Lum { namespace OS { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2012-03-24 13:31:09
|
Revision: 4137 http://illumination.svn.sourceforge.net/illumination/?rev=4137&view=rev Author: tteuling Date: 2012-03-24 13:31:03 +0000 (Sat, 24 Mar 2012) Log Message: ----------- Add missing virtual destructor. Modified Paths: -------------- trunk/Illumination/src/Lum/Model/Number.cpp Modified: trunk/Illumination/src/Lum/Model/Number.cpp =================================================================== --- trunk/Illumination/src/Lum/Model/Number.cpp 2012-03-24 13:30:45 UTC (rev 4136) +++ trunk/Illumination/src/Lum/Model/Number.cpp 2012-03-24 13:31:03 UTC (rev 4137) @@ -127,6 +127,11 @@ // no code } + virtual ~Value() + { + // no code + } + void SetNull(bool isNull) { this->isNull=isNull; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2012-03-24 13:30:51
|
Revision: 4136 http://illumination.svn.sourceforge.net/illumination/?rev=4136&view=rev Author: tteuling Date: 2012-03-24 13:30:45 +0000 (Sat, 24 Mar 2012) Log Message: ----------- Add missing include. Modified Paths: -------------- trunk/Illumination/src/Lum/OS/Base/Event.cpp Modified: trunk/Illumination/src/Lum/OS/Base/Event.cpp =================================================================== --- trunk/Illumination/src/Lum/OS/Base/Event.cpp 2012-03-24 13:22:55 UTC (rev 4135) +++ trunk/Illumination/src/Lum/OS/Base/Event.cpp 2012-03-24 13:30:45 UTC (rev 4136) @@ -42,7 +42,7 @@ bool MouseEvent::IsGrabEnd() const { // last button listed in qualifier is release - return type==up && qualifier==(1 << (((unsigned long)button)-1)); + return type==up && qualifier==(1ul << (((unsigned long)button)-1)); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2012-03-24 13:23:02
|
Revision: 4135 http://illumination.svn.sourceforge.net/illumination/?rev=4135&view=rev Author: tteuling Date: 2012-03-24 13:22:55 +0000 (Sat, 24 Mar 2012) Log Message: ----------- Fixed compiler error and pitential memory leak. Modified Paths: -------------- trunk/Illumination/include/Lum/Model/Table.h Modified: trunk/Illumination/include/Lum/Model/Table.h =================================================================== --- trunk/Illumination/include/Lum/Model/Table.h 2011-11-08 11:05:34 UTC (rev 4134) +++ trunk/Illumination/include/Lum/Model/Table.h 2012-03-24 13:22:55 UTC (rev 4135) @@ -113,6 +113,11 @@ class Comparator { public: + inline virtual ~Comparator() + { + // no code + } + virtual bool operator()(const Element& a, const Element& b, size_t column, bool ascending) const = 0; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-11-08 11:05:40
|
Revision: 4134 http://illumination.svn.sourceforge.net/illumination/?rev=4134&view=rev Author: tteuling Date: 2011-11-08 11:05:34 +0000 (Tue, 08 Nov 2011) Log Message: ----------- Fixed bug in properties dialog for small screens. Modified Paths: -------------- trunk/Illumination/src/Lum/Dlg/Properties.cpp Modified: trunk/Illumination/src/Lum/Dlg/Properties.cpp =================================================================== --- trunk/Illumination/src/Lum/Dlg/Properties.cpp 2011-11-06 19:32:31 UTC (rev 4133) +++ trunk/Illumination/src/Lum/Dlg/Properties.cpp 2011-11-08 11:05:34 UTC (rev 4134) @@ -320,7 +320,7 @@ tab->Add(props->GetDesc().GetLabel(),label); label=NULL; } - else if (OS::display->GetSize()>=OS::Display::sizeNormal) { + else { vPanel->Add(label); label=NULL; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-11-06 19:32:38
|
Revision: 4133 http://illumination.svn.sourceforge.net/illumination/?rev=4133&view=rev Author: tteuling Date: 2011-11-06 19:32:31 +0000 (Sun, 06 Nov 2011) Log Message: ----------- Hildon build fixes. Modified Paths: -------------- trunk/Illumination/src/Lum/OS/Hildon/Behaviour.cpp Modified: trunk/Illumination/src/Lum/OS/Hildon/Behaviour.cpp =================================================================== --- trunk/Illumination/src/Lum/OS/Hildon/Behaviour.cpp 2011-11-06 19:19:05 UTC (rev 4132) +++ trunk/Illumination/src/Lum/OS/Hildon/Behaviour.cpp 2011-11-06 19:32:31 UTC (rev 4133) @@ -34,7 +34,7 @@ #include <Lum/OS/X11/Display.h> #include <Lum/OS/X11/Window.h> -#include <Lum/OS/X11/GtkTheme.h> +#include <Lum/OS/Gtk/GtkTheme.h> namespace Lum { namespace OS { @@ -116,7 +116,7 @@ { X11::Display *display=dynamic_cast<X11::Display*>(OS::display); - SetBackground(dynamic_cast<X11::GtkTheme*>(OS::display->GetTheme())->appMenuBackground); + SetBackground(dynamic_cast<Gtk::GtkTheme*>(OS::display->GetTheme())->appMenuBackground); SetType(OS::Window::typeCustom); GetWindow()->SetScreenOrientationHint(OS::Window::screenOrientationBothSupported); dynamic_cast<X11::Window*>(GetWindow())->SetCustomWindowType(XInternAtom(display->display, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-11-06 19:19:11
|
Revision: 4132 http://illumination.svn.sourceforge.net/illumination/?rev=4132&view=rev Author: tteuling Date: 2011-11-06 19:19:05 +0000 (Sun, 06 Nov 2011) Log Message: ----------- Fixed build under older g++ versions. Modified Paths: -------------- trunk/Illumination/include/Lum/Def/Props.h Modified: trunk/Illumination/include/Lum/Def/Props.h =================================================================== --- trunk/Illumination/include/Lum/Def/Props.h 2011-11-05 21:36:19 UTC (rev 4131) +++ trunk/Illumination/include/Lum/Def/Props.h 2011-11-06 19:19:05 UTC (rev 4132) @@ -53,7 +53,7 @@ PropGroup* Boolean(const Def::Boolean& boolean); PropGroup* Number(const Def::Number& number); - PropGroup* Interval(const Interval& interval); + PropGroup* Interval(const Def::Interval& interval); PropGroup* OneOfN(const Def::OneOfN& oneOfN); PropGroup* OneOfMany(const Def::OneOfMany& oneOfMany); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-11-05 21:36:25
|
Revision: 4131 http://illumination.svn.sourceforge.net/illumination/?rev=4131&view=rev Author: tteuling Date: 2011-11-05 21:36:19 +0000 (Sat, 05 Nov 2011) Log Message: ----------- Added model validation to properties dialog. Modified Paths: -------------- trunk/Illumination/include/Lum/Dlg/Properties.h trunk/Illumination/src/Lum/Dlg/Properties.cpp Modified: trunk/Illumination/include/Lum/Dlg/Properties.h =================================================================== --- trunk/Illumination/include/Lum/Dlg/Properties.h 2011-11-01 07:13:01 UTC (rev 4130) +++ trunk/Illumination/include/Lum/Dlg/Properties.h 2011-11-05 21:36:19 UTC (rev 4131) @@ -52,6 +52,7 @@ void ObserveModels(); void PushModels(); + void ValidateModels(); void SaveModels(); void PopModels(); Modified: trunk/Illumination/src/Lum/Dlg/Properties.cpp =================================================================== --- trunk/Illumination/src/Lum/Dlg/Properties.cpp 2011-11-01 07:13:01 UTC (rev 4130) +++ trunk/Illumination/src/Lum/Dlg/Properties.cpp 2011-11-05 21:36:19 UTC (rev 4131) @@ -138,6 +138,37 @@ VisitModels(visitor); } + void Properties::ValidateModels() + { + struct SaveVisitor : Visitor + { + bool valid; + + SaveVisitor() + { + valid=true; + } + + void Visit(Lum::Base::Model* model) + { + if (model->IsNull()) { + valid=false; + } + } + }; + + SaveVisitor visitor; + + VisitModels(visitor); + + if (visitor.valid) { + okAction->Enable(); + } + else { + okAction->Disable(); + } + } + void Properties::SaveModels() { struct SaveVisitor : Visitor @@ -315,6 +346,9 @@ GetClosedAction()->IsFinished()) { Exit(); } + else { + ValidateModels(); + } Dialog::Resync(model,msg); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-11-01 07:13:07
|
Revision: 4130 http://illumination.svn.sourceforge.net/illumination/?rev=4130&view=rev Author: tteuling Date: 2011-11-01 07:13:01 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Fixed warning/errors in std::min/std::max macros. Modified Paths: -------------- trunk/Illumination/src/Lum/Dlg/File.cpp trunk/Illumination/src/Lum/Edit/Text.cpp trunk/Illumination/src/Lum/Float.cpp trunk/Illumination/src/Lum/String.cpp Modified: trunk/Illumination/src/Lum/Dlg/File.cpp =================================================================== --- trunk/Illumination/src/Lum/Dlg/File.cpp 2011-07-09 15:24:58 UTC (rev 4129) +++ trunk/Illumination/src/Lum/Dlg/File.cpp 2011-11-01 07:13:01 UTC (rev 4130) @@ -297,7 +297,7 @@ header=new Model::HeaderImpl(); header->AddColumn(_l(L"MODEL_DIR_FILENAME",L"Filename"),Base::Size::stdCharWidth,15,true); - header->AddColumn(_l(L"MODEL_DIR_SIZE",L"Size"),Base::Size::stdCharWidth,std::max(8u,_l(L"MODEL_DIR_DIR",L"(dir)").length())); + header->AddColumn(_l(L"MODEL_DIR_SIZE",L"Size"),Base::Size::stdCharWidth,std::max((size_t)8u,_l(L"MODEL_DIR_DIR",L"(dir)").length())); header->AddColumn(_l(L"MODEL_DIR_DATE",L"Date"),Base::Size::stdCharWidth,10); table=new Table(); Modified: trunk/Illumination/src/Lum/Edit/Text.cpp =================================================================== --- trunk/Illumination/src/Lum/Edit/Text.cpp 2011-07-09 15:24:58 UTC (rev 4129) +++ trunk/Illumination/src/Lum/Edit/Text.cpp 2011-11-01 07:13:01 UTC (rev 4130) @@ -610,7 +610,7 @@ assert(highMark+1==line); if (line>=memory.size()) { if (memory.size()==0) { - memory.resize(std::max(line,10000u)); + memory.resize(std::max(line,(size_t)10000u)); } else { memory.resize(std::max(line,memory.size()*10)); Modified: trunk/Illumination/src/Lum/Float.cpp =================================================================== --- trunk/Illumination/src/Lum/Float.cpp 2011-07-09 15:24:58 UTC (rev 4129) +++ trunk/Illumination/src/Lum/Float.cpp 2011-11-01 07:13:01 UTC (rev 4130) @@ -102,7 +102,7 @@ unsigned long rows; if (preferredColumns>0) { - columns=std::max(1u,std::min(objects.size(),preferredColumns)); + columns=std::max((size_t)1u,std::min(objects.size(),preferredColumns)); } else { columns=std::max(1l,lround(sqrt(objects.size()))); @@ -213,7 +213,7 @@ void Float::GetDimension(size_t& width, size_t& height) { if (preferredColumns>0) { - columns=std::max(1u,std::min(objects.size(),preferredColumns)); + columns=std::max((size_t)1u,std::min(objects.size(),preferredColumns)); } else { columns=std::max(1l,lround(sqrt(objects.size()))); Modified: trunk/Illumination/src/Lum/String.cpp =================================================================== --- trunk/Illumination/src/Lum/String.cpp 2011-07-09 15:24:58 UTC (rev 4129) +++ trunk/Illumination/src/Lum/String.cpp 2011-11-01 07:13:01 UTC (rev 4130) @@ -185,7 +185,7 @@ String::String() : textAlign(left), baseline(false), - visWidth(std::max(20u,OS::display->GetFont()->height*5)), + visWidth(std::max((size_t)20u,OS::display->GetFont()->height*5)), offset(0),cursor(0), markA((size_t)-1),markB((size_t)-1), font(OS::display->GetFont()), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-07-09 15:25:04
|
Revision: 4129 http://illumination.svn.sourceforge.net/illumination/?rev=4129&view=rev Author: tteuling Date: 2011-07-09 15:24:58 +0000 (Sat, 09 Jul 2011) Log Message: ----------- Removed warning. Modified Paths: -------------- trunk/DiceJinni/src/GameArea.cpp Modified: trunk/DiceJinni/src/GameArea.cpp =================================================================== --- trunk/DiceJinni/src/GameArea.cpp 2011-05-02 20:12:44 UTC (rev 4128) +++ trunk/DiceJinni/src/GameArea.cpp 2011-07-09 15:24:58 UTC (rev 4129) @@ -129,7 +129,6 @@ size_t w=(i+1)*distance+i*cellSize; size_t r; size_t c; - size_t aw; size_t ah; if (w>width && i>1) { @@ -137,7 +136,6 @@ } c=i; - aw=w; r=iter->dices.size()/i; if (iter->dices.size()%i>0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-05-02 20:12:50
|
Revision: 4128 http://illumination.svn.sourceforge.net/illumination/?rev=4128&view=rev Author: tteuling Date: 2011-05-02 20:12:44 +0000 (Mon, 02 May 2011) Log Message: ----------- Removed g++ 4.6 warning Modified Paths: -------------- trunk/WeightJinni/src/ImportExport.cpp Modified: trunk/WeightJinni/src/ImportExport.cpp =================================================================== --- trunk/WeightJinni/src/ImportExport.cpp 2011-05-02 20:12:05 UTC (rev 4127) +++ trunk/WeightJinni/src/ImportExport.cpp 2011-05-02 20:12:44 UTC (rev 4128) @@ -149,7 +149,6 @@ Lum::Base::Path path; std::wstring dir; std::wstring file; - bool res; if (!Lum::Manager::FileSystem::Instance()->GetEntry(Lum::Manager::FileSystem::userDocumentDir, dir)) { @@ -180,7 +179,7 @@ top->Add(entry); } - res=Lum::Config::SaveConfigToXMLFile(file,top); + Lum::Config::SaveConfigToXMLFile(file,top); delete top; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-05-02 20:12:13
|
Revision: 4127 http://illumination.svn.sourceforge.net/illumination/?rev=4127&view=rev Author: tteuling Date: 2011-05-02 20:12:05 +0000 (Mon, 02 May 2011) Log Message: ----------- Removed g++ 4.6 warning Modified Paths: -------------- trunk/TOE/src/FctTextIO.cpp Modified: trunk/TOE/src/FctTextIO.cpp =================================================================== --- trunk/TOE/src/FctTextIO.cpp 2011-05-02 20:10:09 UTC (rev 4126) +++ trunk/TOE/src/FctTextIO.cpp 2011-05-02 20:12:05 UTC (rev 4127) @@ -36,7 +36,6 @@ { std::wstring fileName; Lum::Dlg::File::Options *options; - bool fakeFunctionExecuted=false; if (!e.model->GetFileName().empty()) { fileName=e.model->GetFileName(); @@ -82,7 +81,6 @@ } else { edit=TextNew(); - fakeFunctionExecuted=true; } Lum::Base::Status status; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-05-02 20:10:15
|
Revision: 4126 http://illumination.svn.sourceforge.net/illumination/?rev=4126&view=rev Author: tteuling Date: 2011-05-02 20:10:09 +0000 (Mon, 02 May 2011) Log Message: ----------- Removed g++ 4.6 warning Modified Paths: -------------- trunk/MathJinni/src/Parser.cpp Modified: trunk/MathJinni/src/Parser.cpp =================================================================== --- trunk/MathJinni/src/Parser.cpp 2011-05-02 20:09:32 UTC (rev 4125) +++ trunk/MathJinni/src/Parser.cpp 2011-05-02 20:10:09 UTC (rev 4126) @@ -422,12 +422,10 @@ bool localized) { size_t state; - size_t bufferPos; std::string buffer; double value; state=0; - bufferPos=0; data=NULL; while (true) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-05-02 20:09:38
|
Revision: 4125 http://illumination.svn.sourceforge.net/illumination/?rev=4125&view=rev Author: tteuling Date: 2011-05-02 20:09:32 +0000 (Mon, 02 May 2011) Log Message: ----------- Removed g++ 4.6 warning. Modified Paths: -------------- trunk/GPSJinni/src/TimeLine.cpp Modified: trunk/GPSJinni/src/TimeLine.cpp =================================================================== --- trunk/GPSJinni/src/TimeLine.cpp 2011-04-30 21:17:27 UTC (rev 4124) +++ trunk/GPSJinni/src/TimeLine.cpp 2011-05-02 20:09:32 UTC (rev 4125) @@ -179,7 +179,6 @@ bool finished=false; // We have drawn one point pastthe visible end and can now finish int px=0,py=0; // Coordinates of previous point long seconds; - double lastValue=0; iter=data.lower_bound(start); @@ -239,7 +238,6 @@ pointsDrawn=true; px=cx; py=cy; - lastValue=iter->second.value; } else { pointsDrawn=false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-04-30 21:17:33
|
Revision: 4124 http://illumination.svn.sourceforge.net/illumination/?rev=4124&view=rev Author: tteuling Date: 2011-04-30 21:17:27 +0000 (Sat, 30 Apr 2011) Log Message: ----------- Fixed g++ 4.6 compiler error. Modified Paths: -------------- trunk/Scopa/src/NeuronalNetwork.h Modified: trunk/Scopa/src/NeuronalNetwork.h =================================================================== --- trunk/Scopa/src/NeuronalNetwork.h 2011-04-30 21:12:35 UTC (rev 4123) +++ trunk/Scopa/src/NeuronalNetwork.h 2011-04-30 21:17:27 UTC (rev 4124) @@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <cstddef> #include <vector> class NeuronalNetwork This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-04-30 21:12:50
|
Revision: 4123 http://illumination.svn.sourceforge.net/illumination/?rev=4123&view=rev Author: tteuling Date: 2011-04-30 21:12:35 +0000 (Sat, 30 Apr 2011) Log Message: ----------- Fixed configure and m4 macros usage. Removed Paths: ------------- trunk/PackageRate/m4/acx_pthread.m4 trunk/PackageRate/m4/iconv.m4 trunk/PackageRate/m4/lib-ld.m4 trunk/PackageRate/m4/lib-link.m4 trunk/PackageRate/m4/lib-prefix.m4 trunk/PackageRate/m4/libtool.m4 trunk/PackageRate/m4/ltoptions.m4 trunk/PackageRate/m4/ltsugar.m4 trunk/PackageRate/m4/ltversion.m4 trunk/PackageRate/m4/lt~obsolete.m4 Deleted: trunk/PackageRate/m4/acx_pthread.m4 =================================================================== --- trunk/PackageRate/m4/acx_pthread.m4 2011-04-30 21:06:16 UTC (rev 4122) +++ trunk/PackageRate/m4/acx_pthread.m4 2011-04-30 21:12:35 UTC (rev 4123) @@ -1,271 +0,0 @@ -# =========================================================================== -# http://autoconf-archive.cryp.to/acx_pthread.html -# =========================================================================== -# -# SYNOPSIS -# -# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro figures out how to build C programs using POSIX threads. It -# sets the PTHREAD_LIBS output variable to the threads library and linker -# flags, and the PTHREAD_CFLAGS output variable to any special C compiler -# flags that are needed. (The user can also force certain compiler -# flags/libs to be tested by setting these environment variables.) -# -# Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). (This -# is necessary on AIX to use the special cc_r compiler alias.) -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also link it with them as well. e.g. you should link with -# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# -# If you are only building threads programs, you may wish to use these -# variables in your default LIBS, CFLAGS, and CC: -# -# LIBS="$PTHREAD_LIBS $LIBS" -# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -# CC="$PTHREAD_CC" -# -# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name -# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -# -# ACTION-IF-FOUND is a list of shell commands to run if a threads library -# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it -# is not found. If ACTION-IF-FOUND is not specified, the default action -# will define HAVE_PTHREAD. -# -# Please let the authors know if this macro fails on any platform, or if -# you have any other suggestions or comments. This macro was based on work -# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help -# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by -# Alejandro Forero Cuervo to the autoconf macro repository. We are also -# grateful for the helpful feedback of numerous users. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson <st...@al...> -# -# This program 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. -# -# This program 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 this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -AC_DEFUN([ACX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_LANG_SAVE -AC_LANG_C -acx_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) - AC_MSG_RESULT($acx_pthread_ok) - if test x"$acx_pthread_ok" = xno; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. - -acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# ... -mt is also the pthreads flag for HP/aCC -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case "${host_cpu}-${host_os}" in - *solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: - - acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" - ;; -esac - -if test x"$acx_pthread_ok" = xno; then -for flag in $acx_pthread_flags; do - - case $flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $flag]) - PTHREAD_CFLAGS="$flag" - ;; - - pthread-config) - AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) - if test x"$acx_pthread_config" = xno; then continue; fi - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$flag]) - PTHREAD_LIBS="-l$flag" - ;; - esac - - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - AC_TRY_LINK([#include <pthread.h>], - [pthread_t th; pthread_join(th, 0); - pthread_attr_init(0); pthread_cleanup_push(0, 0); - pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], - [acx_pthread_ok=yes]) - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - AC_MSG_RESULT($acx_pthread_ok) - if test "x$acx_pthread_ok" = xyes; then - break; - fi - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - -# Various other checks: -if test "x$acx_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_MSG_CHECKING([for joinable pthread attribute]) - attr_name=unknown - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;], - [attr_name=$attr; break]) - done - AC_MSG_RESULT($attr_name) - if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then - AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - fi - - AC_MSG_CHECKING([if more special flags are required for pthreads]) - flag=no - case "${host_cpu}-${host_os}" in - *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; - *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; - esac - AC_MSG_RESULT(${flag}) - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - # More AIX lossage: must compile with xlc_r or cc_r - if test x"$GCC" != xyes; then - AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) - else - PTHREAD_CC=$CC - fi -else - PTHREAD_CC="$CC" -fi - -AC_SUBST(PTHREAD_LIBS) -AC_SUBST(PTHREAD_CFLAGS) -AC_SUBST(PTHREAD_CC) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_pthread_ok" = xyes; then - ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) - : -else - acx_pthread_ok=no - $2 -fi -AC_LANG_RESTORE -])dnl ACX_PTHREAD Deleted: trunk/PackageRate/m4/iconv.m4 =================================================================== --- trunk/PackageRate/m4/iconv.m4 2011-04-30 21:06:16 UTC (rev 4122) +++ trunk/PackageRate/m4/iconv.m4 2011-04-30 21:12:35 UTC (rev 4123) @@ -1,214 +0,0 @@ -# iconv.m4 serial 11 (gettext-0.18.1) -dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], -[ - dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - - dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV - dnl accordingly. - AC_LIB_LINKFLAGS_BODY([iconv]) -]) - -AC_DEFUN([AM_ICONV_LINK], -[ - dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and - dnl those with the standalone portable GNU libiconv installed). - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles - - dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV - dnl accordingly. - AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) - - dnl Add $INCICONV to CPPFLAGS before performing the following checks, - dnl because if the user has installed libiconv and not disabled its use - dnl via --without-libiconv-prefix, he wants to use it. The first - dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. - am_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) - - AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - AC_TRY_LINK([#include <stdlib.h> -#include <iconv.h>], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - [am_cv_func_iconv=yes]) - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include <stdlib.h> -#include <iconv.h>], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - [am_cv_lib_iconv=yes] - [am_cv_func_iconv=yes]) - LIBS="$am_save_LIBS" - fi - ]) - if test "$am_cv_func_iconv" = yes; then - AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ - dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. - am_save_LIBS="$LIBS" - if test $am_cv_lib_iconv = yes; then - LIBS="$LIBS $LIBICONV" - fi - AC_TRY_RUN([ -#include <iconv.h> -#include <string.h> -int main () -{ - /* Test against AIX 5.1 bug: Failures are not distinguishable from successful - returns. */ - { - iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); - if (cd_utf8_to_88591 != (iconv_t)(-1)) - { - static const char input[] = "\342\202\254"; /* EURO SIGN */ - char buf[10]; - const char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_utf8_to_88591, - (char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - if (res == 0) - return 1; - } - } - /* Test against Solaris 10 bug: Failures are not distinguishable from - successful returns. */ - { - iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); - if (cd_ascii_to_88591 != (iconv_t)(-1)) - { - static const char input[] = "\263"; - char buf[10]; - const char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_ascii_to_88591, - (char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - if (res == 0) - return 1; - } - } -#if 0 /* This bug could be worked around by the caller. */ - /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ - { - iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); - if (cd_88591_to_utf8 != (iconv_t)(-1)) - { - static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; - char buf[50]; - const char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - if ((int)res > 0) - return 1; - } - } -#endif - /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is - provided. */ - if (/* Try standardized names. */ - iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) - /* Try IRIX, OSF/1 names. */ - && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) - /* Try AIX names. */ - && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) - /* Try HP-UX names. */ - && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - return 1; - return 0; -}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], - [case "$host_os" in - aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; - *) am_cv_func_iconv_works="guessing yes" ;; - esac]) - LIBS="$am_save_LIBS" - ]) - case "$am_cv_func_iconv_works" in - *no) am_func_iconv=no am_cv_lib_iconv=no ;; - *) am_func_iconv=yes ;; - esac - else - am_func_iconv=no am_cv_lib_iconv=no - fi - if test "$am_func_iconv" = yes; then - AC_DEFINE([HAVE_ICONV], [1], - [Define if you have the iconv() function and it works.]) - fi - if test "$am_cv_lib_iconv" = yes; then - AC_MSG_CHECKING([how to link with libiconv]) - AC_MSG_RESULT([$LIBICONV]) - else - dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV - dnl either. - CPPFLAGS="$am_save_CPPFLAGS" - LIBICONV= - LTLIBICONV= - fi - AC_SUBST([LIBICONV]) - AC_SUBST([LTLIBICONV]) -]) - -dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to -dnl avoid warnings like -dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". -dnl This is tricky because of the way 'aclocal' is implemented: -dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. -dnl Otherwise aclocal's initial scan pass would miss the macro definition. -dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. -dnl Otherwise aclocal would emit many "Use of uninitialized value $1" -dnl warnings. -m4_define([gl_iconv_AC_DEFUN], - m4_version_prereq([2.64], - [[AC_DEFUN_ONCE( - [$1], [$2])]], - [[AC_DEFUN( - [$1], [$2])]])) -gl_iconv_AC_DEFUN([AM_ICONV], -[ - AM_ICONV_LINK - if test "$am_cv_func_iconv" = yes; then - AC_MSG_CHECKING([for iconv declaration]) - AC_CACHE_VAL([am_cv_proto_iconv], [ - AC_TRY_COMPILE([ -#include <stdlib.h> -#include <iconv.h> -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); -#endif -], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) - am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) - am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - AC_MSG_RESULT([ - $am_cv_proto_iconv]) - AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], - [Define as const if the declaration of iconv() needs const.]) - fi -]) Deleted: trunk/PackageRate/m4/lib-ld.m4 =================================================================== --- trunk/PackageRate/m4/lib-ld.m4 2011-04-30 21:06:16 UTC (rev 4122) +++ trunk/PackageRate/m4/lib-ld.m4 2011-04-30 21:12:35 UTC (rev 4123) @@ -1,110 +0,0 @@ -# lib-ld.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. - -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. -AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - acl_cv_prog_gnu_ld=yes ;; -*) - acl_cv_prog_gnu_ld=no ;; -esac]) -with_gnu_ld=$acl_cv_prog_gnu_ld -]) - -dnl From libtool-1.4. Sets the variable LD. -AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH([gnu-ld], -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL([acl_cv_path_LD], -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; - esac - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$acl_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT([$LD]) -else - AC_MSG_RESULT([no]) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_LIB_PROG_LD_GNU -]) Deleted: trunk/PackageRate/m4/lib-link.m4 =================================================================== --- trunk/PackageRate/m4/lib-link.m4 2011-04-30 21:06:16 UTC (rev 4122) +++ trunk/PackageRate/m4/lib-link.m4 2011-04-30 21:12:35 UTC (rev 4123) @@ -1,774 +0,0 @@ -# lib-link.m4 serial 21 (gettext-0.18) -dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_PREREQ([2.54]) - -dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and -dnl augments the CPPFLAGS variable. -dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname -dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. -AC_DEFUN([AC_LIB_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - pushdef([Name],[translit([$1],[./-], [___])]) - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - ac_cv_lib[]Name[]_libs="$LIB[]NAME" - ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" - ac_cv_lib[]Name[]_cppflags="$INC[]NAME" - ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" - ]) - LIB[]NAME="$ac_cv_lib[]Name[]_libs" - LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" - INC[]NAME="$ac_cv_lib[]Name[]_cppflags" - LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - AC_SUBST([LIB]NAME[_PREFIX]) - dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the - dnl results of this search when this library appears as a dependency. - HAVE_LIB[]NAME=yes - popdef([NAME]) - popdef([Name]) -]) - -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) -dnl searches for libname and the libraries corresponding to explicit and -dnl implicit dependencies, together with the specified include files and -dnl the ability to compile and link the specified testcode. The missing-message -dnl defaults to 'no' and may contain additional hints for the user. -dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} -dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and -dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs -dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. -dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname -dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. -AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - pushdef([Name],[translit([$1],[./-], [___])]) - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - - dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME - dnl accordingly. - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - - dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, - dnl because if the user has installed lib[]Name and not disabled its use - dnl via --without-lib[]Name-prefix, he wants to use it. - ac_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - - AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ - ac_save_LIBS="$LIBS" - dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, - dnl because these -l options might require -L options that are present in - dnl LIBS. -l options benefit only from the -L options listed before it. - dnl Otherwise, add it to the front of LIBS, because it may be a static - dnl library that depends on another static library that is present in LIBS. - dnl Static libraries benefit only from the static libraries listed after - dnl it. - case " $LIB[]NAME" in - *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; - *) LIBS="$LIB[]NAME $LIBS" ;; - esac - AC_TRY_LINK([$3], [$4], - [ac_cv_lib[]Name=yes], - [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) - LIBS="$ac_save_LIBS" - ]) - if test "$ac_cv_lib[]Name" = yes; then - HAVE_LIB[]NAME=yes - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) - AC_MSG_CHECKING([how to link with lib[]$1]) - AC_MSG_RESULT([$LIB[]NAME]) - else - HAVE_LIB[]NAME=no - dnl If $LIB[]NAME didn't lead to a usable library, we don't need - dnl $INC[]NAME either. - CPPFLAGS="$ac_save_CPPFLAGS" - LIB[]NAME= - LTLIB[]NAME= - LIB[]NAME[]_PREFIX= - fi - AC_SUBST([HAVE_LIB]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - AC_SUBST([LIB]NAME[_PREFIX]) - popdef([NAME]) - popdef([Name]) -]) - -dnl Determine the platform dependent parameters needed to use rpath: -dnl acl_libext, -dnl acl_shlibext, -dnl acl_hardcode_libdir_flag_spec, -dnl acl_hardcode_libdir_separator, -dnl acl_hardcode_direct, -dnl acl_hardcode_minus_L. -AC_DEFUN([AC_LIB_RPATH], -[ - dnl Tell automake >= 1.10 to complain if config.rpath is missing. - m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) - AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS - AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld - AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host - AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir - AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - ]) - wl="$acl_cv_wl" - acl_libext="$acl_cv_libext" - acl_shlibext="$acl_cv_shlibext" - acl_libname_spec="$acl_cv_libname_spec" - acl_library_names_spec="$acl_cv_library_names_spec" - acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - acl_hardcode_direct="$acl_cv_hardcode_direct" - acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" - dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE([rpath], - [ --disable-rpath do not hardcode runtime library paths], - :, enable_rpath=yes) -]) - -dnl AC_LIB_FROMPACKAGE(name, package) -dnl declares that libname comes from the given package. The configure file -dnl will then not have a --with-libname-prefix option but a -dnl --with-package-prefix option. Several libraries can come from the same -dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar -dnl macro call that searches for libname. -AC_DEFUN([AC_LIB_FROMPACKAGE], -[ - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - define([acl_frompackage_]NAME, [$2]) - popdef([NAME]) - pushdef([PACK],[$2]) - pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - define([acl_libsinpackage_]PACKUP, - m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1]) - popdef([PACKUP]) - popdef([PACK]) -]) - -dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. -dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found -dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. -AC_DEFUN([AC_LIB_LINKFLAGS_BODY], -[ - AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) - pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) - dnl Autoconf >= 2.61 supports dots in --with options. - pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_ARG_WITH(P_A_C_K[-prefix], -[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib - --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi - fi - fi -]) - dnl Search the library and its dependencies in $additional_libdir and - dnl $LDFLAGS. Using breadth-first-seach. - LIB[]NAME= - LTLIB[]NAME= - INC[]NAME= - LIB[]NAME[]_PREFIX= - dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been - dnl computed. So it has to be reset here. - HAVE_LIB[]NAME= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='$1 $2' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - dnl See if it was already located by an earlier AC_LIB_LINKFLAGS - dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" - else - dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined - dnl that this library doesn't exist. So just drop it. - : - fi - else - dnl Search the library lib$name in $additional_libdir and $LDFLAGS - dnl and the already constructed $LIBNAME/$LTLIBNAME. - found_dir= - found_la= - found_so= - found_a= - eval libname=\"$acl_libname_spec\" # typically: libname=lib$name - if test -n "$acl_shlibext"; then - shrext=".$acl_shlibext" # typically: shrext=.so - else - shrext= - fi - if test $use_additional = yes; then - dir="$additional_libdir" - dnl The same code as in the loop below: - dnl First look for a shared library. - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - dnl Then look for a static library. - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - dnl First look for a shared library. - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - dnl Then look for a static library. - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - dnl Found the library. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - dnl Linking with a shared library. We attempt to hardcode its - dnl directory into the executable's runpath, unless it's the - dnl standard /usr/lib. - if test "$enable_rpath" = no \ - || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then - dnl No hardcoding is needed. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - dnl The hardcoding into $LIBNAME is system dependent. - if test "$acl_hardcode_direct" = yes; then - dnl Using DIR/libNAME.so during linking hardcodes DIR into the - dnl resulting binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - dnl Rely on "-L$found_dir". - dnl But don't add it if it's already contained in the LDFLAGS - dnl or the already constructed $LIBNAME - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH - dnl here, because this doesn't fit in flags passed to the - dnl compiler. So give up. No hardcoding. This affects only - dnl very old systems. - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - dnl Linking with a static library. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" - else - dnl We shouldn't come here, but anyway it's good to have a - dnl fallback. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" - fi - fi - dnl Assume the include files are nearby. - additional_includedir= - case "$found_dir" in - */$acl_libdirstem | */$acl_libdirstem/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - if test "$name" = '$1'; then - LIB[]NAME[]_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - */$acl_libdirstem2 | */$acl_libdirstem2/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - if test "$name" = '$1'; then - LIB[]NAME[]_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - dnl Potentially add $additional_includedir to $INCNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's /usr/local/include and we are using GCC on Linux, - dnl 3. if it's already present in $CPPFLAGS or the already - dnl constructed $INCNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INC[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $INCNAME. - INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - dnl Look for dependencies. - if test -n "$found_la"; then - dnl Read the .la file. It defines the variables - dnl dlname, library_names, old_library, dependency_libs, current, - dnl age, revision, installed, dlopen, dlpreopen, libdir. - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - dnl We use only dependency_libs. - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's /usr/local/lib and we are using GCC on Linux, - dnl 3. if it's already present in $LDFLAGS or the already - dnl constructed $LIBNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LIBNAME. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LTLIBNAME. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - dnl Handle this in the next round. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - dnl Handle this in the next round. Throw away the .la's - dnl directory; it is already contained in a preceding -L - dnl option. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - dnl Most likely an immediate library name. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" - ;; - esac - done - fi - else - dnl Didn't find the library; assume it is in the system directories - dnl known to the linker and runtime loader. (All the system - dnl directories known to the linker should also be known to the - dnl runtime loader, otherwise the system is severely misconfigured.) - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then - dnl Weird platform: only the last -rpath option counts, the user must - dnl pass all path elements in one option. We can arrange that for a - dnl single library, but not when more than one $LIBNAMEs are used. - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" - done - dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - else - dnl The -rpath options are cumulative. - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - dnl When using libtool, the option that works for both libraries and - dnl executables is -R. The -R options are cumulative. - for found_dir in $ltrpathdirs; do - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" - done - fi - popdef([P_A_C_K]) - popdef([PACKLIBS]) - popdef([PACKUP]) - popdef([PACK]) - popdef([NAME]) -]) - -dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, -dnl unless already present in VAR. -dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes -dnl contains two or three consecutive elements that belong together. -AC_DEFUN([AC_LIB_APPENDTOVAR], -[ - for element in [$2]; do - haveit= - for x in $[$1]; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - [$1]="${[$1]}${[$1]:+ }$element" - fi - done -]) - -dnl For those cases where a variable contains several -L and -l options -dnl referring to unknown libraries and directories, this macro determines the -dnl necessary additional linker options for the runtime path. -dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) -dnl sets LDADDVAR to linker options needed together with LIBSVALUE. -dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, -dnl otherwise linking without libtool is assumed. -AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], -[ - AC_REQUIRE([AC_LIB_RPATH]) - AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) - $1= - if test "$enable_rpath" != no; then - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - dnl Use an explicit option to hardcode directories into the resulting - dnl binary. - rpathdirs= - next= - for opt in $2; do - if test -n "$next"; then - dir="$next" - dnl No need to hardcode the standard /usr/lib. - if test "X$dir" != "X/usr/$acl_libdirstem" \ - && test "X$dir" != "X/usr/$acl_libdirstem2"; then - rpathdirs="$rpathdirs $dir" - fi - next= - else - case $opt in - -L) next=yes ;; - -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` - dnl No need to hardcode the standard /usr/lib. - if test "X$dir" != "X/usr/$acl_libdirstem" \ - && test "X$dir" != "X/usr/$acl_libdirstem2"; then - rpathdirs="$rpathdirs $dir" - fi - next= ;; - *) next= ;; - esac - fi - done - if test "X$rpathdirs" != "X"; then - if test -n ""$3""; then - dnl libtool is used for linking. Use -R options. - for dir in $rpathdirs; do - $1="${$1}${$1:+ }-R$dir" - done - else - dnl The linker is used for linking directly. - if test -n "$acl_hardcode_libdir_separator"; then - dnl Weird platform: only the last -rpath option counts, the user - dnl must pass all path elements in one option. - alldirs= - for dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - $1="$flag" - else - dnl The -rpath options are cumulative. - for dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - $1="${$1}${$1:+ }$flag" - done - fi - fi - fi - fi - fi - AC_SUBST([$1]) -]) Deleted: trunk/PackageRate/m4/lib-prefix.m4 =================================================================== --- trunk/PackageRate/m4/lib-prefix.m4 2011-04-30 21:06:16 UTC (rev 4122) +++ trunk/PackageRate/m4/lib-prefix.m4 2011-04-30 21:12:35 UTC (rev 4123) @@ -1,224 +0,0 @@ -# lib-prefix.m4 serial 7 (gettext-0.18) -dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and -dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't -dnl require excessive bracketing. -ifdef([AC_HELP_STRING], -[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], -[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) - -dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed -dnl to access previously installed libraries. The basic assumption is that -dnl a user will want packages to use other packages he previously installed -dnl with the same --prefix option. -dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate -dnl libraries, but is otherwise very convenient. -AC_DEFUN([AC_LIB_PREFIX], -[ - AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib-prefix], -[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib - --without-lib-prefix don't search for libraries in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - fi - fi -]) - if test $use_additional = yes; then - dnl Potentially add $additional_includedir to $CPPFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's already present in $CPPFLAGS, - dnl 3. if it's /usr/local/include and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additi... [truncated message content] |
From: <tte...@us...> - 2011-04-30 21:06:24
|
Revision: 4122 http://illumination.svn.sourceforge.net/illumination/?rev=4122&view=rev Author: tteuling Date: 2011-04-30 21:06:16 +0000 (Sat, 30 Apr 2011) Log Message: ----------- Fixed g++ 4.6 errors and warnings. Modified Paths: -------------- trunk/Illumination/include/Lum/Model/Table.h trunk/Illumination/src/Lum/Edit/Edit.cpp trunk/Illumination/src/Lum/Menu.cpp trunk/Illumination/src/Lum/OS/Base/Theme.cpp trunk/Illumination/src/Lum/OS/Gtk/GtkTheme.cpp trunk/Illumination/src/Lum/OS/X11/Window.cpp trunk/Illumination/src/Lum/TimeLine.cpp Modified: trunk/Illumination/include/Lum/Model/Table.h =================================================================== --- trunk/Illumination/include/Lum/Model/Table.h 2011-04-23 13:44:58 UTC (rev 4121) +++ trunk/Illumination/include/Lum/Model/Table.h 2011-04-30 21:06:16 UTC (rev 4122) @@ -421,7 +421,7 @@ { private: - mutable typename StdTableBase<Element, Container>::ContainerType& container; + typename StdTableBase<Element, Container>::ContainerType& container; public: StdRefTable(typename StdTableBase<Element, Container>::ContainerType& container, Modified: trunk/Illumination/src/Lum/Edit/Edit.cpp =================================================================== --- trunk/Illumination/src/Lum/Edit/Edit.cpp 2011-04-23 13:44:58 UTC (rev 4121) +++ trunk/Illumination/src/Lum/Edit/Edit.cpp 2011-04-30 21:06:16 UTC (rev 4122) @@ -1495,8 +1495,6 @@ */ void Edit::ClearSelection() { - size_t a; - if (IsSelected()) { ClearSelectionInternal(); if (!stableSelection) { @@ -1504,10 +1502,8 @@ } } else if (IsMarkSet()) { - a=markA->GetY(); model->FreeCursor(markA); markA=NULL; - //model->NotifyRedraw(a,a); } } Modified: trunk/Illumination/src/Lum/Menu.cpp =================================================================== --- trunk/Illumination/src/Lum/Menu.cpp 2011-04-23 13:44:58 UTC (rev 4121) +++ trunk/Illumination/src/Lum/Menu.cpp 2011-04-30 21:06:16 UTC (rev 4122) @@ -1425,7 +1425,7 @@ std::list<Object*>::iterator iter; int yPos; int x1,x2,x3,x4; - size_t w1=0,w2=0,w3=0,w4=0; + size_t w1=0,w2=0,w3=0; if (list.size()>0) { MenuEntry* entry=dynamic_cast<MenuEntry*>(*list.begin()); @@ -1433,7 +1433,6 @@ w1=entry->w1; w2=entry->w2; w3=entry->w3; - w4=entry->w4; } // Image Modified: trunk/Illumination/src/Lum/OS/Base/Theme.cpp =================================================================== --- trunk/Illumination/src/Lum/OS/Base/Theme.cpp 2011-04-23 13:44:58 UTC (rev 4121) +++ trunk/Illumination/src/Lum/OS/Base/Theme.cpp 2011-04-30 21:06:16 UTC (rev 4122) @@ -121,7 +121,7 @@ int xOff, int yOff, size_t width, size_t height, int x, int y, size_t w, size_t h) { - Color shine,shadow,halfShadow,halfShine; + Color shine,shadow,halfShadow; int type; x=xOff; @@ -136,7 +136,6 @@ shine=dynamic_cast<DefaultTheme*>(display->GetTheme())->shineColor; shadow=dynamic_cast<DefaultTheme*>(display->GetTheme())->shadowColor; halfShadow=dynamic_cast<DefaultTheme*>(display->GetTheme())->halfShadowColor; - halfShine=dynamic_cast<DefaultTheme*>(display->GetTheme())->halfShineColor; type=this->type; @@ -1508,13 +1507,12 @@ void InternalFrame::Draw(OS::DrawInfo* draw, int x, int y, size_t w, size_t h) { - Color shine,shadow,halfShadow,halfShine; + Color shine,shadow,halfShadow; int top,type; shine=dynamic_cast<DefaultTheme*>(display->GetTheme())->shineColor; shadow=dynamic_cast<DefaultTheme*>(display->GetTheme())->shadowColor; halfShadow=dynamic_cast<DefaultTheme*>(display->GetTheme())->halfShadowColor; - halfShine=dynamic_cast<DefaultTheme*>(display->GetTheme())->halfShineColor; type=this->type; Modified: trunk/Illumination/src/Lum/OS/Gtk/GtkTheme.cpp =================================================================== --- trunk/Illumination/src/Lum/OS/Gtk/GtkTheme.cpp 2011-04-23 13:44:58 UTC (rev 4121) +++ trunk/Illumination/src/Lum/OS/Gtk/GtkTheme.cpp 2011-04-30 21:06:16 UTC (rev 4122) @@ -1287,7 +1287,6 @@ { GdkDrawable *gtkDraw; GdkGC *gdkGC; - GdkRectangle rectangle; GdkPixbuf *gdkPixbuf; bool scaled=false; @@ -1306,11 +1305,6 @@ gdkPixbuf=gdkPixbufNormal; } - rectangle.x=0; - rectangle.y=0; - rectangle.width=w; - rectangle.height=h; - if (w!=GetWidth() || height!=GetHeight()) { scaled=true; @@ -1380,7 +1374,6 @@ { GdkDrawable *gtkDraw; GdkGC *gdkGC; - GdkRectangle rectangle; GdkPixbuf *gdkPixbuf; assert(w!=0); @@ -1399,11 +1392,6 @@ gdkPixbuf=gdkPixbufNormal; } - rectangle.x=0; - rectangle.y=0; - rectangle.width=w; - rectangle.height=h; - gtkDraw=gdk_pixmap_new(NULL, w,h, OS::display->GetColorDepth()); Modified: trunk/Illumination/src/Lum/OS/X11/Window.cpp =================================================================== --- trunk/Illumination/src/Lum/OS/X11/Window.cpp 2011-04-23 13:44:58 UTC (rev 4121) +++ trunk/Illumination/src/Lum/OS/X11/Window.cpp 2011-04-30 21:06:16 UTC (rev 4122) @@ -1479,7 +1479,8 @@ false, display->atoms[Display::atomAtom], &atomType,&atomFormat,&atomItems,&atomBytes,&data); - if (atomType==display->atoms[Display::atomAtom]) { + if (res==Success && + atomType==display->atoms[Display::atomAtom]) { Atom *value=(Atom*)data; for (size_t i=0; i<atomItems; i++) { Modified: trunk/Illumination/src/Lum/TimeLine.cpp =================================================================== --- trunk/Illumination/src/Lum/TimeLine.cpp 2011-04-23 13:44:58 UTC (rev 4121) +++ trunk/Illumination/src/Lum/TimeLine.cpp 2011-04-30 21:06:16 UTC (rev 4122) @@ -269,8 +269,6 @@ void TimeLine::Resync(Base::Model* model, const Base::ResyncMsg& /*msg*/) { - bool scroll=false; - if (state==this->model->IsNull()) { state=!this->model->IsNull(); @@ -289,7 +287,6 @@ if (nextPos>=points[0].size()) { size_t size=points[0].size(); for (size_t y=0; y<points.size(); y++) { - scroll=true; points[y].erase(points[y].begin()); points[y].resize(size); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-04-23 13:45:05
|
Revision: 4121 http://illumination.svn.sourceforge.net/illumination/?rev=4121&view=rev Author: tteuling Date: 2011-04-23 13:44:58 +0000 (Sat, 23 Apr 2011) Log Message: ----------- Make use of GSettings for reading Gtk/Gnome default font names and sizes. Modified Paths: -------------- trunk/Illumination/src/Lum/OS/Gtk/GtkTheme.cpp Modified: trunk/Illumination/src/Lum/OS/Gtk/GtkTheme.cpp =================================================================== --- trunk/Illumination/src/Lum/OS/Gtk/GtkTheme.cpp 2011-03-01 14:31:14 UTC (rev 4120) +++ trunk/Illumination/src/Lum/OS/Gtk/GtkTheme.cpp 2011-04-23 13:44:58 UTC (rev 4121) @@ -44,6 +44,10 @@ #include <Lum/OS/Display.h> +#if GLIB_CHECK_VERSION(2,26,0) + #include <gio/gio.h> +#endif + #if defined(HAVE_LIB_GCONF) #include <gconf/gconf-client.h> #endif @@ -3433,7 +3437,85 @@ return false; } -#if defined(HAVE_LIB_GCONF) +#if GLIB_CHECK_VERSION(2,26,0) + static std::wstring ExtractFontNameFromGSettings(const char* key) + { + GSettings *settings; + gchar *tmp; + + settings=g_settings_new("org.gnome.desktop.interface"); + tmp=g_settings_get_string(settings,key); + + if (tmp==NULL) { + g_object_unref(settings); + return L""; + } + + std::wstring name(Lum::Base::StringToWString(tmp)); + + if (name.empty()) { + g_free(tmp); + g_object_unref(settings); + return L""; + } + + g_free(tmp); + g_object_unref(settings); + + size_t x=name.length()-1; + + while (x>0 && name[x]>=L'0' && name[x]<=L'9') { + x--; + } + while (x>0 && name[x]==L' ') { + x--; + } + + return name.substr(0,x+1); + } + + static double ExtractFontSizeFromGSettings(const char* key) + { + GSettings *settings; + gchar *tmp; + + settings=g_settings_new("org.gnome.desktop.interface"); + tmp=g_settings_get_string(settings,key); + + if (tmp==NULL) { + g_object_unref(settings); + return 0; + } + + std::wstring size(Lum::Base::StringToWString(tmp)); + + if (size.empty()) { + g_free(tmp); + g_object_unref(settings); + return 0; + } + + g_free(tmp); + g_object_unref(settings); + + size_t x=size.length()-1; + size_t value; + + while (x>0 && size[x]>=L'0' && size[x]<=L'9') { + x--; + } + + assert(x<size.length()); + + size=size.substr(x+1); + + if (Lum::Base::WStringToNumber(size,value)) { + return value; + } + + assert(false); + } +#elif defined(HAVE_LIB_GCONF) static std::wstring ExtractFontNameFromGConf(const char* path) { GConfClient *client; @@ -3470,7 +3552,7 @@ return name.substr(0,x+1); } - static size_t ExtractFontSizeFromGConf(const char* path) + static double ExtractFontSizeFromGConf(const char* path) { GConfClient *client; gchar *tmp; @@ -3488,7 +3570,7 @@ if (size.empty()) { g_free(tmp); g_object_unref(client); - return 0; + return 0.0; } g_free(tmp); @@ -3518,32 +3600,68 @@ std::wstring result; #if defined(LUM_HAVE_LIB_HILDON) - return Lum::Base::StringToWString(pango_font_description_get_family(gtkWidgets->GetStyle(GtkWidgets::styleWindow)->font_desc)); + result=Lum::Base::StringToWString(pango_font_description_get_family(gtkWidgets->GetStyle(GtkWidgets::styleWindow)->font_desc)); + + if (!result.empty()) { + return result; + } +#elif GLIB_CHECK_VERSION(2,26,0) + result=ExtractFontNameFromGSettings("font-name"); + + if (!result.empty()) { + return result; + } #elif defined(HAVE_LIB_GCONF) result=ExtractFontNameFromGConf("/desktop/gnome/interface/font_name"); -#endif - if (result.empty()) { - result=L"Helvetica"; + if (!result.empty()) { + return result; } +#endif + result=L"Helvetica"; + return result; } double GtkTheme::GetProportionalFontSize() const { - size_t result=0; + double result=0; #if defined(LUM_HAVE_LIB_HILDON) result=pango_font_description_get_size(gtkWidgets->GetStyle(GtkWidgets::styleWindow)->font_desc)/PANGO_SCALE; + + if (result>=0) { + double resolution=gdk_screen_get_resolution(gdk_screen_get_default()); + + if (resolution<=0) { + resolution=96; + } + + return result*(resolution/72); + } +#elif GLIB_CHECK_VERSION(2,26,0) + result=ExtractFontSizeFromGSettings("font-name"); + + if (result>=0) { + return result; + } #elif defined(HAVE_LIB_GCONF) result=ExtractFontSizeFromGConf("/desktop/gnome/interface/font_name"); -#endif - if (result==0) { - result=9; + if (result>=0) { + double resolution=gdk_screen_get_resolution(gdk_screen_get_default()); + + if (resolution<=0) { + resolution=96; + } + + return result*(resolution/72); } +#endif + result=9; + double resolution=gdk_screen_get_resolution(gdk_screen_get_default()); if (resolution<=0) { @@ -3557,29 +3675,51 @@ { std::wstring result; -#if defined(HAVE_LIB_GCONF) +#if GLIB_CHECK_VERSION(2,26,0) + result=ExtractFontNameFromGSettings("monospace-font-name"); + + if (!result.empty()) { + return result; + } + +#elif defined(HAVE_LIB_GCONF) result=ExtractFontNameFromGConf("/desktop/gnome/interface/monospace_font_name"); -#endif - if (result.empty()) { - result=L"Fixed"; + if (!result.empty()) { + return result; } +#endif + result=L"Fixed"; + return result; } double GtkTheme::GetFixedFontSize() const { - size_t result=0; + double result=0; -#if defined(HAVE_LIB_GCONF) +#if GLIB_CHECK_VERSION(2,26,0) + result=ExtractFontSizeFromGSettings("monospace-font-name"); + + if (result>=0) { + return result; + } +#elif defined(HAVE_LIB_GCONF) result=ExtractFontSizeFromGConf("/desktop/gnome/interface/monospace_font_name"); -#endif + if (result>=0) { + double resolution=gdk_screen_get_resolution(gdk_screen_get_default()); - if (result==0) { - result=9; + if (resolution<=0) { + resolution=96; + } + + return result*(resolution/72); } +#endif + result=9; + double resolution=gdk_screen_get_resolution(gdk_screen_get_default()); if (resolution<=0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-03-01 14:31:20
|
Revision: 4120 http://illumination.svn.sourceforge.net/illumination/?rev=4120&view=rev Author: tteuling Date: 2011-03-01 14:31:14 +0000 (Tue, 01 Mar 2011) Log Message: ----------- Updated Properties example to current illumination code. Modified Paths: -------------- trunk/Demos/src/PropertiesDialog.cpp Modified: trunk/Demos/src/PropertiesDialog.cpp =================================================================== --- trunk/Demos/src/PropertiesDialog.cpp 2011-03-01 14:30:40 UTC (rev 4119) +++ trunk/Demos/src/PropertiesDialog.cpp 2011-03-01 14:31:14 UTC (rev 4120) @@ -47,9 +47,9 @@ props->Boolean(Lum::Def::Boolean(Lum::Def::Desc(L"Boolean"),boolean)); props->Number(Lum::Def::Number(Lum::Def::Desc(L"Int"), numberRange)); props->Number(Lum::Def::Number(Lum::Def::Desc(L"size_t"), number)); - props->Interval(Lum::Def::Desc(L"Int interval"), - Lum::Def::Number(Lum::Def::Desc(L"start"),intervalStart), - Lum::Def::Number(Lum::Def::Desc(L"end"),intervalEnd)); + props->Interval(Lum::Def::Interval(Lum::Def::Desc(L"Int interval"), + intervalStart, + intervalEnd)); props=props->End(); props=props->Group(L"Group 2"); props->OneOfN(Lum::Def::OneOfN(Lum::Def::Desc(L"OneOfN"), oneOfN) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-03-01 14:30:47
|
Revision: 4119 http://illumination.svn.sourceforge.net/illumination/?rev=4119&view=rev Author: tteuling Date: 2011-03-01 14:30:40 +0000 (Tue, 01 Mar 2011) Log Message: ----------- Props code cleanup. Fixed compiler warning. Modified Paths: -------------- trunk/Illumination/include/Lum/Def/Props.h trunk/Illumination/src/Lum/Def/Props.cpp Modified: trunk/Illumination/include/Lum/Def/Props.h =================================================================== --- trunk/Illumination/include/Lum/Def/Props.h 2011-02-09 19:15:34 UTC (rev 4118) +++ trunk/Illumination/include/Lum/Def/Props.h 2011-03-01 14:30:40 UTC (rev 4119) @@ -61,8 +61,6 @@ PropGroup* Group(const std::wstring& name); PropGroup* End(); - //PropGroup* Append(PropGroup* group); - const std::list<Property*>& GetProps() const; const std::list<PropGroup*>& GetGroups() const; Modified: trunk/Illumination/src/Lum/Def/Props.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/Props.cpp 2011-02-09 19:15:34 UTC (rev 4118) +++ trunk/Illumination/src/Lum/Def/Props.cpp 2011-03-01 14:30:40 UTC (rev 4119) @@ -47,34 +47,17 @@ for (std::list<Property*>::const_iterator prop=other.props.begin(); prop!=other.props.end(); ++prop) { - if (dynamic_cast<Def::Boolean*>(*prop)!=NULL) { - props.push_back(new Def::Boolean(*dynamic_cast<Def::Boolean*>(*prop))); - } - else if (dynamic_cast<Def::Number*>(*prop)!=NULL) { - props.push_back(new Def::Number(*dynamic_cast<Def::Number*>(*prop))); - } - else if (dynamic_cast<Def::Interval*>(*prop)!=NULL) { - props.push_back(new Def::Interval(*dynamic_cast<Def::Interval*>(*prop))); - } - else if (dynamic_cast<Def::OneOfMany*>(*prop)!=NULL) { - props.push_back(new Def::OneOfMany(*dynamic_cast<Def::OneOfMany*>(*prop))); - } - else if (dynamic_cast<Def::OneOfN*>(*prop)!=NULL) { - props.push_back(new Def::OneOfN(*dynamic_cast<Def::OneOfN*>(*prop))); - } - else { - assert(false); - } + props.push_back((*prop)->Copy()); } for (std::list<PropGroup*>::const_iterator group=other.groups.begin(); group!=other.groups.end(); ++group) { - PropGroup *group=new PropGroup(*group); + PropGroup *g=new PropGroup(*(*group)); - group->parent=this; + g->parent=this; - groups.push_back(group); + groups.push_back(g); } } @@ -152,44 +135,6 @@ return parent; } - /* - PropGroup* PropGroup::Append(PropGroup* group) - { - assert(group!=NULL); - - for (std::list<PropItem*>::const_iterator prop=group->props.begin(); - prop!=group->props.end(); - ++prop) { - if (dynamic_cast<PropBoolean*>(*prop)!=NULL) { - props.push_back(new PropBoolean(*dynamic_cast<PropBoolean*>(*prop))); - } - else if (dynamic_cast<PropNumber*>(*prop)!=NULL) { - props.push_back(new PropNumber(*dynamic_cast<PropNumber*>(*prop))); - } - else if (dynamic_cast<PropInterval*>(*prop)!=NULL) { - props.push_back(new PropInterval(*dynamic_cast<PropInterval*>(*prop))); - } - else if (dynamic_cast<PropOneOfMany*>(*prop)!=NULL) { - props.push_back(new PropOneOfMany(*dynamic_cast<PropOneOfMany*>(*prop))); - } - else if (dynamic_cast<PropOneOfN*>(*prop)!=NULL) { - props.push_back(new PropOneOfN(*dynamic_cast<PropOneOfN*>(*prop))); - } - else if (dynamic_cast<PropGroup*>(*prop)!=NULL) { - PropGroup *group=new PropGroup(*dynamic_cast<PropGroup*>(*prop)); - - group->parent=this; - - props.push_back(group); - } - else { - assert(false); - } - } - - return this; - }*/ - const Desc& PropGroup::GetDesc() const { return description; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-02-09 19:15:41
|
Revision: 4118 http://illumination.svn.sourceforge.net/illumination/?rev=4118&view=rev Author: tteuling Date: 2011-02-09 19:15:34 +0000 (Wed, 09 Feb 2011) Log Message: ----------- Removed PropItem and derived classes, which made things more complex than necessary. Modified Paths: -------------- trunk/Illumination/include/Lum/Def/Boolean.h trunk/Illumination/include/Lum/Def/Number.h trunk/Illumination/include/Lum/Def/OneOfMany.h trunk/Illumination/include/Lum/Def/OneOfN.h trunk/Illumination/include/Lum/Def/Property.h trunk/Illumination/include/Lum/Def/Props.h trunk/Illumination/include/Lum/Dlg/Properties.h trunk/Illumination/include/Makefile.am trunk/Illumination/src/Lum/Def/Boolean.cpp trunk/Illumination/src/Lum/Def/Number.cpp trunk/Illumination/src/Lum/Def/OneOfMany.cpp trunk/Illumination/src/Lum/Def/OneOfN.cpp trunk/Illumination/src/Lum/Def/Property.cpp trunk/Illumination/src/Lum/Def/Props.cpp trunk/Illumination/src/Lum/Dlg/Properties.cpp trunk/Illumination/src/Makefile.am Added Paths: ----------- trunk/Illumination/include/Lum/Def/Interval.h trunk/Illumination/src/Lum/Def/Interval.cpp Modified: trunk/Illumination/include/Lum/Def/Boolean.h =================================================================== --- trunk/Illumination/include/Lum/Def/Boolean.h 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/include/Lum/Def/Boolean.h 2011-02-09 19:15:34 UTC (rev 4118) @@ -41,6 +41,8 @@ public: Boolean(const Desc& description, Model::Boolean *value); + Property* Copy() const; + Model::Boolean* GetBoolean() const; }; } Added: trunk/Illumination/include/Lum/Def/Interval.h =================================================================== --- trunk/Illumination/include/Lum/Def/Interval.h (rev 0) +++ trunk/Illumination/include/Lum/Def/Interval.h 2011-02-09 19:15:34 UTC (rev 4118) @@ -0,0 +1,54 @@ +#ifndef LUM_DEF_INTERVAL_H +#define LUM_DEF_INTERVAL_H + +/* + This source is part of the Illumination library + Copyright (C) 2011 Tim Teulings + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <Lum/Private/ImportExport.h> + +#include <Lum/Def/Property.h> + +#include <Lum/Model/Number.h> + +namespace Lum { + + namespace Def { + /** + */ + class LUMAPI Interval : public Property + { + private: + Model::NumberRef start; + Model::NumberRef end; + + public: + Interval(const Desc& description, + Model::Number* start, + Model::Number* end); + + Property* Copy() const; + + Model::Number* GetStart() const; + Model::Number* GetEnd() const; + }; + } +} + +#endif + Property changes on: trunk/Illumination/include/Lum/Def/Interval.h ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Modified: trunk/Illumination/include/Lum/Def/Number.h =================================================================== --- trunk/Illumination/include/Lum/Def/Number.h 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/include/Lum/Def/Number.h 2011-02-09 19:15:34 UTC (rev 4118) @@ -39,6 +39,8 @@ public: Number(const Desc& description, Model::Number* value); + Property* Copy() const; + Model::Number* GetValue() const; }; } Modified: trunk/Illumination/include/Lum/Def/OneOfMany.h =================================================================== --- trunk/Illumination/include/Lum/Def/OneOfMany.h 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/include/Lum/Def/OneOfMany.h 2011-02-09 19:15:34 UTC (rev 4118) @@ -56,6 +56,8 @@ Model::Table* choices, TableCellPainter* tablePainter=NULL); + Property* Copy() const; + OneOfMany& SetChoicesHeader(Model::Header* choicesHeader); Model::Number* GetValue() const; Modified: trunk/Illumination/include/Lum/Def/OneOfN.h =================================================================== --- trunk/Illumination/include/Lum/Def/OneOfN.h 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/include/Lum/Def/OneOfN.h 2011-02-09 19:15:34 UTC (rev 4118) @@ -55,6 +55,8 @@ public: OneOfN(const Desc& description, Model::Number* value); + Property* Copy() const; + OneOfN& AddChoice(const Choice& choice); Model::Number* GetValue() const; Modified: trunk/Illumination/include/Lum/Def/Property.h =================================================================== --- trunk/Illumination/include/Lum/Def/Property.h 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/include/Lum/Def/Property.h 2011-02-09 19:15:34 UTC (rev 4118) @@ -40,7 +40,11 @@ Property(const Desc& description); public: + virtual ~Property(); + const Desc& GetDesc() const; + + virtual Property* Copy() const = 0; }; } } Modified: trunk/Illumination/include/Lum/Def/Props.h =================================================================== --- trunk/Illumination/include/Lum/Def/Props.h 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/include/Lum/Def/Props.h 2011-02-09 19:15:34 UTC (rev 4118) @@ -24,6 +24,7 @@ #include <Lum/Def/Boolean.h> #include <Lum/Def/Desc.h> +#include <Lum/Def/Interval.h> #include <Lum/Def/Number.h> #include <Lum/Def/OneOfMany.h> #include <Lum/Def/OneOfN.h> @@ -31,101 +32,15 @@ namespace Lum { namespace Def { - class LUMAPI PropItem + class LUMAPI PropGroup { - protected: - PropItem(); - - public: - virtual ~PropItem(); - }; - - class LUMAPI PropBoolean : public PropItem - { private: - Boolean boolean; + PropGroup *parent; + Desc description; + std::list<PropGroup*> groups; + std::list<Property*> props; - public: - PropBoolean(const Boolean& boolean); - - const Boolean& GetValue() const; - }; - - class LUMAPI PropNumber : public PropItem - { private: - Number number; - - public: - PropNumber(const Number& number); - - const Number& GetValue() const; - }; - - class LUMAPI PropInterval : public PropItem - { - private: - Desc desc; - Number start; - Number end; - - public: - PropInterval(const Desc& desc, - const Number& start, - const Number& end) - : desc(desc), - start(start), - end(end) - { - // no code - } - - const Desc& GetDesc() const - { - return desc; - } - - const Number& GetStart() const - { - return start; - } - - const Number& GetEnd() const - { - return end; - } - }; - - class LUMAPI PropOneOfMany : public PropItem - { - private: - OneOfMany oneOfMany; - - public: - PropOneOfMany(const OneOfMany& oneOfMany); - - const OneOfMany& GetValue() const; - }; - - class LUMAPI PropOneOfN : public PropItem - { - private: - OneOfN oneOfN; - - public: - PropOneOfN(const OneOfN& oneOfN); - - const OneOfN& GetValue() const; - }; - - class LUMAPI PropGroup : public PropItem - { - private: - PropGroup *parent; - Desc description; - std::list<PropItem*> props; - - private: PropGroup(PropGroup* parent, const Desc& description); @@ -138,9 +53,7 @@ PropGroup* Boolean(const Def::Boolean& boolean); PropGroup* Number(const Def::Number& number); - PropGroup* Interval(const Desc& desc, - const Def::Number& start, - const Def::Number& end); + PropGroup* Interval(const Interval& interval); PropGroup* OneOfN(const Def::OneOfN& oneOfN); PropGroup* OneOfMany(const Def::OneOfMany& oneOfMany); @@ -148,9 +61,10 @@ PropGroup* Group(const std::wstring& name); PropGroup* End(); - PropGroup* Append(PropGroup* group); + //PropGroup* Append(PropGroup* group); - const std::list<PropItem*>& GetProps() const; + const std::list<Property*>& GetProps() const; + const std::list<PropGroup*>& GetGroups() const; const Desc& GetDesc() const; Modified: trunk/Illumination/include/Lum/Dlg/Properties.h =================================================================== --- trunk/Illumination/include/Lum/Dlg/Properties.h 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/include/Lum/Dlg/Properties.h 2011-02-09 19:15:34 UTC (rev 4118) @@ -57,7 +57,7 @@ protected: void AddControlForProperty(Label* label, - Def::PropItem* prop); + Def::Property* prop); public: Properties(Def::PropGroup *props); Modified: trunk/Illumination/include/Makefile.am =================================================================== --- trunk/Illumination/include/Makefile.am 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/include/Makefile.am 2011-02-09 19:15:34 UTC (rev 4118) @@ -18,6 +18,7 @@ Lum/Def/AppInfo.h \ Lum/Def/Boolean.h \ Lum/Def/Desc.h \ + Lum/Def/Interval.h \ Lum/Def/Menu.h \ Lum/Def/MultiView.h \ Lum/Def/Number.h \ Modified: trunk/Illumination/src/Lum/Def/Boolean.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/Boolean.cpp 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/src/Lum/Def/Boolean.cpp 2011-02-09 19:15:34 UTC (rev 4118) @@ -29,6 +29,11 @@ assert(value!=NULL); } + Property* Boolean::Copy() const + { + return new Boolean(GetDesc(),value); + } + Model::Boolean* Boolean::GetBoolean() const { return value; Added: trunk/Illumination/src/Lum/Def/Interval.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/Interval.cpp (rev 0) +++ trunk/Illumination/src/Lum/Def/Interval.cpp 2011-02-09 19:15:34 UTC (rev 4118) @@ -0,0 +1,51 @@ +/* + This source is part of the Illumination library + Copyright (C) 2010 Tim Teulings + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <Lum/Def/Interval.h> + +namespace Lum { + namespace Def { + + Interval::Interval(const Desc& description, + Model::Number* start, + Model::Number* end) + : Property(description), + start(start), + end(end) + { + assert(start!=NULL); + assert(end!=NULL); + } + + Property* Interval::Copy() const + { + return new Interval(GetDesc(),start,end); + } + + Model::Number* Interval::GetStart() const + { + return start; + } + + Model::Number* Interval::GetEnd() const + { + return end; + } + } +} Property changes on: trunk/Illumination/src/Lum/Def/Interval.cpp ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Modified: trunk/Illumination/src/Lum/Def/Number.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/Number.cpp 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/src/Lum/Def/Number.cpp 2011-02-09 19:15:34 UTC (rev 4118) @@ -29,6 +29,11 @@ assert(value!=NULL); } + Property* Number::Copy() const + { + return new Number(GetDesc(),value); + } + Model::Number* Number::GetValue() const { return value; Modified: trunk/Illumination/src/Lum/Def/OneOfMany.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/OneOfMany.cpp 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/src/Lum/Def/OneOfMany.cpp 2011-02-09 19:15:34 UTC (rev 4118) @@ -37,6 +37,18 @@ choicesHeader->AddColumn(L"",Lum::Base::Size::pixel,0); } + Property* OneOfMany::Copy() const + { + OneOfMany *result=new OneOfMany(GetDesc(), + value, + choices, + tablePainter); + + result->SetChoicesHeader(choicesHeader); + + return result; + } + OneOfMany& OneOfMany::SetChoicesHeader(Model::Header* choicesHeader) { assert(choicesHeader!=NULL); Modified: trunk/Illumination/src/Lum/Def/OneOfN.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/OneOfN.cpp 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/src/Lum/Def/OneOfN.cpp 2011-02-09 19:15:34 UTC (rev 4118) @@ -39,6 +39,16 @@ assert(value!=NULL); } + Property* OneOfN::Copy() const + { + OneOfN *result=new OneOfN(GetDesc(), + value); + + result->choices=choices; + + return result; + } + OneOfN& OneOfN::AddChoice(const Choice& choice) { choices.push_back(choice); Modified: trunk/Illumination/src/Lum/Def/Property.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/Property.cpp 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/src/Lum/Def/Property.cpp 2011-02-09 19:15:34 UTC (rev 4118) @@ -28,6 +28,11 @@ // no code } + Property::~Property() + { + // no code + } + const Desc& Property::GetDesc() const { return description; Modified: trunk/Illumination/src/Lum/Def/Props.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/Props.cpp 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/src/Lum/Def/Props.cpp 2011-02-09 19:15:34 UTC (rev 4118) @@ -26,60 +26,6 @@ namespace Lum { namespace Def { - PropItem::PropItem() - { - // no code - } - - PropItem::~PropItem() - { - // no code - } - - PropBoolean::PropBoolean(const Boolean& boolean) - : boolean(boolean) - { - // no code - } - - const Boolean& PropBoolean::GetValue() const - { - return boolean; - } - - PropNumber::PropNumber(const Number& number) - : number(number) - { - // no code - } - - const Number& PropNumber::GetValue() const - { - return number; - } - - PropOneOfMany::PropOneOfMany(const OneOfMany& oneOfMany) - : oneOfMany(oneOfMany) - { - // no code - } - - const OneOfMany& PropOneOfMany::GetValue() const - { - return oneOfMany; - } - - PropOneOfN::PropOneOfN(const OneOfN& oneOfN) - : oneOfN(oneOfN) - { - // no code - } - - const OneOfN& PropOneOfN::GetValue() const - { - return oneOfN; - } - PropGroup::PropGroup(PropGroup* parent, const Desc& description) : parent(parent), description(description) @@ -98,80 +44,87 @@ parent=NULL; description=other.description; - for (std::list<PropItem*>::const_iterator prop=other.props.begin(); + for (std::list<Property*>::const_iterator prop=other.props.begin(); prop!=other.props.end(); ++prop) { - if (dynamic_cast<PropBoolean*>(*prop)!=NULL) { - props.push_back(new PropBoolean(*dynamic_cast<PropBoolean*>(*prop))); + if (dynamic_cast<Def::Boolean*>(*prop)!=NULL) { + props.push_back(new Def::Boolean(*dynamic_cast<Def::Boolean*>(*prop))); } - else if (dynamic_cast<PropNumber*>(*prop)!=NULL) { - props.push_back(new PropNumber(*dynamic_cast<PropNumber*>(*prop))); + else if (dynamic_cast<Def::Number*>(*prop)!=NULL) { + props.push_back(new Def::Number(*dynamic_cast<Def::Number*>(*prop))); } - else if (dynamic_cast<PropInterval*>(*prop)!=NULL) { - props.push_back(new PropInterval(*dynamic_cast<PropInterval*>(*prop))); + else if (dynamic_cast<Def::Interval*>(*prop)!=NULL) { + props.push_back(new Def::Interval(*dynamic_cast<Def::Interval*>(*prop))); } - else if (dynamic_cast<PropOneOfMany*>(*prop)!=NULL) { - props.push_back(new PropOneOfMany(*dynamic_cast<PropOneOfMany*>(*prop))); + else if (dynamic_cast<Def::OneOfMany*>(*prop)!=NULL) { + props.push_back(new Def::OneOfMany(*dynamic_cast<Def::OneOfMany*>(*prop))); } - else if (dynamic_cast<PropOneOfN*>(*prop)!=NULL) { - props.push_back(new PropOneOfN(*dynamic_cast<PropOneOfN*>(*prop))); + else if (dynamic_cast<Def::OneOfN*>(*prop)!=NULL) { + props.push_back(new Def::OneOfN(*dynamic_cast<Def::OneOfN*>(*prop))); } - else if (dynamic_cast<PropGroup*>(*prop)!=NULL) { - PropGroup *group=new PropGroup(*dynamic_cast<PropGroup*>(*prop)); - - group->parent=this; - - props.push_back(group); - } else { assert(false); } } + + for (std::list<PropGroup*>::const_iterator group=other.groups.begin(); + group!=other.groups.end(); + ++group) { + PropGroup *group=new PropGroup(*group); + + group->parent=this; + + groups.push_back(group); + } } PropGroup::~PropGroup() { - for (std::list<PropItem*>::iterator prop=props.begin(); + for (std::list<Property*>::iterator prop=props.begin(); prop!=props.end(); ++prop) { delete *prop; } + + for (std::list<PropGroup*>::const_iterator group=groups.begin(); + group!=groups.end(); + ++group) { + delete *group; + } } PropGroup* PropGroup::Boolean(const Def::Boolean& boolean) { - props.push_back(new PropBoolean(boolean)); + props.push_back(boolean.Copy()); return this; } PropGroup* PropGroup::Number(const Def::Number& number) { - props.push_back(new PropNumber(number)); + props.push_back(number.Copy()); return this; } - PropGroup* PropGroup::Interval(const Desc& desc, - const Def::Number& start, - const Def::Number& end) + PropGroup* PropGroup::Interval(const Def::Interval& interval) { - props.push_back(new PropInterval(desc,start,end)); + props.push_back(interval.Copy()); return this; } PropGroup* PropGroup::OneOfMany(const Def::OneOfMany& oneOfMany) { - props.push_back(new PropOneOfMany(oneOfMany)); + props.push_back(oneOfMany.Copy()); return this; } PropGroup* PropGroup::OneOfN(const Def::OneOfN& oneOfN) { - props.push_back(new PropOneOfN(oneOfN)); + props.push_back(oneOfN.Copy()); return this; } @@ -180,7 +133,7 @@ { PropGroup *group=new PropGroup(this,description); - props.push_back(group); + groups.push_back(group); return group; } @@ -189,7 +142,7 @@ { PropGroup *group=new PropGroup(this,Desc(name)); - props.push_back(group); + groups.push_back(group); return group; } @@ -199,6 +152,7 @@ return parent; } + /* PropGroup* PropGroup::Append(PropGroup* group) { assert(group!=NULL); @@ -234,18 +188,23 @@ } return this; - } + }*/ const Desc& PropGroup::GetDesc() const { return description; } - const std::list<PropItem*>& PropGroup::GetProps() const + const std::list<Property*>& PropGroup::GetProps() const { return props; } + const std::list<PropGroup*>& PropGroup::GetGroups() const + { + return groups; + } + PropGroup* PropGroup::Create() { return new PropGroup(); Modified: trunk/Illumination/src/Lum/Dlg/Properties.cpp =================================================================== --- trunk/Illumination/src/Lum/Dlg/Properties.cpp 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/src/Lum/Dlg/Properties.cpp 2011-02-09 19:15:34 UTC (rev 4118) @@ -61,40 +61,41 @@ void Properties::VisitModels(Def::PropGroup *props, Visitor& visitor) { - for (std::list<Def::PropItem*>::const_iterator prop=props->GetProps().begin(); + for (std::list<Def::Property*>::const_iterator prop=props->GetProps().begin(); prop!=props->GetProps().end(); ++prop) { - if (dynamic_cast<Def::PropGroup*>(*prop)!=NULL) { - Def::PropGroup* group=dynamic_cast<Def::PropGroup*>(*prop); + if (dynamic_cast<Def::Boolean*>(*prop)!=NULL) { + Def::Boolean* boolean=dynamic_cast<Def::Boolean*>(*prop); - VisitModels(group,visitor); + visitor.Visit(boolean->GetBoolean()); } - else if (dynamic_cast<Def::PropBoolean*>(*prop)!=NULL) { - Def::PropBoolean* boolean=dynamic_cast<Def::PropBoolean*>(*prop); + else if (dynamic_cast<Def::Number*>(*prop)!=NULL) { + Def::Number* number=dynamic_cast<Def::Number*>(*prop); - visitor.Visit(boolean->GetValue().GetBoolean()); + visitor.Visit(number->GetValue()); } - else if (dynamic_cast<Def::PropNumber*>(*prop)!=NULL) { - Def::PropNumber* number=dynamic_cast<Def::PropNumber*>(*prop); + else if (dynamic_cast<Def::Interval*>(*prop)!=NULL) { + Def::Interval* interval=dynamic_cast<Def::Interval*>(*prop); - visitor.Visit(number->GetValue().GetValue()); + visitor.Visit(interval->GetStart()); + visitor.Visit(interval->GetEnd()); } - else if (dynamic_cast<Def::PropInterval*>(*prop)!=NULL) { - Def::PropInterval* interval=dynamic_cast<Def::PropInterval*>(*prop); + else if (dynamic_cast<Def::OneOfN*>(*prop)!=NULL) { + Def::OneOfN* oneOfN=dynamic_cast<Def::OneOfN*>(*prop); - visitor.Visit(interval->GetStart().GetValue()); - visitor.Visit(interval->GetEnd().GetValue()); + visitor.Visit(oneOfN->GetValue()); } - else if (dynamic_cast<Def::PropOneOfN*>(*prop)!=NULL) { - Def::PropOneOfN* oneOfN=dynamic_cast<Def::PropOneOfN*>(*prop); + else if (dynamic_cast<Def::OneOfMany*>(*prop)!=NULL) { + Def::OneOfMany* oneOfMany=dynamic_cast<Def::OneOfMany*>(*prop); - visitor.Visit(oneOfN->GetValue().GetValue()); + visitor.Visit(oneOfMany->GetValue()); } - else if (dynamic_cast<Def::PropOneOfMany*>(*prop)!=NULL) { - Def::PropOneOfMany* oneOfMany=dynamic_cast<Def::PropOneOfMany*>(*prop); + } - visitor.Visit(oneOfMany->GetValue().GetValue()); - } + for (std::list<Def::PropGroup*>::const_iterator group=props->GetGroups().begin(); + group!=props->GetGroups().end(); + ++group) { + VisitModels(*group,visitor); } } @@ -168,50 +169,50 @@ } void Properties::AddControlForProperty(Label* label, - Def::PropItem* prop) + Def::Property* prop) { - if (dynamic_cast<Def::PropBoolean*>(prop)!=NULL) { - Def::PropBoolean* boolean=dynamic_cast<Def::PropBoolean*>(prop); + if (dynamic_cast<Def::Boolean*>(prop)!=NULL) { + Def::Boolean* boolean=dynamic_cast<Def::Boolean*>(prop); - label->AddLabel(boolean->GetValue().GetDesc().GetLabel(), - Manager::Behaviour::Instance()->GetBooleanControl(boolean->GetValue(),true,false)); + label->AddLabel(boolean->GetDesc().GetLabel(), + Manager::Behaviour::Instance()->GetBooleanControl(*boolean,true,false)); } - else if (dynamic_cast<Def::PropNumber*>(prop)!=NULL) { - Def::PropNumber* number=dynamic_cast<Def::PropNumber*>(prop); + else if (dynamic_cast<Def::Number*>(prop)!=NULL) { + Def::Number* number=dynamic_cast<Def::Number*>(prop); - if (number->GetValue().GetValue()->GetMaxAsDouble()- - number->GetValue().GetValue()->GetMinAsDouble()<20.0) { - label->AddLabel(number->GetValue().GetDesc().GetLabel()+L":", - HSlider::Create(number->GetValue().GetValue(),true,true,false)); + if (number->GetValue()->GetMaxAsDouble()- + number->GetValue()->GetMinAsDouble()<20.0) { + label->AddLabel(number->GetDesc().GetLabel()+L":", + HSlider::Create(number->GetValue(),true,true,false)); } else { - label->AddLabel(number->GetValue().GetDesc().GetLabel()+L":", - String::Create(number->GetValue().GetValue(),true,false)); + label->AddLabel(number->GetDesc().GetLabel()+L":", + String::Create(number->GetValue(),true,false)); } } - else if (dynamic_cast<Def::PropInterval*>(prop)!=NULL) { - Def::PropInterval *interval=dynamic_cast<Def::PropInterval*>(prop); - HPanel *hPanel; + else if (dynamic_cast<Def::Interval*>(prop)!=NULL) { + Def::Interval *interval=dynamic_cast<Def::Interval*>(prop); + HPanel *hPanel; hPanel=new HPanel(); hPanel->SetFlex(true,false); - hPanel->Add(String::Create(interval->GetStart().GetValue(),true,false)); + hPanel->Add(String::Create(interval->GetStart(),true,false)); hPanel->Add(Text::Create(L" - ")); - hPanel->Add(String::Create(interval->GetEnd().GetValue(),true,false)); + hPanel->Add(String::Create(interval->GetEnd(),true,false)); label->AddLabel(interval->GetDesc().GetLabel()+L":",hPanel); } - else if (dynamic_cast<Def::PropOneOfN*>(prop)!=NULL) { - Def::PropOneOfN* oneOfN=dynamic_cast<Def::PropOneOfN*>(prop); + else if (dynamic_cast<Def::OneOfN*>(prop)!=NULL) { + Def::OneOfN* oneOfN=dynamic_cast<Def::OneOfN*>(prop); - label->AddLabel(oneOfN->GetValue().GetDesc().GetLabel()+L":", - Manager::Behaviour::Instance()->GetOneOfNControl(oneOfN->GetValue(),true,false)); + label->AddLabel(oneOfN->GetDesc().GetLabel()+L":", + Manager::Behaviour::Instance()->GetOneOfNControl(*oneOfN,true,false)); } - else if (dynamic_cast<Def::PropOneOfMany*>(prop)!=NULL) { - Def::PropOneOfMany* oneOfMany=dynamic_cast<Def::PropOneOfMany*>(prop); + else if (dynamic_cast<Def::OneOfMany*>(prop)!=NULL) { + Def::OneOfMany* oneOfMany=dynamic_cast<Def::OneOfMany*>(prop); - label->AddLabel(oneOfMany->GetValue().GetDesc().GetLabel()+L":", - Manager::Behaviour::Instance()->GetOneOfManyControl(oneOfMany->GetValue(),true,false)); + label->AddLabel(oneOfMany->GetDesc().GetLabel()+L":", + Manager::Behaviour::Instance()->GetOneOfManyControl(*oneOfMany,true,false)); } else { std::cerr << "Unsupported property" << std::endl; @@ -243,13 +244,7 @@ groupStack.erase(groupStack.begin()); - for (std::list<Def::PropItem*>::const_iterator prop=props->GetProps().begin(); - prop!=props->GetProps().end(); - ++prop) { - if (dynamic_cast<Def::PropGroup*>(*prop)==NULL) { - isGroup=false; - } - } + isGroup=props->GetGroups().size()>0; if (isGroup) { if (OS::display->GetSize()<OS::Display::sizeNormal) { @@ -273,12 +268,10 @@ label=NULL; } - for (std::list<Def::PropItem*>::const_iterator prop=props->GetProps().begin(); - prop!=props->GetProps().end(); - ++prop) { - if (dynamic_cast<Def::PropGroup*>(*prop)!=NULL) { - groupStack.push_back(dynamic_cast<Def::PropGroup*>(*prop)); - } + for (std::list<Def::PropGroup*>::const_iterator group=props->GetGroups().begin(); + group!=props->GetGroups().end(); + ++group) { + groupStack.push_back(*group); } } else { @@ -286,17 +279,10 @@ label=Label::Create(true,true); } - for (std::list<Def::PropItem*>::const_iterator prop=props->GetProps().begin(); + for (std::list<Def::Property*>::const_iterator prop=props->GetProps().begin(); prop!=props->GetProps().end(); ++prop) { - if (dynamic_cast<Def::PropGroup*>(*prop)!=NULL) { - Def::PropGroup *group=dynamic_cast<Def::PropGroup*>(*prop); - - label->AddLabel(group->GetDesc().GetLabel(),NULL); - } - else { - AddControlForProperty(label,*prop); - } + AddControlForProperty(label,*prop); } if (tab!=NULL) { Modified: trunk/Illumination/src/Makefile.am =================================================================== --- trunk/Illumination/src/Makefile.am 2011-02-09 17:02:16 UTC (rev 4117) +++ trunk/Illumination/src/Makefile.am 2011-02-09 19:15:34 UTC (rev 4118) @@ -42,6 +42,7 @@ Lum/Def/AppInfo.cpp \ Lum/Def/Boolean.cpp \ Lum/Def/Desc.cpp \ + Lum/Def/Interval.cpp \ Lum/Def/Menu.cpp \ Lum/Def/MultiView.cpp \ Lum/Def/Number.cpp \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-02-09 17:02:23
|
Revision: 4117 http://illumination.svn.sourceforge.net/illumination/?rev=4117&view=rev Author: tteuling Date: 2011-02-09 17:02:16 +0000 (Wed, 09 Feb 2011) Log Message: ----------- Added common base class Def::Property to property-like definitions. Modified Paths: -------------- trunk/Illumination/include/Lum/Def/Boolean.h trunk/Illumination/include/Lum/Def/Number.h trunk/Illumination/include/Lum/Def/OneOfMany.h trunk/Illumination/include/Lum/Def/OneOfN.h trunk/Illumination/include/Lum/Def/Props.h trunk/Illumination/include/Lum/Dlg/Properties.h trunk/Illumination/include/Makefile.am trunk/Illumination/src/Lum/Def/Boolean.cpp trunk/Illumination/src/Lum/Def/Number.cpp trunk/Illumination/src/Lum/Def/OneOfMany.cpp trunk/Illumination/src/Lum/Def/OneOfN.cpp trunk/Illumination/src/Lum/Dlg/Properties.cpp trunk/Illumination/src/Makefile.am Added Paths: ----------- trunk/Illumination/include/Lum/Def/Property.h trunk/Illumination/src/Lum/Def/Property.cpp Modified: trunk/Illumination/include/Lum/Def/Boolean.h =================================================================== --- trunk/Illumination/include/Lum/Def/Boolean.h 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/include/Lum/Def/Boolean.h 2011-02-09 17:02:16 UTC (rev 4117) @@ -22,7 +22,7 @@ #include <Lum/Private/ImportExport.h> -#include <Lum/Def/Desc.h> +#include <Lum/Def/Property.h> #include <Lum/Model/Boolean.h> @@ -33,18 +33,15 @@ * Definition of an boolean value and together with all necessary information to visualize this value in various contextes like dialogs, menu items and similar. */ - class LUMAPI Boolean + class LUMAPI Boolean : public Property { private: - Desc description; Model::BooleanRef value; public: Boolean(const Desc& description, Model::Boolean *value); Model::Boolean* GetBoolean() const; - - const Desc& GetDesc() const; }; } } Modified: trunk/Illumination/include/Lum/Def/Number.h =================================================================== --- trunk/Illumination/include/Lum/Def/Number.h 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/include/Lum/Def/Number.h 2011-02-09 17:02:16 UTC (rev 4117) @@ -22,7 +22,7 @@ #include <Lum/Private/ImportExport.h> -#include <Lum/Def/Desc.h> +#include <Lum/Def/Property.h> #include <Lum/Model/Number.h> @@ -31,29 +31,15 @@ namespace Def { /** */ - class LUMAPI Number + class LUMAPI Number : public Property { private: - Desc description; Model::NumberRef value; public: - Number(const Desc& description, Model::Number* value) - : description(description), - value(value) - { - assert(value!=NULL); - } + Number(const Desc& description, Model::Number* value); - Model::Number* GetValue() const - { - return value; - } - - const Desc& GetDesc() const - { - return description; - } + Model::Number* GetValue() const; }; } } Modified: trunk/Illumination/include/Lum/Def/OneOfMany.h =================================================================== --- trunk/Illumination/include/Lum/Def/OneOfMany.h 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/include/Lum/Def/OneOfMany.h 2011-02-09 17:02:16 UTC (rev 4117) @@ -24,7 +24,7 @@ #include <Lum/Private/ImportExport.h> -#include <Lum/Def/Desc.h> +#include <Lum/Def/Property.h> #include <Lum/Model/Header.h> #include <Lum/Model/Number.h> @@ -42,10 +42,9 @@ buttons or combo boxes. OneOfMany will always fall back to use a table for value selection. */ - class LUMAPI OneOfMany + class LUMAPI OneOfMany : public Property { private: - Desc description; Model::NumberRef value; Model::TableRef choices; Model::HeaderRef choicesHeader; @@ -59,7 +58,6 @@ OneOfMany& SetChoicesHeader(Model::Header* choicesHeader); - const Desc& GetDesc() const; Model::Number* GetValue() const; Model::Table* GetChoices() const; Model::Header* GetChoicesHeader() const; Modified: trunk/Illumination/include/Lum/Def/OneOfN.h =================================================================== --- trunk/Illumination/include/Lum/Def/OneOfN.h 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/include/Lum/Def/OneOfN.h 2011-02-09 17:02:16 UTC (rev 4117) @@ -24,7 +24,7 @@ #include <Lum/Private/ImportExport.h> -#include <Lum/Def/Desc.h> +#include <Lum/Def/Property.h> #include <Lum/Model/Number.h> @@ -34,7 +34,7 @@ * Definition of an boolean value and together with all necessary information to visualize this value in various contextes like dialogs, menu items and similar. */ - class LUMAPI OneOfN + class LUMAPI OneOfN : public Property { public: class LUMAPI Choice @@ -49,7 +49,6 @@ }; private: - Desc description; Model::NumberRef value; std::list<Choice> choices; @@ -60,7 +59,6 @@ Model::Number* GetValue() const; - const Desc& GetDesc() const; const std::list<Choice>& GetChoices() const; }; } Added: trunk/Illumination/include/Lum/Def/Property.h =================================================================== --- trunk/Illumination/include/Lum/Def/Property.h (rev 0) +++ trunk/Illumination/include/Lum/Def/Property.h 2011-02-09 17:02:16 UTC (rev 4117) @@ -0,0 +1,49 @@ +#ifndef LUM_DEF_PROPERTY_H +#define LUM_DEF_PROPERTY_H + +/* + This source is part of the Illumination library + Copyright (C) 2011 Tim Teulings + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <Lum/Private/ImportExport.h> + +#include <Lum/Def/Desc.h> + +namespace Lum { + + namespace Def { + /** + * Abstract definition base class for data elements, which are part of + * a dialog, property page or similar. + */ + class LUMAPI Property + { + private: + Desc description; + + protected: + Property(const Desc& description); + + public: + const Desc& GetDesc() const; + }; + } +} + +#endif + Property changes on: trunk/Illumination/include/Lum/Def/Property.h ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: trunk/Illumination/include/Lum/Def/Props.h =================================================================== --- trunk/Illumination/include/Lum/Def/Props.h 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/include/Lum/Def/Props.h 2011-02-09 17:02:16 UTC (rev 4117) @@ -126,7 +126,8 @@ std::list<PropItem*> props; private: - PropGroup(PropGroup* parent,const Desc& description); + PropGroup(PropGroup* parent, + const Desc& description); public: PropGroup(); @@ -142,9 +143,11 @@ const Def::Number& end); PropGroup* OneOfN(const Def::OneOfN& oneOfN); PropGroup* OneOfMany(const Def::OneOfMany& oneOfMany); + PropGroup* Group(const Desc& description); PropGroup* Group(const std::wstring& name); PropGroup* End(); + PropGroup* Append(PropGroup* group); const std::list<PropItem*>& GetProps() const; Modified: trunk/Illumination/include/Lum/Dlg/Properties.h =================================================================== --- trunk/Illumination/include/Lum/Dlg/Properties.h 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/include/Lum/Dlg/Properties.h 2011-02-09 17:02:16 UTC (rev 4117) @@ -29,6 +29,8 @@ #include <Lum/Model/Action.h> #include <Lum/Model/String.h> +#include <Lum/Label.h> + namespace Lum { namespace Dlg { class LUMAPI Properties : public ActionDialog @@ -53,6 +55,10 @@ void SaveModels(); void PopModels(); + protected: + void AddControlForProperty(Label* label, + Def::PropItem* prop); + public: Properties(Def::PropGroup *props); ~Properties(); Modified: trunk/Illumination/include/Makefile.am =================================================================== --- trunk/Illumination/include/Makefile.am 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/include/Makefile.am 2011-02-09 17:02:16 UTC (rev 4117) @@ -23,6 +23,7 @@ Lum/Def/Number.h \ Lum/Def/OneOfMany.h \ Lum/Def/OneOfN.h \ + Lum/Def/Property.h \ Lum/Def/Props.h \ Lum/Dlg/About.h \ Lum/Dlg/ActionDialog.h \ Modified: trunk/Illumination/src/Lum/Def/Boolean.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/Boolean.cpp 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/src/Lum/Def/Boolean.cpp 2011-02-09 17:02:16 UTC (rev 4117) @@ -21,8 +21,9 @@ namespace Lum { namespace Def { + Boolean::Boolean(const Desc& description, Model::Boolean *value) - : description(description), + : Property(description), value(value) { assert(value!=NULL); @@ -32,11 +33,6 @@ { return value; } - - const Desc& Boolean::GetDesc() const - { - return description; - } } } Modified: trunk/Illumination/src/Lum/Def/Number.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/Number.cpp 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/src/Lum/Def/Number.cpp 2011-02-09 17:02:16 UTC (rev 4117) @@ -22,5 +22,17 @@ namespace Lum { namespace Def { + Number::Number(const Desc& description, Model::Number* value) + : Property(description), + value(value) + { + assert(value!=NULL); + } + + Model::Number* Number::GetValue() const + { + return value; + } + } } Modified: trunk/Illumination/src/Lum/Def/OneOfMany.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/OneOfMany.cpp 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/src/Lum/Def/OneOfMany.cpp 2011-02-09 17:02:16 UTC (rev 4117) @@ -25,7 +25,7 @@ Model::Number* value, Model::Table* choices, TableCellPainter* tablePainter) - : description(description), + : Property(description), value(value), choices(choices), tablePainter(tablePainter) @@ -46,11 +46,6 @@ return *this; } - const Desc& OneOfMany::GetDesc() const - { - return description; - } - Model::Number* OneOfMany::GetValue() const { return value; Modified: trunk/Illumination/src/Lum/Def/OneOfN.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/OneOfN.cpp 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/src/Lum/Def/OneOfN.cpp 2011-02-09 17:02:16 UTC (rev 4117) @@ -33,7 +33,7 @@ } OneOfN::OneOfN(const Desc& description, Model::Number* value) - : description(description), + : Property(description), value(value) { assert(value!=NULL); @@ -51,11 +51,6 @@ return value; } - const Desc& OneOfN::GetDesc() const - { - return description; - } - const std::list<OneOfN::Choice>& OneOfN::GetChoices() const { return choices; Added: trunk/Illumination/src/Lum/Def/Property.cpp =================================================================== --- trunk/Illumination/src/Lum/Def/Property.cpp (rev 0) +++ trunk/Illumination/src/Lum/Def/Property.cpp 2011-02-09 17:02:16 UTC (rev 4117) @@ -0,0 +1,37 @@ +/* + This source is part of the Illumination library + Copyright (C) 2011 Tim Teulings + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <Lum/Def/Property.h> + +namespace Lum { + namespace Def { + + Property::Property(const Desc& description) + : description(description) + { + // no code + } + + const Desc& Property::GetDesc() const + { + return description; + } + } +} + Property changes on: trunk/Illumination/src/Lum/Def/Property.cpp ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: trunk/Illumination/src/Lum/Dlg/Properties.cpp =================================================================== --- trunk/Illumination/src/Lum/Dlg/Properties.cpp 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/src/Lum/Dlg/Properties.cpp 2011-02-09 17:02:16 UTC (rev 4117) @@ -25,7 +25,6 @@ #include <Lum/Base/L10N.h> #include <Lum/Base/String.h> -#include <Lum/Label.h> #include <Lum/Panel.h> #include <Lum/ScrolledObject.h> #include <Lum/Slider.h> @@ -168,6 +167,57 @@ VisitModels(visitor); } + void Properties::AddControlForProperty(Label* label, + Def::PropItem* prop) + { + if (dynamic_cast<Def::PropBoolean*>(prop)!=NULL) { + Def::PropBoolean* boolean=dynamic_cast<Def::PropBoolean*>(prop); + + label->AddLabel(boolean->GetValue().GetDesc().GetLabel(), + Manager::Behaviour::Instance()->GetBooleanControl(boolean->GetValue(),true,false)); + } + else if (dynamic_cast<Def::PropNumber*>(prop)!=NULL) { + Def::PropNumber* number=dynamic_cast<Def::PropNumber*>(prop); + + if (number->GetValue().GetValue()->GetMaxAsDouble()- + number->GetValue().GetValue()->GetMinAsDouble()<20.0) { + label->AddLabel(number->GetValue().GetDesc().GetLabel()+L":", + HSlider::Create(number->GetValue().GetValue(),true,true,false)); + } + else { + label->AddLabel(number->GetValue().GetDesc().GetLabel()+L":", + String::Create(number->GetValue().GetValue(),true,false)); + } + } + else if (dynamic_cast<Def::PropInterval*>(prop)!=NULL) { + Def::PropInterval *interval=dynamic_cast<Def::PropInterval*>(prop); + HPanel *hPanel; + + hPanel=new HPanel(); + hPanel->SetFlex(true,false); + hPanel->Add(String::Create(interval->GetStart().GetValue(),true,false)); + hPanel->Add(Text::Create(L" - ")); + hPanel->Add(String::Create(interval->GetEnd().GetValue(),true,false)); + + label->AddLabel(interval->GetDesc().GetLabel()+L":",hPanel); + } + else if (dynamic_cast<Def::PropOneOfN*>(prop)!=NULL) { + Def::PropOneOfN* oneOfN=dynamic_cast<Def::PropOneOfN*>(prop); + + label->AddLabel(oneOfN->GetValue().GetDesc().GetLabel()+L":", + Manager::Behaviour::Instance()->GetOneOfNControl(oneOfN->GetValue(),true,false)); + } + else if (dynamic_cast<Def::PropOneOfMany*>(prop)!=NULL) { + Def::PropOneOfMany* oneOfMany=dynamic_cast<Def::PropOneOfMany*>(prop); + + label->AddLabel(oneOfMany->GetValue().GetDesc().GetLabel()+L":", + Manager::Behaviour::Instance()->GetOneOfManyControl(oneOfMany->GetValue(),true,false)); + } + else { + std::cerr << "Unsupported property" << std::endl; + } + } + Lum::Object* Properties::GetContent() { std::list<Def::PropGroup*> groupStack; @@ -213,11 +263,9 @@ Tab *newTab=Tab::Create(true,true); if (tab!=NULL) { - std::cout << "Create sub tab" << std::endl; tab->Add(props->GetDesc().GetLabel(),newTab); } else { - std::cout << "Create top tab" << std::endl; vPanel->Add(newTab); } @@ -246,51 +294,8 @@ label->AddLabel(group->GetDesc().GetLabel(),NULL); } - else if (dynamic_cast<Def::PropBoolean*>(*prop)!=NULL) { - Def::PropBoolean* boolean=dynamic_cast<Def::PropBoolean*>(*prop); - - label->AddLabel(boolean->GetValue().GetDesc().GetLabel(), - Manager::Behaviour::Instance()->GetBooleanControl(boolean->GetValue(),true,false)); - } - else if (dynamic_cast<Def::PropNumber*>(*prop)!=NULL) { - Def::PropNumber* number=dynamic_cast<Def::PropNumber*>(*prop); - - if (number->GetValue().GetValue()->GetMaxAsDouble()- - number->GetValue().GetValue()->GetMinAsDouble()<20.0) { - label->AddLabel(number->GetValue().GetDesc().GetLabel()+L":", - HSlider::Create(number->GetValue().GetValue(),true,true,false)); - } - else { - label->AddLabel(number->GetValue().GetDesc().GetLabel()+L":", - String::Create(number->GetValue().GetValue(),true,false)); - } - } - else if (dynamic_cast<Def::PropInterval*>(*prop)!=NULL) { - Def::PropInterval *interval=dynamic_cast<Def::PropInterval*>(*prop); - HPanel *hPanel; - - hPanel=new HPanel(); - hPanel->SetFlex(true,false); - hPanel->Add(String::Create(interval->GetStart().GetValue(),true,false)); - hPanel->Add(Text::Create(L" - ")); - hPanel->Add(String::Create(interval->GetEnd().GetValue(),true,false)); - - label->AddLabel(interval->GetDesc().GetLabel()+L":",hPanel); - } - else if (dynamic_cast<Def::PropOneOfN*>(*prop)!=NULL) { - Def::PropOneOfN* oneOfN=dynamic_cast<Def::PropOneOfN*>(*prop); - - label->AddLabel(oneOfN->GetValue().GetDesc().GetLabel()+L":", - Manager::Behaviour::Instance()->GetOneOfNControl(oneOfN->GetValue(),true,false)); - } - else if (dynamic_cast<Def::PropOneOfMany*>(*prop)!=NULL) { - Def::PropOneOfMany* oneOfMany=dynamic_cast<Def::PropOneOfMany*>(*prop); - - label->AddLabel(oneOfMany->GetValue().GetDesc().GetLabel()+L":", - Manager::Behaviour::Instance()->GetOneOfManyControl(oneOfMany->GetValue(),true,false)); - } else { - std::cerr << "Unsupported property" << std::endl; + AddControlForProperty(label,*prop); } } Modified: trunk/Illumination/src/Makefile.am =================================================================== --- trunk/Illumination/src/Makefile.am 2011-02-08 14:32:48 UTC (rev 4116) +++ trunk/Illumination/src/Makefile.am 2011-02-09 17:02:16 UTC (rev 4117) @@ -47,6 +47,7 @@ Lum/Def/Number.cpp \ Lum/Def/OneOfMany.cpp \ Lum/Def/OneOfN.cpp \ + Lum/Def/Property.cpp \ Lum/Def/Props.cpp \ Lum/Dlg/About.cpp \ Lum/Dlg/ActionDialog.cpp \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-02-08 14:32:54
|
Revision: 4116 http://illumination.svn.sourceforge.net/illumination/?rev=4116&view=rev Author: tteuling Date: 2011-02-08 14:32:48 +0000 (Tue, 08 Feb 2011) Log Message: ----------- Fixed PropertiesDialog layouting. Modified Paths: -------------- trunk/Illumination/src/Lum/Dlg/Properties.cpp trunk/Illumination/src/Lum/Multi.cpp trunk/Illumination/src/Lum/Tab.cpp Modified: trunk/Illumination/src/Lum/Dlg/Properties.cpp =================================================================== --- trunk/Illumination/src/Lum/Dlg/Properties.cpp 2011-02-07 17:34:17 UTC (rev 4115) +++ trunk/Illumination/src/Lum/Dlg/Properties.cpp 2011-02-08 14:32:48 UTC (rev 4116) @@ -101,7 +101,7 @@ void Properties::VisitModels(Visitor& visitor) { - VisitModels(props, visitor); + VisitModels(props,visitor); } void Properties::ObserveModels() @@ -176,8 +176,7 @@ Tab *tab=NULL; Lum::Object *top; - vPanel=new VPanel(); - vPanel->SetFlex(true,true); + vPanel=VPanel::Create(true,true); if (OS::display->GetSize()<OS::Display::sizeNormal) { top=ScrolledObject::Create(vPanel,true,true); @@ -205,20 +204,20 @@ if (isGroup) { if (OS::display->GetSize()<OS::Display::sizeNormal) { if (label==NULL) { - label=new Label(); - label->SetFlex(true,true); + label=Label::Create(true,true); } label->AddLabel(props->GetDesc().GetLabel(),NULL); } else { - Tab *newTab=new Tab(); - newTab->SetFlex(true,true); + Tab *newTab=Tab::Create(true,true); if (tab!=NULL) { + std::cout << "Create sub tab" << std::endl; tab->Add(props->GetDesc().GetLabel(),newTab); } else { + std::cout << "Create top tab" << std::endl; vPanel->Add(newTab); } @@ -236,9 +235,7 @@ } else { if (label==NULL) { - label=new Label(); - label->SetFlex(true,true); - vPanel->Add(label); + label=Label::Create(true,true); } for (std::list<Def::PropItem*>::const_iterator prop=props->GetProps().begin(); @@ -302,6 +299,7 @@ label=NULL; } else if (OS::display->GetSize()>=OS::Display::sizeNormal) { + vPanel->Add(label); label=NULL; } } Modified: trunk/Illumination/src/Lum/Multi.cpp =================================================================== --- trunk/Illumination/src/Lum/Multi.cpp 2011-02-07 17:34:17 UTC (rev 4115) +++ trunk/Illumination/src/Lum/Multi.cpp 2011-02-08 14:32:48 UTC (rev 4116) @@ -153,8 +153,6 @@ Multi* Multi::Append(Object* object) { - object->SetParent(this); - if (inited) { object->CalcSize(); } Modified: trunk/Illumination/src/Lum/Tab.cpp =================================================================== --- trunk/Illumination/src/Lum/Tab.cpp 2011-02-07 17:34:17 UTC (rev 4115) +++ trunk/Illumination/src/Lum/Tab.cpp 2011-02-08 14:32:48 UTC (rev 4116) @@ -322,10 +322,8 @@ assert(label!=NULL); assert(object!=NULL); - Object *rider; + Object *rider=new TabButton(this,list.size(),label,model); - rider=new TabButton(this,list.size(),label,model); - rider->SetParent(this); rider->SetFlex(true,true); list.push_back(rider); @@ -393,6 +391,7 @@ for (std::list<Object*>::iterator iter=list.begin(); iter!=list.end(); ++iter) { + (*iter)->SetParent(this); (*iter)->CalcSize(); mw=std::max(mw,(*iter)->GetOWidth()); mh=std::max(mh,(*iter)->GetOHeight()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-02-07 17:34:24
|
Revision: 4115 http://illumination.svn.sourceforge.net/illumination/?rev=4115&view=rev Author: tteuling Date: 2011-02-07 17:34:17 +0000 (Mon, 07 Feb 2011) Log Message: ----------- Fixed font handling for win32 driver. Modified Paths: -------------- trunk/Illumination/src/Lum/OS/Win32/Font.cpp Modified: trunk/Illumination/src/Lum/OS/Win32/Font.cpp =================================================================== --- trunk/Illumination/src/Lum/OS/Win32/Font.cpp 2011-02-07 15:31:43 UTC (rev 4114) +++ trunk/Illumination/src/Lum/OS/Win32/Font.cpp 2011-02-07 17:34:17 UTC (rev 4115) @@ -19,6 +19,8 @@ #include <Lum/OS/Win32/Font.h> +#include <cstdlib> + #include <Lum/OS/Win32/Display.h> #include <iostream> @@ -85,8 +87,9 @@ info.lfFaceName[0]='\0'; if (attrHeight & features) { - info.lfHeight=-MulDiv(pixelHeight,GetDeviceCaps(dynamic_cast<Display*>(OS::display)->hdc,LOGPIXELSY),72); + info.lfHeight=std::abs(MulDiv(pixelHeight,GetDeviceCaps(dynamic_cast<Display*>(OS::display)->hdc,LOGPIXELSY),72)); } + if (attrName & features) { strcpy(info.lfFaceName,name.c_str()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tte...@us...> - 2011-02-07 15:31:49
|
Revision: 4114 http://illumination.svn.sourceforge.net/illumination/?rev=4114&view=rev Author: tteuling Date: 2011-02-07 15:31:43 +0000 (Mon, 07 Feb 2011) Log Message: ----------- Fixed default font size calculation under Windows. Modified Paths: -------------- trunk/Illumination/src/Lum/OS/Win32/Win32Theme.cpp Modified: trunk/Illumination/src/Lum/OS/Win32/Win32Theme.cpp =================================================================== --- trunk/Illumination/src/Lum/OS/Win32/Win32Theme.cpp 2011-02-07 14:39:52 UTC (rev 4113) +++ trunk/Illumination/src/Lum/OS/Win32/Win32Theme.cpp 2011-02-07 15:31:43 UTC (rev 4114) @@ -2413,8 +2413,7 @@ ::SystemParametersInfoW(SPI_GETNONCLIENTMETRICS,sizeof(NONCLIENTMETRICSW),&metrics,0); - return std::abs((metrics.lfMessageFont.lfHeight*72)/ - GetDeviceCaps(dynamic_cast<Display*>(OS::display)->hdc,LOGPIXELSY)); + return std::abs(metrics.lfMessageFont.lfHeight); } std::wstring Win32Theme::GetFixedFontName() const @@ -2435,8 +2434,7 @@ SelectObject(((Display*)display)->hdc,GetStockObject(ANSI_FIXED_FONT)); GetTextMetrics(((Display*)display)->hdc,&metric); - return ((metric.tmAscent+metric.tmDescent)*72)/ - GetDeviceCaps(dynamic_cast<Display*>(OS::display)->hdc,LOGPIXELSY); + return metric.tmHeight; } size_t Win32Theme::GetSpaceHorizontal(Display::Space space) const This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |