More work - Federico

This commit is contained in:
Arturo Espinosa 1999-09-15 07:21:31 +00:00
parent 7b495112aa
commit ceffd956d5
8 changed files with 117 additions and 31 deletions

18
.cvsignore Normal file
View file

@ -0,0 +1,18 @@
aclocal.m4
intl
ABOUT-NLS
config.guess
config.sub
ltconfig
ltmain.sh
config.h.in
stamp-h.in
Makefile.in
configure
config.log
config.h
config.cache
libtool
config.status
stamp-h
Makefile

16
README
View file

@ -1,17 +1,17 @@
Eye of Gnome: an image viewer
-----------------------------
=============================
Perfect vision soup:
- 1 cauldron of raven broth
- 2 vampire's ears
- 2 vampire ears
- 4 legs of tarantula
- 1 eye of gnome
Description
-----------
===========
This is the Eye of Gnome, an image viewer program. It is meant to be
@ -20,34 +20,34 @@ program.
Requirements
------------
============
This package requires the basic gnome-libs package and the gdk-pixbuf
library.
Availability
------------
============
The latest version of this package is available from the GNOME CVS
repository at cvs.gnome.org or the FTP site at ftp.gnome.org.
Reporting bugs
--------------
==============
Please use the GNOME bug tracking system to report bugs. You can
reach it at http://bugs.gnome.org.
License
-------
=======
This program is released under the terms of the GNU General Public
License. Please see the file COPYING for details.
Author
------
======
Federico Mena-Quintero (federico@gimp.org)

9
po/.cvsignore Normal file
View file

@ -0,0 +1,9 @@
*.gmo
*.mo
Makefile
Makefile.in
Makefile.in.in
POTFILES
cat-id-tbl.c
eog.pot
stamp-cat-id

4
src/.cvsignore Normal file
View file

@ -0,0 +1,4 @@
Makefile.in
Makefile
.deps
eog

View file

@ -1,4 +1,8 @@
1999-09-15 Federico Mena Quintero <federico@redhat.com>
* window.c (about_cmd): Finished the about box.
(window_construct): Added a constructor. Create the menus.
(window_new): New function.
* Started the ChangeLog.

View file

@ -4,6 +4,7 @@
#include "image.h"
#include "image-item.h"
#include "gtkscrollframe.h"
#include "window.h"
static GnomeCanvas *canvas;
@ -101,6 +102,11 @@ main (int argc, char **argv)
NULL, 0, &ctx);
gdk_rgb_init ();
window = window_new ();
gtk_widget_show_all (window);
#if 0
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
vbox = gtk_vbox_new (FALSE, 0);
@ -165,6 +171,7 @@ main (int argc, char **argv)
gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
gtk_widget_show_all (window);
#endif
gtk_main ();
return 0;

View file

@ -46,20 +46,25 @@ open_cmd (GtkWidget *widget, gpointer data)
static void
close_cmd (GtkWidget *widget, gpointer data)
{
Window *window;
window = WINDOW (data);
/* FIXME */
gtk_widget_destroy (GTK_WIDGET (window));
}
/* File/Exit callback */
static void
exit_cmd (GtkWidget *widget, gpointer data)
{
/* FIXME */
}
Window *window;
static void
meept (GtkWidget *widget, gpointer data)
{
fprintf (stderr, "meept!\n");
window = WINDOW (data);
/* FIXME */
gtk_main_quit ();
}
/* Help/About callback */
@ -73,21 +78,22 @@ about_cmd (GtkWidget *widget, gpointer data)
};
if (!about) {
about = gnome_about_new (_("Retina"),
VERSION,
_("Copyright (C) 1999 The Free Software Foundation"),
authors,
_("The GNOME image viewer and cataloging program"),
NULL);
about = gnome_about_new (
_("Eye of Gnome"),
VERSION,
_("Copyright (C) 1999 The Free Software Foundation"),
authors,
_("The GNOME image viewer and image cataloging program"),
NULL);
gtk_signal_connect (GTK_OBJECT (about), "destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
&about);
gtk_signal_connect (GTK_OBJECT (about), "destroy",
GTK_SIGNAL_FUNC (meept),
&about);
}
gtk_widget_show (about);
gtk_widget_show_now (about);
g_assert (GTK_WIDGET_REALIZED (about));
gdk_window_show (about->window);
gtk_widget_grab_focus (about);
}
@ -95,11 +101,15 @@ about_cmd (GtkWidget *widget, gpointer data)
/* Main menu */
static GnomeUIInfo file_menu[] = {
GNOMEUIINFO_ITEM_STOCK (N_("_Open Image..."),
N_("Open an image file"),
open_cmd, GNOME_STOCK_MENU_OPEN),
{ GNOME_APP_UI_ITEM, N_("_Open Image..."), N_("Open an image file"),
open_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN,
'o', GDK_CONTROL_MASK, NULL },
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_MENU_CLOSE_ITEM (close_cmd, NULL),
{ GNOME_APP_UI_ITEM, N_("_Close This Window"), N_("Close the current window"),
close_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CLOSE,
'w', GDK_CONTROL_MASK, NULL },
GNOMEUIINFO_MENU_EXIT_ITEM (exit_cmd, NULL),
GNOMEUIINFO_END
};
@ -174,9 +184,6 @@ window_init (Window *window)
priv = g_new0 (WindowPrivate, 1);
window->priv = priv;
#if 0
gnome_app_create_menus_with_data (
#endif
}
/* Destroy handler for windows */
@ -209,3 +216,38 @@ window_delete (GtkWidget *widget, GdkEventAny *event)
/* FIXME */
return FALSE;
}
/**
* window_new:
* @void:
*
* Creates a new main window in the WINDOW_MODE_NONE mode.
*
* Return value: A newly-created main window.
**/
GtkWidget *
window_new (void)
{
GtkWidget *window;
window = gtk_type_new (TYPE_WINDOW);
window_construct (WINDOW (window));
return window;
}
/**
* window_construct:
* @window: A window widget.
*
* Constructs the window widget.
**/
void
window_construct (Window *window)
{
g_return_if_fail (window != NULL);
g_return_if_fail (IS_WINDOW (window));
gnome_app_construct (GNOME_APP (window), "eog", _("Eye of Gnome"));
gnome_app_create_menus_with_data (GNOME_APP (window), main_menu, window);
}

View file

@ -32,6 +32,8 @@ struct _WindowClass {
GtkType window_get_type (void);
GtkWidget *window_new (void);
void window_construct (Window *window);