Resource Editor for Linux/X11


Main Window

With the Resource Editor you should make any bitmaps and cursors to your X11 programs.

Using the ResEdit

Resource editor is containing two sub window. Left is the working area, and Right is a target or source window for any copy/move functions.
Between the windows you find two arrow to copy a resource.

Menu line

Resource A
Resource B
Over a list window you'll find the resource file name.
Before an item you can find a letter an a number. Letter b is a bitmap, and letter c is a cursor.

In the QT Widget programming you can use DIB bitmaps easily.
Cursor files are double bitmaps. One array for the cursor body and other for mask.
Cursor bitmaps are 1 bit/pixel format arrays. All cursors' size are 32x32.
Here is a sample cursor and the file.

// CURSOR crArrow
#define crArrow_width 32
#define crArrow_height 32
#define crArrow_x 0
#define crArrow_y 0
static unsigned char crArrow_m[] = {
0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00,
0xff, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00,
0xff, 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0xff, 0x00, 0x00, 0x00, 0xf7, 0x01, 0x00, 0x00,
0xe3, 0x01, 0x00, 0x00, 0xc1, 0x03, 0x00, 0x00,
0xc0, 0x03, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00,
0x80, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static unsigned char crArrow_b[] = {
0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
0x21, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00,
0x81, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
0x01, 0x02, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00,
0x81, 0x0f, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00,
0x99, 0x00, 0x00, 0x00, 0x35, 0x01, 0x00, 0x00,
0x23, 0x01, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00,
0x40, 0x02, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00,
0x80, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

The bitmap resources are simple byte-arrays, that contains natural device independent bitmap files encoded by HEX-ASCII. This arrays are ready to use to C/C++ programming.
Here is a simple bitmap and the array, like the ResEdit format.

// BITMAP bmKey_A
uchar bmKey_A[]=
{
0x42,0x4d,0x68,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x28,0x00,
0x00,0x00,0x14,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x80,
0x00,0x00,0x00,0x80,0x80,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x80,
0x00,0x00,0x80,0x80,0x80,0x00,0xc0,0xc0,0xc0,0x00,0x00,0x00,0xff,0x00,0x00,0xff,
0x00,0x00,0x00,0xff,0xff,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0xff,
0x00,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xf7,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
0x77,0x77,0xff,0x00,0xff,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0xff,0x00,
0xff,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x77,0xff,0x00,0xff,0x88,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x77,0xff,0x00,0xff,0x88,0x00,0x08,0x88,0x88,0x80,0x00,
0x88,0x77,0xff,0x00,0xff,0x88,0x80,0x08,0x88,0x88,0x80,0x08,0x88,0x77,0xff,0x00,
0xff,0x88,0x80,0x00,0x88,0x88,0x00,0x08,0x88,0x77,0xff,0x00,0xff,0x88,0x88,0x00,
0x88,0x88,0x00,0x88,0x88,0x77,0xff,0x00,0xff,0x88,0x88,0x00,0x00,0x00,0x00,0x88,
0x88,0x77,0xff,0x00,0xff,0x88,0x88,0x80,0x08,0x80,0x08,0x88,0x88,0x77,0xff,0x00,
0xff,0x88,0x88,0x80,0x08,0x80,0x08,0x88,0x88,0x77,0xff,0x00,0xff,0x88,0x88,0x80,
0x08,0x80,0x08,0x88,0x88,0x77,0xff,0x00,0xff,0x88,0x88,0x88,0x00,0x00,0x88,0x88,
0x88,0x77,0xff,0x00,0xff,0x88,0x88,0x88,0x00,0x00,0x88,0x88,0x88,0x77,0xff,0x00,
0xff,0x88,0x88,0x88,0x80,0x08,0x88,0x88,0x88,0x77,0xff,0x00,0xff,0x88,0x88,0x88,
0x88,0x88,0x88,0x88,0x88,0x77,0xff,0x00,0xff,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
0x88,0x77,0xff,0x00,0xff,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x77,0xff,0x00,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0x00,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
};


Cursor Editor

The Cursor Editor is a simple bit-mask editor, like bitmap in the X systems. Parts of the program window:

The most usable functions placed in the upper toolbar: You can use the left toolbar to any drawing functions: In top of right side of the window, placed the colour index buttons. One button for left mouse button and the other for right mouse button. Behind this buttons placed the colour palette (green = transparency, white and black for the cursor shape).
In the cursor-shape area, you can place pixels or shapes with left or right mouse buttons.
With the Ctrl button you can place hot-spot of the cursor.
In the File menu, you can import any Windows 3.x cursors.

Bitmap Editor

The Bitmap Editor is a picture editor.
Maximum allowed size is 95X95 pixel and maximum colours is 16 or 256.
Parts of the program window:

The most usable functions placed in the upper toolbar: You can use the left toolbar to any drawing functions: You can import and export any Windows 3.x or OS/2 device independent bitmaps.

Colour Mixing

In the colour chooser area on any colours you'll get a mixer dialog. With the left mouse you must press the Alt or Ctrl key.
With the Ctrl you'll get an HSV (Hule - Saturation - Value) system mixer, with the Alt key, you'll get an RGB (Red - Green - Blue) mixer.


[back]

This page made by: Zsolt Borka