/* =========================================================================
** Extended Template and Library
-** stringf Prodecure Implementation
+** stringf Procedure Implementation
** $Id$
**
** Copyright (c) 2002 Robert B. Quattlebaum Jr.
#define ETL_NO_THROW throw()
#endif
-#ifdef HAVE_VASPRINTF // This is the prefered method
+#ifdef HAVE_VASPRINTF // This is the preferred method
extern int vasprintf(char **,const char *,va_list)ETL_NO_THROW;
#else
inline std::string
vstrprintf(const char *format, va_list args)
{
-#ifdef HAVE_VASPRINTF // This is the prefered method (and safest)
+#ifdef HAVE_VASPRINTF // This is the preferred method (and safest)
char *buffer;
std::string ret;
vasprintf(&buffer,format,args);
{
std::string::const_iterator iter;
- if(str.size() == 1 && str[0] == ETL_DIRECTORY_SEPERATOR)
+ if(str.size() == 1 && str[0] == ETL_DIRECTORY_SEPARATOR)
return str;
- if(str.end()[-1]==ETL_DIRECTORY_SEPERATOR)
+ if(str.end()[-1]==ETL_DIRECTORY_SEPARATOR)
iter=str.end()-2;
else
iter=str.end()-1;
for(;iter!=str.begin();iter--)
- if(*iter==ETL_DIRECTORY_SEPERATOR)
+ if(*iter==ETL_DIRECTORY_SEPARATOR)
break;
- if (*iter==ETL_DIRECTORY_SEPERATOR)
+ if (*iter==ETL_DIRECTORY_SEPARATOR)
iter++;
- if(str.end()[-1]==ETL_DIRECTORY_SEPERATOR)
+ if(str.end()[-1]==ETL_DIRECTORY_SEPARATOR)
return std::string(iter,str.end()-1);
return std::string(iter,str.end());
{
std::string::const_iterator iter;
- if(str.size() == 1 && str[0] == ETL_DIRECTORY_SEPERATOR)
+ if(str.size() == 1 && str[0] == ETL_DIRECTORY_SEPARATOR)
return str;
- if(str.end()[-1]==ETL_DIRECTORY_SEPERATOR)
+ if(str.end()[-1]==ETL_DIRECTORY_SEPARATOR)
iter=str.end()-2;
else
iter=str.end()-1;
for(;iter!=str.begin();iter--)
- if(*iter==ETL_DIRECTORY_SEPERATOR)
+ if(*iter==ETL_DIRECTORY_SEPARATOR)
break;
if(iter==str.begin())
- if (*iter==ETL_DIRECTORY_SEPERATOR)
+ if (*iter==ETL_DIRECTORY_SEPARATOR)
return "/";
else
return ".";
if(path.size()>=3 && path[1]==':' && (path[2]=='\\' || path[2]=='/'))
return true;
#endif
- if(!path.empty() && path[0]==ETL_DIRECTORY_SEPERATOR)
+ if(!path.empty() && path[0]==ETL_DIRECTORY_SEPARATOR)
return true;
return false;
}
switch(*iter)
{
case '/':
- ret+=ETL_DIRECTORY_SEPERATOR;
+ ret+=ETL_DIRECTORY_SEPARATOR;
break;
case '~':
ret+='~';
for(iter=path.begin();iter!=path.end();++iter)
{
- if(*iter==ETL_DIRECTORY_SEPERATOR)
+ if(*iter==ETL_DIRECTORY_SEPARATOR)
break;
ret+=*iter;
}
//if(iter!=path.end())
- ret+=ETL_DIRECTORY_SEPERATOR;
+ ret+=ETL_DIRECTORY_SEPARATOR;
return ret;
}
{
while(!path.empty())
{
- if(path[0]==ETL_DIRECTORY_SEPERATOR)
+ if(path[0]==ETL_DIRECTORY_SEPARATOR)
{
path.erase(path.begin());
return path;
if((dir=="../" || dir=="..\\") && ret.size())
{
ret=dirname(ret);
- if (*(ret.end()-1)!=ETL_DIRECTORY_SEPERATOR)
- ret+=ETL_DIRECTORY_SEPERATOR;
+ if (*(ret.end()-1)!=ETL_DIRECTORY_SEPARATOR)
+ ret+=ETL_DIRECTORY_SEPARATOR;
}
else if((dir!="./" && dir!=".\\") && dir!=".")
ret+=dir;
}
if (ret.size()==0)ret+='.';
- // Remove any trailing directory seperators
- if(ret.size() && ret[ret.size()-1]==ETL_DIRECTORY_SEPERATOR)
+ // Remove any trailing directory separators
+ if(ret.size() && ret[ret.size()-1]==ETL_DIRECTORY_SEPARATOR)
ret.erase(ret.begin()+ret.size()-1);
return ret;
}
return cleanup_path(ret);
if(is_absolute_path(path))
return cleanup_path(path);
- return cleanup_path(ret+ETL_DIRECTORY_SEPERATOR+path);
+ return cleanup_path(ret+ETL_DIRECTORY_SEPARATOR+path);
}
inline std::string
while(!curr_path.empty())
{
- dest_path=std::string("..")+ETL_DIRECTORY_SEPERATOR+dest_path;
+ dest_path=std::string("..")+ETL_DIRECTORY_SEPARATOR+dest_path;
curr_path=remove_root_from_path(curr_path);
}
#endif
#ifdef WIN32
-#define ETL_DIRECTORY_SEPERATOR '\\'
+#define ETL_DIRECTORY_SEPARATOR '\\'
#else
-#define ETL_DIRECTORY_SEPERATOR '/'
+#define ETL_DIRECTORY_SEPARATOR '/'
#endif
#ifndef ETL_FLAG_NONAMESPACE
if(get_canvas())
{
- if(error)error=FT_New_Face(ft_library,(get_canvas()->get_file_path()+ETL_DIRECTORY_SEPERATOR+newfont).c_str(),face_index,&face);
- if(error)error=FT_New_Face(ft_library,(get_canvas()->get_file_path()+ETL_DIRECTORY_SEPERATOR+newfont+".ttf").c_str(),face_index,&face);
+ if(error)error=FT_New_Face(ft_library,(get_canvas()->get_file_path()+ETL_DIRECTORY_SEPARATOR+newfont).c_str(),face_index,&face);
+ if(error)error=FT_New_Face(ft_library,(get_canvas()->get_file_path()+ETL_DIRECTORY_SEPARATOR+newfont+".ttf").c_str(),face_index,&face);
}
#ifdef USE_MAC_FT_FUNCS
if(is_absolute_path(newfilename))
filename_with_path=newfilename;
else
- filename_with_path=get_canvas()->get_file_path()+ETL_DIRECTORY_SEPERATOR+newfilename;
+ filename_with_path=get_canvas()->get_file_path()+ETL_DIRECTORY_SEPARATOR+newfilename;
handle<Importer> newimporter;
if(!newimporter)
{
- newimporter=Importer::open(get_canvas()->get_file_path()+ETL_DIRECTORY_SEPERATOR+basename(newfilename));
+ newimporter=Importer::open(get_canvas()->get_file_path()+ETL_DIRECTORY_SEPARATOR+basename(newfilename));
if(!newimporter)
{
synfig::error(strprintf("Unable to create an importer object with file \"%s\"",filename_with_path.c_str()));
if(is_absolute_path(file_name))
external_canvas=open_canvas(file_name);
else
- external_canvas=open_canvas(get_file_path()+ETL_DIRECTORY_SEPERATOR+file_name);
+ external_canvas=open_canvas(get_file_path()+ETL_DIRECTORY_SEPARATOR+file_name);
if(!external_canvas)
throw Exception::FileNotFound(file_name);
return new_child_canvas(id);
}
- // If the first character is the seperator, then
+ // If the first character is the separator, then
// this references the root canvas.
if(id[0]==':')
return get_root()->surefind_canvas(string(id,1));
if(is_absolute_path(file_name))
external_canvas=open_canvas(file_name);
else
- external_canvas=open_canvas(get_file_path()+ETL_DIRECTORY_SEPERATOR+file_name);
+ external_canvas=open_canvas(get_file_path()+ETL_DIRECTORY_SEPARATOR+file_name);
if(!external_canvas)
throw Exception::FileNotFound(file_name);
throw Exception::IDNotFound("Child Canvas in Parent Canvas: (child)"+id);
}
- // If the first character is the seperator, then
+ // If the first character is the separator, then
// this references the root canvas.
if(id.find_first_of(':')==0)
return get_root()->find_canvas(string(id,1));
/* === S Y N F I G ========================================================= */
/*! \file general.h
-** \brief General macros, classes, and prodecure declarations
+** \brief General macros, classes, and procedure declarations
**
** $Id$
**
return;
}
String line;
- String prefix=etl::dirname(filename)+ETL_DIRECTORY_SEPERATOR;
+ String prefix=etl::dirname(filename)+ETL_DIRECTORY_SEPARATOR;
while(!stream.eof())
{
getline(stream,line);
std::string imagepath;
#ifdef WIN32
- imagepath=App::get_base_path()+ETL_DIRECTORY_SEPERATOR+IMAGE_DIR;
+ imagepath=App::get_base_path()+ETL_DIRECTORY_SEPARATOR+IMAGE_DIR;
#else
imagepath=IMAGE_DIR;
#endif
char* synfig_root=getenv("SYNFIG_ROOT");
if(synfig_root) {
imagepath=synfig_root;
- imagepath+=ETL_DIRECTORY_SEPERATOR;
+ imagepath+=ETL_DIRECTORY_SEPARATOR;
imagepath+="share/pixmaps";
}
- imagepath+=ETL_DIRECTORY_SEPERATOR;
+ imagepath+=ETL_DIRECTORY_SEPARATOR;
// Create the Logo
if(basename(filename)==filename)
{
- gtk_file_selection_set_filename(GTK_FILE_SELECTION(fileselection),(prev_path+ETL_DIRECTORY_SEPERATOR).c_str());
+ gtk_file_selection_set_filename(GTK_FILE_SELECTION(fileselection),(prev_path+ETL_DIRECTORY_SEPARATOR).c_str());
}
else
gtk_file_selection_set_filename(GTK_FILE_SELECTION(fileselection),dirname(filename).c_str());
return Glib::build_filename(get_shadow_directory(),strprintf("%08X-%s",hash1,basename(filename).c_str()));
-// return dirname(filename) + ETL_DIRECTORY_SEPERATOR + ".shadow_" + basename(filename);
+// return dirname(filename) + ETL_DIRECTORY_SEPARATOR + ".shadow_" + basename(filename);
}
bool
table->attach(x,1,2,0,2,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
table->attach(y,1,2,2,4,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
- //seperator
+ //separator
table->attach(*manage(new Gtk::VSeparator),2,3,0,4,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK|Gtk::FILL);
//color label
char* synfig_root=getenv("SYNFIG_ROOT");
if(synfig_root) {
path_to_icons=synfig_root;
- path_to_icons+=ETL_DIRECTORY_SEPERATOR;
+ path_to_icons+=ETL_DIRECTORY_SEPARATOR;
path_to_icons+="share/pixmaps/synfigstudio";
}
- path_to_icons+=ETL_DIRECTORY_SEPERATOR;
+ path_to_icons+=ETL_DIRECTORY_SEPARATOR;
try{
Gtk::Window::set_default_icon_from_file(path_to_icons+"synfig_icon."+IMAGE_EXT);
#include <gtkmm/box.h>
#include <ETL/misc>
#include <synfig/general.h>
-//#include <gtkmm/seperator.h>
+//#include <gtkmm/separator.h>
#endif
try
{
- entry_filename.set_text(Glib::build_filename(Glib::get_home_dir(),Glib::ustring("Desktop")+ETL_DIRECTORY_SEPERATOR+Glib::ustring("output.png")));
+ entry_filename.set_text(Glib::build_filename(Glib::get_home_dir(),Glib::ustring("Desktop")+ETL_DIRECTORY_SEPARATOR+Glib::ustring("output.png")));
}
catch(...)
{
if(!data.empty())
{
if(!load_sketch(data))
- load_sketch(dirname(canvas->get_file_name())+ETL_DIRECTORY_SEPERATOR+basename(data));
+ load_sketch(dirname(canvas->get_file_name())+ETL_DIRECTORY_SEPARATOR+basename(data));
}
}