Changeset 36
- Timestamp:
- 04/12/06 06:33:09 (2 years ago)
- Location:
- trunk
- Files:
-
- 7 modified
-
src/IMainView.h (modified) (1 diff)
-
src/MainPter.cxx (modified) (3 diffs)
-
src/gtk/MainView.cxx (modified) (13 diffs)
-
src/gtk/MainView.h (modified) (1 diff)
-
tests/DumbMainView.cxx (modified) (3 diffs)
-
tests/DumbMainView.h (modified) (3 diffs)
-
tests/MainPterTest.cxx (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/IMainView.h
r33 r36 38 38 virtual void sensitiveGoToPage (gboolean sensitive) = 0; 39 39 virtual void sensitiveGoToPreviousPage (gboolean sensitive) = 0; 40 virtual void sensitiveRotateLeft (gboolean sensitive) = 0; 41 virtual void sensitiveRotateRight (gboolean sensitive) = 0; 40 42 virtual void sensitiveZoomIn (gboolean sensitive) = 0; 41 43 virtual void sensitiveZoomOut (gboolean sensitive) = 0; -
trunk/src/MainPter.cxx
r35 r36 52 52 { 53 53 delete m_Document; 54 delete m_View; 54 55 delete m_DocumentPage; 55 delete m_View;56 56 } 57 57 … … 80 80 } 81 81 view.sensitiveGoToPage (TRUE); 82 view.sensitiveRotateRight (TRUE); 83 view.sensitiveRotateLeft (TRUE); 82 84 view.sensitiveZoomIn (TRUE); 83 85 view.sensitiveZoomOut (TRUE); … … 95 97 view.sensitiveGoToPage (FALSE); 96 98 view.sensitiveGoToPreviousPage (FALSE); 99 view.sensitiveRotateRight (FALSE); 100 view.sensitiveRotateLeft (FALSE); 97 101 view.sensitiveZoomIn (FALSE); 98 102 view.sensitiveZoomOut (FALSE); -
trunk/src/gtk/MainView.cxx
r35 r36 26 26 27 27 // Forward delarations. 28 static void main_window_go_to_first_page_cb (GtkWidget *, gpointer); 29 static void main_window_go_to_last_page_cb (GtkWidget *, gpointer); 30 static void main_window_go_to_next_page_cb (GtkWidget *, gpointer); 31 static void main_window_go_to_previous_page_cb (GtkWidget *, gpointer); 28 32 static void main_window_open_file_cb (GtkWidget *, gpointer); 29 33 static void main_window_quit_cb (GtkWidget *, gpointer); … … 60 64 MainView::~MainView () 61 65 { 66 g_object_unref (G_OBJECT (m_UIManager)); 62 67 } 63 68 … … 92 97 MainView::sensitiveGoToFirstPage (gboolean sensitive) 93 98 { 99 GtkAction *goToFirstPage = gtk_ui_manager_get_action (m_UIManager, 100 "/MenuBar/GoMenu/GoToFirstPage"); 101 gtk_action_set_sensitive (goToFirstPage, sensitive); 94 102 } 95 103 … … 97 105 MainView::sensitiveGoToLastPage (gboolean sensitive) 98 106 { 107 GtkAction *goToLastPage = 108 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/GoMenu/GoToLastPage"); 109 gtk_action_set_sensitive (goToLastPage, sensitive); 99 110 } 100 111 … … 102 113 MainView::sensitiveGoToNextPage (gboolean sensitive) 103 114 { 115 GtkAction *goToNextPage = 116 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/GoMenu/GoToNextPage"); 117 gtk_action_set_sensitive (goToNextPage, sensitive); 104 118 } 105 119 … … 112 126 MainView::sensitiveGoToPreviousPage (gboolean sensitive) 113 127 { 128 GtkAction *goToPreviousPage = gtk_ui_manager_get_action (m_UIManager, 129 "/MenuBar/GoMenu/GoToPreviousPage"); 130 gtk_action_set_sensitive (goToPreviousPage, sensitive); 131 } 132 133 void 134 MainView::sensitiveRotateLeft (gboolean sensitive) 135 { 136 GtkAction *rotateLeft = 137 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/ViewMenu/RotateLeft"); 138 gtk_action_set_sensitive (rotateLeft, sensitive); 139 } 140 141 void 142 MainView::sensitiveRotateRight (gboolean sensitive) 143 { 144 GtkAction *rotateRight = gtk_ui_manager_get_action (m_UIManager, 145 "/MenuBar/ViewMenu/RotateRight"); 146 gtk_action_set_sensitive (rotateRight, sensitive); 114 147 } 115 148 … … 117 150 MainView::sensitiveZoomIn (gboolean sensitive) 118 151 { 152 GtkAction *zoomIn = 153 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/ViewMenu/ZoomIn"); 154 gtk_action_set_sensitive (zoomIn, sensitive); 119 155 } 120 156 … … 122 158 MainView::sensitiveZoomOut (gboolean sensitive) 123 159 { 160 GtkAction *zoomOut = 161 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/ViewMenu/ZoomOut"); 162 gtk_action_set_sensitive (zoomOut, sensitive); 124 163 } 125 164 … … 127 166 MainView::sensitiveZoomFit (gboolean sensitive) 128 167 { 168 GtkAction *zoomFit = 169 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/ViewMenu/ZoomFit"); 170 gtk_action_set_sensitive (zoomFit, sensitive); 129 171 } 130 172 … … 132 174 MainView::sensitiveZoomWidth (gboolean sensitive) 133 175 { 176 GtkAction *zoomWidth = 177 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/ViewMenu/ZoomWidth"); 178 gtk_action_set_sensitive (zoomWidth, sensitive); 134 179 } 135 180 … … 226 271 { "RotateRight", GTK_STOCK_REDO, _("Rotate _Right"), NULL, NULL, NULL}, 227 272 { "RotateLeft", GTK_STOCK_UNDO, _("Rotate Left"), NULL, NULL, NULL}, 228 { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, _("_First Page"), "Home", NULL, NULL},229 { "GoToNextPage", GTK_STOCK_GO_FORWARD, _("_Next Page"), "Page_Down", NULL, NULL},230 { "GoToPreviousPage", GTK_STOCK_GO_BACK, _("_Previous Page"), "Page_Up", NULL, NULL},231 { "GoToLastPage", GTK_STOCK_GOTO_LAST, _("_Last Page"), "End", NULL, NULL},273 { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, _("_First Page"), "Home", NULL, G_CALLBACK (main_window_go_to_first_page_cb) }, 274 { "GoToNextPage", GTK_STOCK_GO_FORWARD, _("_Next Page"), "Page_Down", NULL, G_CALLBACK (main_window_go_to_next_page_cb) }, 275 { "GoToPreviousPage", GTK_STOCK_GO_BACK, _("_Previous Page"), "Page_Up", NULL, G_CALLBACK (main_window_go_to_previous_page_cb) }, 276 { "GoToLastPage", GTK_STOCK_GOTO_LAST, _("_Last Page"), "End", NULL, G_CALLBACK (main_window_go_to_last_page_cb) }, 232 277 { "About", GTK_STOCK_ABOUT, "_About", NULL, NULL, NULL } 233 278 }; … … 237 282 " <menubar name='MenuBar'>" 238 283 " <menu action='FileMenu'>" 239 " <menuitem action='OpenFile'/>"284 " <menuitem name='OpenFile' action='OpenFile'/>" 240 285 " <separator/>" 241 " <menuitem action='Quit'/>"286 " <menuitem name='Quit' action='Quit'/>" 242 287 " </menu>" 243 288 " <menu action='ViewMenu'>" 244 " <menuitem action='ZoomIn'/>"245 " <menuitem action='ZoomOut'/>"246 " <menuitem action='ZoomFit'/>"247 " <menuitem action='ZoomWidth'/>"289 " <menuitem name='ZoomIn' action='ZoomIn'/>" 290 " <menuitem name='ZoomOut' action='ZoomOut'/>" 291 " <menuitem name='ZoomFit' action='ZoomFit'/>" 292 " <menuitem name='ZoomWidth' action='ZoomWidth'/>" 248 293 " <separator />" 249 " <menuitem action='RotateRight'/>"250 " <menuitem action='RotateLeft'/>"294 " <menuitem name='RotateRight' action='RotateRight'/>" 295 " <menuitem name='RotateLeft' action='RotateLeft'/>" 251 296 " </menu>" 252 297 " <menu action='GoMenu'>" 253 " <menuitem action='GoToFirstPage'/>"254 " <menuitem action='GoToPreviousPage'/>"255 " <menuitem action='GoToNextPage'/>"256 " <menuitem action='GoToLastPage'/>"298 " <menuitem name='GoToFirstPage' action='GoToFirstPage'/>" 299 " <menuitem name='GoToPreviousPage' action='GoToPreviousPage'/>" 300 " <menuitem name='GoToNextPage' action='GoToNextPage'/>" 301 " <menuitem name='GoToLastPage' action='GoToLastPage'/>" 257 302 " </menu>" 258 303 " <menu action='HelpMenu'>" 259 " <menuitem action='About'/>"304 " <menuitem name='About' action='About'/>" 260 305 " </menu>" 261 306 " </menubar>" 262 307 " <toolbar name='ToolBar'>" 263 " <toolitem action='OpenFile'/>"308 " <toolitem name='OpenFile' action='OpenFile'/>" 264 309 " <separator/>" 265 " <toolitem action='GoToPreviousPage'/>"266 " <toolitem action='GoToNextPage'/>"310 " <toolitem name='GoToPreviousPage' action='GoToPreviousPage'/>" 311 " <toolitem name='GoToNextPage' action='GoToNextPage'/>" 267 312 " <separator/>" 268 313 " <separator/>" 269 " <toolitem action='ZoomIn'/>"270 " <toolitem action='ZoomOut'/>"271 " <toolitem action='ZoomFit'/>"272 " <toolitem action='ZoomWidth'/>"314 " <toolitem name='ZoomIn' action='ZoomIn'/>" 315 " <toolitem name='ZoomOut' action='ZoomOut'/>" 316 " <toolitem name='ZoomFit' action='ZoomFit'/>" 317 " <toolitem name='ZoomWidth' action='ZoomWidth'/>" 273 318 " </toolbar>" 274 319 "</ui>"; … … 305 350 //////////////////////////////////////////////////////////////// 306 351 352 void 353 main_window_go_to_first_page_cb (GtkWidget *, gpointer) 354 { 355 } 356 357 void 358 main_window_go_to_last_page_cb (GtkWidget *, gpointer) 359 { 360 } 361 362 void 363 main_window_go_to_next_page_cb (GtkWidget *, gpointer) 364 { 365 } 366 367 void 368 main_window_go_to_previous_page_cb (GtkWidget *, gpointer) 369 { 370 } 371 307 372 /// 308 373 /// @brief The user tries to open a file. -
trunk/src/gtk/MainView.h
r35 r36 39 39 void sensitiveGoToPage (gboolean sensitive); 40 40 void sensitiveGoToPreviousPage (gboolean sensitive); 41 void sensitiveRotateLeft (gboolean sensitive); 42 void sensitiveRotateRight (gboolean sensitive); 41 43 void sensitiveZoomIn (gboolean sensitive); 42 44 void sensitiveZoomOut (gboolean sensitive); -
trunk/tests/DumbMainView.cxx
r31 r36 38 38 m_SensitiveGoToPage = TRUE; 39 39 m_SensitiveGoToPreviousPage = TRUE; 40 m_SensitiveRotateLeft = TRUE; 41 m_SensitiveRotateRight = TRUE; 40 42 m_SensitiveZoomIn = TRUE; 41 43 m_SensitiveZoomOut = TRUE; … … 100 102 } 101 103 104 void 105 DumbMainView::sensitiveRotateLeft (gboolean sensitive) 106 { 107 m_SensitiveRotateLeft = sensitive; 108 } 109 110 void 111 DumbMainView::sensitiveRotateRight (gboolean sensitive) 112 { 113 m_SensitiveRotateRight = sensitive; 114 } 115 102 116 void 103 117 DumbMainView::sensitiveZoomIn (gboolean sensitive) … … 248 262 { 249 263 return m_SensitiveGoToPreviousPage; 264 } 265 266 gboolean 267 DumbMainView::isSensitiveRotateLeft () 268 { 269 return m_SensitiveRotateLeft; 270 } 271 272 gboolean 273 DumbMainView::isSensitiveRotateRight () 274 { 275 return m_SensitiveRotateRight; 250 276 } 251 277 -
trunk/tests/DumbMainView.h
r31 r36 35 35 void sensitiveGoToPage (gboolean sensitive); 36 36 void sensitiveGoToPreviousPage (gboolean sensitive); 37 void sensitiveRotateLeft (gboolean sensitive); 38 void sensitiveRotateRight (gboolean sensitive); 37 39 void sensitiveZoomIn (gboolean sensitive); 38 40 void sensitiveZoomOut (gboolean sensitive); … … 60 62 gboolean isSensitiveGoToPage (void); 61 63 gboolean isSensitiveGoToPreviousPage (void); 64 gboolean isSensitiveRotateLeft (void); 65 gboolean isSensitiveRotateRight (void); 62 66 gboolean isSensitiveZoomIn (void); 63 67 gboolean isSensitiveZoomOut (void); … … 79 83 gboolean m_SensitiveGoToPage; 80 84 gboolean m_SensitiveGoToPreviousPage; 85 gboolean m_SensitiveRotateLeft; 86 gboolean m_SensitiveRotateRight; 81 87 gboolean m_SensitiveZoomIn; 82 88 gboolean m_SensitiveZoomOut; -
trunk/tests/MainPterTest.cxx
r31 r36 68 68 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPage ()); 69 69 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 70 CPPUNIT_ASSERT (!m_View->isSensitiveRotateLeft ()); 71 CPPUNIT_ASSERT (!m_View->isSensitiveRotateRight ()); 70 72 CPPUNIT_ASSERT (!m_View->isSensitiveZoomIn ()); 71 73 CPPUNIT_ASSERT (!m_View->isSensitiveZoomOut ()); … … 95 97 CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 96 98 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 99 CPPUNIT_ASSERT (m_View->isSensitiveRotateLeft ()); 100 CPPUNIT_ASSERT (m_View->isSensitiveRotateRight ()); 97 101 CPPUNIT_ASSERT (m_View->isSensitiveZoomIn ()); 98 102 CPPUNIT_ASSERT (m_View->isSensitiveZoomOut ()); … … 111 115 CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 112 116 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 117 CPPUNIT_ASSERT (m_View->isSensitiveRotateLeft ()); 118 CPPUNIT_ASSERT (m_View->isSensitiveRotateRight ()); 113 119 CPPUNIT_ASSERT (m_View->isSensitiveZoomIn ()); 114 120 CPPUNIT_ASSERT (m_View->isSensitiveZoomOut ()); … … 136 142 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPage ()); 137 143 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 144 CPPUNIT_ASSERT (!m_View->isSensitiveRotateLeft ()); 145 CPPUNIT_ASSERT (!m_View->isSensitiveRotateRight ()); 138 146 CPPUNIT_ASSERT (!m_View->isSensitiveZoomIn ()); 139 147 CPPUNIT_ASSERT (!m_View->isSensitiveZoomOut ()); … … 164 172 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPage ()); 165 173 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 174 CPPUNIT_ASSERT (!m_View->isSensitiveRotateLeft ()); 175 CPPUNIT_ASSERT (!m_View->isSensitiveRotateRight ()); 166 176 CPPUNIT_ASSERT (!m_View->isSensitiveZoomIn ()); 167 177 CPPUNIT_ASSERT (!m_View->isSensitiveZoomOut ()); … … 194 204 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPage ()); 195 205 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 206 CPPUNIT_ASSERT (!m_View->isSensitiveRotateLeft ()); 207 CPPUNIT_ASSERT (!m_View->isSensitiveRotateRight ()); 196 208 CPPUNIT_ASSERT (!m_View->isSensitiveZoomIn ()); 197 209 CPPUNIT_ASSERT (!m_View->isSensitiveZoomOut ()); … … 224 236 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPage ()); 225 237 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 238 CPPUNIT_ASSERT (!m_View->isSensitiveRotateLeft ()); 239 CPPUNIT_ASSERT (!m_View->isSensitiveRotateRight ()); 226 240 CPPUNIT_ASSERT (!m_View->isSensitiveZoomIn ()); 227 241 CPPUNIT_ASSERT (!m_View->isSensitiveZoomOut ()); … … 254 268 CPPUNIT_ASSERT (m_View->isSensitiveGoToPage ()); 255 269 CPPUNIT_ASSERT (!m_View->isSensitiveGoToPreviousPage ()); 270 CPPUNIT_ASSERT (m_View->isSensitiveRotateLeft ()); 271 CPPUNIT_ASSERT (m_View->isSensitiveRotateRight ()); 256 272 CPPUNIT_ASSERT (m_View->isSensitiveZoomIn ()); 257 273 CPPUNIT_ASSERT (m_View->isSensitiveZoomOut ());
