Commit f02a8b61 authored by Maurits Rijk's avatar Maurits Rijk

HIG-ified, replaced deprecated widget GtkCList by GtkTreeModel/View (also

* plug-ins/imagemap/imap_*.[ch]: (partly) HIG-ified, replaced
  deprecated widget GtkCList by GtkTreeModel/View (also fixes #136893),
  use file choosers instead of file selectors, minor clean-up.
parent 1f786473
2004-05-20 Maurits Rijk <m.rijk@chello.nl>
* plug-ins/imagemap/imap_*.[ch]: (partly) HIG-ified, replaced
deprecated widget GtkCList by GtkTreeModel/View (also fixes #136893),
use file choosers instead of file selectors, minor clean-up.
2004-05-20 Sven Neumann <sven@gimp.org>
* plug-ins/Lighting/lighting_ui.c
......
......@@ -3,7 +3,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-2003 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2004 Maurits Rijk m.rijk@chello.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -39,10 +39,10 @@ do_about_dialog(void)
default_dialog_hide_cancel_button(dialog);
default_dialog_hide_apply_button(dialog);
default_dialog_hide_help_button(dialog);
default_dialog_set_label(dialog, _("Imagemap plug-in 2.0"));
default_dialog_set_label(dialog, _("Imagemap plug-in 2.2"));
default_dialog_set_label(
dialog, _("Copyright(c) 1999-2003 by Maurits Rijk"));
default_dialog_set_label(dialog, _("lpeek.mrijk@consunet.nl"));
dialog, _("Copyright(c) 1999-2004 by Maurits Rijk"));
default_dialog_set_label(dialog, _("m.rijk@chello.nl"));
default_dialog_set_label(
dialog, _(" Released under the GNU General Public License "));
}
......
......@@ -3,7 +3,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-1999 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2004 Maurits Rijk m.rijk@chello.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -3,7 +3,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-2002 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2004 Maurits Rijk m.rijk@chello.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -59,23 +59,28 @@ static void
browse_cb (GtkWidget *widget,
BrowseWidget_t *browse)
{
if (! browse->file_selection)
if (!browse->file_selection)
{
GtkWidget *dialog;
dialog = browse->file_selection = gtk_file_selection_new (browse->name);
gtk_window_set_transient_for (GTK_WINDOW (dialog),
GTK_WINDOW (gtk_widget_get_toplevel (widget)));
g_signal_connect (dialog, "delete_event",
G_CALLBACK (gtk_true),
NULL);
dialog = browse->file_selection =
gtk_file_chooser_dialog_new (browse->name,
GTK_WINDOW (gtk_widget_get_toplevel (widget)),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
g_signal_connect (dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&dialog);
g_signal_connect (dialog, "response",
G_CALLBACK (select_cb),
browse);
}
gtk_window_present (GTK_WINDOW (browse->file_selection));
}
......@@ -104,27 +109,27 @@ browse_widget_new(const gchar *name)
browse->name = name;
browse->filter = NULL;
browse->hbox = gtk_hbox_new(FALSE, 1);
gtk_widget_show(browse->hbox);
browse->hbox = gtk_hbox_new (FALSE, 1);
gtk_widget_show (browse->hbox);
browse->file = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(browse->hbox), browse->file, TRUE, TRUE, 0);
gtk_drag_dest_set(browse->file, GTK_DEST_DEFAULT_ALL, target_table,
2, GDK_ACTION_COPY);
g_signal_connect(browse->file, "drag_data_received",
G_CALLBACK(handle_drop), NULL);
browse->file = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX(browse->hbox), browse->file, TRUE, TRUE, 0);
gtk_drag_dest_set (browse->file, GTK_DEST_DEFAULT_ALL, target_table,
2, GDK_ACTION_COPY);
g_signal_connect (browse->file, "drag_data_received",
G_CALLBACK(handle_drop), NULL);
gtk_widget_show(browse->file);
gtk_widget_show (browse->file);
browse->button = button = gtk_button_new();
icon = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON);
gtk_container_add(GTK_CONTAINER(button), icon);
gtk_widget_show(icon);
browse->button = button = gtk_button_new ();
icon = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON);
gtk_container_add (GTK_CONTAINER (button), icon);
gtk_widget_show (icon);
gtk_box_pack_end(GTK_BOX(browse->hbox), button, FALSE, FALSE, 0);
g_signal_connect(button, "clicked",
G_CALLBACK(browse_cb), (gpointer) browse);
gtk_widget_show(button);
gtk_box_pack_end(GTK_BOX (browse->hbox), button, FALSE, FALSE, 0);
g_signal_connect (button, "clicked",
G_CALLBACK(browse_cb), (gpointer) browse);
gtk_widget_show (button);
return browse;
}
......@@ -132,7 +137,7 @@ browse_widget_new(const gchar *name)
void
browse_widget_set_filename(BrowseWidget_t *browse, const gchar *filename)
{
gtk_entry_set_text(GTK_ENTRY(browse->file), filename);
gtk_entry_set_text (GTK_ENTRY (browse->file), filename);
}
void
......
/* A Bison parser, made by GNU Bison 1.875a. */
/* A Bison parser, made from imap_cern.y
by GNU bison 1.35. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#define YYBISON 1 /* Identify Bison output. */
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* Written by Richard Stallman by simplifying the original so called
``semantic'' parser. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
There are some unavoidable exceptions within include files to
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
/* Identify Bison output. */
#define YYBISON 1
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Pure parsers. */
#define YYPURE 0
/* Using locations. */
#define YYLSP_NEEDED 0
/* If NAME_PREFIX is specified substitute the variables and functions
names. */
#define yyparse cern_parse
#define yylex cern_lex
#define yylex cern_lex
#define yyerror cern_error
#define yylval cern_lval
#define yychar cern_char
#define yylval cern_lval
#define yychar cern_char
#define yydebug cern_debug
#define yynerrs cern_nerrs
# define RECTANGLE 257
# define POLYGON 258
# define CIRCLE 259
# define DEFAULT 260
# define AUTHOR 261
# define DESCRIPTION 262
# define BEGIN_COMMENT 263
# define FLOAT 264
# define COMMENT 265
# define LINK 266
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
RECTANGLE = 258,
POLYGON = 259,
CIRCLE = 260,
DEFAULT = 261,
AUTHOR = 262,
DESCRIPTION = 263,
BEGIN_COMMENT = 264,
FLOAT = 265,
COMMENT = 266,
LINK = 267
};
#endif
#define RECTANGLE 258
#define POLYGON 259
#define CIRCLE 260
#define DEFAULT 261
#define AUTHOR 262
#define DESCRIPTION 263
#define BEGIN_COMMENT 264
#define FLOAT 265
#define COMMENT 266
#define LINK 267
/* Copy the first part of user declarations. */
#line 1 "imap_cern.y"
/*
......@@ -133,43 +65,217 @@ static void cern_error(char* s);
static Object_t *current_object;
/* Enabling traces. */
#line 45 "imap_cern.y"
#ifndef YYSTYPE
typedef union {
int val;
double value;
char id[256];
} yystype;
# define YYSTYPE yystype
# define YYSTYPE_IS_TRIVIAL 1
#endif
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#define YYFINAL 51
#define YYFLAG -32768
#define YYNTBASE 16
/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
#define YYTRANSLATE(x) ((unsigned)(x) <= 266 ? yytranslate[x] : 30)
/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
static const char yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
13, 15, 2, 2, 14, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12
};
#if YYDEBUG
static const short yyprhs[] =
{
0, 0, 2, 3, 6, 8, 10, 12, 14, 16,
19, 32, 41, 42, 47, 48, 51, 57, 59, 61,
63, 66, 69
};
static const short yyrhs[] =
{
17, 0, 0, 17, 18, 0, 19, 0, 20, 0,
21, 0, 22, 0, 26, 0, 6, 12, 0, 3,
13, 10, 14, 10, 15, 13, 10, 14, 10, 15,
12, 0, 5, 13, 10, 14, 10, 15, 10, 12,
0, 0, 4, 23, 24, 12, 0, 0, 24, 25,
0, 13, 10, 14, 10, 15, 0, 28, 0, 29,
0, 27, 0, 9, 11, 0, 7, 11, 0, 8,
11, 0
};
#endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 45 "imap_cern.y"
typedef union YYSTYPE {
int val;
double value;
char id[256];
} YYSTYPE;
/* Line 191 of yacc.c. */
#line 159 "y.tab.c"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#if YYDEBUG
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const short yyrline[] =
{
0, 58, 61, 62, 65, 66, 67, 68, 69, 72,
80, 92, 103, 103, 110, 111, 116, 125, 126, 127,
130, 135, 143
};
#endif
#if (YYDEBUG) || defined YYERROR_VERBOSE
/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
static const char *const yytname[] =
{
"$", "error", "$undefined.", "RECTANGLE", "POLYGON", "CIRCLE", "DEFAULT",
"AUTHOR", "DESCRIPTION", "BEGIN_COMMENT", "FLOAT", "COMMENT", "LINK",
"'('", "','", "')'", "cern_file", "area_list", "area", "default",
"rectangle", "circle", "polygon", "@1", "coord_list", "coord",
"comment_line", "real_comment", "author_line", "description_line", 0
};
#endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const short yyr1[] =
{
0, 16, 17, 17, 18, 18, 18, 18, 18, 19,
20, 21, 23, 22, 24, 24, 25, 26, 26, 26,
27, 28, 29
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const short yyr2[] =
{
0, 1, 0, 2, 1, 1, 1, 1, 1, 2,
12, 8, 0, 4, 0, 2, 5, 1, 1, 1,
2, 2, 2
};
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
doesn't specify something else to do. Zero means the default is an
error. */
static const short yydefact[] =
{
2, 1, 0, 12, 0, 0, 0, 0, 0, 3,
4, 5, 6, 7, 8, 19, 17, 18, 0, 14,
0, 9, 21, 22, 20, 0, 0, 0, 0, 13,
0, 15, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 16, 11, 0, 0, 0, 10, 0,
0, 0
};
static const short yydefgoto[] =
{
49, 1, 9, 10, 11, 12, 13, 19, 26, 31,
14, 15, 16, 17
};
static const short yypact[] =
{
-32768, -3, -4,-32768, -2, 0, -1, 2, 3,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 5,-32768,
6,-32768,-32768,-32768,-32768, 4, -5, 7, 9,-32768,
10,-32768, 12, 8, 11, 13, 14, 16, 19, 20,
17, 21, 22,-32768,-32768, 24, 23, 25,-32768, 31,
35,-32768
};
static const short yypgoto[] =
{
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768
};
#define YYLAST 38
/* Copy the second part of user declarations. */
static const short yytable[] =
{
2, 3, 4, 5, 6, 7, 8, 29, 30, 18,
22, 20, 21, 23, 24, 25, 27, 0, 28, 33,
34, 32, 35, 36, 0, 37, 40, 39, 38, 41,
42, 50, 43, 44, 46, 51, 45, 48, 47
};
/* Line 214 of yacc.c. */
#line 171 "y.tab.c"
static const short yycheck[] =
{
3, 4, 5, 6, 7, 8, 9, 12, 13, 13,
11, 13, 12, 11, 11, 10, 10, -1, 14, 10,
10, 14, 10, 15, -1, 14, 10, 13, 15, 10,
10, 0, 15, 12, 10, 0, 14, 12, 15
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/share/bison/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
#if ! defined (yyoverflow) || YYERROR_VERBOSE
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* This is the parser code that is written into each bison parser when
the %semantic_parser declaration is not specified in the grammar.
It was written by Richard Stallman by simplifying the hairy parser
used when %semantic_parser is specified. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
There are some unavoidable exceptions within include files to
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
/* The parser invokes alloca or malloc; define the necessary symbols. */
......@@ -198,28 +304,37 @@ typedef union YYSTYPE {
# define YYSTACK_ALLOC malloc
# define YYSTACK_FREE free
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
#if (! defined (yyoverflow) \
&& (! defined (__cplusplus) \
|| (YYSTYPE_IS_TRIVIAL)))
|| (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
short yyss;
YYSTYPE yyvs;
};
# if YYLSP_NEEDED
YYLTYPE yyls;
# endif
};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
# if YYLSP_NEEDED
# define YYSTACK_BYTES(N) \
((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ 2 * YYSTACK_GAP_MAX)
# else
# define YYSTACK_BYTES(N) \
((N) * (sizeof (short) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
+ YYSTACK_GAP_MAX)
# endif
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
......@@ -250,216 +365,13 @@ union yyalloc
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)
#endif
#if defined (__STDC__) || defined (__cplusplus)
typedef signed char yysigned_char;
#else
typedef short yysigned_char;
#endif
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 3
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 39
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 16
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 15
/* YYNRULES -- Number of rules. */
#define YYNRULES 23
/* YYNRULES -- Number of states. */
#define YYNSTATES 51
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 267
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const unsigned char yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
13, 15, 2, 2, 14, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12
};
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
static const unsigned char yyprhs[] =
{
0, 0, 3, 5, 6, 9, 11, 13, 15, 17,
19, 22, 35, 44, 45, 50, 51, 54, 60, 62,
64, 66, 69, 72
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yysigned_char yyrhs[] =
{