1998-07-11 06:33:31 +08:00
|
|
|
/* docindexif.c - Interface file for the docindex for gimp.
|
|
|
|
*
|
|
|
|
* Copyright (C) 1998 Chris Lahey.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
1998-07-11 04:35:57 +08:00
|
|
|
|
|
|
|
#include "docindex.h"
|
1998-07-11 06:33:31 +08:00
|
|
|
#include "docindexif.h"
|
1998-07-11 04:35:57 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
raise_if_match( gpointer data, gpointer user_data )
|
|
|
|
{
|
|
|
|
GimpImage *gimage = GIMP_IMAGE (data);
|
|
|
|
struct bool_char_pair *pair = (struct bool_char_pair *) user_data;
|
|
|
|
if ( ( ! pair->boole ) && gimage->has_filename)
|
|
|
|
if ( strcmp( pair->string, gimage->filename ) == 0 )
|
|
|
|
{
|
|
|
|
pair->boole = TRUE;
|
|
|
|
/* gdk_raise_window( NULL, gimage-> ); */ /* FIXME */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
open_or_raise( gchar *file_name )
|
|
|
|
{
|
|
|
|
struct bool_char_pair pair;
|
|
|
|
|
|
|
|
pair.boole = FALSE;
|
|
|
|
pair.string = file_name;
|
|
|
|
|
|
|
|
gimage_foreach( raise_if_match, &pair );
|
|
|
|
|
|
|
|
if ( ! pair.boole )
|
|
|
|
{
|
|
|
|
file_open( file_name, file_name );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
exit_from_go()
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void open_file_in_position( gchar *filename, gint position )
|
|
|
|
{
|
|
|
|
file_open( filename, filename );
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkMenuFactory *create_idea_menu()
|
|
|
|
{
|
1998-08-21 13:48:37 +08:00
|
|
|
return NULL;
|
1998-07-11 04:35:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *create_idea_toolbar()
|
|
|
|
{
|
|
|
|
GtkWidget *toolbar;
|
|
|
|
|
|
|
|
toolbar = gtk_toolbar_new( GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
|
|
|
|
gtk_widget_show( toolbar );
|
|
|
|
gtk_toolbar_set_button_relief( GTK_TOOLBAR( toolbar ), GTK_RELIEF_NONE );
|
|
|
|
|
|
|
|
gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ),
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
_("Open"), _("Open a file"), "Toolbar/Open",
|
1998-07-11 04:35:57 +08:00
|
|
|
NULL,
|
|
|
|
(GtkSignalFunc) file_open_callback, NULL);
|
|
|
|
|
|
|
|
gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ),
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
_("Up"), _("Move the selected entry up in the index"), "Toolbar/Up",
|
1998-07-11 04:35:57 +08:00
|
|
|
NULL,
|
|
|
|
(GtkSignalFunc) idea_up_callback, NULL);
|
|
|
|
|
|
|
|
gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ),
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
_("Down"), _("Move the selected entry down in the index"), "Toolbar/Down",
|
1998-07-11 04:35:57 +08:00
|
|
|
NULL,
|
|
|
|
(GtkSignalFunc) idea_down_callback, NULL );
|
|
|
|
|
|
|
|
gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ),
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
_("Remove"), _("Remove the selected entry from the index"), "Toolbar/Remove",
|
1998-07-11 04:35:57 +08:00
|
|
|
NULL,
|
|
|
|
(GtkSignalFunc) idea_remove_callback, NULL );
|
|
|
|
|
|
|
|
gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ),
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
_("Close"), _("Close the Document Index"), "Toolbar/Hide",
|
1998-07-11 04:35:57 +08:00
|
|
|
NULL,
|
|
|
|
(GtkSignalFunc) idea_hide_callback, NULL );
|
|
|
|
return toolbar;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *append2( gchar *string1, gboolean del1, gchar *string2, gboolean del2)
|
|
|
|
{
|
|
|
|
gchar *newstring = g_malloc( strlen( string1 ) + strlen( string2 ) + 1 );
|
|
|
|
sprintf( newstring, "%s%s", string1, string2 );
|
|
|
|
if ( del1 )
|
|
|
|
g_free( string1 );
|
|
|
|
if ( del2 )
|
|
|
|
g_free( string2 );
|
|
|
|
return newstring;
|
|
|
|
}
|
|
|
|
|
|
|
|
int getinteger( FILE *fp )
|
|
|
|
{
|
|
|
|
gchar nextchar;
|
|
|
|
int response = 0;
|
|
|
|
gboolean negative = FALSE;
|
|
|
|
|
|
|
|
while ( isspace( nextchar = fgetc( fp ) ) )
|
|
|
|
/* empty statement */ ;
|
|
|
|
|
|
|
|
if ( nextchar == '-' )
|
|
|
|
{
|
|
|
|
negative = TRUE;
|
|
|
|
while ( isspace( nextchar = fgetc( fp ) ) )
|
|
|
|
/* empty statement */ ;
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( ; '0' <= nextchar && '9' >= nextchar; nextchar = fgetc( fp ) )
|
|
|
|
{
|
|
|
|
response *= 10;
|
|
|
|
response += nextchar - '0';
|
|
|
|
}
|
|
|
|
for ( ; isspace( nextchar ); nextchar = fgetc( fp ) )
|
|
|
|
/* empty statement */ ;
|
|
|
|
ungetc( nextchar, fp );
|
|
|
|
if ( negative )
|
|
|
|
response = -response;
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
|
|
|
|
void clear_white( FILE *fp )
|
|
|
|
{
|
1998-09-09 09:35:35 +08:00
|
|
|
int nextchar;
|
1998-07-11 04:35:57 +08:00
|
|
|
|
|
|
|
while ( isspace( nextchar = fgetc( fp ) ) )
|
|
|
|
/* empty statement */ ;
|
1998-09-09 09:35:35 +08:00
|
|
|
if (nextchar != EOF)
|
|
|
|
ungetc( nextchar, fp );
|
1998-07-11 04:35:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* reset_usize
|
|
|
|
* A callback so that the window can be resized smaller. */
|
|
|
|
gint reset_usize( gpointer data )
|
|
|
|
{
|
|
|
|
gtk_widget_set_usize( GTK_WIDGET( data ), 0, 0 );
|
|
|
|
return FALSE;
|
|
|
|
}
|