Archive for the 'Programming' Category

Next Entries Next
December 19, 2008, 3:02 pm

Holiday

Today is my last day of work for this year, I have three weeks of holidays to look forward to.  I’m going to see family for Christmas and it is looking increasing likely that I am going to end up at some random lake to catch up with a few friends for new years.  The downside to this is thanks to my current living arrangement it means I’m going to all but drop off the internet for those three weeks, this isn’t a necessarily a bad thing though as it is going to give me a lot of time to work on gIDE.

I was hoping to have the first release of gIDE done before Christmas which is looking increasingly less likely, so much so that I’m not going to bother with it any more.  There isn’t a lot that I have to get done before I’m happy to make a release, these will also be the first things on my list of things I am going to work on during my time off.  In no particular order the features are:

  • Find/Replace
  • Project Properties
  • Generic Build System
  • Document split view

I’m also considering implementing a limited subset of vim commands, though I think I will wait until after this release in the hopes of getting some user feedback on what they think would be the most useful commands to include.

In other news I recently saw The Day the Earth Stood Still.  To be honest I was not that impressed, the movie seemed to trying to get a message across but not succeeding, at times I even felt that the movie wasn’t overly sure what that message should be.  The casting for the movie however was spot on, especially with Keanu Reeves.  Also a couple of days ago I recommended that you go read Pictures of You by Gibson Twist, from there I got linked to another webcomic of his which I enjoyed.  So if you enjoyed Pictures of You you might also want to check out Our Time in Eden.

Tags: , , , ,
Category: gIDE, Me, Movies, Programming, Projects  |  Comment

December 12, 2008, 2:49 pm

Site Upgrade

Today I decided to upgrade this blog to version 2.7 of wordpress, which I managed to screw up royaly.  I somehow managed to accidently delete most of wordpress file including all of the files for the theme and the plugins, thankfully I wasn’t touching the database or shit would have really hit the fan.  So after wasting time and finding everything again it is all up and running, nothing seems to be breaking so I’m quite happy at the moment.  I also finally took the time to enable OpenID for comments, doing this also turned this blog into an OpenID provider as well which is neat because I’ve been meaning to get myself an OpenID for a while.

So far I’m impressed the wordpress 2.7, the work they have done on the admin area is top notch both functionally and aesthetically.  It seems to have a much more professional feel to it than the previous versions did, I’m not sure if this was intentional or not but it is nice.

A quick update on gIDE while I’m at it.  The new add file dialog hit trunk earlier this morning it isn’t quite what I wanted but it is an improvement over what was there.  As I said earlier the remove file dialog was done away with entirely, just using a message dialog seems to be a lot better.  Along with those changes I finally got around to adding a right click pop-up menu to the project browser which allows you to add, remove and soon rename files in the project, I should have done that ages ago but I was lazy.  Hopefully the last of the overhauls will be finished this weekend so I can get back to adding new features.  To round the project off I thought I had better provide a screenshot of the new add file dialog.

gIDE add file dialog

Tags: , , , , , , ,
Category: gIDE, Programming, Projects, The site  |  Comment

December 10, 2008, 4:22 pm

gIDE Update

The new Create project dialog I mentioned earlier this week has hit trunk as of about 5 minutes ago and everything seems to be working fine as always the svn repository is http://mlowen.com/svn/gIDE/trunk.

Before I get back to adding new features to gIDE there are a couple of more overhauls of the current system that I want to do, the parts I want to look at are:

  • Configuration system.
  • Add file dialog.
  • Remove file dialog.

The configuration system doesn’t need much more than some tweaking and at the most is a nights work.  I’m also thinking about doing away entirely with the remove file dialog as it just seems clunky where a right click menu would do the trick.  The add file dialog is the only one that I’m not overly sure how to approach as of yet, originally it was a quick hack to get the functionality in there (much like the create project dialog) with the intent of replacing it later.  Well the time has come to do away with the quick hack but I’m just not sure what the new dialog should look like, all I know is I want something different from what I currently have which can be seen in the screenshots below.

Default add file dialog.

Default add file dialog.

Adding a new file to a subfolder of the project

Adding a new file to a subfolder of the project

As you can see these are pretty bloody horrible, will probably brainstorm tonight and post some design sketches tomorrow or Friday.

Tags: , , , , , , ,
Category: gIDE, Programming, Projects  |  Comment

December 8, 2008, 5:01 pm

Latest gIDE Progress

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:

gIDE with the Create Project Dialog opened.

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: , , , , , ,
Category: gIDE, Programming, Projects  |  Comment

July 1, 2008, 5:39 pm

Reading and Writing files with GIOmm

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 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 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

Projects

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: gIDE, Programming, Projects  |  1 Comment

February 2, 2008, 5:19 am

Syntax higlighting with gtksourceviewmm

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 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 manager = gtksourceview::SourceLanguagesManager::create();
Glib::RefPtr 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

Reading a file in with GnomeVFSmm

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 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 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

Next Entries Next