Archives

Archive for 2010

Dec 9th

Styling pre and code HTML tags

2010
No comments | 1396 views

Styling <pre> and <code> tags can be cumbersome at times, especially when you use them for displaying content with arbitrary line lengths.

Source code of any kind and language is a good example here as it may contain overly long lines. Wrapping them inside <pre> or <code> tags has the potential of "blowing up" your page layout, because the browser will normally not reformat the content of a <pre> or <code> tag (pre stands for preformatted). This is especially annoying in forums or blogs because it will force readers to scroll the entire page horizontally and will generally look fugly.

Nevertheless, code blocks are important for many types of content - posting code examples, log files or anything else that contains pre-formatted textual data and almost any forum, blog or CMS allows for special formatting of code blocks.

Obviously, it is desirable to find a way to avoid these layout problems and there are basically 2 possible solutions:

Read more...

1 Like Like
Tags: ,

Oct 30th

Wiki updated

2010
No comments | 959 views

After quite some time without any updates, I finally found time to take care of my aging Wiki. Because of some troubles (mainly bad performance and some old and no longer maintained extensions acting up), I decided to switch from MediaWiki to PmWiki and I'm loving it. PmWiki's simplicity paired with its powerful feature set is quite impressive, to say so.

The transition went with relative easy (with the help of some perl scripts to convert some of the markup differences between MediaWiki and PmWiki) and most of the pages are already online. Links should be fixed, but some orphans may still be straying around.

At the same time, I'm currently updating the TabSRMM documentation for version 3. Because of the many changes in the plugin, this is a lengthy process and it may take a while until I can finish it. The most important things are already done though.

Because of the different page organization system in PmWiki, some URLs had to change and the direct links in the TabSRMM option page may result in a 404. When possible, I installed redirection pages and I already updated the "Help" links in the plugin.

1 Like Like
Tags: , ,

Sep 30th

Using AGG with buffered paint

2010
No comments | 1557 views

In the last article, I explained how to render to a Windows device context, using the AGG 2d graphics library. As promised, I want to explain how to do it when using the Buffered Paint API, available on Windows Vista or later.

Buffered paint is a set of new APIs allowing an application to perform flicker free painting without the overhead of creating memory device contexts and bitmaps. It is only available on Windows Vista or later and is part of the UxTheme library. Using it will either make your application incompatible with Windows XP or earlier or will require using the GetProcAddress() method on Vista or later while providing a fallback method when the buffered paint API is not available.

Read more...

2 Likes Like
Tags: ,

Sep 24th

Rendering to a device context with AGG (AntiGrain)

2010
No comments | 1824 views

Quite a few years ago, I discovered AntiGrain Geometry, a high-performance, high-quality, platform-independent generic library for rendering 2d vector graphics.

AGG is fast, lightweight, implemented as a set of C++ classes, makes heavy use of templates and is fairly easy to integrate into a project. There is no need to build and link against libraries as you just add the files to your project and make sure you include the necessary headers. Clean and simple.

It can serve as a replacement for GDI+ and usually produces better results at higher speeds. It is also somewhat similar to cairo graphics, but has less features. It is perfect when you need to draw filled or outlined shapes, deal with all kinds of gradients or draw antialiased lines.

Read more...

2 Likes Like
Tags: ,

Sep 23rd

When you are a developer and use WordPress…

2010
1 comment | 2715 views

Every now and then, you stumble over something you did not realize that it exists even though it's so obvious that something like it _must_ exist :)

As a developer, you sometimes need to post source code in your blog. Reading source code can be exciting and rewarding but it can be a pain when the code is not properly formatted. Syntax highlighting is a nice method to improve source code readability and is practically supported by every single development tool that can be used to read or edit code.

It makes sense, because reading highlighted code is a lot easier (and, as a side effect, it also looks better), so naturally, you want this feature to be available when you are frequently posting source code on the web. Read more...

1 Like Like
Tags:

Sep 14th

Updated the Chrome-like tabs style for Firefox 4 / beta

2010
2 comments | 5866 views

Chrome-like tabs in Fx4

I've updated my style which creates a chrome-like tab strip and tweaks some more things for Firefox 4 beta. The original post can be found here. A few changes were necessary to keep up with changes in Firefox 4 itself, especially changes in the drawing of the title bar and the orange app button.

Some minor updates only

Please read the notes before installing it. You'll definitely need a very recent build of Firefox 4 and the style is designed to work best on Vista or 7 with the Aero theme active. Also, it is not intended to be used with a persona theme (a.k.a. lightweight theme), because the tabs are not transparent enough to look good with a persona theme.

Where to get it?

The style is available from userstyles.org.

Original post

This post describes the style in more detail. Most things are still valid with the exception of the combined stop/reload button. This is now a default feature in Firefox 4 and a user style is no longer needed to implement it.

1 Like Like
Tags:

Aug 25th

Miranda 0.9.0 and TabSRMM 3.0 officially released

2010
14 comments | 11716 views

*

