Changeset 253

Show
Ignore:
Timestamp:
10/16/06 14:49:05 (2 years ago)
Author:
jordi
Message:

Applied Enrico Tröger's patch for full screen support. This closes ticket #33.

Location:
trunk
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/THANKS

    r252 r253  
    22contributions: 
    33 
     4    - Enrico Tröger <enrico.troeger@uvena.de>, for his full screen patch. 
    45    - Igor Vagulin <igor_vagulin@mail.ru>, for his Russian translation. 
    56    - LoneFox <>, for his patches. 
  • trunk/src/IMainView.h

    r227 r253  
    356356 
    357357            /// 
     358            /// @brief Sets the view to full screen. 
     359            /// 
     360            /// @param fullScreen @a TRUE if the view should go full screen, 
     361            ///                   @a FALSE otherwise. 
     362            /// 
     363            virtual void setFullScreen (gboolean fullScreen) = 0; 
     364 
     365            /// 
    358366            /// @brief Sets the text for the number of pages. 
    359367            /// 
  • trunk/src/MainPter.cxx

    r252 r253  
    329329 
    330330/// 
     331/// @brief The "Full Screen" action was activated. 
     332/// 
     333/// @param show TRUE if Full Screen is active, FALSE otherwise. 
     334/// 
     335void 
     336MainPter::fullScreenActivated (gboolean active) 
     337{ 
     338    getView ().setFullScreen (active); 
     339} 
     340 
     341/// 
    331342/// @brief The "Go To First Page" action was activated. 
    332343/// 
  • trunk/src/MainPter.h

    r245 r253  
    4848            void aboutBoxLinkActivated (const gchar *link); 
    4949            void findActivated (void); 
     50            void fullScreenActivated (gboolean active); 
    5051            void goToFirstPageActivated (void); 
    5152            void goToLastPageActivated (void); 
  • trunk/src/gtk/MainView.cxx

    r251 r253  
    5353                                            gpointer); 
    5454static void main_window_find_cb (GtkWidget *, gpointer); 
     55static void main_window_fullscreen_cb (GtkToggleAction *, gpointer); 
    5556static gboolean main_window_moved_or_resized_cb (GtkWidget *, 
    5657                                                 GdkEventConfigure *, gpointer); 
     
    8283 
    8384// The actions for menus and toolbars. 
    84 static const GtkActionEntry g_NormalEntries[] =  
     85static const GtkActionEntry g_NormalEntries[] = 
    8586{ 
    8687    { "FileMenu", NULL, N_("_File"), NULL, NULL, NULL }, 
     
    163164static GtkToggleActionEntry g_ToggleEntries[] = 
    164165{ 
     166    { "FullScreen", NULL, N_("F_ull screen"), NULL, 
     167      N_("Toggle full screen window"), 
     168      G_CALLBACK (main_window_fullscreen_cb), FALSE }, 
     169 
    165170    { "ShowToolBar", NULL, N_("Show _Toolbar"), NULL, 
    166171      N_("Show or hide the toolbar"), 
    167172      G_CALLBACK (main_window_show_toolbar_cb), TRUE }, 
     173 
    168174    { "ShowStatusBar", NULL, N_("Show _Statusbar"), NULL, 
    169175      N_("Show or hide the statusbar"), 
    170176      G_CALLBACK (main_window_show_statusbar_cb), TRUE }, 
     177 
    171178    { "ShowIndex", NULL, N_("Show I_ndex"), "F9", 
    172179      N_("Show or hide the document's outline"), 
     
    568575                                 config.getWindowHeight ()); 
    569576    gtk_widget_show (m_MainWindow); 
    570     gtk_window_move (GTK_WINDOW (m_MainWindow),  
     577    gtk_window_move (GTK_WINDOW (m_MainWindow), 
    571578                     config.getWindowX (), config.getWindowY ()); 
    572579} 
     
    598605        gtk_widget_hide (m_Sidebar); 
    599606    } 
    600     GtkAction *showIndex =  
    601         gtk_ui_manager_get_action (m_UIManager,  
     607    GtkAction *showIndex = 
     608        gtk_ui_manager_get_action (m_UIManager, 
    602609                                   "/MenuBar/ViewMenu/ShowIndex"); 
    603610    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (showIndex), show); 
     
    629636    } 
    630637    gdk_flush (); 
     638} 
     639 
     640void 
     641MainView::setFullScreen (gboolean fullScreen) 
     642{ 
     643    if ( fullScreen ) 
     644    { 
     645        gtk_window_fullscreen (GTK_WINDOW (m_MainWindow)); 
     646    } 
     647    else 
     648    { 
     649        gtk_window_unfullscreen (GTK_WINDOW (m_MainWindow)); 
     650    } 
    631651} 
    632652 
     
    10591079 
    10601080/// 
     1081/// @brief The user tried to switch to full screen. 
     1082/// 
     1083void 
     1084main_window_fullscreen_cb (GtkToggleAction *action, gpointer data) 
     1085{ 
     1086    g_assert ( NULL != data && "The data parameter is NULL."); 
     1087 
     1088    MainPter *pter = (MainPter *)data; 
     1089    pter->fullScreenActivated (gtk_toggle_action_get_active (action)); 
     1090} 
     1091 
     1092/// 
    10611093/// @brief Called when the window is moved or resized. 
    10621094/// 
  • trunk/src/gtk/MainView.h

    r227 r253  
    6262            void showIndex (gboolean show); 
    6363            void setCursor (ViewCursor cursorType); 
     64            void setFullScreen (gboolean fullScreen); 
    6465            void setNumberOfPagesText (const gchar *text); 
    6566            void setGoToPageText (const gchar *text); 
  • trunk/tests/DumbMainView.cxx

    r227 r253  
    267267 
    268268void 
     269DumbMainView::setFullScreen (gboolean fullScreen) 
     270{ 
     271} 
     272 
     273void 
    269274DumbMainView::setNumberOfPagesText (const gchar *text) 
    270275{ 
  • trunk/tests/DumbMainView.h

    r227 r253  
    6363            const gchar *getGoToPageText (void); 
    6464            void setCursor (ViewCursor cursorType); 
     65            void setFullScreen (gboolean fullScreen); 
    6566            void setNumberOfPagesText (const gchar *text); 
    6667            void setGoToPageText (const gchar *text);