- /* Copyright (C) 1998, 1999 State University of New York at Stony Brook
- Author: Andrew V. Shuvalov ( andrew@ecsl.cs.sunysb.edu )
- Software license is located in file "COPYING"
- */
- #ifndef _gtk_main_win_h_
- #define _gtk_main_win_h_
- #include <string>
- #include <vector>
- #include <map>
- #include "movie_item.h"
- #include "session.h"
- /**
- */
- class MainWindow : public Gtk_Window {
- /** reference to Session */
- Session &session;
- /** top menu */
- Gtk_MenuBar *menuBar;
- /** some entries are added on the fly */
- Gtk_Menu *editMenu;
- /** bottom status bar */
- Gtk_Statusbar *statusBar;
- guint statusBarContextId;
- /** log events */
- Gtk_Text *logText;
- /** toggle if the log test follows the last line */
- Gtk_ToggleButton *toggleLogAuto;
- Gtk_Label *dbNameLabel;
- /** list of all movies in current database */
- Gtk_CList *movieList;
- static const int movieListColumns = 3;
- int movieListCurrentlySelectedMovie;
- /** right - pane items: movie name */
- Gtk_Text *dbMovieName;
- Gtk_Text *comments;
- /** start */
- Gtk_Label *dbStartTime;
- /** duration */
- Gtk_Label *dbDuration;
- /** edit text to change database name */
- Gtk_Entry *dbNameText;
- /** pixmap to construct small bullets at the left of movie list window */
- Gtk_Pixmap *textLoadedPixmap;
- Gtk_Pixmap *textNotLoadedPixmap;
- // Gdk_Bitmap *textLoadedBitmap;
- // Gdk_Bitmap *textNotLoadedBitmap;
- public:
- typedef const map< int, MovieItem > CMapOfMoviesT;
- public:
- MainWindow( Session &s );
- ~MainWindow();
- // overload virtual
- gint delete_event_impl( GdkEventAny * );
- ///@name callbacks
- //@{
- void callback_exit();
- void callback_movie_select_row( gint row, gint col, GdkEvent *button );
- /** to process only double-click */
- gint callback_movie_button_press( GdkEventButton *event );
- void callback_preferences();
- void callback_dbname();
- //@}
- /** transfer data from session */
- void display_database_name( string &dbname );
- /** display the "superuser" on status bar */
- void show_superuser_status( bool status );
- /** update menu */
- void status_changed_to_superuser( bool status );
- /** display */
- void update_movie_list( CMapOfMoviesT &movies );
- void update_pixmap( int row );
- void update_pixmap_by_id( int id );
- // other functions
- void display_message( const string &msg );
- void display_messagenl( const string &msg );
- void display_messages( const vector< string > &msgs );
- };
- #endif // _gtk_main_win_h_