After more than one year of development, new versions of the popular instant messenger were officially released on Wednesday, August 25, 2010.

Update: The download links are no longer valid, please refer to this page.

The new version has a number of new features and improvements, especially for users of the Windows 7 operating system, a completely new designed icon theme with support for large icons and many improvements to the standard protocols that come with Miranda. Support for unicode status messages and unicode file names in file transfers are among them, but there is a lot more.

Miranda 0.9 can be downloaded from the official site.

TabSRMM 3.0

To complement the release of Miranda 0.9, new versions of my advanced messaging plugins are also available for download. They have various new features and enhancements compared to TabSRMM 2. You can read about here on the blog or browse the documentation on the Wiki. Downloads are available from the official Miranda addons site for both the 32bit UNICODE and 64bit UNICODE release.

The ANSI version has been discontinued and is no longer available. Support for Windows 9x has been dropped, so there is no longer a need for providing an ANSI build.

1 Like Like

Aug 16th

More on Firefox 4 and Direct2D

2010
No comments | 1410 views

A while ago I wrote about Direct2D and DirectWrite rendering in Firefox 4 and explained how to activate it. Recently, the method to activate D2D has changed somewhat, because the developers decided that it is about time to make D2D the default on platforms that can support it (Windows Vista SP2 or later).

Update: This is now outdated information. Firefox 4 has been released a while ago and it comes with hardware acceleration enabled by default, depending on the capabilities of the operating system and video drivers. Tweaking with about:config options is not really recommended unless you know what you are doing. To check whether hardware accelerated rendering is enabled in your Firefox, open a new tab, type about:support in the URL bar and scroll to the very bottom of the page. The graphics section will tell you what's enabled and what's not.

Around August 15, 2010, the method changed and now works as follows:

  • If mozilla.widget.render-mode is set to -1 (which is the default value for a fresh install), Firefox will automatically activate D2D when available. It will test operating system version and video drivers for DirectX10 support and make sure to run on a supported OS service pack level.
  • If mozilla.widget.render-mode is set to 0 (can be done in about:config - restart required), D2D will be disabled, regardless of OS and driver support.

Other values (like the old value of 6 which activated it) are probably still supported, but they are no longer needed. Should you prefer to disable D2D, because of its remaining issues, simply set mozilla.widget.render-mode to 0.

Update on this

There is now a new visible option to control D2D behavior in recent nightly builds and this option will also be in b5. Options->Advanced->General->Use hardware acceleration when available is what you want to modify. Uncheck it to disable D2D even when your operating system and hardware supports it. Using about:config to control its behavior is no longer necessary.

1 Like Like

Aug 15th

TabSRMM enters beta stage

2010
2 comments | 1663 views

As of August 10, 2010, TabSRMM is now officially in BETA. Miranda 0.9 will go final in the not so far future, so we need a stable plugin.

The version number was pushed to 3.0.1.0 and it is expected that the final release of TabSRMM 3 will be 3.0.2 or something like that. Quite a while ago I changed version numbering to be consistent with Miranda, where only the first three numbers are relevant and official releases never carry the 4th (build) number.

Source code was copied over to the stable branch (SVN repo at: https://miranda.googlecode.com/svn/branches/stable/miranda/plugins/tabsrmm) and if you build from source, you should definitely switch over. Trunk will be unmaintained for a while as the focus is now on fixing bugs and polishing the features added during the 3.x development phase (although all these fixes will, of course, appear in both trunk and stable).

A final 3.x release will be published both on my own and the official Miranda addon download pages. There is no ETA yet, but it will be ready when Miranda 0.9 is. There are no major issues left and the remaining ones are mostly for polishing and fixing minor annoyances.

Like

Aug 15th

Animated tabs in Firefox 4 nightly

2010
1 comment | 3305 views

Another feature "borrowed" from another browser :)

In Google Chrome, when you open or close tabs, they will smoothly slide into or out of view. It's a neat little piece of eye candy and people tend to love it. Consequently, there is an addon that implements animations for opening and closing tabs in Firefox. The author states that he was inspired by a feature planned for Firefox 4 - tab animations.

And indeed, the feature has recently landed on trunk and already works with recent nigthly builds of Firefox 4, but since it is a new and experimental feature, it is disabled by default and there is no option for it. As always, about:config will be more than happy to help :)

Look for browser.tabs.animate and set it to true. If the setting does - for whatever reason - not yet exist in your profile, create a new Boolean value and set it to true. A restart of Firefox is required after changing this setting.

You need to have a very recent nightly version of Firefox 4. If it doesn't work after adding the value in about:config, your version is probably too old. Get a newer one.

One warning though

There is one issue which will result in "ghost tabs" - when you close a tab, it will lose its label, icon and close button, but the tab outline will remain on the tab strip. This happens when you have modified your maximum tab width (here is an article that tells you how to do this) which apparently confuses the animation code. Just make sure to NOT use a modified maximum tab width and all should be fine. The bug is not triggered when only changing the minimum tab width.

1 Like Like