Esempio n. 1
0
/*!
  Destructs the application.  Does not close the Xt toolkit.
*/
KXtApplication::~KXtApplication()
{
    Q_ASSERT(qxtapp==this);
    removeXtEventFilters();
    qxtapp = 0;

    // the manpage says: "or just exit", that's what we do to avoid
    // double closing of the display
//     if (my_xt) {
//      XtDestroyApplicationContext(appcon);
//      }
}
Esempio n. 2
0
/*
** NPP_Shutdown is called when your DLL is being unloaded to do any
** DLL-specific shut-down. You should be a good citizen and declare that
** you're not using your java class any more. This allows java to unload
** it, freeing up memory.
*/
extern "C" void
NPP_Shutdown(void)
{
    if (qNP) {
	if (plugin_java_class)
	    qNP->unuseJavaClass();
	delete qNP;
	qNP = 0;
    }

    if (piApp) {
#ifdef _WS_X11_
	qt_np_remove_timeoutcb(np_do_timers);
	qt_np_remove_timer_setter(np_set_timer);
	qt_np_remove_event_proc(np_event_proc);
	qt_np_count--;

	if (qt_np_leave_cb == PluginSDK_QApplication::removeXtEventFiltersIfOutsideQNPWidget)
	    qt_np_leave_cb = 0;
	if ( qt_np_count == 0) {
	    // We are the last Qt-based plugin to leave
	    removeXtEventFilters(Safe);
	    removeXtEventFilters(Dangerous);
	    if (qt_np_timerid) XtRemoveTimeOut( qt_np_timerid );
	    qt_np_timerid = 0;
	    qt_np_leave_cb = 0;
	}
	delete piApp;
#endif
	piApp = 0;

	// delete qApp; ### Crashes under X11.  Waste memory until we can fix this.
#ifdef _WS_WIN_
	delete qApp;
#endif
    }
}
Esempio n. 3
0
// Called when a top-level widget (which has an Xt widget's window) is left.
static
void leave_event_handler(Widget, XtPointer, XEvent*, Boolean* cont)
{
    if (piApp) {
	if ( !QApplication::activePopupWidget()
	  && !QApplication::activeModalWidget() )
	{
	    if ( focussedWidget ) {
		focussedWidget->leaveInstance();
		focussedWidget = 0;
	    }
	    removeXtEventFilters(Dangerous);
	}
    }
    *cont = FALSE;
}