gtk_main_win.h
上传用户:psq1974
上传日期:2007-01-06
资源大小:1195k
文件大小:2k
源码类别:

mpeg/mp3

开发平台:

C/C++

  1. /* Copyright (C) 1998, 1999 State University of New York at Stony Brook
  2.    Author: Andrew V. Shuvalov ( andrew@ecsl.cs.sunysb.edu )
  3.    Software license is located in file "COPYING"
  4. */
  5. #ifndef _gtk_main_win_h_
  6. #define _gtk_main_win_h_
  7. #include <string>
  8. #include <vector>
  9. #include <map>
  10. #include "movie_item.h"
  11. #include "session.h"
  12. /** 
  13.  */
  14. class MainWindow : public Gtk_Window {
  15.   /** reference to Session */
  16.   Session &session;
  17.   /** top menu */
  18.   Gtk_MenuBar *menuBar;
  19.   /** some entries are added on the fly */
  20.   Gtk_Menu    *editMenu;
  21.   /** bottom status bar */
  22.   Gtk_Statusbar *statusBar;
  23.   guint statusBarContextId;
  24.   /** log events */
  25.   Gtk_Text    *logText;
  26.   /** toggle if the log test follows the last line */
  27.   Gtk_ToggleButton *toggleLogAuto;
  28.   Gtk_Label   *dbNameLabel;
  29.   /** list of all movies in current database */
  30.   Gtk_CList *movieList;
  31.   static const int movieListColumns = 3;
  32.   int movieListCurrentlySelectedMovie;
  33.   /** right - pane items: movie name */
  34.   Gtk_Text *dbMovieName;
  35.   Gtk_Text *comments;
  36.   /** start */
  37.   Gtk_Label *dbStartTime;
  38.   /** duration */
  39.   Gtk_Label *dbDuration;
  40.   /** edit text to change database name */
  41.   Gtk_Entry *dbNameText;
  42.   /** pixmap to construct small bullets at the left of movie list window */
  43.   Gtk_Pixmap *textLoadedPixmap;
  44.   Gtk_Pixmap *textNotLoadedPixmap;
  45.   //  Gdk_Bitmap *textLoadedBitmap;
  46.   //  Gdk_Bitmap *textNotLoadedBitmap;
  47.   
  48. public:
  49.   typedef const map< int, MovieItem > CMapOfMoviesT;
  50. public:
  51.   MainWindow( Session &s );
  52.   ~MainWindow();
  53.   // overload virtual
  54.   gint delete_event_impl( GdkEventAny * );
  55.   
  56.   ///@name callbacks
  57.   //@{
  58.   void callback_exit();
  59.   void callback_movie_select_row( gint row, gint col, GdkEvent *button );
  60.   /** to process only double-click */
  61.   gint callback_movie_button_press( GdkEventButton *event );
  62.   void callback_preferences();
  63.   void callback_dbname();
  64.   //@}
  65.   /** transfer data from session */
  66.   void display_database_name( string &dbname );
  67.   /** display the "superuser" on status bar */
  68.   void show_superuser_status( bool status );
  69.   /** update menu */
  70.   void status_changed_to_superuser( bool status );
  71.   /** display */
  72.   void update_movie_list( CMapOfMoviesT &movies );
  73.   void update_pixmap( int row );
  74.   void update_pixmap_by_id( int id );
  75.   // other functions
  76.   void display_message( const string &msg );
  77.   void display_messagenl( const string &msg );
  78.   void display_messages( const vector< string > &msgs );
  79. };
  80. #endif //  _gtk_main_win_h_