Re: patch so far...



Hi,

On Fri, 2005-12-30 at 20:57 +0000, Joachim Noreiko wrote:
> Here's a patch of all my changes to the gnome user
> docs so far, as requested by Shaun.
> 
> This patch includes the one I mailed to this list
> about a week ago.
> It concerns 3 sections of the guide, in three files
> * basic skills
> * desktop overview
> * small change to the mouse prefs
> 
> The first two are works in progress, but are fine as
> they stand.
> In particular, I'm not entirely happy with the mouse
> basics section. See the comments I've left in source.
> Images of the mouse pointers are also needed to go
> with this patch.

I've attached a little program I wrote that will create little png's of
all the cursors in the current (cursor) theme.  It creates them in a
directory called "cursor_images" in the directory its run from (creating
it if needed).

The program can be compiled using the command:
gcc -o spit_cursors spit_cursors.c `pkg-config --cflags --libs gtk+-2.0`

and run from the terminal with the command:
$./spit_cursors

Hope this helps
Don

> 
> Joachim
> 
> 
> 		
> ___________________________________________________________ 
> Yahoo! Exclusive Xmas Game, help Santa with his celebrity party - http://santas-christmas-party.yahoo.net/
> _______________________________________________ gnome-doc-list mailing list gnome-doc-list gnome org http://mail.gnome.org/mailman/listinfo/gnome-doc-list
/* A really simple program to find all the possible cursor images for the current theme
 * and dump them out to files in the directory cursor_images.
 *
 * Compile using the command:
 * gcc -o spit_cursors spit_cursors.c `pkg-config --cflags --libs gtk+-2.0`
 */

#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>

char * filenames[] = {	"xcursor.png", "arrow.png", "based_arrow_down.png", "based_arrow_up.png",
			"boat.png", "bogosity.png", "bottom_left.png", "bottom_right.png",
			"bottom_side.png", "bottom_tee.png", "box_spiral.png", "center_ptr.png",
			"circle.png", "clock.png", "coffee_mug.png", "cross.png", "cross_reverse.png",
			"crosshair.png", "diamond_cross.png", "dot.png", "dotbox.png",
			"double_arrow.png", "draft_large.png", "draft_small.png", "draped_box.png",
			"exchange.png", "fleur.png", "gobbler.png", "gumby.png", "hand1.png",
			"hand2.png", "heart.png", "icon.png", "iron_cross.png", "left_ptr.png",
			"left_side.png", "left_tee.png", "leftbutton.png", "ll_angle.png",
			"lr_angle.png", "man.png", "middlebutton.png", "mouse.png", "pencil.png",
			"pirate.png", "plus.png", "question_arrow.png", "right_ptr.png",
			"right_side.png", "right_tee.png", "rightbutton.png", "rtl_logo.png",
			"sailboat.png", "sb_down_arrow.png", "sb_h_double_arrow.png",
			"sb_left_arrow.png", "sb_right_arrow.png", "sb_up_arrow.png",
			"sb_v_double_arrow.png", "shuttle.png", "sizing.png", "spider.png",
			"spraycan.png", "star.png", "target.png", "tcross.png", "top_left_arrow.png",
			"top_left_corner.png", "top_right_corner.png", "top_side.png", "top_tee.png",
			"trek.png", "ul_angle.png", "umbrella.png", "ur_angle.png", "watch.png",
			"xterm.png"
		};

gchar * directory ()
{
	static gchar *dirname = NULL;

	if (!dirname) {
		dirname = g_strdup ("cursor_images");
		if (!g_file_test (dirname, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
	    		mkdir (dirname, 0750);		
	}

	return dirname;
}


void get_image (int number)
{
	GdkCursor* cursor = gdk_cursor_new (number*2);
	gchar * fname = g_strconcat (directory(), "/", filenames[number], NULL);
	GdkPixbuf *pb = gdk_cursor_get_image (cursor);

	if (pb) {
		gdk_pixbuf_save (pb, fname, "png", NULL, NULL);
		gdk_pixbuf_unref (pb);
	}

	gdk_cursor_destroy (cursor);
	g_free (fname);
}


int main (int argc, char **argv)
{
	int i;

	gtk_init(&argc, &argv);

	for (i=0; i<76; i++) { /* 76 possible cursor images, according to gdk */
		get_image (i);
	}

	return 0;
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]