From: <pa...@us...> - 2003-10-04 22:25:51
|
Update of /cvsroot/fuse-emulator/fuse/ui/gtk In directory sc8-pr-cvs1:/tmp/cvs-serv16496/ui/gtk Modified Files: Makefile.am gtkui.c Added Files: gtkinternals.h statusbar.c Log Message: Add very simple statusbar showing tape motor status. --- NEW FILE: gtkinternals.h --- /* gtkinternals.h: stuff internal to the GTK+ UI Copyright (c) 2003 Philip Kendall $Id: gtkinternals.h,v 1.1 2003/10/04 22:25:46 pak21 Exp $ 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 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Author contact information: E-mail: pak...@sr... Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England */ #ifndef FUSE_GTKINTERNALS_H #define FUSE_GTKINTERNALS_H #include <gtk/gtk.h> /* Is the tape running? */ extern GtkWidget *gtkstatusbar_tape; #endif /* #ifndef FUSE_GTKINTERNALS_H */ --- NEW FILE: statusbar.c --- /* statusbar.c: routines for updating the status bar Copyright (c) 2003 Philip Kendall, Russell Marks $Id: statusbar.c,v 1.1 2003/10/04 22:25:46 pak21 Exp $ 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 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Author contact information: E-mail: pak...@sr... Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England */ #include <config.h> #ifdef UI_GTK /* Use this file iff we're using GTK+ */ #include <gtk/gtk.h> #include "gtkinternals.h" /* Is the tape running? */ GtkWidget *gtkstatusbar_tape = NULL; int ui_statusbar_tape( int running ) { gtk_label_set( GTK_LABEL( gtkstatusbar_tape ), running ? "Tape: 1" : "Tape: 0" ); return 0; } #endif /* #ifdef UI_GTK */ Index: Makefile.am =================================================================== RCS file: /cvsroot/fuse-emulator/fuse/ui/gtk/Makefile.am,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Makefile.am 18 Jun 2003 12:51:10 -0000 1.15 --- Makefile.am 4 Oct 2003 22:25:46 -0000 1.16 *************** *** 1,4 **** ## Process this file with automake to produce Makefile.in ! ## Copyright (c) 2001-2002 Philip Kendall ## $Id$ --- 1,4 ---- ## Process this file with automake to produce Makefile.in ! ## Copyright (c) 2001-2003 Philip Kendall ## $Id$ *************** *** 38,42 **** gtkui.c \ options.c keysyms.c picture.c \ ! roms.c BUILT_SOURCES = keysyms.c options.c options.h --- 38,43 ---- gtkui.c \ options.c keysyms.c picture.c \ ! roms.c \ ! statusbar.c BUILT_SOURCES = keysyms.c options.c options.h *************** *** 52,54 **** noinst_HEADERS = gtkdisplay.h \ ! gtkkeyboard.h gtkui.h options.h options.pl options-header.pl --- 53,60 ---- noinst_HEADERS = gtkdisplay.h \ ! gtkkeyboard.h \ ! gtkinternals.h \ ! gtkui.h \ ! options.h \ ! options.pl \ ! options-header.pl Index: gtkui.c =================================================================== RCS file: /cvsroot/fuse-emulator/fuse/ui/gtk/gtkui.c,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** gtkui.c 18 Jun 2003 12:51:10 -0000 1.100 --- gtkui.c 4 Oct 2003 22:25:46 -0000 1.101 *************** *** 1,4 **** /* gtkui.c: GTK+ routines for dealing with the user interface ! Copyright (c) 2000-2002 Philip Kendall, Russell Marks $Id$ --- 1,4 ---- /* gtkui.c: GTK+ routines for dealing with the user interface ! Copyright (c) 2000-2003 Philip Kendall, Russell Marks $Id$ *************** *** 47,50 **** --- 47,51 ---- #include "gtkdisplay.h" #include "gtkkeyboard.h" + #include "gtkinternals.h" #include "gtkui.h" #include "machine.h" *************** *** 241,245 **** ui_init( int *argc, char ***argv ) { ! GtkWidget *box,*menu_bar; GtkAccelGroup *accel_group; GdkGeometry geometry; --- 242,246 ---- ui_init( int *argc, char ***argv ) { ! GtkWidget *box, *menu_bar, *status_bar; GtkAccelGroup *accel_group; GdkGeometry geometry; *************** *** 294,297 **** --- 295,304 ---- gtk_box_pack_start( GTK_BOX(box), gtkui_drawing_area, FALSE, FALSE, 0 ); + + status_bar = gtk_hbox_new( FALSE, 3 ); + gtk_box_pack_start_defaults( GTK_BOX( box ), status_bar ); + + gtkstatusbar_tape = gtk_label_new( "Tape: 0" ); + gtk_box_pack_start_defaults( GTK_BOX( status_bar ), gtkstatusbar_tape ); hints = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE | |