summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b28c4e3)
raw | patch | inline | side by side (parent: b28c4e3)
author | joelholdsworth <joelholdsworth@users.sourceforge.net> | |
Sat, 28 Jul 2007 20:08:47 +0000 (20:08 +0000) | ||
committer | joelholdsworth <joelholdsworth@users.sourceforge.net> | |
Sat, 28 Jul 2007 20:08:47 +0000 (20:08 +0000) |
src/desktop.cpp | patch | blob | history | |
src/desktop.h | patch | blob | history | |
src/interface.cpp | patch | blob | history | |
src/verbs.cpp | patch | blob | history |
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 4cfc279ccc6933c3b1acd0adc66f17985111be69..e785aab6dcd7a4b0e48cf1bfbc3e6f03cf5961fa 100644 (file)
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
_widget->setTransient (p, transient_policy);
}
-void SPDesktop::getToplevel( Gtk::Widget*& toplevel )
+Gtk::Window*
+SPDesktop::getToplevel( )
{
- toplevel = (Gtk::Widget*)_widget->getWindow();
+ return _widget->getWindow();
}
void
diff --git a/src/desktop.h b/src/desktop.h
index 3bf6fa65a99e5f6ee373fd1c520b2f3c50cdc3c7..ca2d2420465f919ac7ab474cc5c637b96eb76adc 100644 (file)
--- a/src/desktop.h
+++ b/src/desktop.h
namespace Gtk
{
- class Widget;
+ class Window;
}
typedef int sp_verb_t;
void setWindowPosition (NR::Point p);
void setWindowSize (gint w, gint h);
void setWindowTransient (void* p, int transient_policy=1);
- void getToplevel( Gtk::Widget*& toplevel );
+ Gtk::Window* getToplevel();
void presentWindow();
bool warnDialog (gchar *text);
void toggleRulers();
diff --git a/src/interface.cpp b/src/interface.cpp
index eada69c34ffdd5bb59f1162c036b68dd70f470cf..a041f5cf582ce91a2ddf4480be158f7df0a4e308 100644 (file)
--- a/src/interface.cpp
+++ b/src/interface.cpp
bool return_value = FALSE;
if (Inkscape::IO::file_test(filename, G_FILE_TEST_EXISTS)) {
- Gtk::Widget* ancestor = NULL;
- SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- if ( desktop ) {
- desktop->getToplevel( ancestor );
- }
- Gtk::Window *window = ancestor->is_toplevel() ?
- dynamic_cast<Gtk::Window*>( ancestor ) : 0;
+ Gtk::Window *window = SP_ACTIVE_DESKTOP->getToplevel();
gchar* baseName = g_path_get_basename( filename );
gchar* dirName = g_path_get_dirname( filename );
GtkWidget* dialog = gtk_message_dialog_new_with_markup( window->gobj(),
diff --git a/src/verbs.cpp b/src/verbs.cpp
index a81157ab87cb979b257f16ece7fae78e8df87e15..41d6fcdcc8e787762c61d105afa5ef90456e3a57 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
#endif
SPDesktop *desktop = dynamic_cast<SPDesktop*>(sp_action_get_view(action));
- Gtk::Window *parent = NULL;
- if(desktop == NULL) return;
- desktop->getToplevel((Gtk::Widget*&)parent);
- if(parent == NULL) return;
+ g_assert(desktop != NULL);
+ Gtk::Window *parent = desktop->getToplevel();
+ g_assert(parent != NULL);
switch ((long) data) {
case SP_VERB_FILE_NEW: