Commit 085eeb9f authored by MEST 1999  Sven Neumann's avatar MEST 1999 Sven Neumann Committed by Sven Neumann
Browse files

Makefile.am removed new file Use a bitmap in the style of the eye instead

Wed Jul  7 20:33:24 MEST 1999  Sven Neumann <sven@gimp.org>

        * Makefile.am
        * pixmaps/locked.xpm: removed
        * pixmaps/locked.xbm: new file
        * app/paths_dialog.c: Use a bitmap in the style of the eye instead
	of the lock pixmap. This could be done more elegantly, but the
        paths_dialog is a mess, sorry.
parent 9df8a5b1
Wed Jul 7 20:33:24 MEST 1999 Sven Neumann <sven@gimp.org>
* Makefile.am
* pixmaps/locked.xpm: removed
* pixmaps/locked.xbm: new file
* app/paths_dialog.c: Use a bitmap in the style of the eye instead of
the lock pixmap. This could be done more elegantly, but the
paths_dialog is a mess, sorry.
1999-07-07 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/gdisplay.c (gdisplay_set_menu_sensitivity): don't make menus
......
......@@ -38,7 +38,7 @@ EXTRA_DIST = \
pixmaps/eye.xbm \
pixmaps/layer.xbm \
pixmaps/linked.xbm \
pixmaps/locked.xpm \
pixmaps/locked.xbm \
pixmaps/lower.xpm \
pixmaps/mask.xbm \
pixmaps/new.xpm \
......
......@@ -64,7 +64,7 @@
#include "pixmaps/penstroke.xpm"
#include "pixmaps/toselection.xpm"
#include "pixmaps/path.xbm"
#include "pixmaps/locked.xpm"
#include "pixmaps/locked.xbm"
#ifndef HAVE_RINT
#define rint(x) floor (x + 0.5)
......@@ -89,7 +89,8 @@ typedef struct {
/* pixmaps for the no preview bitmap */
GdkPixmap * pixmap_normal;
GdkPixmap * pixmap_selected;
GdkPixmap * pixmap_locked;
GdkPixmap * pixmap_locked_normal;
GdkPixmap * pixmap_locked_selected;
/* state information */
gint selsigid;
......@@ -123,23 +124,25 @@ typedef struct {
static gchar * unique_name(GimpImage *,gchar *);
static gint path_widget_preview_events (GtkWidget *, GdkEvent *);
static void paths_dialog_realized (GtkWidget *widget);
static void paths_select_row (GtkWidget *widget,gint row,gint column,GdkEventButton *event,gpointer data);
static void paths_unselect_row (GtkWidget *widget,gint row,gint column,GdkEventButton *event,gpointer data);
static gint paths_list_events (GtkWidget *widget,GdkEvent *event);
static void paths_dialog_map_callback (GtkWidget *w,gpointer client_data);
static void paths_dialog_unmap_callback(GtkWidget *w,gpointer client_data);
static void paths_dialog_destroy_cb (GimpImage *image);
static void paths_update_paths(gpointer data,gint row);
static GSList * pathpoints_copy(GSList *list);
static void pathpoints_free(GSList *list);
static void paths_update_preview(BezierSelect *bezier_sel);
/* static gint path_widget_preview_events (GtkWidget *, GdkEvent *); */
static void paths_dialog_realized (GtkWidget *widget);
static void paths_select_row (GtkWidget *widget, gint row, gint column,
GdkEventButton *event, gpointer data);
static void paths_unselect_row (GtkWidget *widget, gint row, gint column,
GdkEventButton *event, gpointer data);
static gint paths_list_events (GtkWidget *widget,GdkEvent *event);
static void paths_dialog_map_callback (GtkWidget *w,gpointer client_data);
static void paths_dialog_unmap_callback (GtkWidget *w,gpointer client_data);
static void paths_dialog_destroy_cb (GimpImage *image);
static void paths_update_paths (gpointer data,gint row);
static GSList * pathpoints_copy (GSList *list);
static void pathpoints_free (GSList *list);
static void paths_update_preview (BezierSelect *bezier_sel);
static void paths_dialog_preview_extents (void);
static void paths_dialog_new_point_callback (GtkWidget *, gpointer);
static void paths_dialog_add_point_callback (GtkWidget *, gpointer);
static void paths_dialog_new_point_callback (GtkWidget *, gpointer);
static void paths_dialog_add_point_callback (GtkWidget *, gpointer);
static void paths_dialog_delete_point_callback (GtkWidget *, gpointer);
static void paths_dialog_edit_point_callback (GtkWidget *, gpointer);
static void paths_dialog_edit_point_callback (GtkWidget *, gpointer);
static void path_close(PATHP);
#define NEW_PATH_BUTTON 1
......@@ -282,7 +285,7 @@ GtkWidget * paths_dialog_create()
/* gtk_clist_set_column_title(GTK_CLIST(paths_list), 1, _("Path")); */
/* gtk_clist_column_titles_show(GTK_CLIST(paths_list)); */
/* gtk_clist_columns_autosize(GTK_CLIST(paths_list)); */
gtk_clist_set_column_width (GTK_CLIST(paths_list),0,30);
gtk_clist_set_column_width (GTK_CLIST(paths_list),0,locked_width);
gtk_container_add (GTK_CONTAINER (scrolled_win), paths_list);
gtk_clist_set_selection_mode (GTK_CLIST (paths_list), GTK_SELECTION_BROWSE);
......@@ -396,7 +399,7 @@ path_dialog_new(GimpImage *gimage,gint name_seed, gpointer udata)
GString *s = g_string_new (NULL);
gchar *suniq;
g_string_sprintf (s, "path %d",name_seed);
g_string_sprintf (s, "Path %d",name_seed);
suniq = unique_name(gimage,s->str);
if(suniq)
{
......@@ -716,7 +719,6 @@ void paths_add_path(PATHP bzp,gint insrow)
PATHWIDGETP pwidget;
gint row;
gchar *row_data[2];
GdkBitmap *mask;
pwidget = g_new0(PATHWIDGET,1);
......@@ -758,13 +760,18 @@ void paths_add_path(PATHP bzp,gint insrow)
pwidget->paths_pixmap = paths_dialog->pixmap_normal;
}
if(!paths_dialog->pixmap_locked)
if(!paths_dialog->pixmap_locked_normal)
{
paths_dialog->pixmap_locked =
gdk_pixmap_create_from_xpm_d (paths_dialog->vbox->window,
&mask,
&paths_dialog->vbox->style->fg[GTK_STATE_NORMAL],
locked_xpm);
paths_dialog->pixmap_locked_normal =
gdk_pixmap_create_from_data (paths_dialog->vbox->window,
locked_bits, locked_width, locked_height, -1,
&paths_dialog->vbox->style->fg[GTK_STATE_NORMAL],
&paths_dialog->vbox->style->white);
paths_dialog->pixmap_locked_selected =
gdk_pixmap_create_from_data (paths_dialog->vbox->window,
locked_bits, locked_width, locked_height, -1,
&paths_dialog->vbox->style->fg[GTK_STATE_SELECTED],
&paths_dialog->vbox->style->bg[GTK_STATE_SELECTED]);
}
gtk_clist_set_row_height(GTK_CLIST(paths_dialog->paths_list),
......@@ -839,6 +846,7 @@ paths_dialog_preview_extents ()
}
}
/*
static gint
path_widget_preview_events (GtkWidget *widget,
GdkEvent *event)
......@@ -848,7 +856,6 @@ path_widget_preview_events (GtkWidget *widget,
switch (event->type)
{
case GDK_BUTTON_PRESS:
/* Control-button press disables the application of the mask */
bevent = (GdkEventButton *) event;
break;
......@@ -856,14 +863,14 @@ path_widget_preview_events (GtkWidget *widget,
if (preview_size)
{
/* layer_widget_preview_redraw (layer_widget, preview_type); */
layer_widget_preview_redraw (layer_widget, preview_type);
/* gdk_draw_pixmap (widget->window, */
/* widget->style->black_gc, */
/* *pixmap, */
/* 0, 0, 2, 2, */
/* layersD->image_width, */
/* layersD->image_height); */
gdk_draw_pixmap (widget->window,
widget->style->black_gc,
*pixmap,
0, 0, 2, 2,
layersD->image_width,
layersD->image_height);
}
break;
......@@ -874,6 +881,7 @@ path_widget_preview_events (GtkWidget *widget,
return FALSE;
}
*/
static void
paths_select_row(GtkWidget *widget,
......@@ -909,11 +917,18 @@ paths_select_row(GtkWidget *widget,
if(bzp->locked == 0)
{
bzp->locked = 1;
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked,
NULL);
if (paths_dialog->selected_row_num == row)
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked_selected,
NULL);
else
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked_normal,
NULL);
}
else
{
......@@ -950,6 +965,13 @@ paths_select_row(GtkWidget *widget,
paths_dialog->current_path_list->last_selected_row = row;
paths_dialog->been_selected = TRUE;
if(bzp->locked)
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked_selected,
NULL);
bsel = path_to_beziersel(bzp);
gdisp = gdisplays_check_valid(paths_dialog->current_path_list->gdisp,
paths_dialog->gimage);
......@@ -964,18 +986,32 @@ paths_select_row(GtkWidget *widget,
}
static void
paths_unselect_row(GtkWidget *widget,
gint row,
gint column,
GdkEventButton *event,
gpointer data)
paths_unselect_row (GtkWidget *widget,
gint row,
gint column,
GdkEventButton *event,
gpointer data)
{
PATHWIDGETP pwidget;
PATHP bzp;
pwidget = (PATHWIDGETP)gtk_clist_get_row_data(GTK_CLIST(widget),row);
if(!pwidget)
return;
bzp = (PATHP)g_slist_nth_data(paths_dialog->current_path_list->bz_paths,row);
g_return_if_fail(bzp != NULL);
if (column && bzp->locked)
{
gtk_clist_set_pixmap (GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked_normal,
NULL);
}
}
void
......@@ -1111,12 +1147,21 @@ paths_update_paths(gpointer data,gint row)
paths_update_preview(bezier_sel);
beziersel_free(bezier_sel);
if(bzp->locked)
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked,
NULL);
if (bzp->locked)
{
if (paths_dialog->selected_row_num == row)
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked_selected,
NULL);
else
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked_normal,
NULL);
}
}
static void
......
......@@ -64,7 +64,7 @@
#include "pixmaps/penstroke.xpm"
#include "pixmaps/toselection.xpm"
#include "pixmaps/path.xbm"
#include "pixmaps/locked.xpm"
#include "pixmaps/locked.xbm"
#ifndef HAVE_RINT
#define rint(x) floor (x + 0.5)
......@@ -89,7 +89,8 @@ typedef struct {
/* pixmaps for the no preview bitmap */
GdkPixmap * pixmap_normal;
GdkPixmap * pixmap_selected;
GdkPixmap * pixmap_locked;
GdkPixmap * pixmap_locked_normal;
GdkPixmap * pixmap_locked_selected;
/* state information */
gint selsigid;
......@@ -123,23 +124,25 @@ typedef struct {
static gchar * unique_name(GimpImage *,gchar *);
static gint path_widget_preview_events (GtkWidget *, GdkEvent *);
static void paths_dialog_realized (GtkWidget *widget);
static void paths_select_row (GtkWidget *widget,gint row,gint column,GdkEventButton *event,gpointer data);
static void paths_unselect_row (GtkWidget *widget,gint row,gint column,GdkEventButton *event,gpointer data);
static gint paths_list_events (GtkWidget *widget,GdkEvent *event);
static void paths_dialog_map_callback (GtkWidget *w,gpointer client_data);
static void paths_dialog_unmap_callback(GtkWidget *w,gpointer client_data);
static void paths_dialog_destroy_cb (GimpImage *image);
static void paths_update_paths(gpointer data,gint row);
static GSList * pathpoints_copy(GSList *list);
static void pathpoints_free(GSList *list);
static void paths_update_preview(BezierSelect *bezier_sel);
/* static gint path_widget_preview_events (GtkWidget *, GdkEvent *); */
static void paths_dialog_realized (GtkWidget *widget);
static void paths_select_row (GtkWidget *widget, gint row, gint column,
GdkEventButton *event, gpointer data);
static void paths_unselect_row (GtkWidget *widget, gint row, gint column,
GdkEventButton *event, gpointer data);
static gint paths_list_events (GtkWidget *widget,GdkEvent *event);
static void paths_dialog_map_callback (GtkWidget *w,gpointer client_data);
static void paths_dialog_unmap_callback (GtkWidget *w,gpointer client_data);
static void paths_dialog_destroy_cb (GimpImage *image);
static void paths_update_paths (gpointer data,gint row);
static GSList * pathpoints_copy (GSList *list);
static void pathpoints_free (GSList *list);
static void paths_update_preview (BezierSelect *bezier_sel);
static void paths_dialog_preview_extents (void);
static void paths_dialog_new_point_callback (GtkWidget *, gpointer);
static void paths_dialog_add_point_callback (GtkWidget *, gpointer);
static void paths_dialog_new_point_callback (GtkWidget *, gpointer);
static void paths_dialog_add_point_callback (GtkWidget *, gpointer);
static void paths_dialog_delete_point_callback (GtkWidget *, gpointer);
static void paths_dialog_edit_point_callback (GtkWidget *, gpointer);
static void paths_dialog_edit_point_callback (GtkWidget *, gpointer);
static void path_close(PATHP);
#define NEW_PATH_BUTTON 1
......@@ -282,7 +285,7 @@ GtkWidget * paths_dialog_create()
/* gtk_clist_set_column_title(GTK_CLIST(paths_list), 1, _("Path")); */
/* gtk_clist_column_titles_show(GTK_CLIST(paths_list)); */
/* gtk_clist_columns_autosize(GTK_CLIST(paths_list)); */
gtk_clist_set_column_width (GTK_CLIST(paths_list),0,30);
gtk_clist_set_column_width (GTK_CLIST(paths_list),0,locked_width);
gtk_container_add (GTK_CONTAINER (scrolled_win), paths_list);
gtk_clist_set_selection_mode (GTK_CLIST (paths_list), GTK_SELECTION_BROWSE);
......@@ -396,7 +399,7 @@ path_dialog_new(GimpImage *gimage,gint name_seed, gpointer udata)
GString *s = g_string_new (NULL);
gchar *suniq;
g_string_sprintf (s, "path %d",name_seed);
g_string_sprintf (s, "Path %d",name_seed);
suniq = unique_name(gimage,s->str);
if(suniq)
{
......@@ -716,7 +719,6 @@ void paths_add_path(PATHP bzp,gint insrow)
PATHWIDGETP pwidget;
gint row;
gchar *row_data[2];
GdkBitmap *mask;
pwidget = g_new0(PATHWIDGET,1);
......@@ -758,13 +760,18 @@ void paths_add_path(PATHP bzp,gint insrow)
pwidget->paths_pixmap = paths_dialog->pixmap_normal;
}
if(!paths_dialog->pixmap_locked)
if(!paths_dialog->pixmap_locked_normal)
{
paths_dialog->pixmap_locked =
gdk_pixmap_create_from_xpm_d (paths_dialog->vbox->window,
&mask,
&paths_dialog->vbox->style->fg[GTK_STATE_NORMAL],
locked_xpm);
paths_dialog->pixmap_locked_normal =
gdk_pixmap_create_from_data (paths_dialog->vbox->window,
locked_bits, locked_width, locked_height, -1,
&paths_dialog->vbox->style->fg[GTK_STATE_NORMAL],
&paths_dialog->vbox->style->white);
paths_dialog->pixmap_locked_selected =
gdk_pixmap_create_from_data (paths_dialog->vbox->window,
locked_bits, locked_width, locked_height, -1,
&paths_dialog->vbox->style->fg[GTK_STATE_SELECTED],
&paths_dialog->vbox->style->bg[GTK_STATE_SELECTED]);
}
gtk_clist_set_row_height(GTK_CLIST(paths_dialog->paths_list),
......@@ -839,6 +846,7 @@ paths_dialog_preview_extents ()
}
}
/*
static gint
path_widget_preview_events (GtkWidget *widget,
GdkEvent *event)
......@@ -848,7 +856,6 @@ path_widget_preview_events (GtkWidget *widget,
switch (event->type)
{
case GDK_BUTTON_PRESS:
/* Control-button press disables the application of the mask */
bevent = (GdkEventButton *) event;
break;
......@@ -856,14 +863,14 @@ path_widget_preview_events (GtkWidget *widget,
if (preview_size)
{
/* layer_widget_preview_redraw (layer_widget, preview_type); */
layer_widget_preview_redraw (layer_widget, preview_type);
/* gdk_draw_pixmap (widget->window, */
/* widget->style->black_gc, */
/* *pixmap, */
/* 0, 0, 2, 2, */
/* layersD->image_width, */
/* layersD->image_height); */
gdk_draw_pixmap (widget->window,
widget->style->black_gc,
*pixmap,
0, 0, 2, 2,
layersD->image_width,
layersD->image_height);
}
break;
......@@ -874,6 +881,7 @@ path_widget_preview_events (GtkWidget *widget,
return FALSE;
}
*/
static void
paths_select_row(GtkWidget *widget,
......@@ -909,11 +917,18 @@ paths_select_row(GtkWidget *widget,
if(bzp->locked == 0)
{
bzp->locked = 1;
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked,
NULL);
if (paths_dialog->selected_row_num == row)
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked_selected,
NULL);
else
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked_normal,
NULL);
}
else
{
......@@ -950,6 +965,13 @@ paths_select_row(GtkWidget *widget,
paths_dialog->current_path_list->last_selected_row = row;
paths_dialog->been_selected = TRUE;
if(bzp->locked)
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked_selected,
NULL);
bsel = path_to_beziersel(bzp);
gdisp = gdisplays_check_valid(paths_dialog->current_path_list->gdisp,
paths_dialog->gimage);
......@@ -964,18 +986,32 @@ paths_select_row(GtkWidget *widget,
}
static void
paths_unselect_row(GtkWidget *widget,
gint row,
gint column,
GdkEventButton *event,
gpointer data)
paths_unselect_row (GtkWidget *widget,
gint row,
gint column,
GdkEventButton *event,
gpointer data)
{
PATHWIDGETP pwidget;
PATHP bzp;
pwidget = (PATHWIDGETP)gtk_clist_get_row_data(GTK_CLIST(widget),row);
if(!pwidget)
return;
bzp = (PATHP)g_slist_nth_data(paths_dialog->current_path_list->bz_paths,row);
g_return_if_fail(bzp != NULL);
if (column && bzp->locked)
{
gtk_clist_set_pixmap (GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked_normal,
NULL);
}
}
void
......@@ -1111,12 +1147,21 @@ paths_update_paths(gpointer data,gint row)
paths_update_preview(bezier_sel);
beziersel_free(bezier_sel);
if(bzp->locked)
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked,
NULL);
if (bzp->locked)
{
if (paths_dialog->selected_row_num == row)
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked_selected,
NULL);
else
gtk_clist_set_pixmap(GTK_CLIST(paths_dialog->paths_list),
row,
0,
paths_dialog->pixmap_locked_normal,
NULL);
}
}
static void
......
/* Made with Gimp */
#define locked_width 20
#define locked_height 20
static char locked_bits[] = {
0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0xc0, 0x3f, 0x00, 0xe0, 0x70, 0x00,
0x60, 0x60, 0x00, 0x30, 0xc0, 0x00, 0x30, 0xc0, 0x00, 0xf8, 0xff, 0x01,
0xf8, 0xff, 0x01, 0x18, 0x80, 0x01, 0x18, 0x86, 0x01, 0x18, 0x8f, 0x01,
0x18, 0x8f, 0x01, 0x18, 0x86, 0x01, 0x18, 0x86, 0x01, 0x18, 0x86, 0x01,
0x18, 0x80, 0x01, 0xf8, 0xff, 0x01, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00 };
/* XPM */
static char * locked_xpm[] = {
"28 32 193 2",
" c None",
". c #FFFFFF",
"+ c #FDFDFD",
"@ c #FAFAFA",
"# c #F8F8F8",
"$ c #F7F7F7",
"% c #F9F9F9",
"& c #FBFBFB",
"* c #FEFEFE",
"= c #FCFCFC",
"- c #E3E3E3",
"; c #C1C1C1",
"> c #A1A1A1",
", c #9D9D9D",
"' c #B1B1B1",
") c #D2D2D2",
"! c #F4F4F4",
"~ c #F3F3F2",
"{ c #D8D8D8",
"] c #989898",
"^ c #666666",
"/ c #4D4D4D",
"( c #404040",
"_ c #444444",
": c #464646",
"< c #565656",
"[ c #7A7A7A",
"} c #B4B4B4",
"| c #F6F6F6",
"1 c #F6F6F5",
"2 c #F2F2F0",
"3 c #C6C6C6",
"4 c #6D6D6D",
"5 c #4B4B4B",
"6 c #707070",
"7 c #9E9E9E",
"8 c #ABABAB",
"9 c #858585",
"0 c #5A5A5A",
"a c #434343",
"b c #545454",
"c c #949494",
"d c #F3F3F3",
"e c #D1D1D1",
"f c #696969",
"g c #505050",
"h c #747474",
"i c #9C9C9C",
"j c #575757",
"k c #F7F7F6",
"l c #8A8A8A",
"m c #494949",
"n c #777777",
"o c #E6E6E6",
"p c #AEAEAE",
"q c #585858",
"r c #F9F9F8",
"s c #CBCBCB",
"t c #535353",
"u c #5D5D5D",
"v c #C9C9C9",
"w c #808080",
"x c #474747",
"y c #8B8B8B",
"z c #FDFDFB",
"A c #B0B0B0",
"B c #3E3E3E",
"C c #767676",
"D c #BFBFBF",
"E c #5F5F5F",
"F c #EEEEEE",
"G c #9B9B9B",
"H c #525252",
"I c #959595",
"J c #5B5B5B",
"K c #DEDEDF",
"L c #FFFFFE",
"M c #E0E0E0",
"N c #797979",
"O c #4C4C4C",
"P c #848484",
"Q c #E1E1E1",
"R c #DDDDDD",
"S c #DCDCDC",
"T c #DEDEDE",
"U c #EAEAEA",
"V c #D0D0D0",
"W c #4F4F4F",
"X c #B9B9BA",
"Y c #6E6E6E",
"Z c #2F2F2F",
"` c #373737",
" . c #343434",