mirror of https://github.com/GNOME/gimp.git
plug-ins: imagemap, tabs to spaces
This commit is contained in:
parent
8f294661b2
commit
e012caf1a3
|
@ -66,14 +66,14 @@ browse_cb (GtkWidget *widget,
|
|||
GtkWidget *dialog;
|
||||
|
||||
dialog = browse->file_chooser =
|
||||
gtk_file_chooser_dialog_new (browse->name,
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (widget)),
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
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,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
|
||||
GTK_RESPONSE_OK,
|
||||
|
@ -83,8 +83,8 @@ browse_cb (GtkWidget *widget,
|
|||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
|
||||
|
||||
g_signal_connect (dialog, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&dialog);
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&dialog);
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (select_cb),
|
||||
browse);
|
||||
|
@ -94,7 +94,7 @@ browse_cb (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
handle_drop(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
|
||||
GtkSelectionData *data, guint info, guint time)
|
||||
GtkSelectionData *data, guint info, guint time)
|
||||
{
|
||||
gboolean success = FALSE;
|
||||
|
||||
|
@ -130,9 +130,9 @@ browse_widget_new (const gchar *name)
|
|||
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);
|
||||
2, GDK_ACTION_COPY);
|
||||
g_signal_connect (browse->file, "drag-data-received",
|
||||
G_CALLBACK(handle_drop), NULL);
|
||||
G_CALLBACK(handle_drop), NULL);
|
||||
|
||||
gtk_widget_show (browse->file);
|
||||
|
||||
|
@ -143,7 +143,7 @@ browse_widget_new (const gchar *name)
|
|||
|
||||
gtk_box_pack_end(GTK_BOX (browse->hbox), button, FALSE, FALSE, 0);
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK(browse_cb), (gpointer) browse);
|
||||
G_CALLBACK(browse_cb), (gpointer) browse);
|
||||
gtk_widget_show (button);
|
||||
|
||||
return browse;
|
||||
|
@ -157,7 +157,7 @@ browse_widget_set_filename(BrowseWidget_t *browse, const gchar *filename)
|
|||
|
||||
void
|
||||
browse_widget_set_filter(BrowseWidget_t *browse, BrowseFilter_t filter,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
browse->filter = filter;
|
||||
browse->filter_data = data;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -176,7 +176,7 @@ typedef union YYSTYPE
|
|||
}
|
||||
/* Line 187 of yacc.c. */
|
||||
#line 179 "y.tab.c"
|
||||
YYSTYPE;
|
||||
YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
|
@ -320,7 +320,7 @@ YYID (i)
|
|||
# endif
|
||||
# if (defined __cplusplus && ! defined _STDLIB_H \
|
||||
&& ! ((defined YYMALLOC || defined malloc) \
|
||||
&& (defined YYFREE || defined free)))
|
||||
&& (defined YYFREE || defined free)))
|
||||
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# ifndef _STDLIB_H
|
||||
# define _STDLIB_H 1
|
||||
|
@ -346,7 +346,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
|
|||
|
||||
#if (! defined yyoverflow \
|
||||
&& (! defined __cplusplus \
|
||||
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
|
||||
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
|
||||
|
||||
/* A type that is properly aligned for any stack member. */
|
||||
union yyalloc
|
||||
|
@ -371,13 +371,13 @@ union yyalloc
|
|||
# define YYCOPY(To, From, Count) \
|
||||
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
|
||||
# else
|
||||
# define YYCOPY(To, From, Count) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yyi; \
|
||||
for (yyi = 0; yyi < (Count); yyi++) \
|
||||
(To)[yyi] = (From)[yyi]; \
|
||||
} \
|
||||
# define YYCOPY(To, From, Count) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yyi; \
|
||||
for (yyi = 0; yyi < (Count); yyi++) \
|
||||
(To)[yyi] = (From)[yyi]; \
|
||||
} \
|
||||
while (YYID (0))
|
||||
# endif
|
||||
# endif
|
||||
|
@ -387,15 +387,15 @@ union yyalloc
|
|||
elements in the stack, and YYPTR gives the new location of the
|
||||
stack. Advance YYPTR to a properly aligned location for the next
|
||||
stack. */
|
||||
# define YYSTACK_RELOCATE(Stack) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yynewbytes; \
|
||||
YYCOPY (&yyptr->Stack, Stack, yysize); \
|
||||
Stack = &yyptr->Stack; \
|
||||
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
|
||||
yyptr += yynewbytes / sizeof (*yyptr); \
|
||||
} \
|
||||
# define YYSTACK_RELOCATE(Stack) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yynewbytes; \
|
||||
YYCOPY (&yyptr->Stack, Stack, yysize); \
|
||||
Stack = &yyptr->Stack; \
|
||||
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
|
||||
yyptr += yynewbytes / sizeof (*yyptr); \
|
||||
} \
|
||||
while (YYID (0))
|
||||
|
||||
#endif
|
||||
|
@ -418,7 +418,7 @@ union yyalloc
|
|||
#define YYUNDEFTOK 2
|
||||
#define YYMAXUTOK 267
|
||||
|
||||
#define YYTRANSLATE(YYX) \
|
||||
#define YYTRANSLATE(YYX) \
|
||||
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
||||
|
||||
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
|
||||
|
@ -597,44 +597,44 @@ static const yytype_uint8 yystos[] =
|
|||
12
|
||||
};
|
||||
|
||||
#define yyerrok (yyerrstatus = 0)
|
||||
#define yyclearin (yychar = YYEMPTY)
|
||||
#define YYEMPTY (-2)
|
||||
#define YYEOF 0
|
||||
#define yyerrok (yyerrstatus = 0)
|
||||
#define yyclearin (yychar = YYEMPTY)
|
||||
#define YYEMPTY (-2)
|
||||
#define YYEOF 0
|
||||
|
||||
#define YYACCEPT goto yyacceptlab
|
||||
#define YYABORT goto yyabortlab
|
||||
#define YYERROR goto yyerrorlab
|
||||
#define YYACCEPT goto yyacceptlab
|
||||
#define YYABORT goto yyabortlab
|
||||
#define YYERROR goto yyerrorlab
|
||||
|
||||
|
||||
/* Like YYERROR except do call yyerror. This remains here temporarily
|
||||
to ease the transition to the new meaning of YYERROR, for GCC.
|
||||
Once GCC version 2 has supplanted version 1, this can go. */
|
||||
|
||||
#define YYFAIL goto yyerrlab
|
||||
#define YYFAIL goto yyerrlab
|
||||
|
||||
#define YYRECOVERING() (!!yyerrstatus)
|
||||
|
||||
#define YYBACKUP(Token, Value) \
|
||||
do \
|
||||
if (yychar == YYEMPTY && yylen == 1) \
|
||||
{ \
|
||||
yychar = (Token); \
|
||||
yylval = (Value); \
|
||||
yytoken = YYTRANSLATE (yychar); \
|
||||
YYPOPSTACK (1); \
|
||||
goto yybackup; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
#define YYBACKUP(Token, Value) \
|
||||
do \
|
||||
if (yychar == YYEMPTY && yylen == 1) \
|
||||
{ \
|
||||
yychar = (Token); \
|
||||
yylval = (Value); \
|
||||
yytoken = YYTRANSLATE (yychar); \
|
||||
YYPOPSTACK (1); \
|
||||
goto yybackup; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
yyerror (YY_("syntax error: cannot back up")); \
|
||||
YYERROR; \
|
||||
} \
|
||||
YYERROR; \
|
||||
} \
|
||||
while (YYID (0))
|
||||
|
||||
|
||||
#define YYTERROR 1
|
||||
#define YYERRCODE 256
|
||||
#define YYTERROR 1
|
||||
#define YYERRCODE 256
|
||||
|
||||
|
||||
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||||
|
@ -643,22 +643,22 @@ while (YYID (0))
|
|||
|
||||
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
||||
#ifndef YYLLOC_DEFAULT
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do \
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do \
|
||||
if (YYID (N)) \
|
||||
{ \
|
||||
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
||||
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
||||
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
||||
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).first_line = (Current).last_line = \
|
||||
YYRHSLOC (Rhs, 0).last_line; \
|
||||
(Current).first_column = (Current).last_column = \
|
||||
YYRHSLOC (Rhs, 0).last_column; \
|
||||
} \
|
||||
{ \
|
||||
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
||||
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
||||
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
||||
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).first_line = (Current).last_line = \
|
||||
YYRHSLOC (Rhs, 0).last_line; \
|
||||
(Current).first_column = (Current).last_column = \
|
||||
YYRHSLOC (Rhs, 0).last_column; \
|
||||
} \
|
||||
while (YYID (0))
|
||||
#endif
|
||||
|
||||
|
@ -669,10 +669,10 @@ while (YYID (0))
|
|||
|
||||
#ifndef YY_LOCATION_PRINT
|
||||
# if YYLTYPE_IS_TRIVIAL
|
||||
# define YY_LOCATION_PRINT(File, Loc) \
|
||||
fprintf (File, "%d.%d-%d.%d", \
|
||||
(Loc).first_line, (Loc).first_column, \
|
||||
(Loc).last_line, (Loc).last_column)
|
||||
# define YY_LOCATION_PRINT(File, Loc) \
|
||||
fprintf (File, "%d.%d-%d.%d", \
|
||||
(Loc).first_line, (Loc).first_column, \
|
||||
(Loc).last_line, (Loc).last_column)
|
||||
# else
|
||||
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
|
||||
# endif
|
||||
|
@ -695,21 +695,21 @@ while (YYID (0))
|
|||
# define YYFPRINTF fprintf
|
||||
# endif
|
||||
|
||||
# define YYDPRINTF(Args) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
YYFPRINTF Args; \
|
||||
# define YYDPRINTF(Args) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
YYFPRINTF Args; \
|
||||
} while (YYID (0))
|
||||
|
||||
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
{ \
|
||||
YYFPRINTF (stderr, "%s ", Title); \
|
||||
yy_symbol_print (stderr, \
|
||||
Type, Value); \
|
||||
YYFPRINTF (stderr, "\n"); \
|
||||
} \
|
||||
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
{ \
|
||||
YYFPRINTF (stderr, "%s ", Title); \
|
||||
yy_symbol_print (stderr, \
|
||||
Type, Value); \
|
||||
YYFPRINTF (stderr, "\n"); \
|
||||
} \
|
||||
} while (YYID (0))
|
||||
|
||||
|
||||
|
@ -741,7 +741,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
|
|||
switch (yytype)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -793,10 +793,10 @@ yy_stack_print (bottom, top)
|
|||
YYFPRINTF (stderr, "\n");
|
||||
}
|
||||
|
||||
# define YY_STACK_PRINT(Bottom, Top) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
yy_stack_print ((Bottom), (Top)); \
|
||||
# define YY_STACK_PRINT(Bottom, Top) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
yy_stack_print ((Bottom), (Top)); \
|
||||
} while (YYID (0))
|
||||
|
||||
|
||||
|
@ -819,21 +819,21 @@ yy_reduce_print (yyvsp, yyrule)
|
|||
int yyi;
|
||||
unsigned long int yylno = yyrline[yyrule];
|
||||
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
|
||||
yyrule - 1, yylno);
|
||||
yyrule - 1, yylno);
|
||||
/* The symbols being reduced. */
|
||||
for (yyi = 0; yyi < yynrhs; yyi++)
|
||||
{
|
||||
fprintf (stderr, " $%d = ", yyi + 1);
|
||||
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
|
||||
&(yyvsp[(yyi + 1) - (yynrhs)])
|
||||
);
|
||||
&(yyvsp[(yyi + 1) - (yynrhs)])
|
||||
);
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
# define YY_REDUCE_PRINT(Rule) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
# define YY_REDUCE_PRINT(Rule) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
yy_reduce_print (yyvsp, Rule); \
|
||||
} while (YYID (0))
|
||||
|
||||
|
@ -849,7 +849,7 @@ int yydebug;
|
|||
|
||||
|
||||
/* YYINITDEPTH -- initial size of the parser's stacks. */
|
||||
#ifndef YYINITDEPTH
|
||||
#ifndef YYINITDEPTH
|
||||
# define YYINITDEPTH 200
|
||||
#endif
|
||||
|
||||
|
@ -936,27 +936,27 @@ yytnamerr (char *yyres, const char *yystr)
|
|||
char const *yyp = yystr;
|
||||
|
||||
for (;;)
|
||||
switch (*++yyp)
|
||||
{
|
||||
case '\'':
|
||||
case ',':
|
||||
goto do_not_strip_quotes;
|
||||
switch (*++yyp)
|
||||
{
|
||||
case '\'':
|
||||
case ',':
|
||||
goto do_not_strip_quotes;
|
||||
|
||||
case '\\':
|
||||
if (*++yyp != '\\')
|
||||
goto do_not_strip_quotes;
|
||||
/* Fall through. */
|
||||
default:
|
||||
if (yyres)
|
||||
yyres[yyn] = *yyp;
|
||||
yyn++;
|
||||
break;
|
||||
case '\\':
|
||||
if (*++yyp != '\\')
|
||||
goto do_not_strip_quotes;
|
||||
/* Fall through. */
|
||||
default:
|
||||
if (yyres)
|
||||
yyres[yyn] = *yyp;
|
||||
yyn++;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
if (yyres)
|
||||
yyres[yyn] = '\0';
|
||||
return yyn;
|
||||
}
|
||||
case '"':
|
||||
if (yyres)
|
||||
yyres[yyn] = '\0';
|
||||
return yyn;
|
||||
}
|
||||
do_not_strip_quotes: ;
|
||||
}
|
||||
|
||||
|
@ -994,7 +994,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
|
|||
|
||||
# if 0
|
||||
/* This is so xgettext sees the translatable formats that are
|
||||
constructed on the fly. */
|
||||
constructed on the fly. */
|
||||
YY_("syntax error, unexpected %s");
|
||||
YY_("syntax error, unexpected %s, expecting %s");
|
||||
YY_("syntax error, unexpected %s, expecting %s or %s");
|
||||
|
@ -1007,13 +1007,13 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
|
|||
static char const yyexpecting[] = ", expecting %s";
|
||||
static char const yyor[] = " or %s";
|
||||
char yyformat[sizeof yyunexpected
|
||||
+ sizeof yyexpecting - 1
|
||||
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
|
||||
* (sizeof yyor - 1))];
|
||||
+ sizeof yyexpecting - 1
|
||||
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
|
||||
* (sizeof yyor - 1))];
|
||||
char const *yyprefix = yyexpecting;
|
||||
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. */
|
||||
YYCHECK. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
|
@ -1025,22 +1025,22 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
|
|||
yyfmt = yystpcpy (yyformat, yyunexpected);
|
||||
|
||||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
yysize = yysize0;
|
||||
yyformat[sizeof yyunexpected - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytname[yyx];
|
||||
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
|
||||
yysize_overflow |= (yysize1 < yysize);
|
||||
yysize = yysize1;
|
||||
yyfmt = yystpcpy (yyfmt, yyprefix);
|
||||
yyprefix = yyor;
|
||||
}
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
yysize = yysize0;
|
||||
yyformat[sizeof yyunexpected - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytname[yyx];
|
||||
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
|
||||
yysize_overflow |= (yysize1 < yysize);
|
||||
yysize = yysize1;
|
||||
yyfmt = yystpcpy (yyfmt, yyprefix);
|
||||
yyprefix = yyor;
|
||||
}
|
||||
|
||||
yyf = YY_(yyformat);
|
||||
yysize1 = yysize + yystrlen (yyf);
|
||||
|
@ -1048,29 +1048,29 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
|
|||
yysize = yysize1;
|
||||
|
||||
if (yysize_overflow)
|
||||
return YYSIZE_MAXIMUM;
|
||||
return YYSIZE_MAXIMUM;
|
||||
|
||||
if (yyresult)
|
||||
{
|
||||
/* Avoid sprintf, as that infringes on the user's name space.
|
||||
Don't have undefined behavior even if the translation
|
||||
produced a string with the wrong number of "%s"s. */
|
||||
char *yyp = yyresult;
|
||||
int yyi = 0;
|
||||
while ((*yyp = *yyf) != '\0')
|
||||
{
|
||||
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||||
yyf += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyf++;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
/* Avoid sprintf, as that infringes on the user's name space.
|
||||
Don't have undefined behavior even if the translation
|
||||
produced a string with the wrong number of "%s"s. */
|
||||
char *yyp = yyresult;
|
||||
int yyi = 0;
|
||||
while ((*yyp = *yyf) != '\0')
|
||||
{
|
||||
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||||
yyf += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyf++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return yysize;
|
||||
}
|
||||
}
|
||||
|
@ -1104,7 +1104,7 @@ yydestruct (yymsg, yytype, yyvaluep)
|
|||
{
|
||||
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1217,7 +1217,7 @@ yyparse ()
|
|||
yystate = 0;
|
||||
yyerrstatus = 0;
|
||||
yynerrs = 0;
|
||||
yychar = YYEMPTY; /* Cause a token to be read. */
|
||||
yychar = YYEMPTY; /* Cause a token to be read. */
|
||||
|
||||
/* Initialize stack pointers.
|
||||
Waste one element of value and location stack
|
||||
|
@ -1247,25 +1247,25 @@ yyparse ()
|
|||
|
||||
#ifdef yyoverflow
|
||||
{
|
||||
/* Give user a chance to reallocate the stack. Use copies of
|
||||
these so that the &'s don't force the real ones into
|
||||
memory. */
|
||||
YYSTYPE *yyvs1 = yyvs;
|
||||
yytype_int16 *yyss1 = yyss;
|
||||
/* Give user a chance to reallocate the stack. Use copies of
|
||||
these so that the &'s don't force the real ones into
|
||||
memory. */
|
||||
YYSTYPE *yyvs1 = yyvs;
|
||||
yytype_int16 *yyss1 = yyss;
|
||||
|
||||
|
||||
/* Each stack pointer address is followed by the size of the
|
||||
data in use in that stack, in bytes. This used to be a
|
||||
conditional around just the two extra args, but that might
|
||||
be undefined if yyoverflow is a macro. */
|
||||
yyoverflow (YY_("memory exhausted"),
|
||||
&yyss1, yysize * sizeof (*yyssp),
|
||||
&yyvs1, yysize * sizeof (*yyvsp),
|
||||
/* Each stack pointer address is followed by the size of the
|
||||
data in use in that stack, in bytes. This used to be a
|
||||
conditional around just the two extra args, but that might
|
||||
be undefined if yyoverflow is a macro. */
|
||||
yyoverflow (YY_("memory exhausted"),
|
||||
&yyss1, yysize * sizeof (*yyssp),
|
||||
&yyvs1, yysize * sizeof (*yyvsp),
|
||||
|
||||
&yystacksize);
|
||||
&yystacksize);
|
||||
|
||||
yyss = yyss1;
|
||||
yyvs = yyvs1;
|
||||
yyss = yyss1;
|
||||
yyvs = yyvs1;
|
||||
}
|
||||
#else /* no yyoverflow */
|
||||
# ifndef YYSTACK_RELOCATE
|
||||
|
@ -1273,23 +1273,23 @@ yyparse ()
|
|||
# else
|
||||
/* Extend the stack our own way. */
|
||||
if (YYMAXDEPTH <= yystacksize)
|
||||
goto yyexhaustedlab;
|
||||
goto yyexhaustedlab;
|
||||
yystacksize *= 2;
|
||||
if (YYMAXDEPTH < yystacksize)
|
||||
yystacksize = YYMAXDEPTH;
|
||||
yystacksize = YYMAXDEPTH;
|
||||
|
||||
{
|
||||
yytype_int16 *yyss1 = yyss;
|
||||
union yyalloc *yyptr =
|
||||
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
|
||||
if (! yyptr)
|
||||
goto yyexhaustedlab;
|
||||
YYSTACK_RELOCATE (yyss);
|
||||
YYSTACK_RELOCATE (yyvs);
|
||||
yytype_int16 *yyss1 = yyss;
|
||||
union yyalloc *yyptr =
|
||||
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
|
||||
if (! yyptr)
|
||||
goto yyexhaustedlab;
|
||||
YYSTACK_RELOCATE (yyss);
|
||||
YYSTACK_RELOCATE (yyvs);
|
||||
|
||||
# undef YYSTACK_RELOCATE
|
||||
if (yyss1 != yyssa)
|
||||
YYSTACK_FREE (yyss1);
|
||||
if (yyss1 != yyssa)
|
||||
YYSTACK_FREE (yyss1);
|
||||
}
|
||||
# endif
|
||||
#endif /* no yyoverflow */
|
||||
|
@ -1299,10 +1299,10 @@ yyparse ()
|
|||
|
||||
|
||||
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
|
||||
(unsigned long int) yystacksize));
|
||||
(unsigned long int) yystacksize));
|
||||
|
||||
if (yyss + yystacksize - 1 <= yyssp)
|
||||
YYABORT;
|
||||
YYABORT;
|
||||
}
|
||||
|
||||
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
|
||||
|
@ -1351,7 +1351,7 @@ yybackup:
|
|||
if (yyn <= 0)
|
||||
{
|
||||
if (yyn == 0 || yyn == YYTABLE_NINF)
|
||||
goto yyerrlab;
|
||||
goto yyerrlab;
|
||||
yyn = -yyn;
|
||||
goto yyreduce;
|
||||
}
|
||||
|
@ -1411,37 +1411,37 @@ yyreduce:
|
|||
case 10:
|
||||
#line 74 "imap_cern.y"
|
||||
{
|
||||
MapInfo_t *info = get_map_info();
|
||||
g_strreplace(&info->default_url, (yyvsp[(2) - (2)].id));
|
||||
MapInfo_t *info = get_map_info();
|
||||
g_strreplace(&info->default_url, (yyvsp[(2) - (2)].id));
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 11:
|
||||
#line 83 "imap_cern.y"
|
||||
{
|
||||
gint x = (gint) (yyvsp[(3) - (12)].value);
|
||||
gint y = (gint) (yyvsp[(5) - (12)].value);
|
||||
gint width = (gint) fabs((yyvsp[(8) - (12)].value) - x);
|
||||
gint height = (gint) fabs((yyvsp[(10) - (12)].value) - y);
|
||||
current_object = create_rectangle(x, y, width, height);
|
||||
object_set_url(current_object, (yyvsp[(12) - (12)].id));
|
||||
add_shape(current_object);
|
||||
gint x = (gint) (yyvsp[(3) - (12)].value);
|
||||
gint y = (gint) (yyvsp[(5) - (12)].value);
|
||||
gint width = (gint) fabs((yyvsp[(8) - (12)].value) - x);
|
||||
gint height = (gint) fabs((yyvsp[(10) - (12)].value) - y);
|
||||
current_object = create_rectangle(x, y, width, height);
|
||||
object_set_url(current_object, (yyvsp[(12) - (12)].id));
|
||||
add_shape(current_object);
|
||||
g_free ((yyvsp[(12) - (12)].id));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 12:
|
||||
#line 96 "imap_cern.y"
|
||||
{
|
||||
gint x = (gint) (yyvsp[(3) - (8)].value);
|
||||
gint y = (gint) (yyvsp[(5) - (8)].value);
|
||||
gint r = (gint) (yyvsp[(7) - (8)].value);
|
||||
current_object = create_circle(x, y, r);
|
||||
object_set_url(current_object, (yyvsp[(8) - (8)].id));
|
||||
add_shape(current_object);
|
||||
gint x = (gint) (yyvsp[(3) - (8)].value);
|
||||
gint y = (gint) (yyvsp[(5) - (8)].value);
|
||||
gint r = (gint) (yyvsp[(7) - (8)].value);
|
||||
current_object = create_circle(x, y, r);
|
||||
object_set_url(current_object, (yyvsp[(8) - (8)].id));
|
||||
add_shape(current_object);
|
||||
g_free ((yyvsp[(8) - (8)].id));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 13:
|
||||
|
@ -1452,55 +1452,55 @@ yyreduce:
|
|||
case 14:
|
||||
#line 108 "imap_cern.y"
|
||||
{
|
||||
object_set_url(current_object, (yyvsp[(4) - (4)].id));
|
||||
add_shape(current_object);
|
||||
object_set_url(current_object, (yyvsp[(4) - (4)].id));
|
||||
add_shape(current_object);
|
||||
g_free ((yyvsp[(4) - (4)].id));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 16:
|
||||
#line 117 "imap_cern.y"
|
||||
{
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 17:
|
||||
#line 122 "imap_cern.y"
|
||||
{
|
||||
Polygon_t *polygon = ObjectToPolygon(current_object);
|
||||
GdkPoint *point = new_point((gint) (yyvsp[(2) - (5)].value), (gint) (yyvsp[(4) - (5)].value));
|
||||
polygon->points = g_list_append(polygon->points,
|
||||
(gpointer) point);
|
||||
}
|
||||
Polygon_t *polygon = ObjectToPolygon(current_object);
|
||||
GdkPoint *point = new_point((gint) (yyvsp[(2) - (5)].value), (gint) (yyvsp[(4) - (5)].value));
|
||||
polygon->points = g_list_append(polygon->points,
|
||||
(gpointer) point);
|
||||
}
|
||||
break;
|
||||
|
||||
case 21:
|
||||
#line 136 "imap_cern.y"
|
||||
{
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
break;
|
||||
|
||||
case 22:
|
||||
#line 142 "imap_cern.y"
|
||||
{
|
||||
MapInfo_t *info = get_map_info();
|
||||
g_strreplace(&info->author, (yyvsp[(2) - (2)].id));
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
MapInfo_t *info = get_map_info();
|
||||
g_strreplace(&info->author, (yyvsp[(2) - (2)].id));
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
break;
|
||||
|
||||
case 23:
|
||||
#line 150 "imap_cern.y"
|
||||
{
|
||||
MapInfo_t *info = get_map_info();
|
||||
gchar *description;
|
||||
MapInfo_t *info = get_map_info();
|
||||
gchar *description;
|
||||
|
||||
description = g_strconcat(info->description, (yyvsp[(2) - (2)].id), "\n",
|
||||
NULL);
|
||||
g_strreplace(&info->description, description);
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
description = g_strconcat(info->description, (yyvsp[(2) - (2)].id), "\n",
|
||||
NULL);
|
||||
g_strreplace(&info->description, description);
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
@ -1544,35 +1544,35 @@ yyerrlab:
|
|||
yyerror (YY_("syntax error"));
|
||||
#else
|
||||
{
|
||||
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
|
||||
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
|
||||
{
|
||||
YYSIZE_T yyalloc = 2 * yysize;
|
||||
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
|
||||
yyalloc = YYSTACK_ALLOC_MAXIMUM;
|
||||
if (yymsg != yymsgbuf)
|
||||
YYSTACK_FREE (yymsg);
|
||||
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
|
||||
if (yymsg)
|
||||
yymsg_alloc = yyalloc;
|
||||
else
|
||||
{
|
||||
yymsg = yymsgbuf;
|
||||
yymsg_alloc = sizeof yymsgbuf;
|
||||
}
|
||||
}
|
||||
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
|
||||
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
|
||||
{
|
||||
YYSIZE_T yyalloc = 2 * yysize;
|
||||
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
|
||||
yyalloc = YYSTACK_ALLOC_MAXIMUM;
|
||||
if (yymsg != yymsgbuf)
|
||||
YYSTACK_FREE (yymsg);
|
||||
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
|
||||
if (yymsg)
|
||||
yymsg_alloc = yyalloc;
|
||||
else
|
||||
{
|
||||
yymsg = yymsgbuf;
|
||||
yymsg_alloc = sizeof yymsgbuf;
|
||||
}
|
||||
}
|
||||
|
||||
if (0 < yysize && yysize <= yymsg_alloc)
|
||||
{
|
||||
(void) yysyntax_error (yymsg, yystate, yychar);
|
||||
yyerror (yymsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
yyerror (YY_("syntax error"));
|
||||
if (yysize != 0)
|
||||
goto yyexhaustedlab;
|
||||
}
|
||||
if (0 < yysize && yysize <= yymsg_alloc)
|
||||
{
|
||||
(void) yysyntax_error (yymsg, yystate, yychar);
|
||||
yyerror (yymsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
yyerror (YY_("syntax error"));
|
||||
if (yysize != 0)
|
||||
goto yyexhaustedlab;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1582,20 +1582,20 @@ yyerrlab:
|
|||
if (yyerrstatus == 3)
|
||||
{
|
||||
/* If just tried and failed to reuse look-ahead token after an
|
||||
error, discard it. */
|
||||
error, discard it. */
|
||||
|
||||
if (yychar <= YYEOF)
|
||||
{
|
||||
/* Return failure if at end of input. */
|
||||
if (yychar == YYEOF)
|
||||
YYABORT;
|
||||
}
|
||||
{
|
||||
/* Return failure if at end of input. */
|
||||
if (yychar == YYEOF)
|
||||
YYABORT;
|
||||
}
|
||||
else
|
||||
{
|
||||
yydestruct ("Error: discarding",
|
||||
yytoken, &yylval);
|
||||
yychar = YYEMPTY;
|
||||
}
|
||||
{
|
||||
yydestruct ("Error: discarding",
|
||||
yytoken, &yylval);
|
||||
yychar = YYEMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
/* Else will try to reuse look-ahead token after shifting the error
|
||||
|
@ -1627,29 +1627,29 @@ yyerrorlab:
|
|||
| yyerrlab1 -- common code for both syntax error and YYERROR. |
|
||||
`-------------------------------------------------------------*/
|
||||
yyerrlab1:
|
||||
yyerrstatus = 3; /* Each real token shifted decrements this. */
|
||||
yyerrstatus = 3; /* Each real token shifted decrements this. */
|
||||
|
||||
for (;;)
|
||||
{
|
||||
yyn = yypact[yystate];
|
||||
if (yyn != YYPACT_NINF)
|
||||
{
|
||||
yyn += YYTERROR;
|
||||
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
|
||||
{
|
||||
yyn = yytable[yyn];
|
||||
if (0 < yyn)
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
yyn += YYTERROR;
|
||||
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
|
||||
{
|
||||
yyn = yytable[yyn];
|
||||
if (0 < yyn)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Pop the current state because it cannot handle the error token. */
|
||||
if (yyssp == yyss)
|
||||
YYABORT;
|
||||
YYABORT;
|
||||
|
||||
|
||||
yydestruct ("Error: popping",
|
||||
yystos[yystate], yyvsp);
|
||||
yystos[yystate], yyvsp);
|
||||
YYPOPSTACK (1);
|
||||
yystate = *yyssp;
|
||||
YY_STACK_PRINT (yyss, yyssp);
|
||||
|
@ -1695,7 +1695,7 @@ yyexhaustedlab:
|
|||
yyreturn:
|
||||
if (yychar != YYEOF && yychar != YYEMPTY)
|
||||
yydestruct ("Cleanup: discarding lookahead",
|
||||
yytoken, &yylval);
|
||||
yytoken, &yylval);
|
||||
/* Do not reclaim the symbols of the rule which action triggered
|
||||
this YYABORT or YYACCEPT. */
|
||||
YYPOPSTACK (yylen);
|
||||
|
@ -1703,7 +1703,7 @@ yyreturn:
|
|||
while (yyssp != yyss)
|
||||
{
|
||||
yydestruct ("Cleanup: popping",
|
||||
yystos[*yyssp], yyvsp);
|
||||
yystos[*yyssp], yyvsp);
|
||||
YYPOPSTACK (1);
|
||||
}
|
||||
#ifndef yyoverflow
|
||||
|
|
|
@ -76,7 +76,7 @@ typedef union YYSTYPE
|
|||
}
|
||||
/* Line 1489 of yacc.c. */
|
||||
#line 79 "y.tab.h"
|
||||
YYSTYPE;
|
||||
YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
|
|
|
@ -44,7 +44,7 @@ static void circle_draw_sashes(Object_t* obj, GdkWindow *window, GdkGC* gc);
|
|||
static MoveSashFunc_t circle_near_sash(Object_t *obj, gint x, gint y);
|
||||
static gboolean circle_point_is_on(Object_t *obj, gint x, gint y);
|
||||
static void circle_get_dimensions(Object_t *obj, gint *x, gint *y,
|
||||
gint *width, gint *height);
|
||||
gint *width, gint *height);
|
||||
static void circle_resize(Object_t *obj, gint percentage_x, gint percentage_y);
|
||||
static void circle_move(Object_t *obj, gint dx, gint dy);
|
||||
static gpointer circle_create_info_widget(GtkWidget *frame);
|
||||
|
@ -52,24 +52,24 @@ static void circle_fill_info_tab(Object_t *obj, gpointer data);
|
|||
static void circle_set_initial_focus(Object_t *obj, gpointer data);
|
||||
static void circle_update(Object_t* obj, gpointer data);
|
||||
static void circle_write_csim(Object_t* obj, gpointer param,
|
||||
OutputFunc_t output);
|
||||
OutputFunc_t output);
|
||||
static void circle_write_cern(Object_t* obj, gpointer param,
|
||||
OutputFunc_t output);
|
||||
OutputFunc_t output);
|
||||
static void circle_write_ncsa(Object_t* obj, gpointer param,
|
||||
OutputFunc_t output);
|
||||
OutputFunc_t output);
|
||||
static const gchar* circle_get_stock_icon_name(void);
|
||||
|
||||
static ObjectClass_t circle_class = {
|
||||
N_("C_ircle"),
|
||||
NULL, /* info_dialog */
|
||||
NULL, /* icon */
|
||||
NULL, /* mask */
|
||||
NULL, /* info_dialog */
|
||||
NULL, /* icon */
|
||||
NULL, /* mask */
|
||||
|
||||
circle_is_valid,
|
||||
NULL, /* circle_destruct */
|
||||
NULL, /* circle_destruct */
|
||||
circle_clone,
|
||||
circle_assign,
|
||||
NULL, /* circle_normalize */
|
||||
NULL, /* circle_normalize */
|
||||
circle_draw,
|
||||
circle_draw_sashes,
|
||||
circle_near_sash,
|
||||
|
@ -78,7 +78,7 @@ static ObjectClass_t circle_class = {
|
|||
circle_resize,
|
||||
circle_move,
|
||||
circle_create_info_widget,
|
||||
circle_fill_info_tab, /* circle_update_info_widget */
|
||||
circle_fill_info_tab, /* circle_update_info_widget */
|
||||
circle_fill_info_tab,
|
||||
circle_set_initial_focus,
|
||||
circle_update,
|
||||
|
@ -167,7 +167,7 @@ circle_resize(Object_t *obj, gint percentage_x, gint percentage_y)
|
|||
circle->x = circle->x * percentage_x / 100;
|
||||
circle->y = circle->y * percentage_y / 100;
|
||||
circle->r = circle->r * ((percentage_x < percentage_y)
|
||||
? percentage_x : percentage_y) / 100;
|
||||
? percentage_x : percentage_y) / 100;
|
||||
}
|
||||
|
||||
static MoveSashFunc_t
|
||||
|
@ -195,7 +195,7 @@ circle_point_is_on(Object_t *obj, gint x, gint y)
|
|||
|
||||
static void
|
||||
circle_get_dimensions(Object_t *obj, gint *x, gint *y,
|
||||
gint *width, gint *height)
|
||||
gint *width, gint *height)
|
||||
{
|
||||
Circle_t *circle = ObjectToCircle(obj);
|
||||
*x = circle->x - circle->r;
|
||||
|
@ -262,14 +262,14 @@ circle_create_info_widget(GtkWidget *frame)
|
|||
|
||||
label = create_label_in_table(table, 0, 0, _("Center _x:"));
|
||||
props->x = create_spin_button_in_table(table, label, 0, 1, 1, 0,
|
||||
max_width - 1);
|
||||
max_width - 1);
|
||||
g_signal_connect(props->x, "value-changed",
|
||||
G_CALLBACK (x_changed_cb), (gpointer) props);
|
||||
create_label_in_table(table, 0, 2, _("pixels"));
|
||||
|
||||
label = create_label_in_table(table, 1, 0, _("Center _y:"));
|
||||
props->y = create_spin_button_in_table(table, label, 1, 1, 1, 0,
|
||||
max_height - 1);
|
||||
max_height - 1);
|
||||
g_signal_connect(props->y, "value-changed",
|
||||
G_CALLBACK (y_changed_cb), (gpointer) props);
|
||||
create_label_in_table(table, 1, 2, _("pixels"));
|
||||
|
@ -318,7 +318,7 @@ circle_write_csim(Object_t *obj, gpointer param, OutputFunc_t output)
|
|||
{
|
||||
Circle_t *circle = ObjectToCircle(obj);
|
||||
output(param, "\"circle\" coords=\"%d,%d,%d\"", circle->x, circle->y,
|
||||
circle->r);
|
||||
circle->r);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -333,7 +333,7 @@ circle_write_ncsa(Object_t *obj, gpointer param, OutputFunc_t output)
|
|||
{
|
||||
Circle_t *circle = ObjectToCircle(obj);
|
||||
output(param, "circle %s %d,%d %d,%d", obj->url,
|
||||
circle->x, circle->y, circle->x, circle->y + circle->r);
|
||||
circle->x, circle->y, circle->x, circle->y + circle->r);
|
||||
}
|
||||
|
||||
static const gchar*
|
||||
|
@ -367,9 +367,9 @@ circle_factory_set_xy1(Object_t *obj, guint state, gint x, gint y)
|
|||
}
|
||||
|
||||
static ObjectFactory_t circle_factory1 = {
|
||||
NULL, /* Object pointer */
|
||||
NULL, /* Finish func */
|
||||
NULL, /* Cancel func */
|
||||
NULL, /* Object pointer */
|
||||
NULL, /* Finish func */
|
||||
NULL, /* Cancel func */
|
||||
circle_factory_create_object1,
|
||||
circle_factory_set_xy1
|
||||
};
|
||||
|
@ -393,9 +393,9 @@ circle_factory_set_xy2(Object_t *obj, guint state, gint x, gint y)
|
|||
}
|
||||
|
||||
static ObjectFactory_t circle_factory2 = {
|
||||
NULL, /* Object pointer */
|
||||
NULL, /* Finish func */
|
||||
NULL, /* Cancel func */
|
||||
NULL, /* Object pointer */
|
||||
NULL, /* Finish func */
|
||||
NULL, /* Cancel func */
|
||||
circle_factory_create_object2,
|
||||
circle_factory_set_xy2
|
||||
};
|
||||
|
|
|
@ -31,15 +31,15 @@
|
|||
static CmdExecuteValue_t clear_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t clear_command_class = {
|
||||
NULL, /* clear_command_destruct */
|
||||
NULL, /* clear_command_destruct */
|
||||
clear_command_execute,
|
||||
NULL, /* clear_command_undo */
|
||||
NULL /* clear_command_redo */
|
||||
NULL, /* clear_command_undo */
|
||||
NULL /* clear_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
Command_t parent;
|
||||
ObjectList_t *list;
|
||||
Command_t parent;
|
||||
ObjectList_t *list;
|
||||
} ClearCommand_t;
|
||||
|
||||
Command_t*
|
||||
|
@ -55,7 +55,7 @@ remove_one_object(Object_t *obj, gpointer data)
|
|||
{
|
||||
ClearCommand_t *command = (ClearCommand_t*) data;
|
||||
command_add_subcommand(&command->parent,
|
||||
delete_command_new(command->list, obj));
|
||||
delete_command_new(command->list, obj));
|
||||
}
|
||||
|
||||
static CmdExecuteValue_t
|
||||
|
|
|
@ -32,10 +32,10 @@ static CmdExecuteValue_t copy_command_execute(Command_t *parent);
|
|||
static void copy_command_undo(Command_t *parent);
|
||||
|
||||
static CommandClass_t copy_command_class = {
|
||||
NULL, /* copy_command_destruct */
|
||||
NULL, /* copy_command_destruct */
|
||||
copy_command_execute,
|
||||
copy_command_undo,
|
||||
NULL /* copy_command_redo */
|
||||
NULL /* copy_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -58,7 +58,7 @@ copy_command_execute(Command_t *parent)
|
|||
{
|
||||
CopyCommand_t *command = (CopyCommand_t*) parent;
|
||||
command->paste_buffer = object_list_copy(command->paste_buffer,
|
||||
get_paste_buffer());
|
||||
get_paste_buffer());
|
||||
object_list_copy_to_paste_buffer(command->list);
|
||||
return CMD_APPEND;
|
||||
}
|
||||
|
|
|
@ -36,12 +36,12 @@ static CommandClass_t copy_object_command_class = {
|
|||
copy_object_command_destruct,
|
||||
copy_object_command_execute,
|
||||
copy_object_command_undo,
|
||||
NULL /* copy_object_command_redo */
|
||||
NULL /* copy_object_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
Command_t parent;
|
||||
Object_t *obj;
|
||||
Object_t *obj;
|
||||
ObjectList_t *paste_buffer;
|
||||
} CopyObjectCommand_t;
|
||||
|
||||
|
@ -52,7 +52,7 @@ copy_object_command_new(Object_t *obj)
|
|||
command->obj = object_ref(obj);
|
||||
command->paste_buffer = NULL;
|
||||
return command_init(&command->parent, _("Copy"),
|
||||
©_object_command_class);
|
||||
©_object_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -69,7 +69,7 @@ copy_object_command_execute(Command_t *parent)
|
|||
ObjectList_t *paste_buffer = get_paste_buffer();
|
||||
|
||||
command->paste_buffer = object_list_copy(command->paste_buffer,
|
||||
paste_buffer);
|
||||
paste_buffer);
|
||||
clear_paste_buffer();
|
||||
object_list_append(paste_buffer, object_clone(command->obj));
|
||||
|
||||
|
|
|
@ -38,14 +38,14 @@ static CommandClass_t create_command_class = {
|
|||
create_command_destruct,
|
||||
create_command_execute,
|
||||
create_command_undo,
|
||||
NULL /* create_command_redo */
|
||||
NULL /* create_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
Command_t parent;
|
||||
Command_t parent;
|
||||
ObjectList_t *list;
|
||||
Object_t *obj;
|
||||
gboolean changed;
|
||||
Object_t *obj;
|
||||
gboolean changed;
|
||||
} CreateCommand_t;
|
||||
|
||||
Command_t*
|
||||
|
|
|
@ -36,11 +36,11 @@ static CommandClass_t cut_command_class = {
|
|||
cut_command_destruct,
|
||||
cut_command_execute,
|
||||
cut_command_undo,
|
||||
NULL /* cut_command_redo */
|
||||
NULL /* cut_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
Command_t parent;
|
||||
Command_t parent;
|
||||
ObjectList_t *list;
|
||||
ObjectList_t *paste_buffer;
|
||||
} CutCommand_t;
|
||||
|
@ -66,7 +66,7 @@ remove_one_object(Object_t *obj, gpointer data)
|
|||
{
|
||||
CutCommand_t *command = (CutCommand_t*) data;
|
||||
command_add_subcommand(&command->parent,
|
||||
delete_command_new(command->list, obj));
|
||||
delete_command_new(command->list, obj));
|
||||
}
|
||||
|
||||
static CmdExecuteValue_t
|
||||
|
@ -76,7 +76,7 @@ cut_command_execute(Command_t *parent)
|
|||
gpointer id;
|
||||
|
||||
command->paste_buffer = object_list_copy(command->paste_buffer,
|
||||
get_paste_buffer());
|
||||
get_paste_buffer());
|
||||
id = object_list_add_remove_cb(command->list, remove_one_object, command);
|
||||
object_list_cut(command->list);
|
||||
object_list_remove_remove_cb(command->list, id);
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
static CmdExecuteValue_t cut_object_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t cut_object_command_class = {
|
||||
NULL, /* cut_object_command_destruct */
|
||||
NULL, /* cut_object_command_destruct */
|
||||
cut_object_command_execute,
|
||||
NULL, /* cut_object_command_undo */
|
||||
NULL /* cut_object_command_redo */
|
||||
NULL, /* cut_object_command_undo */
|
||||
NULL /* cut_object_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -48,7 +48,7 @@ cut_object_command_new(Object_t *obj)
|
|||
Command_t *parent;
|
||||
|
||||
parent = command_init(&command->parent, _("Cut"),
|
||||
&cut_object_command_class);
|
||||
&cut_object_command_class);
|
||||
command_add_subcommand(parent, copy_object_command_new(obj));
|
||||
command_add_subcommand(parent, delete_command_new(obj->list, obj));
|
||||
|
||||
|
|
|
@ -36,15 +36,15 @@ static CommandClass_t delete_command_class = {
|
|||
delete_command_destruct,
|
||||
delete_command_execute,
|
||||
delete_command_undo,
|
||||
NULL /* delete_command_redo */
|
||||
NULL /* delete_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
Command_t parent;
|
||||
ObjectList_t *list;
|
||||
Object_t *obj;
|
||||
gint position;
|
||||
gboolean changed;
|
||||
gint position;
|
||||
gboolean changed;
|
||||
} DeleteCommand_t;
|
||||
|
||||
Command_t*
|
||||
|
@ -54,7 +54,7 @@ delete_command_new(ObjectList_t *list, Object_t *obj)
|
|||
command->list = list;
|
||||
command->obj = object_ref(obj);
|
||||
return command_init(&command->parent, _("Delete"),
|
||||
&delete_command_class);
|
||||
&delete_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -33,18 +33,18 @@ static CmdExecuteValue_t delete_point_command_execute(Command_t *parent);
|
|||
static void delete_point_command_undo(Command_t *parent);
|
||||
|
||||
static CommandClass_t delete_point_command_class = {
|
||||
NULL, /* delete_point_command_destruct */
|
||||
NULL, /* delete_point_command_destruct */
|
||||
delete_point_command_execute,
|
||||
delete_point_command_undo,
|
||||
NULL /* delete_point_command_redo */
|
||||
NULL /* delete_point_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
Command_t parent;
|
||||
Command_t parent;
|
||||
Polygon_t *polygon;
|
||||
GdkPoint *point;
|
||||
GdkPoint copy;
|
||||
gint position;
|
||||
GdkPoint copy;
|
||||
gint position;
|
||||
} DeletePointCommand_t;
|
||||
|
||||
Command_t*
|
||||
|
@ -56,9 +56,9 @@ delete_point_command_new(Object_t *obj, GdkPoint *point)
|
|||
command->point = point;
|
||||
command->copy = *point;
|
||||
command->position = g_list_index(command->polygon->points,
|
||||
(gpointer) point);
|
||||
(gpointer) point);
|
||||
return command_init(&command->parent, _("Delete Point"),
|
||||
&delete_point_command_class);
|
||||
&delete_point_command_class);
|
||||
}
|
||||
|
||||
static CmdExecuteValue_t
|
||||
|
@ -82,5 +82,5 @@ delete_point_command_undo(Command_t *parent)
|
|||
|
||||
command->point = new_point(point->x, point->y);
|
||||
polygon->points = g_list_insert(polygon->points, (gpointer) command->point,
|
||||
command->position);
|
||||
command->position);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ static void edit_object_command_undo(Command_t *parent);
|
|||
|
||||
static CommandClass_t edit_object_command_class = {
|
||||
edit_object_command_destruct,
|
||||
NULL, /* edit_object_command_execute */
|
||||
NULL, /* edit_object_command_execute */
|
||||
edit_object_command_undo,
|
||||
edit_object_command_undo
|
||||
};
|
||||
|
@ -51,7 +51,7 @@ edit_object_command_new(Object_t *obj)
|
|||
command->obj = object_ref(obj);
|
||||
command->copy = object_clone(obj);
|
||||
return command_init(&command->parent, _("Edit Object"),
|
||||
&edit_object_command_class);
|
||||
&edit_object_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -38,18 +38,18 @@
|
|||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
typedef struct {
|
||||
DefaultDialog_t *dialog;
|
||||
DefaultDialog_t *dialog;
|
||||
|
||||
ObjectList_t *list;
|
||||
GimpDrawable *drawable;
|
||||
ObjectList_t *list;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
GtkWidget *alternate;
|
||||
GtkWidget *all;
|
||||
GtkWidget *left_border;
|
||||
GtkWidget *right_border;
|
||||
GtkWidget *upper_border;
|
||||
GtkWidget *lower_border;
|
||||
GtkWidget *url;
|
||||
GtkWidget *alternate;
|
||||
GtkWidget *all;
|
||||
GtkWidget *left_border;
|
||||
GtkWidget *right_border;
|
||||
GtkWidget *upper_border;
|
||||
GtkWidget *lower_border;
|
||||
GtkWidget *url;
|
||||
} GimpGuidesDialog_t;
|
||||
|
||||
static gint
|
||||
|
@ -80,7 +80,7 @@ gimp_guides_ok_cb(gpointer data)
|
|||
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(param->right_border)))
|
||||
vguides = g_slist_append(vguides,
|
||||
GINT_TO_POINTER(gimp_image_width(image_ID)));
|
||||
GINT_TO_POINTER(gimp_image_width(image_ID)));
|
||||
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(param->upper_border)))
|
||||
hguides = g_slist_append(NULL, GINT_TO_POINTER(0));
|
||||
|
@ -89,7 +89,7 @@ gimp_guides_ok_cb(gpointer data)
|
|||
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(param->lower_border)))
|
||||
hguides = g_slist_append(hguides,
|
||||
GINT_TO_POINTER(gimp_image_height(image_ID)));
|
||||
GINT_TO_POINTER(gimp_image_height(image_ID)));
|
||||
|
||||
url = gtk_entry_get_text(GTK_ENTRY(param->url));
|
||||
|
||||
|
@ -101,12 +101,12 @@ gimp_guides_ok_cb(gpointer data)
|
|||
gint position = gimp_image_get_guide_position(image_ID, guide_num);
|
||||
|
||||
if (gimp_image_get_guide_orientation(image_ID, guide_num)
|
||||
== GIMP_ORIENTATION_HORIZONTAL) {
|
||||
hguides = g_slist_insert_sorted(hguides, GINT_TO_POINTER(position),
|
||||
guide_sort_func);
|
||||
} else { /* GIMP_ORIENTATION_VERTICAL */
|
||||
vguides = g_slist_insert_sorted(vguides, GINT_TO_POINTER(position),
|
||||
guide_sort_func);
|
||||
== GIMP_ORIENTATION_HORIZONTAL) {
|
||||
hguides = g_slist_insert_sorted(hguides, GINT_TO_POINTER(position),
|
||||
guide_sort_func);
|
||||
} else { /* GIMP_ORIENTATION_VERTICAL */
|
||||
vguides = g_slist_insert_sorted(vguides, GINT_TO_POINTER(position),
|
||||
guide_sort_func);
|
||||
}
|
||||
guide_num = gimp_image_find_next_guide(image_ID, guide_num);
|
||||
}
|
||||
|
@ -116,18 +116,18 @@ gimp_guides_ok_cb(gpointer data)
|
|||
subcommand_start(_("Use Gimp Guides"));
|
||||
|
||||
for (hg = hguides; hg && hg->next;
|
||||
hg = (all) ? hg->next : hg->next->next) {
|
||||
hg = (all) ? hg->next : hg->next->next) {
|
||||
gint y = GPOINTER_TO_INT(hg->data);
|
||||
gint height = GPOINTER_TO_INT(hg->next->data) - y;
|
||||
for (vg = vguides; vg && vg->next;
|
||||
vg = (all) ? vg->next : vg->next->next) {
|
||||
gint x = GPOINTER_TO_INT(vg->data);
|
||||
gint width = GPOINTER_TO_INT(vg->next->data) - x;
|
||||
Object_t *obj = create_rectangle(x, y, width, height);
|
||||
Command_t *command = create_command_new(param->list, obj);
|
||||
vg = (all) ? vg->next : vg->next->next) {
|
||||
gint x = GPOINTER_TO_INT(vg->data);
|
||||
gint width = GPOINTER_TO_INT(vg->next->data) - x;
|
||||
Object_t *obj = create_rectangle(x, y, width, height);
|
||||
Command_t *command = create_command_new(param->list, obj);
|
||||
|
||||
object_set_url(obj, url);
|
||||
command_execute(command);
|
||||
object_set_url(obj, url);
|
||||
command_execute(command);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,7 @@ make_gimp_guides_dialog(void)
|
|||
|
||||
static void
|
||||
init_gimp_guides_dialog(GimpGuidesDialog_t *dialog, ObjectList_t *list,
|
||||
GimpDrawable *drawable)
|
||||
GimpDrawable *drawable)
|
||||
{
|
||||
dialog->list = list;
|
||||
dialog->drawable = drawable;
|
||||
|
@ -229,10 +229,10 @@ do_create_gimp_guides_dialog(ObjectList_t *list, GimpDrawable *drawable)
|
|||
static CmdExecuteValue_t gimp_guides_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t gimp_guides_command_class = {
|
||||
NULL, /* guides_command_destruct */
|
||||
NULL, /* guides_command_destruct */
|
||||
gimp_guides_command_execute,
|
||||
NULL, /* guides_command_undo */
|
||||
NULL /* guides_command_redo */
|
||||
NULL, /* guides_command_undo */
|
||||
NULL /* guides_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -248,7 +248,7 @@ gimp_guides_command_new(ObjectList_t *list, GimpDrawable *drawable)
|
|||
command->list = list;
|
||||
command->drawable = drawable;
|
||||
return command_init(&command->parent, _("Use Gimp Guides"),
|
||||
&gimp_guides_command_class);
|
||||
&gimp_guides_command_class);
|
||||
}
|
||||
|
||||
static CmdExecuteValue_t
|
||||
|
|
|
@ -35,20 +35,20 @@
|
|||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
typedef struct {
|
||||
DefaultDialog_t *dialog;
|
||||
GtkWidget *image_dimensions;
|
||||
GtkWidget *guide_bounds;
|
||||
GtkWidget *width;
|
||||
GtkWidget *height;
|
||||
GtkWidget *left;
|
||||
GtkWidget *top;
|
||||
GtkWidget *horz_spacing;
|
||||
GtkWidget *vert_spacing;
|
||||
GtkWidget *no_across;
|
||||
GtkWidget *no_down;
|
||||
GtkWidget *base_url;
|
||||
DefaultDialog_t *dialog;
|
||||
GtkWidget *image_dimensions;
|
||||
GtkWidget *guide_bounds;
|
||||
GtkWidget *width;
|
||||
GtkWidget *height;
|
||||
GtkWidget *left;
|
||||
GtkWidget *top;
|
||||
GtkWidget *horz_spacing;
|
||||
GtkWidget *vert_spacing;
|
||||
GtkWidget *no_across;
|
||||
GtkWidget *no_down;
|
||||
GtkWidget *base_url;
|
||||
|
||||
ObjectList_t *list;
|
||||
ObjectList_t *list;
|
||||
} GuidesDialog_t;
|
||||
|
||||
static void
|
||||
|
@ -75,12 +75,12 @@ guides_ok_cb(gpointer data)
|
|||
for (i = 0; i < rows; i++) {
|
||||
gint x = left;
|
||||
for (j = 0; j < cols; j++) {
|
||||
Object_t *obj = create_rectangle(x, y, width, height);
|
||||
Command_t *command = create_command_new(param->list, obj);
|
||||
Object_t *obj = create_rectangle(x, y, width, height);
|
||||
Command_t *command = create_command_new(param->list, obj);
|
||||
|
||||
object_set_url(obj, gtk_entry_get_text(GTK_ENTRY(param->base_url)));
|
||||
command_execute(command);
|
||||
x += width + hspace;
|
||||
object_set_url(obj, gtk_entry_get_text(GTK_ENTRY(param->base_url)));
|
||||
command_execute(command);
|
||||
x += width + hspace;
|
||||
}
|
||||
y += height + vspace;
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ recalc_bounds(GtkWidget *widget, gpointer data)
|
|||
bound_h = (height + vspace) * rows - vspace;
|
||||
|
||||
bounds = g_strdup_printf (_("Resulting Guide Bounds: %d,%d to %d,%d (%d areas)"),
|
||||
left, top, left + bound_w, top + bound_h, rows * cols);
|
||||
left, top, left + bound_w, top + bound_h, rows * cols);
|
||||
if (left + bound_w > get_image_width() ||
|
||||
top + bound_h > get_image_height())
|
||||
{
|
||||
|
@ -141,9 +141,9 @@ make_guides_dialog (void)
|
|||
|
||||
hbox = gimp_hint_box_new (
|
||||
_("Guides are pre-defined rectangles covering the image. You define "
|
||||
"them by their width, height, and spacing from each other. This "
|
||||
"allows you to rapidly create the most common image map type - "
|
||||
"image collection of \"thumbnails\", suitable for navigation bars."));
|
||||
"them by their width, height, and spacing from each other. This "
|
||||
"allows you to rapidly create the most common image map type - "
|
||||
"image collection of \"thumbnails\", suitable for navigation bars."));
|
||||
gtk_box_pack_start (GTK_BOX (dialog->vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
|
@ -189,13 +189,13 @@ make_guides_dialog (void)
|
|||
|
||||
label = create_label_in_table(table, 2, 2, _("_No. across:"));
|
||||
data->no_across = create_spin_button_in_table(table, label, 2, 3, 0, 0,
|
||||
100);
|
||||
100);
|
||||
g_signal_connect (data->no_across, "changed",
|
||||
G_CALLBACK(recalc_bounds), (gpointer) data);
|
||||
|
||||
label = create_label_in_table(table, 3, 0, _("_Vert. spacing:"));
|
||||
data->vert_spacing = create_spin_button_in_table(table, label, 3, 1, 0, 0,
|
||||
100);
|
||||
100);
|
||||
g_signal_connect (data->vert_spacing, "changed",
|
||||
G_CALLBACK(recalc_bounds), (gpointer) data);
|
||||
|
||||
|
@ -252,10 +252,10 @@ do_create_guides_dialog_local (ObjectList_t *list)
|
|||
static CmdExecuteValue_t guides_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t guides_command_class = {
|
||||
NULL, /* guides_command_destruct */
|
||||
NULL, /* guides_command_destruct */
|
||||
guides_command_execute,
|
||||
NULL, /* guides_command_undo */
|
||||
NULL /* guides_command_redo */
|
||||
NULL, /* guides_command_undo */
|
||||
NULL /* guides_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -34,19 +34,19 @@ static CmdExecuteValue_t insert_point_command_execute(Command_t *parent);
|
|||
static void insert_point_command_undo(Command_t *parent);
|
||||
|
||||
static CommandClass_t insert_point_command_class = {
|
||||
NULL, /* insert_point_command_destruct */
|
||||
NULL, /* insert_point_command_destruct */
|
||||
insert_point_command_execute,
|
||||
insert_point_command_undo,
|
||||
NULL /* insert_point_command_redo */
|
||||
NULL /* insert_point_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
Command_t parent;
|
||||
Command_t parent;
|
||||
Polygon_t *polygon;
|
||||
gint x;
|
||||
gint y;
|
||||
gint edge;
|
||||
gint position;
|
||||
gint x;
|
||||
gint y;
|
||||
gint edge;
|
||||
gint position;
|
||||
} InsertPointCommand_t;
|
||||
|
||||
Command_t*
|
||||
|
@ -59,7 +59,7 @@ insert_point_command_new(Object_t *obj, gint x, gint y, gint edge)
|
|||
command->y = y;
|
||||
command->edge = edge;
|
||||
return command_init(&command->parent, _("Insert Point"),
|
||||
&insert_point_command_class);
|
||||
&insert_point_command_class);
|
||||
}
|
||||
|
||||
static CmdExecuteValue_t
|
||||
|
@ -75,7 +75,7 @@ insert_point_command_execute(Command_t *parent)
|
|||
command->position = command->edge - 1;
|
||||
} else {
|
||||
polygon->points = g_list_insert(polygon->points, (gpointer) point,
|
||||
command->edge);
|
||||
command->edge);
|
||||
command->position = command->edge;
|
||||
}
|
||||
redraw_preview();
|
||||
|
@ -92,5 +92,5 @@ insert_point_command_undo(Command_t *parent)
|
|||
|
||||
g_free(p->data);
|
||||
polygon->points = g_list_remove_link(polygon->points, p);
|
||||
redraw_preview(); /* Fix me! */
|
||||
redraw_preview(); /* Fix me! */
|
||||
}
|
||||
|
|
|
@ -37,8 +37,8 @@ static CmdExecuteValue_t move_command_execute(Command_t *parent);
|
|||
static CommandClass_t move_command_class = {
|
||||
move_command_destruct,
|
||||
move_command_execute,
|
||||
NULL, /* move_command_undo */
|
||||
NULL /* move_command_redo */
|
||||
NULL, /* move_command_undo */
|
||||
NULL /* move_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -58,7 +58,7 @@ typedef struct {
|
|||
gint image_width;
|
||||
gint image_height;
|
||||
|
||||
GdkCursorType cursor; /* Remember previous cursor */
|
||||
GdkCursorType cursor; /* Remember previous cursor */
|
||||
gboolean moved_first_time;
|
||||
} MoveCommand_t;
|
||||
|
||||
|
@ -73,7 +73,7 @@ move_command_new(Preview_t *preview, Object_t *obj, gint x, gint y)
|
|||
command->start_x = x;
|
||||
command->start_y = y;
|
||||
object_get_dimensions(obj, &command->obj_x, &command->obj_y,
|
||||
&command->obj_width, &command->obj_height);
|
||||
&command->obj_width, &command->obj_height);
|
||||
command->obj_start_x = command->obj_x;
|
||||
command->obj_start_y = command->obj_y;
|
||||
|
||||
|
@ -149,7 +149,7 @@ button_release(GtkWidget *widget, GdkEventButton *event, gpointer data)
|
|||
command->obj_y -= command->obj_start_y;
|
||||
if (command->obj_x || command->obj_y)
|
||||
command_list_add(object_move_command_new(command->obj, command->obj_x,
|
||||
command->obj_y));
|
||||
command->obj_y));
|
||||
|
||||
/* preview_thaw(); */
|
||||
}
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
static CmdExecuteValue_t move_down_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t move_down_command_class = {
|
||||
NULL, /* move_down_command_destruct */
|
||||
NULL, /* move_down_command_destruct */
|
||||
move_down_command_execute,
|
||||
NULL, /* move_down_command_undo */
|
||||
NULL /* move_down_command_redo */
|
||||
NULL, /* move_down_command_undo */
|
||||
NULL /* move_down_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -50,7 +50,7 @@ move_down_command_new(ObjectList_t *list)
|
|||
command->list = list;
|
||||
command->add = FALSE;
|
||||
return command_init(&command->parent, _("Move Down"),
|
||||
&move_down_command_class);
|
||||
&move_down_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -60,7 +60,7 @@ move_down_one_object(Object_t *obj, gpointer data)
|
|||
|
||||
if (command->add) {
|
||||
command_add_subcommand(&command->parent,
|
||||
object_down_command_new(command->list, obj));
|
||||
object_down_command_new(command->list, obj));
|
||||
command->add = FALSE;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -40,19 +40,19 @@ static CommandClass_t move_sash_command_class = {
|
|||
};
|
||||
|
||||
typedef struct {
|
||||
Command_t parent;
|
||||
Command_t parent;
|
||||
GtkWidget *widget;
|
||||
Object_t *obj;
|
||||
gint x;
|
||||
gint y;
|
||||
gint image_width;
|
||||
gint image_height;
|
||||
gint x;
|
||||
gint y;
|
||||
gint image_width;
|
||||
gint image_height;
|
||||
MoveSashFunc_t sash_func;
|
||||
} MoveSashCommand_t;
|
||||
|
||||
Command_t*
|
||||
move_sash_command_new(GtkWidget *widget, Object_t *obj,
|
||||
gint x, gint y, MoveSashFunc_t sash_func)
|
||||
gint x, gint y, MoveSashFunc_t sash_func)
|
||||
{
|
||||
MoveSashCommand_t *command = g_new(MoveSashCommand_t, 1);
|
||||
Command_t *parent;
|
||||
|
@ -66,7 +66,7 @@ move_sash_command_new(GtkWidget *widget, Object_t *obj,
|
|||
command->sash_func = sash_func;
|
||||
|
||||
parent = command_init(&command->parent, _("Move Sash"),
|
||||
&move_sash_command_class);
|
||||
&move_sash_command_class);
|
||||
command_add_subcommand(parent, edit_object_command_new(obj));
|
||||
|
||||
return parent;
|
||||
|
|
|
@ -32,10 +32,10 @@ static CmdExecuteValue_t move_selected_command_execute(Command_t *parent);
|
|||
static void move_selected_command_undo(Command_t *parent);
|
||||
|
||||
static CommandClass_t move_selected_command_class = {
|
||||
NULL, /* move_selected_command_destruct */
|
||||
NULL, /* move_selected_command_destruct */
|
||||
move_selected_command_execute,
|
||||
move_selected_command_undo,
|
||||
NULL /* move_selected_command_redo */
|
||||
NULL /* move_selected_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -53,7 +53,7 @@ move_selected_command_new(ObjectList_t *list, gint dx, gint dy)
|
|||
command->dx = dx;
|
||||
command->dy = dy;
|
||||
return command_init(&command->parent, _("Move Selected Objects"),
|
||||
&move_selected_command_class);
|
||||
&move_selected_command_class);
|
||||
}
|
||||
|
||||
static CmdExecuteValue_t
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
static CmdExecuteValue_t move_to_front_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t move_to_front_command_class = {
|
||||
NULL, /* move_to_front_command_destruct, */
|
||||
NULL, /* move_to_front_command_destruct, */
|
||||
move_to_front_command_execute,
|
||||
NULL, /* move_to_front_command_undo */
|
||||
NULL /* move_to_front_command_redo */
|
||||
NULL, /* move_to_front_command_undo */
|
||||
NULL /* move_to_front_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -48,7 +48,7 @@ move_to_front_command_new(ObjectList_t *list)
|
|||
MoveToFrontCommand_t *command = g_new(MoveToFrontCommand_t, 1);
|
||||
command->list = list;
|
||||
return command_init(&command->parent, _("Move To Front"),
|
||||
&move_to_front_command_class);
|
||||
&move_to_front_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -56,7 +56,7 @@ remove_one_object(Object_t *obj, gpointer data)
|
|||
{
|
||||
MoveToFrontCommand_t *command = (MoveToFrontCommand_t*) data;
|
||||
command_add_subcommand(&command->parent,
|
||||
delete_command_new(command->list, obj));
|
||||
delete_command_new(command->list, obj));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -64,7 +64,7 @@ add_one_object(Object_t *obj, gpointer data)
|
|||
{
|
||||
MoveToFrontCommand_t *command = (MoveToFrontCommand_t*) data;
|
||||
command_add_subcommand(&command->parent,
|
||||
create_command_new(command->list, obj));
|
||||
create_command_new(command->list, obj));
|
||||
}
|
||||
|
||||
static CmdExecuteValue_t
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
static CmdExecuteValue_t move_up_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t move_up_command_class = {
|
||||
NULL, /* move_up_command_destruct */
|
||||
NULL, /* move_up_command_destruct */
|
||||
move_up_command_execute,
|
||||
NULL, /* move_up_command_undo */
|
||||
NULL /* move_up_command_redo */
|
||||
NULL, /* move_up_command_undo */
|
||||
NULL /* move_up_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -59,7 +59,7 @@ move_up_one_object(Object_t *obj, gpointer data)
|
|||
|
||||
if (command->add) {
|
||||
command_add_subcommand(&command->parent,
|
||||
object_up_command_new(command->list, obj));
|
||||
object_up_command_new(command->list, obj));
|
||||
command->add = FALSE;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -36,7 +36,7 @@ static CommandClass_t object_down_command_class = {
|
|||
object_down_command_destruct,
|
||||
object_down_command_execute,
|
||||
object_down_command_undo,
|
||||
NULL /* object_down_command_redo */
|
||||
NULL /* object_down_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -52,7 +52,7 @@ object_down_command_new(ObjectList_t *list, Object_t *obj)
|
|||
command->list = list;
|
||||
command->obj = object_ref(obj);
|
||||
return command_init(&command->parent, _("Move Down"),
|
||||
&object_down_command_class);
|
||||
&object_down_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -36,7 +36,7 @@ static CommandClass_t object_move_command_class = {
|
|||
object_move_command_destruct,
|
||||
object_move_command_execute,
|
||||
object_move_command_undo,
|
||||
NULL /* object_move_command_redo */
|
||||
NULL /* object_move_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -54,7 +54,7 @@ object_move_command_new(Object_t *obj, gint dx, gint dy)
|
|||
command->dx = dx;
|
||||
command->dy = dy;
|
||||
return command_init(&command->parent, _("Move"),
|
||||
&object_move_command_class);
|
||||
&object_move_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -36,7 +36,7 @@ static CommandClass_t object_up_command_class = {
|
|||
object_up_command_destruct,
|
||||
object_up_command_execute,
|
||||
object_up_command_undo,
|
||||
NULL /* object_up_command_redo */
|
||||
NULL /* object_up_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -52,7 +52,7 @@ object_up_command_new(ObjectList_t *list, Object_t *obj)
|
|||
command->list = list;
|
||||
command->obj = object_ref(obj);
|
||||
return command_init(&command->parent, _("Move Up"),
|
||||
&object_up_command_class);
|
||||
&object_up_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
static CmdExecuteValue_t paste_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t paste_command_class = {
|
||||
NULL, /* paste_command_destruct, */
|
||||
NULL, /* paste_command_destruct, */
|
||||
paste_command_execute,
|
||||
NULL, /* paste_command_undo */
|
||||
NULL /* paste_command_redo */
|
||||
NULL, /* paste_command_undo */
|
||||
NULL /* paste_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -55,7 +55,7 @@ paste_one_object(Object_t *obj, gpointer data)
|
|||
{
|
||||
PasteCommand_t *command = (PasteCommand_t*) data;
|
||||
command_add_subcommand(&command->parent,
|
||||
create_command_new(command->list, obj));
|
||||
create_command_new(command->list, obj));
|
||||
}
|
||||
|
||||
static CmdExecuteValue_t
|
||||
|
|
|
@ -36,7 +36,7 @@ static CommandClass_t select_command_class = {
|
|||
select_command_destruct,
|
||||
select_command_execute,
|
||||
select_command_undo,
|
||||
NULL /* select_command_redo */
|
||||
NULL /* select_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
static CmdExecuteValue_t select_all_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t select_all_command_class = {
|
||||
NULL, /* select_all_command_destruct, */
|
||||
NULL, /* select_all_command_destruct, */
|
||||
select_all_command_execute,
|
||||
NULL, /* select_all_command_undo */
|
||||
NULL /* select_all_command_redo */
|
||||
NULL, /* select_all_command_undo */
|
||||
NULL /* select_all_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -48,7 +48,7 @@ select_all_command_new(ObjectList_t *list)
|
|||
SelectAllCommand_t *command = g_new(SelectAllCommand_t, 1);
|
||||
command->list = list;
|
||||
return command_init(&command->parent, _("Select All"),
|
||||
&select_all_command_class);
|
||||
&select_all_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
static CmdExecuteValue_t select_next_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t select_next_command_class = {
|
||||
NULL, /* select_next_command_destruct */
|
||||
NULL, /* select_next_command_destruct */
|
||||
select_next_command_execute,
|
||||
NULL, /* select_next_command_undo */
|
||||
NULL /* select_next_command_redo */
|
||||
NULL, /* select_next_command_undo */
|
||||
NULL /* select_next_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -48,7 +48,7 @@ select_next_command_new(ObjectList_t *list)
|
|||
SelectNextCommand_t *command = g_new(SelectNextCommand_t, 1);
|
||||
command->list = list;
|
||||
return command_init(&command->parent, _("Select Next"),
|
||||
&select_next_command_class);
|
||||
&select_next_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
static CmdExecuteValue_t select_prev_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t select_prev_command_class = {
|
||||
NULL, /* select_prev_command_destruct */
|
||||
NULL, /* select_prev_command_destruct */
|
||||
select_prev_command_execute,
|
||||
NULL, /* select_prev_command_undo */
|
||||
NULL /* select_prev_command_redo */
|
||||
NULL, /* select_prev_command_undo */
|
||||
NULL /* select_prev_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -48,7 +48,7 @@ select_prev_command_new(ObjectList_t *list)
|
|||
SelectPrevCommand_t *command = g_new(SelectPrevCommand_t, 1);
|
||||
command->list = list;
|
||||
return command_init(&command->parent, _("Select Previous"),
|
||||
&select_prev_command_class);
|
||||
&select_prev_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -33,25 +33,25 @@
|
|||
static CmdExecuteValue_t select_region_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t select_region_command_class = {
|
||||
NULL, /* select_region_command_destruct, */
|
||||
NULL, /* select_region_command_destruct, */
|
||||
select_region_command_execute,
|
||||
NULL, /* select_region_command_undo */
|
||||
NULL /* select_region_command_redo */
|
||||
NULL, /* select_region_command_undo */
|
||||
NULL /* select_region_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
Command_t parent;
|
||||
GtkWidget *widget;
|
||||
Command_t parent;
|
||||
GtkWidget *widget;
|
||||
ObjectList_t *list;
|
||||
gint x;
|
||||
gint y;
|
||||
Object_t *obj;
|
||||
Command_t *unselect_command;
|
||||
gint x;
|
||||
gint y;
|
||||
Object_t *obj;
|
||||
Command_t *unselect_command;
|
||||
} SelectRegionCommand_t;
|
||||
|
||||
Command_t*
|
||||
select_region_command_new(GtkWidget *widget, ObjectList_t *list, gint x,
|
||||
gint y)
|
||||
gint y)
|
||||
{
|
||||
SelectRegionCommand_t *command = g_new(SelectRegionCommand_t, 1);
|
||||
Command_t *sub_command;
|
||||
|
@ -61,7 +61,7 @@ select_region_command_new(GtkWidget *widget, ObjectList_t *list, gint x,
|
|||
command->x = x;
|
||||
command->y = y;
|
||||
(void) command_init(&command->parent, _("Select Region"),
|
||||
&select_region_command_class);
|
||||
&select_region_command_class);
|
||||
|
||||
sub_command = unselect_all_command_new(list, NULL);
|
||||
command_add_subcommand(&command->parent, sub_command);
|
||||
|
@ -112,14 +112,14 @@ select_release(GtkWidget *widget, GdkEventButton *event, gpointer data)
|
|||
|
||||
id = object_list_add_select_cb(command->list, select_one_object, command);
|
||||
count = object_list_select_region(command->list, rectangle->x, rectangle->y,
|
||||
rectangle->width, rectangle->height);
|
||||
rectangle->width, rectangle->height);
|
||||
object_list_remove_select_cb(command->list, id);
|
||||
|
||||
if (count) {
|
||||
command_list_add(&command->parent);
|
||||
} else { /* Nothing selected */
|
||||
} else { /* Nothing selected */
|
||||
if (command->unselect_command->sub_commands)
|
||||
command_list_add(&command->parent);
|
||||
command_list_add(&command->parent);
|
||||
}
|
||||
object_unref(obj);
|
||||
}
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
static CmdExecuteValue_t send_to_back_command_execute(Command_t *parent);
|
||||
|
||||
static CommandClass_t send_to_back_command_class = {
|
||||
NULL, /* send_to_back_command_destruct, */
|
||||
NULL, /* send_to_back_command_destruct, */
|
||||
send_to_back_command_execute,
|
||||
NULL, /* send_to_back_command_undo */
|
||||
NULL /* send_to_back_command_redo */
|
||||
NULL, /* send_to_back_command_undo */
|
||||
NULL /* send_to_back_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -48,7 +48,7 @@ send_to_back_command_new(ObjectList_t *list)
|
|||
SendToBackCommand_t *command = g_new(SendToBackCommand_t, 1);
|
||||
command->list = list;
|
||||
return command_init(&command->parent, _("Send To Back"),
|
||||
&send_to_back_command_class);
|
||||
&send_to_back_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -56,7 +56,7 @@ remove_one_object(Object_t *obj, gpointer data)
|
|||
{
|
||||
SendToBackCommand_t *command = (SendToBackCommand_t*) data;
|
||||
command_add_subcommand(&command->parent,
|
||||
delete_command_new(command->list, obj));
|
||||
delete_command_new(command->list, obj));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -64,7 +64,7 @@ add_one_object(Object_t *obj, gpointer data)
|
|||
{
|
||||
SendToBackCommand_t *command = (SendToBackCommand_t*) data;
|
||||
command_add_subcommand(&command->parent,
|
||||
create_command_new(command->list, obj));
|
||||
create_command_new(command->list, obj));
|
||||
}
|
||||
|
||||
static CmdExecuteValue_t
|
||||
|
|
|
@ -36,7 +36,7 @@ static CommandClass_t unselect_command_class = {
|
|||
unselect_command_destruct,
|
||||
unselect_command_execute,
|
||||
unselect_command_undo,
|
||||
NULL /* unselect_command_redo */
|
||||
NULL /* unselect_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -50,7 +50,7 @@ unselect_command_new(Object_t *obj)
|
|||
UnselectCommand_t *command = g_new(UnselectCommand_t, 1);
|
||||
command->obj = object_ref(obj);
|
||||
return command_init(&command->parent, _("Unselect"),
|
||||
&unselect_command_class);
|
||||
&unselect_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -36,8 +36,8 @@ static CmdExecuteValue_t unselect_all_command_execute(Command_t *command);
|
|||
static CommandClass_t unselect_all_command_class = {
|
||||
unselect_all_command_destruct,
|
||||
unselect_all_command_execute,
|
||||
NULL, /* unselect_all_command_undo */
|
||||
NULL /* unselect_all_command_redo */
|
||||
NULL, /* unselect_all_command_undo */
|
||||
NULL /* unselect_all_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -53,7 +53,7 @@ unselect_all_command_new(ObjectList_t *list, Object_t *exception)
|
|||
command->list = list;
|
||||
command->exception = (exception) ? object_ref(exception) : exception;
|
||||
return command_init(&command->parent, _("Unselect All"),
|
||||
&unselect_all_command_class);
|
||||
&unselect_all_command_class);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -79,7 +79,7 @@ unselect_all_command_execute(Command_t *parent)
|
|||
CmdExecuteValue_t rvalue;
|
||||
|
||||
id = object_list_add_select_cb(command->list, select_one_object,
|
||||
command);
|
||||
command);
|
||||
if (object_list_deselect_all(command->list, command->exception)) {
|
||||
rvalue = CMD_APPEND;
|
||||
} else {
|
||||
|
|
|
@ -37,7 +37,7 @@ static CommandList_t *_current_command_list = &_command_list;
|
|||
|
||||
static void
|
||||
command_list_callback_add(CommandListCallback_t *list,
|
||||
CommandListCallbackFunc_t func, gpointer data)
|
||||
CommandListCallbackFunc_t func, gpointer data)
|
||||
{
|
||||
CommandListCB_t *cb = g_new(CommandListCB_t, 1);
|
||||
cb->func = func;
|
||||
|
@ -133,10 +133,10 @@ subcommand_list_add(CommandList_t *list, Command_t *command)
|
|||
}
|
||||
|
||||
static CommandClass_t parent_command_class = {
|
||||
NULL, /* parent_command_destruct */
|
||||
NULL, /* parent_command_execute */
|
||||
NULL, /* parent_command_undo */
|
||||
NULL /* parent_command_redo */
|
||||
NULL, /* parent_command_destruct */
|
||||
NULL, /* parent_command_execute */
|
||||
NULL, /* parent_command_undo */
|
||||
NULL /* parent_command_redo */
|
||||
};
|
||||
|
||||
static Command_t*
|
||||
|
@ -179,22 +179,22 @@ _command_list_set_undo_level(CommandList_t *list, gint level)
|
|||
GList *p, *q;
|
||||
/* first remove data at the front */
|
||||
for (p = list->list; diff && p != list->undo; p = q, diff--) {
|
||||
Command_t *curr = (Command_t*) p->data;
|
||||
q = p->next;
|
||||
command_destruct(curr);
|
||||
list->list = g_list_remove_link(list->list, p);
|
||||
Command_t *curr = (Command_t*) p->data;
|
||||
q = p->next;
|
||||
command_destruct(curr);
|
||||
list->list = g_list_remove_link(list->list, p);
|
||||
}
|
||||
|
||||
/* If still to long start removing redo levels at the end */
|
||||
for (p = g_list_last(list->list); diff && p != list->undo; p = q,
|
||||
diff--) {
|
||||
Command_t *curr = (Command_t*) p->data;
|
||||
q = p->prev;
|
||||
command_destruct(curr);
|
||||
list->list = g_list_remove_link(list->list, p);
|
||||
diff--) {
|
||||
Command_t *curr = (Command_t*) p->data;
|
||||
q = p->prev;
|
||||
command_destruct(curr);
|
||||
list->list = g_list_remove_link(list->list, p);
|
||||
}
|
||||
command_list_callback_call(&list->update_cb,
|
||||
(Command_t*) list->undo->data);
|
||||
(Command_t*) list->undo->data);
|
||||
}
|
||||
list->undo_levels = level;
|
||||
}
|
||||
|
@ -233,9 +233,9 @@ command_list_execute(CommandList_t *list)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Command_t *command = (Command_t*) p->data;
|
||||
if (command->sub_commands)
|
||||
command_list_execute(command->sub_commands);
|
||||
command_list_execute(command->sub_commands);
|
||||
if (command->class->execute)
|
||||
(void) command->class->execute(command);
|
||||
(void) command->class->execute(command);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,13 +246,13 @@ command_execute(Command_t *command)
|
|||
command->locked = FALSE;
|
||||
} else {
|
||||
if (command->sub_commands)
|
||||
command_list_execute(command->sub_commands);
|
||||
command_list_execute(command->sub_commands);
|
||||
if (command->class->execute) {
|
||||
CmdExecuteValue_t value = command->class->execute(command);
|
||||
if (value == CMD_APPEND)
|
||||
command_list_add(command);
|
||||
else if (value == CMD_DESTRUCT)
|
||||
command_destruct(command);
|
||||
CmdExecuteValue_t value = command->class->execute(command);
|
||||
if (value == CMD_APPEND)
|
||||
command_list_add(command);
|
||||
else if (value == CMD_DESTRUCT)
|
||||
command_destruct(command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -357,10 +357,10 @@ command_add_subcommand(Command_t *command, Command_t *sub_command)
|
|||
static CmdExecuteValue_t basic_command_execute(Command_t *command);
|
||||
|
||||
static CommandClass_t basic_command_class = {
|
||||
NULL, /* basic_command_destruct */
|
||||
NULL, /* basic_command_destruct */
|
||||
basic_command_execute,
|
||||
NULL,
|
||||
NULL /* basic_command_redo */
|
||||
NULL /* basic_command_redo */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -43,8 +43,8 @@ struct CommandClass_t {
|
|||
struct Command_t {
|
||||
CommandClass_t *class;
|
||||
CommandList_t *sub_commands;
|
||||
const gchar *name;
|
||||
gboolean locked;
|
||||
const gchar *name;
|
||||
gboolean locked;
|
||||
};
|
||||
|
||||
|
||||
|
@ -65,8 +65,8 @@ struct CommandList_t {
|
|||
CommandList_t *parent;
|
||||
gint undo_levels;
|
||||
GList *list;
|
||||
GList *undo; /* Pointer to current undo command */
|
||||
GList *redo; /* Pointer to current redo command */
|
||||
GList *undo; /* Pointer to current undo command */
|
||||
GList *redo; /* Pointer to current redo command */
|
||||
CommandListCallback_t update_cb;
|
||||
};
|
||||
|
||||
|
@ -84,7 +84,7 @@ Command_t *command_list_get_redo_command(void);
|
|||
|
||||
Command_t *command_new(void (*func)(void));
|
||||
Command_t *command_init(Command_t *command, const gchar *name,
|
||||
CommandClass_t *class);
|
||||
CommandClass_t *class);
|
||||
void command_execute(Command_t *command);
|
||||
void command_undo(Command_t *command);
|
||||
void command_redo(Command_t *command);
|
||||
|
|
|
@ -37,13 +37,13 @@ Command_t *delete_command_new(ObjectList_t *list, Object_t *obj);
|
|||
Command_t *delete_point_command_new(Object_t *obj, GdkPoint *point);
|
||||
Command_t *edit_object_command_new(Object_t *obj);
|
||||
Command_t *gimp_guides_command_new(ObjectList_t *list,
|
||||
GimpDrawable *_drawable);
|
||||
GimpDrawable *_drawable);
|
||||
Command_t *guides_command_new(ObjectList_t *list);
|
||||
Command_t *insert_point_command_new(Object_t *obj, gint x, gint y, gint edge);
|
||||
Command_t *move_down_command_new(ObjectList_t *list);
|
||||
Command_t *move_command_new(Preview_t *preview, Object_t *obj, gint x, gint y);
|
||||
Command_t *move_sash_command_new(GtkWidget *widget, Object_t *obj,
|
||||
gint x, gint y, MoveSashFunc_t sash_func);
|
||||
gint x, gint y, MoveSashFunc_t sash_func);
|
||||
Command_t *move_selected_command_new(ObjectList_t *list, gint dx, gint dy);
|
||||
Command_t *move_to_front_command_new(ObjectList_t *list);
|
||||
Command_t *move_up_command_new(ObjectList_t *list);
|
||||
|
@ -56,7 +56,7 @@ Command_t *select_command_new(Object_t *obj);
|
|||
Command_t *select_next_command_new(ObjectList_t *list);
|
||||
Command_t *select_prev_command_new(ObjectList_t *list);
|
||||
Command_t *select_region_command_new(GtkWidget *widget, ObjectList_t *list,
|
||||
gint x, gint y);
|
||||
gint x, gint y);
|
||||
Command_t *send_to_back_command_new(ObjectList_t *list);
|
||||
Command_t *unselect_all_command_new(ObjectList_t *list, Object_t *exception);
|
||||
Command_t *unselect_command_new(Object_t *obj);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -108,7 +108,7 @@ typedef union YYSTYPE
|
|||
}
|
||||
/* Line 1489 of yacc.c. */
|
||||
#line 111 "y.tab.h"
|
||||
YYSTYPE;
|
||||
YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
|
|
|
@ -59,7 +59,7 @@ dialog_response (GtkWidget *widget,
|
|||
|
||||
void
|
||||
default_dialog_set_ok_cb(DefaultDialog_t *dialog, void (*ok_cb)(gpointer),
|
||||
gpointer ok_cb_data)
|
||||
gpointer ok_cb_data)
|
||||
{
|
||||
dialog->ok_cb = ok_cb;
|
||||
dialog->ok_cb_data = ok_cb_data;
|
||||
|
@ -67,8 +67,8 @@ default_dialog_set_ok_cb(DefaultDialog_t *dialog, void (*ok_cb)(gpointer),
|
|||
|
||||
void
|
||||
default_dialog_set_apply_cb(DefaultDialog_t *dialog,
|
||||
void (*apply_cb)(gpointer),
|
||||
gpointer apply_cb_data)
|
||||
void (*apply_cb)(gpointer),
|
||||
gpointer apply_cb_data)
|
||||
{
|
||||
dialog->apply_cb = apply_cb;
|
||||
dialog->apply_cb_data = apply_cb_data;
|
||||
|
@ -76,8 +76,8 @@ default_dialog_set_apply_cb(DefaultDialog_t *dialog,
|
|||
|
||||
void
|
||||
default_dialog_set_cancel_cb(DefaultDialog_t *dialog,
|
||||
void (*cancel_cb)(gpointer),
|
||||
gpointer cancel_cb_data)
|
||||
void (*cancel_cb)(gpointer),
|
||||
gpointer cancel_cb_data)
|
||||
{
|
||||
dialog->cancel_cb = cancel_cb;
|
||||
dialog->cancel_cb_data = cancel_cb_data;
|
||||
|
@ -116,7 +116,7 @@ make_default_dialog (const gchar *title)
|
|||
G_CALLBACK (dialog_response),
|
||||
data);
|
||||
g_signal_connect (data->dialog, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&data->dialog);
|
||||
|
||||
data->vbox = gtk_vbox_new (FALSE, 12);
|
||||
|
|
|
@ -25,28 +25,28 @@
|
|||
|
||||
typedef struct
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *ok;
|
||||
GtkWidget *apply;
|
||||
GtkWidget *cancel;
|
||||
void (*ok_cb)(gpointer);
|
||||
gpointer ok_cb_data;
|
||||
void (*apply_cb)(gpointer);
|
||||
gpointer apply_cb_data;
|
||||
void (*cancel_cb)(gpointer);
|
||||
gpointer cancel_cb_data;
|
||||
GtkWidget *ok;
|
||||
GtkWidget *apply;
|
||||
GtkWidget *cancel;
|
||||
void (*ok_cb)(gpointer);
|
||||
gpointer ok_cb_data;
|
||||
void (*apply_cb)(gpointer);
|
||||
gpointer apply_cb_data;
|
||||
void (*cancel_cb)(gpointer);
|
||||
gpointer cancel_cb_data;
|
||||
} DefaultDialog_t;
|
||||
|
||||
DefaultDialog_t *make_default_dialog(const gchar *title);
|
||||
void default_dialog_set_ok_cb(DefaultDialog_t *dialog, void (*ok_cb)(gpointer),
|
||||
gpointer ok_cb_data);
|
||||
gpointer ok_cb_data);
|
||||
void default_dialog_set_apply_cb(DefaultDialog_t *dialog,
|
||||
void (*apply_cb)(gpointer),
|
||||
gpointer apply_cb_data);
|
||||
void (*apply_cb)(gpointer),
|
||||
gpointer apply_cb_data);
|
||||
void default_dialog_set_cancel_cb(DefaultDialog_t *dialog,
|
||||
void (*ok_cb)(gpointer),
|
||||
gpointer ok_cb_data);
|
||||
void (*ok_cb)(gpointer),
|
||||
gpointer ok_cb_data);
|
||||
void default_dialog_show(DefaultDialog_t *dialog);
|
||||
void default_dialog_hide_cancel_button(DefaultDialog_t *dialog);
|
||||
void default_dialog_hide_apply_button(DefaultDialog_t *dialog);
|
||||
|
@ -54,6 +54,6 @@ void default_dialog_hide_help_button(DefaultDialog_t *dialog);
|
|||
void default_dialog_set_title(DefaultDialog_t *dialog, const gchar *title);
|
||||
void default_dialog_set_label(DefaultDialog_t *dialog, const gchar *text);
|
||||
GtkWidget *default_dialog_add_table(DefaultDialog_t *dialog, gint rows,
|
||||
gint cols);
|
||||
gint cols);
|
||||
|
||||
#endif /* _IMAP_DEFAULT_DIALOG_H */
|
||||
|
|
|
@ -100,11 +100,11 @@ set_url(GtkWidget *widget, AreaInfoDialog_t *param, const gchar *prefix)
|
|||
}
|
||||
else
|
||||
{
|
||||
p = strchr(url, ':'); /* 'mailto:' */
|
||||
p = strchr(url, ':'); /* 'mailto:' */
|
||||
if (p)
|
||||
{
|
||||
p++;
|
||||
if (*p == '/') /* 'file:/' */
|
||||
if (*p == '/') /* 'file:/' */
|
||||
p++;
|
||||
}
|
||||
else
|
||||
|
@ -171,7 +171,7 @@ select_email_cb(GtkWidget *widget, AreaInfoDialog_t *param)
|
|||
|
||||
static void
|
||||
append_page (GtkWidget *notebook, GtkWidget *page, const gchar *icon_name,
|
||||
const gchar *label_name)
|
||||
const gchar *label_name)
|
||||
{
|
||||
GtkWidget *hbox, *icon, *label;
|
||||
|
||||
|
@ -211,49 +211,49 @@ create_link_tab(AreaInfoDialog_t *dialog, GtkWidget *notebook)
|
|||
gtk_widget_show(subtable);
|
||||
|
||||
dialog->web_site = create_radio_button_in_table(subtable, NULL, 0, 0,
|
||||
_("_Web Site"));
|
||||
_("_Web Site"));
|
||||
g_signal_connect(dialog->web_site, "toggled",
|
||||
G_CALLBACK (select_web_cb), (gpointer) dialog);
|
||||
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->web_site));
|
||||
|
||||
dialog->ftp_site = create_radio_button_in_table(subtable, group, 0, 1,
|
||||
_("_Ftp Site"));
|
||||
_("_Ftp Site"));
|
||||
g_signal_connect(dialog->ftp_site, "toggled",
|
||||
G_CALLBACK (select_ftp_cb), (gpointer) dialog);
|
||||
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->ftp_site));
|
||||
|
||||
dialog->gopher = create_radio_button_in_table(subtable, group, 0, 2,
|
||||
_("_Gopher"));
|
||||
_("_Gopher"));
|
||||
g_signal_connect(dialog->gopher, "toggled",
|
||||
G_CALLBACK (select_gopher_cb), (gpointer) dialog);
|
||||
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->gopher));
|
||||
|
||||
dialog->other = create_radio_button_in_table(subtable, group, 0, 3,
|
||||
_("Ot_her"));
|
||||
_("Ot_her"));
|
||||
g_signal_connect(dialog->other, "toggled",
|
||||
G_CALLBACK (select_other_cb), (gpointer) dialog);
|
||||
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->other));
|
||||
|
||||
dialog->file = create_radio_button_in_table(subtable, group, 1, 0,
|
||||
_("F_ile"));
|
||||
_("F_ile"));
|
||||
g_signal_connect(dialog->file, "toggled",
|
||||
G_CALLBACK (select_file_cb), (gpointer) dialog);
|
||||
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->file));
|
||||
|
||||
dialog->wais = create_radio_button_in_table(subtable, group, 1, 1,
|
||||
_("WAI_S"));
|
||||
_("WAI_S"));
|
||||
g_signal_connect(dialog->wais, "toggled",
|
||||
G_CALLBACK (select_wais_cb), (gpointer) dialog);
|
||||
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->wais));
|
||||
|
||||
dialog->telnet = create_radio_button_in_table(subtable, group, 1, 2,
|
||||
_("Tel_net"));
|
||||
_("Tel_net"));
|
||||
g_signal_connect(dialog->telnet, "toggled",
|
||||
G_CALLBACK (select_telnet_cb), (gpointer) dialog);
|
||||
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(dialog->telnet));
|
||||
|
||||
dialog->email = create_radio_button_in_table(subtable, group, 1, 3,
|
||||
_("e-_mail"));
|
||||
_("e-_mail"));
|
||||
g_signal_connect(dialog->email, "toggled",
|
||||
G_CALLBACK (select_email_cb), (gpointer) dialog);
|
||||
|
||||
|
@ -266,13 +266,13 @@ create_link_tab(AreaInfoDialog_t *dialog, GtkWidget *notebook)
|
|||
gtk_table_attach_defaults(GTK_TABLE(table), browse->hbox, 0, 1, 3, 4);
|
||||
dialog->url = browse->file;
|
||||
g_signal_connect(dialog->url, "changed", G_CALLBACK(url_changed),
|
||||
dialog);
|
||||
dialog);
|
||||
gtk_label_set_mnemonic_widget(GTK_LABEL(label), dialog->url);
|
||||
|
||||
dialog->relative_link = create_check_button_in_table(table, 4, 0,
|
||||
_("Relati_ve link"));
|
||||
_("Relati_ve link"));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->relative_link),
|
||||
TRUE);
|
||||
TRUE);
|
||||
|
||||
label = create_label_in_table(
|
||||
table, 6, 0,
|
||||
|
@ -293,8 +293,8 @@ geometry_changed(Object_t *obj, gpointer data)
|
|||
dialog->geometry_lock = FALSE;
|
||||
} else {
|
||||
if (dialog->obj == obj) {
|
||||
object_update_info_widget(obj, dialog->infotab);
|
||||
obj->class->assign(obj, dialog->clone);
|
||||
object_update_info_widget(obj, dialog->infotab);
|
||||
obj->class->assign(obj, dialog->clone);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ create_info_tab(AreaInfoDialog_t *dialog, GtkWidget *notebook)
|
|||
dialog->infotab = obj->class->create_info_widget(frame);
|
||||
|
||||
append_page (notebook, vbox, obj->class->get_stock_icon_name (),
|
||||
gettext (obj->class->name));
|
||||
gettext (obj->class->name));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -386,7 +386,7 @@ edit_area_apply_cb(gpointer data)
|
|||
object_set_target(obj, gtk_entry_get_text(GTK_ENTRY(param->target)));
|
||||
object_set_comment(obj, gtk_entry_get_text(GTK_ENTRY(param->comment)));
|
||||
object_set_mouse_over(obj,
|
||||
gtk_entry_get_text(GTK_ENTRY(param->mouse_over)));
|
||||
gtk_entry_get_text(GTK_ENTRY(param->mouse_over)));
|
||||
object_set_mouse_out(obj, gtk_entry_get_text(GTK_ENTRY(param->mouse_out)));
|
||||
object_set_focus(obj, gtk_entry_get_text(GTK_ENTRY(param->focus)));
|
||||
object_set_blur(obj, gtk_entry_get_text(GTK_ENTRY(param->blur)));
|
||||
|
@ -434,7 +434,7 @@ edit_area_cancel_cb(gpointer data)
|
|||
|
||||
static void
|
||||
switch_page(GtkWidget *widget, gpointer page, gint page_num,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
AreaInfoDialog_t *param = (AreaInfoDialog_t*) data;
|
||||
if (page_num == 0) {
|
||||
|
@ -477,7 +477,7 @@ create_edit_area_info_dialog(Object_t *obj)
|
|||
|
||||
void
|
||||
edit_area_info_dialog_show(AreaInfoDialog_t *dialog, Object_t *obj,
|
||||
gboolean add)
|
||||
gboolean add)
|
||||
{
|
||||
gchar *title;
|
||||
|
||||
|
@ -500,7 +500,7 @@ edit_area_info_dialog_show(AreaInfoDialog_t *dialog, Object_t *obj,
|
|||
object_list_add_geometry_cb(obj->list, geometry_changed, dialog);
|
||||
|
||||
title = g_strdup_printf (_("Area #%d Settings"),
|
||||
object_get_position_in_list(obj) + 1);
|
||||
object_get_position_in_list(obj) + 1);
|
||||
default_dialog_set_title(dialog->dialog, title);
|
||||
g_free (title);
|
||||
default_dialog_show(dialog->dialog);
|
||||
|
|
|
@ -30,37 +30,37 @@ typedef struct AreaInfoDialog_t AreaInfoDialog_t;
|
|||
|
||||
struct AreaInfoDialog_t {
|
||||
DefaultDialog_t *dialog;
|
||||
Object_t *obj;
|
||||
Object_t *clone;
|
||||
gboolean add;
|
||||
gboolean geometry_lock;
|
||||
gboolean preview;
|
||||
Object_t *obj;
|
||||
Object_t *clone;
|
||||
gboolean add;
|
||||
gboolean geometry_lock;
|
||||
gboolean preview;
|
||||
|
||||
GtkWidget *notebook;
|
||||
GtkWidget *web_site;
|
||||
GtkWidget *ftp_site;
|
||||
GtkWidget *gopher;
|
||||
GtkWidget *other;
|
||||
GtkWidget *file;
|
||||
GtkWidget *wais;
|
||||
GtkWidget *telnet;
|
||||
GtkWidget *email;
|
||||
GtkWidget *url;
|
||||
GtkWidget *relative_link;
|
||||
GtkWidget *target;
|
||||
GtkWidget *comment;
|
||||
GtkWidget *mouse_over;
|
||||
GtkWidget *mouse_out;
|
||||
GtkWidget *focus;
|
||||
GtkWidget *blur;
|
||||
GtkWidget *browse;
|
||||
gpointer infotab;
|
||||
gpointer geometry_cb_id;
|
||||
GtkWidget *notebook;
|
||||
GtkWidget *web_site;
|
||||
GtkWidget *ftp_site;
|
||||
GtkWidget *gopher;
|
||||
GtkWidget *other;
|
||||
GtkWidget *file;
|
||||
GtkWidget *wais;
|
||||
GtkWidget *telnet;
|
||||
GtkWidget *email;
|
||||
GtkWidget *url;
|
||||
GtkWidget *relative_link;
|
||||
GtkWidget *target;
|
||||
GtkWidget *comment;
|
||||
GtkWidget *mouse_over;
|
||||
GtkWidget *mouse_out;
|
||||
GtkWidget *focus;
|
||||
GtkWidget *blur;
|
||||
GtkWidget *browse;
|
||||
gpointer infotab;
|
||||
gpointer geometry_cb_id;
|
||||
};
|
||||
|
||||
AreaInfoDialog_t *create_edit_area_info_dialog(Object_t *obj);
|
||||
void edit_area_info_dialog_show(AreaInfoDialog_t *dialog, Object_t *obj,
|
||||
gboolean add);
|
||||
gboolean add);
|
||||
void edit_area_info_dialog_emit_geometry_signal(AreaInfoDialog_t *dialog);
|
||||
|
||||
#endif /* _IMAP_EDIT_AREA_INFO_H */
|
||||
|
|
|
@ -176,7 +176,7 @@ do_file_error_dialog (const char *error,
|
|||
gimp_filename_to_utf8 (filename));
|
||||
|
||||
g_signal_connect_swapped (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
dialog);
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
dialog);
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ grid_assign_value(GtkWidget *widget, gpointer data, gint *value)
|
|||
GridDialog_t *dialog = (GridDialog_t*) data;
|
||||
if (dialog->enable_preview) {
|
||||
*value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
|
||||
redraw_preview(); /* Fix me! */
|
||||
redraw_preview(); /* Fix me! */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ width_changed_cb(GtkWidget *widget, gpointer data)
|
|||
|
||||
grid_assign_value(widget, data, &grid_width);
|
||||
if (gimp_chain_button_get_active(
|
||||
GIMP_CHAIN_BUTTON(dialog->chain_width_height))) {
|
||||
GIMP_CHAIN_BUTTON(dialog->chain_width_height))) {
|
||||
gint value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->height), value);
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ height_changed_cb(GtkWidget *widget, gpointer data)
|
|||
|
||||
grid_assign_value(widget, data, &grid_height);
|
||||
if (gimp_chain_button_get_active(
|
||||
GIMP_CHAIN_BUTTON(dialog->chain_width_height))) {
|
||||
GIMP_CHAIN_BUTTON(dialog->chain_width_height))) {
|
||||
gint value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->width), value);
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ left_changed_cb(GtkWidget *widget, gpointer data)
|
|||
|
||||
grid_assign_value(widget, data, &grid_left);
|
||||
if (gimp_chain_button_get_active(
|
||||
GIMP_CHAIN_BUTTON(dialog->chain_left_top))) {
|
||||
GIMP_CHAIN_BUTTON(dialog->chain_left_top))) {
|
||||
gint value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->top), value);
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ top_changed_cb(GtkWidget *widget, gpointer data)
|
|||
|
||||
grid_assign_value(widget, data, &grid_top);
|
||||
if (gimp_chain_button_get_active(
|
||||
GIMP_CHAIN_BUTTON(dialog->chain_left_top))) {
|
||||
GIMP_CHAIN_BUTTON(dialog->chain_left_top))) {
|
||||
gint value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->left), value);
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ create_grid_settings_dialog(void)
|
|||
gtk_widget_show(chain_button);
|
||||
|
||||
data->preview = create_check_button_in_table(main_table, 3, 0,
|
||||
_("_Preview"));
|
||||
_("_Preview"));
|
||||
g_signal_connect(data->preview, "toggled",
|
||||
G_CALLBACK (toggle_preview_cb), (gpointer) data);
|
||||
gtk_widget_show(data->preview);
|
||||
|
@ -343,8 +343,8 @@ draw_crosses(GdkWindow *window, GdkGC* gc, gint width, gint height)
|
|||
|
||||
for (x = grid_left; x < width; x += grid_width) {
|
||||
for (y = grid_top; y < height; y += grid_height) {
|
||||
draw_line(window, gc, x - 3, y, x + 3, y);
|
||||
draw_line(window, gc, x, y - 3, x, y + 3);
|
||||
draw_line(window, gc, x - 3, y, x + 3, y);
|
||||
draw_line(window, gc, x, y - 3, x, y + 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1085,28 +1085,28 @@ key_press_cb(GtkWidget *widget, GdkEventKey *event)
|
|||
|
||||
switch (event->keyval) {
|
||||
case GDK_Left:
|
||||
if (ctrl)
|
||||
if (ctrl)
|
||||
move_sash_selected_objects(-1, 0, shift);
|
||||
else
|
||||
move_selected_objects(-1, 0, shift);
|
||||
handled = TRUE;
|
||||
break;
|
||||
case GDK_Right:
|
||||
if (ctrl)
|
||||
if (ctrl)
|
||||
move_sash_selected_objects(1, 0, shift);
|
||||
else
|
||||
move_selected_objects(1, 0, shift);
|
||||
handled = TRUE;
|
||||
break;
|
||||
case GDK_Up:
|
||||
if (ctrl)
|
||||
if (ctrl)
|
||||
move_sash_selected_objects(0, -1, shift);
|
||||
else
|
||||
move_selected_objects(0, -1, shift);
|
||||
handled = TRUE;
|
||||
break;
|
||||
case GDK_Down:
|
||||
if (ctrl)
|
||||
if (ctrl)
|
||||
move_sash_selected_objects(0, 1, shift);
|
||||
else
|
||||
move_selected_objects(0, 1, shift);
|
||||
|
|
|
@ -41,7 +41,7 @@ typedef struct {
|
|||
gchar *description;
|
||||
gint old_image_width;
|
||||
gint old_image_height;
|
||||
gboolean color; /* Color (TRUE) or Gray (FALSE) */
|
||||
gboolean color; /* Color (TRUE) or Gray (FALSE) */
|
||||
gboolean show_gray;
|
||||
} MapInfo_t;
|
||||
|
||||
|
@ -66,13 +66,13 @@ void main_toolbar_set_grid(gboolean active);
|
|||
void set_zoom(gint zoom_factor);
|
||||
gint get_real_coord(gint coord);
|
||||
void draw_line(GdkWindow *window, GdkGC *gc, gint x1, gint y1, gint x2,
|
||||
gint y2);
|
||||
gint y2);
|
||||
void draw_rectangle(GdkWindow *window, GdkGC *gc, gint filled, gint x, gint y,
|
||||
gint width, gint height);
|
||||
gint width, gint height);
|
||||
void draw_arc(GdkWindow *window, GdkGC *gc, gint filled, gint x, gint y,
|
||||
gint width, gint height, gint angle1, gint angle2);
|
||||
gint width, gint height, gint angle1, gint angle2);
|
||||
void draw_circle(GdkWindow *window, GdkGC *gc, gint filled, gint x, gint y,
|
||||
gint r);
|
||||
gint r);
|
||||
void draw_polygon(GdkWindow *window, GdkGC *gc, GList *list);
|
||||
|
||||
const char *get_filename(void);
|
||||
|
|
|
@ -393,19 +393,19 @@ make_menu(GtkWidget *main_vbox, GtkWidget *window)
|
|||
gtk_action_group_set_translation_domain (action_group, NULL);
|
||||
|
||||
gtk_action_group_add_actions (action_group, entries, G_N_ELEMENTS (entries),
|
||||
window);
|
||||
window);
|
||||
gtk_action_group_add_toggle_actions (action_group, toggle_entries,
|
||||
G_N_ELEMENTS (toggle_entries), window);
|
||||
G_N_ELEMENTS (toggle_entries), window);
|
||||
|
||||
gtk_action_group_add_radio_actions (action_group, color_entries,
|
||||
G_N_ELEMENTS (color_entries), 0,
|
||||
G_CALLBACK (set_preview_color), NULL);
|
||||
G_N_ELEMENTS (color_entries), 0,
|
||||
G_CALLBACK (set_preview_color), NULL);
|
||||
gtk_action_group_add_radio_actions (action_group, zoom_entries,
|
||||
G_N_ELEMENTS (zoom_entries), 0,
|
||||
G_CALLBACK (set_zoom_factor), NULL);
|
||||
G_N_ELEMENTS (zoom_entries), 0,
|
||||
G_CALLBACK (set_zoom_factor), NULL);
|
||||
gtk_action_group_add_radio_actions (action_group, mapping_entries,
|
||||
G_N_ELEMENTS (mapping_entries), 0,
|
||||
G_CALLBACK (set_func), window);
|
||||
G_N_ELEMENTS (mapping_entries), 0,
|
||||
G_CALLBACK (set_func), window);
|
||||
|
||||
ui_manager = gtk_ui_manager_new ();
|
||||
gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
|
||||
|
@ -415,7 +415,7 @@ make_menu(GtkWidget *main_vbox, GtkWidget *window)
|
|||
|
||||
error = NULL;
|
||||
if (!gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, -1,
|
||||
&error))
|
||||
&error))
|
||||
{
|
||||
g_warning ("building menus failed: %s", error->message);
|
||||
g_error_free (error);
|
||||
|
@ -456,7 +456,7 @@ menu_build_mru_items(MRU_t *mru)
|
|||
children = gtk_container_get_children(GTK_CONTAINER(_menu.open_recent));
|
||||
p = g_list_nth(children, position);
|
||||
for (i = 0; i < _menu.nr_off_mru_items; i++, p = p->next) {
|
||||
gtk_widget_destroy((GtkWidget*) p->data);
|
||||
gtk_widget_destroy((GtkWidget*) p->data);
|
||||
}
|
||||
g_list_free(children);
|
||||
}
|
||||
|
@ -464,11 +464,11 @@ menu_build_mru_items(MRU_t *mru)
|
|||
i = 0;
|
||||
for (p = mru->list; p; p = p->next, i++) {
|
||||
GtkWidget *item = insert_item_with_label(_menu.open_recent, position++,
|
||||
(gchar*) p->data,
|
||||
menu_mru, p->data);
|
||||
(gchar*) p->data,
|
||||
menu_mru, p->data);
|
||||
if (i < 9) {
|
||||
guchar accelerator_key = '1' + i;
|
||||
add_accelerator(item, accelerator_key, GDK_CONTROL_MASK);
|
||||
guchar accelerator_key = '1' + i;
|
||||
add_accelerator(item, accelerator_key, GDK_CONTROL_MASK);
|
||||
}
|
||||
}
|
||||
_menu.nr_off_mru_items = i;
|
||||
|
@ -479,14 +479,14 @@ do_main_popup_menu(GdkEventButton *event)
|
|||
{
|
||||
GtkWidget *popup = gtk_ui_manager_get_widget (ui_manager, "/PopupMenu");
|
||||
gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL,
|
||||
event->button, event->time);
|
||||
event->button, event->time);
|
||||
}
|
||||
|
||||
void
|
||||
menu_check_grid(gboolean check)
|
||||
{
|
||||
GtkAction *action = gtk_ui_manager_get_action (ui_manager,
|
||||
"/MainMenu/ToolsMenu/Grid");
|
||||
"/MainMenu/ToolsMenu/Grid");
|
||||
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), check);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ typedef struct {
|
|||
GtkWidget *zoom_in;
|
||||
GtkWidget *zoom_out;
|
||||
|
||||
gint nr_off_mru_items;
|
||||
gint nr_off_mru_items;
|
||||
} Menu_t;
|
||||
|
||||
GtkWidget *menu_get_widget(const gchar *path);
|
||||
|
|
|
@ -38,16 +38,16 @@ init_accel_group(GtkWidget *window)
|
|||
|
||||
void
|
||||
add_accelerator(GtkWidget *widget, guint accelerator_key,
|
||||
guint8 accelerator_mods)
|
||||
guint8 accelerator_mods)
|
||||
{
|
||||
gtk_widget_add_accelerator(widget, "activate", accelerator_group,
|
||||
accelerator_key, accelerator_mods,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
accelerator_key, accelerator_mods,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
insert_item_with_label(GtkWidget *parent, gint position, gchar *label,
|
||||
MenuCallback activate, gpointer data)
|
||||
MenuCallback activate, gpointer data)
|
||||
{
|
||||
GtkWidget *item = gtk_image_menu_item_new_with_mnemonic(label);
|
||||
gtk_menu_shell_insert(GTK_MENU_SHELL(parent), item, position);
|
||||
|
|
|
@ -27,13 +27,13 @@ typedef void (*MenuCallback)(GtkWidget *widget, gpointer data);
|
|||
|
||||
void init_accel_group(GtkWidget *window);
|
||||
GtkWidget *insert_item_with_label(GtkWidget *parent, gint position,
|
||||
gchar *label, MenuCallback activate,
|
||||
gpointer data);
|
||||
gchar *label, MenuCallback activate,
|
||||
gpointer data);
|
||||
|
||||
void menu_command(GtkWidget *widget, gpointer data);
|
||||
|
||||
void add_accelerator(GtkWidget *widget, guint accelerator_key,
|
||||
guint8 accelerator_mods);
|
||||
guint8 accelerator_mods);
|
||||
|
||||
|
||||
#endif /* _IMAP_MENU_FUNCS_H */
|
||||
|
|
|
@ -41,7 +41,7 @@ void
|
|||
draw_sash(GdkWindow *window, GdkGC *gc, gint x, gint y)
|
||||
{
|
||||
draw_rectangle(window, gc, TRUE, x - _sash_size / 2, y - _sash_size / 2,
|
||||
_sash_size, _sash_size);
|
||||
_sash_size, _sash_size);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
|
@ -59,7 +59,7 @@ static GList*
|
|||
mru_find_link(MRU_t *mru, const gchar *filename)
|
||||
{
|
||||
return g_list_find_custom(mru->list, (gpointer) filename,
|
||||
(GCompareFunc) strcmp);
|
||||
(GCompareFunc) strcmp);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -82,7 +82,7 @@ mru_set_first(MRU_t *mru, const gchar *filename)
|
|||
GList *link = mru_find_link(mru, filename);
|
||||
if (link)
|
||||
mru->list = g_list_prepend(g_list_remove_link(mru->list, link),
|
||||
link->data);
|
||||
link->data);
|
||||
else
|
||||
mru_add(mru, filename);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
typedef struct {
|
||||
GList *list;
|
||||
gint max_size;
|
||||
gint max_size;
|
||||
} MRU_t;
|
||||
|
||||
MRU_t* mru_create(void);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -177,7 +177,7 @@ typedef union YYSTYPE
|
|||
}
|
||||
/* Line 187 of yacc.c. */
|
||||
#line 180 "y.tab.c"
|
||||
YYSTYPE;
|
||||
YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
|
@ -321,7 +321,7 @@ YYID (i)
|
|||
# endif
|
||||
# if (defined __cplusplus && ! defined _STDLIB_H \
|
||||
&& ! ((defined YYMALLOC || defined malloc) \
|
||||
&& (defined YYFREE || defined free)))
|
||||
&& (defined YYFREE || defined free)))
|
||||
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# ifndef _STDLIB_H
|
||||
# define _STDLIB_H 1
|
||||
|
@ -347,7 +347,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
|
|||
|
||||
#if (! defined yyoverflow \
|
||||
&& (! defined __cplusplus \
|
||||
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
|
||||
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
|
||||
|
||||
/* A type that is properly aligned for any stack member. */
|
||||
union yyalloc
|
||||
|
@ -372,13 +372,13 @@ union yyalloc
|
|||
# define YYCOPY(To, From, Count) \
|
||||
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
|
||||
# else
|
||||
# define YYCOPY(To, From, Count) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yyi; \
|
||||
for (yyi = 0; yyi < (Count); yyi++) \
|
||||
(To)[yyi] = (From)[yyi]; \
|
||||
} \
|
||||
# define YYCOPY(To, From, Count) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yyi; \
|
||||
for (yyi = 0; yyi < (Count); yyi++) \
|
||||
(To)[yyi] = (From)[yyi]; \
|
||||
} \
|
||||
while (YYID (0))
|
||||
# endif
|
||||
# endif
|
||||
|
@ -388,15 +388,15 @@ union yyalloc
|
|||
elements in the stack, and YYPTR gives the new location of the
|
||||
stack. Advance YYPTR to a properly aligned location for the next
|
||||
stack. */
|
||||
# define YYSTACK_RELOCATE(Stack) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yynewbytes; \
|
||||
YYCOPY (&yyptr->Stack, Stack, yysize); \
|
||||
Stack = &yyptr->Stack; \
|
||||
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
|
||||
yyptr += yynewbytes / sizeof (*yyptr); \
|
||||
} \
|
||||
# define YYSTACK_RELOCATE(Stack) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yynewbytes; \
|
||||
YYCOPY (&yyptr->Stack, Stack, yysize); \
|
||||
Stack = &yyptr->Stack; \
|
||||
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
|
||||
yyptr += yynewbytes / sizeof (*yyptr); \
|
||||
} \
|
||||
while (YYID (0))
|
||||
|
||||
#endif
|
||||
|
@ -419,7 +419,7 @@ union yyalloc
|
|||
#define YYUNDEFTOK 2
|
||||
#define YYMAXUTOK 268
|
||||
|
||||
#define YYTRANSLATE(YYX) \
|
||||
#define YYTRANSLATE(YYX) \
|
||||
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
||||
|
||||
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
|
||||
|
@ -596,44 +596,44 @@ static const yytype_uint8 yystos[] =
|
|||
31, 11, 11, 14, 11, 14, 11, 14, 11, 11
|
||||
};
|
||||
|
||||
#define yyerrok (yyerrstatus = 0)
|
||||
#define yyclearin (yychar = YYEMPTY)
|
||||
#define YYEMPTY (-2)
|
||||
#define YYEOF 0
|
||||
#define yyerrok (yyerrstatus = 0)
|
||||
#define yyclearin (yychar = YYEMPTY)
|
||||
#define YYEMPTY (-2)
|
||||
#define YYEOF 0
|
||||
|
||||
#define YYACCEPT goto yyacceptlab
|
||||
#define YYABORT goto yyabortlab
|
||||
#define YYERROR goto yyerrorlab
|
||||
#define YYACCEPT goto yyacceptlab
|
||||
#define YYABORT goto yyabortlab
|
||||
#define YYERROR goto yyerrorlab
|
||||
|
||||
|
||||
/* Like YYERROR except do call yyerror. This remains here temporarily
|
||||
to ease the transition to the new meaning of YYERROR, for GCC.
|
||||
Once GCC version 2 has supplanted version 1, this can go. */
|
||||
|
||||
#define YYFAIL goto yyerrlab
|
||||
#define YYFAIL goto yyerrlab
|
||||
|
||||
#define YYRECOVERING() (!!yyerrstatus)
|
||||
|
||||
#define YYBACKUP(Token, Value) \
|
||||
do \
|
||||
if (yychar == YYEMPTY && yylen == 1) \
|
||||
{ \
|
||||
yychar = (Token); \
|
||||
yylval = (Value); \
|
||||
yytoken = YYTRANSLATE (yychar); \
|
||||
YYPOPSTACK (1); \
|
||||
goto yybackup; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
#define YYBACKUP(Token, Value) \
|
||||
do \
|
||||
if (yychar == YYEMPTY && yylen == 1) \
|
||||
{ \
|
||||
yychar = (Token); \
|
||||
yylval = (Value); \
|
||||
yytoken = YYTRANSLATE (yychar); \
|
||||
YYPOPSTACK (1); \
|
||||
goto yybackup; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
yyerror (YY_("syntax error: cannot back up")); \
|
||||
YYERROR; \
|
||||
} \
|
||||
YYERROR; \
|
||||
} \
|
||||
while (YYID (0))
|
||||
|
||||
|
||||
#define YYTERROR 1
|
||||
#define YYERRCODE 256
|
||||
#define YYTERROR 1
|
||||
#define YYERRCODE 256
|
||||
|
||||
|
||||
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||||
|
@ -642,22 +642,22 @@ while (YYID (0))
|
|||
|
||||
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
||||
#ifndef YYLLOC_DEFAULT
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do \
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do \
|
||||
if (YYID (N)) \
|
||||
{ \
|
||||
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
||||
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
||||
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
||||
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).first_line = (Current).last_line = \
|
||||
YYRHSLOC (Rhs, 0).last_line; \
|
||||
(Current).first_column = (Current).last_column = \
|
||||
YYRHSLOC (Rhs, 0).last_column; \
|
||||
} \
|
||||
{ \
|
||||
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
||||
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
||||
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
||||
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).first_line = (Current).last_line = \
|
||||
YYRHSLOC (Rhs, 0).last_line; \
|
||||
(Current).first_column = (Current).last_column = \
|
||||
YYRHSLOC (Rhs, 0).last_column; \
|
||||
} \
|
||||
while (YYID (0))
|
||||
#endif
|
||||
|
||||
|
@ -668,10 +668,10 @@ while (YYID (0))
|
|||
|
||||
#ifndef YY_LOCATION_PRINT
|
||||
# if YYLTYPE_IS_TRIVIAL
|
||||
# define YY_LOCATION_PRINT(File, Loc) \
|
||||
fprintf (File, "%d.%d-%d.%d", \
|
||||
(Loc).first_line, (Loc).first_column, \
|
||||
(Loc).last_line, (Loc).last_column)
|
||||
# define YY_LOCATION_PRINT(File, Loc) \
|
||||
fprintf (File, "%d.%d-%d.%d", \
|
||||
(Loc).first_line, (Loc).first_column, \
|
||||
(Loc).last_line, (Loc).last_column)
|
||||
# else
|
||||
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
|
||||
# endif
|
||||
|
@ -694,21 +694,21 @@ while (YYID (0))
|
|||
# define YYFPRINTF fprintf
|
||||
# endif
|
||||
|
||||
# define YYDPRINTF(Args) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
YYFPRINTF Args; \
|
||||
# define YYDPRINTF(Args) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
YYFPRINTF Args; \
|
||||
} while (YYID (0))
|
||||
|
||||
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
{ \
|
||||
YYFPRINTF (stderr, "%s ", Title); \
|
||||
yy_symbol_print (stderr, \
|
||||
Type, Value); \
|
||||
YYFPRINTF (stderr, "\n"); \
|
||||
} \
|
||||
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
{ \
|
||||
YYFPRINTF (stderr, "%s ", Title); \
|
||||
yy_symbol_print (stderr, \
|
||||
Type, Value); \
|
||||
YYFPRINTF (stderr, "\n"); \
|
||||
} \
|
||||
} while (YYID (0))
|
||||
|
||||
|
||||
|
@ -740,7 +740,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
|
|||
switch (yytype)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -792,10 +792,10 @@ yy_stack_print (bottom, top)
|
|||
YYFPRINTF (stderr, "\n");
|
||||
}
|
||||
|
||||
# define YY_STACK_PRINT(Bottom, Top) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
yy_stack_print ((Bottom), (Top)); \
|
||||
# define YY_STACK_PRINT(Bottom, Top) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
yy_stack_print ((Bottom), (Top)); \
|
||||
} while (YYID (0))
|
||||
|
||||
|
||||
|
@ -818,21 +818,21 @@ yy_reduce_print (yyvsp, yyrule)
|
|||
int yyi;
|
||||
unsigned long int yylno = yyrline[yyrule];
|
||||
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
|
||||
yyrule - 1, yylno);
|
||||
yyrule - 1, yylno);
|
||||
/* The symbols being reduced. */
|
||||
for (yyi = 0; yyi < yynrhs; yyi++)
|
||||
{
|
||||
fprintf (stderr, " $%d = ", yyi + 1);
|
||||
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
|
||||
&(yyvsp[(yyi + 1) - (yynrhs)])
|
||||
);
|
||||
&(yyvsp[(yyi + 1) - (yynrhs)])
|
||||
);
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
# define YY_REDUCE_PRINT(Rule) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
# define YY_REDUCE_PRINT(Rule) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
yy_reduce_print (yyvsp, Rule); \
|
||||
} while (YYID (0))
|
||||
|
||||
|
@ -848,7 +848,7 @@ int yydebug;
|
|||
|
||||
|
||||
/* YYINITDEPTH -- initial size of the parser's stacks. */
|
||||
#ifndef YYINITDEPTH
|
||||
#ifndef YYINITDEPTH
|
||||
# define YYINITDEPTH 200
|
||||
#endif
|
||||
|
||||
|
@ -935,27 +935,27 @@ yytnamerr (char *yyres, const char *yystr)
|
|||
char const *yyp = yystr;
|
||||
|
||||
for (;;)
|
||||
switch (*++yyp)
|
||||
{
|
||||
case '\'':
|
||||
case ',':
|
||||
goto do_not_strip_quotes;
|
||||
switch (*++yyp)
|
||||
{
|
||||
case '\'':
|
||||
case ',':
|
||||
goto do_not_strip_quotes;
|
||||
|
||||
case '\\':
|
||||
if (*++yyp != '\\')
|
||||
goto do_not_strip_quotes;
|
||||
/* Fall through. */
|
||||
default:
|
||||
if (yyres)
|
||||
yyres[yyn] = *yyp;
|
||||
yyn++;
|
||||
break;
|
||||
case '\\':
|
||||
if (*++yyp != '\\')
|
||||
goto do_not_strip_quotes;
|
||||
/* Fall through. */
|
||||
default:
|
||||
if (yyres)
|
||||
yyres[yyn] = *yyp;
|
||||
yyn++;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
if (yyres)
|
||||
yyres[yyn] = '\0';
|
||||
return yyn;
|
||||
}
|
||||
case '"':
|
||||
if (yyres)
|
||||
yyres[yyn] = '\0';
|
||||
return yyn;
|
||||
}
|
||||
do_not_strip_quotes: ;
|
||||
}
|
||||
|
||||
|
@ -993,7 +993,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
|
|||
|
||||
# if 0
|
||||
/* This is so xgettext sees the translatable formats that are
|
||||
constructed on the fly. */
|
||||
constructed on the fly. */
|
||||
YY_("syntax error, unexpected %s");
|
||||
YY_("syntax error, unexpected %s, expecting %s");
|
||||
YY_("syntax error, unexpected %s, expecting %s or %s");
|
||||
|
@ -1006,13 +1006,13 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
|
|||
static char const yyexpecting[] = ", expecting %s";
|
||||
static char const yyor[] = " or %s";
|
||||
char yyformat[sizeof yyunexpected
|
||||
+ sizeof yyexpecting - 1
|
||||
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
|
||||
* (sizeof yyor - 1))];
|
||||
+ sizeof yyexpecting - 1
|
||||
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
|
||||
* (sizeof yyor - 1))];
|
||||
char const *yyprefix = yyexpecting;
|
||||
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. */
|
||||
YYCHECK. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
|
@ -1024,22 +1024,22 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
|
|||
yyfmt = yystpcpy (yyformat, yyunexpected);
|
||||
|
||||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
yysize = yysize0;
|
||||
yyformat[sizeof yyunexpected - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytname[yyx];
|
||||
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
|
||||
yysize_overflow |= (yysize1 < yysize);
|
||||
yysize = yysize1;
|
||||
yyfmt = yystpcpy (yyfmt, yyprefix);
|
||||
yyprefix = yyor;
|
||||
}
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
yysize = yysize0;
|
||||
yyformat[sizeof yyunexpected - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytname[yyx];
|
||||
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
|
||||
yysize_overflow |= (yysize1 < yysize);
|
||||
yysize = yysize1;
|
||||
yyfmt = yystpcpy (yyfmt, yyprefix);
|
||||
yyprefix = yyor;
|
||||
}
|
||||
|
||||
yyf = YY_(yyformat);
|
||||
yysize1 = yysize + yystrlen (yyf);
|
||||
|
@ -1047,29 +1047,29 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
|
|||
yysize = yysize1;
|
||||
|
||||
if (yysize_overflow)
|
||||
return YYSIZE_MAXIMUM;
|
||||
return YYSIZE_MAXIMUM;
|
||||
|
||||
if (yyresult)
|
||||
{
|
||||
/* Avoid sprintf, as that infringes on the user's name space.
|
||||
Don't have undefined behavior even if the translation
|
||||
produced a string with the wrong number of "%s"s. */
|
||||
char *yyp = yyresult;
|
||||
int yyi = 0;
|
||||
while ((*yyp = *yyf) != '\0')
|
||||
{
|
||||
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||||
yyf += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyf++;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
/* Avoid sprintf, as that infringes on the user's name space.
|
||||
Don't have undefined behavior even if the translation
|
||||
produced a string with the wrong number of "%s"s. */
|
||||
char *yyp = yyresult;
|
||||
int yyi = 0;
|
||||
while ((*yyp = *yyf) != '\0')
|
||||
{
|
||||
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||||
yyf += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyf++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return yysize;
|
||||
}
|
||||
}
|
||||
|
@ -1103,7 +1103,7 @@ yydestruct (yymsg, yytype, yyvaluep)
|
|||
{
|
||||
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1216,7 +1216,7 @@ yyparse ()
|
|||
yystate = 0;
|
||||
yyerrstatus = 0;
|
||||
yynerrs = 0;
|
||||
yychar = YYEMPTY; /* Cause a token to be read. */
|
||||
yychar = YYEMPTY; /* Cause a token to be read. */
|
||||
|
||||
/* Initialize stack pointers.
|
||||
Waste one element of value and location stack
|
||||
|
@ -1246,25 +1246,25 @@ yyparse ()
|
|||
|
||||
#ifdef yyoverflow
|
||||
{
|
||||
/* Give user a chance to reallocate the stack. Use copies of
|
||||
these so that the &'s don't force the real ones into
|
||||
memory. */
|
||||
YYSTYPE *yyvs1 = yyvs;
|
||||
yytype_int16 *yyss1 = yyss;
|
||||
/* Give user a chance to reallocate the stack. Use copies of
|
||||
these so that the &'s don't force the real ones into
|
||||
memory. */
|
||||
YYSTYPE *yyvs1 = yyvs;
|
||||
yytype_int16 *yyss1 = yyss;
|
||||
|
||||
|
||||
/* Each stack pointer address is followed by the size of the
|
||||
data in use in that stack, in bytes. This used to be a
|
||||
conditional around just the two extra args, but that might
|
||||
be undefined if yyoverflow is a macro. */
|
||||
yyoverflow (YY_("memory exhausted"),
|
||||
&yyss1, yysize * sizeof (*yyssp),
|
||||
&yyvs1, yysize * sizeof (*yyvsp),
|
||||
/* Each stack pointer address is followed by the size of the
|
||||
data in use in that stack, in bytes. This used to be a
|
||||
conditional around just the two extra args, but that might
|
||||
be undefined if yyoverflow is a macro. */
|
||||
yyoverflow (YY_("memory exhausted"),
|
||||
&yyss1, yysize * sizeof (*yyssp),
|
||||
&yyvs1, yysize * sizeof (*yyvsp),
|
||||
|
||||
&yystacksize);
|
||||
&yystacksize);
|
||||
|
||||
yyss = yyss1;
|
||||
yyvs = yyvs1;
|
||||
yyss = yyss1;
|
||||
yyvs = yyvs1;
|
||||
}
|
||||
#else /* no yyoverflow */
|
||||
# ifndef YYSTACK_RELOCATE
|
||||
|
@ -1272,23 +1272,23 @@ yyparse ()
|
|||
# else
|
||||
/* Extend the stack our own way. */
|
||||
if (YYMAXDEPTH <= yystacksize)
|
||||
goto yyexhaustedlab;
|
||||
goto yyexhaustedlab;
|
||||
yystacksize *= 2;
|
||||
if (YYMAXDEPTH < yystacksize)
|
||||
yystacksize = YYMAXDEPTH;
|
||||
yystacksize = YYMAXDEPTH;
|
||||
|
||||
{
|
||||
yytype_int16 *yyss1 = yyss;
|
||||
union yyalloc *yyptr =
|
||||
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
|
||||
if (! yyptr)
|
||||
goto yyexhaustedlab;
|
||||
YYSTACK_RELOCATE (yyss);
|
||||
YYSTACK_RELOCATE (yyvs);
|
||||
yytype_int16 *yyss1 = yyss;
|
||||
union yyalloc *yyptr =
|
||||
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
|
||||
if (! yyptr)
|
||||
goto yyexhaustedlab;
|
||||
YYSTACK_RELOCATE (yyss);
|
||||
YYSTACK_RELOCATE (yyvs);
|
||||
|
||||
# undef YYSTACK_RELOCATE
|
||||
if (yyss1 != yyssa)
|
||||
YYSTACK_FREE (yyss1);
|
||||
if (yyss1 != yyssa)
|
||||
YYSTACK_FREE (yyss1);
|
||||
}
|
||||
# endif
|
||||
#endif /* no yyoverflow */
|
||||
|
@ -1298,10 +1298,10 @@ yyparse ()
|
|||
|
||||
|
||||
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
|
||||
(unsigned long int) yystacksize));
|
||||
(unsigned long int) yystacksize));
|
||||
|
||||
if (yyss + yystacksize - 1 <= yyssp)
|
||||
YYABORT;
|
||||
YYABORT;
|
||||
}
|
||||
|
||||
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
|
||||
|
@ -1350,7 +1350,7 @@ yybackup:
|
|||
if (yyn <= 0)
|
||||
{
|
||||
if (yyn == 0 || yyn == YYTABLE_NINF)
|
||||
goto yyerrlab;
|
||||
goto yyerrlab;
|
||||
yyn = -yyn;
|
||||
goto yyreduce;
|
||||
}
|
||||
|
@ -1410,75 +1410,75 @@ yyreduce:
|
|||
case 9:
|
||||
#line 72 "imap_ncsa.y"
|
||||
{
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
#line 78 "imap_ncsa.y"
|
||||
{
|
||||
MapInfo_t *info = get_map_info();
|
||||
g_strreplace(&info->author, (yyvsp[(2) - (2)].id));
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
MapInfo_t *info = get_map_info();
|
||||
g_strreplace(&info->author, (yyvsp[(2) - (2)].id));
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
break;
|
||||
|
||||
case 11:
|
||||
#line 86 "imap_ncsa.y"
|
||||
{
|
||||
MapInfo_t *info = get_map_info();
|
||||
g_strreplace(&info->title, (yyvsp[(2) - (2)].id));
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
MapInfo_t *info = get_map_info();
|
||||
g_strreplace(&info->title, (yyvsp[(2) - (2)].id));
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
break;
|
||||
|
||||
case 12:
|
||||
#line 94 "imap_ncsa.y"
|
||||
{
|
||||
MapInfo_t *info = get_map_info();
|
||||
gchar *description;
|
||||
MapInfo_t *info = get_map_info();
|
||||
gchar *description;
|
||||
|
||||
description = g_strconcat(info->description, (yyvsp[(2) - (2)].id), "\n",
|
||||
NULL);
|
||||
g_strreplace(&info->description, description);
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
description = g_strconcat(info->description, (yyvsp[(2) - (2)].id), "\n",
|
||||
NULL);
|
||||
g_strreplace(&info->description, description);
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
break;
|
||||
|
||||
case 20:
|
||||
#line 117 "imap_ncsa.y"
|
||||
{
|
||||
MapInfo_t *info = get_map_info();
|
||||
g_strreplace(&info->default_url, (yyvsp[(2) - (2)].id));
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
MapInfo_t *info = get_map_info();
|
||||
g_strreplace(&info->default_url, (yyvsp[(2) - (2)].id));
|
||||
g_free ((yyvsp[(2) - (2)].id));
|
||||
}
|
||||
break;
|
||||
|
||||
case 21:
|
||||
#line 126 "imap_ncsa.y"
|
||||
{
|
||||
gint x = (gint) (yyvsp[(3) - (8)].value);
|
||||
gint y = (gint) (yyvsp[(5) - (8)].value);
|
||||
gint width = (gint) fabs((yyvsp[(6) - (8)].value) - x);
|
||||
gint height = (gint) fabs((yyvsp[(8) - (8)].value) - y);
|
||||
current_object = create_rectangle(x, y, width, height);
|
||||
object_set_url(current_object, (yyvsp[(2) - (8)].id));
|
||||
add_shape(current_object);
|
||||
g_free ((yyvsp[(2) - (8)].id));
|
||||
}
|
||||
gint x = (gint) (yyvsp[(3) - (8)].value);
|
||||
gint y = (gint) (yyvsp[(5) - (8)].value);
|
||||
gint width = (gint) fabs((yyvsp[(6) - (8)].value) - x);
|
||||
gint height = (gint) fabs((yyvsp[(8) - (8)].value) - y);
|
||||
current_object = create_rectangle(x, y, width, height);
|
||||
object_set_url(current_object, (yyvsp[(2) - (8)].id));
|
||||
add_shape(current_object);
|
||||
g_free ((yyvsp[(2) - (8)].id));
|
||||
}
|
||||
break;
|
||||
|
||||
case 22:
|
||||
#line 139 "imap_ncsa.y"
|
||||
{
|
||||
gint x = (gint) (yyvsp[(3) - (8)].value);
|
||||
gint y = (gint) (yyvsp[(5) - (8)].value);
|
||||
gint r = (gint) fabs((yyvsp[(8) - (8)].value) - (yyvsp[(5) - (8)].value));
|
||||
current_object = create_circle(x, y, r);
|
||||
object_set_url(current_object, (yyvsp[(2) - (8)].id));
|
||||
add_shape(current_object);
|
||||
g_free ((yyvsp[(2) - (8)].id));
|
||||
}
|
||||
gint x = (gint) (yyvsp[(3) - (8)].value);
|
||||
gint y = (gint) (yyvsp[(5) - (8)].value);
|
||||
gint r = (gint) fabs((yyvsp[(8) - (8)].value) - (yyvsp[(5) - (8)].value));
|
||||
current_object = create_circle(x, y, r);
|
||||
object_set_url(current_object, (yyvsp[(2) - (8)].id));
|
||||
add_shape(current_object);
|
||||
g_free ((yyvsp[(2) - (8)].id));
|
||||
}
|
||||
break;
|
||||
|
||||
case 23:
|
||||
|
@ -1489,26 +1489,26 @@ yyreduce:
|
|||
case 24:
|
||||
#line 151 "imap_ncsa.y"
|
||||
{
|
||||
object_set_url(current_object, (yyvsp[(2) - (4)].id));
|
||||
add_shape(current_object);
|
||||
g_free ((yyvsp[(2) - (4)].id));
|
||||
}
|
||||
object_set_url(current_object, (yyvsp[(2) - (4)].id));
|
||||
add_shape(current_object);
|
||||
g_free ((yyvsp[(2) - (4)].id));
|
||||
}
|
||||
break;
|
||||
|
||||
case 26:
|
||||
#line 160 "imap_ncsa.y"
|
||||
{
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 27:
|
||||
#line 165 "imap_ncsa.y"
|
||||
{
|
||||
Polygon_t *polygon = ObjectToPolygon(current_object);
|
||||
GdkPoint *point = new_point((gint) (yyvsp[(1) - (3)].value), (gint) (yyvsp[(3) - (3)].value));
|
||||
polygon->points = g_list_append(polygon->points,
|
||||
(gpointer) point);
|
||||
}
|
||||
Polygon_t *polygon = ObjectToPolygon(current_object);
|
||||
GdkPoint *point = new_point((gint) (yyvsp[(1) - (3)].value), (gint) (yyvsp[(3) - (3)].value));
|
||||
polygon->points = g_list_append(polygon->points,
|
||||
(gpointer) point);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
@ -1552,35 +1552,35 @@ yyerrlab:
|
|||
yyerror (YY_("syntax error"));
|
||||
#else
|
||||
{
|
||||
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
|
||||
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
|
||||
{
|
||||
YYSIZE_T yyalloc = 2 * yysize;
|
||||
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
|
||||
yyalloc = YYSTACK_ALLOC_MAXIMUM;
|
||||
if (yymsg != yymsgbuf)
|
||||
YYSTACK_FREE (yymsg);
|
||||
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
|
||||
if (yymsg)
|
||||
yymsg_alloc = yyalloc;
|
||||
else
|
||||
{
|
||||
yymsg = yymsgbuf;
|
||||
yymsg_alloc = sizeof yymsgbuf;
|
||||
}
|
||||
}
|
||||
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
|
||||
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
|
||||
{
|
||||
YYSIZE_T yyalloc = 2 * yysize;
|
||||
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
|
||||
yyalloc = YYSTACK_ALLOC_MAXIMUM;
|
||||
if (yymsg != yymsgbuf)
|
||||
YYSTACK_FREE (yymsg);
|
||||
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
|
||||
if (yymsg)
|
||||
yymsg_alloc = yyalloc;
|
||||
else
|
||||
{
|
||||
yymsg = yymsgbuf;
|
||||
yymsg_alloc = sizeof yymsgbuf;
|
||||
}
|
||||
}
|
||||
|
||||
if (0 < yysize && yysize <= yymsg_alloc)
|
||||
{
|
||||
(void) yysyntax_error (yymsg, yystate, yychar);
|
||||
yyerror (yymsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
yyerror (YY_("syntax error"));
|
||||
if (yysize != 0)
|
||||
goto yyexhaustedlab;
|
||||
}
|
||||
if (0 < yysize && yysize <= yymsg_alloc)
|
||||
{
|
||||
(void) yysyntax_error (yymsg, yystate, yychar);
|
||||
yyerror (yymsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
yyerror (YY_("syntax error"));
|
||||
if (yysize != 0)
|
||||
goto yyexhaustedlab;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1590,20 +1590,20 @@ yyerrlab:
|
|||
if (yyerrstatus == 3)
|
||||
{
|
||||
/* If just tried and failed to reuse look-ahead token after an
|
||||
error, discard it. */
|
||||
error, discard it. */
|
||||
|
||||
if (yychar <= YYEOF)
|
||||
{
|
||||
/* Return failure if at end of input. */
|
||||
if (yychar == YYEOF)
|
||||
YYABORT;
|
||||
}
|
||||
{
|
||||
/* Return failure if at end of input. */
|
||||
if (yychar == YYEOF)
|
||||
YYABORT;
|
||||
}
|
||||
else
|
||||
{
|
||||
yydestruct ("Error: discarding",
|
||||
yytoken, &yylval);
|
||||
yychar = YYEMPTY;
|
||||
}
|
||||
{
|
||||
yydestruct ("Error: discarding",
|
||||
yytoken, &yylval);
|
||||
yychar = YYEMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
/* Else will try to reuse look-ahead token after shifting the error
|
||||
|
@ -1635,29 +1635,29 @@ yyerrorlab:
|
|||
| yyerrlab1 -- common code for both syntax error and YYERROR. |
|
||||
`-------------------------------------------------------------*/
|
||||
yyerrlab1:
|
||||
yyerrstatus = 3; /* Each real token shifted decrements this. */
|
||||
yyerrstatus = 3; /* Each real token shifted decrements this. */
|
||||
|
||||
for (;;)
|
||||
{
|
||||
yyn = yypact[yystate];
|
||||
if (yyn != YYPACT_NINF)
|
||||
{
|
||||
yyn += YYTERROR;
|
||||
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
|
||||
{
|
||||
yyn = yytable[yyn];
|
||||
if (0 < yyn)
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
yyn += YYTERROR;
|
||||
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
|
||||
{
|
||||
yyn = yytable[yyn];
|
||||
if (0 < yyn)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Pop the current state because it cannot handle the error token. */
|
||||
if (yyssp == yyss)
|
||||
YYABORT;
|
||||
YYABORT;
|
||||
|
||||
|
||||
yydestruct ("Error: popping",
|
||||
yystos[yystate], yyvsp);
|
||||
yystos[yystate], yyvsp);
|
||||
YYPOPSTACK (1);
|
||||
yystate = *yyssp;
|
||||
YY_STACK_PRINT (yyss, yyssp);
|
||||
|
@ -1703,7 +1703,7 @@ yyexhaustedlab:
|
|||
yyreturn:
|
||||
if (yychar != YYEOF && yychar != YYEMPTY)
|
||||
yydestruct ("Cleanup: discarding lookahead",
|
||||
yytoken, &yylval);
|
||||
yytoken, &yylval);
|
||||
/* Do not reclaim the symbols of the rule which action triggered
|
||||
this YYABORT or YYACCEPT. */
|
||||
YYPOPSTACK (yylen);
|
||||
|
@ -1711,7 +1711,7 @@ yyreturn:
|
|||
while (yyssp != yyss)
|
||||
{
|
||||
yydestruct ("Cleanup: popping",
|
||||
yystos[*yyssp], yyvsp);
|
||||
yystos[*yyssp], yyvsp);
|
||||
YYPOPSTACK (1);
|
||||
}
|
||||
#ifndef yyoverflow
|
||||
|
|
|
@ -78,7 +78,7 @@ typedef union YYSTYPE
|
|||
}
|
||||
/* Line 1489 of yacc.c. */
|
||||
#line 81 "y.tab.h"
|
||||
YYSTYPE;
|
||||
YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
|
|
|
@ -40,7 +40,7 @@ static ObjectList_t *_paste_buffer;
|
|||
|
||||
static gpointer
|
||||
object_list_callback_add(ObjectListCallback_t *list,
|
||||
ObjectListCallbackFunc_t func, gpointer data)
|
||||
ObjectListCallbackFunc_t func, gpointer data)
|
||||
{
|
||||
ObjectListCB_t *cb = g_new(ObjectListCB_t, 1);
|
||||
cb->func = func;
|
||||
|
@ -67,49 +67,49 @@ object_list_callback_call(ObjectListCallback_t *list, Object_t *obj)
|
|||
|
||||
gpointer
|
||||
object_list_add_changed_cb(ObjectList_t *list, ObjectListCallbackFunc_t func,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
return object_list_callback_add(&list->changed_cb, func, data);
|
||||
}
|
||||
|
||||
gpointer
|
||||
object_list_add_update_cb(ObjectList_t *list, ObjectListCallbackFunc_t func,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
return object_list_callback_add(&list->update_cb, func, data);
|
||||
}
|
||||
|
||||
gpointer
|
||||
object_list_add_add_cb(ObjectList_t *list, ObjectListCallbackFunc_t func,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
return object_list_callback_add(&list->add_cb, func, data);
|
||||
}
|
||||
|
||||
gpointer
|
||||
object_list_add_remove_cb(ObjectList_t *list, ObjectListCallbackFunc_t func,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
return object_list_callback_add(&list->remove_cb, func, data);
|
||||
}
|
||||
|
||||
gpointer
|
||||
object_list_add_select_cb(ObjectList_t *list, ObjectListCallbackFunc_t func,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
return object_list_callback_add(&list->select_cb, func, data);
|
||||
}
|
||||
|
||||
gpointer
|
||||
object_list_add_move_cb(ObjectList_t *list, ObjectListCallbackFunc_t func,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
return object_list_callback_add(&list->move_cb, func, data);
|
||||
}
|
||||
|
||||
gpointer
|
||||
object_list_add_geometry_cb(ObjectList_t *list, ObjectListCallbackFunc_t func,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
return object_list_callback_add(&list->geometry_cb, func, data);
|
||||
}
|
||||
|
@ -408,9 +408,9 @@ do_object_locked_dialog(void)
|
|||
default_dialog_hide_cancel_button(dialog);
|
||||
default_dialog_hide_apply_button(dialog);
|
||||
default_dialog_set_label(
|
||||
dialog,
|
||||
"\n You cannot delete the selected object \n"
|
||||
"since it is currently being edited.\n");
|
||||
dialog,
|
||||
"\n You cannot delete the selected object \n"
|
||||
"since it is currently being edited.\n");
|
||||
}
|
||||
default_dialog_show(dialog);
|
||||
}
|
||||
|
@ -423,7 +423,7 @@ object_factory_create_object(ObjectFactory_t *factory, gint x, gint y)
|
|||
|
||||
static gboolean
|
||||
button_motion(GtkWidget *widget, GdkEventMotion *event,
|
||||
ObjectFactory_t *factory)
|
||||
ObjectFactory_t *factory)
|
||||
{
|
||||
gint x = get_real_coord((gint) event->x);
|
||||
gint y = get_real_coord((gint) event->y);
|
||||
|
@ -452,45 +452,45 @@ object_on_button_press(GtkWidget *widget, GdkEventButton *event, gpointer data)
|
|||
|
||||
if (obj) {
|
||||
if (event->button == 1) {
|
||||
if (!factory->finish || factory->finish(obj, x, y)) {
|
||||
g_signal_handlers_disconnect_by_func(widget,
|
||||
if (!factory->finish || factory->finish(obj, x, y)) {
|
||||
g_signal_handlers_disconnect_by_func(widget,
|
||||
button_motion,
|
||||
factory);
|
||||
if (object_is_valid(obj)) {
|
||||
Command_t *command = create_command_new(get_shapes(), obj);
|
||||
command_execute(command);
|
||||
if (preferences->prompt_for_area_info)
|
||||
object_edit(obj, FALSE);
|
||||
} else {
|
||||
if (object_is_valid(obj)) {
|
||||
Command_t *command = create_command_new(get_shapes(), obj);
|
||||
command_execute(command);
|
||||
if (preferences->prompt_for_area_info)
|
||||
object_edit(obj, FALSE);
|
||||
} else {
|
||||
object_draw(obj, gtk_widget_get_window (widget));
|
||||
object_unref(obj);
|
||||
}
|
||||
gdk_gc_set_function(preferences->normal_gc, GDK_COPY);
|
||||
obj = NULL;
|
||||
main_clear_dimension();
|
||||
}
|
||||
}
|
||||
gdk_gc_set_function(preferences->normal_gc, GDK_COPY);
|
||||
obj = NULL;
|
||||
main_clear_dimension();
|
||||
}
|
||||
} else if (event->button == 3) {
|
||||
object_draw(obj, gtk_widget_get_window (widget));
|
||||
if (!factory->cancel || factory->cancel(event, obj)) {
|
||||
g_signal_handlers_disconnect_by_func(widget,
|
||||
if (!factory->cancel || factory->cancel(event, obj)) {
|
||||
g_signal_handlers_disconnect_by_func(widget,
|
||||
button_motion,
|
||||
factory);
|
||||
object_unref(obj);
|
||||
gdk_gc_set_function(preferences->normal_gc, GDK_COPY);
|
||||
obj = NULL;
|
||||
main_clear_dimension();
|
||||
} else {
|
||||
object_unref(obj);
|
||||
gdk_gc_set_function(preferences->normal_gc, GDK_COPY);
|
||||
obj = NULL;
|
||||
main_clear_dimension();
|
||||
} else {
|
||||
object_draw(obj, gtk_widget_get_window (widget));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (event->button == 1) {
|
||||
factory = ((ObjectFactory_t*(*)(guint)) data)(event->state);
|
||||
obj = object_factory_create_object(factory, x, y);
|
||||
factory = ((ObjectFactory_t*(*)(guint)) data)(event->state);
|
||||
obj = object_factory_create_object(factory, x, y);
|
||||
|
||||
gdk_gc_set_function(preferences->normal_gc, GDK_XOR);
|
||||
gdk_gc_set_function(preferences->normal_gc, GDK_XOR);
|
||||
|
||||
g_signal_connect(widget, "motion-notify-event",
|
||||
g_signal_connect(widget, "motion-notify-event",
|
||||
G_CALLBACK(button_motion), factory);
|
||||
}
|
||||
}
|
||||
|
@ -596,7 +596,7 @@ object_list_draw_selected(ObjectList_t *list, GdkWindow *window)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->selected)
|
||||
object_draw(obj, window);
|
||||
object_draw(obj, window);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -608,25 +608,25 @@ object_list_find(ObjectList_t *list, gint x, gint y)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->class->point_is_on(obj, x, y))
|
||||
found = obj;
|
||||
found = obj;
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
Object_t*
|
||||
object_list_near_sash(ObjectList_t *list, gint x, gint y,
|
||||
MoveSashFunc_t *sash_func)
|
||||
MoveSashFunc_t *sash_func)
|
||||
{
|
||||
Object_t *found = NULL;
|
||||
GList *p;
|
||||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->selected) {
|
||||
MoveSashFunc_t func = obj->class->near_sash(obj, x, y);
|
||||
if (func) {
|
||||
found = obj;
|
||||
*sash_func = func;
|
||||
}
|
||||
MoveSashFunc_t func = obj->class->near_sash(obj, x, y);
|
||||
if (func) {
|
||||
found = obj;
|
||||
*sash_func = func;
|
||||
}
|
||||
}
|
||||
}
|
||||
return found;
|
||||
|
@ -672,13 +672,13 @@ object_list_cut(ObjectList_t *list)
|
|||
Object_t *obj = (Object_t*) p->data;
|
||||
q = p->next;
|
||||
if (obj->selected) {
|
||||
if (obj->locked) {
|
||||
do_object_locked_dialog();
|
||||
} else {
|
||||
object_list_append(_paste_buffer, obj);
|
||||
object_list_remove_link(list, p);
|
||||
count++;
|
||||
}
|
||||
if (obj->locked) {
|
||||
do_object_locked_dialog();
|
||||
} else {
|
||||
object_list_append(_paste_buffer, obj);
|
||||
object_list_remove_link(list, p);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
object_list_set_changed(list, (count) ? TRUE : FALSE);
|
||||
|
@ -694,7 +694,7 @@ object_list_copy_to_paste_buffer(ObjectList_t *list)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->selected)
|
||||
object_list_append(_paste_buffer, object_clone(obj));
|
||||
object_list_append(_paste_buffer, object_clone(obj));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -712,12 +712,12 @@ object_list_delete_selected(ObjectList_t *list)
|
|||
Object_t *obj = (Object_t*) p->data;
|
||||
q = p->next;
|
||||
if (obj->selected) {
|
||||
if (obj->locked) {
|
||||
do_object_locked_dialog();
|
||||
} else {
|
||||
object_list_remove_link(list, p);
|
||||
object_unref(obj);
|
||||
}
|
||||
if (obj->locked) {
|
||||
do_object_locked_dialog();
|
||||
} else {
|
||||
object_list_remove_link(list, p);
|
||||
object_unref(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -729,8 +729,8 @@ object_list_edit_selected(ObjectList_t *list)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->selected) {
|
||||
object_edit(obj, TRUE);
|
||||
break;
|
||||
object_edit(obj, TRUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -743,8 +743,8 @@ object_list_select_all(ObjectList_t *list)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (!obj->selected) {
|
||||
object_select(obj);
|
||||
count++;
|
||||
object_select(obj);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
|
@ -757,15 +757,15 @@ object_list_select_next(ObjectList_t *list)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->selected) {
|
||||
object_unselect(obj);
|
||||
p = (p->next) ? p->next : list->list;
|
||||
object_select((Object_t*) p->data);
|
||||
for (p = p->next; p; p = p->next) {
|
||||
obj = (Object_t*) p->data;
|
||||
if (obj->selected)
|
||||
object_unselect(obj);
|
||||
}
|
||||
break;
|
||||
object_unselect(obj);
|
||||
p = (p->next) ? p->next : list->list;
|
||||
object_select((Object_t*) p->data);
|
||||
for (p = p->next; p; p = p->next) {
|
||||
obj = (Object_t*) p->data;
|
||||
if (obj->selected)
|
||||
object_unselect(obj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -776,21 +776,21 @@ void object_list_select_prev(ObjectList_t *list)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->selected) {
|
||||
GList *q = (p->prev) ? p->prev : g_list_last(list->list);
|
||||
for (; p; p = p->next) {
|
||||
obj = (Object_t*) p->data;
|
||||
if (obj->selected)
|
||||
object_unselect(obj);
|
||||
}
|
||||
object_select((Object_t*) q->data);
|
||||
break;
|
||||
GList *q = (p->prev) ? p->prev : g_list_last(list->list);
|
||||
for (; p; p = p->next) {
|
||||
obj = (Object_t*) p->data;
|
||||
if (obj->selected)
|
||||
object_unselect(obj);
|
||||
}
|
||||
object_select((Object_t*) q->data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gint
|
||||
object_list_select_region(ObjectList_t *list, gint x, gint y, gint width,
|
||||
gint height)
|
||||
gint height)
|
||||
{
|
||||
GList *p;
|
||||
gint count = 0;
|
||||
|
@ -800,9 +800,9 @@ object_list_select_region(ObjectList_t *list, gint x, gint y, gint width,
|
|||
|
||||
object_get_dimensions(obj, &obj_x, &obj_y, &obj_width, &obj_height);
|
||||
if (obj_x >= x && obj_x + obj_width <= x + width &&
|
||||
obj_y >= y && obj_y + obj_height <= y + height) {
|
||||
object_select(obj);
|
||||
count++;
|
||||
obj_y >= y && obj_y + obj_height <= y + height) {
|
||||
object_select(obj);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
|
@ -816,8 +816,8 @@ object_list_deselect_all(ObjectList_t *list, Object_t *exception)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->selected && obj != exception) {
|
||||
object_unselect(obj);
|
||||
count++;
|
||||
object_unselect(obj);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
|
@ -831,7 +831,7 @@ object_list_nr_selected(ObjectList_t *list)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->selected)
|
||||
count++;
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
@ -873,7 +873,7 @@ object_list_move_selected(ObjectList_t *list, gint dx, gint dy)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->selected)
|
||||
object_move(obj, dx, dy);
|
||||
object_move(obj, dx, dy);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -899,7 +899,7 @@ object_list_move_selected_up(ObjectList_t *list)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->selected && p->prev)
|
||||
object_list_swap_prev(list, p);
|
||||
object_list_swap_prev(list, p);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -911,7 +911,7 @@ object_list_move_selected_down(ObjectList_t *list)
|
|||
for (p = g_list_last(list->list); p; p = p->prev) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->selected && p->next)
|
||||
object_list_swap_next(list, p);
|
||||
object_list_swap_next(list, p);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -925,8 +925,8 @@ object_list_move_to_front(ObjectList_t *list)
|
|||
Object_t *obj = (Object_t*) p->data;
|
||||
q = p->next;
|
||||
if (obj->selected) {
|
||||
object_list_remove_link(list, p);
|
||||
object_list_append(list, obj);
|
||||
object_list_remove_link(list, p);
|
||||
object_list_append(list, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -941,8 +941,8 @@ object_list_send_to_back(ObjectList_t *list)
|
|||
Object_t *obj = (Object_t*) p->data;
|
||||
q = p->next;
|
||||
if (obj->selected) {
|
||||
object_list_remove_link(list, p);
|
||||
object_list_prepend(list, obj);
|
||||
object_list_remove_link(list, p);
|
||||
object_list_prepend(list, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -954,14 +954,14 @@ object_list_move_sash_selected(ObjectList_t *list, gint dx, gint dy)
|
|||
for (p = list->list; p; p = p->next) {
|
||||
Object_t *obj = (Object_t*) p->data;
|
||||
if (obj->selected)
|
||||
object_move_sash(obj, dx, dy);
|
||||
object_move_sash(obj, dx, dy);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
write_xml_attrib(const gchar *attrib, const gchar *value,
|
||||
const gchar *default_text, gpointer param,
|
||||
OutputFunc_t output)
|
||||
const gchar *default_text, gpointer param,
|
||||
OutputFunc_t output)
|
||||
{
|
||||
if (*value) {
|
||||
gchar *escaped_value = g_markup_escape_text(value, -1);
|
||||
|
@ -1012,7 +1012,7 @@ object_list_write_ncsa(ObjectList_t *list, gpointer param, OutputFunc_t output)
|
|||
Object_t *obj = (Object_t*) p->data;
|
||||
|
||||
if (*obj->comment)
|
||||
output(param, "# %s\n", obj->comment);
|
||||
output(param, "# %s\n", obj->comment);
|
||||
obj->class->write_ncsa(obj, param, output);
|
||||
output(param, "\n");
|
||||
}
|
||||
|
|
|
@ -31,18 +31,18 @@ typedef struct ObjectList_t ObjectList_t;
|
|||
#include "imap_menu_funcs.h"
|
||||
|
||||
struct Object_t {
|
||||
ObjectClass_t *class;
|
||||
ObjectList_t *list;
|
||||
gint refcount;
|
||||
gboolean selected;
|
||||
gboolean locked;
|
||||
gchar *url;
|
||||
gchar *target;
|
||||
gchar *comment;
|
||||
gchar *mouse_over;
|
||||
gchar *mouse_out;
|
||||
gchar *focus;
|
||||
gchar *blur;
|
||||
ObjectClass_t *class;
|
||||
ObjectList_t *list;
|
||||
gint refcount;
|
||||
gboolean selected;
|
||||
gboolean locked;
|
||||
gchar *url;
|
||||
gchar *target;
|
||||
gchar *comment;
|
||||
gchar *mouse_over;
|
||||
gchar *mouse_out;
|
||||
gchar *focus;
|
||||
gchar *blur;
|
||||
};
|
||||
|
||||
typedef void (*MoveSashFunc_t)(Object_t*, gint, gint);
|
||||
|
@ -51,10 +51,10 @@ typedef void (*OutputFunc_t)(gpointer, const char*, ...) G_GNUC_PRINTF(2,3);
|
|||
struct AreaInfoDialog_t;
|
||||
|
||||
struct ObjectClass_t {
|
||||
const gchar *name;
|
||||
AreaInfoDialog_t *info_dialog;
|
||||
GdkPixmap *icon;
|
||||
GdkBitmap *mask;
|
||||
const gchar *name;
|
||||
AreaInfoDialog_t *info_dialog;
|
||||
GdkPixmap *icon;
|
||||
GdkBitmap *mask;
|
||||
|
||||
gboolean (*is_valid)(Object_t *obj);
|
||||
void (*destruct)(Object_t *obj);
|
||||
|
@ -66,7 +66,7 @@ struct ObjectClass_t {
|
|||
MoveSashFunc_t (*near_sash)(Object_t *obj, gint x, gint y);
|
||||
gboolean (*point_is_on)(Object_t *obj, gint x, gint y);
|
||||
void (*get_dimensions)(Object_t *obj, gint *x, gint *y, gint *width,
|
||||
gint *height);
|
||||
gint *height);
|
||||
void (*resize)(Object_t *obj, gint percentage_x, gint percentage_y);
|
||||
void (*move)(Object_t *obj, gint dx, gint dy);
|
||||
gpointer (*create_info_widget)(GtkWidget *frame);
|
||||
|
@ -110,28 +110,28 @@ void object_emit_geometry_signal(Object_t *obj);
|
|||
void object_emit_update_signal(Object_t *obj);
|
||||
|
||||
#define object_is_valid(obj) \
|
||||
((obj)->class->is_valid(obj))
|
||||
((obj)->class->is_valid(obj))
|
||||
|
||||
#define object_get_dimensions(obj, x, y, width, height) \
|
||||
((obj)->class->get_dimensions((obj), (x), (y), (width), (height)))
|
||||
((obj)->class->get_dimensions((obj), (x), (y), (width), (height)))
|
||||
|
||||
#define object_normalize(obj) \
|
||||
((obj)->class->normalize(obj))
|
||||
((obj)->class->normalize(obj))
|
||||
|
||||
#define object_resize(obj, per_x, per_y) \
|
||||
((obj)->class->resize((obj), (per_x), (per_y)))
|
||||
((obj)->class->resize((obj), (per_x), (per_y)))
|
||||
|
||||
#define object_update(obj, data) \
|
||||
((obj)->class->update((obj), (data)))
|
||||
((obj)->class->update((obj), (data)))
|
||||
|
||||
#define object_update_info_widget(obj, data) \
|
||||
((obj)->class->update_info_widget((obj), (data)))
|
||||
((obj)->class->update_info_widget((obj), (data)))
|
||||
|
||||
#define object_fill_info_tab(obj, data) \
|
||||
((obj)->class->fill_info_tab((obj), (data)))
|
||||
((obj)->class->fill_info_tab((obj), (data)))
|
||||
|
||||
#define object_get_stock_icon_name(obj) \
|
||||
((obj)->class->get_stock_icon_name())
|
||||
((obj)->class->get_stock_icon_name())
|
||||
|
||||
typedef struct {
|
||||
Object_t *obj;
|
||||
|
@ -142,7 +142,7 @@ typedef struct {
|
|||
} ObjectFactory_t;
|
||||
|
||||
gboolean object_on_button_press(GtkWidget *widget, GdkEventButton *event,
|
||||
gpointer data);
|
||||
gpointer data);
|
||||
|
||||
typedef struct {
|
||||
GList *list;
|
||||
|
@ -175,7 +175,7 @@ void object_list_draw(ObjectList_t *list, GdkWindow *window);
|
|||
void object_list_draw_selected(ObjectList_t *list, GdkWindow *window);
|
||||
Object_t *object_list_find(ObjectList_t *list, gint x, gint y);
|
||||
Object_t *object_list_near_sash(ObjectList_t *list, gint x, gint y,
|
||||
MoveSashFunc_t *sash_func);
|
||||
MoveSashFunc_t *sash_func);
|
||||
|
||||
gint object_list_cut(ObjectList_t *list);
|
||||
void object_list_copy_to_paste_buffer(ObjectList_t *list);
|
||||
|
@ -188,11 +188,11 @@ gint object_list_select_all(ObjectList_t *list);
|
|||
void object_list_select_next(ObjectList_t *list);
|
||||
void object_list_select_prev(ObjectList_t *list);
|
||||
gint object_list_select_region(ObjectList_t *list, gint x, gint y, gint width,
|
||||
gint height);
|
||||
gint height);
|
||||
gint object_list_deselect_all(ObjectList_t *list, Object_t *exception);
|
||||
gint object_list_nr_selected(ObjectList_t *list);
|
||||
void object_list_resize(ObjectList_t *list, gint percentage_x,
|
||||
gint percentage_y);
|
||||
gint percentage_y);
|
||||
void object_list_move_selected(ObjectList_t *list, gint dx, gint dy);
|
||||
void object_list_move_up(ObjectList_t *list, Object_t *obj);
|
||||
void object_list_move_down(ObjectList_t *list, Object_t *obj);
|
||||
|
@ -203,33 +203,33 @@ void object_list_send_to_back(ObjectList_t *list);
|
|||
void object_list_move_sash_selected(ObjectList_t *list, gint dx, gint dy);
|
||||
|
||||
void object_list_write_csim(ObjectList_t *list, gpointer param,
|
||||
OutputFunc_t output);
|
||||
OutputFunc_t output);
|
||||
void object_list_write_cern(ObjectList_t *list, gpointer param,
|
||||
OutputFunc_t output);
|
||||
OutputFunc_t output);
|
||||
void object_list_write_ncsa(ObjectList_t *list, gpointer param,
|
||||
OutputFunc_t output);
|
||||
OutputFunc_t output);
|
||||
|
||||
typedef void (*ObjectListCallbackFunc_t)(Object_t*, gpointer);
|
||||
|
||||
gpointer object_list_add_changed_cb(ObjectList_t *list,
|
||||
ObjectListCallbackFunc_t func,
|
||||
gpointer data);
|
||||
ObjectListCallbackFunc_t func,
|
||||
gpointer data);
|
||||
gpointer object_list_add_update_cb(ObjectList_t *list,
|
||||
ObjectListCallbackFunc_t func,
|
||||
gpointer data);
|
||||
ObjectListCallbackFunc_t func,
|
||||
gpointer data);
|
||||
gpointer object_list_add_add_cb(ObjectList_t *list,
|
||||
ObjectListCallbackFunc_t func, gpointer data);
|
||||
ObjectListCallbackFunc_t func, gpointer data);
|
||||
gpointer object_list_add_remove_cb(ObjectList_t *list,
|
||||
ObjectListCallbackFunc_t func,
|
||||
gpointer data);
|
||||
ObjectListCallbackFunc_t func,
|
||||
gpointer data);
|
||||
gpointer object_list_add_select_cb(ObjectList_t *list,
|
||||
ObjectListCallbackFunc_t func,
|
||||
gpointer data);
|
||||
ObjectListCallbackFunc_t func,
|
||||
gpointer data);
|
||||
gpointer object_list_add_move_cb(ObjectList_t *list,
|
||||
ObjectListCallbackFunc_t func, gpointer data);
|
||||
ObjectListCallbackFunc_t func, gpointer data);
|
||||
gpointer object_list_add_geometry_cb(ObjectList_t *list,
|
||||
ObjectListCallbackFunc_t func,
|
||||
gpointer data);
|
||||
ObjectListCallbackFunc_t func,
|
||||
gpointer data);
|
||||
|
||||
void object_list_remove_add_cb(ObjectList_t *list, gpointer id);
|
||||
void object_list_remove_select_cb(ObjectList_t *list, gpointer id);
|
||||
|
@ -239,13 +239,13 @@ void object_list_remove_geometry_cb(ObjectList_t *list, gpointer id);
|
|||
|
||||
#define object_list_clear_changed(list) ((list)->changed = FALSE)
|
||||
#define object_list_set_changed(list, ischanged) \
|
||||
((list)->changed = (ischanged))
|
||||
((list)->changed = (ischanged))
|
||||
#define object_list_get_changed(list) ((list)->changed)
|
||||
|
||||
void clear_paste_buffer(void);
|
||||
gpointer paste_buffer_add_add_cb(ObjectListCallbackFunc_t func, gpointer data);
|
||||
gpointer paste_buffer_add_remove_cb(ObjectListCallbackFunc_t func,
|
||||
gpointer data);
|
||||
gpointer data);
|
||||
ObjectList_t *get_paste_buffer(void);
|
||||
|
||||
void do_object_locked_dialog(void);
|
||||
|
|
|
@ -39,11 +39,11 @@ object_handle_popup(ObjectPopup_t *popup, Object_t *obj, GdkEventButton *event)
|
|||
#ifdef _TEMP_
|
||||
gtk_widget_set_sensitive(popup->up, (position > 1) ? TRUE : FALSE);
|
||||
gtk_widget_set_sensitive(popup->down,
|
||||
(position < g_list_length(obj->list->list))
|
||||
? TRUE : FALSE);
|
||||
(position < g_list_length(obj->list->list))
|
||||
? TRUE : FALSE);
|
||||
#endif
|
||||
gtk_menu_popup(GTK_MENU(popup->menu), NULL, NULL, NULL, NULL,
|
||||
event->button, event->time);
|
||||
event->button, event->time);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -33,7 +33,7 @@ typedef struct {
|
|||
} ObjectPopup_t;
|
||||
|
||||
void object_handle_popup(ObjectPopup_t *popup, Object_t *obj,
|
||||
GdkEventButton *event);
|
||||
GdkEventButton *event);
|
||||
void object_do_popup(Object_t *obj, GdkEventButton *event);
|
||||
|
||||
#endif /* _IMAP_OBJECT_POPUP_H */
|
||||
|
|
|
@ -49,9 +49,9 @@ static void polygon_draw_sashes(Object_t* obj, GdkWindow *window, GdkGC* gc);
|
|||
static MoveSashFunc_t polygon_near_sash(Object_t *obj, gint x, gint y);
|
||||
static gboolean polygon_point_is_on(Object_t *obj, gint x, gint y);
|
||||
static void polygon_get_dimensions(Object_t *obj, gint *x, gint *y,
|
||||
gint *width, gint *height);
|
||||
gint *width, gint *height);
|
||||
static void polygon_resize(Object_t *obj, gint percentage_x,
|
||||
gint percentage_y);
|
||||
gint percentage_y);
|
||||
static void polygon_move(Object_t *obj, gint dx, gint dy);
|
||||
static gpointer polygon_create_info_widget(GtkWidget *frame);
|
||||
static void polygon_update_info_widget(Object_t *obj, gpointer data);
|
||||
|
@ -59,25 +59,25 @@ static void polygon_fill_info_tab(Object_t *obj, gpointer data);
|
|||
static void polygon_set_initial_focus(Object_t *obj, gpointer data);
|
||||
static void polygon_update(Object_t* obj, gpointer data);
|
||||
static void polygon_write_csim(Object_t* obj, gpointer param,
|
||||
OutputFunc_t output);
|
||||
OutputFunc_t output);
|
||||
static void polygon_write_cern(Object_t* obj, gpointer param,
|
||||
OutputFunc_t output);
|
||||
OutputFunc_t output);
|
||||
static void polygon_write_ncsa(Object_t* obj, gpointer param,
|
||||
OutputFunc_t output);
|
||||
OutputFunc_t output);
|
||||
static void polygon_do_popup(Object_t *obj, GdkEventButton *event);
|
||||
static const gchar* polygon_get_stock_icon_name(void);
|
||||
|
||||
static ObjectClass_t polygon_class = {
|
||||
N_("_Polygon"),
|
||||
NULL, /* info_dialog */
|
||||
NULL, /* icon */
|
||||
NULL, /* mask */
|
||||
NULL, /* info_dialog */
|
||||
NULL, /* icon */
|
||||
NULL, /* mask */
|
||||
|
||||
polygon_is_valid,
|
||||
polygon_destruct,
|
||||
polygon_clone,
|
||||
polygon_assign,
|
||||
NULL, /* polygon_normalize */
|
||||
NULL, /* polygon_normalize */
|
||||
polygon_draw,
|
||||
polygon_draw_sashes,
|
||||
polygon_near_sash,
|
||||
|
@ -193,8 +193,8 @@ polygon_near_sash(Object_t *obj, gint x, gint y)
|
|||
for (p = polygon->points; p; p = p->next, _sash_index++) {
|
||||
GdkPoint *point = (GdkPoint*) p->data;
|
||||
if (near_sash(point->x, point->y, x, y)) {
|
||||
_sash_point = point;
|
||||
return move_sash;
|
||||
_sash_point = point;
|
||||
return move_sash;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
@ -229,7 +229,7 @@ polygon_point_is_on(Object_t *obj, gint x, gint y)
|
|||
for (; p; p = p->next) {
|
||||
GdkPoint *point = (GdkPoint*) p->data;
|
||||
if (right_intersect(prev, point, x, y))
|
||||
count++;
|
||||
count++;
|
||||
prev = point;
|
||||
}
|
||||
if (right_intersect(prev, first, x, y))
|
||||
|
@ -240,7 +240,7 @@ polygon_point_is_on(Object_t *obj, gint x, gint y)
|
|||
|
||||
static void
|
||||
polygon_get_dimensions(Object_t *obj, gint *x, gint *y,
|
||||
gint *width, gint *height)
|
||||
gint *width, gint *height)
|
||||
{
|
||||
Polygon_t *polygon = ObjectToPolygon(obj);
|
||||
gint min_x = G_MAXINT, min_y = G_MAXINT;
|
||||
|
@ -250,13 +250,13 @@ polygon_get_dimensions(Object_t *obj, gint *x, gint *y,
|
|||
for (p = polygon->points; p; p = p->next) {
|
||||
GdkPoint *point = (GdkPoint*) p->data;
|
||||
if (point->x < min_x)
|
||||
min_x = point->x;
|
||||
min_x = point->x;
|
||||
if (point->x > max_x)
|
||||
max_x = point->x;
|
||||
max_x = point->x;
|
||||
if (point->y < min_y)
|
||||
min_y = point->y;
|
||||
min_y = point->y;
|
||||
if (point->y > max_y)
|
||||
max_y = point->y;
|
||||
max_y = point->y;
|
||||
}
|
||||
*x = min_x;
|
||||
*y = min_y;
|
||||
|
@ -298,7 +298,7 @@ typedef struct {
|
|||
GtkWidget *insert;
|
||||
GtkWidget *append;
|
||||
GtkWidget *remove;
|
||||
gint selected_row;
|
||||
gint selected_row;
|
||||
guint timeout;
|
||||
} PolygonProperties_t;
|
||||
|
||||
|
@ -342,7 +342,7 @@ static void
|
|||
set_buttons_sensitivity(PolygonProperties_t *data)
|
||||
{
|
||||
gint rows = gtk_tree_model_iter_n_children (GTK_TREE_MODEL(data->store),
|
||||
NULL);
|
||||
NULL);
|
||||
gtk_widget_set_sensitive(data->insert, rows != MAX_POLYGON_POINTS);
|
||||
gtk_widget_set_sensitive(data->append, rows != MAX_POLYGON_POINTS);
|
||||
gtk_widget_set_sensitive(data->remove, rows > 2);
|
||||
|
@ -364,7 +364,7 @@ insert_button_clicked(GtkWidget *widget, PolygonProperties_t *data)
|
|||
gtk_tree_model_get (model, &iter, 0, &point, -1);
|
||||
here = g_list_find(polygon->points, point);
|
||||
polygon->points = g_list_insert_before(polygon->points, here,
|
||||
new_point(x, y));
|
||||
new_point(x, y));
|
||||
polygon_fill_info_tab(data->obj, data);
|
||||
}
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ y_changed_cb(GtkWidget *widget, gpointer data)
|
|||
|
||||
static void
|
||||
render_x(GtkTreeViewColumn *column, GtkCellRenderer *cell,
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
{
|
||||
GdkPoint *point;
|
||||
gchar scratch[16];
|
||||
|
@ -429,7 +429,7 @@ render_x(GtkTreeViewColumn *column, GtkCellRenderer *cell,
|
|||
|
||||
static void
|
||||
render_y(GtkTreeViewColumn *column, GtkCellRenderer *cell,
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
{
|
||||
GdkPoint *point;
|
||||
gchar scratch[16];
|
||||
|
@ -457,9 +457,9 @@ polygon_create_info_widget(GtkWidget *frame)
|
|||
swin = gtk_scrolled_window_new(NULL, NULL);
|
||||
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
|
||||
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
||||
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(swin),
|
||||
GTK_SHADOW_IN);
|
||||
GTK_SHADOW_IN);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), swin, FALSE, FALSE, FALSE);
|
||||
gtk_widget_show(swin);
|
||||
|
||||
|
@ -471,19 +471,19 @@ polygon_create_info_widget(GtkWidget *frame)
|
|||
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes (_("x (pixels)"),
|
||||
renderer,
|
||||
NULL);
|
||||
renderer,
|
||||
NULL);
|
||||
gtk_tree_view_column_set_cell_data_func(column, renderer,
|
||||
render_x, props, NULL);
|
||||
render_x, props, NULL);
|
||||
gtk_tree_view_column_set_alignment(column, 0.5);
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (view), column);
|
||||
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes (_("y (pixels)"),
|
||||
renderer,
|
||||
NULL);
|
||||
renderer,
|
||||
NULL);
|
||||
gtk_tree_view_column_set_cell_data_func(column, renderer,
|
||||
render_y, props, NULL);
|
||||
render_y, props, NULL);
|
||||
gtk_tree_view_column_set_alignment(column, 0.5);
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (view), column);
|
||||
|
||||
|
@ -497,41 +497,41 @@ polygon_create_info_widget(GtkWidget *frame)
|
|||
|
||||
label = create_label_in_table(table, 0, 0, "_x:");
|
||||
props->x = create_spin_button_in_table(table, label, 0, 1, 1, 0,
|
||||
max_width - 1);
|
||||
max_width - 1);
|
||||
g_signal_connect(props->x, "changed",
|
||||
G_CALLBACK(x_changed_cb), (gpointer) props);
|
||||
G_CALLBACK(x_changed_cb), (gpointer) props);
|
||||
gtk_widget_set_size_request(props->x, 64, -1);
|
||||
create_label_in_table(table, 0, 2, _("pixels"));
|
||||
|
||||
label = create_label_in_table(table, 1, 0, "_y:");
|
||||
props->y = create_spin_button_in_table(table, label, 1, 1, 1, 0,
|
||||
max_height - 1);
|
||||
max_height - 1);
|
||||
g_signal_connect(props->y, "changed",
|
||||
G_CALLBACK(y_changed_cb), (gpointer) props);
|
||||
G_CALLBACK(y_changed_cb), (gpointer) props);
|
||||
gtk_widget_set_size_request(props->y, 64, -1);
|
||||
create_label_in_table(table, 1, 2, _("pixels"));
|
||||
|
||||
props->update = gtk_button_new_with_mnemonic(_("_Update"));
|
||||
g_signal_connect(props->update, "clicked",
|
||||
G_CALLBACK(update_button_clicked), props);
|
||||
G_CALLBACK(update_button_clicked), props);
|
||||
gtk_table_attach_defaults(GTK_TABLE(table), props->update, 1, 2, 2, 3);
|
||||
gtk_widget_show(props->update);
|
||||
|
||||
props->insert = gtk_button_new_with_mnemonic(_("_Insert"));
|
||||
g_signal_connect(props->insert, "clicked",
|
||||
G_CALLBACK(insert_button_clicked), props);
|
||||
G_CALLBACK(insert_button_clicked), props);
|
||||
gtk_table_attach_defaults(GTK_TABLE(table), props->insert, 1, 2, 3, 4);
|
||||
gtk_widget_show(props->insert);
|
||||
|
||||
props->append = gtk_button_new_with_mnemonic(_("A_ppend"));
|
||||
g_signal_connect(props->append, "clicked",
|
||||
G_CALLBACK(append_button_clicked), props);
|
||||
G_CALLBACK(append_button_clicked), props);
|
||||
gtk_table_attach_defaults(GTK_TABLE(table), props->append, 1, 2, 4, 5);
|
||||
gtk_widget_show(props->append);
|
||||
|
||||
props->remove = gtk_button_new_with_mnemonic(_("_Remove"));
|
||||
g_signal_connect(props->remove, "clicked",
|
||||
G_CALLBACK(remove_button_clicked), props);
|
||||
G_CALLBACK(remove_button_clicked), props);
|
||||
gtk_table_attach_defaults(GTK_TABLE(table), props->remove, 1, 2, 5, 6);
|
||||
gtk_widget_show(props->remove);
|
||||
|
||||
|
@ -540,7 +540,7 @@ polygon_create_info_widget(GtkWidget *frame)
|
|||
props->selection = gtk_tree_view_get_selection(GTK_TREE_VIEW (view));
|
||||
gtk_tree_selection_set_mode(props->selection, GTK_SELECTION_SINGLE);
|
||||
g_signal_connect (props->selection, "changed",
|
||||
G_CALLBACK (select_row_cb), props);
|
||||
G_CALLBACK (select_row_cb), props);
|
||||
|
||||
return props;
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ polygon_update_info_widget(Object_t *obj, gpointer data)
|
|||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(props->y), _sash_point->y);
|
||||
|
||||
if (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(props->store), &iter,
|
||||
NULL, _sash_index)) {
|
||||
NULL, _sash_index)) {
|
||||
gtk_tree_selection_select_iter(props->selection, &iter);
|
||||
}
|
||||
|
||||
|
@ -590,7 +590,7 @@ polygon_fill_info_tab(Object_t *obj, gpointer data)
|
|||
}
|
||||
|
||||
if (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(props->store), &iter,
|
||||
NULL, _sash_index)) {
|
||||
NULL, _sash_index)) {
|
||||
gtk_tree_selection_select_iter(props->selection, &iter);
|
||||
}
|
||||
set_buttons_sensitivity(props);
|
||||
|
@ -704,7 +704,7 @@ polygon_near_edge(Object_t *obj, gint x, gint y)
|
|||
for (p = p->next; p; p = p->next, n++) {
|
||||
GdkPoint *next = (GdkPoint*) p->data;
|
||||
if (point_near_edge(prev, next, x, y))
|
||||
return n;
|
||||
return n;
|
||||
prev = next;
|
||||
}
|
||||
return (point_near_edge(prev, first, x, y)) ? n + 1 : 0;
|
||||
|
@ -819,7 +819,7 @@ polygon_factory_set_xy(Object_t *obj, guint state, gint x, gint y)
|
|||
}
|
||||
|
||||
static ObjectFactory_t polygon_factory = {
|
||||
NULL, /* Object pointer */
|
||||
NULL, /* Object pointer */
|
||||
polygon_factory_finish,
|
||||
polygon_factory_cancel,
|
||||
polygon_factory_create_object,
|
||||
|
|
|
@ -42,34 +42,34 @@
|
|||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
typedef struct {
|
||||
DefaultDialog_t *dialog;
|
||||
GtkWidget *notebook;
|
||||
GtkWidget *ncsa;
|
||||
GtkWidget *cern;
|
||||
GtkWidget *csim;
|
||||
GtkWidget *prompt_for_area_info;
|
||||
GtkWidget *require_default_url;
|
||||
GtkWidget *show_area_handle;
|
||||
GtkWidget *keep_circles_round;
|
||||
GtkWidget *show_url_tip;
|
||||
GtkWidget *use_doublesized;
|
||||
DefaultDialog_t *dialog;
|
||||
GtkWidget *notebook;
|
||||
GtkWidget *ncsa;
|
||||
GtkWidget *cern;
|
||||
GtkWidget *csim;
|
||||
GtkWidget *prompt_for_area_info;
|
||||
GtkWidget *require_default_url;
|
||||
GtkWidget *show_area_handle;
|
||||
GtkWidget *keep_circles_round;
|
||||
GtkWidget *show_url_tip;
|
||||
GtkWidget *use_doublesized;
|
||||
|
||||
GtkWidget *undo_levels;
|
||||
GtkWidget *mru_size;
|
||||
GtkWidget *undo_levels;
|
||||
GtkWidget *mru_size;
|
||||
|
||||
GtkWidget *normal_fg;
|
||||
GtkWidget *normal_bg;
|
||||
GtkWidget *selected_fg;
|
||||
GtkWidget *selected_bg;
|
||||
GtkWidget *normal_fg;
|
||||
GtkWidget *normal_bg;
|
||||
GtkWidget *selected_fg;
|
||||
GtkWidget *selected_bg;
|
||||
|
||||
GtkWidget *threshold;
|
||||
GtkWidget *auto_convert;
|
||||
GtkWidget *threshold;
|
||||
GtkWidget *auto_convert;
|
||||
|
||||
PreferencesData_t *old_data;
|
||||
PreferencesData_t *old_data;
|
||||
} PreferencesDialog_t;
|
||||
|
||||
static void get_button_colors (PreferencesDialog_t *dialog,
|
||||
ColorSelData_t *colors);
|
||||
ColorSelData_t *colors);
|
||||
|
||||
static gint
|
||||
parse_map_type(void)
|
||||
|
@ -117,7 +117,7 @@ parse_line(PreferencesData_t *data, char *line)
|
|||
char *token;
|
||||
ColorSelData_t *colors = &data->colors;
|
||||
|
||||
line++; /* Skip '(' */
|
||||
line++; /* Skip '(' */
|
||||
token = strtok(line, " ");
|
||||
|
||||
if (!strcmp(token, "default-map-type")) {
|
||||
|
@ -137,11 +137,11 @@ parse_line(PreferencesData_t *data, char *line)
|
|||
} else if (!strcmp(token, "mru-size")) {
|
||||
data->mru_size = parse_int();
|
||||
if (data->mru_size < 1)
|
||||
data->mru_size = 1;
|
||||
data->mru_size = 1;
|
||||
} else if (!strcmp(token, "undo-levels")) {
|
||||
data->undo_levels = parse_int();
|
||||
if (data->undo_levels < 1)
|
||||
data->undo_levels = 1;
|
||||
data->undo_levels = 1;
|
||||
} else if (!strcmp(token, "normal-fg-color")) {
|
||||
parse_color(&colors->normal_fg);
|
||||
} else if (!strcmp(token, "normal-bg-color")) {
|
||||
|
@ -170,9 +170,9 @@ preferences_load(PreferencesData_t *data)
|
|||
g_free(filename);
|
||||
if (in) {
|
||||
while (fgets(buf, sizeof(buf), in)) {
|
||||
if (*buf != '\n' && *buf != '#') {
|
||||
parse_line(data, buf);
|
||||
}
|
||||
if (*buf != '\n' && *buf != '#') {
|
||||
parse_line(data, buf);
|
||||
}
|
||||
}
|
||||
fclose(in);
|
||||
return TRUE;
|
||||
|
@ -193,40 +193,40 @@ preferences_save(PreferencesData_t *data)
|
|||
if (out) {
|
||||
fprintf(out, "# Image map plug-in resource file\n\n");
|
||||
if (data->default_map_type == NCSA)
|
||||
fprintf(out, "(default-map-type ncsa)\n");
|
||||
fprintf(out, "(default-map-type ncsa)\n");
|
||||
else if (data->default_map_type == CERN)
|
||||
fprintf(out, "(default-map-type cern)\n");
|
||||
fprintf(out, "(default-map-type cern)\n");
|
||||
else
|
||||
fprintf(out, "(default-map-type csim)\n");
|
||||
fprintf(out, "(default-map-type csim)\n");
|
||||
|
||||
fprintf(out, "(prompt-for-area-info %s)\n",
|
||||
(data->prompt_for_area_info) ? "yes" : "no");
|
||||
(data->prompt_for_area_info) ? "yes" : "no");
|
||||
fprintf(out, "(require-default-url %s)\n",
|
||||
(data->require_default_url) ? "yes" : "no");
|
||||
(data->require_default_url) ? "yes" : "no");
|
||||
fprintf(out, "(show-area-handle %s)\n",
|
||||
(data->show_area_handle) ? "yes" : "no");
|
||||
(data->show_area_handle) ? "yes" : "no");
|
||||
fprintf(out, "(keep-circles-round %s)\n",
|
||||
(data->keep_circles_round) ? "yes" : "no");
|
||||
(data->keep_circles_round) ? "yes" : "no");
|
||||
fprintf(out, "(show-url-tip %s)\n",
|
||||
(data->show_url_tip) ? "yes" : "no");
|
||||
(data->show_url_tip) ? "yes" : "no");
|
||||
fprintf(out, "(use-doublesized %s)\n",
|
||||
(data->use_doublesized) ? "yes" : "no");
|
||||
(data->use_doublesized) ? "yes" : "no");
|
||||
|
||||
fprintf(out, "(undo-levels %d)\n", data->undo_levels);
|
||||
fprintf(out, "(mru-size %d)\n", data->mru_size);
|
||||
|
||||
fprintf(out, "(normal-fg-color %d %d %d)\n",
|
||||
colors->normal_fg.red, colors->normal_fg.green,
|
||||
colors->normal_fg.blue);
|
||||
colors->normal_fg.red, colors->normal_fg.green,
|
||||
colors->normal_fg.blue);
|
||||
fprintf(out, "(normal-bg-color %d %d %d)\n",
|
||||
colors->normal_bg.red, colors->normal_bg.green,
|
||||
colors->normal_bg.blue);
|
||||
colors->normal_bg.red, colors->normal_bg.green,
|
||||
colors->normal_bg.blue);
|
||||
fprintf(out, "(selected-fg-color %d %d %d)\n",
|
||||
colors->selected_fg.red, colors->selected_fg.green,
|
||||
colors->selected_fg.blue);
|
||||
colors->selected_fg.red, colors->selected_fg.green,
|
||||
colors->selected_fg.blue);
|
||||
fprintf(out, "(selected-bg-color %d %d %d)\n",
|
||||
colors->selected_bg.red, colors->selected_bg.green,
|
||||
colors->selected_bg.blue);
|
||||
colors->selected_bg.red, colors->selected_bg.green,
|
||||
colors->selected_bg.blue);
|
||||
|
||||
mru_write(get_mru(), out);
|
||||
|
||||
|
@ -338,7 +338,7 @@ create_tab(GtkWidget *notebook, const gchar *label, gint rows, gint cols)
|
|||
gtk_widget_show(table);
|
||||
|
||||
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox,
|
||||
gtk_label_new_with_mnemonic(label));
|
||||
gtk_label_new_with_mnemonic(label));
|
||||
|
||||
return table;
|
||||
}
|
||||
|
@ -380,7 +380,7 @@ create_general_tab(PreferencesDialog_t *data, GtkWidget *notebook)
|
|||
create_check_button_in_table(table, 5, 0, _("Show area URL _tip"));
|
||||
data->use_doublesized =
|
||||
create_check_button_in_table(table, 6, 0,
|
||||
_("_Use double-sized grab handles"));
|
||||
_("_Use double-sized grab handles"));
|
||||
gtk_widget_show(frame);
|
||||
}
|
||||
|
||||
|
@ -391,25 +391,25 @@ create_menu_tab(PreferencesDialog_t *data, GtkWidget *notebook)
|
|||
GtkWidget *label;
|
||||
|
||||
label = create_label_in_table(table, 0, 0,
|
||||
_("Number of _undo levels (1 - 99):"));
|
||||
_("Number of _undo levels (1 - 99):"));
|
||||
data->undo_levels = create_spin_button_in_table(table, label, 0, 1, 1, 1,
|
||||
99);
|
||||
99);
|
||||
|
||||
label = create_label_in_table(table, 1, 0,
|
||||
_("Number of M_RU entries (1 - 16):"));
|
||||
_("Number of M_RU entries (1 - 16):"));
|
||||
data->mru_size = create_spin_button_in_table(table, label, 1, 1, 1, 1, 16);
|
||||
}
|
||||
|
||||
static GtkWidget*
|
||||
create_color_field(PreferencesDialog_t *data, GtkWidget *table, gint row,
|
||||
gint col)
|
||||
gint col)
|
||||
{
|
||||
GimpRGB color = {0.0, 0.0, 0.0, 1.0};
|
||||
GtkWidget *area = gimp_color_button_new (_("Select Color"), 16, 8, &color,
|
||||
GIMP_COLOR_AREA_FLAT);
|
||||
GIMP_COLOR_AREA_FLAT);
|
||||
gimp_color_button_set_update (GIMP_COLOR_BUTTON (area), TRUE);
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), area, col, col + 1, row,
|
||||
row + 1);
|
||||
row + 1);
|
||||
gtk_widget_show (area);
|
||||
|
||||
return area;
|
||||
|
@ -437,7 +437,7 @@ create_contiguous_regions_tab(PreferencesDialog_t *data, GtkWidget *notebook)
|
|||
GtkWidget *label;
|
||||
|
||||
label = create_label_in_table(table, 0, 0,
|
||||
_("_Threshold:"));
|
||||
_("_Threshold:"));
|
||||
data->auto_convert =
|
||||
create_check_button_in_table(table, 1, 0, _("_Automatically convert"));
|
||||
}
|
||||
|
@ -491,20 +491,20 @@ do_preferences_dialog(void)
|
|||
GTK_TOGGLE_BUTTON(dialog->prompt_for_area_info),
|
||||
old_data->prompt_for_area_info);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->require_default_url),
|
||||
old_data->require_default_url);
|
||||
old_data->require_default_url);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->show_area_handle),
|
||||
old_data->show_area_handle);
|
||||
old_data->show_area_handle);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->keep_circles_round),
|
||||
old_data->keep_circles_round);
|
||||
old_data->keep_circles_round);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->show_url_tip),
|
||||
old_data->show_url_tip);
|
||||
old_data->show_url_tip);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->use_doublesized),
|
||||
old_data->use_doublesized);
|
||||
old_data->use_doublesized);
|
||||
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->undo_levels),
|
||||
old_data->undo_levels);
|
||||
old_data->undo_levels);
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->mru_size),
|
||||
old_data->mru_size);
|
||||
old_data->mru_size);
|
||||
|
||||
set_button_colors(dialog, &old_data->colors);
|
||||
|
||||
|
|
|
@ -33,20 +33,20 @@ typedef struct {
|
|||
} ColorSelData_t;
|
||||
|
||||
typedef struct {
|
||||
gint default_map_type;
|
||||
gboolean prompt_for_area_info;
|
||||
gboolean require_default_url;
|
||||
gboolean show_area_handle;
|
||||
gboolean keep_circles_round;
|
||||
gboolean show_url_tip;
|
||||
gboolean use_doublesized;
|
||||
gboolean auto_convert;
|
||||
gdouble threshold;
|
||||
gint undo_levels;
|
||||
gint mru_size;
|
||||
ColorSelData_t colors;
|
||||
GdkGC *normal_gc;
|
||||
GdkGC *selected_gc;
|
||||
gint default_map_type;
|
||||
gboolean prompt_for_area_info;
|
||||
gboolean require_default_url;
|
||||
gboolean show_area_handle;
|
||||
gboolean keep_circles_round;
|
||||
gboolean show_url_tip;
|
||||
gboolean use_doublesized;
|
||||
gboolean auto_convert;
|
||||
gdouble threshold;
|
||||
gint undo_levels;
|
||||
gint mru_size;
|
||||
ColorSelData_t colors;
|
||||
GdkGC *normal_gc;
|
||||
GdkGC *selected_gc;
|
||||
} PreferencesData_t;
|
||||
|
||||
void do_preferences_dialog(void);
|
||||
|
|
|
@ -35,26 +35,26 @@
|
|||
#include "imap_preview.h"
|
||||
|
||||
#define PREVIEW_MASK (GDK_EXPOSURE_MASK | \
|
||||
GDK_POINTER_MOTION_MASK | \
|
||||
GDK_POINTER_MOTION_MASK | \
|
||||
GDK_BUTTON_PRESS_MASK | \
|
||||
GDK_BUTTON_RELEASE_MASK | \
|
||||
GDK_BUTTON_MOTION_MASK | \
|
||||
GDK_KEY_PRESS_MASK | \
|
||||
GDK_KEY_RELEASE_MASK | \
|
||||
GDK_ENTER_NOTIFY_MASK | \
|
||||
GDK_LEAVE_NOTIFY_MASK)
|
||||
GDK_BUTTON_RELEASE_MASK | \
|
||||
GDK_BUTTON_MOTION_MASK | \
|
||||
GDK_KEY_PRESS_MASK | \
|
||||
GDK_KEY_RELEASE_MASK | \
|
||||
GDK_ENTER_NOTIFY_MASK | \
|
||||
GDK_LEAVE_NOTIFY_MASK)
|
||||
|
||||
#define PREVIEW_SIZE 400
|
||||
|
||||
/*======================================================================
|
||||
Preview Rendering Util routine
|
||||
Preview Rendering Util routine
|
||||
=======================================================================*/
|
||||
|
||||
#define CHECKWIDTH 4
|
||||
#define LIGHTCHECK 192
|
||||
#define DARKCHECK 128
|
||||
#ifndef OPAQUE
|
||||
#define OPAQUE 255
|
||||
#define OPAQUE 255
|
||||
#endif
|
||||
|
||||
static Preview_t*
|
||||
|
@ -78,10 +78,10 @@ preview_get_height(GtkWidget *preview)
|
|||
static void
|
||||
render_gray_image(Preview_t *preview_base, GimpPixelRgn *srcrgn)
|
||||
{
|
||||
guchar *src_row, *dest_buffer, *src, *dest;
|
||||
gint row, col;
|
||||
gint bpp, dwidth, dheight, pwidth, pheight;
|
||||
gint *src_col;
|
||||
guchar *src_row, *dest_buffer, *src, *dest;
|
||||
gint row, col;
|
||||
gint bpp, dwidth, dheight, pwidth, pheight;
|
||||
gint *src_col;
|
||||
GtkWidget *preview = preview_base->preview;
|
||||
|
||||
dwidth = srcrgn->w;
|
||||
|
@ -101,13 +101,13 @@ render_gray_image(Preview_t *preview_base, GimpPixelRgn *srcrgn)
|
|||
|
||||
for (row = 0; row < pheight; row++) {
|
||||
gimp_pixel_rgn_get_row(srcrgn, src_row, 0, row * dheight / pheight,
|
||||
dwidth);
|
||||
dwidth);
|
||||
|
||||
src = src_row;
|
||||
|
||||
for (col = 0; col < pwidth; col++) {
|
||||
src = &src_row[src_col[col]];
|
||||
*dest++ = *src;
|
||||
src = &src_row[src_col[col]];
|
||||
*dest++ = *src;
|
||||
}
|
||||
}
|
||||
gimp_preview_area_draw (GIMP_PREVIEW_AREA (preview),
|
||||
|
@ -124,14 +124,14 @@ render_gray_image(Preview_t *preview_base, GimpPixelRgn *srcrgn)
|
|||
static void
|
||||
render_indexed_image(Preview_t *preview_base, GimpPixelRgn *srcrgn)
|
||||
{
|
||||
guchar *src_row, *dest_buffer, *src, *dest;
|
||||
gint row, col;
|
||||
gint dwidth, dheight, pwidth, pheight;
|
||||
gint *src_col;
|
||||
gint bpp, alpha, has_alpha;
|
||||
guchar *cmap, *colour;
|
||||
gint ncols;
|
||||
gboolean gray = get_map_info()->show_gray;
|
||||
guchar *src_row, *dest_buffer, *src, *dest;
|
||||
gint row, col;
|
||||
gint dwidth, dheight, pwidth, pheight;
|
||||
gint *src_col;
|
||||
gint bpp, alpha, has_alpha;
|
||||
guchar *cmap, *colour;
|
||||
gint ncols;
|
||||
gboolean gray = get_map_info()->show_gray;
|
||||
GtkWidget *preview = preview_base->preview;
|
||||
|
||||
dwidth = srcrgn->w;
|
||||
|
@ -157,23 +157,23 @@ render_indexed_image(Preview_t *preview_base, GimpPixelRgn *srcrgn)
|
|||
dest = dest_buffer;
|
||||
for (row = 0; row < pheight; row++) {
|
||||
gimp_pixel_rgn_get_row(srcrgn, src_row, 0, row * dheight / pheight,
|
||||
dwidth);
|
||||
dwidth);
|
||||
|
||||
for (col = 0; col < pwidth; col++) {
|
||||
src = &src_row[src_col[col]];
|
||||
colour = cmap + 3 * (int)(*src);
|
||||
src = &src_row[src_col[col]];
|
||||
colour = cmap + 3 * (int)(*src);
|
||||
|
||||
if (gray) {
|
||||
guchar avg = (299 * colour[0] + 587 * colour[1] +
|
||||
114 * colour[2]) / 1000;
|
||||
*dest++ = avg;
|
||||
*dest++ = avg;
|
||||
*dest++ = avg;
|
||||
} else {
|
||||
*dest++ = colour[0];
|
||||
*dest++ = colour[1];
|
||||
*dest++ = colour[2];
|
||||
}
|
||||
if (gray) {
|
||||
guchar avg = (299 * colour[0] + 587 * colour[1] +
|
||||
114 * colour[2]) / 1000;
|
||||
*dest++ = avg;
|
||||
*dest++ = avg;
|
||||
*dest++ = avg;
|
||||
} else {
|
||||
*dest++ = colour[0];
|
||||
*dest++ = colour[1];
|
||||
*dest++ = colour[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
gimp_preview_area_draw(GIMP_PREVIEW_AREA(preview),
|
||||
|
@ -189,13 +189,13 @@ render_indexed_image(Preview_t *preview_base, GimpPixelRgn *srcrgn)
|
|||
static void
|
||||
render_rgb_image(Preview_t *preview_base, GimpPixelRgn *srcrgn)
|
||||
{
|
||||
guchar *src_row, *dest_buffer, *src, *dest;
|
||||
gint row, col;
|
||||
gint dwidth, dheight, pwidth, pheight;
|
||||
gint *src_col;
|
||||
gint bpp, alpha, has_alpha, b;
|
||||
guchar check;
|
||||
gboolean gray = get_map_info()->show_gray;
|
||||
guchar *src_row, *dest_buffer, *src, *dest;
|
||||
gint row, col;
|
||||
gint dwidth, dheight, pwidth, pheight;
|
||||
gint *src_col;
|
||||
gint bpp, alpha, has_alpha, b;
|
||||
guchar check;
|
||||
gboolean gray = get_map_info()->show_gray;
|
||||
GtkWidget *preview = preview_base->preview;
|
||||
|
||||
dwidth = srcrgn->w;
|
||||
|
@ -218,39 +218,39 @@ render_rgb_image(Preview_t *preview_base, GimpPixelRgn *srcrgn)
|
|||
dest = dest_buffer;
|
||||
for (row = 0; row < pheight; row++) {
|
||||
gimp_pixel_rgn_get_row(srcrgn, src_row, 0, row * dheight / pheight,
|
||||
dwidth);
|
||||
dwidth);
|
||||
for (col = 0; col < pwidth; col++) {
|
||||
src = &src_row[src_col[col]];
|
||||
if(!has_alpha || src[alpha] == OPAQUE) {
|
||||
/* no alpha channel or opaque -- simple way */
|
||||
for (b = 0; b < alpha; b++)
|
||||
dest[b] = src[b];
|
||||
} else {
|
||||
/* more or less transparent */
|
||||
if( ( col % (CHECKWIDTH*2) < CHECKWIDTH ) ^
|
||||
( row % (CHECKWIDTH*2) < CHECKWIDTH ) )
|
||||
check = LIGHTCHECK;
|
||||
else
|
||||
check = DARKCHECK;
|
||||
src = &src_row[src_col[col]];
|
||||
if(!has_alpha || src[alpha] == OPAQUE) {
|
||||
/* no alpha channel or opaque -- simple way */
|
||||
for (b = 0; b < alpha; b++)
|
||||
dest[b] = src[b];
|
||||
} else {
|
||||
/* more or less transparent */
|
||||
if( ( col % (CHECKWIDTH*2) < CHECKWIDTH ) ^
|
||||
( row % (CHECKWIDTH*2) < CHECKWIDTH ) )
|
||||
check = LIGHTCHECK;
|
||||
else
|
||||
check = DARKCHECK;
|
||||
|
||||
if (src[alpha] == 0) {
|
||||
/* full transparent -- check */
|
||||
for (b = 0; b < alpha; b++)
|
||||
dest[b] = check;
|
||||
} else {
|
||||
/* middlemost transparent -- mix check and src */
|
||||
for (b = 0; b < alpha; b++)
|
||||
dest[b] = (src[b] * src[alpha] +
|
||||
check * (OPAQUE - src[alpha])) / OPAQUE;
|
||||
}
|
||||
}
|
||||
if (gray) {
|
||||
guchar avg;
|
||||
avg = (299 * dest[0] + 587 * dest[1] + 114 * dest[2]) / 1000;
|
||||
for (b = 0; b < alpha; b++)
|
||||
dest[b] = avg;
|
||||
}
|
||||
dest += alpha;
|
||||
if (src[alpha] == 0) {
|
||||
/* full transparent -- check */
|
||||
for (b = 0; b < alpha; b++)
|
||||
dest[b] = check;
|
||||
} else {
|
||||
/* middlemost transparent -- mix check and src */
|
||||
for (b = 0; b < alpha; b++)
|
||||
dest[b] = (src[b] * src[alpha] +
|
||||
check * (OPAQUE - src[alpha])) / OPAQUE;
|
||||
}
|
||||
}
|
||||
if (gray) {
|
||||
guchar avg;
|
||||
avg = (299 * dest[0] + 587 * dest[1] + 114 * dest[2]) / 1000;
|
||||
for (b = 0; b < alpha; b++)
|
||||
dest[b] = avg;
|
||||
}
|
||||
dest += alpha;
|
||||
}
|
||||
}
|
||||
gimp_preview_area_draw (GIMP_PREVIEW_AREA (preview),
|
||||
|
@ -304,7 +304,7 @@ add_preview_motion_event(Preview_t *preview, GCallback func)
|
|||
g_return_if_fail (func != NULL);
|
||||
|
||||
g_signal_connect(preview->preview, "motion-notify-event",
|
||||
func, NULL);
|
||||
func, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -313,7 +313,7 @@ add_enter_notify_event(Preview_t *preview, GCallback func)
|
|||
g_return_if_fail (func != NULL);
|
||||
|
||||
g_signal_connect(preview->preview, "enter-notify-event",
|
||||
func, NULL);
|
||||
func, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -322,7 +322,7 @@ add_leave_notify_event(Preview_t *preview, GCallback func)
|
|||
g_return_if_fail (func != NULL);
|
||||
|
||||
g_signal_connect(preview->preview, "leave-notify-event",
|
||||
func, NULL);
|
||||
func, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -331,7 +331,7 @@ add_preview_button_press_event(Preview_t *preview, GCallback func)
|
|||
g_return_if_fail (func != NULL);
|
||||
|
||||
g_signal_connect(preview->preview, "button-press-event",
|
||||
func, NULL);
|
||||
func, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -376,7 +376,7 @@ static const GtkTargetEntry target_table[] =
|
|||
|
||||
static void
|
||||
handle_drop(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
|
||||
GtkSelectionData *data, guint info, guint time)
|
||||
GtkSelectionData *data, guint info, guint time)
|
||||
{
|
||||
gboolean success = FALSE;
|
||||
|
||||
|
@ -441,15 +441,15 @@ make_preview (GimpDrawable *drawable)
|
|||
g_object_set_data (G_OBJECT (preview), "preview", data);
|
||||
gtk_widget_set_events(GTK_WIDGET(preview), PREVIEW_MASK);
|
||||
g_signal_connect_after(preview, "expose-event",
|
||||
G_CALLBACK(preview_expose), data);
|
||||
G_CALLBACK(preview_expose), data);
|
||||
g_signal_connect (preview, "size-allocate",
|
||||
G_CALLBACK (preview_size_allocate), (gpointer)data);
|
||||
|
||||
/* Handle drop of links in preview widget */
|
||||
gtk_drag_dest_set(preview, GTK_DEST_DEFAULT_ALL, target_table,
|
||||
2, GDK_ACTION_COPY);
|
||||
2, GDK_ACTION_COPY);
|
||||
g_signal_connect(preview, "drag-data-received",
|
||||
G_CALLBACK(handle_drop), NULL);
|
||||
G_CALLBACK(handle_drop), NULL);
|
||||
|
||||
data->widget_width = data->width =
|
||||
gimp_drawable_width(drawable->drawable_id);
|
||||
|
@ -467,11 +467,11 @@ make_preview (GimpDrawable *drawable)
|
|||
button = gtk_button_new();
|
||||
gtk_widget_set_can_focus (button, FALSE);
|
||||
gtk_table_attach(GTK_TABLE(table), button, 0, 1, 0, 1, GTK_FILL, GTK_FILL,
|
||||
0, 0);
|
||||
0, 0);
|
||||
gtk_widget_set_events(button,
|
||||
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
||||
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
||||
g_signal_connect(button, "button-press-event",
|
||||
G_CALLBACK(arrow_cb), NULL);
|
||||
G_CALLBACK(arrow_cb), NULL);
|
||||
gtk_widget_show(button);
|
||||
|
||||
arrow = gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_OUT);
|
||||
|
@ -481,8 +481,8 @@ make_preview (GimpDrawable *drawable)
|
|||
/* Create horizontal ruler */
|
||||
data->hruler = ruler = gimp_ruler_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
g_signal_connect_swapped(preview, "motion-notify-event",
|
||||
G_CALLBACK(GTK_WIDGET_GET_CLASS(ruler)->motion_notify_event),
|
||||
ruler);
|
||||
G_CALLBACK(GTK_WIDGET_GET_CLASS(ruler)->motion_notify_event),
|
||||
ruler);
|
||||
|
||||
gtk_table_attach(GTK_TABLE(table), ruler, 1, 2, 0, 1,
|
||||
GTK_EXPAND | GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
|
||||
|
@ -491,20 +491,20 @@ make_preview (GimpDrawable *drawable)
|
|||
/* Create vertical ruler */
|
||||
data->vruler = ruler = gimp_ruler_new (GTK_ORIENTATION_VERTICAL);
|
||||
g_signal_connect_swapped(preview, "motion-notify-event",
|
||||
G_CALLBACK(GTK_WIDGET_GET_CLASS(ruler)->motion_notify_event),
|
||||
ruler);
|
||||
G_CALLBACK(GTK_WIDGET_GET_CLASS(ruler)->motion_notify_event),
|
||||
ruler);
|
||||
gtk_table_attach(GTK_TABLE(table), ruler, 0, 1, 1, 2,
|
||||
GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show(ruler);
|
||||
|
||||
window = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(window),
|
||||
GTK_POLICY_NEVER, GTK_POLICY_NEVER);
|
||||
GTK_POLICY_NEVER, GTK_POLICY_NEVER);
|
||||
width = (data->width > 600) ? 600 : data->width;
|
||||
height = (data->height > 400) ? 400 : data->height;
|
||||
gtk_widget_set_size_request(window, width, height);
|
||||
gtk_table_attach(GTK_TABLE(table), window, 1, 2, 1, 2, GTK_FILL, GTK_FILL,
|
||||
0, 0);
|
||||
0, 0);
|
||||
gtk_widget_show(window);
|
||||
|
||||
hadj = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (window));
|
||||
|
@ -540,7 +540,7 @@ make_preview (GimpDrawable *drawable)
|
|||
gtk_widget_show (preview);
|
||||
|
||||
gimp_pixel_rgn_init(&data->src_rgn, drawable, 0, 0, data->width,
|
||||
data->height, FALSE, FALSE);
|
||||
data->height, FALSE, FALSE);
|
||||
render_preview(data, &data->src_rgn);
|
||||
|
||||
gtk_widget_show(table);
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
|
||||
typedef struct {
|
||||
GimpDrawable *drawable;
|
||||
GtkWidget *window;
|
||||
GtkWidget *preview;
|
||||
GtkWidget *hruler;
|
||||
GtkWidget *vruler;
|
||||
gint width;
|
||||
gint height;
|
||||
GtkWidget *window;
|
||||
GtkWidget *preview;
|
||||
GtkWidget *hruler;
|
||||
GtkWidget *vruler;
|
||||
gint width;
|
||||
gint height;
|
||||
gint widget_width;
|
||||
gint widget_height;
|
||||
GimpPixelRgn src_rgn;
|
||||
|
@ -53,6 +53,6 @@ gint preview_get_height(GtkWidget *preview);
|
|||
|
||||
void preview_zoom(Preview_t *preview, gint zoom_factor);
|
||||
GdkCursorType preview_set_cursor(Preview_t *preview,
|
||||
GdkCursorType cursor_type);
|
||||
GdkCursorType cursor_type);
|
||||
|
||||
#endif /* _IMAP_PREVIEW_H */
|
||||
|
|
|
@ -48,30 +48,30 @@ static void rectangle_draw_sashes(Object_t *obj, GdkWindow *window, GdkGC* gc);
|
|||
static MoveSashFunc_t rectangle_near_sash(Object_t *obj, gint x, gint y);
|
||||
static gboolean rectangle_point_is_on(Object_t *obj, gint x, gint y);
|
||||
static void rectangle_get_dimensions(Object_t *obj, gint *x, gint *y,
|
||||
gint *width, gint *height);
|
||||
gint *width, gint *height);
|
||||
static void rectangle_resize(Object_t *obj, gint percentage_x,
|
||||
gint percentage_y);
|
||||
gint percentage_y);
|
||||
static void rectangle_move(Object_t *obj, gint dx, gint dy);
|
||||
static gpointer rectangle_create_info_widget(GtkWidget *frame);
|
||||
static void rectangle_fill_info_tab(Object_t *obj, gpointer data);
|
||||
static void rectangle_set_initial_focus(Object_t *obj, gpointer data);
|
||||
static void rectangle_update(Object_t *obj, gpointer data);
|
||||
static void rectangle_write_csim(Object_t *obj, gpointer param,
|
||||
OutputFunc_t output);
|
||||
OutputFunc_t output);
|
||||
static void rectangle_write_cern(Object_t *obj, gpointer param,
|
||||
OutputFunc_t output);
|
||||
OutputFunc_t output);
|
||||
static void rectangle_write_ncsa(Object_t *obj, gpointer param,
|
||||
OutputFunc_t output);
|
||||
OutputFunc_t output);
|
||||
static const gchar* rectangle_get_stock_icon_name(void);
|
||||
|
||||
static ObjectClass_t rectangle_class = {
|
||||
N_("_Rectangle"),
|
||||
NULL, /* info_dialog */
|
||||
NULL, /* icon */
|
||||
NULL, /* mask */
|
||||
NULL, /* info_dialog */
|
||||
NULL, /* icon */
|
||||
NULL, /* mask */
|
||||
|
||||
rectangle_is_valid,
|
||||
NULL, /* rectangle_destruct */
|
||||
NULL, /* rectangle_destruct */
|
||||
rectangle_clone,
|
||||
rectangle_assign,
|
||||
rectangle_normalize,
|
||||
|
@ -83,7 +83,7 @@ static ObjectClass_t rectangle_class = {
|
|||
rectangle_resize,
|
||||
rectangle_move,
|
||||
rectangle_create_info_widget,
|
||||
rectangle_fill_info_tab, /* rectangle_update_info_widget */
|
||||
rectangle_fill_info_tab, /* rectangle_update_info_widget */
|
||||
rectangle_fill_info_tab,
|
||||
rectangle_set_initial_focus,
|
||||
rectangle_update,
|
||||
|
@ -107,7 +107,7 @@ create_rectangle(gint x, gint y, gint width, gint height)
|
|||
|
||||
static void
|
||||
draw_any_rectangle(GdkWindow *window, GdkGC *gc, gint x, gint y, gint w,
|
||||
gint h)
|
||||
gint h)
|
||||
{
|
||||
if (w < 0) {
|
||||
x += w;
|
||||
|
@ -170,7 +170,7 @@ rectangle_draw(Object_t *obj, GdkWindow *window, GdkGC *gc)
|
|||
{
|
||||
Rectangle_t *rectangle = ObjectToRectangle(obj);
|
||||
draw_any_rectangle(window, gc, rectangle->x, rectangle->y,
|
||||
rectangle->width, rectangle->height);
|
||||
rectangle->width, rectangle->height);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -182,12 +182,12 @@ rectangle_draw_sashes(Object_t *obj, GdkWindow *window, GdkGC *gc)
|
|||
draw_sash(window, gc, rectangle->x + rectangle->width, rectangle->y);
|
||||
draw_sash(window, gc, rectangle->x, rectangle->y + rectangle->height / 2);
|
||||
draw_sash(window, gc, rectangle->x + rectangle->width,
|
||||
rectangle->y + rectangle->height / 2);
|
||||
rectangle->y + rectangle->height / 2);
|
||||
draw_sash(window, gc, rectangle->x, rectangle->y + rectangle->height);
|
||||
draw_sash(window, gc, rectangle->x + rectangle->width / 2,
|
||||
rectangle->y + rectangle->height);
|
||||
rectangle->y + rectangle->height);
|
||||
draw_sash(window, gc, rectangle->x + rectangle->width,
|
||||
rectangle->y + rectangle->height);
|
||||
rectangle->y + rectangle->height);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -267,18 +267,18 @@ rectangle_near_sash(Object_t *obj, gint x, gint y)
|
|||
else if (near_sash(rectangle->x + rectangle->width, rectangle->y, x, y))
|
||||
return MoveUpperRightSash;
|
||||
else if (near_sash(rectangle->x, rectangle->y + rectangle->height / 2,
|
||||
x, y))
|
||||
x, y))
|
||||
return MoveLeftSash;
|
||||
else if (near_sash(rectangle->x + rectangle->width,
|
||||
rectangle->y + rectangle->height / 2, x, y))
|
||||
rectangle->y + rectangle->height / 2, x, y))
|
||||
return MoveRightSash;
|
||||
else if (near_sash(rectangle->x, rectangle->y + rectangle->height, x, y))
|
||||
return MoveLowerLeftSash;
|
||||
else if (near_sash(rectangle->x + rectangle->width / 2,
|
||||
rectangle->y + rectangle->height, x, y))
|
||||
rectangle->y + rectangle->height, x, y))
|
||||
return MoveLowerSash;
|
||||
else if (near_sash(rectangle->x + rectangle->width,
|
||||
rectangle->y + rectangle->height, x, y))
|
||||
rectangle->y + rectangle->height, x, y))
|
||||
return MoveLowerRightSash;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ rectangle_point_is_on(Object_t *obj, gint x, gint y)
|
|||
|
||||
static void
|
||||
rectangle_get_dimensions(Object_t *obj, gint *x, gint *y,
|
||||
gint *width, gint *height)
|
||||
gint *width, gint *height)
|
||||
{
|
||||
Rectangle_t *rectangle = ObjectToRectangle(obj);
|
||||
*x = rectangle->x;
|
||||
|
@ -387,30 +387,30 @@ rectangle_create_info_widget(GtkWidget *frame)
|
|||
|
||||
label = create_label_in_table(table, 0, 0, _("Upper left _x:"));
|
||||
props->x = create_spin_button_in_table(table, label, 0, 1, 1, 0,
|
||||
max_width - 1);
|
||||
max_width - 1);
|
||||
g_signal_connect(props->x, "value-changed",
|
||||
G_CALLBACK(x_changed_cb), (gpointer) props);
|
||||
G_CALLBACK(x_changed_cb), (gpointer) props);
|
||||
create_label_in_table(table, 0, 3, _("pixels"));
|
||||
|
||||
label = create_label_in_table(table, 1, 0, _("Upper left _y:"));
|
||||
props->y = create_spin_button_in_table(table, label, 1, 1, 1, 0,
|
||||
max_height - 1);
|
||||
max_height - 1);
|
||||
g_signal_connect(props->y, "value-changed",
|
||||
G_CALLBACK(y_changed_cb), (gpointer) props);
|
||||
G_CALLBACK(y_changed_cb), (gpointer) props);
|
||||
create_label_in_table(table, 1, 3, _("pixels"));
|
||||
|
||||
label = create_label_in_table(table, 2, 0, _("_Width:"));
|
||||
props->width = create_spin_button_in_table(table, label, 2, 1, 1, 1,
|
||||
max_width);
|
||||
max_width);
|
||||
g_signal_connect(props->width, "value-changed",
|
||||
G_CALLBACK(width_changed_cb), (gpointer) props);
|
||||
G_CALLBACK(width_changed_cb), (gpointer) props);
|
||||
create_label_in_table(table, 2, 3, _("pixels"));
|
||||
|
||||
label = create_label_in_table(table, 3, 0, _("_Height:"));
|
||||
props->height = create_spin_button_in_table(table, label, 3, 1, 1, 1,
|
||||
max_height);
|
||||
max_height);
|
||||
g_signal_connect(props->height, "value-changed",
|
||||
G_CALLBACK(height_changed_cb), (gpointer) props);
|
||||
G_CALLBACK(height_changed_cb), (gpointer) props);
|
||||
create_label_in_table(table, 3, 3, _("pixels"));
|
||||
|
||||
chain_button = gimp_chain_button_new(GIMP_CHAIN_RIGHT);
|
||||
|
@ -432,7 +432,7 @@ rectangle_fill_info_tab(Object_t *obj, gpointer data)
|
|||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(props->y), rectangle->y);
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(props->width), rectangle->width);
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(props->height),
|
||||
rectangle->height);
|
||||
rectangle->height);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -461,7 +461,7 @@ rectangle_write_csim(Object_t *obj, gpointer param, OutputFunc_t output)
|
|||
{
|
||||
Rectangle_t *rectangle = ObjectToRectangle(obj);
|
||||
output(param, "\"rect\" coords=\"%d,%d,%d,%d\"", rectangle->x, rectangle->y,
|
||||
rectangle->x + rectangle->width, rectangle->y + rectangle->height);
|
||||
rectangle->x + rectangle->width, rectangle->y + rectangle->height);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -469,7 +469,7 @@ rectangle_write_cern(Object_t *obj, gpointer param, OutputFunc_t output)
|
|||
{
|
||||
Rectangle_t *rectangle = ObjectToRectangle(obj);
|
||||
output(param, "rect (%d,%d) (%d,%d)", rectangle->x, rectangle->y,
|
||||
rectangle->x + rectangle->width, rectangle->y + rectangle->height);
|
||||
rectangle->x + rectangle->width, rectangle->y + rectangle->height);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -477,8 +477,8 @@ rectangle_write_ncsa(Object_t *obj, gpointer param, OutputFunc_t output)
|
|||
{
|
||||
Rectangle_t *rectangle = ObjectToRectangle(obj);
|
||||
output(param, "rect %s %d,%d %d,%d", obj->url,
|
||||
rectangle->x, rectangle->y,
|
||||
rectangle->x + rectangle->width, rectangle->y + rectangle->height);
|
||||
rectangle->x, rectangle->y,
|
||||
rectangle->x + rectangle->width, rectangle->y + rectangle->height);
|
||||
}
|
||||
|
||||
static const gchar*
|
||||
|
@ -518,18 +518,18 @@ rectangle_factory_set_xy(Object_t *obj, guint state, gint x, gint y)
|
|||
gint width = abs(rectangle->width);
|
||||
gint height = abs(rectangle->height);
|
||||
if (width < height)
|
||||
rectangle->height = (rectangle->height < 0) ? -width : width;
|
||||
rectangle->height = (rectangle->height < 0) ? -width : width;
|
||||
else
|
||||
rectangle->width = (rectangle->width < 0) ? -height : height;
|
||||
rectangle->width = (rectangle->width < 0) ? -height : height;
|
||||
}
|
||||
|
||||
main_set_dimension(rectangle->width, rectangle->height);
|
||||
}
|
||||
|
||||
static ObjectFactory_t rectangle_factory = {
|
||||
NULL, /* Object pointer */
|
||||
NULL, /* Object pointer */
|
||||
rectangle_factory_finish,
|
||||
NULL, /* Cancel func */
|
||||
NULL, /* Cancel func */
|
||||
rectangle_factory_create_object,
|
||||
rectangle_factory_set_xy
|
||||
};
|
||||
|
|
|
@ -90,17 +90,17 @@ button_press_cb(GtkWidget *widget, GdkEventButton *event, Selection_t *data)
|
|||
data->doubleclick = FALSE;
|
||||
|
||||
if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
|
||||
(gint) event->x, (gint) event->y,
|
||||
&path, NULL, NULL, NULL)) {
|
||||
GtkTreeIter iter;
|
||||
(gint) event->x, (gint) event->y,
|
||||
&path, NULL, NULL, NULL)) {
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (data->store), &iter,
|
||||
path)) {
|
||||
Object_t *obj;
|
||||
gtk_tree_model_get (GTK_TREE_MODEL(data->store), &iter, 0, &obj, -1);
|
||||
object_edit (obj, TRUE);
|
||||
}
|
||||
gtk_tree_path_free (path);
|
||||
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (data->store), &iter,
|
||||
path)) {
|
||||
Object_t *obj;
|
||||
gtk_tree_model_get (GTK_TREE_MODEL(data->store), &iter, 0, &obj, -1);
|
||||
object_edit (obj, TRUE);
|
||||
}
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
} else {
|
||||
data->doubleclick = TRUE;
|
||||
|
@ -123,7 +123,7 @@ selection_set_selected(Selection_t *selection, gint row)
|
|||
GtkTreeIter iter;
|
||||
|
||||
if (gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (selection->store), &iter,
|
||||
NULL, row)) {
|
||||
NULL, row)) {
|
||||
Object_t *obj;
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL(selection->store), &iter, 0, &obj, -1);
|
||||
|
@ -156,20 +156,20 @@ object_added_cb(Object_t *obj, gpointer data)
|
|||
|
||||
static gboolean
|
||||
selection_find_object(Selection_t *selection, Object_t *lookup,
|
||||
GtkTreeIter *iter)
|
||||
GtkTreeIter *iter)
|
||||
{
|
||||
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (selection->store),
|
||||
iter)) {
|
||||
iter)) {
|
||||
do {
|
||||
Object_t *obj;
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL(selection->store), iter, 0,
|
||||
&obj, -1);
|
||||
&obj, -1);
|
||||
if (obj == lookup)
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (selection->store),
|
||||
iter));
|
||||
iter));
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ object_updated_cb(Object_t *obj, gpointer data)
|
|||
|
||||
path = gtk_tree_model_get_path (GTK_TREE_MODEL (selection->store), &iter);
|
||||
gtk_tree_model_row_changed (GTK_TREE_MODEL (selection->store), path,
|
||||
&iter);
|
||||
&iter);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -231,7 +231,7 @@ selection_get_object (GtkTreeModel *tree_model, GtkTreeIter *iter)
|
|||
|
||||
static void
|
||||
handle_drop(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
|
||||
GtkSelectionData *data, guint info, guint time)
|
||||
GtkSelectionData *data, guint info, guint time)
|
||||
{
|
||||
gboolean success = FALSE;
|
||||
|
||||
|
@ -266,7 +266,7 @@ handle_drop(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
|
|||
|
||||
static void
|
||||
render_image (GtkTreeViewColumn *column, GtkCellRenderer *cell,
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
{
|
||||
Object_t *obj = selection_get_object (tree_model, iter);
|
||||
g_object_set(cell, "stock-id", object_get_stock_icon_name(obj), NULL);
|
||||
|
@ -274,7 +274,7 @@ render_image (GtkTreeViewColumn *column, GtkCellRenderer *cell,
|
|||
|
||||
static void
|
||||
render_nr (GtkTreeViewColumn *column, GtkCellRenderer *cell,
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
{
|
||||
Object_t *obj = selection_get_object (tree_model, iter);
|
||||
gchar *scratch;
|
||||
|
@ -286,7 +286,7 @@ render_nr (GtkTreeViewColumn *column, GtkCellRenderer *cell,
|
|||
|
||||
static void
|
||||
render_url (GtkTreeViewColumn *column, GtkCellRenderer *cell,
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
{
|
||||
Object_t *obj = selection_get_object (tree_model, iter);
|
||||
g_object_set (cell, "text", obj->url, NULL);
|
||||
|
@ -294,7 +294,7 @@ render_url (GtkTreeViewColumn *column, GtkCellRenderer *cell,
|
|||
|
||||
static void
|
||||
render_target (GtkTreeViewColumn *column, GtkCellRenderer *cell,
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
{
|
||||
Object_t *obj = selection_get_object (tree_model, iter);
|
||||
g_object_set (cell, "text", obj->target, NULL);
|
||||
|
@ -302,7 +302,7 @@ render_target (GtkTreeViewColumn *column, GtkCellRenderer *cell,
|
|||
|
||||
static void
|
||||
render_comment (GtkTreeViewColumn *column, GtkCellRenderer *cell,
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
|
||||
{
|
||||
Object_t *obj = selection_get_object (tree_model, iter);
|
||||
g_object_set (cell, "text", obj->comment, NULL);
|
||||
|
@ -348,10 +348,10 @@ make_selection(ObjectList_t *object_list)
|
|||
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes (N_("#"),
|
||||
renderer,
|
||||
NULL);
|
||||
renderer,
|
||||
NULL);
|
||||
gtk_tree_view_column_set_cell_data_func (column, renderer,
|
||||
render_nr, data, NULL);
|
||||
render_nr, data, NULL);
|
||||
gtk_tree_view_column_set_min_width (column, 16);
|
||||
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
|
||||
gtk_tree_view_column_set_alignment (column, 0.5);
|
||||
|
@ -363,12 +363,12 @@ make_selection(ObjectList_t *object_list)
|
|||
renderer = gtk_cell_renderer_pixbuf_new ();
|
||||
gtk_tree_view_column_pack_start(column, renderer, FALSE);
|
||||
gtk_tree_view_column_set_cell_data_func (column, renderer,
|
||||
render_image, data, NULL);
|
||||
render_image, data, NULL);
|
||||
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
gtk_tree_view_column_pack_start (column, renderer, TRUE);
|
||||
gtk_tree_view_column_set_cell_data_func (column, renderer, render_url, data,
|
||||
NULL);
|
||||
NULL);
|
||||
gtk_tree_view_column_set_min_width (column, 80);
|
||||
gtk_tree_view_column_set_resizable (column, TRUE);
|
||||
gtk_tree_view_column_set_alignment (column, 0.5);
|
||||
|
@ -377,9 +377,9 @@ make_selection(ObjectList_t *object_list)
|
|||
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes (_("ALT Text"), renderer,
|
||||
NULL);
|
||||
NULL);
|
||||
gtk_tree_view_column_set_cell_data_func (column, renderer, render_comment,
|
||||
data, NULL);
|
||||
data, NULL);
|
||||
gtk_tree_view_column_set_min_width (column, 64);
|
||||
gtk_tree_view_column_set_resizable (column, TRUE);
|
||||
gtk_tree_view_column_set_alignment (column, 0.5);
|
||||
|
@ -387,9 +387,9 @@ make_selection(ObjectList_t *object_list)
|
|||
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes (_("Target"), renderer,
|
||||
NULL);
|
||||
NULL);
|
||||
gtk_tree_view_column_set_cell_data_func (column, renderer,
|
||||
render_target, data, NULL);
|
||||
render_target, data, NULL);
|
||||
gtk_tree_view_column_set_min_width (column, 64);
|
||||
gtk_tree_view_column_set_resizable (column, TRUE);
|
||||
gtk_tree_view_column_set_alignment (column, 0.5);
|
||||
|
@ -407,15 +407,15 @@ make_selection(ObjectList_t *object_list)
|
|||
|
||||
/* Drop support */
|
||||
gtk_drag_dest_set (list, GTK_DEST_DEFAULT_ALL, target_table, 2,
|
||||
GDK_ACTION_COPY);
|
||||
GDK_ACTION_COPY);
|
||||
g_signal_connect (list, "drag-data-received", G_CALLBACK(handle_drop), NULL);
|
||||
|
||||
/* For handling doubleclick */
|
||||
|
||||
g_signal_connect (list, "button-press-event",
|
||||
G_CALLBACK(button_press_cb), data);
|
||||
G_CALLBACK(button_press_cb), data);
|
||||
g_signal_connect (list, "button-release-event",
|
||||
G_CALLBACK(button_release_cb), data);
|
||||
G_CALLBACK(button_release_cb), data);
|
||||
|
||||
/* Callbacks we are interested in */
|
||||
data->selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list));
|
||||
|
|
|
@ -27,18 +27,18 @@
|
|||
#include "imap_object.h"
|
||||
|
||||
typedef struct {
|
||||
GtkListStore *store;
|
||||
GtkTreeSelection *selection;
|
||||
GtkListStore *store;
|
||||
GtkTreeSelection *selection;
|
||||
|
||||
GtkWidget *container;
|
||||
GtkWidget *list;
|
||||
GtkWidget *selected_child;
|
||||
ObjectList_t *object_list;
|
||||
gint selected_row;
|
||||
gint nr_rows;
|
||||
gboolean is_visible;
|
||||
gboolean select_lock;
|
||||
gboolean doubleclick;
|
||||
gint selected_row;
|
||||
gint nr_rows;
|
||||
gboolean is_visible;
|
||||
gboolean select_lock;
|
||||
gboolean doubleclick;
|
||||
|
||||
CommandFactory_t cmd_move_up;
|
||||
CommandFactory_t cmd_move_down;
|
||||
|
@ -52,13 +52,13 @@ void selection_freeze(Selection_t *selection);
|
|||
void selection_thaw(Selection_t *selection);
|
||||
|
||||
#define selection_set_move_up_command(selection, command) \
|
||||
((selection)->cmd_move_up = (command))
|
||||
((selection)->cmd_move_up = (command))
|
||||
#define selection_set_move_down_command(selection, command) \
|
||||
((selection)->cmd_move_down = (command))
|
||||
((selection)->cmd_move_down = (command))
|
||||
#define selection_set_delete_command(selection, command) \
|
||||
((selection)->cmd_delete = (command))
|
||||
((selection)->cmd_delete = (command))
|
||||
#define selection_set_edit_command(selection, command) \
|
||||
((selection)->cmd_edit = (command))
|
||||
((selection)->cmd_edit = (command))
|
||||
|
||||
#endif /* _IMAP_SELECTION_H */
|
||||
|
||||
|
|
|
@ -37,13 +37,13 @@
|
|||
typedef struct {
|
||||
DefaultDialog_t *dialog;
|
||||
BrowseWidget_t *imagename;
|
||||
GtkWidget *filename;
|
||||
GtkWidget *title;
|
||||
GtkWidget *author;
|
||||
GtkWidget *default_url;
|
||||
GtkWidget *ncsa;
|
||||
GtkWidget *cern;
|
||||
GtkWidget *csim;
|
||||
GtkWidget *filename;
|
||||
GtkWidget *title;
|
||||
GtkWidget *author;
|
||||
GtkWidget *default_url;
|
||||
GtkWidget *ncsa;
|
||||
GtkWidget *cern;
|
||||
GtkWidget *csim;
|
||||
GtkTextBuffer *description;
|
||||
} SettingsDialog_t;
|
||||
|
||||
|
@ -62,10 +62,10 @@ settings_ok_cb(gpointer data)
|
|||
g_strreplace(&info->title, gtk_entry_get_text(GTK_ENTRY(param->title)));
|
||||
g_strreplace(&info->author, gtk_entry_get_text(GTK_ENTRY(param->author)));
|
||||
g_strreplace(&info->default_url,
|
||||
gtk_entry_get_text(GTK_ENTRY(param->default_url)));
|
||||
gtk_entry_get_text(GTK_ENTRY(param->default_url)));
|
||||
gtk_text_buffer_get_bounds(param->description, &start, &end);
|
||||
description = gtk_text_buffer_get_text(param->description, &start, &end,
|
||||
FALSE);
|
||||
FALSE);
|
||||
g_strreplace(&info->description, description);
|
||||
g_free(description);
|
||||
|
||||
|
@ -96,7 +96,7 @@ create_settings_dialog(void)
|
|||
create_label_in_table(table, 1, 0, _("Image name:"));
|
||||
data->imagename = browse_widget_new(_("Select Image File"));
|
||||
gtk_table_attach_defaults(GTK_TABLE(table), data->imagename->hbox, 1, 2,
|
||||
1, 2);
|
||||
1, 2);
|
||||
|
||||
label = create_label_in_table(table, 2, 0, _("_Title:"));
|
||||
data->title = create_entry_in_table(table, label, 2, 1);
|
||||
|
@ -116,13 +116,13 @@ create_settings_dialog(void)
|
|||
|
||||
swin = gtk_scrolled_window_new(NULL, NULL);
|
||||
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(swin),
|
||||
GTK_SHADOW_IN);
|
||||
GTK_SHADOW_IN);
|
||||
gtk_table_attach(GTK_TABLE(table), swin, 1, 2, 5, 8,
|
||||
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
||||
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
||||
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
|
||||
GTK_POLICY_NEVER,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
GTK_POLICY_NEVER,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_widget_show(swin);
|
||||
gtk_container_add(GTK_CONTAINER(swin), view);
|
||||
|
||||
|
@ -135,21 +135,21 @@ create_settings_dialog(void)
|
|||
|
||||
data->ncsa = gtk_radio_button_new_with_mnemonic_from_widget(NULL, "_NCSA");
|
||||
g_signal_connect(data->ncsa, "toggled",
|
||||
G_CALLBACK(type_toggled_cb), (gpointer) NCSA);
|
||||
G_CALLBACK(type_toggled_cb), (gpointer) NCSA);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), data->ncsa, FALSE, FALSE, 0);
|
||||
gtk_widget_show(data->ncsa);
|
||||
|
||||
data->cern = gtk_radio_button_new_with_mnemonic_from_widget(
|
||||
GTK_RADIO_BUTTON(data->ncsa), "C_ERN");
|
||||
g_signal_connect(data->cern, "toggled",
|
||||
G_CALLBACK(type_toggled_cb), (gpointer) CERN);
|
||||
G_CALLBACK(type_toggled_cb), (gpointer) CERN);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), data->cern, FALSE, FALSE, 0);
|
||||
gtk_widget_show(data->cern);
|
||||
|
||||
data->csim = gtk_radio_button_new_with_mnemonic_from_widget(
|
||||
GTK_RADIO_BUTTON(data->cern), "C_SIM");
|
||||
g_signal_connect(data->csim, "toggled",
|
||||
G_CALLBACK(type_toggled_cb), (gpointer) CSIM);
|
||||
G_CALLBACK(type_toggled_cb), (gpointer) CSIM);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), data->csim, FALSE, FALSE, 0);
|
||||
gtk_widget_show(data->csim);
|
||||
|
||||
|
|
|
@ -75,12 +75,12 @@ do_source_dialog(void)
|
|||
|
||||
swin = gtk_scrolled_window_new(NULL, NULL);
|
||||
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(swin),
|
||||
GTK_SHADOW_IN);
|
||||
GTK_SHADOW_IN);
|
||||
gtk_widget_set_size_request(swin, 400, 300);
|
||||
gtk_box_pack_start(GTK_BOX(dialog->vbox), swin, TRUE, TRUE, 0);
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_widget_show(swin);
|
||||
gtk_container_add(GTK_CONTAINER(swin), text);
|
||||
}
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
StatusBar_t*
|
||||
make_statusbar(GtkWidget *main_vbox, GtkWidget *window)
|
||||
{
|
||||
StatusBar_t *statusbar = g_new(StatusBar_t, 1);
|
||||
GtkWidget *hbox, *iconw;
|
||||
StatusBar_t *statusbar = g_new(StatusBar_t, 1);
|
||||
GtkWidget *hbox, *iconw;
|
||||
|
||||
hbox = gtk_hbox_new(FALSE, 1);
|
||||
gtk_box_pack_start(GTK_BOX(main_vbox), hbox, FALSE, FALSE, 0);
|
||||
|
@ -48,7 +48,7 @@ make_statusbar(GtkWidget *main_vbox, GtkWidget *window)
|
|||
|
||||
/* (x, y) coordinate */
|
||||
iconw = gtk_image_new_from_stock(IMAP_STOCK_COORD,
|
||||
GTK_ICON_SIZE_SMALL_TOOLBAR);
|
||||
GTK_ICON_SIZE_SMALL_TOOLBAR);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(hbox), iconw, FALSE, FALSE, 10);
|
||||
gtk_widget_show(iconw);
|
||||
|
@ -62,7 +62,7 @@ make_statusbar(GtkWidget *main_vbox, GtkWidget *window)
|
|||
|
||||
/* Dimension info */
|
||||
iconw = gtk_image_new_from_stock(IMAP_STOCK_DIMENSION,
|
||||
GTK_ICON_SIZE_SMALL_TOOLBAR);
|
||||
GTK_ICON_SIZE_SMALL_TOOLBAR);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), iconw, FALSE, FALSE, 10);
|
||||
gtk_widget_show(iconw);
|
||||
|
||||
|
@ -98,8 +98,8 @@ statusbar_set_status(StatusBar_t *statusbar, const gchar *format, ...)
|
|||
|
||||
statusbar_clear_status(statusbar);
|
||||
statusbar->message_id =
|
||||
gtk_statusbar_push(GTK_STATUSBAR(statusbar->status),
|
||||
statusbar->status_id, scratch);
|
||||
gtk_statusbar_push(GTK_STATUSBAR(statusbar->status),
|
||||
statusbar->status_id, scratch);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -107,8 +107,8 @@ statusbar_clear_status(StatusBar_t *statusbar)
|
|||
{
|
||||
if (statusbar->message_id)
|
||||
gtk_statusbar_remove(GTK_STATUSBAR(statusbar->status),
|
||||
statusbar->status_id,
|
||||
statusbar->message_id);
|
||||
statusbar->status_id,
|
||||
statusbar->message_id);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -147,5 +147,5 @@ statusbar_set_zoom(StatusBar_t *statusbar, gint factor)
|
|||
|
||||
sprintf(scratch, "1:%d", factor);
|
||||
gtk_statusbar_push(GTK_STATUSBAR(statusbar->zoom), statusbar->zoom_id,
|
||||
scratch);
|
||||
scratch);
|
||||
}
|
||||
|
|
|
@ -32,13 +32,13 @@ static GtkIconFactory *imap_icon_factory = NULL;
|
|||
|
||||
static GtkStockItem imap_stock_items[] =
|
||||
{
|
||||
{ IMAP_STOCK_CIRCLE, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_COORD, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_CIRCLE, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_COORD, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_DIMENSION, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_JAVA, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_POLYGON, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_RECTANGLE, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_TO_BACK, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_JAVA, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_POLYGON, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_RECTANGLE, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_TO_BACK, NULL, 0, 0, NULL },
|
||||
{ IMAP_STOCK_TO_FRONT, NULL, 0, 0, NULL }
|
||||
};
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ add_widget_to_table(GtkWidget *table, int row, int col, GtkWidget *w)
|
|||
|
||||
GtkWidget*
|
||||
create_spin_button_in_table(GtkWidget *table, GtkWidget *label,
|
||||
int row, int col, int value, int min, int max)
|
||||
int row, int col, int value, int min, int max)
|
||||
{
|
||||
GtkObject *adj = gtk_adjustment_new(value, min, max, 1, 1, 1);
|
||||
GtkWidget *button = gtk_spin_button_new(GTK_ADJUSTMENT(adj), 1, 0);
|
||||
|
@ -48,7 +48,7 @@ create_spin_button_in_table(GtkWidget *table, GtkWidget *label,
|
|||
|
||||
GtkWidget*
|
||||
create_check_button_in_table(GtkWidget *table, int row, int col,
|
||||
const char *text)
|
||||
const char *text)
|
||||
{
|
||||
GtkWidget *button = gtk_check_button_new_with_mnemonic(text);
|
||||
return add_widget_to_table(table, row, col, button);
|
||||
|
@ -56,7 +56,7 @@ create_check_button_in_table(GtkWidget *table, int row, int col,
|
|||
|
||||
GtkWidget*
|
||||
create_radio_button_in_table(GtkWidget *table, GSList *group,
|
||||
int row, int col, const char *text)
|
||||
int row, int col, const char *text)
|
||||
{
|
||||
GtkWidget *button = gtk_radio_button_new_with_mnemonic(group, text);
|
||||
return add_widget_to_table(table, row, col, button);
|
||||
|
|
|
@ -24,16 +24,16 @@
|
|||
#define _IMAP_TABLE_H
|
||||
|
||||
GtkWidget *create_spin_button_in_table(GtkWidget *table, GtkWidget *label,
|
||||
int row, int col,
|
||||
int value, int min, int max);
|
||||
int row, int col,
|
||||
int value, int min, int max);
|
||||
GtkWidget *create_check_button_in_table(GtkWidget *table, int row, int col,
|
||||
const char *text);
|
||||
const char *text);
|
||||
GtkWidget *create_radio_button_in_table(GtkWidget *table, GSList *group,
|
||||
int row, int col, const char *text);
|
||||
int row, int col, const char *text);
|
||||
GtkWidget *create_label_in_table(GtkWidget *table, int row, int col,
|
||||
const char *text);
|
||||
const char *text);
|
||||
GtkWidget *create_entry_in_table(GtkWidget *table, GtkWidget *label, int row,
|
||||
int col);
|
||||
int col);
|
||||
|
||||
#endif /* _IMAP_TABLE_H */
|
||||
|
||||
|
|
|
@ -109,8 +109,8 @@ taglist_set(TagList_t *tlist, const gchar *name, const gchar *value)
|
|||
for (p = tlist->list; p; p = p->next) {
|
||||
tag = (Tag_t*) p->data;
|
||||
if (!g_ascii_strcasecmp(tag->name, name)) {
|
||||
g_strreplace(&tag->value, value);
|
||||
return;
|
||||
g_strreplace(&tag->value, value);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* Tag not found, add a new tag */
|
||||
|
|
Loading…
Reference in New Issue