December 8, 2008, 5:01 pm
Recently I finished the new Create Project dialog in gIDE which integrates with the project template system I wrote earlier, for those who saw the previous one this is a marked improvement. The new dialog is similar to create dialogs in most IDE’s where the user chooses the language they want to work in and the project type. Given that information gIDE will get the appropriate project template and creates the project. It is currently using a placeholder image for the Project Icon, I want to make this configurable in the project template and replace the placeholder image with a different default image.
This first screenshot shows gIDE when the create project dialog first opens:
This second shows just the create dialog with some random choices made:

Finally just to round things off a screenshot of gIDE in action working on another project I’m hacking away on:

The working create dialog has not been commited to svn yet as there is one or two small bugs I’m trying to track down but it should be up within the next day or two.
Tags: gIDE, Gnome, IDE, Programming, project, screenshots, Templates
Category: Programming, Projects, gIDE |
Comment
July 1, 2008, 5:39 pm
Seeing as a while ago I posted on reading a file in with GnomeVFSmm since now and then the folks at GNOME have release GIO their new i/o library. Thankfully this makes life for the developer a lot easier from what I can tell to prove this here is my example from my GnomeVFSmm reworked to use GIO.
Reading from a file:
Glib::ustring read_from_file(Glib::ustring file_name)
{
Glib::RefPtr<gio::File> fp = Gio::File::create_for_uri(file_name);
char *raw;
gsize read_bytes;
std::string e_tag;
fp->load_contents(raw, read_bytes, e_tag);
Glib::ustring buffer = raw;
return buffer;
}
Writing to a file:
void write_to_file(Glib::ustring file_name, std::string e_tag, Glib::ustring buf)
{
Glib::RefPtr<gio::File> fp = Gio::File::create_for_uri(file_name);
fp->replace_contents(buf.c_str(), e_tag, e_tag);
}
Just as a note this method only works for reading and writing text files, and there should be some error checking which has been omitted. If there is any problems in the above code do not hesitate to let me know. Also as a side note does anyone know how to retrieve the mime type for a file using GIOmm.
Category: Programming |
Comment
February 16, 2008, 6:36 pm
Now that the new server is up and running smoothley I decided to migrate my two relatively new project into the svn repositries on this sever, at some point I’ll make a better post about each project but for now a brief introduction will have to do. Both of these projects are available for anonymous checkout from svn and the source is browsable online, a link will be posted so you can do both these things.
Axalon
Axalon is a collaborative GUI designer written in C# and is being developed on windows, I haven’t quite yet decided what license to release it under, but chances are it will be the GPL. For those that are curious it is the rewrite of my research project I did at university last year, after seeing how to do things better I figured a complete re-write might be easier. The svn repo (also where you can browse the source on line) is:
http://mlowen.com/svn/axalon
gIDE
gIDE is a simplistic IDE designed for the Gnome desktop enviroment written in C++, it uses Gtkmm and various other related librarie. gIDE is being released under version 2 of the GNU GPL, the svn repo is:
http://mlowen.com/svn/gIDE
With both these projects feel free to check them out and play around with them, they are both in early stages of development and not really all that useful, hopefully I will have pages up for them by the end of the weekend but don’t hold me to anything.
Category: Programming, Projects, gIDE |
1 Comment
February 2, 2008, 5:19 am
Following on from yesterdays post, here is another task which I couldn’t find code for when I did a quick google search. This time around it’s setting the right syntax highlighting when using gtksourceviewmm, this example does use the function from the last post. For reference this code snippet is part of a function for loading a text file, which takes a Glib::ustring called file_name as a parameter.
m_uri = Gnome::Vfs::Uri::create(file_name);
Glib::ustring buf;
if(!read_file(m_uri, &buf))
return false;
// Time to add the data to the sourceview
Glib::RefPtr<gtksourceview::SourceBuffer> buffer = m_text.get_source_buffer();
buffer->begin_not_undoable_action();
buffer->set_text(buf);
buffer->end_not_undoable_action();
// Set the syntax highlighting
Glib::RefPtr<gtksourceview::SourceLanguagesManager> manager = gtksourceview::SourceLanguagesManager::create();
Glib::RefPtr<gtksourceview::SourceLanguage> language = manager->get_language_from_mime_type(m_uri->get_file_info()->get_mime_type());
if(language) {
buffer->set_language(language);
buffer->set_highlight(true);
}
Category: Programming |
Comment
February 1, 2008, 4:30 am
Recently I have being working on a project (which I will post about later) in which I wanted to use GnomeVFSmm the c++ port of GnomeVFS, but when I looked on the web I noticed a distinct lack of examples or tutorials using GnomeVFSmm, in the end I managed to figure it out, but for future reference and others looking for similar code here is a function for reading in a file.
bool read_file(Glib::RefPtr<gnome::Vfs::Uri> uri, Glib::ustring *contents)
{
if(!uri)
return false;
if(!uri->uri_exists())
return false;
try {
Gnome::Vfs::Handle file;
file.open(uri, Gnome::Vfs::OPEN_READ);
Glib::RefPtr<gnome::Vfs::fileinfo> info = file.get_file_info();
char buffer[info->get_size() + 1];
file.read(buffer, info->get_size());
buffer[info->get_size()] = 0;
(*contents) = buffer;
file.close();
} catch (Gnome::Vfs::exception &ex) {
// Raise an exception dialog here
return false;
}
return true;
}
Granted GVFS isn’t too far off but until it’s released this might still be helpful.
Category: Programming |
1 Comment