StartupId::StartupId( QWidget* parent, const char* name ) : QWidget( parent ), startup_info( KStartupInfo::CleanOnCantDetect ), startup_window( None ), blinking( true ), bouncing( false ), selection_watcher( new KSelectionWatcher( "_KDE_STARTUP_FEEDBACK", -1, this )) { setObjectName( QLatin1String( name ) ); hide(); // is QWidget only because of x11Event() if( kde_startup_status == StartupPre ) { kde_splash_progress = XInternAtom( QX11Info::display(), "_KDE_SPLASH_PROGRESS", False ); XWindowAttributes attrs; XGetWindowAttributes( QX11Info::display(), QX11Info::appRootWindow(), &attrs); XSelectInput( QX11Info::display(), QX11Info::appRootWindow(), attrs.your_event_mask | SubstructureNotifyMask); kapp->installX11EventFilter( this ); } update_timer.setSingleShot( true ); connect( &update_timer, SIGNAL(timeout()), SLOT(update_startupid())); connect( &startup_info, SIGNAL(gotNewStartup(KStartupInfoId,KStartupInfoData)), SLOT(gotNewStartup(KStartupInfoId,KStartupInfoData))); connect( &startup_info, SIGNAL(gotStartupChange(KStartupInfoId,KStartupInfoData)), SLOT(gotStartupChange(KStartupInfoId,KStartupInfoData))); connect( &startup_info, SIGNAL(gotRemoveStartup(KStartupInfoId,KStartupInfoData)), SLOT(gotRemoveStartup(KStartupInfoId))); connect( selection_watcher, SIGNAL(newOwner(Window)), SLOT(newOwner())); connect( selection_watcher, SIGNAL(lostOwner()), SLOT(lostOwner())); active_selection = ( selection_watcher->owner() != None ); }
KDETrayProxy::KDETrayProxy() : selection(makeSelectionAtom()) { connect(&selection, SIGNAL(newOwner(Window)), SLOT(newOwner(Window))); connect(&module, SIGNAL(windowAdded(WId)), SLOT(windowAdded(WId))); selection.owner(); for(QValueList< WId >::ConstIterator it = module.windows().begin(); it != module.windows().end(); ++it) windowAdded(*it); kapp->installX11EventFilter(this); // XSelectInput( StructureNotifyMask ) on windows is done by KWinModule // kdDebug() << "Init done" << endl; }
void KMenuBar::setTopLevelMenuInternal(bool top_level) { if(d->forcedTopLevel) top_level = true; d->wasTopLevel = top_level; if(parentWidget() && parentWidget()->topLevelWidget()->isFullScreen()) top_level = false; if(isTopLevelMenu() == top_level) return; d->topLevel = top_level; if(isTopLevelMenu()) { #ifdef Q_WS_X11 d->selection = new KSelectionWatcher(KMenuBarPrivate::makeSelectionAtom(), DefaultScreen(qt_xdisplay())); connect(d->selection, SIGNAL(newOwner(Window)), this, SLOT(updateFallbackSize())); connect(d->selection, SIGNAL(lostOwner()), this, SLOT(updateFallbackSize())); #endif d->frameStyle = frameStyle(); d->lineWidth = lineWidth(); d->margin = margin(); d->fallback_mode = false; bool wasShown = !isHidden(); reparent(parentWidget(), WType_TopLevel | WStyle_Tool | WStyle_Customize | WStyle_NoBorder, QPoint(0, 0), false); #ifdef Q_WS_X11 KWin::setType(winId(), NET::TopMenu); if(parentWidget()) XSetTransientForHint(qt_xdisplay(), winId(), parentWidget()->topLevelWidget()->winId()); #endif QMenuBar::setFrameStyle(NoFrame); QMenuBar::setLineWidth(0); QMenuBar::setMargin(0); updateFallbackSize(); d->min_size = QSize(0, 0); if(parentWidget() && !parentWidget()->isTopLevel()) setShown(parentWidget()->isVisible()); else if(wasShown) show(); } else { #ifdef Q_WS_X11 delete d->selection; d->selection = NULL; #endif setBackgroundMode(PaletteButton); setFrameStyle(d->frameStyle); setLineWidth(d->lineWidth); setMargin(d->margin); setMinimumSize(0, 0); setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); updateMenuBarSize(); if(parentWidget()) reparent(parentWidget(), QPoint(0, 0), !isHidden()); } }
int main( int argc, char ** argv ) { //Declarations IplImage * template_img; IplImage * plate_img; int numContours; plateInfo * plate_info; charInfo * char_info; char** plate_number; char pNumber[7]; int i; if( argc < 5 ) exit (0); else { char *state = findState(argv); //Load template image template_img = cvLoadImage( argv[1], CV_LOAD_IMAGE_GRAYSCALE); //Load original license image plate_img = cvLoadImage( argv[2], CV_LOAD_IMAGE_COLOR ); plate_info = processPlateChars( plate_img ); char_info = processTemplateChars( template_img, &numContours ); plate_number = compareChar( char_info, plate_info, &numContours ); //Mkay, this should do it.. //Print that bad boy! printf("\nPlate number: "); for(i = 1; i < 8; i++) { printf("%s", plate_number[i]); strcpy((pNumber + (i-1)), plate_number[i]); } printf("\n"); // char * number = pNumber[6]; printf("%s", pNumber); Owner owner; owner = newOwner(state, pNumber); WriteToXML(owner); return EXIT_SUCCESS; } }